1"use strict"; 2(self["webpackChunkessentials_app"] = self["webpackChunkessentials_app"] || []).push([["vendor.angular.other"],{ 3 4/***/ 345: 5/*!******************************************************************************!*\ 6 !*** ./node_modules/@angular/platform-browser/fesm2022/platform-browser.mjs ***! 7 \******************************************************************************/ 8/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { 9 10__webpack_require__.r(__webpack_exports__); 11/* harmony export */ __webpack_require__.d(__webpack_exports__, { 12/* harmony export */ BrowserModule: () => (/* reexport safe */ _browser_D_u_fknz_mjs__WEBPACK_IMPORTED_MODULE_1__.BrowserModule), 13/* harmony export */ By: () => (/* binding */ By), 14/* harmony export */ DomSanitizer: () => (/* binding */ DomSanitizer), 15/* harmony export */ EVENT_MANAGER_PLUGINS: () => (/* reexport safe */ _dom_renderer_DGKzginR_mjs__WEBPACK_IMPORTED_MODULE_3__.EVENT_MANAGER_PLUGINS), 16/* harmony export */ EventManager: () => (/* reexport safe */ _dom_renderer_DGKzginR_mjs__WEBPACK_IMPORTED_MODULE_3__.EventManager), 17/* harmony export */ EventManagerPlugin: () => (/* reexport safe */ _dom_renderer_DGKzginR_mjs__WEBPACK_IMPORTED_MODULE_3__.EventManagerPlugin), 18/* harmony export */ HAMMER_GESTURE_CONFIG: () => (/* binding */ HAMMER_GESTURE_CONFIG), 19/* harmony export */ HAMMER_LOADER: () => (/* binding */ HAMMER_LOADER), 20/* harmony export */ HammerGestureConfig: () => (/* binding */ HammerGestureConfig), 21/* harmony export */ HammerModule: () => (/* binding */ HammerModule), 22/* harmony export */ HydrationFeatureKind: () => (/* binding */ HydrationFeatureKind), 23/* harmony export */ Meta: () => (/* binding */ Meta), 24/* harmony export */ REMOVE_STYLES_ON_COMPONENT_DESTROY: () => (/* reexport safe */ _dom_renderer_DGKzginR_mjs__WEBPACK_IMPORTED_MODULE_3__.REMOVE_STYLES_ON_COMPONENT_DESTROY), 25/* harmony export */ Title: () => (/* binding */ Title), 26/* harmony export */ VERSION: () => (/* binding */ VERSION), 27/* harmony export */ bootstrapApplication: () => (/* reexport safe */ _browser_D_u_fknz_mjs__WEBPACK_IMPORTED_MODULE_1__.bootstrapApplication), 28/* harmony export */ createApplication: () => (/* reexport safe */ _browser_D_u_fknz_mjs__WEBPACK_IMPORTED_MODULE_1__.createApplication), 29/* harmony export */ disableDebugTools: () => (/* binding */ disableDebugTools), 30/* harmony export */ enableDebugTools: () => (/* binding */ enableDebugTools), 31/* harmony export */ platformBrowser: () => (/* reexport safe */ _browser_D_u_fknz_mjs__WEBPACK_IMPORTED_MODULE_1__.platformBrowser), 32/* harmony export */ provideClientHydration: () => (/* binding */ provideClientHydration), 33/* harmony export */ provideProtractorTestingSupport: () => (/* reexport safe */ _browser_D_u_fknz_mjs__WEBPACK_IMPORTED_MODULE_1__.provideProtractorTestingSupport), 34/* harmony export */ withEventReplay: () => (/* binding */ withEventReplay), 35/* harmony export */ withHttpTransferCacheOptions: () => (/* binding */ withHttpTransferCacheOptions), 36/* harmony export */ withI18nSupport: () => (/* binding */ withI18nSupport), 37/* harmony export */ withIncrementalHydration: () => (/* binding */ withIncrementalHydration), 38/* harmony export */ withNoHttpTransferCache: () => (/* binding */ withNoHttpTransferCache), 39/* harmony export */ "ɵBrowserDomAdapter": () => (/* reexport safe */ _browser_D_u_fknz_mjs__WEBPACK_IMPORTED_MODULE_1__.BrowserDomAdapter), 40/* harmony export */ "ɵBrowserGetTestability": () => (/* reexport safe */ _browser_D_u_fknz_mjs__WEBPACK_IMPORTED_MODULE_1__.BrowserGetTestability), 41/* harmony export */ "ɵDomEventsPlugin": () => (/* reexport safe */ _browser_D_u_fknz_mjs__WEBPACK_IMPORTED_MODULE_1__.DomEventsPlugin), 42/* harmony export */ "ɵDomRendererFactory2": () => (/* reexport safe */ _dom_renderer_DGKzginR_mjs__WEBPACK_IMPORTED_MODULE_3__.DomRendererFactory2), 43/* harmony export */ "ɵDomSanitizerImpl": () => (/* binding */ DomSanitizerImpl), 44/* harmony export */ "ɵHammerGesturesPlugin": () => (/* binding */ HammerGesturesPlugin), 45/* harmony export */ "ɵKeyEventsPlugin": () => (/* reexport safe */ _browser_D_u_fknz_mjs__WEBPACK_IMPORTED_MODULE_1__.KeyEventsPlugin), 46/* harmony export */ "ɵSharedStylesHost": () => (/* reexport safe */ _dom_renderer_DGKzginR_mjs__WEBPACK_IMPORTED_MODULE_3__.SharedStylesHost),
47/* harmony export */ "ɵgetDOM": () => (/* reexport safe */ _angular_common__WEBPACK_IMPORTED_MODULE_2__.getDOM) 48/* harmony export */ }); 49/* harmony import */ var C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/defineProperty.js */ 64467); 50/* harmony import */ var _browser_D_u_fknz_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./browser-D-u-fknz.mjs */ 45932); 51/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/common */ 96048); 52/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/common */ 59361); 53/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/core */ 17705); 54/* harmony import */ var _dom_renderer_DGKzginR_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./dom_renderer-DGKzginR.mjs */ 63142); 55/* harmony import */ var _angular_common_http__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @angular/common/http */ 21626); 56 57/** 58 * @license Angular v19.2.14 59 * (c) 2010-2025 Google LLC. https://angular.io/ 60 * License: MIT 61 */ 62 63 64 65 66 67 68 69 70 71 72/** 73 * A service for managing HTML `<meta>` tags. 74 * 75 * Properties of the `MetaDefinition` object match the attributes of the 76 * HTML `<meta>` tag. These tags define document metadata that is important for 77 * things like configuring a Content Security Policy, defining browser compatibility 78 * and security settings, setting HTTP Headers, defining rich content for social sharing, 79 * and Search Engine Optimization (SEO). 80 * 81 * To identify specific `<meta>` tags in a document, use an attribute selection 82 * string in the format `"tag_attribute='value string'"`. 83 * For example, an `attrSelector` value of `"name='description'"` matches a tag 84 * whose `name` attribute has the value `"description"`. 85 * Selectors are used with the `querySelector()` Document method, 86 * in the format `meta[{attrSelector}]`. 87 * 88 * @see [HTML meta tag](https://developer.mozilla.org/docs/Web/HTML/Element/meta) 89 * @see [Document.querySelector()](https://developer.mozilla.org/docs/Web/API/Document/querySelector) 90 * 91 * 92 * @publicApi 93 */ 94let Meta = /*#__PURE__*/(() => { 95 var _Meta; 96 class Meta { 97 constructor(_doc) { 98 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_doc", void 0); 99 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_dom", void 0); 100 this._doc = _doc; 101 this._dom = (0,_angular_common__WEBPACK_IMPORTED_MODULE_2__.getDOM)(); 102 } 103 /** 104 * Retrieves or creates a specific `<meta>` tag element in the current HTML document. 105 * In searching for an existing tag, Angular attempts to match the `name` or `property` attribute 106 * values in the provided tag definition, and verifies that all other attribute values are equal. 107 * If an existing element is found, it is returned and is not modified in any way. 108 * @param tag The definition of a `<meta>` element to match or create. 109 * @param forceCreation True to create a new element without checking whether one already exists. 110 * @returns The existing element with the same attributes and values if found, 111 * the new element if no match is found, or `null` if the tag parameter is not defined. 112 */ 113 addTag(tag, forceCreation = false) { 114 if (!tag) return null; 115 return this._getOrCreateElement(tag, forceCreation); 116 } 117 /** 118 * Retrieves or creates a set of `<meta>` tag elements in the current HTML document. 119 * In searching for an existing tag, Angular attempts to match the `name` or `property` attribute 120 * values in the provided tag definition, and verifies that all other attribute values are equal. 121 * @param tags An array of tag definitions to match or create. 122 * @param forceCreation True to create new elements without checking whether they already exist. 123 * @returns The matching elements if found, or the new elements. 124 */ 125 addTags(tags, forceCreation = false) { 126 if (!tags) return []; 127 return tags.reduce((result, tag) => { 128 if (tag) { 129 result.push(this._getOrCreateElement(tag, forceCreation)); 130 } 131 return result; 132 }, []); 133 } 134 /** 135 * Retrieves a `<meta>` tag element in the current HTML document. 136 * @param attrSelector The tag attribute and value to match against, in the format 137 * `"tag_attribute='value string'"`. 138 * @returns The matching element, if any. 139 */ 140 getTag(attrSelector) { 141 if (!attrSelector) return null; 142 return this._doc.querySelector(`meta[${attrSelector}]`) || null; 143 } 144 /** 145 * Retrieves a set of `<meta>` tag elements in the current HTML document. 146 * @param attrSelector The tag attribute and value to match against, in the format 147 * `"tag_attribute='value string'"`. 148 * @returns The matching elements, if any. 149 */ 150 getTags(attrSelector) { 151 if (!attrSelector) return []; 152 const list /*NodeList*/ = this._doc.querySelectorAll(`meta[${attrSelector}]`); 153 return list ? [].slice.call(list) : []; 154 } 155 /** 156 * Modifies an existing `<meta>` tag element in the current HTML document. 157 * @param tag The tag description with which to replace the existing tag content. 158 * @param selector A tag attribute and value to match against, to identify 159 * an existing tag. A string in the format `"tag_attribute=`value string`"`. 160 * If not supplied, matches a tag with the same `name` or `property` attribute value as the 161 * replacement tag. 162 * @return The modified element. 163 */ 164 updateTag(tag, selector) { 165 if (!tag) return null; 166 selector = selector || this._parseSelector(tag); 167 const meta = this.getTag(selector); 168 if (meta) { 169 return this._setMetaElementAttributes(tag, meta); 170 } 171 return this._getOrCreateElement(tag, true); 172 } 173 /** 174 * Removes an existing `<meta>` tag element from the current HTML document. 175 * @param attrSelector A tag attribute and value to match against, to identify 176 * an existing tag. A string in the format `"tag_attribute=`value string`"`. 177 */
178 removeTag(attrSelector) { 179 this.removeTagElement(this.getTag(attrSelector)); 180 } 181 /** 182 * Removes an existing `<meta>` tag element from the current HTML document. 183 * @param meta The tag definition to match against to identify an existing tag. 184 */ 185 removeTagElement(meta) { 186 if (meta) { 187 this._dom.remove(meta); 188 } 189 } 190 _getOrCreateElement(meta, forceCreation = false) { 191 if (!forceCreation) { 192 const selector = this._parseSelector(meta); 193 // It's allowed to have multiple elements with the same name so it's not enough to 194 // just check that element with the same name already present on the page. We also need to 195 // check if element has tag attributes 196 const elem = this.getTags(selector).filter(elem => this._containsAttributes(meta, elem))[0]; 197 if (elem !== undefined) return elem; 198 } 199 const element = this._dom.createElement('meta'); 200 this._setMetaElementAttributes(meta, element); 201 const head = this._doc.getElementsByTagName('head')[0]; 202 head.appendChild(element); 203 return element; 204 } 205 _setMetaElementAttributes(tag, el) { 206 Object.keys(tag).forEach(prop => el.setAttribute(this._getMetaKeyMap(prop), tag[prop])); 207 return el; 208 } 209 _parseSelector(tag) { 210 const attr = tag.name ? 'name' : 'property'; 211 return `${attr}="${tag[attr]}"`; 212 } 213 _containsAttributes(tag, elem) { 214 return Object.keys(tag).every(key => elem.getAttribute(this._getMetaKeyMap(key)) === tag[key]); 215 } 216 _getMetaKeyMap(prop) { 217 return META_KEYS_MAP[prop] || prop; 218 } 219 } 220 _Meta = Meta; 221 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Meta, "\u0275fac", function _Meta_Factory(__ngFactoryType__) { 222 return new (__ngFactoryType__ || _Meta)(_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵɵinject"](_angular_common__WEBPACK_IMPORTED_MODULE_5__.DOCUMENT)); 223 }); 224 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Meta, "\u0275prov", /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵɵdefineInjectable"]({ 225 token: _Meta, 226 factory: _Meta.ɵfac, 227 providedIn: 'root' 228 })); 229 return Meta; 230})(); 231/*#__PURE__*/(() => { 232 (typeof ngDevMode === "undefined" || ngDevMode) && void 0; 233})(); 234/** 235 * Mapping for MetaDefinition properties with their correct meta attribute names 236 */ 237const META_KEYS_MAP = { 238 httpEquiv: 'http-equiv' 239}; 240 241/** 242 * A service that can be used to get and set the title of a current HTML document. 243 * 244 * Since an Angular application can't be bootstrapped on the entire HTML document (`<html>` tag) 245 * it is not possible to bind to the `text` property of the `HTMLTitleElement` elements 246 * (representing the `<title>` tag). Instead, this service can be used to set and get the current 247 * title value. 248 * 249 * @publicApi 250 */ 251let Title = /*#__PURE__*/(() => { 252 var _Title; 253 class Title { 254 constructor(_doc) { 255 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_doc", void 0); 256 this._doc = _doc; 257 } 258 /** 259 * Get the title of the current HTML document. 260 */ 261 getTitle() { 262 return this._doc.title; 263 } 264 /** 265 * Set the title of the current HTML document. 266 * @param newTitle 267 */ 268 setTitle(newTitle) { 269 this._doc.title = newTitle || ''; 270 } 271 } 272 _Title = Title; 273 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Title, "\u0275fac", function _Title_Factory(__ngFactoryType__) { 274 return new (__ngFactoryType__ || _Title)(_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵɵinject"](_angular_common__WEBPACK_IMPORTED_MODULE_5__.DOCUMENT)); 275 }); 276 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Title, "\u0275prov", /* @__P
276URE__ */_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵɵdefineInjectable"]({ 277 token: _Title, 278 factory: _Title.ɵfac, 279 providedIn: 'root' 280 })); 281 return Title; 282})(); 283/*#__PURE__*/(() => { 284 (typeof ngDevMode === "undefined" || ngDevMode) && void 0; 285})(); 286 287/// <reference path="../../../goog.d.ts" /> 288/** 289 * Exports the value under a given `name` in the global property `ng`. For example `ng.probe` if 290 * `name` is `'probe'`. 291 * @param name Name under which it will be exported. Keep in mind this will be a property of the 292 * global `ng` object. 293 * @param value The value to export. 294 */ 295function exportNgVar(name, value) { 296 if (typeof COMPILED === 'undefined' || !COMPILED) { 297 // Note: we can't export `ng` when using closure enhanced optimization as: 298 // - closure declares globals itself for minified names, which sometimes clobber our `ng` global 299 // - we can't declare a closure extern as the namespace `ng` is already used within Google 300 // for typings for angularJS (via `goog.provide('ng....')`). 301 const ng = _angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵglobal"]['ng'] = _angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵglobal"]['ng'] || {}; 302 ng[name] = value; 303 } 304} 305class ChangeDetectionPerfRecord { 306 constructor(msPerTick, numTicks) { 307 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "msPerTick", void 0); 308 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "numTicks", void 0); 309 this.msPerTick = msPerTick; 310 this.numTicks = numTicks; 311 } 312} 313/** 314 * Entry point for all Angular profiling-related debug tools. This object 315 * corresponds to the `ng.profiler` in the dev console. 316 */ 317class AngularProfiler { 318 constructor(ref) { 319 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "appRef", void 0); 320 this.appRef = ref.injector.get(_angular_core__WEBPACK_IMPORTED_MODULE_4__.ApplicationRef); 321 } 322 // tslint:disable:no-console 323 /** 324 * Exercises change detection in a loop and then prints the average amount of 325 * time in milliseconds how long a single round of change detection takes for 326 * the current state of the UI. It runs a minimum of 5 rounds for a minimum 327 * of 500 milliseconds. 328 * 329 * Optionally, a user may pass a `config` parameter containing a map of 330 * options. Supported options are: 331 * 332 * `record` (boolean) - causes the profiler to record a CPU profile while 333 * it exercises the change detector. Example: 334 * 335 * ```ts 336 * ng.profiler.timeChangeDetection({record: true}) 337 * ``` 338 */ 339 timeChangeDetection(config) { 340 const record = config && config['record']; 341 const profileName = 'Change Detection'; 342 // Profiler is not available in Android browsers without dev tools opened 343 if (record && 'profile' in console && typeof console.profile === 'function') { 344 console.profile(profileName); 345 } 346 const start = performance.now(); 347 let numTicks = 0; 348 while (numTicks < 5 || performance.now() - start < 500) { 349 this.appRef.tick(); 350 numTicks++; 351 } 352 const end = performance.now(); 353 if (record && 'profileEnd' in console && typeof console.profileEnd === 'function') { 354 console.profileEnd(profileName); 355 } 356 const msPerTick = (end - start) / numTicks; 357 console.log(`ran ${numTicks} change detection cycles`); 358 console.log(`${msPerTick.toFixed(2)} ms per check`); 359 return new ChangeDetectionPerfRecord(msPerTick, numTicks); 360 } 361} 362const PROFILER_GLOBAL_NAME = 'profiler'; 363/** 364 * Enabled Angular debug tools that are accessible via your browser's 365 * developer console. 366 * 367 * Usage: 368 * 369 * 1. Open developer console (e.g. in Chrome Ctrl + Shift + j) 370 * 1. Type `ng.` (usually the console will show auto-complete suggestion) 371 * 1. Try the change detection profiler `ng.profiler.timeChangeDetection()` 372 * then hit Enter. 373 * 374 * @publicApi 375 */ 376function enableDebugTools(ref) { 377 exportNgVar(PROFILER_GLOBAL_NAME, new AngularProfiler(ref)); 378 return ref; 379} 380/** 381 * Disables Angular tools. 382 * 383 * @publicApi 384 */ 385function disableDebugTools() { 386 exportNgVar(PROFILER_GLOBAL_NAME, null); 387} 388 389/** 390 * Predicates for use with {@link DebugElement}'s query functions. 391 * 392 * @publicApi 393 */ 394class By { 395 /** 396 * Match all nodes. 397 * 398 * @usageNotes 399 * ### Example 400 * 401 * {@example platform-browser/dom/debug/ts/by/by.ts region='by_all'} 402 */ 403 static all() { 404 return () => true; 405 } 406 /** 407 * Match elements by the given CSS selector. 408 * 409 * @usageNotes 410 * ### Example 411 * 412 * {@example platform-browser/dom/debug/ts/by/by.ts region='by_css'} 413 */ 414 static css(selector) { 415 return debugElement => { 416 return debugElement.nativeElement != null ? elementMatches(debugElement.nativeElement, selector) : false;
417 }; 418 } 419 /** 420 * Match nodes that have the given directive present. 421 * 422 * @usageNotes 423 * ### Example 424 * 425 * {@example platform-browser/dom/debug/ts/by/by.ts region='by_directive'} 426 */ 427 static directive(type) { 428 return debugNode => debugNode.providerTokens.indexOf(type) !== -1; 429 } 430} 431function elementMatches(n, selector) { 432 if ((0,_angular_common__WEBPACK_IMPORTED_MODULE_2__.getDOM)().isElementNode(n)) { 433 return n.matches && n.matches(selector) || n.msMatchesSelector && n.msMatchesSelector(selector) || n.webkitMatchesSelector && n.webkitMatchesSelector(selector); 434 } 435 return false; 436} 437 438/// <reference types="hammerjs" /> 439/** 440 * Supported HammerJS recognizer event names. 441 */ 442const EVENT_NAMES = { 443 // pan 444 'pan': true, 445 'panstart': true, 446 'panmove': true, 447 'panend': true, 448 'pancancel': true, 449 'panleft': true, 450 'panright': true, 451 'panup': true, 452 'pandown': true, 453 // pinch 454 'pinch': true, 455 'pinchstart': true, 456 'pinchmove': true, 457 'pinchend': true, 458 'pinchcancel': true, 459 'pinchin': true, 460 'pinchout': true, 461 // press 462 'press': true, 463 'pressup': true, 464 // rotate 465 'rotate': true, 466 'rotatestart': true, 467 'rotatemove': true, 468 'rotateend': true, 469 'rotatecancel': true, 470 // swipe 471 'swipe': true, 472 'swipeleft': true, 473 'swiperight': true, 474 'swipeup': true, 475 'swipedown': true, 476 // tap 477 'tap': true, 478 'doubletap': true 479}; 480/** 481 * DI token for providing [HammerJS](https://hammerjs.github.io/) support to Angular. 482 * @see {@link HammerGestureConfig} 483 * 484 * @ngModule HammerModule 485 * @publicApi 486 */ 487const HAMMER_GESTURE_CONFIG = /*#__PURE__*/new _angular_core__WEBPACK_IMPORTED_MODULE_4__.InjectionToken(typeof ngDevMode === 'undefined' || ngDevMode ? 'HammerGestureConfig' : ''); 488/** 489 * Injection token used to provide a HammerLoader to Angular. 490 * 491 * @see {@link HammerLoader} 492 * 493 * @publicApi 494 */ 495const HAMMER_LOADER = /*#__PURE__*/new _angular_core__WEBPACK_IMPORTED_MODULE_4__.InjectionToken(typeof ngDevMode === 'undefined' || ngDevMode ? 'HammerLoa
495der' : ''); 496/** 497 * An injectable [HammerJS Manager](https://hammerjs.github.io/api/#hammermanager) 498 * for gesture recognition. Configures specific event recognition. 499 * @publicApi 500 */ 501let HammerGestureConfig = /*#__PURE__*/(() => { 502 var _HammerGestureConfig; 503 class HammerGestureConfig { 504 constructor() { 505 /** 506 * A set of supported event names for gestures to be used in Angular. 507 * Angular supports all built-in recognizers, as listed in 508 * [HammerJS documentation](https://hammerjs.github.io/). 509 */ 510 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "events", []); 511 /** 512 * Maps gesture event names to a set of configuration options 513 * that specify overrides to the default values for specific properties. 514 * 515 * The key is a supported event name to be configured, 516 * and the options object contains a set of properties, with override values 517 * to be applied to the named recognizer event. 518 * For example, to disable recognition of the rotate event, specify 519 * `{"rotate": {"enable": false}}`. 520 * 521 * Properties that are not present take the HammerJS default values. 522 * For information about which properties are supported for which events, 523 * and their allowed and default values, see 524 * [HammerJS documentation](https://hammerjs.github.io/). 525 * 526 */ 527 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "overrides", {}); 528 /** 529 * Properties whose default values can be overridden for a given event. 530 * Different sets of properties apply to different events. 531 * For information about which properties are supported for which events, 532 * and their allowed and default values, see 533 * [HammerJS documentation](https://hammerjs.github.io/). 534 */ 535 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "options", void 0); 536 } 537 /** 538 * Creates a [HammerJS Manager](https://hammerjs.github.io/api/#hammermanager) 539 * and attaches it to a given HTML element. 540 * @param element The element that will recognize gestures. 541 * @returns A HammerJS event-manager object. 542 */ 543 buildHammer(element) { 544 const mc = new Hammer(element, this.options); 545 mc.get('pinch').set({ 546 enable: true 547 }); 548 mc.get('rotate').set({ 549 enable: true 550 }); 551 for (const eventName in this.overrides) { 552 mc.get(eventName).set(this.overrides[eventName]); 553 } 554 return mc; 555 } 556 } 557 _HammerGestureConfig = HammerGestureConfig; 558 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(HammerGestureConfig, "\u0275fac", function _HammerGestureConfig_Factory(__ngFactoryType__) { 559 return new (__ngFactoryType__ || _HammerGestureConfig)(); 560 }); 561 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(HammerGestureConfig, "\u0275prov", /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵɵdefineInjectable"]({ 562 token: _HammerGestureConfig, 563 factory: _HammerGestureConfig.ɵfac 564 })); 565 return HammerGestureConfig; 566})(); 567/*#__PURE__*/(() => { 568 (typeof ngDevMode === "undefined" || ngDevMode) && void 0; 569})(); 570/** 571 * Event plugin that adds Hammer support to an application. 572 * 573 * @ngModule HammerModule 574 */ 575let HammerGesturesPlugin = /*#__PURE__*/(() => { 576 var _HammerGesturesPlugin; 577 class HammerGesturesPlugin extends _dom_renderer_DGKzginR_mjs__WEBPACK_IMPORTED_MODULE_3__.EventManagerPlugin { 578 constructor(doc, _config, _injector, loader) { 579 super(doc); 580 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_config", void 0); 581 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_injector", void 0); 582 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "loader", void 0); 583 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_loaderPromise", null); 584 this._config = _config; 585 this._injector = _injector; 586 this.loader = loader; 587 } 588 supports(eventName) { 589 if (!EVENT_NAMES.hasOwnProperty(eventName.toLowerCase()) && !this.isCu
589stomEvent(eventName)) { 590 return false; 591 } 592 if (!window.Hammer && !this.loader) { 593 if (typeof ngDevMode === 'undefined' || ngDevMode) { 594 // Get a `Console` through an injector to tree-shake the 595 // class when it is unused in production. 596 const _console = this._injector.get(_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵConsole"]); 597 _console.warn(`The "${eventName}" event cannot be bound because Hammer.JS is not ` + `loaded and no custom loader has been specified.`); 598 } 599 return false; 600 } 601 return true; 602 } 603 addEventListener(element, eventName, handler) { 604 const zone = this.manager.getZone(); 605 eventName = eventName.toLowerCase(); 606 // If Hammer is not present but a loader is specified, we defer adding the event listener 607 // until Hammer is loaded. 608 if (!window.Hammer && this.loader) { 609 this._loaderPromise = this._loaderPromise || zone.runOutsideAngular(() => this.loader()); 610 // This `addEventListener` method returns a function to remove the added listener. 611 // Until Hammer is loaded, the returned function needs to *cancel* the registration rather 612 // than remove anything. 613 let cancelRegistration = false; 614 let deregister = () => { 615 cancelRegistration = true; 616 }; 617 zone.runOutsideAngular(() => this._loaderPromise.then(() => { 618 // If Hammer isn't actually loaded when the custom loader resolves, give up. 619 if (!window.Hammer) { 620 if (typeof ngDevMode === 'undefined' || ngDevMode) { 621 const _console = this._injector.get(_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵConsole"]); 622 _console.warn(`The custom HAMMER_LOADER completed, but Hammer.JS is not present.`); 623 } 624 deregister = () => {}; 625 return; 626 } 627 if (!cancelRegistration) { 628 // Now that Hammer is loaded and the listener is being loaded for real, 629 // the deregistration function changes from canceling registration to 630 // removal. 631 deregister = this.addEventListener(element, eventName, handler); 632 } 633 }).catch(() => { 634 if (typeof ngDevMode === 'undefined' || ngDevMode) { 635 const _console = this._injector.get(_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵConsole"]); 636 _console.warn(`The "${eventName}" event cannot be bound because the custom ` + `Hammer.JS loader failed.`); 637 } 638 deregister = () => {}; 639 })); 640 // Return a function that *executes* `deregister` (and not `deregister` itself) so that we 641 // can change the behavior of `deregister` once the listener is added. Using a closure in 642 // this way allows us to avoid any additional data structures to track listener removal. 643 return () => { 644 deregister(); 645 }; 646 } 647 return zone.runOutsideAngular(() => { 648 // Creating the manager bind events, must be done outside of angular 649 const mc = this._config.buildHammer(element); 650 const callback = function (eventObj) { 651 zone.runGuarded(function () { 652 handler(eventObj); 653 }); 654 }; 655 mc.on(eventName, callback); 656 return () => { 657 mc.off(eventName, callback); 658 // destroy mc to prevent memory leak 659 if (typeof mc.destroy === 'function') { 660 mc.destroy(); 661 } 662 }; 663 }); 664 } 665 isCustomEvent(eventName) { 666 return this._config.events.indexOf(eventName) > -1; 667 } 668 } 669 _HammerGesturesPlugin = HammerGesturesPlugin; 670 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(HammerGesturesPlugin, "\u0275fac", function _HammerGesturesPlugin_Factory(__ngFactoryType__) { 671 return new (__ngFactoryType__ || _HammerGesturesPlugin)(_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵɵinject"](_angular_common__WEBPACK_IMPORTED_MODULE_5__.DOCUMENT), _angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵɵinject"](HAMMER_GESTURE_CONFIG), _angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_4__.Injector), _angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵɵinject"](HAMMER_LOADER, 8)); 672 }); 673 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(HammerGesturesPlugin, "\u0275prov", /* @__P
673URE__ */_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵɵdefineInjectable"]({ 674 token: _HammerGesturesPlugin, 675 factory: _HammerGesturesPlugin.ɵfac 676 })); 677 return HammerGesturesPlugin; 678})(); 679/*#__PURE__*/(() => { 680 (typeof ngDevMode === "undefined" || ngDevMode) && void 0; 681})(); 682/** 683 * Adds support for HammerJS. 684 * 685 * Import this module at the root of your application so that Angular can work with 686 * HammerJS to detect gesture events. 687 * 688 * Note that applications still need to include the HammerJS script itself. This module 689 * simply sets up the coordination layer between HammerJS and Angular's `EventManager`. 690 * 691 * @publicApi 692 */ 693let HammerModule = /*#__PURE__*/(() => { 694 var _HammerModule; 695 class HammerModule {} 696 _HammerModule = HammerModule; 697 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(HammerModule, "\u0275fac", function _HammerModule_Factory(__ngFactoryType__) { 698 return new (__ngFactoryType__ || _HammerModule)(); 699 }); 700 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(HammerModule, "\u0275mod", /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵɵdefineNgModule"]({ 701 type: _HammerModule 702 })); 703 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(HammerModule, "\u0275inj", /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵɵdefineInjector"]({ 704 providers: [{ 705 provide: _dom_renderer_DGKzginR_mjs__WEBPACK_IMPORTED_MODULE_3__.EVENT_MANAGER_PLUGINS, 706 useClass: HammerGesturesPlugin, 707 multi: true, 708 deps: [_angular_common__WEBPACK_IMPORTED_MODULE_5__.DOCUMENT, HAMMER_GESTURE_CONFIG, _angular_core__WEBPACK_IMPORTED_MODULE_4__.Injector, [new _angular_core__WEBPACK_IMPORTED_MODULE_4__.Optional(), HAMMER_LOADER]] 709 }, { 710 provide: HAMMER_GESTURE_CONFIG, 711 useClass: HammerGestureConfig 712 }] 713 })); 714 return HammerModule; 715})(); 716/*#__PURE__*/(() => { 717 (typeof ngDevMode === "undefined" || ngDevMode) && void 0; 718})(); 719 720/** 721 * DomSanitizer helps preventing Cross Site Scripting Security bugs (XSS) by sanitizing 722 * values to be safe to use in the different DOM contexts. 723 * 724 * For example, when binding a URL in an `<a [href]="someValue">` hyperlink, `someValue` will be 725 * sanitized so that an attacker cannot inject e.g. a `javascript:` URL that would execute code on 726 * the website. 727 * 728 * In specific situations, it might be necessary to disable sanitization, for example if the 729 * application genuinely needs to produce a `javascript:` style link with a dynamic value in it. 730 * Users can bypass security by constructing a value with one of the `bypassSecurityTrust...` 731 * methods, and then binding to that value from the template. 732 * 733 * These situations should be very rare, and extraordinary care must be taken to avoid creating a 734 * Cross Site Scripting (XSS) security bug! 735 * 736 * When using `bypassSecurityTrust...`, make sure to call the method as early as possible and as 737 * close as possible to the source of the value, to make it easy to verify no security bug is 738 * created by its use. 739 * 740 * It is not required (and not recommended) to bypass security if the value is safe, e.g. a URL that 741 * does not start with a suspicious protocol, or an HTML snippet that does not contain dangerous 742 * code. The sanitizer leaves safe values intact. 743 * 744 * @security Calling any of the `bypassSecurityTrust...` APIs disables Angular's built-in 745 * sanitization for the value passed in. Carefully check and audit all values and code paths going 746 * into this call. Make sure any user data is appropriately escaped for this security context. 747 * For more detail, see the [Security Guide](https://g.co/ng/security). 748 * 749 * @publicApi 750 */ 751let DomSanitizer = /*#__PURE__*/(() => { 752 var _DomSanitizer; 753 class DomSanitizer {} 754 _DomSanitizer = DomSanitizer; 755 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(DomSanitizer, "\u0275fac", function _DomSanitizer_Factory(__ngFactoryType__) { 756 return new (__ngFactoryType__ || _DomSanitizer)(); 757 }); 758 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(DomSanitizer, "\u0275prov", /* @__P
758URE__ */_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵɵdefineInjectable"]({ 759 token: _DomSanitizer, 760 factory: function _DomSanitizer_Factory(__ngFactoryType__) { 761 let __ngConditionalFactory__ = null; 762 if (__ngFactoryType__) { 763 __ngConditionalFactory__ = new (__ngFactoryType__ || _DomSanitizer)(); 764 } else { 765 __ngConditionalFactory__ = _angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵɵinject"](DomSanitizerImpl); 766 } 767 return __ngConditionalFactory__; 768 }, 769 providedIn: 'root' 770 })); 771 return DomSanitizer; 772})(); 773/*#__PURE__*/(() => { 774 (typeof ngDevMode === "undefined" || ngDevMode) && void 0; 775})(); 776let DomSanitizerImpl = /*#__PURE__*/(() => { 777 var _DomSanitizerImpl; 778 class DomSanitizerImpl extends DomSanitizer { 779 constructor(_doc) { 780 super(); 781 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_doc", void 0); 782 this._doc = _doc; 783 } 784 sanitize(ctx, value) { 785 if (value == null) return null; 786 switch (ctx) { 787 case _angular_core__WEBPACK_IMPORTED_MODULE_4__.SecurityContext.NONE: 788 return value; 789 case _angular_core__WEBPACK_IMPORTED_MODULE_4__.SecurityContext.HTML: 790 if ((0,_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵallowSanitizationBypassAndThrow"])(value, "HTML" /* BypassType.Html */)) { 791 return (0,_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵunwrapSafeValue"])(value); 792 } 793 return (0,_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵ_sanitizeHtml"])(this._doc, String(value)).toString(); 794 case _angular_core__WEBPACK_IMPORTED_MODULE_4__.SecurityContext.STYLE: 795 if ((0,_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵallowSanitizationBypassAndThrow"])(value, "Style" /* BypassType.Style */)) { 796 return (0,_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵunwrapSafeValue"])(value); 797 } 798 return value; 799 case _angular_core__WEBPACK_IMPORTED_MODULE_4__.SecurityContext.SCRIPT: 800 if ((0,_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵallowSanitizationBypassAndThrow"])(value, "Script" /* BypassType.Script */)) { 801 return (0,_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵunwrapSafeValue"])(value); 802 } 803 throw new _angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵRuntimeError"](5200 /* RuntimeErrorCode.SANITIZATION_UNSAFE_SCRIPT */, (typeof ngDevMode === 'undefined' || ngDevMode) && 'unsafe value used in a script context'); 804 case _angular_core__WEBPACK_IMPORTED_MODULE_4__.SecurityContext.URL: 805 if ((0,_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵallowSanitizationBypassAndThrow"])(value, "URL" /* BypassType.Url */)) { 806 return (0,_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵunwrapSafeValue"])(value); 807 } 808 return (0,_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵ_sanitizeUrl"])(String(value)); 809 case _angular_core__WEBPACK_IMPORTED_MODULE_4__.SecurityContext.RESOURCE_URL: 810 if ((0,_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵallowSanitizationBypassAndThrow"])(value, "ResourceURL" /* BypassType.ResourceUrl */)) { 811 return (0,_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵunwrapSafeValue"])(value); 812 } 813 throw new _angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵRuntimeError"](5201 /* RuntimeErrorCode.SANITIZATION_UNSAFE_RESOURCE_URL */, (typeof ngDevMode === 'undefined' || ngDevMode) && `unsafe value used in a resource URL context (see ${_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵXSS_SECURITY_URL"]})`); 814 default: 815 throw new _angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵRuntimeError"](5202 /* RuntimeErrorCode.SANITIZATION_UNEXPECTED_CTX */, (typeof ngDevMode === 'undefined' || ngDevMode) && `Unexpected SecurityContext ${ctx} (see ${_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵXSS_SECURITY_URL"]})`); 816 } 817 } 818 bypassSecurityTrustHtml(value) { 819 return (0,_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵbypassSanitizationTrustHtml"])(value); 820 } 821 bypassSecurityTrustStyle(value) { 822 return (0,_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵbypassSanitizationTrustStyle"])(value); 823 } 824 bypassSecurityTrustScript(value) { 825 return (0,_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵbypassSanitizationTrustScript"])(value); 826 } 827 bypassSecurityTrustUrl(value) { 828 return (0,_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵbypassSanitizationTrustUrl"])(value); 829 } 830 bypassSecurityTrustResourceUrl(value) { 831 return (0,_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵbypassSanitizationTrustResourceUrl"])(value); 832 } 833 } 834 _DomSanitizerImpl = DomSanitizerImpl; 835 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(DomSanitizerImpl, "\u0275fac", function _DomSanitizerImpl_Factory(__ngFactoryType__) { 836 return new (__ngFactoryType__ || _DomSanitizerImpl)(_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵɵinject"](_angular_common__WEBPACK_IMPORTED_MODULE_5__.DOCUMENT)); 837 }); 838 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(DomSanitizerImpl, "\u0275prov", /* @__P
838URE__ */_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵɵdefineInjectable"]({ 839 token: _DomSanitizerImpl, 840 factory: _DomSanitizerImpl.ɵfac, 841 providedIn: 'root' 842 })); 843 return DomSanitizerImpl; 844})(); 845/*#__PURE__*/(() => { 846 (typeof ngDevMode === "undefined" || ngDevMode) && void 0; 847})(); 848 849/** 850 * The list of features as an enum to uniquely type each `HydrationFeature`. 851 * @see {@link HydrationFeature} 852 * 853 * @publicApi 854 */ 855var HydrationFeatureKind = /*#__PURE__*/function (HydrationFeatureKind) { 856 HydrationFeatureKind[HydrationFeatureKind["NoHttpTransferCache"] = 0] = "NoHttpTransferCache"; 857 HydrationFeatureKind[HydrationFeatureKind["HttpTransferCacheOptions"] = 1] = "HttpTransferCacheOptions"; 858 HydrationFeatureKind[HydrationFeatureKind["I18nSupport"] = 2] = "I18nSupport"; 859 HydrationFeatureKind[HydrationFeatureKind["EventReplay"] = 3] = "EventReplay"; 860 HydrationFeatureKind[HydrationFeatureKind["IncrementalHydration"] = 4] = "IncrementalHydration"; 861 return HydrationFeatureKind; 862}(HydrationFeatureKind || {}); 863/** 864 * Helper function to create an object that represents a Hydration feature. 865 */ 866function hydrationFeature(ɵkind, ɵproviders = [], ɵoptions = {}) { 867 return { 868 ɵkind, 869 ɵproviders 870 }; 871} 872/** 873 * Disables HTTP transfer cache. Effectively causes HTTP requests to be performed twice: once on the 874 * server and other one on the browser. 875 * 876 * @publicApi 877 */ 878function withNoHttpTransferCache() { 879 // This feature has no providers and acts as a flag that turns off 880 // HTTP transfer cache (which otherwise is turned on by default). 881 return hydrationFeature(HydrationFeatureKind.NoHttpTransferCache); 882} 883/** 884 * The function accepts an object, which allows to configure cache parameters, 885 * such as which headers should be included (no headers are included by default), 886 * whether POST requests should be cached or a callback function to determine if a 887 * particular request should be cached. 888 * 889 * @publicApi 890 */ 891function withHttpTransferCacheOptions(options) { 892 // This feature has no providers and acts as a flag to pass options to the HTTP transfer cache. 893 return hydrationFeature(HydrationFeatureKind.HttpTransferCacheOptions, (0,_angular_common_http__WEBPACK_IMPORTED_MODULE_6__["ɵwithHttpTransferCache"])(options)); 894} 895/** 896 * Enables support for hydrating i18n blocks. 897 * 898 * @developerPreview 899 * @publicApi 900 */ 901function withI18nSupport() { 902 return hydrationFeature(HydrationFeatureKind.I18nSupport, (0,_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵwithI18nSupport"])()); 903} 904/** 905 * Enables support for replaying user events (e.g. `click`s) that happened on a page 906 * before hydration logic has completed. Once an application is hydrated, all captured 907 * events are replayed and relevant event listeners are executed. 908 * 909 * @usageNotes 910 * 911 * Basic example of how you can enable event replay in your application when 912 * `bootstrapApplication` function is used: 913 * ```ts 914 * bootstrapApplication(AppComponent, { 915 * providers: [provideClientHydration(withEventReplay())] 916 * }); 917 * ``` 918 * @publicApi 919 * @see {@link provideClientHydration} 920 */ 921function withEventReplay() { 922 return hydrationFeature(HydrationFeatureKind.EventReplay, (0,_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵwithEventReplay"])()); 923} 924/** 925 * Enables support for incremental hydration using the `hydrate` trigger syntax. 926 * 927 * @usageNotes 928 * 929 * Basic example of how you can enable incremental hydration in your application when 930 * the `bootstrapApplication` function is used: 931 * ```ts 932 * bootstrapApplication(AppComponent, { 933 * providers: [provideClientHydration(withIncrementalHydration())] 934 * }); 935 * ``` 936 * @experimental 937 * @publicApi 938 * @see {@link provideClientHydration} 939 */ 940function withIncrementalHydration() { 941 return hydrationFeature(HydrationFeatureKind.IncrementalHydration, (0,_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵwithIncrementalHydration"])()); 942} 943/** 944 * Returns an `ENVIRONMENT_INITIALIZER` token setup with a function 945 * that verifies whether compatible ZoneJS was used in an application 946 * and logs a warning in a console if it's not the case. 947 */ 948function provideZoneJsCompatibilityDetector() { 949 return [{ 950 provide: _angular_core__WEBPACK_IMPORTED_MODULE_4__.ENVIRONMENT_INITIALIZER, 951 useValue: () => { 952 const ngZone = (0,_angular_core__WEBPACK_IMPORTED_MODULE_4__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_4__.NgZone); 953 const isZoneless = (0,_angular_core__WEBPACK_IMPORTED_MODULE_4__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵZONELESS_ENABLED"]); 954 // Checking `ngZone instanceof NgZone` would be insufficient here, 955 // because custom implementations might use NgZone as a base class. 956 if (!isZoneless && ngZone.constructor !== _angular_core__WEBPACK_IMPORTED_MODULE_4__.NgZone) { 957 const console = (0,_angular_core__WEBPACK_IMPORTED_MODULE_4__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵConsole"]); 958 const message = (0,_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵformatRuntimeError"])(-5e3 /* RuntimeErrorCode.UNSUPPORTED_ZONEJS_INSTANCE */, 'Angular detected that hydration was enabled for an application ' + 'that uses a custom or a noop Zone.js implementation. ' + 'This is not yet a fully supported configuration.'); 959 console.warn(message); 960 } 961 }, 962 multi: true 963 }]; 964} 965/** 966 * Sets up providers necessary to enable hydration functionality for the application. 967 * 968 * By default, the function enables the recommended set of features for the optimal 969 * performance for most of the applications. It includes the following features: 970 * 971 * * Reconciling DOM hydration. Learn more about it [here](guide/hydration). 972 * * [`HttpClient`](api/common/http/HttpClient) response caching while running on the server and 973 * transferring this cache to the client to avoid extra HTTP requests. Learn more about data caching 974 * [here](guide/ssr#caching-data-when-using-httpclient). 975 * 976 * These functions allow you to disable some of the default features or enable new ones: 977 * 978 * * {@link withNoHttpTransferCache} to disable HTTP transfer cache 979 * * {@link withHttpTransferCacheOptions} to configure some HTTP transfer cache options 980 * * {@link withI18nSupport} to enable hydration support for i18n blocks 981 * * {@link withEventReplay} to enable support for replaying user events 982 * 983 * @usageNotes 984 * 985 * Basic example of how you can enable hydration in your application when 986 * `bootstrapApplication` function is used: 987 * ```ts 988 * bootstrapApplication(AppComponent, { 989 * providers: [provideClientHydration()] 990 * }); 991 * ``` 992 * 993 * Alternatively if you are using NgModules, you would add `provideClientHydration` 994 * to your root app module's provider list. 995 * ```ts 996 * @NgModule({ 997 * declarations: [RootCmp], 998 * bootstrap: [RootCmp], 999 * providers: [provideClientHydration()], 1000 * }) 1001 * export class AppModule {} 1002 * ``` 1003 * 1004 * @see {@link withNoHttpTransferCache} 1005 * @see {@link withHttpTransferCacheOptions} 1006 * @see {@link withI18nSupport} 1007 * @see {@link withEventReplay} 1008 * 1009 * @param features Optional features to configure additional hydration behaviors. 1010 * @returns A set of providers to enable hydration. 1011 * 1012 * @publicApi 1013 */ 1014function provideClientHydration(...features) { 1015 const providers = []; 1016 const featuresKind = new Set(); 1017 for (const { 1018 ɵproviders, 1019 ɵkind 1020 } of features) { 1021 featuresKind.add(ɵkind); 1022 if (ɵproviders.length) { 1023 providers.push(ɵproviders); 1024 } 1025 } 1026 const hasHttpTransferCacheOptions = featuresKind.has(HydrationFeatureKind.HttpTransferCacheOptions); 1027 if (typeof ngDevMode !== 'undefined' && ngDevMode && featuresKind.has(HydrationFeatureKind.NoHttpTransferCache) && hasHttpTransferCacheOptions) { 1028 // TODO: Make this a runtime error 1029 throw new Error('Configuration error: found both withHttpTransferCacheOptions() and withNoHttpTransferCache() in the same call to provideClientHydration(), which is a contradiction.'); 1030 } 1031 return (0,_angular_core__WEBPACK_IMPORTED_MODULE_4__.makeEnvironmentProviders)([typeof ngDevMode !== 'undefined' && ngDevMode ? provideZoneJsCompatibilityDetector() : [], (0,_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵwithDomHydration"])(), featuresKind.has(HydrationFeatureKind.NoHttpTransferCache) || hasHttpTransferCacheOptions ? [] : (0,_angular_common_http__WEBPACK_IMPORTED_MODULE_6__["ɵwithHttpTransferCache"])({}), providers]); 1032} 1033 1034/** 1035 * @module 1036 * @description 1037 * Entry point for all public APIs of the platform-browser package. 1038 */ 1039/** 1040 * @publicApi 1041 */ 1042const VERSION = /*#__PURE__*/new _angular_core__WEBPACK_IMPORTED_MODULE_4__.Version('19.2.14'); 1043 1044//# sourceMappingURL=platform-browser.mjs.map 1045 1046/***/ }), 1047 1048/***/ 6485: 1049/*!*********************************************************************!*\ 1050 !*** ./node_modules/@angular/animations/fesm2022/util-D9FfmVnv.mjs ***! 1051 \*********************************************************************/ 1052/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { 1053 1054__webpack_require__.r(__webpack_exports__); 1055/* harmony export */ __webpack_require__.d(__webpack_exports__, { 1056/* harmony export */ ENTER_CLASSNAME: () => (/* binding */ ENTER_CLASSNAME), 1057/* harmony export */ LEAVE_CLASSNAME: () => (/* binding */ LEAVE_CLASSNAME), 1058/* harmony export */ NG_ANIMATING_CLASSNAME: () => (/* binding */ NG_ANIMATING_CLASSNAME), 1059/* harmony export */ NG_ANIMATING_SELECTOR: () => (/* binding */ NG_ANIMATING_SELECTOR), 1060/* harmony export */ NG_TRIGGER_CLASSNAME: () => (/* binding */ NG_TRIGGER_CLASSNAME), 1061/* harmony export */ NG_TRIGGER_SELECTOR: () => (/* binding */ NG_TRIGGER_SELECTOR), 1062/* harmony export */ SUBSTITUTION_EXPR_START: () => (/* binding */ SUBSTITUTION_EXPR_START), 1063/* harmony export */ allowPreviousPlayerStylesMerge: () => (/* binding */ allowPreviousPlayerStylesMerge), 1064/* harmony export */ balancePreviousStylesIntoKeyframes: () => (/* binding */ balancePreviousStylesIntoKeyframes), 1065/* harmony export */ buildingFailed: () => (/* binding */ buildingFailed),
1066/* harmony export */ camelCaseToDashCase: () => (/* binding */ camelCaseToDashCase), 1067/* harmony export */ computeStyle: () => (/* binding */ computeStyle), 1068/* harmony export */ containsElement: () => (/* binding */ containsElement), 1069/* harmony export */ createAnimationFailed: () => (/* binding */ createAnimationFailed), 1070/* harmony export */ dashCaseToCamelCase: () => (/* binding */ dashCaseToCamelCase), 1071/* harmony export */ eraseStyles: () => (/* binding */ eraseStyles), 1072/* harmony export */ extractStyleParams: () => (/* binding */ extractStyleParams), 1073/* harmony export */ getOrSetDefaultValue: () => (/* binding */ getOrSetDefaultValue), 1074/* harmony export */ getParentElement: () => (/* binding */ getParentElement), 1075/* harmony export */ interpolateParams: () => (/* binding */ interpolateParams), 1076/* harmony export */ invalidCssUnitValue: () => (/* binding */ invalidCssUnitValue), 1077/* harmony export */ invalidDefinition: () => (/* binding */ invalidDefinition), 1078/* harmony export */ invalidExpression: () => (/* binding */ invalidExpression), 1079/* harmony export */ invalidKeyframes: () => (/* binding */ invalidKeyframes), 1080/* harmony export */ invalidOffset: () => (/* binding */ invalidOffset), 1081/* harmony export */ invalidParallelAnimation: () => (/* binding */ invalidParallelAnimation), 1082/* harmony export */ invalidQuery: () => (/* binding */ invalidQuery), 1083/* harmony export */ invalidStagger: () => (/* binding */ invalidStagger), 1084/* harmony export */ invalidState: () => (/* binding */ invalidState), 1085/* harmony export */ invalidStyleValue: () => (/* binding */ invalidStyleValue), 1086/* harmony export */ invalidTransitionAlias: () => (/* binding */ invalidTransitionAlias), 1087/* harmony export */ invalidTrigger: () => (/* binding */ invalidTrigger), 1088/* harmony export */ invokeQuery: () => (/* binding */ invokeQuery), 1089/* harmony export */ keyframeOffsetsOutOfOrder: () => (/* binding */ keyframeOffsetsOutOfOrder), 1090/* harmony export */ keyframesMissingOffsets: () => (/* binding */ keyframesMissingOffsets), 1091/* harmony export */ listenOnPlayer: () => (/* binding */ listenOnPlayer), 1092/* harmony export */ makeAnimationEvent: () => (/* binding */ makeAnimationEvent), 1093/* harmony export */ missingEvent: () => (/* binding */ missingEvent), 1094/* harmony export */ missingOrDestroyedAnimation: () => (/* binding */ missingOrDestroyedAnimation), 1095/* harmony export */ missingPlayer: () => (/* binding */ missingPlayer), 1096/* harmony export */ missingTrigger: () => (/* binding */ missingTrigger), 1097/* harmony export */ normalizeAnimationEntry: () => (/* binding */ normalizeAnimationEntry), 1098/* harmony export */ normalizeKeyframes: () => (/* binding */ normalizeKeyframes$1), 1099/* harmony export */ normalizeKeyframes$1: () => (/* binding */ normalizeKeyframes), 1100/* harmony export */ normalizeStyles: () => (/* binding */ normalizeStyles), 1101/* harmony export */ optimizeGroupPlayer: () => (/* binding */ optimizeGroupPlayer), 1102/* harmony export */ parseTimelineCommand: () => (/* binding */ parseTimelineCommand), 1103/* harmony export */ registerFailed: () => (/* binding */ registerFailed), 1104/* harmony export */ resolveTiming: () => (/* binding */ resolveTiming), 1105/* harmony export */ resolveTimingValue: () => (/* binding */ resolveTimingValue), 1106/* harmony export */ setStyles: () => (/* binding */ setStyles), 1107/* harmony export */ transitionFailed: () => (/* binding */ transitionFailed), 1108/* harmony export */ triggerBuildFailed: () => (/* binding */ triggerBuildFailed), 1109/* harmony export */ triggerTransitionsFailed: () => (/* binding */ triggerTransitionsFailed), 1110/* harmony export */ unregisteredTrigger: () => (/* binding */ unregisteredTrigger), 1111/* harmony export */ unsupportedTriggerEvent: () => (/* binding */ unsupportedTriggerEvent), 1112/* harmony export */ validateStyleParams: () => (/* binding */ validateStyleParams), 1113/* harmony export */ validateStyleProperty: () => (/* binding */ validateStyleProperty), 1114/* harmony export */ validateWebAnimatableStyleProperty: () => (/* binding */ validateWebAnimatableStyleProperty), 1115/* harmony export */ validationFailed: () => (/* binding */ validationFailed), 1116/* harmony export */ visitDslNode: () => (/* binding */ visitDslNode) 1117/* harmony export */ }); 1118/* harmony import */ var _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./private_export-faY_wCkZ.mjs */ 60969); 1119/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 17705); 1120/** 1121 * @license Angular v19.2.14 1122 * (c) 2010-2025 Google LLC. https://angular.io/ 1123 * License: MIT 1124 */ 1125 1126 1127 1128const LINE_START = '\n - ';
1129function invalidTimingValue(exp) { 1130 return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3000 /* RuntimeErrorCode.INVALID_TIMING_VALUE */, ngDevMode && `The provided timing value "${exp}" is invalid.`); 1131} 1132function negativeStepValue() { 1133 return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3100 /* RuntimeErrorCode.NEGATIVE_STEP_VALUE */, ngDevMode && 'Duration values below 0 are not allowed for this animation step.'); 1134} 1135function negativeDelayValue() { 1136 return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3101 /* RuntimeErrorCode.NEGATIVE_DELAY_VALUE */, ngDevMode && 'Delay values below 0 are not allowed for this animation step.'); 1137} 1138function invalidStyleParams(varName) { 1139 return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3001 /* RuntimeErrorCode.INVALID_STYLE_PARAMS */, ngDevMode && `Unable to resolve the local animation param ${varName} in the given list of values`); 1140} 1141function invalidParamValue(varName) { 1142 return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3003 /* RuntimeErrorCode.INVALID_PARAM_VALUE */, ngDevMode && `Please provide a value for the animation param ${varName}`); 1143}
1144function invalidNodeType(nodeType) { 1145 return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3004 /* RuntimeErrorCode.INVALID_NODE_TYPE */, ngDevMode && `Unable to resolve animation metadata node #${nodeType}`); 1146} 1147function invalidCssUnitValue(userProvidedProperty, value) { 1148 return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3005 /* RuntimeErrorCode.INVALID_CSS_UNIT_VALUE */, ngDevMode && `Please provide a CSS unit value for ${userProvidedProperty}:${value}`); 1149} 1150function invalidTrigger() { 1151 return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3006 /* RuntimeErrorCode.INVALID_TRIGGER */, ngDevMode && "animation triggers cannot be prefixed with an `@` sign (e.g. trigger('@foo', [...]))"); 1152} 1153function invalidDefinition() { 1154 return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3007 /* RuntimeErrorCode.INVALID_DEFINITION */, ngDevMode && 'only state() and transition() definitions can sit inside of a trigger()'); 1155} 1156function invalidState(metadataName, missingSubs) { 1157 return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3008 /* RuntimeErrorCode.INVALID_STATE */, ngDevMode && `state("${metadataName}", ...) must define default values for all the following style substitutions: ${missingSubs.join(', ')}`); 1158}
1159function invalidStyleValue(value) { 1160 return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3002 /* RuntimeErrorCode.INVALID_STYLE_VALUE */, ngDevMode && `The provided style string value ${value} is not allowed.`); 1161} 1162function invalidParallelAnimation(prop, firstStart, firstEnd, secondStart, secondEnd) { 1163 return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3010 /* RuntimeErrorCode.INVALID_PARALLEL_ANIMATION */, ngDevMode && `The CSS property "${prop}" that exists between the times of "${firstStart}ms" and "${firstEnd}ms" is also being animated in a parallel animation between the times of "${secondStart}ms" and "${secondEnd}ms"`); 1164} 1165function invalidKeyframes() { 1166 return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3011 /* RuntimeErrorCode.INVALID_KEYFRAMES */, ngDevMode && `keyframes() must be placed inside of a call to animate()`); 1167} 1168function invalidOffset() { 1169 return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3012 /* RuntimeErrorCode.INVALID_OFFSET */, ngDevMode && `Please ensure that all keyframe offsets are between 0 and 1`); 1170} 1171function keyframeOffsetsOutOfOrder() { 1172 return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3200 /* RuntimeErrorCode.KEYFRAME_OFFSETS_OUT_OF_ORDER */, ngDevMode && `Please ensure that all keyframe offsets are in order`); 1173} 1174function keyframesMissingOffsets() { 1175 return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3202 /* RuntimeErrorCode.KEYFRAMES_MISSING_OFFSETS */, ngDevMode && `Not all style() steps within the declared keyframes() contain offsets`); 1176}
1177function invalidStagger() { 1178 return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3013 /* RuntimeErrorCode.INVALID_STAGGER */, ngDevMode && `stagger() can only be used inside of query()`); 1179} 1180function invalidQuery(selector) { 1181 return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3014 /* RuntimeErrorCode.INVALID_QUERY */, ngDevMode && `\`query("${selector}")\` returned zero elements. (Use \`query("${selector}", { optional: true })\` if you wish to allow this.)`); 1182} 1183function invalidExpression(expr) { 1184 return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3015 /* RuntimeErrorCode.INVALID_EXPRESSION */, ngDevMode && `The provided transition expression "${expr}" is not supported`); 1185} 1186function invalidTransitionAlias(alias) { 1187 return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3016 /* RuntimeErrorCode.INVALID_TRANSITION_ALIAS */, ngDevMode && `The transition alias value "${alias}" is not supported`); 1188} 1189function validationFailed(errors) { 1190 return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3500 /* RuntimeErrorCode.VALIDATION_FAILED */, ngDevMode && `animation validation failed:\n${errors.map(err => err.message).join('\n')}`); 1191} 1192function buildingFailed(errors) { 1193 return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3501 /* RuntimeErrorCode.BUILDING_FAILED */, ngDevMode && `animation building failed:\n${errors.map(err => err.message).join('\n')}`); 1194} 1195function triggerBuildFailed(name, errors) { 1196 return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3404 /* RuntimeErrorCode.TRIGGER_BUILD_FAILED */, ngDevMode && `The animation trigger "${name}" has failed to build due to the following errors:\n - ${errors.map(err => err.message).join('\n - ')}`); 1197} 1198function animationFailed(errors) { 1199 return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3502 /* RuntimeErrorCode.ANIMATION_FAILED */, ngDevMode && `Unable to animate due to the following errors:${LINE_START}${errors.map(err => err.message).join(LINE_START)}`); 1200} 1201function registerFailed(errors) { 1202 return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3503 /* RuntimeErrorCode.REGISTRATION_FAILED */, ngDevMode && `Unable to build the animation due to the following errors: ${errors.map(err => err.message).join('\n')}`); 1203} 1204function missingOrDestroyedAnimation() { 1205 return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3300 /* RuntimeErrorCode.MISSING_OR_DESTROYED_ANIMATION */, ngDevMode && "The requested animation doesn't exist or has already been destroyed"); 1206} 1207function createAnimationFailed(errors) { 1208 return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3504 /* RuntimeErrorCode.CREATE_ANIMATION_FAILED */, ngDevMode && `Unable to create the animation due to the following errors:${errors.map(err => err.message).join('\n')}`); 1209} 1210function missingPlayer(id) { 1211 return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3301 /* RuntimeErrorCode.MISSING_PLAYER */, ngDevMode && `Unable to find the timeline player referenced by ${id}`); 1212} 1213function missingTrigger(phase, name) { 1214 return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3302 /* RuntimeErrorCode.MISSING_TRIGGER */, ngDevMode && `Unable to listen on the animation trigger event "${phase}" because the animation trigger "${name}" doesn\'t exist!`); 1215} 1216function missingEvent(name) { 1217 return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3303 /* RuntimeErrorCode.MISSING_EVENT */, ngDevMode && `Unable to listen on the animation trigger "${name}" because the provided event is undefined!`); 1218} 1219function unsupportedTriggerEvent(phase, name) { 1220 return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3400 /* RuntimeErrorCode.UNSUPPORTED_TRIGGER_EVENT */, ngDevMode && `The provided animation trigger event "${phase}" for the animation trigger "${name}" is not supported!`); 1221} 1222function unregisteredTrigger(name) { 1223 return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3401 /* RuntimeErrorCode.UNREGISTERED_TRIGGER */, ngDevMode && `The provided animation trigger "${name}" has not been registered!`); 1224} 1225function triggerTransitionsFailed(errors) { 1226 return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3402 /* RuntimeErrorCode.TRIGGER_TRANSITIONS_FAILED */, ngDevMode && `Unable to process animations due to the following failed trigger transitions\n ${errors.map(err => err.message).join('\n')}`); 1227} 1228function transitionFailed(name, errors) { 1229 return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3505 /* RuntimeErrorCode.TRANSITION_FAILED */, ngDevMode && `@${name} has failed due to:\n ${errors.map(err => err.message).join('\n- ')}`); 1230} 1231 1232/** 1233 * Set of all animatable CSS properties 1234 * 1235 * @see https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_animated_properties 1236 */ 1237const ANIMATABLE_PROP_SET = /*#__PURE__*/new Set(['-moz-outline-radius', '-moz-outline-radius-bottomleft', '-moz-outline-radius-bottomright', '-moz-outline-radius-topleft', '-moz-outline-radius-topright', '-ms-grid-columns', '-ms-grid-rows', '-webkit-line-clamp', '-webkit-text-fill-color', '-webkit-text-stroke', '-webkit-text-stroke-color', 'accent-color', 'all', 'backdrop-filter', 'background', 'background-color', 'background-position', 'background-size', 'block-size', 'border', 'border-block-end', 'border-block-end-color', 'border-block-end-width', 'border-block-start', 'border-block-start-color', 'border-block-start-width', 'border-bottom', 'border-bottom-color', 'border-bottom-left-radius', 'border-bottom-right-radius', 'border-bottom-width', 'border-color', 'border-end-end-radius', 'border-end-start-radius', 'border-image-outset', 'border-image-slice', 'border-image-width', 'border-inline-end', 'border-inline-end-color', 'border-inline-end-width', 'border-inline-start', 'border-inline-start-color', 'border-inline-start-width', 'border-left', 'border-left-color', 'border-left-width', 'border-radius', 'border-right', 'border-right-color', 'border-right-width', 'border-start-end-radius', 'border-start-start-radius', 'border-top', 'border-top-color', 'border-top-left-radius', 'border-top-right-radius', 'border-top-width', 'border-width', 'bottom', 'box-shadow', 'caret-color', 'clip', 'clip-path', 'color', 'column-count', 'column-gap', 'column-rule', 'column-rule-color', 'column-rule-width', 'column-width', 'columns', 'filter', 'flex', 'flex-basis', 'flex-grow', 'flex-shrink', 'font', 'font-size', 'font-size-adjust', 'font-stretch', 'font-variation-settings', 'font-weight', 'gap', 'grid-column-gap', 'grid-gap', 'grid-row-gap', 'grid-template-columns', 'grid-template-rows', 'height', 'inline-size', 'input-security', 'inset', 'inset-block', 'inset-block-end', 'inset-block-start', 'inset-inline', 'inset-inline-end', 'inset-inline-start', 'left', 'letter-spacing', 'line-clamp', 'line-height', 'margin', 'margin-block-end', 'margin-block-start', 'margin-bottom', 'margin-inline-end', 'margin-inline-start', 'margin-left', 'margin-right', 'margin-top', 'mask', 'mask-border', 'mask-position', 'mask-size', 'max-block-size', 'max-height', 'max-inline-size', 'max-lines', 'max-width', 'min-block-size', 'min-height', 'min-inline-size', 'min-width', 'object-position', 'offset', 'offset-anchor', 'offset-distance', 'offset-path', 'offset-position', 'offset-rotate', 'opacity', 'order', 'outline', 'outline-color', 'outline-offset', 'outline-width', 'padding', 'padding-block-end', 'padding-block-start', 'padding-bottom', 'padding-inline-end', 'padding-inline-start', 'padding-left', 'padding-right', 'padding-top', 'perspective', 'perspective-origin', 'right', 'rotate', 'row-gap', 'scale', 'scroll-margin', 'scroll-margin-block', 'scroll-margin-block-end', 'scroll-margin-block-start', 'scroll-margin-bottom', 'scroll-margin-inline', 'scroll-margin-inline-end', 'scroll-margin-inline-start', 'scroll-margin-left', 'scroll-margin-right', 'scroll-margin-top', 'scroll-padding', 'scroll-padding-block', 'scroll-padding-block-end', 'scroll-padding-block-start', 'scroll-padding-bottom', 'scroll-padding-inline', 'scroll-padding-inline-end', 'scroll-padding-inline-start', 'scroll-padding-left', 'scroll-padding-right', 'scroll-padding-top', 'scroll-snap-coordinate', 'scroll-snap-destination', 'scrollbar-color', 'shape-image-threshold', 'shape-margin', 'shape-outside', 'tab-size', 'text-decoration', 'text-decoration-color', 'text-decoration-thickness', 'text-emphasis', 'text-emphasis-color', 'text-indent', 'text-shadow', 'text-underline-offset', 'top', 'transform', 'transform-origin', 'translate', 'vertical-align', 'visibility', 'width', 'word-spacing', 'z-index', 'zoom']); 1238function optimizeGroupPlayer(players) { 1239 switch (players.length) { 1240 case 0: 1241 return new _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_1__.NoopAnimationPlayer(); 1242 case 1: 1243 return players[0]; 1244 default: 1245 return new _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_1__.AnimationGroupPlayer(players); 1246 } 1247} 1248function normalizeKeyframes$1(normalizer, keyframes, preStyles = new Map(), postStyles = new Map()) { 1249 const errors = []; 1250 const normalizedKeyframes = []; 1251 let previousOffset = -1; 1252 let previousKeyframe = null;
vendor: 10,804 bytes, lines 1253-1578
1253 keyframes.forEach(kf => { 1254 const offset = kf.get('offset'); 1255 const isSameOffset = offset == previousOffset; 1256 const normalizedKeyframe = isSameOffset && previousKeyframe || new Map(); 1257 kf.forEach((val, prop) => { 1258 let normalizedProp = prop; 1259 let normalizedValue = val; 1260 if (prop !== 'offset') { 1261 normalizedProp = normalizer.normalizePropertyName(normalizedProp, errors); 1262 switch (normalizedValue) { 1263 case _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_1__["ɵPRE_STYLE"]: 1264 normalizedValue = preStyles.get(prop); 1265 break; 1266 case _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_1__.AUTO_STYLE: 1267 normalizedValue = postStyles.get(prop); 1268 break; 1269 default: 1270 normalizedValue = normalizer.normalizeStyleValue(prop, normalizedProp, normalizedValue, errors); 1271 break; 1272 } 1273 } 1274 normalizedKeyframe.set(normalizedProp, normalizedValue); 1275 }); 1276 if (!isSameOffset) { 1277 normalizedKeyframes.push(normalizedKeyframe); 1278 } 1279 previousKeyframe = normalizedKeyframe; 1280 previousOffset = offset; 1281 }); 1282 if (errors.length) { 1283 throw animationFailed(errors); 1284 } 1285 return normalizedKeyframes; 1286} 1287function listenOnPlayer(player, eventName, event, callback) { 1288 switch (eventName) { 1289 case 'start': 1290 player.onStart(() => callback(event && copyAnimationEvent(event, 'start', player))); 1291 break; 1292 case 'done': 1293 player.onDone(() => callback(event && copyAnimationEvent(event, 'done', player))); 1294 break; 1295 case 'destroy': 1296 player.onDestroy(() => callback(event && copyAnimationEvent(event, 'destroy', player))); 1297 break; 1298 } 1299} 1300function copyAnimationEvent(e, phaseName, player) { 1301 const totalTime = player.totalTime; 1302 const disabled = player.disabled ? true : false; 1303 const event = makeAnimationEvent(e.element, e.triggerName, e.fromState, e.toState, phaseName || e.phaseName, totalTime == undefined ? e.totalTime : totalTime, disabled); 1304 const data = e['_data']; 1305 if (data != null) { 1306 event['_data'] = data; 1307 } 1308 return event; 1309} 1310function makeAnimationEvent(element, triggerName, fromState, toState, phaseName = '', totalTime = 0, disabled) { 1311 return { 1312 element, 1313 triggerName, 1314 fromState, 1315 toState, 1316 phaseName, 1317 totalTime, 1318 disabled: !!disabled 1319 }; 1320} 1321function getOrSetDefaultValue(map, key, defaultValue) { 1322 let value = map.get(key); 1323 if (!value) { 1324 map.set(key, value = defaultValue); 1325 } 1326 return value; 1327} 1328function parseTimelineCommand(command) { 1329 const separatorPos = command.indexOf(':'); 1330 const id = command.substring(1, separatorPos); 1331 const action = command.slice(separatorPos + 1); 1332 return [id, action]; 1333} 1334const documentElement = /* @__PURE__ */(() => typeof document === 'undefined' ? null : document.documentElement)(); 1335function getParentElement(element) { 1336 const parent = element.parentNode || element.host || null; // consider host to support shadow DOM 1337 if (parent === documentElement) { 1338 return null; 1339 } 1340 return parent; 1341} 1342function containsVendorPrefix(prop) { 1343 // Webkit is the only real popular vendor prefix nowadays 1344 // cc: http://shouldiprefix.com/ 1345 return prop.substring(1, 6) == 'ebkit'; // webkit or Webkit 1346} 1347let _CACHED_BODY = null; 1348let _IS_WEBKIT = false; 1349function validateStyleProperty(prop) { 1350 if (!_CACHED_BODY) { 1351 _CACHED_BODY = getBodyNode() || {}; 1352 _IS_WEBKIT = _CACHED_BODY.style ? 'WebkitAppearance' in _CACHED_BODY.style : false; 1353 } 1354 let result = true; 1355 if (_CACHED_BODY.style && !containsVendorPrefix(prop)) { 1356 result = prop in _CACHED_BODY.style; 1357 if (!result && _IS_WEBKIT) { 1358 const camelProp = 'Webkit' + prop.charAt(0).toUpperCase() + prop.slice(1); 1359 result = camelProp in _CACHED_BODY.style; 1360 } 1361 } 1362 return result; 1363} 1364function validateWebAnimatableStyleProperty(prop) { 1365 return ANIMATABLE_PROP_SET.has(prop); 1366} 1367function getBodyNode() { 1368 if (typeof document != 'undefined') { 1369 return document.body; 1370 } 1371 return null; 1372} 1373function containsElement(elm1, elm2) { 1374 while (elm2) { 1375 if (elm2 === elm1) { 1376 return true; 1377 } 1378 elm2 = getParentElement(elm2); 1379 } 1380 return false; 1381} 1382function invokeQuery(element, selector, multi) { 1383 if (multi) { 1384 return Array.from(element.querySelectorAll(selector)); 1385 } 1386 const elem = element.querySelector(selector); 1387 return elem ? [elem] : []; 1388} 1389const ONE_SECOND = 1000; 1390const SUBSTITUTION_EXPR_START = '{{'; 1391const SUBSTITUTION_EXPR_END = '}}'; 1392const ENTER_CLASSNAME = 'ng-enter'; 1393const LEAVE_CLASSNAME = 'ng-leave'; 1394const NG_TRIGGER_CLASSNAME = 'ng-trigger'; 1395const NG_TRIGGER_SELECTOR = '.ng-trigger'; 1396const NG_ANIMATING_CLASSNAME = 'ng-animating'; 1397const NG_ANIMATING_SELECTOR = '.ng-animating'; 1398function resolveTimingValue(value) { 1399 if (typeof value == 'number') return value; 1400 const matches = value.match(/^(-?[\.\d]+)(m?s)/); 1401 if (!matches || matches.length < 2) return 0; 1402 return _convertTimeValueToMS(parseFloat(matches[1]), matches[2]); 1403} 1404function _convertTimeValueToMS(value, unit) { 1405 switch (unit) { 1406 case 's': 1407 return value * ONE_SECOND; 1408 default: 1409 // ms or something else 1410 return value; 1411 } 1412} 1413function resolveTiming(timings, errors, allowNegativeValues) { 1414 return timings.hasOwnProperty('duration') ? timings : parseTimeExpression(timings, errors, allowNegativeValues); 1415} 1416function parseTimeExpression(exp, errors, allowNegativeValues) { 1417 const regex = /^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i; 1418 let duration; 1419 let delay = 0; 1420 let easing = ''; 1421 if (typeof exp === 'string') { 1422 const matches = exp.match(regex); 1423 if (matches === null) { 1424 errors.push(invalidTimingValue(exp)); 1425 return { 1426 duration: 0, 1427 delay: 0, 1428 easing: '' 1429 }; 1430 } 1431 duration = _convertTimeValueToMS(parseFloat(matches[1]), matches[2]); 1432 const delayMatch = matches[3]; 1433 if (delayMatch != null) { 1434 delay = _convertTimeValueToMS(parseFloat(delayMatch), matches[4]); 1435 } 1436 const easingVal = matches[5]; 1437 if (easingVal) { 1438 easing = easingVal; 1439 } 1440 } else { 1441 duration = exp; 1442 } 1443 if (!allowNegativeValues) { 1444 let containsErrors = false; 1445 let startIndex = errors.length; 1446 if (duration < 0) { 1447 errors.push(negativeStepValue()); 1448 containsErrors = true; 1449 } 1450 if (delay < 0) { 1451 errors.push(negativeDelayValue()); 1452 containsErrors = true; 1453 } 1454 if (containsErrors) { 1455 errors.splice(startIndex, 0, invalidTimingValue(exp)); 1456 } 1457 } 1458 return { 1459 duration, 1460 delay, 1461 easing 1462 }; 1463} 1464function normalizeKeyframes(keyframes) { 1465 if (!keyframes.length) { 1466 return []; 1467 } 1468 if (keyframes[0] instanceof Map) { 1469 return keyframes; 1470 } 1471 return keyframes.map(kf => new Map(Object.entries(kf))); 1472} 1473function normalizeStyles(styles) { 1474 return Array.isArray(styles) ? new Map(...styles) : new Map(styles); 1475} 1476function setStyles(element, styles, formerStyles) { 1477 styles.forEach((val, prop) => { 1478 const camelProp = dashCaseToCamelCase(prop); 1479 if (formerStyles && !formerStyles.has(prop)) { 1480 formerStyles.set(prop, element.style[camelProp]); 1481 } 1482 element.style[camelProp] = val; 1483 }); 1484} 1485function eraseStyles(element, styles) { 1486 styles.forEach((_, prop) => { 1487 const camelProp = dashCaseToCamelCase(prop); 1488 element.style[camelProp] = ''; 1489 }); 1490} 1491function normalizeAnimationEntry(steps) { 1492 if (Array.isArray(steps)) { 1493 if (steps.length == 1) return steps[0]; 1494 return (0,_private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_1__.sequence)(steps); 1495 } 1496 return steps; 1497} 1498function validateStyleParams(value, options, errors) { 1499 const params = options.params || {}; 1500 const matches = extractStyleParams(value); 1501 if (matches.length) { 1502 matches.forEach(varName => { 1503 if (!params.hasOwnProperty(varName)) { 1504 errors.push(invalidStyleParams(varName)); 1505 } 1506 }); 1507 } 1508} 1509const PARAM_REGEX = /* @__PURE__ */new RegExp(`${SUBSTITUTION_EXPR_START}\\s*(.+?)\\s*${SUBSTITUTION_EXPR_END}`, 'g'); 1510function extractStyleParams(value) { 1511 let params = []; 1512 if (typeof value === 'string') { 1513 let match; 1514 while (match = PARAM_REGEX.exec(value)) { 1515 params.push(match[1]); 1516 } 1517 PARAM_REGEX.lastIndex = 0; 1518 } 1519 return params; 1520} 1521function interpolateParams(value, params, errors) { 1522 const original = `${value}`; 1523 const str = original.replace(PARAM_REGEX, (_, varName) => { 1524 let localVal = params[varName]; 1525 // this means that the value was never overridden by the data passed in by the user 1526 if (localVal == null) { 1527 errors.push(invalidParamValue(varName)); 1528 localVal = ''; 1529 } 1530 return localVal.toString(); 1531 }); 1532 // we do this to assert that numeric values stay as they are 1533 return str == original ? value : str; 1534} 1535const DASH_CASE_REGEXP = /-+([a-z0-9])/g; 1536function dashCaseToCamelCase(input) { 1537 return input.replace(DASH_CASE_REGEXP, (...m) => m[1].toUpperCase()); 1538} 1539function camelCaseToDashCase(input) { 1540 return input.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase(); 1541} 1542function allowPreviousPlayerStylesMerge(duration, delay) { 1543 return duration === 0 || delay === 0; 1544} 1545function balancePreviousStylesIntoKeyframes(element, keyframes, previousStyles) { 1546 if (previousStyles.size && keyframes.length) { 1547 let startingKeyframe = keyframes[0]; 1548 let missingStyleProps = []; 1549 previousStyles.forEach((val, prop) => { 1550 if (!startingKeyframe.has(prop)) { 1551 missingStyleProps.push(prop); 1552 } 1553 startingKeyframe.set(prop, val); 1554 }); 1555 if (missingStyleProps.length) { 1556 for (let i = 1; i < keyframes.length; i++) { 1557 let kf = keyframes[i]; 1558 missingStyleProps.forEach(prop => kf.set(prop, computeStyle(element, prop))); 1559 } 1560 } 1561 } 1562 return keyframes; 1563} 1564function visitDslNode(visitor, node, context) { 1565 switch (node.type) { 1566 case _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_1__.AnimationMetadataType.Trigger: 1567 return visitor.visitTrigger(node, context); 1568 case _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_1__.AnimationMetadataType.State: 1569 return visitor.visitState(node, context); 1570 case _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_1__.AnimationMetadataType.Transition: 1571 return visitor.visitTransition(node, context); 1572 case _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_1__.AnimationMetadataType.Sequence: 1573 return visitor.visitSequence(node, context); 1574 case _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_1__.AnimationMetadataType.Group: 1575 return visitor.visitGroup(node, context); 1576 case _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_1__.AnimationMetadataType.Animate: 1577 return visitor.visitAnimate(node, context); 1578 case _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_1__.AnimationMetadataType.
1578Keyframes: 1579 return visitor.visitKeyframes(node, context); 1580 case _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_1__.AnimationMetadataType.Style: 1581 return visitor.visitStyle(node, context); 1582 case _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_1__.AnimationMetadataType.Reference: 1583 return visitor.visitReference(node, context); 1584 case _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_1__.AnimationMetadataType.AnimateChild: 1585 return visitor.visitAnimateChild(node, context); 1586 case _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_1__.AnimationMetadataType.AnimateRef: 1587 return visitor.visitAnimateRef(node, context); 1588 case _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_1__.AnimationMetadataType.Query: 1589 return visitor.visitQuery(node, context); 1590 case _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_1__.AnimationMetadataType.Stagger: 1591 return visitor.visitStagger(node, context); 1592 default: 1593 throw invalidNodeType(node.type); 1594 } 1595} 1596function computeStyle(element, prop) { 1597 return window.getComputedStyle(element)[prop]; 1598} 1599 1600//# sourceMappingURL=util-D9FfmVnv.mjs.map 1601 1602/***/ }), 1603 1604/***/ 11845: 1605/*!************************************************************************!*\ 1606 !*** ./node_modules/@angular/cdk/fesm2022/directionality-CBXD4hga.mjs ***! 1607 \************************************************************************/ 1608/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { 1609 1610__webpack_require__.r(__webpack_exports__); 1611/* harmony export */ __webpack_require__.d(__webpack_exports__, { 1612/* harmony export */ D: () => (/* binding */ Directionality), 1613/* harmony export */ _: () => (/* binding */ _resolveDirectionality), 1614/* harmony export */ a: () => (/* binding */ DIR_DOCUMENT) 1615/* harmony export */ }); 1616/* harmony import */ var C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/defineProperty.js */ 64467); 1617/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ 17705); 1618/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/common */ 59361); 1619 1620 1621 1622 1623 1624/** 1625 * Injection token used to inject the document into Directionality. 1626 * This is used so that the value can be faked in tests. 1627 * 1628 * We can't use the real document in tests because changing the real `dir` causes geometry-based 1629 * tests in Safari to fail. 1630 * 1631 * We also can't re-provide the DOCUMENT token from platform-browser because the unit tests 1632 * themselves use things like `querySelector` in test code. 1633 * 1634 * This token is defined in a separate file from Directionality as a workaround for 1635 * https://github.com/angular/angular/issues/22559 1636 * 1637 * @docs-private 1638 */ 1639const DIR_DOCUMENT = /*#__PURE__*/new _angular_core__WEBPACK_IMPORTED_MODULE_1__.InjectionToken('cdk-dir-doc', { 1640 providedIn: 'root', 1641 factory: DIR_DOCUMENT_FACTORY 1642}); 1643/** 1644 * @docs-private 1645 * @deprecated No longer used, will be removed. 1646 * @breaking-change 21.0.0 1647 */ 1648function DIR_DOCUMENT_FACTORY() { 1649 return (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.inject)(_angular_common__WEBPACK_IMPORTED_MODULE_2__.DOCUMENT); 1650} 1651 1652/** Regex that matches locales with an RTL script. Taken from `goog.i18n.bidi.isRtlLanguage`. */ 1653const RTL_LOCALE_PATTERN = /^(ar|ckb|dv|he|iw|fa|nqo|ps|sd|ug|ur|yi|.*[-_](Adlm|Arab|Hebr|Nkoo|Rohg|Thaa))(?!.*[-_](Latn|Cyrl)($|-|_))($|-|_)/i; 1654/** Resolves a string value to a specific direction. */ 1655function _resolveDirectionality(rawValue) { 1656 var _navigator; 1657 const value = (rawValue === null || rawValue === void 0 ? void 0 : rawValue.toLowerCase()) || ''; 1658 if (value === 'auto' && typeof navigator !== 'undefined' && (_navigator = navigator) !== null && _navigator !== void 0 && _navigator.language) { 1659 return RTL_LOCALE_PATTERN.test(navigator.language) ? 'rtl' : 'ltr'; 1660 } 1661 return value === 'rtl' ? 'rtl' : 'ltr'; 1662} 1663/** 1664 * The directionality (LTR / RTL) context for the application (or a subtree of it). 1665 * Exposes the current direction and a stream of direction changes. 1666 */ 1667let Directionality = /*#__PURE__*/(() => { 1668 var _Directionality; 1669 class Directionality { 1670 constructor() { 1671 /** The current 'ltr' or 'rtl' value. */ 1672 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "value", 'ltr'); 1673 /** Stream that emits whenever the 'ltr' / 'rtl' state changes. */ 1674 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "change", new _angular_core__WEBPACK_IMPORTED_MODULE_1__.EventEmitter()); 1675 const _document = (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.inject)(DIR_DOCUMENT, { 1676 optional: true 1677 }); 1678 if (_document) { 1679 const bodyDir = _document.body ? _document.body.dir : null; 1680 const htmlDir = _document.documentElement ? _document.documentElement.dir : null; 1681 this.value = _resolveDirectionality(bodyDir || htmlDir || 'ltr'); 1682 } 1683 } 1684 ngOnDestroy() { 1685 this.change.complete(); 1686 } 1687 } 1688 _Directionality = Directionality; 1689 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Directionality, "\u0275fac", function _Directionality_Factory(__ngFactoryType__) { 1690 return new (__ngFactoryType__ || _Directionality)(); 1691 }); 1692 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Directionality, "\u0275prov", /* @__P
1692URE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ 1693 token: _Directionality, 1694 factory: _Directionality.ɵfac, 1695 providedIn: 'root' 1696 })); 1697 return Directionality; 1698})(); 1699/*#__PURE__*/(() => { 1700 (typeof ngDevMode === "undefined" || ngDevMode) && void 0; 1701})(); 1702 1703//# sourceMappingURL=directionality-CBXD4hga.mjs.map 1704 1705/***/ }), 1706 1707/***/ 17035: 1708/*!******************************************************************!*\ 1709 !*** ./node_modules/@angular/cdk/fesm2022/keycodes-CpHkExLC.mjs ***! 1710 \******************************************************************/ 1711/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { 1712 1713__webpack_require__.r(__webpack_exports__); 1714/* harmony export */ __webpack_require__.d(__webpack_exports__, { 1715/* harmony export */ $: () => (/* binding */ FF_EQUALS), 1716/* harmony export */ A: () => (/* binding */ A), 1717/* harmony export */ B: () => (/* binding */ BACKSPACE), 1718/* harmony export */ C: () => (/* binding */ CONTROL), 1719/* harmony export */ D: () => (/* binding */ DOWN_ARROW), 1720/* harmony export */ E: () => (/* binding */ END), 1721/* harmony export */ F: () => (/* binding */ F1), 1722/* harmony export */ G: () => (/* binding */ PRINT_SCREEN), 1723/* harmony export */ H: () => (/* binding */ HOME), 1724/* harmony export */ I: () => (/* binding */ INSERT), 1725/* harmony export */ J: () => (/* binding */ TWO), 1726/* harmony export */ K: () => (/* binding */ THREE), 1727/* harmony export */ L: () => (/* binding */ LEFT_ARROW), 1728/* harmony export */ M: () => (/* binding */ MAC_META), 1729/* harmony export */ N: () => (/* binding */ NINE), 1730/* harmony export */ O: () => (/* binding */ ONE), 1731/* harmony export */ P: () => (/* binding */ PAGE_DOWN), 1732/* harmony export */ Q: () => (/* binding */ FOUR), 1733/* harmony export */ R: () => (/* binding */ RIGHT_ARROW), 1734/* harmony export */ S: () => (/* binding */ SPACE), 1735/* harmony export */ T: () => (/* binding */ TAB), 1736/* harmony export */ U: () => (/* binding */ UP_ARROW), 1737/* harmony export */ V: () => (/* binding */ FIVE), 1738/* harmony export */ W: () => (/* binding */ SIX), 1739/* harmony export */ X: () => (/* binding */ SEVEN), 1740/* harmony export */ Y: () => (/* binding */ EIGHT), 1741/* harmony export */ Z: () => (/* binding */ Z), 1742/* harmony export */ _: () => (/* binding */ FF_SEMICOLON), 1743/* harmony export */ a: () => (/* binding */ PAGE_UP), 1744/* harmony export */ a$: () => (/* binding */ CLOSE_SQUARE_BRACKET), 1745/* harmony export */ a0: () => (/* binding */ QUESTION_MARK), 1746/* harmony export */ a1: () => (/* binding */ AT_SIGN), 1747/* harmony export */ a2: () => (/* binding */ B), 1748/* harmony export */ a3: () => (/* binding */ C), 1749/* harmony export */ a4: () => (/* binding */ D), 1750/* harmony export */ a5: () => (/* binding */ E), 1751/* harmony export */ a6: () => (/* binding */ F), 1752/* harmony export */ a7: () => (/* binding */ G), 1753/* harmony export */ a8: () => (/* binding */ H), 1754/* harmony export */ a9: () => (/* binding */ I), 1755/* harmony export */ aA: () => (/* binding */ NUMPAD_SEVEN), 1756/* harmony export */ aB: () => (/* binding */ NUMPAD_EIGHT), 1757/* harmony export */ aC: () => (/* binding */ NUMPAD_NINE), 1758/* harmony export */ aD: () => (/* binding */ NUMPAD_MULTIPLY), 1759/* harmony export */ aE: () => (/* binding */ NUMPAD_PLUS), 1760/* harmony export */ aF: () => (/* binding */ NUMPAD_MINUS), 1761/* harmony export */ aG: () => (/* binding */ NUMPAD_PERIOD), 1762/* harmony export */ aH: () => (/* binding */ NUMPAD_DIVIDE), 1763/* harmony export */ aI: () => (/* binding */ NUM_LOCK), 1764/* harmony export */ aJ: () => (/* binding */ SCROLL_LOCK), 1765/* harmony export */ aK: () => (/* binding */ FIRST_MEDIA), 1766/* harmony export */ aL: () => (/* binding */ FF_MINUS), 1767/* harmony export */ aM: () => (/* binding */ MUTE), 1768/* harmony export */ aN: () => (/* binding */ VOLUME_DOWN), 1769/* harmony export */ aO: () => (/* binding */ VOLUME_UP), 1770/* harmony export */ aP: () => (/* binding */ FF_MUTE), 1771/* harmony export */ aQ: () => (/* binding */ FF_VOLUME_DOWN), 1772/* harmony export */ aR: () => (/* binding */ LAST_MEDIA), 1773/* harmony export */ aS: () => (/* binding */ FF_VOLUME_UP), 1774/* harmony export */ aT: () => (/* binding */ SEMICOLON), 1775/* harmony export */ aU: () => (/* binding */ EQUALS), 1776/* harmony export */ aV: () => (/* binding */ DASH), 1777/* harmony export */ aW: () => (/* binding */ SLASH), 1778/* harmony export */ aX: () => (/* binding */ APOSTROPHE), 1779/* harmony export */ aY: () => (/* binding */ TILDE), 1780/* harmony export */ aZ: () => (/* binding */ OPEN_SQUARE_BRACKET), 1781/* harmony export */ a_: () => (/* binding */ BACKSLASH), 1782/* harmony export */ aa: () => (/* binding */ J), 1783/* harmony export */ ab: () => (/* binding */ K), 1784/* harmony export */ ac: () => (/* binding */ L), 1785/* harmony export */ ad: () => (/* binding */ M), 1786/* harmony export */ ae: () => (/* binding */ N), 1787/* harmony export */ af: () => (/* binding */ O), 1788/* harmony export */ ag: () => (/* binding */ P), 1789/* harmony export */ ah: () => (/* binding */ Q), 1790/* harmony export */ ai: () => (/* binding */ R), 1791/* harmony export */ aj: () => (/* binding */ S), 1792/* harmony export */ ak: () => (/* binding */ T), 1793/* harmony export */ al: () => (/* binding */ U), 1794/* harmony export */ am: () => (/* binding */ V), 1795/* harmony export */ an: () => (/* binding */ W), 1796/* harmony export */ ao: () => (/* binding */ X), 1797/* harmony export */ ap: () => (/* binding */ Y), 1798/* harmony export */ aq: () => (/* binding */ MAC_WK_CMD_LEFT), 1799/* harmony export */ ar: () => (/* binding */ MAC_WK_CMD_RIGHT), 1800/* harmony export */ as: () => (/* binding */ CONTEXT_MENU), 1801/* harmony export */ at: () => (/* binding */ NUMPAD_ZERO), 1802/* harmony export */ au: () => (/* binding */ NUMPAD_ONE), 1803/* harmony export */ av: () => (/* binding */ NUMPAD_TWO), 1804/* harmony export */ aw: () => (/* binding */ NUMPAD_THREE), 1805/* harmony export */ ax: () => (/* binding */ NUMPAD_FOUR), 1806/* harmony export */ ay: () => (/* binding */ NUMPAD_FIVE), 1807/* harmony export */ az: () => (/* binding */ NUMPAD_SIX), 1808/* harmony export */ b: () => (/* binding */ ZERO), 1809/* harmony export */ b0: () => (/* binding */ SINGLE_QUOTE), 1810/* harmony export */ c: () => (/* binding */ ENTER), 1811/* harmony export */ d: () => (/* binding */ ALT), 1812/* harmony export */ e: () => (/* binding */ META), 1813/* harmony export */ f: () => (/* binding */ SHIFT), 1814/* harmony export */ g: () => (/* binding */ ESCAPE), 1815/* harmony export */ h: () => (/* binding */ PERIOD), 1816/* harmony export */ i: () =>
1816 (/* binding */ DELETE), 1817/* harmony export */ j: () => (/* binding */ F2), 1818/* harmony export */ k: () => (/* binding */ F3), 1819/* harmony export */ l: () => (/* binding */ F4), 1820/* harmony export */ m: () => (/* binding */ F5), 1821/* harmony export */ n: () => (/* binding */ F6), 1822/* harmony export */ o: () => (/* binding */ F7), 1823/* harmony export */ p: () => (/* binding */ F8), 1824/* harmony export */ q: () => (/* binding */ F9), 1825/* harmony export */ r: () => (/* binding */ F10), 1826/* harmony export */ s: () => (/* binding */ F11), 1827/* harmony export */ t: () => (/* binding */ F12), 1828/* harmony export */ u: () => (/* binding */ COMMA), 1829/* harmony export */ v: () => (/* binding */ MAC_ENTER), 1830/* harmony export */ w: () => (/* binding */ NUM_CENTER), 1831/* harmony export */ x: () => (/* binding */ PAUSE), 1832/* harmony export */ y: () => (/* binding */ CAPS_LOCK), 1833/* harmony export */ z: () => (/* binding */ PLUS_SIGN) 1834/* harmony export */ }); 1835const MAC_ENTER = 3; 1836const BACKSPACE = 8; 1837const TAB = 9; 1838const NUM_CENTER = 12; 1839const ENTER = 13; 1840const SHIFT = 16; 1841const CONTROL = 17; 1842const ALT = 18; 1843const PAUSE = 19; 1844const CAPS_LOCK = 20; 1845const ESCAPE = 27; 1846const SPACE = 32; 1847const PAGE_UP = 33; 1848const PAGE_DOWN = 34; 1849const END = 35; 1850const HOME = 36; 1851const LEFT_ARROW = 37; 1852const UP_ARROW = 38; 1853const RIGHT_ARROW = 39; 1854const DOWN_ARROW = 40; 1855const PLUS_SIGN = 43; 1856const PRINT_SCREEN = 44; 1857const INSERT = 45; 1858const DELETE = 46; 1859const ZERO = 48; 1860const ONE = 49; 1861const TWO = 50; 1862const THREE = 51; 1863const FOUR = 52; 1864const FIVE = 53; 1865const SIX = 54; 1866const SEVEN = 55; 1867const EIGHT = 56; 1868const NINE = 57; 1869const FF_SEMICOLON = 59; // Firefox (Gecko) fires this for semicolon instead of 186 1870const FF_EQUALS = 61; // Firefox (Gecko) fires this for equals instead of 187 1871const QUESTION_MARK = 63; 1872const AT_SIGN = 64; 1873const A = 65; 1874const B = 66; 1875const C = 67; 1876const D = 68; 1877const E = 69; 1878const F = 70; 1879const G = 71; 1880const H = 72; 1881const I = 73; 1882const J = 74; 1883const K = 75; 1884const L = 76; 1885const M = 77; 1886const N = 78; 1887const O = 79; 1888const P = 80; 1889const Q = 81; 1890const R = 82; 1891const S = 83; 1892const T = 84; 1893const U = 85; 1894const V = 86; 1895const W = 87; 1896const X = 88; 1897const Y = 89; 1898const Z = 90; 1899const META = 91; // WIN_KEY_LEFT 1900const MAC_WK_CMD_LEFT = 91; 1901const MAC_WK_CMD_RIGHT = 93; 1902const CONTEXT_MENU = 93; 1903const NUMPAD_ZERO = 96; 1904const NUMPAD_ONE = 97; 1905const NUMPAD_TWO = 98; 1906const NUMPAD_THREE = 99; 1907const NUMPAD_FOUR = 100; 1908const NUMPAD_FIVE = 101; 1909const NUMPAD_SIX = 102; 1910const NUMPAD_SEVEN = 103; 1911const NUMPAD_EIGHT = 104; 1912const NUMPAD_NINE = 105; 1913const NUMPAD_MULTIPLY = 106; 1914const NUMPAD_PLUS = 107; 1915const NUMPAD_MINUS = 109; 1916const NUMPAD_PERIOD = 110; 1917const NUMPAD_DIVIDE = 111; 1918const F1 = 112; 1919const F2 = 113; 1920const F3 = 114; 1921const F4 = 115; 1922const F5 = 116; 1923const F6 = 117; 1924const F7 = 118; 1925const F8 = 119; 1926const F9 = 120; 1927const F10 = 121; 1928const F11 = 122; 1929const F12 = 123; 1930const NUM_LOCK = 144; 1931const SCROLL_LOCK = 145; 1932const FIRST_MEDIA = 166; 1933const FF_MINUS = 173; 1934const MUTE = 173; // Firefox (Gecko) fires 181 for MUTE 1935const VOLUME_DOWN = 174; // Firefox (Gecko) fires 182 for VOLUME_DOWN 1936const VOLUME_UP = 175; // Firefox (Gecko) fires 183 for VOLUME_UP 1937const FF_MUTE = 181; 1938const FF_VOLUME_DOWN = 182; 1939const LAST_MEDIA = 183; 1940const FF_VOLUME_UP = 183; 1941const SEMICOLON = 186; // Firefox (Gecko) fires 59 for SEMICOLON 1942const EQUALS = 187; // Firefox (Gecko) fires 61 for EQUALS 1943const COMMA = 188; 1944const DASH = 189; // Firefox (Gecko) fires 173 for DASH/MINUS 1945const PERIOD = 190; 1946const SLASH = 191; 1947const APOSTROPHE = 192; 1948const TILDE = 192; 1949const OPEN_SQUARE_BRACKET = 219; 1950const BACKSLASH = 220; 1951const CLOSE_SQUARE_BRACKET = 221; 1952const SINGLE_QUOTE = 222; 1953const MAC_META = 224; 1954 1955//# sourceMappingURL=keycodes-CpHkExLC.mjs.map 1956 1957/***/ }), 1958 1959/***/ 23291: 1960/*!***************************************************************************!*\ 1961 !*** ./node_modules/@angular/cdk/fesm2022/portal-directives-Bw5woq8I.mjs ***! 1962 \***************************************************************************/ 1963/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { 1964 1965__webpack_require__.r(__webpack_exports__); 1966/* harmony export */ __webpack_require__.d(__webpack_exports__, { 1967/* harmony export */ B: () => (/* binding */ BasePortalOutlet), 1968/* harmony export */ C: () => (/* binding */ ComponentPortal), 1969/* harmony export */ D: () => (/* binding */ DomPortal), 1970/* harmony export */ P: () => (/* binding */ Portal), 1971/* harmony export */ T: () => (/* binding */ TemplatePortal), 1972/* harmony export */ a: () => (/* binding */ BasePortalHost), 1973/* harmony export */ b: () => (/* binding */ DomPortalOutlet), 1974/* harmony export */ c: () => (/* binding */ DomPortalHost), 1975/* harmony export */ d: () => (/* binding */ CdkPortal), 1976/* harmony export */ e: () => (/* binding */ TemplatePortalDirective), 1977/* harmony export */ f: () => (/* binding */ CdkPortalOutlet), 1978/* harmony export */ g: () => (/* binding */ PortalHostDirective), 1979/* harmony export */ h: () => (/* binding */ PortalModule) 1980/* harmony export */ }); 1981/* harmony import */ var C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/defineProperty.js */ 64467); 1982/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ 17705); 1983/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/common */ 59361); 1984 1985 1986 1987 1988 1989/** 1990 * Throws an exception when attempting to attach a null portal to a host. 1991 * @docs-private 1992 */ 1993function throwNullPortalError() { 1994 throw Error('Must provide a portal to attach'); 1995} 1996/** 1997 * Throws an exception when attempting to attach a portal to a host that is already attached.
1998 * @docs-private 1999 */ 2000function throwPortalAlreadyAttachedError() { 2001 throw Error('Host already has a portal attached'); 2002} 2003/** 2004 * Throws an exception when attempting to attach a portal to an already-disposed host. 2005 * @docs-private 2006 */ 2007function throwPortalOutletAlreadyDisposedError() { 2008 throw Error('This PortalOutlet has already been disposed'); 2009} 2010/** 2011 * Throws an exception when attempting to attach an unknown portal type. 2012 * @docs-private 2013 */ 2014function throwUnknownPortalTypeError() { 2015 throw Error('Attempting to attach an unknown Portal type. BasePortalOutlet accepts either ' + 'a ComponentPortal or a TemplatePortal.'); 2016} 2017/** 2018 * Throws an exception when attempting to attach a portal to a null host. 2019 * @docs-private 2020 */ 2021function throwNullPortalOutletError() { 2022 throw Error('Attempting to attach a portal to a null PortalOutlet'); 2023} 2024/** 2025 * Throws an exception when attempting to detach a portal that is not attached. 2026 * @docs-private 2027 */ 2028function throwNoPortalAttachedError() { 2029 throw Error('Attempting to detach a portal that is not attached to a host'); 2030} 2031 2032/** 2033 * A `Portal` is something that you want to render somewhere else. 2034 * It can be attach to / detached from a `PortalOutlet`. 2035 */ 2036class Portal { 2037 constructor() { 2038 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_attachedHost", void 0); 2039 } 2040 /** Attach this portal to a host. */ 2041 attach(host) { 2042 if (typeof ngDevMode === 'undefined' || ngDevMode) { 2043 if (host == null) { 2044 throwNullPortalOutletError(); 2045 } 2046 if (host.hasAttached()) { 2047 throwPortalAlreadyAttachedError(); 2048 } 2049 } 2050 this._attachedHost = host; 2051 return host.attach(this); 2052 } 2053 /** Detach this portal from its host */ 2054 detach() { 2055 let host = this._attachedHost; 2056 if (host != null) { 2057 this._attachedHost = null; 2058 host.detach(); 2059 } else if (typeof ngDevMode === 'undefined' || ngDevMode) { 2060 throwNoPortalAttachedError(); 2061 } 2062 } 2063 /** Whether this portal is attached to a host. */ 2064 get isAttached() { 2065 return this._attachedHost != null; 2066 } 2067 /** 2068 * Sets the PortalOutlet reference without performing `attach()`. This is used directly by 2069 * the PortalOutlet when it is performing an `attach()` or `detach()`. 2070 */ 2071 setAttachedHost(host) { 2072 this._attachedHost = host; 2073 } 2074} 2075/** 2076 * A `ComponentPortal` is a portal that instantiates some Component upon attachment. 2077 */ 2078class ComponentPortal extends Portal { 2079 constructor(component, viewContainerRef, injector, 2080 /** 2081 * @deprecated No longer in use. To be removed. 2082 * @breaking-change 18.0.0 2083 */ 2084 _componentFactoryResolver, projectableNodes) { 2085 super(); 2086 /** The type of the component that will be instantiated for attachment. */ 2087 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "component", void 0); 2088 /** 2089 * Where the attached component should live in Angular's *logical* component tree. 2090 * This is different from where the component *renders*, which is determined by the PortalOutlet. 2091 * The origin is necessary when the host is outside of the Angular application context. 2092 */ 2093 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "viewContainerRef", void 0); 2094 /** Injector used for the instantiation of the component. */ 2095 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "injector", void 0); 2096 /** 2097 * @deprecated No longer in use. To be removed. 2098 * @breaking-change 18.0.0 2099 */ 2100 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "componentFactoryResolver", void 0); 2101 /** 2102 * List of DOM nodes that should be projected through `<ng-content>` of the attached component. 2103 */ 2104 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "projectableNodes", void 0); 2105 this.component = component; 2106 this.viewContainerRef = viewContainerRef; 2107 this.injector = injector; 2108 this.projectableNodes = projectableNodes; 2109 } 2110} 2111/** 2112 * A `TemplatePortal` is a portal that represents some embedded template (TemplateRef). 2113 */ 2114class TemplatePortal extends Portal { 2115 constructor(/** The embedded template that will be used to instantiate an embedded View in the host. */ 2116 templateRef, /** Reference to the ViewContainer into which the template will be stamped out. */ 2117 viewContainerRef, /** Contextual data to be passed in to the embedded view. */ 2118 context, /** The injector to use for the embedded view. */ 2119 injector) { 2120 super(); 2121 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "templateRef", void 0); 2122 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "viewContainerRef", void 0); 2123 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "context", void 0); 2124 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "injector", void 0); 2125 this.templateRef = templateRef; 2126 this.viewContainerRef = viewContainerRef; 2127 this.context = context; 2128 this.injector = injector; 2129 } 2130 get origin() { 2131 return this.templateRef.elementRef; 2132 } 2133 /** 2134 * Attach the portal to the provided `PortalOutlet`. 2135 * When a context is provided it will override the `context` property of the `TemplatePortal` 2136 * instance. 2137 */ 2138 attach(host, context = this.context) { 2139 this.context = context; 2140 return super.attach(host); 2141 } 2142 detach() { 2143 this.context = undefined; 2144 return super.detach(); 2145 } 2146} 2147/** 2148 * A `DomPortal` is a portal whose DOM element will be taken from its current position 2149 * in the DOM and moved into a portal outlet, when it is attached. On detach, the content 2150 * will be restored to its original position. 2151 */ 2152class DomPortal extends Portal { 2153 constructor(element) { 2154 super(); 2155 /** DOM node hosting the portal's content. */ 2156 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "element", void 0); 2157 this.element = element instanceof _angular_core__WEBPACK_IMPORTED_MODULE_1__.ElementRef ? element.nativeElement : element; 2158 } 2159} 2160/** 2161 * Partial implementation of PortalOutlet that handles attaching 2162 * ComponentPortal and TemplatePortal. 2163 */ 2164class BasePortalOutlet { 2165 constructor() { 2166 /** The portal currently attached to the host. */ 2167 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_attachedPortal", void 0); 2168 /** A function that will permanently dispose this host. */ 2169 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_disposeFn", void 0); 2170 /** Whether this host has already been permanently disposed. */ 2171 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_isDisposed", false);
2172 // @breaking-change 10.0.0 `attachDomPortal` to become a required abstract method. 2173 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "attachDomPortal", null); 2174 } 2175 /** Whether this host has an attached portal. */ 2176 hasAttached() { 2177 return !!this._attachedPortal; 2178 } 2179 /** Attaches a portal. */ 2180 attach(portal) { 2181 if (typeof ngDevMode === 'undefined' || ngDevMode) { 2182 if (!portal) { 2183 throwNullPortalError(); 2184 } 2185 if (this.hasAttached()) { 2186 throwPortalAlreadyAttachedError(); 2187 } 2188 if (this._isDisposed) { 2189 throwPortalOutletAlreadyDisposedError(); 2190 } 2191 } 2192 if (portal instanceof ComponentPortal) { 2193 this._attachedPortal = portal; 2194 return this.attachComponentPortal(portal); 2195 } else if (portal instanceof TemplatePortal) { 2196 this._attachedPortal = portal; 2197 return this.attachTemplatePortal(portal); 2198 // @breaking-change 10.0.0 remove null check for `this.attachDomPortal`. 2199 } else if (this.attachDomPortal && portal instanceof DomPortal) { 2200 this._attachedPortal = portal; 2201 return this.attachDomPortal(portal); 2202 } 2203 if (typeof ngDevMode === 'undefined' || ngDevMode) { 2204 throwUnknownPortalTypeError(); 2205 } 2206 } 2207 /** Detaches a previously attached portal. */ 2208 detach() { 2209 if (this._attachedPortal) { 2210 this._attachedPortal.setAttachedHost(null); 2211 this._attachedPortal = null; 2212 } 2213 this._invokeDisposeFn(); 2214 } 2215 /** Permanently dispose of this portal host. */ 2216 dispose() { 2217 if (this.hasAttached()) { 2218 this.detach(); 2219 } 2220 this._invokeDisposeFn(); 2221 this._isDisposed = true; 2222 } 2223 /** @docs-private */ 2224 setDisposeFn(fn) { 2225 this._disposeFn = fn; 2226 } 2227 _invokeDisposeFn() { 2228 if (this._disposeFn) { 2229 this._disposeFn(); 2230 this._disposeFn = null; 2231 } 2232 } 2233} 2234/** 2235 * @deprecated Use `BasePortalOutlet` instead. 2236 * @breaking-change 9.0.0 2237 */ 2238class BasePortalHost extends BasePortalOutlet {} 2239 2240/** 2241 * A PortalOutlet for attaching portals to an arbitrary DOM element outside of the Angular 2242 * application context. 2243 */ 2244class DomPortalOutlet extends BasePortalOutlet { 2245 /** 2246 * @param outletElement Element into which the content is projected. 2247 * @param _unusedComponentFactoryResolver Used to resolve the component factory. 2248 * Only required when attaching component portals. 2249 * @param _appRef Reference to the application. Only used in component portals when there 2250 * is no `ViewContainerRef` available. 2251 * @param _defaultInjector Injector to use as a fallback when the portal being attached doesn't 2252 * have one. Only used for component portals. 2253 * @param _document Reference to the document. Used when attaching a DOM portal. Will eventually 2254 * become a required parameter. 2255 */ 2256 constructor(/** Element into which the content is projected. */ 2257 outletElement, 2258 /** 2259 * @deprecated No longer in use. To be removed. 2260 * @breaking-change 18.0.0 2261 */ 2262 _unusedComponentFactoryResolver, _appRef, _defaultInjector, 2263 /** 2264 * @deprecated `_document` Parameter to be made required. 2265 * @breaking-change 10.0.0 2266 */ 2267 _document) { 2268 super(); 2269 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "outletElement", void 0); 2270 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_appRef", void 0); 2271 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_defaultInjector", void 0); 2272 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_document", void 0); 2273 /** 2274 * Attaches a DOM portal by transferring its content into the outlet. 2275 * @param portal Portal to be attached.
2276 * @deprecated To be turned into a method. 2277 * @breaking-change 10.0.0 2278 */ 2279 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "attachDomPortal", portal => { 2280 const element = portal.element; 2281 if (!element.parentNode && (typeof ngDevMode === 'undefined' || ngDevMode)) { 2282 throw Error('DOM portal content must be attached to a parent node.'); 2283 } 2284 // Anchor used to save the element's previous position so 2285 // that we can restore it when the portal is detached. 2286 const anchorNode = this._document.createComment('dom-portal'); 2287 element.parentNode.insertBefore(anchorNode, element); 2288 this.outletElement.appendChild(element); 2289 this._attachedPortal = portal; 2290 super.setDisposeFn(() => { 2291 // We can't use `replaceWith` here because IE doesn't support it. 2292 if (anchorNode.parentNode) { 2293 anchorNode.parentNode.replaceChild(element, anchorNode); 2294 } 2295 }); 2296 }); 2297 this.outletElement = outletElement; 2298 this._appRef = _appRef; 2299 this._defaultInjector = _defaultInjector; 2300 this._document = _document; 2301 } 2302 /** 2303 * Attach the given ComponentPortal to DOM element. 2304 * @param portal Portal to be attached 2305 * @returns Reference to the created component. 2306 */ 2307 attachComponentPortal(portal) { 2308 let componentRef; 2309 // If the portal specifies a ViewContainerRef, we will use that as the attachment point 2310 // for the component (in terms of Angular's component tree, not rendering). 2311 // When the ViewContainerRef is missing, we use the factory to create the component directly 2312 // and then manually attach the view to the application. 2313 if (portal.viewContainerRef) { 2314 const injector = portal.injector || portal.viewContainerRef.injector; 2315 const ngModuleRef = injector.get(_angular_core__WEBPACK_IMPORTED_MODULE_1__.NgModuleRef, null, { 2316 optional: true 2317 }) || undefined; 2318 componentRef = portal.viewContainerRef.createComponent(portal.component, { 2319 index: portal.viewContainerRef.length, 2320 injector, 2321 ngModuleRef, 2322 projectableNodes: portal.projectableNodes || undefined 2323 }); 2324 this.setDisposeFn(() => componentRef.destroy()); 2325 } else { 2326 if ((typeof ngDevMode === 'undefined' || ngDevMode) && !this._appRef) { 2327 throw Error('Cannot attach component portal to outlet without an ApplicationRef.'); 2328 } 2329 const appRef = this._appRef; 2330 const elementInjector = portal.injector || this._defaultInjector || _angular_core__WEBPACK_IMPORTED_MODULE_1__.Injector.NULL; 2331 const environmentInjector = elementInjector.get(_angular_core__WEBPACK_IMPORTED_MODULE_1__.EnvironmentInjector, appRef.injector); 2332 componentRef = (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.createComponent)(portal.component, { 2333 elementInjector, 2334 environmentInjector, 2335 projectableNodes: portal.projectableNodes || undefined 2336 }); 2337 appRef.attachView(componentRef.hostView); 2338 this.setDisposeFn(() => { 2339 // Verify that the ApplicationRef has registered views before trying to detach a host view. 2340 // This check also protects the `detachView` from being called on a destroyed ApplicationRef. 2341 if (appRef.viewCount > 0) { 2342 appRef.detachView(componentRef.hostView); 2343 } 2344 componentRef.destroy(); 2345 }); 2346 } 2347 // At this point the component has been instantiated, so we move it to the location in the DOM 2348 // where we want it to be rendered. 2349 this.outletElement.appendChild(this._getComponentRootNode(componentRef)); 2350 this._attachedPortal = portal; 2351 return componentRef; 2352 } 2353 /** 2354 * Attaches a template portal to the DOM as an embedded view. 2355 * @param portal Portal to be attached. 2356 * @returns Reference to the created embedded view. 2357 */ 2358 attachTemplatePortal(portal) { 2359 let viewContainer = portal.viewContainerRef; 2360 let viewRef = viewContainer.createEmbeddedView(portal.templateRef, portal.context, { 2361 injector: portal.injector 2362 }); 2363 // The method `createEmbeddedView` will add the view as a child of the viewContainer. 2364 // But for the DomPortalOutlet the view can be added everywhere in the DOM 2365 // (e.g Overlay Container) To move the view to the specified host element. We just 2366 // re-append the existing root nodes.
2367 viewRef.rootNodes.forEach(rootNode => this.outletElement.appendChild(rootNode)); 2368 // Note that we want to detect changes after the nodes have been moved so that 2369 // any directives inside the portal that are looking at the DOM inside a lifecycle 2370 // hook won't be invoked too early. 2371 viewRef.detectChanges(); 2372 this.setDisposeFn(() => { 2373 let index = viewContainer.indexOf(viewRef); 2374 if (index !== -1) { 2375 viewContainer.remove(index); 2376 } 2377 }); 2378 this._attachedPortal = portal; 2379 // TODO(jelbourn): Return locals from view. 2380 return viewRef; 2381 } 2382 /** 2383 * Clears out a portal from the DOM. 2384 */ 2385 dispose() { 2386 super.dispose(); 2387 this.outletElement.remove(); 2388 } 2389 /** Gets the root HTMLElement for an instantiated component. */ 2390 _getComponentRootNode(componentRef) { 2391 return componentRef.hostView.rootNodes[0]; 2392 } 2393} 2394/** 2395 * @deprecated Use `DomPortalOutlet` instead. 2396 * @breaking-change 9.0.0 2397 */ 2398class DomPortalHost extends DomPortalOutlet {} 2399 2400/** 2401 * Directive version of a `TemplatePortal`. Because the directive *is* a TemplatePortal, 2402 * the directive instance itself can be attached to a host, enabling declarative use of portals. 2403 */ 2404let CdkPortal = /*#__PURE__*/(() => { 2405 var _CdkPortal; 2406 class CdkPortal extends TemplatePortal { 2407 constructor() { 2408 const templateRef = (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_1__.TemplateRef); 2409 const viewContainerRef = (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_1__.ViewContainerRef); 2410 super(templateRef, viewContainerRef); 2411 } 2412 } 2413 _CdkPortal = CdkPortal; 2414 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(CdkPortal, "\u0275fac", function _CdkPortal_Factory(__ngFactoryType__) { 2415 return new (__ngFactoryType__ || _CdkPortal)(); 2416 }); 2417 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(CdkPortal, "\u0275dir", /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineDirective"]({ 2418 type: _CdkPortal, 2419 selectors: [["", "cdkPortal", ""]], 2420 exportAs: ["cdkPortal"], 2421 features: [_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵInheritDefinitionFeature"]] 2422 })); 2423 return CdkPortal; 2424})(); 2425/*#__PURE__*/(() => { 2426 (typeof ngDevMode === "undefined" || ngDevMode) && void 0; 2427})(); 2428/** 2429 * @deprecated Use `CdkPortal` instead. 2430 * @breaking-change 9.0.0 2431 */ 2432let TemplatePortalDirective = /*#__PURE__*/(() => { 2433 var _TemplatePortalDirective; 2434 class TemplatePortalDirective extends CdkPortal {} 2435 _TemplatePortalDirective = TemplatePortalDirective; 2436 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(TemplatePortalDirective, "\u0275fac", /* @__PURE__ */(() => { 2437 let ɵ_TemplatePortalDirective_BaseFactory; 2438 return function _TemplatePortalDirective_Factory(__ngFactoryType__) { 2439 return (ɵ_TemplatePortalDirective_BaseFactory || (ɵ_TemplatePortalDirective_BaseFactory = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵgetInheritedFactory"](_TemplatePortalDirective)))(__ngFactoryType__ || _TemplatePortalDirective); 2440 }; 2441 })()); 2442 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(TemplatePortalDirective, "\u0275dir", /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineDirective"]({ 2443 type: _TemplatePortalDirective, 2444 selectors: [["", "cdk-portal", ""], ["", "portal", ""]], 2445 exportAs: ["cdkPortal"], 2446 features: [_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵProvidersFeature"]([{ 2447 provide: CdkPortal, 2448 useExisting: _TemplatePortalDirective 2449 }]), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵInheritDefinitionFeature"]] 2450 })); 2451 return TemplatePortalDirective; 2452})(); 2453/*#__PURE__*/(() => { 2454 (typeof ngDevMode === "undefined" || ngDevMode) && void 0; 2455})(); 2456/** 2457 * Directive version of a PortalOutlet. Because the directive *is* a PortalOutlet, portals can be 2458 * directly attached to it, enabling declarative use. 2459 * 2460 * Usage: 2461 * `<ng-template [cdkPortalOutlet]="greeting"></ng-template>` 2462 */ 2463let CdkPortalOutlet = /*#__PURE__*/(() => { 2464 var _CdkPortalOutlet; 2465 class CdkPortalOutlet extends BasePortalOutlet { 2466 constructor() { 2467 super(); 2468 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_moduleRef", (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_1__.NgModuleRef, { 2469 optional: true 2470 })); 2471 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_document", (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.inject)(_angular_common__WEBPACK_IMPORTED_MODULE_2__.DOCUMENT)); 2472 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_viewContainerRef", (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_1__.ViewContainerRef)); 2473 /** Whether the portal component is initialized. */ 2474 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_isInitialized", false); 2475 /** Reference to the currently-attached component/view ref. */ 2476 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_attachedRef", void 0); 2477 /** Emits when a portal is attached to the outlet. */ 2478 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "attached", new _angular_core__WEBPACK_IMPORTED_MODULE_1__.EventEmitter()); 2479 /** 2480 * Attaches the given DomPortal to this PortalHost by moving all of the portal content into
2480it. 2481 * @param portal Portal to be attached. 2482 * @deprecated To be turned into a method. 2483 * @breaking-change 10.0.0 2484 */ 2485 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "attachDomPortal", portal => { 2486 const element = portal.element; 2487 if (!element.parentNode && (typeof ngDevMode === 'undefined' || ngDevMode)) { 2488 throw Error('DOM portal content must be attached to a parent node.'); 2489 } 2490 // Anchor used to save the element's previous position so 2491 // that we can restore it when the portal is detached. 2492 const anchorNode = this._document.createComment('dom-portal'); 2493 portal.setAttachedHost(this); 2494 element.parentNode.insertBefore(anchorNode, element); 2495 this._getRootNode().appendChild(element); 2496 this._attachedPortal = portal; 2497 super.setDisposeFn(() => { 2498 if (anchorNode.parentNode) { 2499 anchorNode.parentNode.replaceChild(element, anchorNode); 2500 } 2501 }); 2502 }); 2503 } 2504 /** Portal associated with the Portal outlet. */ 2505 get portal() { 2506 return this._attachedPortal; 2507 } 2508 set portal(portal) { 2509 // Ignore the cases where the `portal` is set to a falsy value before the lifecycle hooks have 2510 // run. This handles the cases where the user might do something like `<div cdkPortalOutlet>` 2511 // and attach a portal programmatically in the parent component. When Angular does the first CD 2512 // round, it will fire the setter with empty string, causing the user's content to be cleared. 2513 if (this.hasAttached() && !portal && !this._isInitialized) { 2514 return; 2515 } 2516 if (this.hasAttached()) { 2517 super.detach(); 2518 } 2519 if (portal) { 2520 super.attach(portal); 2521 } 2522 this._attachedPortal = portal || null; 2523 } 2524 /** Component or view reference that is attached to the portal. */ 2525 get attachedRef() { 2526 return this._attachedRef; 2527 } 2528 ngOnInit() { 2529 this._isInitialized = true; 2530 } 2531 ngOnDestroy() { 2532 super.dispose(); 2533 this._attachedRef = this._attachedPortal = null; 2534 } 2535 /** 2536 * Attach the given ComponentPortal to this PortalOutlet. 2537 * 2538 * @param portal Portal to be attached to the portal outlet. 2539 * @returns Reference to the created component. 2540 */ 2541 attachComponentPortal(portal) { 2542 portal.setAttachedHost(this); 2543 // If the portal specifies an origin, use that as the logical location of the component 2544 // in the application tree. Otherwise use the location of this PortalOutlet. 2545 const viewContainerRef = portal.viewContainerRef != null ? portal.viewContainerRef : this._viewContainerRef; 2546 const ref = viewContainerRef.createComponent(portal.component, { 2547 index: viewContainerRef.length, 2548 injector: portal.injector || viewContainerRef.injector, 2549 projectableNodes: portal.projectableNodes || undefined, 2550 ngModuleRef: this._moduleRef || undefined 2551 }); 2552 // If we're using a view container that's different from the injected one (e.g. when the portal 2553 // specifies its own) we need to move the component into the outlet, otherwise it'll be rendered 2554 // inside of the alternate view container. 2555 if (viewContainerRef !== this._viewContainerRef) { 2556 this._getRootNode().appendChild(ref.hostView.rootNodes[0]); 2557 } 2558 super.setDisposeFn(() => ref.destroy()); 2559 this._attachedPortal = portal; 2560 this._attachedRef = ref; 2561 this.attached.emit(ref); 2562 return ref; 2563 } 2564 /** 2565 * Attach the given TemplatePortal to this PortalHost as an embedded View. 2566 * @param portal Portal to be attached. 2567 * @returns Reference to the created embedded view. 2568 */ 2569 attachTemplatePortal(portal) { 2570 portal.setAttachedHost(this); 2571 const viewRef = this._viewContainerRef.createEmbeddedView(portal.templateRef, portal.context, { 2572 injector: portal.injector 2573 }); 2574 super.setDisposeFn(() => this._viewContainerRef.clear()); 2575 this._attachedPortal = portal; 2576 this._attachedRef = viewRef; 2577 this.attached.emit(viewRef); 2578 return viewRef; 2579 } 2580 /** Gets the root node of the portal outlet. */ 2581 _getRootNode() { 2582 const nativeElement = this._viewContainerRef.element.nativeElement; 2583 // The directive could be set on a template which will result in a comment 2584 // node being the root. Use the comment's parent node if that is the case. 2585 return nativeElement.nodeType === nativeElement.ELEMENT_NODE ? nativeElement : nativeElement.parentNode; 2586 } 2587 } 2588 _CdkPortalOutlet = CdkPortalOutlet; 2589 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(CdkPortalOutlet, "\u0275fac", function _CdkPortalOutlet_Factory(__ngFactoryType__) { 2590 return new (__ngFactoryType__ || _CdkPortalOutlet)(); 2591 }); 2592 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(CdkPortalOutlet, "\u0275dir", /* @__P
2592URE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineDirective"]({ 2593 type: _CdkPortalOutlet, 2594 selectors: [["", "cdkPortalOutlet", ""]], 2595 inputs: { 2596 portal: [0, "cdkPortalOutlet", "portal"] 2597 }, 2598 outputs: { 2599 attached: "attached" 2600 }, 2601 exportAs: ["cdkPortalOutlet"], 2602 features: [_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵInheritDefinitionFeature"]] 2603 })); 2604 return CdkPortalOutlet; 2605})(); 2606/*#__PURE__*/(() => { 2607 (typeof ngDevMode === "undefined" || ngDevMode) && void 0; 2608})(); 2609/** 2610 * @deprecated Use `CdkPortalOutlet` instead. 2611 * @breaking-change 9.0.0 2612 */ 2613let PortalHostDirective = /*#__PURE__*/(() => { 2614 var _PortalHostDirective; 2615 class PortalHostDirective extends CdkPortalOutlet {} 2616 _PortalHostDirective = PortalHostDirective; 2617 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(PortalHostDirective, "\u0275fac", /* @__PURE__ */(() => { 2618 let ɵ_PortalHostDirective_BaseFactory; 2619 return function _PortalHostDirective_Factory(__ngFactoryType__) { 2620 return (ɵ_PortalHostDirective_BaseFactory || (ɵ_PortalHostDirective_BaseFactory = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵgetInheritedFactory"](_PortalHostDirective)))(__ngFactoryType__ || _PortalHostDirective); 2621 }; 2622 })()); 2623 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(PortalHostDirective, "\u0275dir", /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineDirective"]({ 2624 type: _PortalHostDirective, 2625 selectors: [["", "cdkPortalHost", ""], ["", "portalHost", ""]], 2626 inputs: { 2627 portal: [0, "cdkPortalHost", "portal"] 2628 }, 2629 exportAs: ["cdkPortalHost"], 2630 features: [_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵProvidersFeature"]([{ 2631 provide: CdkPortalOutlet, 2632 useExisting: _PortalHostDirective 2633 }]), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵInheritDefinitionFeature"]] 2634 })); 2635 return PortalHostDirective; 2636})(); 2637/*#__PURE__*/(() => { 2638 (typeof ngDevMode === "undefined" || ngDevMode) && void 0; 2639})(); 2640let PortalModule = /*#__PURE__*/(() => { 2641 var _PortalModule; 2642 class PortalModule {} 2643 _PortalModule = PortalModule; 2644 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(PortalModule, "\u0275fac", function _PortalModule_Factory(__ngFactoryType__) { 2645 return new (__ngFactoryType__ || _PortalModule)(); 2646 }); 2647 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(PortalModule, "\u0275mod", /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineNgModule"]({ 2648 type: _PortalModule 2649 })); 2650 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(PortalModule, "\u0275inj", /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjector"]({})); 2651 return PortalModule; 2652})(); 2653/*#__PURE__*/(() => { 2654 (typeof ngDevMode === "undefined" || ngDevMode) && void 0; 2655})(); 2656 2657//# sourceMappingURL=portal-directives-Bw5woq8I.mjs.map 2658 2659/***/ }), 2660 2661/***/ 28203: 2662/*!*****************************************************!*\ 2663 !*** ./node_modules/@angular/cdk/fesm2022/bidi.mjs ***! 2664 \*****************************************************/ 2665/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { 2666 2667__webpack_require__.r(__webpack_exports__); 2668/* harmony export */ __webpack_require__.d(__webpack_exports__, { 2669/* harmony export */ BidiModule: () => (/* binding */ BidiModule), 2670/* harmony export */ DIR_DOCUMENT: () => (/* reexport safe */ _directionality_CBXD4hga_mjs__WEBPACK_IMPORTED_MODULE_1__.a), 2671/* harmony export */ Dir: () => (/* binding */ Dir), 2672/* harmony export */ Directionality: () => (/* reexport safe */ _directionality_CBXD4hga_mjs__WEBPACK_IMPORTED_MODULE_1__.D) 2673/* harmony export */ }); 2674/* harmony import */ var C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/defineProperty.js */ 64467); 2675/* harmony import */ var _directionality_CBXD4hga_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./directionality-CBXD4hga.mjs */ 11845); 2676/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/core */ 17705); 2677 2678 2679 2680 2681 2682 2683 2684/** 2685 * Directive to listen for changes of direction of part of the DOM. 2686 * 2687 * Provides itself as Directionality such that descendant directives only need to ever inject 2688 * Directionality to get the closest direction. 2689 */ 2690let Dir = /*#__PURE__*/(() => { 2691 var _Dir; 2692 class Dir { 2693 constructor() { 2694 /** Normalized direction that accounts for invalid/unsupported values. */ 2695 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_dir", 'ltr'); 2696 /** Whether the `value` has been set to its initial value. */ 2697 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_isInitialized", false); 2698 /** Direction as passed in by the consumer. */ 2699 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_rawDir", void 0); 2700 /** Event emitted when the direction changes. */ 2701 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "change", new _angular_core__WEBPACK_IMPORTED_MODULE_2__.EventEmitter()); 2702 } 2703 /** @docs-private */ 2704 get dir() { 2705 return this._dir; 2706 } 2707 set dir(value) { 2708 const previousValue = this._dir; 2709 // Note: `_resolveDirectionality` resolves the language based on the browser's language, 2710 // whereas the browser does it based on the content of the element. Since doing so based 2711 // on the content can be expensive, for now we're doing the simpler matching. 2712 this._dir = (0,_directionality_CBXD4hga_mjs__WEBPACK_IMPORTED_MODULE_1__._)(value); 2713 this._rawDir = value; 2714 if (previousValue !== this._dir && this._isInitialized) { 2715 this.change.emit(this._dir); 2716 } 2717 } 2718 /** Current layout direction of the element. */ 2719 get value() { 2720 return this.dir; 2721 } 2722 /** Initialize once default value has been set. */ 2723 ngAfterContentInit() { 2724 this._isInitialized = true; 2725 } 2726 ngOnDestroy() { 2727 this.change.complete(); 2728 } 2729 } 2730 _Dir = Dir; 2731 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Dir, "\u0275fac", function _Dir_Factory(__ngFactoryType__) { 2732 return new (__ngFactoryType__ || _Dir)(); 2733 }); 2734 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Dir, "\u0275dir", /* @__P
2734URE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineDirective"]({ 2735 type: _Dir, 2736 selectors: [["", "dir", ""]], 2737 hostVars: 1, 2738 hostBindings: function _Dir_HostBindings(rf, ctx) { 2739 if (rf & 2) { 2740 _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵattribute"]("dir", ctx._rawDir); 2741 } 2742 }, 2743 inputs: { 2744 dir: "dir" 2745 }, 2746 outputs: { 2747 change: "dirChange" 2748 }, 2749 exportAs: ["dir"], 2750 features: [_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵProvidersFeature"]([{ 2751 provide: _directionality_CBXD4hga_mjs__WEBPACK_IMPORTED_MODULE_1__.D, 2752 useExisting: _Dir 2753 }])] 2754 })); 2755 return Dir; 2756})(); 2757/*#__PURE__*/(() => { 2758 (typeof ngDevMode === "undefined" || ngDevMode) && void 0; 2759})(); 2760let BidiModule = /*#__PURE__*/(() => { 2761 var _BidiModule; 2762 class BidiModule {} 2763 _BidiModule = BidiModule; 2764 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(BidiModule, "\u0275fac", function _BidiModule_Factory(__ngFactoryType__) { 2765 return new (__ngFactoryType__ || _BidiModule)(); 2766 }); 2767 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(BidiModule, "\u0275mod", /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineNgModule"]({ 2768 type: _BidiModule 2769 })); 2770 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(BidiModule, "\u0275inj", /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineInjector"]({})); 2771 return BidiModule; 2772})(); 2773/*#__PURE__*/(() => { 2774 (typeof ngDevMode === "undefined" || ngDevMode) && void 0; 2775})(); 2776 2777//# sourceMappingURL=bidi.mjs.map 2778 2779/***/ }), 2780 2781/***/ 29650: 2782/*!************************************************************************!*\ 2783 !*** ./node_modules/@angular/platform-browser/fesm2022/animations.mjs ***! 2784 \************************************************************************/ 2785/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { 2786 2787__webpack_require__.r(__webpack_exports__); 2788/* harmony export */ __webpack_require__.d(__webpack_exports__, { 2789/* harmony export */ ANIMATION_MODULE_TYPE: () => (/* reexport safe */ _angular_core__WEBPACK_IMPORTED_MODULE_1__.ANIMATION_MODULE_TYPE), 2790/* harmony export */ BrowserAnimationsModule: () => (/* binding */ BrowserAnimationsModule), 2791/* harmony export */ NoopAnimationsModule: () => (/* binding */ NoopAnimationsModule), 2792/* harmony export */ provideAnimations: () => (/* binding */ provideAnimations), 2793/* harmony export */ provideNoopAnimations: () => (/* binding */ provideNoopAnimations), 2794/* harmony export */ "ɵInjectableAnimationEngine": () => (/* binding */ InjectableAnimationEngine) 2795/* harmony export */ }); 2796/* harmony import */ var C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/defineProperty.js */ 64467); 2797/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ 17705); 2798/* harmony import */ var _angular_animations_browser__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/animations/browser */ 68008); 2799/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/common */ 59361); 2800/* harmony import */ var _dom_renderer_DGKzginR_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./dom_renderer-DGKzginR.mjs */ 63142); 2801/* harmony import */ var _browser_D_u_fknz_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./browser-D-u-fknz.mjs */ 45932); 2802 2803/** 2804 * @license Angular v19.2.14 2805 * (c) 2010-2025 Google LLC. https://angular.io/ 2806 * License: MIT 2807 */ 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817let InjectableAnimationEngine = /*#__PURE__*/(() => { 2818 var _InjectableAnimationEngine; 2819 class InjectableAnimationEngine extends _angular_animations_browser__WEBPACK_IMPORTED_MODULE_2__["ɵAnimationEngine"] { 2820 // The `ApplicationRef` is injected here explicitly to force the dependency ordering. 2821 // Since the `ApplicationRef` should be created earlier before the `AnimationEngine`, they 2822 // both have `ngOnDestroy` hooks and `flush()` must be called after all views are destroyed. 2823 constructor(doc, driver, normalizer) { 2824 super(doc, driver, normalizer); 2825 } 2826 ngOnDestroy() { 2827 this.flush(); 2828 } 2829 } 2830 _InjectableAnimationEngine = InjectableAnimationEngine; 2831 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(InjectableAnimationEngine, "\u0275fac", function _InjectableAnimationEngine_Factory(__ngFactoryType__) { 2832 return new (__ngFactoryType__ || _InjectableAnimationEngine)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_common__WEBPACK_IMPORTED_MODULE_3__.DOCUMENT), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_animations_browser__WEBPACK_IMPORTED_MODULE_2__.AnimationDriver), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_animations_browser__WEBPACK_IMPORTED_MODULE_2__["ɵAnimationStyleNormalizer"])); 2833 }); 2834 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(InjectableAnimationEngine, "\u0275prov", /* @__P
2834URE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ 2835 token: _InjectableAnimationEngine, 2836 factory: _InjectableAnimationEngine.ɵfac 2837 })); 2838 return InjectableAnimationEngine; 2839})(); 2840/*#__PURE__*/(() => { 2841 (typeof ngDevMode === "undefined" || ngDevMode) && void 0; 2842})(); 2843function instantiateDefaultStyleNormalizer() { 2844 return new _angular_animations_browser__WEBPACK_IMPORTED_MODULE_2__["ɵWebAnimationsStyleNormalizer"](); 2845} 2846function instantiateRendererFactory(renderer, engine, zone) { 2847 return new _angular_animations_browser__WEBPACK_IMPORTED_MODULE_2__["ɵAnimationRendererFactory"](renderer, engine, zone); 2848} 2849const SHARED_ANIMATION_PROVIDERS = [{ 2850 provide: _angular_animations_browser__WEBPACK_IMPORTED_MODULE_2__["ɵAnimationStyleNormalizer"], 2851 useFactory: instantiateDefaultStyleNormalizer 2852}, { 2853 provide: _angular_animations_browser__WEBPACK_IMPORTED_MODULE_2__["ɵAnimationEngine"], 2854 useClass: InjectableAnimationEngine 2855}, { 2856 provide: _angular_core__WEBPACK_IMPORTED_MODULE_1__.RendererFactory2, 2857 useFactory: instantiateRendererFactory, 2858 deps: [_dom_renderer_DGKzginR_mjs__WEBPACK_IMPORTED_MODULE_4__.DomRendererFactory2, _angular_animations_browser__WEBPACK_IMPORTED_MODULE_2__["ɵAnimationEngine"], _angular_core__WEBPACK_IMPORTED_MODULE_1__.NgZone] 2859}]; 2860/** 2861 * Separate providers from the actual module so that we can do a local modification in Google3 to 2862 * include them in the BrowserTestingModule. 2863 */ 2864const BROWSER_NOOP_ANIMATIONS_PROVIDERS = [{ 2865 provide: _angular_animations_browser__WEBPACK_IMPORTED_MODULE_2__.AnimationDriver, 2866 useClass: _angular_animations_browser__WEBPACK_IMPORTED_MODULE_2__.NoopAnimationDriver 2867}, { 2868 provide: _angular_core__WEBPACK_IMPORTED_MODULE_1__.ANIMATION_MODULE_TYPE, 2869 useValue: 'NoopAnimations' 2870}, ...SHARED_ANIMATION_PROVIDERS]; 2871/** 2872 * Separate providers from the actual module so that we can do a local modification in Google3 to 2873 * include them in the BrowserModule. 2874 */ 2875const BROWSER_ANIMATIONS_PROVIDERS = [ 2876// Note: the `ngServerMode` happen inside factories to give the variable time to initialize. 2877{ 2878 provide: _angular_animations_browser__WEBPACK_IMPORTED_MODULE_2__.AnimationDriver, 2879 useFactory: () => typeof ngServerMode !== 'undefined' && ngServerMode ? new _angular_animations_browser__WEBPACK_IMPORTED_MODULE_2__.NoopAnimationDriver() : new _angular_animations_browser__WEBPACK_IMPORTED_MODULE_2__["ɵWebAnimationsDriver"]() 2880}, { 2881 provide: _angular_core__WEBPACK_IMPORTED_MODULE_1__.ANIMATION_MODULE_TYPE, 2882 useFactory: () => typeof ngServerMode !== 'undefined' && ngServerMode ? 'NoopAnimations' : 'BrowserAnimations' 2883}, ...SHARED_ANIMATION_PROVIDERS]; 2884 2885/** 2886 * Exports `BrowserModule` with additional dependency-injection providers 2887 * for use with animations. See [Animations](guide/animations). 2888 * @publicApi 2889 */ 2890let BrowserAnimationsModule = /*#__PURE__*/(() => { 2891 var _BrowserAnimationsModule; 2892 class BrowserAnimationsModule { 2893 /** 2894 * Configures the module based on the specified object. 2895 * 2896 * @param config Object used to configure the behavior of the `BrowserAnimationsModule`. 2897 * @see {@link BrowserAnimationsModuleConfig} 2898 * 2899 * @usageNotes 2900 * When registering the `BrowserAnimationsModule`, you can use the `withConfig` 2901 * function as follows: 2902 * ```ts 2903 * @NgModule({ 2904 * imports: [BrowserAnimationsModule.withConfig(config)] 2905 * }) 2906 * class MyNgModule {} 2907 * ``` 2908 */ 2909 static withConfig(config) { 2910 return { 2911 ngModule: BrowserAnimationsModule, 2912 providers: config.disableAnimations ? BROWSER_NOOP_ANIMATIONS_PROVIDERS : BROWSER_ANIMATIONS_PROVIDERS 2913 }; 2914 } 2915 } 2916 _BrowserAnimationsModule = BrowserAnimationsModule; 2917 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(BrowserAnimationsModule, "\u0275fac", function _BrowserAnimationsModule_Factory(__ngFactoryType__) { 2918 return new (__ngFactoryType__ || _BrowserAnimationsModule)(); 2919 }); 2920 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(BrowserAnimationsModule, "\u0275mod", /* @__P
2920URE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineNgModule"]({ 2921 type: _BrowserAnimationsModule 2922 })); 2923 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(BrowserAnimationsModule, "\u0275inj", /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjector"]({ 2924 providers: BROWSER_ANIMATIONS_PROVIDERS, 2925 imports: [_browser_D_u_fknz_mjs__WEBPACK_IMPORTED_MODULE_5__.BrowserModule] 2926 })); 2927 return BrowserAnimationsModule; 2928})(); 2929/*#__PURE__*/(() => { 2930 (typeof ngDevMode === "undefined" || ngDevMode) && void 0; 2931})(); 2932/** 2933 * Returns the set of dependency-injection providers 2934 * to enable animations in an application. See [animations guide](guide/animations) 2935 * to learn more about animations in Angular. 2936 * 2937 * @usageNotes 2938 * 2939 * The function is useful when you want to enable animations in an application 2940 * bootstrapped using the `bootstrapApplication` function. In this scenario there 2941 * is no need to import the `BrowserAnimationsModule` NgModule at all, just add 2942 * providers returned by this function to the `providers` list as show below. 2943 * 2944 * ```ts 2945 * bootstrapApplication(RootComponent, { 2946 * providers: [ 2947 * provideAnimations() 2948 * ] 2949 * }); 2950 * ``` 2951 * 2952 * @publicApi 2953 */ 2954function provideAnimations() { 2955 (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵperformanceMarkFeature"])('NgEagerAnimations'); 2956 // Return a copy to prevent changes to the original array in case any in-place 2957 // alterations are performed to the `provideAnimations` call results in app code. 2958 return [...BROWSER_ANIMATIONS_PROVIDERS]; 2959} 2960/** 2961 * A null player that must be imported to allow disabling of animations. 2962 * @publicApi 2963 */ 2964let NoopAnimationsModule = /*#__PURE__*/(() => { 2965 var _NoopAnimationsModule; 2966 class NoopAnimationsModule {} 2967 _NoopAnimationsModule = NoopAnimationsModule; 2968 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(NoopAnimationsModule, "\u0275fac", function _NoopAnimationsModule_Factory(__ngFactoryType__) { 2969 return new (__ngFactoryType__ || _NoopAnimationsModule)(); 2970 }); 2971 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(NoopAnimationsModule, "\u0275mod", /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineNgModule"]({ 2972 type: _NoopAnimationsModule 2973 })); 2974 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(NoopAnimationsModule, "\u0275inj", /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjector"]({ 2975 providers: BROWSER_NOOP_ANIMATIONS_PROVIDERS, 2976 imports: [_browser_D_u_fknz_mjs__WEBPACK_IMPORTED_MODULE_5__.BrowserModule] 2977 })); 2978 return NoopAnimationsModule; 2979})(); 2980/*#__PURE__*/(() => { 2981 (typeof ngDevMode === "undefined" || ngDevMode) && void 0; 2982})(); 2983/** 2984 * Returns the set of dependency-injection providers 2985 * to disable animations in an application. See [animations guide](guide/animations) 2986 * to learn more about animations in Angular. 2987 * 2988 * @usageNotes 2989 * 2990 * The function is useful when you want to bootstrap an application using 2991 * the `bootstrapApplication` function, but you need to disable animations 2992 * (for example, when running tests). 2993 * 2994 * ```ts 2995 * bootstrapApplication(RootComponent, { 2996 * providers: [ 2997 * provideNoopAnimations() 2998 * ] 2999 * }); 3000 * ``` 3001 * 3002 * @publicApi 3003 */ 3004function provideNoopAnimations() { 3005 // Return a copy to prevent changes to the original array in case any in-place 3006 // alterations are performed to the `provideNoopAnimations` call results in app code. 3007 return [...BROWSER_NOOP_ANIMATIONS_PROVIDERS]; 3008} 3009 3010//# sourceMappingURL=animations.mjs.map 3011 3012/***/ }), 3013 3014/***/ 30884: 3015/*!**************************************************************************!*\ 3016 !*** ./node_modules/@angular/cdk/fesm2022/test-environment-CT0XxPyp.mjs ***! 3017 \**************************************************************************/ 3018/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { 3019 3020__webpack_require__.r(__webpack_exports__); 3021/* harmony export */ __webpack_require__.d(__webpack_exports__, { 3022/* harmony export */ _: () => (/* binding */ _isTestEnvironment) 3023/* harmony export */ }); 3024/** Gets whether the code is currently running in a test environment. */ 3025function _isTestEnvironment() { 3026 // We can't use `declare const` because it causes conflicts inside Google with the real typings 3027 // for these symbols and we can't read them off the global object, because they don't appear to 3028 // be attached there for some runners like Jest. 3029 // (see: https://github.com/angular/components/issues/23365#issuecomment-938146643) 3030 return ( 3031 // @ts-ignore 3032 typeof __karma__ !== 'undefined' && !!__karma__ || 3033 // @ts-ignore 3034 typeof jasmine !== 'undefined' && !!jasmine || 3035 // @ts-ignore 3036 typeof jest !== 'undefined' && !!jest || 3037 // @ts-ignore
3038 typeof Mocha !== 'undefined' && !!Mocha 3039 ); 3040} 3041 3042//# sourceMappingURL=test-environment-CT0XxPyp.mjs.map 3043 3044/***/ }), 3045 3046/***/ 34726: 3047/*!****************************************************************************************!*\ 3048 !*** ./node_modules/@angular/cdk/fesm2022/recycle-view-repeater-strategy-DoWdPqVw.mjs ***! 3049 \****************************************************************************************/ 3050/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { 3051 3052__webpack_require__.r(__webpack_exports__); 3053/* harmony export */ __webpack_require__.d(__webpack_exports__, { 3054/* harmony export */ A: () => (/* binding */ ArrayDataSource), 3055/* harmony export */ _: () => (/* binding */ _RecycleViewRepeaterStrategy), 3056/* harmony export */ a: () => (/* binding */ _ViewRepeaterOperation), 3057/* harmony export */ b: () => (/* binding */ _VIEW_REPEATER_STRATEGY) 3058/* harmony export */ }); 3059/* harmony import */ var C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/defineProperty.js */ 64467); 3060/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs */ 8982); 3061/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rxjs */ 14421); 3062/* harmony import */ var _data_source_D34wiQZj_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./data-source-D34wiQZj.mjs */ 82448); 3063/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/core */ 17705); 3064 3065 3066 3067 3068 3069/** DataSource wrapper for a native array. */ 3070class ArrayDataSource extends _data_source_D34wiQZj_mjs__WEBPACK_IMPORTED_MODULE_1__.D { 3071 constructor(_data) { 3072 super(); 3073 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_data", void 0); 3074 this._data = _data; 3075 } 3076 connect() { 3077 return (0,rxjs__WEBPACK_IMPORTED_MODULE_2__.isObservable)(this._data) ? this._data : (0,rxjs__WEBPACK_IMPORTED_MODULE_3__.of)(this._data); 3078 } 3079 disconnect() {} 3080} 3081 3082/** Indicates how a view was changed by a {@link _ViewRepeater}. */ 3083var _ViewRepeaterOperation = /*#__PURE__*/function (_ViewRepeaterOperation) { 3084 /** The content of an existing view was replaced with another item. */ 3085 _ViewRepeaterOperation[_ViewRepeaterOperation["REPLACED"] = 0] = "REPLACED"; 3086 /** A new view was created with `createEmbeddedView`. */ 3087 _ViewRepeaterOperation[_ViewRepeaterOperation["INSERTED"] = 1] = "INSERTED"; 3088 /** The position of a view changed, but the content remains the same. */ 3089 _ViewRepeaterOperation[_ViewRepeaterOperation["MOVED"] = 2] = "MOVED"; 3090 /** A view was detached from the view container. */ 3091 _ViewRepeaterOperation[_ViewRepeaterOperation["REMOVED"] = 3] = "REMOVED"; 3092 return _ViewRepeaterOperation; 3093}(_ViewRepeaterOperation || {}); 3094/** 3095 * Injection token for {@link _ViewRepeater}. This token is for use by Angular Material only. 3096 * @docs-private 3097 */ 3098const _VIEW_REPEATER_STRATEGY = /*#__PURE__*/new _angular_core__WEBPACK_IMPORTED_MODULE_4__.InjectionToken('_ViewRepeater'); 3099 3100/** 3101 * A repeater that caches views when they are removed from a 3102 * {@link ViewContainerRef}. When new items are inserted into the container, 3103 * the repeater will reuse one of the cached views instead of creating a new 3104 * embedded view. Recycling cached views reduces the quantity of expensive DOM 3105 * inserts. 3106 * 3107 * @template T The type for the embedded view's $implicit property. 3108 * @template R The type for the item in each IterableDiffer change record. 3109 * @template C The type for the context passed to each embedded view. 3110 */ 3111class _RecycleViewRepeaterStrategy { 3112 constructor() { 3113 /** 3114 * The size of the cache used to store unused views. 3115 * Setting the cache size to `0` will disable caching. Defaults to 20 views. 3116 */ 3117 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "viewCacheSize", 20); 3118 /**
3119 * View cache that stores embedded view instances that have been previously stamped out, 3120 * but don't are not currently rendered. The view repeater will reuse these views rather than 3121 * creating brand new ones. 3122 * 3123 * TODO(michaeljamesparsons) Investigate whether using a linked list would improve performance. 3124 */ 3125 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_viewCache", []); 3126 } 3127 /** Apply changes to the DOM. */ 3128 applyChanges(changes, viewContainerRef, itemContextFactory, itemValueResolver, itemViewChanged) { 3129 // Rearrange the views to put them in the right location. 3130 changes.forEachOperation((record, adjustedPreviousIndex, currentIndex) => { 3131 let view; 3132 let operation; 3133 if (record.previousIndex == null) { 3134 // Item added. 3135 const viewArgsFactory = () => itemContextFactory(record, adjustedPreviousIndex, currentIndex); 3136 view = this._insertView(viewArgsFactory, currentIndex, viewContainerRef, itemValueResolver(record)); 3137 operation = view ? _ViewRepeaterOperation.INSERTED : _ViewRepeaterOperation.REPLACED; 3138 } else if (currentIndex == null) { 3139 // Item removed. 3140 this._detachAndCacheView(adjustedPreviousIndex, viewContainerRef); 3141 operation = _ViewRepeaterOperation.REMOVED; 3142 } else { 3143 // Item moved. 3144 view = this._moveView(adjustedPreviousIndex, currentIndex, viewContainerRef, itemValueResolver(record)); 3145 operation = _ViewRepeaterOperation.MOVED; 3146 } 3147 if (itemViewChanged) { 3148 var _view; 3149 itemViewChanged({ 3150 context: (_view = view) === null || _view === void 0 ? void 0 : _view.context, 3151 operation, 3152 record 3153 }); 3154 } 3155 }); 3156 } 3157 detach() { 3158 for (const view of this._viewCache) { 3159 view.destroy(); 3160 } 3161 this._viewCache = []; 3162 } 3163 /** 3164 * Inserts a view for a new item, either from the cache or by creating a new 3165 * one. Returns `undefined` if the item was inserted into a cached view. 3166 */ 3167 _insertView(viewArgsFactory, currentIndex, viewContainerRef, value) { 3168 const cachedView = this._insertViewFromCache(currentIndex, viewContainerRef); 3169 if (cachedView) { 3170 cachedView.context.$implicit = value; 3171 return undefined; 3172 } 3173 const viewArgs = viewArgsFactory(); 3174 return viewContainerRef.createEmbeddedView(viewArgs.templateRef, viewArgs.context, viewArgs.index); 3175 } 3176 /** Detaches the view at the given index and inserts into the view cache. */ 3177 _detachAndCacheView(index, viewContainerRef) { 3178 const detachedView = viewContainerRef.detach(index); 3179 this._maybeCacheView(detachedView, viewContainerRef); 3180 } 3181 /** Moves view at the previous index to the current index. */ 3182 _moveView(adjustedPreviousIndex, currentIndex, viewContainerRef, value) { 3183 const view = viewContainerRef.get(adjustedPreviousIndex); 3184 viewContainerRef.move(view, currentIndex); 3185 view.context.$implicit = value; 3186 return view; 3187 } 3188 /** 3189 * Cache the given detached view. If the cache is full, the view will be 3190 * destroyed. 3191 */ 3192 _maybeCacheView(view, viewContainerRef) { 3193 if (this._viewCache.length < this.viewCacheSize) { 3194 this._viewCache.push(view); 3195 } else { 3196 const index = viewContainerRef.indexOf(view); 3197 // The host component could remove views from the container outside of 3198 // the view repeater. It's unlikely this will occur, but just in case, 3199 // destroy the view on its own, otherwise destroy it through the 3200 // container to ensure that all the references are removed. 3201 if (index === -1) { 3202 view.destroy(); 3203 } else { 3204 viewContainerRef.remove(index); 3205 } 3206 } 3207 } 3208 /** Inserts a recycled view from the cache at the given index. */ 3209 _insertViewFromCache(index, viewContainerRef) { 3210 const cachedView = this._viewCache.pop(); 3211 if (cachedView) { 3212 viewContainerRef.insert(cachedView, index); 3213 } 3214 return cachedView || null; 3215 } 3216} 3217 3218//# sourceMappingURL=recycle-view-repeater-strategy-DoWdPqVw.mjs.map 3219 3220/***/ }), 3221 3222/***/ 39022: 3223/*!**********************************************************************!*\ 3224 !*** ./node_modules/@angular/cdk/fesm2022/id-generator-Dw_9dSDu.mjs ***! 3225 \**********************************************************************/ 3226/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { 3227 3228__webpack_require__.r(__webpack_exports__); 3229/* harmony export */ __webpack_require__.d(__webpack_exports__, { 3230/* harmony export */ _: () => (/* binding */ _IdGenerator) 3231/* harmony export */ }); 3232/* harmony import */ var C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/defineProperty.js */ 64467); 3233/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ 17705); 3234 3235 3236 3237 3238/** 3239 * Keeps track of the ID count per prefix. This helps us make the IDs a bit more deterministic 3240 * like they were before the service was introduced. Note that ideally we wouldn't have to do 3241 * this, but there are some internal tests that rely on the IDs. 3242 */ 3243const counters = {}; 3244/** Service that generates unique IDs for DOM nodes. */ 3245let _IdGenerator = /*#__PURE__*/(() => { 3246 var _IdGenerator2; 3247 class _IdGenerator { 3248 constructor() { 3249 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_appId", (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_1__.APP_ID)); 3250 } 3251 /** 3252 * Generates a unique ID with a specific prefix. 3253 * @param prefix Prefix to add to the ID. 3254 */ 3255 getId(prefix) { 3256 // Omit the app ID if it's the default `ng`. Since the vast majority of pages have one 3257 // Angular app on them, we can reduce the amount of breakages by not adding it. 3258 if (this._appId !== 'ng') { 3259 prefix += this._appId; 3260 } 3261 if (!counters.hasOwnProperty(prefix)) { 3262 counters[prefix] = 0; 3263 } 3264 return `${prefix}${counters[prefix]++}`; 3265 } 3266 } 3267 _IdGenerator2 = _IdGenerator; 3268 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_IdGenerator, "\u0275fac", function _IdGenerator2_Factory(__ngFactoryType__) { 3269 return new (__ngFactoryType__ || _IdGenerator2)(); 3270 }); 3271 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_IdGenerator, "\u0275prov", /* @__P
3271URE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ 3272 token: _IdGenerator2, 3273 factory: _IdGenerator2.ɵfac, 3274 providedIn: 'root' 3275 })); 3276 return _IdGenerator; 3277})(); 3278/*#__PURE__*/(() => { 3279 (typeof ngDevMode === "undefined" || ngDevMode) && void 0; 3280})(); 3281 3282//# sourceMappingURL=id-generator-Dw_9dSDu.mjs.map 3283 3284/***/ }), 3285 3286/***/ 39837: 3287/*!**************************************************************!*\ 3288 !*** ./node_modules/@angular/compiler/fesm2022/compiler.mjs ***! 3289 \**************************************************************/ 3290/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { 3291 3292__webpack_require__.r(__webpack_exports__); 3293/* harmony export */ __webpack_require__.d(__webpack_exports__, { 3294/* harmony export */ AST: () => (/* binding */ AST), 3295/* harmony export */ ASTWithName: () => (/* binding */ ASTWithName), 3296/* harmony export */ ASTWithSource: () => (/* binding */ ASTWithSource), 3297/* harmony export */ AbsoluteSourceSpan: () => (/* binding */ AbsoluteSourceSpan), 3298/* harmony export */ ArrayType: () => (/* binding */ ArrayType), 3299/* harmony export */ ArrowFunctionExpr: () => (/* binding */ ArrowFunctionExpr), 3300/* harmony export */ Attribute: () => (/* binding */ Attribute), 3301/* harmony export */ Binary: () => (/* binding */ Binary), 3302/* harmony export */ BinaryOperator: () => (/* binding */ BinaryOperator), 3303/* harmony export */ BinaryOperatorExpr: () => (/* binding */ BinaryOperatorExpr), 3304/* harmony export */ BindingPipe: () => (/* binding */ BindingPipe), 3305/* harmony export */ BindingType: () => (/* binding */ BindingType), 3306/* harmony export */ Block: () => (/* binding */ Block), 3307/* harmony export */ BlockParameter: () => (/* binding */ BlockParameter), 3308/* harmony export */ BoundElementProperty: () => (/* binding */ BoundElementProperty), 3309/* harmony export */ BuiltinType: () => (/* binding */ BuiltinType), 3310/* harmony export */ BuiltinTypeName: () => (/* binding */ BuiltinTypeName), 3311/* harmony export */ CUSTOM_ELEMENTS_SCHEMA: () => (/* binding */ CUSTOM_ELEMENTS_SCHEMA), 3312/* harmony export */ Call: () => (/* binding */ Call), 3313/* harmony export */ Chain: () => (/* binding */ Chain), 3314/* harmony export */ ChangeDetectionStrategy: () => (/* binding */ ChangeDetectionStrategy), 3315/* harmony export */ CommaExpr: () => (/* binding */ CommaExpr), 3316/* harmony export */ Comment: () => (/* binding */ Comment), 3317/* harmony export */ CompilerConfig: () => (/* binding */ CompilerConfig), 3318/* harmony export */ CompilerFacadeImpl: () => (/* binding */ CompilerFacadeImpl), 3319/* harmony export */ Conditional: () => (/* binding */ Conditional), 3320/* harmony export */ ConditionalExpr: () => (/* binding */ ConditionalExpr), 3321/* harmony export */ ConstantPool: () => (/* binding */ ConstantPool), 3322/* harmony export */ CssSelector: () => (/* binding */ CssSelector), 3323/* harmony export */ DEFAULT_INTERPOLATION_CONFIG: () => (/* binding */ DEFAULT_INTERPOLATION_CONFIG), 3324/* harmony export */ DYNAMIC_TYPE: () => (/* binding */ DYNAMIC_TYPE), 3325/* harmony export */ DeclareFunctionStmt: () => (/* binding */ DeclareFunctionStmt), 3326/* harmony export */ DeclareVarStmt: () => (/* binding */ DeclareVarStmt), 3327/* harmony export */ DomElementSchemaRegistry: () => (/* binding */ DomElementSchemaRegistry), 3328/* harmony export */ DynamicImportExpr: () => (/* binding */ DynamicImportExpr), 3329/* harmony export */ EOF: () => (/* binding */ EOF), 3330/* harmony export */ Element: () => (/* binding */ Element), 3331/* harmony export */ ElementSchemaRegistry: () => (/* binding */ ElementSchemaRegistry), 3332/* harmony export */ EmitterVisitorContext: () => (/* binding */ EmitterVisitorContext), 3333/* harmony export */ EmptyExpr: () => (/* binding */ EmptyExpr$1), 3334/* harmony export */ Expansion: () => (/* binding */ Expansion), 3335/* harmony export */ ExpansionCase: () => (/* binding */ ExpansionCase), 3336/* harmony export */ Expression: () => (/* binding */ Expression), 3337/* harmony export */ ExpressionBinding: () => (/* binding */ ExpressionBinding), 3338/* harmony export */ ExpressionStatement: () => (/* binding */ ExpressionStatement), 3339/* harmony export */ ExpressionType: () => (/* binding */ ExpressionType),
3340/* harmony export */ ExternalExpr: () => (/* binding */ ExternalExpr), 3341/* harmony export */ ExternalReference: () => (/* binding */ ExternalReference), 3342/* harmony export */ FactoryTarget: () => (/* binding */ FactoryTarget), 3343/* harmony export */ FunctionExpr: () => (/* binding */ FunctionExpr), 3344/* harmony export */ HtmlParser: () => (/* binding */ HtmlParser), 3345/* harmony export */ HtmlTagDefinition: () => (/* binding */ HtmlTagDefinition), 3346/* harmony export */ I18NHtmlParser: () => (/* binding */ I18NHtmlParser), 3347/* harmony export */ IfStmt: () => (/* binding */ IfStmt), 3348/* harmony export */ ImplicitReceiver: () => (/* binding */ ImplicitReceiver), 3349/* harmony export */ InstantiateExpr: () => (/* binding */ InstantiateExpr), 3350/* harmony export */ Interpolation: () => (/* binding */ Interpolation$1), 3351/* harmony export */ InterpolationConfig: () => (/* binding */ InterpolationConfig), 3352/* harmony export */ InvokeFunctionExpr: () => (/* binding */ InvokeFunctionExpr), 3353/* harmony export */ JSDocComment: () => (/* binding */ JSDocComment), 3354/* harmony export */ JitEvaluator: () => (/* binding */ JitEvaluator), 3355/* harmony export */ KeyedRead: () => (/* binding */ KeyedRead), 3356/* harmony export */ KeyedWrite: () => (/* binding */ KeyedWrite), 3357/* harmony export */ LeadingComment: () => (/* binding */ LeadingComment), 3358/* harmony export */ LetDeclaration: () => (/* binding */ LetDeclaration), 3359/* harmony export */ Lexer: () => (/* binding */ Lexer), 3360/* harmony export */ LiteralArray: () => (/* binding */ LiteralArray), 3361/* harmony export */ LiteralArrayExpr: () => (/* binding */ LiteralArrayExpr), 3362/* harmony export */ LiteralExpr: () => (/* binding */ LiteralExpr), 3363/* harmony export */ LiteralMap: () => (/* binding */ LiteralMap), 3364/* harmony export */ LiteralMapExpr: () => (/* binding */ LiteralMapExpr), 3365/* harmony export */ LiteralPrimitive: () => (/* binding */ LiteralPrimitive), 3366/* harmony export */ LocalizedString: () => (/* binding */ LocalizedString), 3367/* harmony export */ MapType: () => (/* binding */ MapType), 3368/* harmony export */ MessageBundle: () => (/* binding */ MessageBundle), 3369/* harmony export */ NONE_TYPE: () => (/* binding */ NONE_TYPE), 3370/* harmony export */ NO_ERRORS_SCHEMA: () => (/* binding */ NO_ERRORS_SCHEMA), 3371/* harmony export */ NodeWithI18n: () => (/* binding */ NodeWithI18n), 3372/* harmony export */ NonNullAssert: () => (/* binding */ NonNullAssert), 3373/* harmony export */ NotExpr: () => (/* binding */ NotExpr), 3374/* harmony export */ ParseError: () => (/* binding */ ParseError), 3375/* harmony export */ ParseErrorLevel: () => (/* binding */ ParseErrorLevel), 3376/* harmony export */ ParseLocation: () => (/* binding */ ParseLocation), 3377/* harmony export */ ParseSourceFile: () => (/* binding */ ParseSourceFile), 3378/* harmony export */ ParseSourceSpan: () => (/* binding */ ParseSourceSpan), 3379/* harmony export */ ParseSpan: () => (/* binding */ ParseSpan), 3380/* harmony export */ ParseTreeResult: () => (/* binding */ ParseTreeResult), 3381/* harmony export */ ParsedEvent: () => (/* binding */ ParsedEvent), 3382/* harmony export */ ParsedEventType: () => (/* binding */ ParsedEventType), 3383/* harmony export */ ParsedProperty: () => (/* binding */ ParsedProperty), 3384/* harmony export */ ParsedPropertyType: () => (/* binding */ ParsedPropertyType), 3385/* harmony export */ ParsedVariable: () => (/* binding */ ParsedVariable), 3386/* harmony export */ Parser: () => (/* binding */ Parser), 3387/* harmony export */ ParserError: () => (/* binding */ ParserError), 3388/* harmony export */ PrefixNot: () => (/* binding */ PrefixNot), 3389/* harmony export */ PropertyRead: () => (/* binding */ PropertyRead), 3390/* harmony export */ PropertyWrite: () => (/* binding */ PropertyWrite), 3391/* harmony export */ R3BoundTarget: () => (/* binding */ R3BoundTarget), 3392/* harmony export */ R3Identifiers: () => (/* binding */ Identifiers), 3393/* harmony export */ R3NgModuleMetadataKind: () => (/* binding */ R3NgModuleMetadataKind), 3394/* harmony export */ R3SelectorScopeMode: () => (/* binding */ R3SelectorScopeMode), 3395/* harmony export */ R3TargetBinder: () => (/* binding */ R3TargetBinder), 3396/* harmony export */ R3TemplateDependencyKind: () => (/* binding */ R3TemplateDependencyKind), 3397/* harmony export */ ReadKeyExpr: () => (/* binding */ ReadKeyExpr),
3398/* harmony export */ ReadPropExpr: () => (/* binding */ ReadPropExpr), 3399/* harmony export */ ReadVarExpr: () => (/* binding */ ReadVarExpr), 3400/* harmony export */ RecursiveAstVisitor: () => (/* binding */ RecursiveAstVisitor), 3401/* harmony export */ RecursiveVisitor: () => (/* binding */ RecursiveVisitor), 3402/* harmony export */ ResourceLoader: () => (/* binding */ ResourceLoader), 3403/* harmony export */ ReturnStatement: () => (/* binding */ ReturnStatement), 3404/* harmony export */ SECURITY_SCHEMA: () => (/* binding */ SECURITY_SCHEMA), 3405/* harmony export */ STRING_TYPE: () => (/* binding */ STRING_TYPE), 3406/* harmony export */ SafeCall: () => (/* binding */ SafeCall), 3407/* harmony export */ SafeKeyedRead: () => (/* binding */ SafeKeyedRead), 3408/* harmony export */ SafePropertyRead: () => (/* binding */ SafePropertyRead), 3409/* harmony export */ SelectorContext: () => (/* binding */ SelectorContext), 3410/* harmony export */ SelectorListContext: () => (/* binding */ SelectorListContext), 3411/* harmony export */ SelectorMatcher: () => (/* binding */ SelectorMatcher), 3412/* harmony export */ Serializer: () => (/* binding */ Serializer), 3413/* harmony export */ SplitInterpolation: () => (/* binding */ SplitInterpolation), 3414/* harmony export */ Statement: () => (/* binding */ Statement), 3415/* harmony export */ StmtModifier: () => (/* binding */ StmtModifier), 3416/* harmony export */ StringToken: () => (/* binding */ StringToken), 3417/* harmony export */ StringTokenKind: () => (/* binding */ StringTokenKind), 3418/* harmony export */ TagContentType: () => (/* binding */ TagContentType), 3419/* harmony export */ TaggedTemplateLiteralExpr: () => (/* binding */ TaggedTemplateLiteralExpr), 3420/* harmony export */ TemplateBindingParseResult: () => (/* binding */ TemplateBindingParseResult), 3421/* harmony export */ TemplateLiteral: () => (/* binding */ TemplateLiteral), 3422/* harmony export */ TemplateLiteralElement: () => (/* binding */ TemplateLiteralElement), 3423/* harmony export */ TemplateLiteralElementExpr: () => (/* binding */ TemplateLiteralElementExpr), 3424/* harmony export */ TemplateLiteralExpr: () => (/* binding */ TemplateLiteralExpr), 3425/* harmony export */ Text: () => (/* binding */ Text), 3426/* harmony export */ ThisReceiver: () => (/* binding */ ThisReceiver), 3427/* harmony export */ TmplAstBlockNode: () => (/* binding */ BlockNode), 3428/* harmony export */ TmplAstBoundAttribute: () => (/* binding */ BoundAttribute), 3429/* harmony export */ TmplAstBoundDeferredTrigger: () => (/* binding */ BoundDeferredTrigger), 3430/* harmony export */ TmplAstBoundEvent: () => (/* binding */ BoundEvent), 3431/* harmony export */ TmplAstBoundText: () => (/* binding */ BoundText), 3432/* harmony export */ TmplAstContent: () => (/* binding */ Content), 3433/* harmony export */ TmplAstDeferredBlock: () => (/* binding */ DeferredBlock), 3434/* harmony export */ TmplAstDeferredBlockError: () => (/* binding */ DeferredBlockError), 3435/* harmony export */ TmplAstDeferredBlockLoading: () => (/* binding */ DeferredBlockLoading), 3436/* harmony export */ TmplAstDeferredBlockPlaceholder: () => (/* binding */ DeferredBlockPlaceholder), 3437/* harmony export */ TmplAstDeferredTrigger: () => (/* binding */ DeferredTrigger), 3438/* harmony export */ TmplAstElement: () => (/* binding */ Element$1), 3439/* harmony export */ TmplAstForLoopBlock: () => (/* binding */ ForLoopBlock), 3440/* harmony export */ TmplAstForLoopBlockEmpty: () => (/* binding */ ForLoopBlockEmpty), 3441/* harmony export */ TmplAstHoverDeferredTrigger: () => (/* binding */ HoverDeferredTrigger), 3442/* harmony export */ TmplAstIcu: () => (/* binding */ Icu$1), 3443/* harmony export */ TmplAstIdleDeferredTrigger: () => (/* binding */ IdleDeferredTrigger), 3444/* harmony export */ TmplAstIfBlock: () => (/* binding */ IfBlock), 3445/* harmony export */ TmplAstIfBlockBranch: () => (/* binding */ IfBlockBranch), 3446/* harmony export */ TmplAstImmediateDeferredTrigger: () => (/* binding */ ImmediateDeferredTrigger), 3447/* harmony export */ TmplAstInteractionDeferredTrigger: () => (/* binding */ InteractionDeferredTrigger), 3448/* harmony export */ TmplAstLetDeclaration: () => (/* binding */ LetDeclaration$1), 3449/* harmony export */ TmplAstNeverDeferredTrigger: () => (/* binding */ NeverDeferredTrigger), 3450/* harmony export */ TmplAstRecursiveVisitor: () => (/* binding */ RecursiveVisitor$1), 3451/* harmony export */ TmplAstReference: () => (/* binding */ Reference), 3452/* harmony export */ TmplAstSwitchBlock: () => (/* binding */ SwitchBlock), 3453/* harmony export */ TmplAstSwitchBlockCase: () => (/* binding */ SwitchBlockCase), 3454/* harmony export */ TmplAstTemplate: () => (/* binding */ Template), 3455/* harmony export */ TmplAstText: () => (/* binding */ Text$3), 3456/* harmony export */ TmplAstTextAttribute: () => (/* binding */ TextAttribute), 3457/* harmony export */ TmplAstTimerDeferredTrigger: () => (/* binding */ TimerDeferredTrigger), 3458/* harmony export */ TmplAstUnknownBlock: () => (/* binding */ UnknownBlock), 3459/* harmony export */ TmplAstVariable: () => (/* binding */ Variable), 3460/* harmony export */ TmplAstViewportDeferredTrigger: () => (/* binding */ ViewportDeferredTrigger), 3461/* harmony export */ Token: () => (/* binding */ Token), 3462/* harmony export */ TokenType: () => (/* binding */ TokenType), 3463/* harmony export */ TransplantedType: () => (/* binding */ TransplantedType), 3464/* harmony export */ TreeError: () => (/* binding */ TreeError), 3465/* harmony export */ Type: () => (/* binding */ Type), 3466/* harmony export */ TypeModifier: () => (/* binding */ TypeModifier), 3467/* harmony export */ TypeofExpr: () => (/* binding */ TypeofExpr), 3468/* harmony export */ TypeofExpression: () => (/* binding */ TypeofExpression), 3469/* harmony export */ Unary: () => (/* binding */ Unary), 3470/* harmony export */ UnaryOperator: () => (/* binding */ UnaryOperator), 3471/* harmony export */ UnaryOperatorExpr: () => (/* binding */ UnaryOperatorExpr), 3472/* harmony export */ VERSION: () => (/* binding */ VERSION), 3473/* harmony export */ VariableBinding: () => (/* binding */ VariableBinding),
3474/* harmony export */ Version: () => (/* binding */ Version), 3475/* harmony export */ ViewEncapsulation: () => (/* binding */ ViewEncapsulation$1), 3476/* harmony export */ WrappedNodeExpr: () => (/* binding */ WrappedNodeExpr), 3477/* harmony export */ WriteKeyExpr: () => (/* binding */ WriteKeyExpr), 3478/* harmony export */ WritePropExpr: () => (/* binding */ WritePropExpr), 3479/* harmony export */ WriteVarExpr: () => (/* binding */ WriteVarExpr), 3480/* harmony export */ Xliff: () => (/* binding */ Xliff), 3481/* harmony export */ Xliff2: () => (/* binding */ Xliff2), 3482/* harmony export */ Xmb: () => (/* binding */ Xmb), 3483/* harmony export */ XmlParser: () => (/* binding */ XmlParser), 3484/* harmony export */ Xtb: () => (/* binding */ Xtb), 3485/* harmony export */ compileClassDebugInfo: () => (/* binding */ compileClassDebugInfo), 3486/* harmony export */ compileClassMetadata: () => (/* binding */ compileClassMetadata), 3487/* harmony export */ compileComponentClassMetadata: () => (/* binding */ compileComponentClassMetadata), 3488/* harmony export */ compileComponentDeclareClassMetadata: () => (/* binding */ compileComponentDeclareClassMetadata), 3489/* harmony export */ compileComponentFromMetadata: () => (/* binding */ compileComponentFromMetadata), 3490/* harmony export */ compileDeclareClassMetadata: () => (/* binding */ compileDeclareClassMetadata), 3491/* harmony export */ compileDeclareComponentFromMetadata: () => (/* binding */ compileDeclareComponentFromMetadata), 3492/* harmony export */ compileDeclareDirectiveFromMetadata: () => (/* binding */ compileDeclareDirectiveFromMetadata), 3493/* harmony export */ compileDeclareFactoryFunction: () => (/* binding */ compileDeclareFactoryFunction), 3494/* harmony export */ compileDeclareInjectableFromMetadata: () => (/* binding */ compileDeclareInjectableFromMetadata), 3495/* harmony export */ compileDeclareInjectorFromMetadata: () => (/* binding */ compileDeclareInjectorFromMetadata), 3496/* harmony export */ compileDeclareNgModuleFromMetadata: () => (/* binding */ compileDeclareNgModuleFromMetadata), 3497/* harmony export */ compileDeclarePipeFromMetadata: () => (/* binding */ compileDeclarePipeFromMetadata), 3498/* harmony export */ compileDeferResolverFunction: () => (/* binding */ compileDeferResolverFunction), 3499/* harmony export */ compileDirectiveFromMetadata: () => (/* binding */ compileDirectiveFromMetadata), 3500/* harmony export */ compileFactoryFunction: () => (/* binding */ compileFactoryFunction), 3501/* harmony export */ compileHmrInitializer: () => (/* binding */ compileHmrInitializer), 3502/* harmony export */ compileHmrUpdateCallback: () => (/* binding */ compileHmrUpdateCallback), 3503/* harmony export */ compileInjectable: () => (/* binding */ compileInjectable), 3504/* harmony export */ compileInjector: () => (/* binding */ compileInjector), 3505/* harmony export */ compileNgModule: () => (/* binding */ compileNgModule), 3506/* harmony export */ compileOpaqueAsyncClassMetadata: () => (/* binding */ compileOpaqueAsyncClassMetadata), 3507/* harmony export */ compilePipeFromMetadata: () => (/* binding */ compilePipeFromMetadata), 3508/* harmony export */ computeMsgId: () => (/* binding */ computeMsgId), 3509/* harmony export */ core: () => (/* binding */ core), 3510/* harmony export */ createCssSelectorFromNode: () => (/* binding */ createCssSelectorFromNode), 3511/* harmony export */ createInjectableType: () => (/* binding */ createInjectableType), 3512/* harmony export */ createMayBeForwardRefExpression: () => (/* binding */ createMayBeForwardRefExpression), 3513/* harmony export */ devOnlyGuardedExpression: () => (/* binding */ devOnlyGuardedExpression), 3514/* harmony export */ emitDistinctChangesOnlyDefaultValue: () => (/* binding */ emitDistinctChangesOnlyDefaultValue), 3515/* harmony export */ encapsulateStyle: () => (/* binding */ encapsulateStyle), 3516/* harmony export */ escapeRegExp: () => (/* binding */ escapeRegExp), 3517/* harmony export */ findMatchingDirectivesAndPipes: () => (/* binding */ findMatchingDirectivesAndPipes), 3518/* harmony export */ getHtmlTagDefinition: () => (/* binding */ getHtmlTagDefinition), 3519/* harmony export */ getNsPrefix: () => (/* binding */ getNsPrefix), 3520/* harmony export */ getSafePropertyAccessString: () => (/* binding */ getSafePropertyAccessString), 3521/* harmony export */ identifierName: () => (/* binding */ identifierName), 3522/* harmony export */ isNgContainer: () => (/* binding */ isNgContainer), 3523/* harmony export */ isNgContent: () => (/* binding */ isNgContent), 3524/* harmony export */ isNgTemplate: () => (/* binding */ isNgTemplate), 3525/* harmony export */ jsDocComment: () => (/* binding */ jsDocComment), 3526/* harmony export */ leadingComment: () => (/* binding */ leadingComment), 3527/* harmony export */ literal: () => (/* binding */ literal), 3528/* harmony export */ literalMap: () => (/* binding */ literalMap), 3529/* harmony export */ makeBindingParser: () => (/* binding */ makeBindingParser), 3530/* harmony export */ mergeNsAndName: () => (/* binding */ mergeNsAndName), 3531/* harmony export */ outputAst: () => (/* binding */ output_ast),
3532/* harmony export */ parseHostBindings: () => (/* binding */ parseHostBindings), 3533/* harmony export */ parseTemplate: () => (/* binding */ parseTemplate), 3534/* harmony export */ preserveWhitespacesDefault: () => (/* binding */ preserveWhitespacesDefault), 3535/* harmony export */ publishFacade: () => (/* binding */ publishFacade), 3536/* harmony export */ r3JitTypeSourceSpan: () => (/* binding */ r3JitTypeSourceSpan), 3537/* harmony export */ sanitizeIdentifier: () => (/* binding */ sanitizeIdentifier), 3538/* harmony export */ setEnableTemplateSourceLocations: () => (/* binding */ setEnableTemplateSourceLocations), 3539/* harmony export */ splitNsName: () => (/* binding */ splitNsName), 3540/* harmony export */ tmplAstVisitAll: () => (/* binding */ visitAll$1), 3541/* harmony export */ verifyHostBindings: () => (/* binding */ verifyHostBindings), 3542/* harmony export */ visitAll: () => (/* binding */ visitAll) 3543/* harmony export */ }); 3544/* harmony import */ var C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js */ 89379); 3545/* harmony import */ var C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/defineProperty.js */ 64467); 3546 3547 3548var _GenericKeyFn; 3549/** 3550 * @license Angular v19.2.14 3551 * (c) 2010-2025 Google LLC. https://angular.io/ 3552 * License: MIT 3553 */ 3554 3555const _SELECTOR_REGEXP = new RegExp('(\\:not\\()|' + 3556// 1: ":not(" 3557'(([\\.\\#]?)[-\\w]+)|' + 3558// 2: "tag"; 3: "."/"#"; 3559// "-" should appear first in the regexp below as FF31 parses "[.-\w]" as a range 3560// 4: attribute; 5: attribute_string; 6: attribute_value 3561'(?:\\[([-.\\w*\\\\$]+)(?:=(["\']?)([^\\]"\']*)\\5)?\\])|' + 3562// "[name]", "[name=value]", 3563// "[name="value"]", 3564// "[name='value']" 3565'(\\))|' + 3566// 7: ")" 3567'(\\s*,\\s*)', 3568// 8: "," 3569'g'); 3570/** 3571 * A css selector contains an element name, 3572 * css classes and attribute/value pairs with the purpose 3573 * of selecting subsets out of them. 3574 */ 3575class CssSelector { 3576 constructor() { 3577 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "element", null); 3578 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "classNames", []); 3579 /** 3580 * The selectors are encoded in pairs where: 3581 * - even locations are attribute names 3582 * - odd locations are attribute values. 3583 * 3584 * Example: 3585 * Selector: `[key1=value1][key2]` would parse to: 3586 * ``` 3587 * ['key1', 'value1', 'key2', ''] 3588 * ``` 3589 */ 3590 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "attrs", []); 3591 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "notSelectors", []); 3592 } 3593 static parse(selector) { 3594 const results = []; 3595 const _addResult = (res, cssSel) => { 3596 if (cssSel.notSelectors.length > 0 && !cssSel.element && cssSel.classNames.length == 0 && cssSel.attrs.length == 0) { 3597 cssSel.element = '*'; 3598 } 3599 res.push(cssSel); 3600 }; 3601 let cssSelector = new CssSelector(); 3602 let match; 3603 let current = cssSelector; 3604 let inNot = false; 3605 _SELECTOR_REGEXP.lastIndex = 0; 3606 while (match = _SELECTOR_REGEXP.exec(selector)) { 3607 if (match[1 /* SelectorRegexp.NOT */]) { 3608 if (inNot) { 3609 throw new Error('Nesting :not in a selector is not allowed'); 3610 } 3611 inNot = true; 3612 current = new CssSelector(); 3613 cssSelector.notSelectors.push(current); 3614 } 3615 const tag = match[2 /* SelectorRegexp.TAG */]; 3616 if (tag) { 3617 const prefix = match[3 /* SelectorRegexp.PREFIX */]; 3618 if (prefix === '#') { 3619 // #hash 3620 current.addAttribute('id', tag.slice(1)); 3621 } else if (prefix === '.') { 3622 // Class 3623 current.addClassName(tag.slice(1)); 3624 } else { 3625 // Element 3626 current.setElement(tag); 3627 } 3628 }
3629 const attribute = match[4 /* SelectorRegexp.ATTRIBUTE */]; 3630 if (attribute) { 3631 current.addAttribute(current.unescapeAttribute(attribute), match[6 /* SelectorRegexp.ATTRIBUTE_VALUE */]); 3632 } 3633 if (match[7 /* SelectorRegexp.NOT_END */]) { 3634 inNot = false; 3635 current = cssSelector; 3636 } 3637 if (match[8 /* SelectorRegexp.SEPARATOR */]) { 3638 if (inNot) { 3639 throw new Error('Multiple selectors in :not are not supported'); 3640 } 3641 _addResult(results, cssSelector); 3642 cssSelector = current = new CssSelector(); 3643 } 3644 } 3645 _addResult(results, cssSelector); 3646 return results; 3647 } 3648 /** 3649 * Unescape `\$` sequences from the CSS attribute selector. 3650 * 3651 * This is needed because `$` can have a special meaning in CSS selectors, 3652 * but we might want to match an attribute that contains `$`. 3653 * [MDN web link for more 3654 * info](https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors). 3655 * @param attr the attribute to unescape. 3656 * @returns the unescaped string. 3657 */ 3658 unescapeAttribute(attr) { 3659 let result = ''; 3660 let escaping = false; 3661 for (let i = 0; i < attr.length; i++) { 3662 const char = attr.charAt(i); 3663 if (char === '\\') { 3664 escaping = true; 3665 continue; 3666 } 3667 if (char === '$' && !escaping) { 3668 throw new Error(`Error in attribute selector "${attr}". ` + `Unescaped "$" is not supported. Please escape with "\\$".`); 3669 } 3670 escaping = false; 3671 result += char; 3672 } 3673 return result; 3674 } 3675 /** 3676 * Escape `$` sequences from the CSS attribute selector. 3677 * 3678 * This is needed because `$` can have a special meaning in CSS selectors, 3679 * with this method we are escaping `$` with `\$'. 3680 * [MDN web link for more 3681 * info](https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors). 3682 * @param attr the attribute to escape. 3683 * @returns the escaped string. 3684 */ 3685 escapeAttribute(attr) { 3686 return attr.replace(/\\/g, '\\\\').replace(/\$/g, '\\$'); 3687 } 3688 isElementSelector() { 3689 return this.hasElementSelector() && this.classNames.length == 0 && this.attrs.length == 0 && this.notSelectors.length === 0; 3690 } 3691 hasElementSelector() { 3692 return !!this.element; 3693 } 3694 setElement(element = null) { 3695 this.element = element; 3696 } 3697 getAttrs() { 3698 const result = []; 3699 if (this.classNames.length > 0) { 3700 result.push('class', this.classNames.join(' ')); 3701 } 3702 return result.concat(this.attrs); 3703 } 3704 addAttribute(name, value = '') { 3705 this.attrs.push(name, value && value.toLowerCase() || ''); 3706 } 3707 addClassName(name) { 3708 this.classNames.push(name.toLowerCase()); 3709 } 3710 toString() { 3711 let res = this.element || ''; 3712 if (this.classNames) { 3713 this.classNames.forEach(klass => res += `.${klass}`); 3714 } 3715 if (this.attrs) { 3716 for (let i = 0; i < this.attrs.length; i += 2) { 3717 const name = this.escapeAttribute(this.attrs[i]); 3718 const value = this.attrs[i + 1]; 3719 res += `[${name}${value ? '=' + value : ''}]`; 3720 } 3721 } 3722 this.notSelectors.forEach(notSelector => res += `:not(${notSelector})`); 3723 return res; 3724 } 3725} 3726/** 3727 * Reads a list of CssSelectors and allows to calculate which ones 3728 * are contained in a given CssSelector. 3729 */ 3730class SelectorMatcher { 3731 constructor() { 3732 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_elementMap", new Map()); 3733 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_elementPartialMap", new Map()); 3734 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_classMap", new Map()); 3735 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_classPartialMap", new Map()); 3736 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_attrValueMap", new Map()); 3737 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_attrValuePartialMap", new Map()); 3738 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_listContexts", []); 3739 } 3740 static createNotMatcher(notSelectors) { 3741 const notMatcher = new SelectorMatcher(); 3742 notMatcher.addSelectables(notSelectors, null); 3743 return notMatcher; 3744 } 3745 addSelectables(cssSelectors, callbackCtxt) { 3746 let listContext = null; 3747 if (cssSelectors.length > 1) { 3748 listContext = new SelectorListContext(cssSelectors); 3749 this._listContexts.push(listContext); 3750 } 3751 for (let i = 0; i < cssSelectors.length; i++) { 3752 this._addSelectable(cssSelectors[i], callbackCtxt, listContext); 3753 } 3754 } 3755 /** 3756 * Add an object that can be found later on by calling `match`. 3757 * @param cssSelector A css selector 3758 * @param callbackCtxt An opaque object that will be given to the callback of the `match` function 3759 */ 3760 _addSelectable(cssSelector, callbackCtxt, listContext) { 3761 let matcher = this; 3762 const element = cssSelector.element; 3763 const classNames = cssSelector.classNames; 3764 const attrs = cssSelector.attrs; 3765 const selectable = new SelectorContext(cssSelector, callbackCtxt, listContext); 3766 if (element) { 3767 const isTerminal = attrs.length === 0 && classNames.length === 0; 3768 if (isTerminal) { 3769 this._addTerminal(matcher._elementMap, element, selectable); 3770 } else { 3771 matcher = this._addPartial(matcher._elementPartialMap, element); 3772 } 3773 } 3774 if (classNames) { 3775 for (let i = 0; i < classNames.length; i++) { 3776 const isTerminal = attrs.length === 0 && i === classNames.length - 1; 3777 const className = classNames[i]; 3778 if (isTerminal) { 3779 this._addTerminal(matcher._classMap, className, selectable); 3780 } else { 3781 matcher = this._addPartial(matcher._classPartialMap, className); 3782 } 3783 } 3784 } 3785 if (attrs) { 3786 for (let i = 0; i < attrs.length; i += 2) { 3787 const isTerminal = i === attrs.length - 2; 3788 const name = attrs[i]; 3789 const value = attrs[i + 1]; 3790 if (isTerminal) { 3791 const terminalMap = matcher._attrValueMap;
3792 let terminalValuesMap = terminalMap.get(name); 3793 if (!terminalValuesMap) { 3794 terminalValuesMap = new Map(); 3795 terminalMap.set(name, terminalValuesMap); 3796 } 3797 this._addTerminal(terminalValuesMap, value, selectable); 3798 } else { 3799 const partialMap = matcher._attrValuePartialMap; 3800 let partialValuesMap = partialMap.get(name); 3801 if (!partialValuesMap) { 3802 partialValuesMap = new Map(); 3803 partialMap.set(name, partialValuesMap); 3804 } 3805 matcher = this._addPartial(partialValuesMap, value); 3806 } 3807 } 3808 } 3809 } 3810 _addTerminal(map, name, selectable) { 3811 let terminalList = map.get(name); 3812 if (!terminalList) { 3813 terminalList = []; 3814 map.set(name, terminalList); 3815 } 3816 terminalList.push(selectable); 3817 } 3818 _addPartial(map, name) { 3819 let matcher = map.get(name); 3820 if (!matcher) { 3821 matcher = new SelectorMatcher(); 3822 map.set(name, matcher); 3823 } 3824 return matcher; 3825 } 3826 /** 3827 * Find the objects that have been added via `addSelectable` 3828 * whose css selector is contained in the given css selector. 3829 * @param cssSelector A css selector 3830 * @param matchedCallback This callback will be called with the object handed into `addSelectable` 3831 * @return boolean true if a match was found 3832 */ 3833 match(cssSelector, matchedCallback) { 3834 let result = false;
3835 const element = cssSelector.element; 3836 const classNames = cssSelector.classNames; 3837 const attrs = cssSelector.attrs; 3838 for (let i = 0; i < this._listContexts.length; i++) { 3839 this._listContexts[i].alreadyMatched = false; 3840 } 3841 result = this._matchTerminal(this._elementMap, element, cssSelector, matchedCallback) || result; 3842 result = this._matchPartial(this._elementPartialMap, element, cssSelector, matchedCallback) || result; 3843 if (classNames) { 3844 for (let i = 0; i < classNames.length; i++) { 3845 const className = classNames[i]; 3846 result = this._matchTerminal(this._classMap, className, cssSelector, matchedCallback) || result; 3847 result = this._matchPartial(this._classPartialMap, className, cssSelector, matchedCallback) || result; 3848 } 3849 } 3850 if (attrs) { 3851 for (let i = 0; i < attrs.length; i += 2) { 3852 const name = attrs[i]; 3853 const value = attrs[i + 1]; 3854 const terminalValuesMap = this._attrValueMap.get(name); 3855 if (value) { 3856 result = this._matchTerminal(terminalValuesMap, '', cssSelector, matchedCallback) || result; 3857 } 3858 result = this._matchTerminal(terminalValuesMap, value, cssSelector, matchedCallback) || result; 3859 const partialValuesMap = this._attrValuePartialMap.get(name); 3860 if (value) { 3861 result = this._matchPartial(partialValuesMap, '', cssSelector, matchedCallback) || result; 3862 } 3863 result = this._matchPartial(partialValuesMap, value, cssSelector, matchedCallback) || result; 3864 } 3865 } 3866 return result; 3867 } 3868 /** @internal */ 3869 _matchTerminal(map, name, cssSelector, matchedCallback) { 3870 if (!map || typeof name !== 'string') { 3871 return false; 3872 } 3873 let selectables = map.get(name) || []; 3874 const starSelectables = map.get('*'); 3875 if (starSelectables) { 3876 selectables = selectables.concat(starSelectables); 3877 } 3878 if (selectables.length === 0) { 3879 return false; 3880 } 3881 let selectable; 3882 let result = false;
3883 for (let i = 0; i < selectables.length; i++) { 3884 selectable = selectables[i]; 3885 result = selectable.finalize(cssSelector, matchedCallback) || result; 3886 } 3887 return result; 3888 } 3889 /** @internal */ 3890 _matchPartial(map, name, cssSelector, matchedCallback) { 3891 if (!map || typeof name !== 'string') { 3892 return false; 3893 } 3894 const nestedSelector = map.get(name); 3895 if (!nestedSelector) { 3896 return false; 3897 } 3898 // TODO(perf): get rid of recursion and measure again 3899 // TODO(perf): don't pass the whole selector into the recursion, 3900 // but only the not processed parts 3901 return nestedSelector.match(cssSelector, matchedCallback); 3902 } 3903} 3904class SelectorListContext { 3905 constructor(selectors) { 3906 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "selectors", void 0); 3907 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "alreadyMatched", false); 3908 this.selectors = selectors; 3909 } 3910} 3911// Store context to pass back selector and context when a selector is matched 3912class SelectorContext { 3913 constructor(selector, cbContext, listContext) { 3914 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "selector", void 0); 3915 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "cbContext", void 0); 3916 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "listContext", void 0); 3917 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "notSelectors", void 0); 3918 this.selector = selector; 3919 this.cbContext = cbContext; 3920 this.listContext = listContext; 3921 this.notSelectors = selector.notSelectors; 3922 } 3923 finalize(cssSelector, callback) { 3924 let result = true; 3925 if (this.notSelectors.length > 0 && (!this.listContext || !this.listContext.alreadyMatched)) { 3926 const notMatcher = SelectorMatcher.createNotMatcher(this.notSelectors); 3927 result = !notMatcher.match(cssSelector, null); 3928 } 3929 if (result && callback && (!this.listContext || !this.listContext.alreadyMatched)) { 3930 if (this.listContext) { 3931 this.listContext.alreadyMatched = true; 3932 } 3933 callback(this.selector, this.cbContext); 3934 } 3935 return result; 3936 } 3937} 3938 3939// Attention: 3940// This file duplicates types and values from @angular/core 3941// so that we are able to make @angular/compiler independent of @angular/core. 3942// This is important to prevent a build cycle, as @angular/core needs to 3943// be compiled with the compiler. 3944// Stores the default value of `emitDistinctChangesOnly` when the `emitDistinctChangesOnly` is not 3945// explicitly set. 3946const emitDistinctChangesOnlyDefaultValue = true; 3947var ViewEncapsulation$1 = /*#__PURE__*/function (ViewEncapsulation) { 3948 ViewEncapsulation[ViewEncapsulation["Emulated"] = 0] = "Emulated"; 3949 // Historically the 1 value was for `Native` encapsulation which has been removed as of v11. 3950 ViewEncapsulation[ViewEncapsulation["None"] = 2] = "None"; 3951 ViewEncapsulation[ViewEncapsulation["ShadowDom"] = 3] = "ShadowDom"; 3952 return ViewEncapsulation; 3953}(ViewEncapsulation$1 || {}); 3954var ChangeDetectionStrategy = /*#__PURE__*/function (ChangeDetectionStrategy) { 3955 ChangeDetectionStrategy[ChangeDetectionStrategy["OnPush"] = 0] = "OnPush"; 3956 ChangeDetectionStrategy[ChangeDetectionStrategy["Default"] = 1] = "Default"; 3957 return ChangeDetectionStrategy; 3958}(ChangeDetectionStrategy || {}); 3959/** Flags describing an input for a directive. */ 3960var InputFlags = /*#__PURE__*/function (InputFlags) { 3961 InputFlags[InputFlags["None"] = 0] = "None"; 3962 InputFlags[InputFlags["SignalBased"] = 1] = "SignalBased"; 3963 InputFlags[InputFlags["HasDecoratorInputTransform"] = 2] = "HasDecoratorInputTransform"; 3964 return InputFlags; 3965}(InputFlags || {}); 3966const CUSTOM_ELEMENTS_SCHEMA = { 3967 name: 'custom-elements' 3968};
3969const NO_ERRORS_SCHEMA = { 3970 name: 'no-errors-schema' 3971}; 3972const Type$1 = Function; 3973var SecurityContext = /*#__PURE__*/function (SecurityContext) { 3974 SecurityContext[SecurityContext["NONE"] = 0] = "NONE"; 3975 SecurityContext[SecurityContext["HTML"] = 1] = "HTML"; 3976 SecurityContext[SecurityContext["STYLE"] = 2] = "STYLE"; 3977 SecurityContext[SecurityContext["SCRIPT"] = 3] = "SCRIPT"; 3978 SecurityContext[SecurityContext["URL"] = 4] = "URL"; 3979 SecurityContext[SecurityContext["RESOURCE_URL"] = 5] = "RESOURCE_URL"; 3980 return SecurityContext; 3981}(SecurityContext || {}); 3982var MissingTranslationStrategy = /*#__PURE__*/function (MissingTranslationStrategy) { 3983 MissingTranslationStrategy[MissingTranslationStrategy["Error"] = 0] = "Error"; 3984 MissingTranslationStrategy[MissingTranslationStrategy["Warning"] = 1] = "Warning"; 3985 MissingTranslationStrategy[MissingTranslationStrategy["Ignore"] = 2] = "Ignore"; 3986 return MissingTranslationStrategy; 3987}(MissingTranslationStrategy || {}); 3988function parserSelectorToSimpleSelector(selector) { 3989 const classes = selector.classNames && selector.classNames.length ? [8 /* SelectorFlags.CLASS */, ...selector.classNames] : []; 3990 const elementName = selector.element && selector.element !== '*' ? selector.element : ''; 3991 return [elementName, ...selector.attrs, ...classes]; 3992} 3993function parserSelectorToNegativeSelector(selector) { 3994 const classes = selector.classNames && selector.classNames.length ? [8 /* SelectorFlags.CLASS */, ...selector.classNames] : []; 3995 if (selector.element) { 3996 return [1 /* SelectorFlags.NOT */ | 4 /* SelectorFlags.ELEMENT */, selector.element, ...selector.attrs, ...classes]; 3997 } else if (selector.attrs.length) { 3998 return [1 /* SelectorFlags.NOT */ | 2 /* SelectorFlags.ATTRIBUTE */, ...selector.attrs, ...classes]; 3999 } else { 4000 return selector.classNames && selector.classNames.length ? [1 /* SelectorFlags.NOT */ | 8 /* SelectorFlags.CLASS */, ...selector.classNames] : []; 4001 } 4002} 4003function parserSelectorToR3Selector(selector) { 4004 const positive = parserSelectorToSimpleSelector(selector); 4005 const negative = selector.notSelectors && selector.notSelectors.length ? selector.notSelectors.map(notSelector => parserSelectorToNegativeSelector(notSelector)) : []; 4006 return positive.concat(...negative); 4007} 4008function parseSelectorToR3Selector(selector) { 4009 return selector ? CssSelector.parse(selector).map(parserSelectorToR3Selector) : []; 4010}
4011var core = /*#__PURE__*/Object.freeze({ 4012 __proto__: null, 4013 CUSTOM_ELEMENTS_SCHEMA: CUSTOM_ELEMENTS_SCHEMA, 4014 get ChangeDetectionStrategy() { 4015 return ChangeDetectionStrategy; 4016 }, 4017 get InputFlags() { 4018 return InputFlags; 4019 }, 4020 get MissingTranslationStrategy() { 4021 return MissingTranslationStrategy; 4022 }, 4023 NO_ERRORS_SCHEMA: NO_ERRORS_SCHEMA, 4024 get SecurityContext() { 4025 return SecurityContext; 4026 }, 4027 Type: Type$1, 4028 get ViewEncapsulation() { 4029 return ViewEncapsulation$1; 4030 }, 4031 emitDistinctChangesOnlyDefaultValue: emitDistinctChangesOnlyDefaultValue, 4032 parseSelectorToR3Selector: parseSelectorToR3Selector 4033}); 4034var FactoryTarget = /*#__PURE__*/function (FactoryTarget) { 4035 FactoryTarget[FactoryTarget["Directive"] = 0] = "Directive"; 4036 FactoryTarget[FactoryTarget["Component"] = 1] = "Component"; 4037 FactoryTarget[FactoryTarget["Injectable"] = 2] = "Injectable"; 4038 FactoryTarget[FactoryTarget["Pipe"] = 3] = "Pipe"; 4039 FactoryTarget[FactoryTarget["NgModule"] = 4] = "NgModule"; 4040 return FactoryTarget; 4041}(FactoryTarget || {}); 4042var R3TemplateDependencyKind$1 = /*#__PURE__*/function (R3TemplateDependencyKind) { 4043 R3TemplateDependencyKind[R3TemplateDependencyKind["Directive"] = 0] = "Directive"; 4044 R3TemplateDependencyKind[R3TemplateDependencyKind["Pipe"] = 1] = "Pipe"; 4045 R3TemplateDependencyKind[R3TemplateDependencyKind["NgModule"] = 2] = "NgModule"; 4046 return R3TemplateDependencyKind; 4047}(R3TemplateDependencyKind$1 || {}); 4048var ViewEncapsulation = /*#__PURE__*/function (ViewEncapsulation) { 4049 ViewEncapsulation[ViewEncapsulation["Emulated"] = 0] = "Emulated"; 4050 // Historically the 1 value was for `Native` encapsulation which has been removed as of v11. 4051 ViewEncapsulation[ViewEncapsulation["None"] = 2] = "None"; 4052 ViewEncapsulation[ViewEncapsulation["ShadowDom"] = 3] = "ShadowDom"; 4053 return ViewEncapsulation; 4054}(ViewEncapsulation || {}); 4055/** 4056 * A lazily created TextEncoder instance for converting strings into UTF-8 bytes 4057 */ 4058let textEncoder; 4059/** 4060 * Return the message id or compute it using the XLIFF1 digest. 4061 */ 4062function digest$1(message) { 4063 return message.id || computeDigest(message); 4064} 4065/** 4066 * Compute the message id using the XLIFF1 digest. 4067 */ 4068function computeDigest(message) { 4069 return sha1(serializeNodes(message.nodes).join('') + `[${message.meaning}]`); 4070} 4071/** 4072 * Return the message id or compute it using the XLIFF2/XMB/$localize digest. 4073 */ 4074function decimalDigest(message) { 4075 return message.id || computeDecimalDigest(message); 4076} 4077/** 4078 * Compute the message id using the XLIFF2/XMB/$localize digest. 4079 */ 4080function computeDecimalDigest(message) { 4081 const visitor = new _SerializerIgnoreIcuExpVisitor(); 4082 const parts = message.nodes.map(a => a.visit(visitor, null)); 4083 return computeMsgId(parts.join(''), message.meaning); 4084} 4085/** 4086 * Serialize the i18n ast to something xml-like in order to generate an UID. 4087 * 4088 * The visitor is also used in the i18n parser tests 4089 * 4090 * @internal 4091 */ 4092class _SerializerVisitor { 4093 visitText(text, context) { 4094 return text.value; 4095 } 4096 visitContainer(container, context) { 4097 return `[${container.children.map(child => child.visit(this)).join(', ')}]`; 4098 } 4099 visitIcu(icu, context) { 4100 const strCases = Object.keys(icu.cases).map(k => `${k} {${icu.cases[k].visit(this)}}`); 4101 return `{${icu.expression}, ${icu.type}, ${strCases.join(', ')}}`; 4102 } 4103 visitTagPlaceholder(ph, context) { 4104 return ph.isVoid ? `<ph tag name="${ph.startName}"/>` : `<ph tag name="${ph.startName}">${ph.children.map(child => child.visit(this)).join(', ')}</ph name="${ph.closeName}">`; 4105 } 4106 visitPlaceholder(ph, context) { 4107 return ph.value ? `<ph name="${ph.name}">${ph.value}</ph>` : `<ph name="${ph.name}"/>`; 4108 } 4109 visitIcuPlaceholder(ph, context) { 4110 return `<ph icu name="${ph.name}">${ph.value.visit(this)}</ph>`; 4111 } 4112 visitBlockPlaceholder(ph, context) { 4113 return `<ph block name="${ph.startName}">${ph.children.map(child => child.visit(this)).join(', ')}</ph name="${ph.closeName}">`; 4114 } 4115} 4116const serializerVisitor$1 = new _SerializerVisitor(); 4117function serializeNodes(nodes) { 4118 return nodes.map(a => a.visit(serializerVisitor$1, null)); 4119} 4120/** 4121 * Serialize the i18n ast to something xml-like in order to generate an UID. 4122 * 4123 * Ignore the ICU expressions so that message IDs stays identical if only the expression changes. 4124 * 4125 * @internal 4126 */ 4127class _SerializerIgnoreIcuExpVisitor extends _SerializerVisitor { 4128 visitIcu(icu) { 4129 let strCases = Object.keys(icu.cases).map(k => `${k} {${icu.cases[k].visit(this)}}`);
4130 // Do not take the expression into account 4131 return `{${icu.type}, ${strCases.join(', ')}}`; 4132 } 4133} 4134/** 4135 * Compute the SHA1 of the given string 4136 * 4137 * see https://csrc.nist.gov/publications/fips/fips180-4/fips-180-4.pdf 4138 * 4139 * WARNING: this function has not been designed not tested with security in mind. 4140 * DO NOT USE IT IN A SECURITY SENSITIVE CONTEXT. 4141 */ 4142function sha1(str) { 4143 textEncoder !== null && textEncoder !== void 0 ? textEncoder : textEncoder = new TextEncoder(); 4144 const utf8 = [...textEncoder.encode(str)]; 4145 const words32 = bytesToWords32(utf8, Endian.Big); 4146 const len = utf8.length * 8; 4147 const w = new Uint32Array(80); 4148 let a = 0x67452301, 4149 b = 0xefcdab89, 4150 c = 0x98badcfe, 4151 d = 0x10325476, 4152 e = 0xc3d2e1f0; 4153 words32[len >> 5] |= 0x80 << 24 - len % 32; 4154 words32[(len + 64 >> 9 << 4) + 15] = len; 4155 for (let i = 0; i < words32.length; i += 16) { 4156 const h0 = a, 4157 h1 = b, 4158 h2 = c, 4159 h3 = d, 4160 h4 = e; 4161 for (let j = 0; j < 80; j++) { 4162 if (j < 16) { 4163 w[j] = words32[i + j]; 4164 } else { 4165 w[j] = rol32(w[j - 3] ^ w[j - 8] ^ w[j - 14] ^ w[j - 16], 1); 4166 } 4167 const fkVal = fk(j, b, c, d); 4168 const f = fkVal[0]; 4169 const k = fkVal[1]; 4170 const temp = [rol32(a, 5), f, e, k, w[j]].reduce(add32); 4171 e = d; 4172 d = c; 4173 c = rol32(b, 30); 4174 b = a; 4175 a = temp; 4176 } 4177 a = add32(a, h0); 4178 b = add32(b, h1); 4179 c = add32(c, h2); 4180 d = add32(d, h3); 4181 e = add32(e, h4); 4182 } 4183 // Convert the output parts to a 160-bit hexadecimal string 4184 return toHexU32(a) + toHexU32(b) + toHexU32(c) + toHexU32(d) + toHexU32(e); 4185} 4186/** 4187 * Convert and format a number as a string representing a 32-bit unsigned hexadecimal number. 4188 * @param value The value to format as a string. 4189 * @returns A hexadecimal string representing the value. 4190 */ 4191function toHexU32(value) { 4192 // unsigned right shift of zero ensures an unsigned 32-bit number 4193 return (value >>> 0).toString(16).padStart(8, '0'); 4194} 4195function fk(index, b, c, d) { 4196 if (index < 20) { 4197 return [b & c | ~b & d, 0x5a827999]; 4198 } 4199 if (index < 40) { 4200 return [b ^ c ^ d, 0x6ed9eba1]; 4201 } 4202 if (index < 60) { 4203 return [b & c | b & d | c & d, 0x8f1bbcdc]; 4204 } 4205 return [b ^ c ^ d, 0xca62c1d6]; 4206} 4207/** 4208 * Compute the fingerprint of the given string 4209 * 4210 * The output is 64 bit number encoded as a decimal string 4211 * 4212 * based on: 4213 * https://github.com/google/closure-compiler/blob/master/src/com/google/javascript/jscomp/GoogleJsMessageIdGenerator.java 4214 */ 4215function fingerprint(str) { 4216 textEncoder !== null && textEncoder !== void 0 ? textEncoder : textEncoder = new TextEncoder(); 4217 const utf8 = textEncoder.encode(str); 4218 const view = new DataView(utf8.buffer, utf8.byteOffset, utf8.byteLength); 4219 let hi = hash32(view, utf8.length, 0); 4220 let lo = hash32(view, utf8.length, 102072); 4221 if (hi == 0 && (lo == 0 || lo == 1)) { 4222 hi = hi ^ 0x130f9bef; 4223 lo = lo ^ -1801410264; 4224 } 4225 return BigInt.asUintN(32, BigInt(hi)) << BigInt(32) | BigInt.asUintN(32, BigInt(lo)); 4226} 4227function computeMsgId(msg, meaning = '') { 4228 let msgFingerprint = fingerprint(msg); 4229 if (meaning) { 4230 // Rotate the 64-bit message fingerprint one bit to the left and then add the meaning 4231 // fingerprint. 4232 msgFingerprint = BigInt.asUintN(64, msgFingerprint << BigInt(1)) | msgFingerprint >> BigInt(63) & BigInt(1); 4233 msgFingerprint += fingerprint(meaning); 4234 } 4235 return BigInt.asUintN(63, msgFingerprint).toString(); 4236} 4237function hash32(view, length, c) { 4238 let a = 0x9e3779b9, 4239 b = 0x9e3779b9; 4240 let index = 0; 4241 const end = length - 12; 4242 for (; index <= end; index += 12) { 4243 a += view.getUint32(index, true); 4244 b += view.getUint32(index + 4, true); 4245 c += view.getUint32(index + 8, true); 4246 const res = mix(a, b, c); 4247 a = res[0], b = res[1], c = res[2]; 4248 } 4249 const remainder = length - index; 4250 // the first byte of c is reserved for the length 4251 c += length; 4252 if (remainder >= 4) { 4253 a += view.getUint32(index, true); 4254 index += 4; 4255 if (remainder >= 8) { 4256 b += view.getUint32(index, true); 4257 index += 4; 4258 // Partial 32-bit word for c 4259 if (remainder >= 9) { 4260 c += view.getUint8(index++) << 8; 4261 } 4262 if (remainder >= 10) { 4263 c += view.getUint8(index++) << 16; 4264 } 4265 if (remainder === 11) { 4266 c += view.getUint8(index++) << 24; 4267 } 4268 } else { 4269 // Partial 32-bit word for b 4270 if (remainder >= 5) { 4271 b += view.getUint8(index++); 4272 } 4273 if (remainder >= 6) { 4274 b += view.getUint8(index++) << 8; 4275 } 4276 if (remainder === 7) { 4277 b += view.getUint8(index++) << 16; 4278 } 4279 } 4280 } else { 4281 // Partial 32-bit word for a 4282 if (remainder >= 1) { 4283 a += view.getUint8(index++); 4284 } 4285 if (remainder >= 2) { 4286 a += view.getUint8(index++) << 8; 4287 } 4288 if (remainder === 3) { 4289 a += view.getUint8(index++) << 16; 4290 } 4291 } 4292 return mix(a, b, c)[2]; 4293} 4294function mix(a, b, c) { 4295 a -= b; 4296 a -= c; 4297 a ^= c >>> 13; 4298 b -= c; 4299 b -= a; 4300 b ^= a << 8; 4301 c -= a; 4302 c -= b;
4303 c ^= b >>> 13; 4304 a -= b; 4305 a -= c; 4306 a ^= c >>> 12; 4307 b -= c; 4308 b -= a; 4309 b ^= a << 16; 4310 c -= a; 4311 c -= b; 4312 c ^= b >>> 5; 4313 a -= b; 4314 a -= c; 4315 a ^= c >>> 3; 4316 b -= c; 4317 b -= a; 4318 b ^= a << 10; 4319 c -= a; 4320 c -= b; 4321 c ^= b >>> 15; 4322 return [a, b, c]; 4323} 4324// Utils 4325var Endian = /*#__PURE__*/function (Endian) { 4326 Endian[Endian["Little"] = 0] = "Little"; 4327 Endian[Endian["Big"] = 1] = "Big"; 4328 return Endian; 4329}(Endian || {}); 4330function add32(a, b) { 4331 return add32to64(a, b)[1]; 4332} 4333function add32to64(a, b) { 4334 const low = (a & 0xffff) + (b & 0xffff); 4335 const high = (a >>> 16) + (b >>> 16) + (low >>> 16); 4336 return [high >>> 16, high << 16 | low & 0xffff]; 4337} 4338// Rotate a 32b number left `count` position 4339function rol32(a, count) { 4340 return a << count | a >>> 32 - count; 4341} 4342function bytesToWords32(bytes, endian) { 4343 const size = bytes.length + 3 >>> 2; 4344 const words32 = []; 4345 for (let i = 0; i < size; i++) { 4346 words32[i] = wordAt(bytes, i * 4, endian); 4347 } 4348 return words32; 4349} 4350function byteAt(bytes, index) { 4351 return index >= bytes.length ? 0 : bytes[index]; 4352} 4353function wordAt(bytes, index, endian) { 4354 let word = 0; 4355 if (endian === Endian.Big) { 4356 for (let i = 0; i < 4; i++) { 4357 word += byteAt(bytes, index + i) << 24 - 8 * i; 4358 } 4359 } else { 4360 for (let i = 0; i < 4; i++) { 4361 word += byteAt(bytes, index + i) << 8 * i; 4362 } 4363 } 4364 return word; 4365} 4366 4367//// Types 4368var TypeModifier = /*#__PURE__*/function (TypeModifier) { 4369 TypeModifier[TypeModifier["None"] = 0] = "None"; 4370 TypeModifier[TypeModifier["Const"] = 1] = "Const"; 4371 return TypeModifier; 4372}(TypeModifier || {}); 4373class Type { 4374 constructor(modifiers = TypeModifier.None) { 4375 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "modifiers", void 0); 4376 this.modifiers = modifiers; 4377 } 4378 hasModifier(modifier) { 4379 return (this.modifiers & modifier) !== 0; 4380 } 4381} 4382var BuiltinTypeName = /*#__PURE__*/function (BuiltinTypeName) { 4383 BuiltinTypeName[BuiltinTypeName["Dynamic"] = 0] = "Dynamic"; 4384 BuiltinTypeName[BuiltinTypeName["Bool"] = 1] = "Bool"; 4385 BuiltinTypeName[BuiltinTypeName["String"] = 2] = "String"; 4386 BuiltinTypeName[BuiltinTypeName["Int"] = 3] = "Int"; 4387 BuiltinTypeName[BuiltinTypeName["Number"] = 4] = "Number"; 4388 BuiltinTypeName[BuiltinTypeName["Function"] = 5] = "Function"; 4389 BuiltinTypeName[BuiltinTypeName["Inferred"] = 6] = "Inferred"; 4390 BuiltinTypeName[BuiltinTypeName["None"] = 7] = "None"; 4391 return BuiltinTypeName; 4392}(BuiltinTypeName || {}); 4393class BuiltinType extends Type { 4394 constructor(name, modifiers) { 4395 super(modifiers); 4396 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "name", void 0); 4397 this.name = name; 4398 } 4399 visitType(visitor, context) { 4400 return visitor.visitBuiltinType(this, context); 4401 } 4402} 4403class ExpressionType extends Type { 4404 constructor(value, modifiers, typeParams = null) { 4405 super(modifiers); 4406 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "value", void 0); 4407 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "typeParams", void 0); 4408 this.value = value; 4409 this.typeParams = typeParams; 4410 } 4411 visitType(visitor, context) { 4412 return visitor.visitExpressionType(this, context); 4413 } 4414} 4415class ArrayType extends Type { 4416 constructor(of, modifiers) { 4417 super(modifiers); 4418 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "of", void 0); 4419 this.of = of; 4420 } 4421 visitType(visitor, context) { 4422 return visitor.visitArrayType(this, context); 4423 } 4424} 4425class MapType extends Type { 4426 constructor(valueType, modifiers) { 4427 super(modifiers); 4428 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "valueType", void 0); 4429 this.valueType = valueType || null; 4430 } 4431 visitType(visitor, context) { 4432 return visitor.visitMapType(this, context); 4433 } 4434} 4435class TransplantedType extends Type { 4436 constructor(type, modifiers) { 4437 super(modifiers); 4438 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "type", void 0); 4439 this.type = type; 4440 } 4441 visitType(visitor, context) { 4442 return visitor.visitTransplantedType(this, context); 4443 } 4444} 4445const DYNAMIC_TYPE = new BuiltinType(BuiltinTypeName.Dynamic); 4446const INFERRED_TYPE = new BuiltinType(BuiltinTypeName.Inferred); 4447const BOOL_TYPE = new BuiltinType(BuiltinTypeName.Bool); 4448const INT_TYPE = new BuiltinType(BuiltinTypeName.Int); 4449const NUMBER_TYPE = new BuiltinType(BuiltinTypeName.Number); 4450const STRING_TYPE = new BuiltinType(BuiltinTypeName.String); 4451const FUNCTION_TYPE = new BuiltinType(BuiltinTypeName.Function); 4452const NONE_TYPE = new BuiltinType(BuiltinTypeName.None); 4453///// Expressions 4454var UnaryOperator = /*#__PURE__*/function (UnaryOperator) { 4455 UnaryOperator[UnaryOperator["Minus"] = 0] = "Minus"; 4456 UnaryOperator[UnaryOperator["Plus"] = 1] = "Plus"; 4457 return UnaryOperator; 4458}(UnaryOperator || {}); 4459var BinaryOperator = /*#__PURE__*/function (BinaryOperator) { 4460 BinaryOperator[BinaryOperator["Equals"] = 0] = "Equals"; 4461 BinaryOperator[BinaryOperator["NotEquals"] = 1] = "NotEquals"; 4462 BinaryOperator[BinaryOperator["Identical"] = 2] = "Identical"; 4463 BinaryOperator[BinaryOperator["NotIdentical"] = 3] = "NotIdentical"; 4464 BinaryOperator[BinaryOperator["Minus"] = 4] = "Minus"; 4465 BinaryOperator[BinaryOperator["Plus"] = 5] = "Plus"; 4466 BinaryOperator[BinaryOperator["Divide"] = 6] = "Divide"; 4467 BinaryOperator[BinaryOperator["Multiply"] = 7] = "Multiply"; 4468 BinaryOperator[BinaryOperator["Modulo"] = 8] = "Modulo"; 4469 BinaryOperator[BinaryOperator["And"] = 9] = "And"; 4470 BinaryOperator[BinaryOperator["Or"] = 10] = "Or"; 4471 BinaryOperator[BinaryOperator["BitwiseOr"] = 11] = "BitwiseOr"; 4472 BinaryOperator[BinaryOperator["BitwiseAnd"] = 12] = "BitwiseAnd"; 4473 BinaryOperator[BinaryOperator["Lower"] = 13] = "Lower"; 4474 BinaryOperator[BinaryOperator["LowerEquals"] = 14] = "LowerEquals"; 4475 BinaryOperator[BinaryOperator["Bigger"] = 15] = "Bigger"; 4476 BinaryOperator[BinaryOperator["BiggerEquals"] = 16] = "BiggerEquals"; 4477 BinaryOperator[BinaryOperator["NullishCoalesce"] = 17] = "NullishCoalesce"; 4478 return BinaryOperator; 4479}(BinaryOperator || {}); 4480function nullSafeIsEquivalent(base, other) { 4481 if (base == null || other == null) { 4482 return base == other; 4483 } 4484 return base.isEquivalent(other); 4485} 4486function areAllEquivalentPredicate(base, other, equivalentPredicate) { 4487 const len = base.length; 4488 if (len !== other.length) { 4489 return false;
4490 } 4491 for (let i = 0; i < len; i++) { 4492 if (!equivalentPredicate(base[i], other[i])) { 4493 return false; 4494 } 4495 } 4496 return true; 4497} 4498function areAllEquivalent(base, other) { 4499 return areAllEquivalentPredicate(base, other, (baseElement, otherElement) => baseElement.isEquivalent(otherElement)); 4500} 4501class Expression { 4502 constructor(type, sourceSpan) { 4503 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "type", void 0); 4504 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "sourceSpan", void 0); 4505 this.type = type || null; 4506 this.sourceSpan = sourceSpan || null; 4507 } 4508 prop(name, sourceSpan) { 4509 return new ReadPropExpr(this, name, null, sourceSpan); 4510 } 4511 key(index, type, sourceSpan) { 4512 return new ReadKeyExpr(this, index, type, sourceSpan); 4513 } 4514 callFn(params, sourceSpan, pure) { 4515 return new InvokeFunctionExpr(this, params, null, sourceSpan, pure); 4516 } 4517 instantiate(params, type, sourceSpan) { 4518 return new InstantiateExpr(this, params, type, sourceSpan); 4519 } 4520 conditional(trueCase, falseCase = null, sourceSpan) { 4521 return new ConditionalExpr(this, trueCase, falseCase, null, sourceSpan); 4522 } 4523 equals(rhs, sourceSpan) { 4524 return new BinaryOperatorExpr(BinaryOperator.Equals, this, rhs, null, sourceSpan); 4525 } 4526 notEquals(rhs, sourceSpan) { 4527 return new BinaryOperatorExpr(BinaryOperator.NotEquals, this, rhs, null, sourceSpan); 4528 } 4529 identical(rhs, sourceSpan) { 4530 return new BinaryOperatorExpr(BinaryOperator.Identical, this, rhs, null, sourceSpan); 4531 } 4532 notIdentical(rhs, sourceSpan) { 4533 return new BinaryOperatorExpr(BinaryOperator.NotIdentical, this, rhs, null, sourceSpan); 4534 } 4535 minus(rhs, sourceSpan) { 4536 return new BinaryOperatorExpr(BinaryOperator.Minus, this, rhs, null, sourceSpan); 4537 } 4538 plus(rhs, sourceSpan) { 4539 return new BinaryOperatorExpr(BinaryOperator.Plus, this, rhs, null, sourceSpan); 4540 } 4541 divide(rhs, sourceSpan) { 4542 return new BinaryOperatorExpr(BinaryOperator.Divide, this, rhs, null, sourceSpan); 4543 } 4544 multiply(rhs, sourceSpan) { 4545 return new BinaryOperatorExpr(BinaryOperator.Multiply, this, rhs, null, sourceSpan); 4546 } 4547 modulo(rhs, sourceSpan) { 4548 return new BinaryOperatorExpr(BinaryOperator.Modulo, this, rhs, null, sourceSpan); 4549 } 4550 and(rhs, sourceSpan) { 4551 return new BinaryOperatorExpr(BinaryOperator.And, this, rhs, null, sourceSpan); 4552 } 4553 bitwiseOr(rhs, sourceSpan, parens = true) { 4554 return new BinaryOperatorExpr(BinaryOperator.BitwiseOr, this, rhs, null, sourceSpan, parens); 4555 } 4556 bitwiseAnd(rhs, sourceSpan, parens = true) { 4557 return new BinaryOperatorExpr(BinaryOperator.BitwiseAnd, this, rhs, null, sourceSpan, parens); 4558 } 4559 or(rhs, sourceSpan) { 4560 return new BinaryOperatorExpr(BinaryOperator.Or, this, rhs, null, sourceSpan); 4561 } 4562 lower(rhs, sourceSpan) { 4563 return new BinaryOperatorExpr(BinaryOperator.Lower, this, rhs, null, sourceSpan); 4564 } 4565 lowerEquals(rhs, sourceSpan) { 4566 return new BinaryOperatorExpr(BinaryOperator.LowerEquals, this, rhs, null, sourceSpan); 4567 } 4568 bigger(rhs, sourceSpan) { 4569 return new BinaryOperatorExpr(BinaryOperator.Bigger, this, rhs, null, sourceSpan); 4570 } 4571 biggerEquals(rhs, sourceSpan) { 4572 return new BinaryOperatorExpr(BinaryOperator.BiggerEquals, this, rhs, null, sourceSpan); 4573 } 4574 isBlank(sourceSpan) { 4575 // Note: We use equals by purpose here to compare to null and undefined in JS. 4576 // We use the typed null to allow strictNullChecks to narrow types. 4577 return this.equals(TYPED_NULL_EXPR, sourceSpan); 4578 } 4579 nullishCoalesce(rhs, sourceSpan) { 4580 return new BinaryOperatorExpr(BinaryOperator.NullishCoalesce, this, rhs, null, sourceSpan); 4581 } 4582 toStmt() { 4583 return new ExpressionStatement(this, null); 4584 } 4585} 4586class ReadVarExpr extends Expression { 4587 constructor(name, type, sourceSpan) { 4588 super(type, sourceSpan); 4589 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "name", void 0); 4590 this.name = name; 4591 } 4592 isEquivalent(e) {
4593 return e instanceof ReadVarExpr && this.name === e.name; 4594 } 4595 isConstant() { 4596 return false; 4597 } 4598 visitExpression(visitor, context) { 4599 return visitor.visitReadVarExpr(this, context); 4600 } 4601 clone() { 4602 return new ReadVarExpr(this.name, this.type, this.sourceSpan); 4603 } 4604 set(value) { 4605 return new WriteVarExpr(this.name, value, null, this.sourceSpan); 4606 } 4607} 4608class TypeofExpr extends Expression { 4609 constructor(expr, type, sourceSpan) { 4610 super(type, sourceSpan); 4611 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "expr", void 0); 4612 this.expr = expr; 4613 } 4614 visitExpression(visitor, context) { 4615 return visitor.visitTypeofExpr(this, context); 4616 } 4617 isEquivalent(e) { 4618 return e instanceof TypeofExpr && e.expr.isEquivalent(this.expr); 4619 } 4620 isConstant() { 4621 return this.expr.isConstant(); 4622 } 4623 clone() { 4624 return new TypeofExpr(this.expr.clone()); 4625 } 4626} 4627class WrappedNodeExpr extends Expression { 4628 constructor(node, type, sourceSpan) { 4629 super(type, sourceSpan); 4630 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "node", void 0); 4631 this.node = node; 4632 } 4633 isEquivalent(e) { 4634 return e instanceof WrappedNodeExpr && this.node === e.node; 4635 } 4636 isConstant() { 4637 return false; 4638 } 4639 visitExpression(visitor, context) { 4640 return visitor.visitWrappedNodeExpr(this, context); 4641 } 4642 clone() { 4643 return new WrappedNodeExpr(this.node, this.type, this.sourceSpan); 4644 } 4645} 4646class WriteVarExpr extends Expression { 4647 constructor(name, value, type, sourceSpan) { 4648 super(type || value.type, sourceSpan); 4649 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "name", void 0); 4650 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "value", void 0); 4651 this.name = name; 4652 this.value = value; 4653 } 4654 isEquivalent(e) { 4655 return e instanceof WriteVarExpr && this.name === e.name && this.value.isEquivalent(e.value); 4656 } 4657 isConstant() { 4658 return false; 4659 } 4660 visitExpression(visitor, context) { 4661 return visitor.visitWriteVarExpr(this, context); 4662 } 4663 clone() { 4664 return new WriteVarExpr(this.name, this.value.clone(), this.type, this.sourceSpan); 4665 } 4666 toDeclStmt(type, modifiers) { 4667 return new DeclareVarStmt(this.name, this.value, type, modifiers, this.sourceSpan); 4668 } 4669 toConstDecl() { 4670 return this.toDeclStmt(INFERRED_TYPE, StmtModifier.Final); 4671 } 4672} 4673class WriteKeyExpr extends Expression { 4674 constructor(receiver, index, value, type, sourceSpan) { 4675 super(type || value.type, sourceSpan); 4676 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "receiver", void 0); 4677 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "index", void 0); 4678 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "value", void 0); 4679 this.receiver = receiver; 4680 this.index = index; 4681 this.value = value; 4682 } 4683 isEquivalent(e) { 4684 return e instanceof WriteKeyExpr && this.receiver.isEquivalent(e.receiver) && this.index.isEquivalent(e.index) && this.value.isEquivalent(e.value); 4685 } 4686 isConstant() { 4687 return false; 4688 } 4689 visitExpression(visitor, context) { 4690 return visitor.visitWriteKeyExpr(this, context); 4691 } 4692 clone() { 4693 return new WriteKeyExpr(this.receiver.clone(), this.index.clone(), this.value.clone(), this.type, this.sourceSpan); 4694 } 4695} 4696class WritePropExpr extends Expression { 4697 constructor(receiver, name, value, type, sourceSpan) { 4698 super(type || value.type, sourceSpan); 4699 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "receiver", void 0); 4700 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "name", void 0); 4701 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "value", void 0); 4702 this.receiver = receiver; 4703 this.name = name; 4704 this.value = value; 4705 } 4706 isEquivalent(e) { 4707 return e instanceof WritePropExpr && this.receiver.isEquivalent(e.receiver) && this.name === e.
4707name && this.value.isEquivalent(e.value); 4708 } 4709 isConstant() { 4710 return false; 4711 } 4712 visitExpression(visitor, context) { 4713 return visitor.visitWritePropExpr(this, context); 4714 } 4715 clone() { 4716 return new WritePropExpr(this.receiver.clone(), this.name, this.value.clone(), this.type, this.sourceSpan); 4717 } 4718} 4719class InvokeFunctionExpr extends Expression { 4720 constructor(fn, args, type, sourceSpan, pure = false) { 4721 super(type, sourceSpan); 4722 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "fn", void 0); 4723 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "args", void 0); 4724 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "pure", void 0); 4725 this.fn = fn; 4726 this.args = args; 4727 this.pure = pure; 4728 } 4729 // An alias for fn, which allows other logic to handle calls and property reads together. 4730 get receiver() { 4731 return this.fn; 4732 } 4733 isEquivalent(e) { 4734 return e instanceof InvokeFunctionExpr && this.fn.isEquivalent(e.fn) && areAllEquivalent(this.args, e.args) && this.pure === e.pure; 4735 } 4736 isConstant() { 4737 return false; 4738 } 4739 visitExpression(visitor, context) { 4740 return visitor.visitInvokeFunctionExpr(this, context); 4741 } 4742 clone() { 4743 return new InvokeFunctionExpr(this.fn.clone(), this.args.map(arg => arg.clone()), this.type, this.sourceSpan, this.pure); 4744 } 4745} 4746class TaggedTemplateLiteralExpr extends Expression { 4747 constructor(tag, template, type, sourceSpan) { 4748 super(type, sourceSpan); 4749 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "tag", void 0); 4750 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "template", void 0); 4751 this.tag = tag; 4752 this.template = template; 4753 } 4754 isEquivalent(e) { 4755 return e instanceof TaggedTemplateLiteralExpr && this.tag.isEquivalent(e.tag) && this.template.isEquivalent(e.template); 4756 } 4757 isConstant() { 4758 return false; 4759 } 4760 visitExpression(visitor, context) { 4761 return visitor.visitTaggedTemplateLiteralExpr(this, context); 4762 } 4763 clone() { 4764 return new TaggedTemplateLiteralExpr(this.tag.clone(), this.template.clone(), this.type, this.sourceSpan); 4765 } 4766} 4767class InstantiateExpr extends Expression { 4768 constructor(classExpr, args, type, sourceSpan) { 4769 super(type, sourceSpan); 4770 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "classExpr", void 0); 4771 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "args", void 0); 4772 this.classExpr = classExpr; 4773 this.args = args; 4774 } 4775 isEquivalent(e) { 4776 return e instanceof InstantiateExpr && this.classExpr.isEquivalent(e.classExpr) && areAllEquivalent(this.args, e.args); 4777 } 4778 isConstant() { 4779 return false; 4780 } 4781 visitExpression(visitor, context) { 4782 return visitor.visitInstantiateExpr(this, context); 4783 } 4784 clone() { 4785 return new InstantiateExpr(this.classExpr.clone(), this.args.map(arg => arg.clone()), this.type, this.sourceSpan); 4786 } 4787} 4788class LiteralExpr extends Expression { 4789 constructor(value, type, sourceSpan) { 4790 super(type, sourceSpan); 4791 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "value", void 0); 4792 this.value = value; 4793 } 4794 isEquivalent(e) { 4795 return e instanceof LiteralExpr && this.value === e.value; 4796 } 4797 isConstant() { 4798 return true; 4799 } 4800 visitExpression(visitor, context) { 4801 return visitor.visitLiteralExpr(this, context); 4802 } 4803 clone() { 4804 return new LiteralExpr(this.value, this.type, this.sourceSpan); 4805 } 4806}
4807class TemplateLiteralExpr extends Expression { 4808 constructor(elements, expressions, sourceSpan) { 4809 super(null, sourceSpan); 4810 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "elements", void 0); 4811 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "expressions", void 0); 4812 this.elements = elements; 4813 this.expressions = expressions; 4814 } 4815 isEquivalent(e) { 4816 return e instanceof TemplateLiteralExpr && areAllEquivalentPredicate(this.elements, e.elements, (a, b) => a.text === b.text) && areAllEquivalent(this.expressions, e.expressions); 4817 } 4818 isConstant() { 4819 return false; 4820 } 4821 visitExpression(visitor, context) { 4822 return visitor.visitTemplateLiteralExpr(this, context); 4823 } 4824 clone() { 4825 return new TemplateLiteralExpr(this.elements.map(el => el.clone()), this.expressions.map(expr => expr.clone())); 4826 } 4827} 4828class TemplateLiteralElementExpr extends Expression { 4829 constructor(text, sourceSpan, rawText) { 4830 super(STRING_TYPE, sourceSpan); 4831 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "text", void 0); 4832 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "rawText", void 0); 4833 this.text = text; 4834 // If `rawText` is not provided, "fake" the raw string by escaping the following sequences: 4835 // - "\" would otherwise indicate that the next character is a control character. 4836 // - "`" and "${" are template string control sequences that would otherwise prematurely 4837 // indicate the end of the template literal element. 4838 // Note that we can't rely on the `sourceSpan` here, because it may be incorrect (see 4839 // https://github.com/angular/angular/pull/60267#discussion_r1986402524). 4840 this.rawText = rawText !== null && rawText !== void 0 ? rawText : escapeForTemplateLiteral(escapeSlashes(text)); 4841 } 4842 visitExpression(visitor, context) { 4843 return visitor.visitTemplateLiteralElementExpr(this, context); 4844 } 4845 isEquivalent(e) { 4846 return e instanceof TemplateLiteralElementExpr && e.text === this.text && e.rawText === this.rawText; 4847 } 4848 isConstant() { 4849 return true; 4850 } 4851 clone() { 4852 return new TemplateLiteralElementExpr(this.text, this.sourceSpan, this.rawText); 4853 } 4854} 4855class LiteralPiece { 4856 constructor(text, sourceSpan) { 4857 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "text", void 0); 4858 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "sourceSpan", void 0); 4859 this.text = text; 4860 this.sourceSpan = sourceSpan; 4861 } 4862} 4863class PlaceholderPiece { 4864 /** 4865 * Create a new instance of a `PlaceholderPiece`. 4866 * 4867 * @param text the name of this placeholder (e.g. `PH_1`). 4868 * @param sourceSpan the location of this placeholder in its localized message the source code. 4869 * @param associatedMessage reference to another message that this placeholder is associated with. 4870 * The `associatedMessage` is mainly used to provide a relationship to an ICU message that has 4871 * been extracted out from the message containing the placeholder. 4872 */ 4873 constructor(text, sourceSpan, associatedMessage) { 4874 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "text", void 0); 4875 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "sourceSpan", void 0); 4876 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "associatedMessage", void 0); 4877 this.text = text; 4878 this.sourceSpan = sourceSpan; 4879 this.associatedMessage = associatedMessage; 4880 } 4881} 4882const MEANING_SEPARATOR$1 = '|'; 4883const ID_SEPARATOR$1 = '@@'; 4884const LEGACY_ID_INDICATOR = 'â';
4885class LocalizedString extends Expression { 4886 constructor(metaBlock, messageParts, placeHolderNames, expressions, sourceSpan) { 4887 super(STRING_TYPE, sourceSpan); 4888 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "metaBlock", void 0); 4889 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "messageParts", void 0); 4890 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "placeHolderNames", void 0); 4891 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "expressions", void 0); 4892 this.metaBlock = metaBlock; 4893 this.messageParts = messageParts; 4894 this.placeHolderNames = placeHolderNames; 4895 this.expressions = expressions; 4896 } 4897 isEquivalent(e) { 4898 // return e instanceof LocalizedString && this.message === e.message; 4899 return false; 4900 } 4901 isConstant() { 4902 return false; 4903 } 4904 visitExpression(visitor, context) { 4905 return visitor.visitLocalizedString(this, context); 4906 } 4907 clone() { 4908 return new LocalizedString(this.metaBlock, this.messageParts, this.placeHolderNames, this.expressions.map(expr => expr.clone()), this.sourceSpan); 4909 } 4910 /** 4911 * Serialize the given `meta` and `messagePart` into "cooked" and "raw" strings that can be used 4912 * in a `$localize` tagged string. The format of the metadata is the same as that parsed by 4913 * `parseI18nMeta()`. 4914 * 4915 * @param meta The metadata to serialize 4916 * @param messagePart The first part of the tagged string 4917 */ 4918 serializeI18nHead() { 4919 let metaBlock = this.metaBlock.description || ''; 4920 if (this.metaBlock.meaning) { 4921 metaBlock = `${this.metaBlock.meaning}${MEANING_SEPARATOR$1}${metaBlock}`; 4922 } 4923 if (this.metaBlock.customId) { 4924 metaBlock = `${metaBlock}${ID_SEPARATOR$1}${this.metaBlock.customId}`; 4925 } 4926 if (this.metaBlock.legacyIds) { 4927 this.metaBlock.legacyIds.forEach(legacyId => { 4928 metaBlock = `${metaBlock}${LEGACY_ID_INDICATOR}${legacyId}`; 4929 }); 4930 } 4931 return createCookedRawString(metaBlock, this.messageParts[0].text, this.getMessagePartSourceSpan(0)); 4932 } 4933 getMessagePartSourceSpan(i) { 4934 var _this$messageParts$i$, _this$messageParts$i; 4935 return (_this$messageParts$i$ = (_this$messageParts$i = this.messageParts[i]) === null || _this$messageParts$i === void 0 ? void 0 : _this$messageParts$i.sourceSpan) !== null && _this$messageParts$i$ !== void 0 ? _this$messageParts$i$ : this.sourceSpan; 4936 } 4937 getPlaceholderSourceSpan(i) { 4938 var _ref, _this$placeHolderName, _this$placeHolderName2, _this$expressions$i; 4939 return (_ref = (_this$placeHolderName = (_this$placeHolderName2 = this.placeHolderNames[i]) === null || _this$placeHolderName2 === void 0 ? void 0 : _this$placeHolderName2.sourceSpan) !== null && _this$placeHolderName !== void 0 ? _this$placeHolderName : (_this$expressions$i = this.expressions[i]) === null || _this$expressions$i === void 0 ? void 0 : _this$expressions$i.sourceSpan) !== null && _ref !== void 0 ? _ref : this.sourceSpan; 4940 } 4941 /** 4942 * Serialize the given `placeholderName` and `messagePart` into "cooked" and "raw" strings that 4943 * can be used in a `$localize` tagged string. 4944 * 4945 * The format is `:<placeholder-name>[@@<associated-id>]:`. 4946 * 4947 * The `associated-id` is the message id of the (usually an ICU) message to which this placeholder 4948 * refers. 4949 * 4950 * @param partIndex The index of the message part to serialize. 4951 */ 4952 serializeI18nTemplatePart(partIndex) { 4953 var _placeholder$associat; 4954 const placeholder = this.placeHolderNames[partIndex - 1]; 4955 const messagePart = this.messageParts[partIndex]; 4956 let metaBlock = placeholder.text; 4957 if (((_placeholder$associat = placeholder.associatedMessage) === null || _placeholder$associat === void 0 ? void 0 : _placeholder$associat.legacyIds.length) === 0) { 4958 metaBlock += `${ID_SEPARATOR$1}${computeMsgId(placeholder.associatedMessage.messageString, placeholder.associatedMessage.meaning)}`; 4959 } 4960 return createCookedRawString(metaBlock, messagePart.text, this.getMessagePartSourceSpan(partIndex)); 4961 } 4962} 4963const escapeSlashes = str => str.replace(/\\/g, '\\\\'); 4964const escapeStartingColon = str => str.replace(/^:/, '\\:'); 4965const escapeColons = str => str.replace(/:/g, '\\:'); 4966const escapeForTemplateLiteral = str => str.replace(/`/g, '\\`').replace(/\${/g, '$\\{'); 4967/** 4968 * Creates a `{cooked, raw}` object from the `metaBlock` and `messagePart`. 4969 * 4970 * The `raw` text must have various character sequences escaped: 4971 * * "\" would otherwise indicate that the next character is a control character. 4972 * * "`" and "${" are template string control sequences that would otherwise prematurely indicate 4973 * the end of a message part. 4974 * * ":" inside a metablock would prematurely indicate the end of the metablock. 4975 * * ":" at the start of a messagePart with no metablock would erroneously indicate the start of a 4976 * metablock. 4977 * 4978 * @param metaBlock Any metadata that should be prepended to the string 4979 * @param messagePart The message part of the string 4980 */ 4981function createCookedRawString(metaBlock, messagePart, range) { 4982 if (metaBlock === '') { 4983 return { 4984 cooked: messagePart, 4985 raw: escapeForTemplateLiteral(escapeStartingColon(escapeSlashes(messagePart))), 4986 range 4987 }; 4988 } else { 4989 return { 4990 cooked: `:${metaBlock}:${messagePart}`, 4991 raw: escapeForTemplateLiteral(`:${escapeColons(escapeSlashes(metaBlock))}:${escapeSlashes(messagePart)}`), 4992 range 4993 }; 4994 } 4995}
4996class ExternalExpr extends Expression { 4997 constructor(value, type, typeParams = null, sourceSpan) { 4998 super(type, sourceSpan); 4999 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "value", void 0); 5000 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "typeParams", void 0); 5001 this.value = value; 5002 this.typeParams = typeParams; 5003 } 5004 isEquivalent(e) { 5005 return e instanceof ExternalExpr && this.value.name === e.value.name && this.value.moduleName === e.value.moduleName; 5006 } 5007 isConstant() { 5008 return false; 5009 } 5010 visitExpression(visitor, context) { 5011 return visitor.visitExternalExpr(this, context); 5012 } 5013 clone() { 5014 return new ExternalExpr(this.value, this.type, this.typeParams, this.sourceSpan); 5015 } 5016} 5017class ExternalReference { 5018 constructor(moduleName, name) { 5019 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "moduleName", void 0); 5020 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "name", void 0); 5021 this.moduleName = moduleName; 5022 this.name = name; 5023 } 5024} 5025class ConditionalExpr extends Expression { 5026 constructor(condition, trueCase, falseCase = null, type, sourceSpan) { 5027 super(type || trueCase.type, sourceSpan); 5028 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "condition", void 0); 5029 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "falseCase", void 0); 5030 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "trueCase", void 0); 5031 this.condition = condition; 5032 this.falseCase = falseCase; 5033 this.trueCase = trueCase; 5034 } 5035 isEquivalent(e) { 5036 return e instanceof ConditionalExpr && this.condition.isEquivalent(e.condition) && this.trueCase.isEquivalent(e.trueCase) && nullSafeIsEquivalent(this.falseCase, e.falseCase); 5037 } 5038 isConstant() { 5039 return false; 5040 } 5041 visitExpression(visitor, context) { 5042 return visitor.visitConditionalExpr(this, context); 5043 } 5044 clone() { 5045 var _this$falseCase; 5046 return new ConditionalExpr(this.condition.clone(), this.trueCase.clone(), (_this$falseCase = this.falseCase) === null || _this$falseCase === void 0 ? void 0 : _this$falseCase.clone(), this.type, this.sourceSpan); 5047 } 5048} 5049class DynamicImportExpr extends Expression { 5050 constructor(url, sourceSpan, urlComment) { 5051 super(null, sourceSpan); 5052 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "url", void 0); 5053 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "urlComment", void 0); 5054 this.url = url; 5055 this.urlComment = urlComment; 5056 } 5057 isEquivalent(e) { 5058 return e instanceof DynamicImportExpr && this.url === e.url && this.urlComment === e.urlComment; 5059 } 5060 isConstant() { 5061 return false; 5062 } 5063 visitExpression(visitor, context) { 5064 return visitor.visitDynamicImportExpr(this, context); 5065 } 5066 clone() { 5067 return new DynamicImportExpr(typeof this.url === 'string' ? this.url : this.url.clone(), this.sourceSpan, this.urlComment); 5068 } 5069} 5070class NotExpr extends Expression { 5071 constructor(condition, sourceSpan) { 5072 super(BOOL_TYPE, sourceSpan); 5073 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "condition", void 0); 5074 this.condition = condition; 5075 } 5076 isEquivalent(e) { 5077 return e instanceof NotExpr && this.condition.isEquivalent(e.condition); 5078 } 5079 isConstant() { 5080 return false;
5081 } 5082 visitExpression(visitor, context) { 5083 return visitor.visitNotExpr(this, context); 5084 } 5085 clone() { 5086 return new NotExpr(this.condition.clone(), this.sourceSpan); 5087 } 5088} 5089class FnParam { 5090 constructor(name, type = null) { 5091 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "name", void 0); 5092 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "type", void 0); 5093 this.name = name; 5094 this.type = type; 5095 } 5096 isEquivalent(param) { 5097 return this.name === param.name; 5098 } 5099 clone() { 5100 return new FnParam(this.name, this.type); 5101 } 5102} 5103class FunctionExpr extends Expression { 5104 constructor(params, statements, type, sourceSpan, name) { 5105 super(type, sourceSpan); 5106 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "params", void 0); 5107 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "statements", void 0); 5108 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "name", void 0); 5109 this.params = params; 5110 this.statements = statements; 5111 this.name = name; 5112 } 5113 isEquivalent(e) { 5114 return (e instanceof FunctionExpr || e instanceof DeclareFunctionStmt) && areAllEquivalent(this.params, e.params) && areAllEquivalent(this.statements, e.statements); 5115 } 5116 isConstant() { 5117 return false; 5118 } 5119 visitExpression(visitor, context) { 5120 return visitor.visitFunctionExpr(this, context); 5121 } 5122 toDeclStmt(name, modifiers) { 5123 return new DeclareFunctionStmt(name, this.params, this.statements, this.type, modifiers, this.sourceSpan); 5124 } 5125 clone() { 5126 // TODO: Should we deep clone statements? 5127 return new FunctionExpr(this.params.map(p => p.clone()), this.statements, this.type, this.sourceSpan, this.name); 5128 } 5129} 5130class ArrowFunctionExpr extends Expression { 5131 // Note that `body: Expression` represents `() => expr` whereas 5132 // `body: Statement[]` represents `() => { expr }`. 5133 constructor(params, body, type, sourceSpan) { 5134 super(type, sourceSpan); 5135 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "params", void 0); 5136 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "body", void 0); 5137 this.params = params; 5138 this.body = body; 5139 } 5140 isEquivalent(e) { 5141 if (!(e instanceof ArrowFunctionExpr) || !areAllEquivalent(this.params, e.params)) { 5142 return false; 5143 } 5144 if (this.body instanceof Expression && e.body instanceof Expression) { 5145 return this.body.isEquivalent(e.body); 5146 } 5147 if (Array.isArray(this.body) && Array.isArray(e.body)) { 5148 return areAllEquivalent(this.body, e.body); 5149 } 5150 return false; 5151 } 5152 isConstant() { 5153 return false; 5154 } 5155 visitExpression(visitor, context) { 5156 return visitor.visitArrowFunctionExpr(this, context); 5157 } 5158 clone() { 5159 // TODO: Should we deep clone statements? 5160 return new ArrowFunctionExpr(this.params.map(p => p.clone()), Array.isArray(this.body) ? this.body : this.body.clone(), this.type, this.sourceSpan); 5161 } 5162 toDeclStmt(name, modifiers) { 5163 return new DeclareVarStmt(name, this, INFERRED_TYPE, modifiers, this.sourceSpan); 5164 } 5165} 5166class UnaryOperatorExpr extends Expression { 5167 constructor(operator, expr, type, sourceSpan, parens = true) { 5168 super(type || NUMBER_TYPE, sourceSpan); 5169 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "operator", void 0); 5170 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "expr", void 0); 5171 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "parens", void 0); 5172 this.operator = operator; 5173 this.expr = expr; 5174 this.parens = parens; 5175 } 5176 isEquivalent(e) { 5177 return e instanceof UnaryOperatorExpr && this.operator === e.operator && this.expr.isEquivalent(e.expr); 5178 } 5179 isConstant() { 5180 return false;
5181 } 5182 visitExpression(visitor, context) { 5183 return visitor.visitUnaryOperatorExpr(this, context); 5184 } 5185 clone() { 5186 return new UnaryOperatorExpr(this.operator, this.expr.clone(), this.type, this.sourceSpan, this.parens); 5187 } 5188} 5189class BinaryOperatorExpr extends Expression { 5190 constructor(operator, lhs, rhs, type, sourceSpan, parens = true) { 5191 super(type || lhs.type, sourceSpan); 5192 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "operator", void 0); 5193 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "rhs", void 0); 5194 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "parens", void 0); 5195 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "lhs", void 0); 5196 this.operator = operator; 5197 this.rhs = rhs; 5198 this.parens = parens; 5199 this.lhs = lhs; 5200 } 5201 isEquivalent(e) { 5202 return e instanceof BinaryOperatorExpr && this.operator === e.operator && this.lhs.isEquivalent(e.lhs) && this.rhs.isEquivalent(e.rhs); 5203 } 5204 isConstant() { 5205 return false; 5206 } 5207 visitExpression(visitor, context) { 5208 return visitor.visitBinaryOperatorExpr(this, context); 5209 } 5210 clone() { 5211 return new BinaryOperatorExpr(this.operator, this.lhs.clone(), this.rhs.clone(), this.type, this.sourceSpan, this.parens); 5212 } 5213} 5214class ReadPropExpr extends Expression { 5215 constructor(receiver, name, type, sourceSpan) { 5216 super(type, sourceSpan); 5217 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "receiver", void 0); 5218 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "name", void 0); 5219 this.receiver = receiver; 5220 this.name = name; 5221 } 5222 // An alias for name, which allows other logic to handle property reads and keyed reads together. 5223 get index() { 5224 return this.name; 5225 } 5226 isEquivalent(e) { 5227 return e instanceof ReadPropExpr && this.receiver.isEquivalent(e.receiver) && this.name === e.name; 5228 } 5229 isConstant() { 5230 return false; 5231 } 5232 visitExpression(visitor, context) { 5233 return visitor.visitReadPropExpr(this, context); 5234 } 5235 set(value) { 5236 return new WritePropExpr(this.receiver, this.name, value, null, this.sourceSpan); 5237 } 5238 clone() { 5239 return new ReadPropExpr(this.receiver.clone(), this.name, this.type, this.sourceSpan); 5240 } 5241} 5242class ReadKeyExpr extends Expression { 5243 constructor(receiver, index, type, sourceSpan) { 5244 super(type, sourceSpan); 5245 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "receiver", void 0); 5246 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "index", void 0); 5247 this.receiver = receiver; 5248 this.index = index; 5249 } 5250 isEquivalent(e) { 5251 return e instanceof ReadKeyExpr && this.receiver.isEquivalent(e.receiver) && this.index.isEquivalent(e.index); 5252 } 5253 isConstant() { 5254 return false; 5255 } 5256 visitExpression(visitor, context) { 5257 return visitor.visitReadKeyExpr(this, context); 5258 } 5259 set(value) { 5260 return new WriteKeyExpr(this.receiver, this.index, value, null, this.sourceSpan); 5261 } 5262 clone() { 5263 return new ReadKeyExpr(this.receiver.clone(), this.index.clone(), this.type, this.sourceSpan); 5264 } 5265} 5266class LiteralArrayExpr extends Expression { 5267 constructor(entries, type, sourceSpan) { 5268 super(type, sourceSpan); 5269 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "entries", void 0); 5270 this.entries = entries; 5271 } 5272 isConstant() { 5273 return this.entries.every(e => e.isConstant()); 5274 } 5275 isEquivalent(e) { 5276 return e instanceof LiteralArrayExpr && areAllEquivalent(this.entries, e.entries); 5277 } 5278 visitExpression(visitor, context) { 5279 return visitor.visitLiteralArrayExpr(this, context); 5280 } 5281 clone() { 5282 return new LiteralArrayExpr(this.entries.map(e => e.clone()), this.type, this.sourceSpan); 5283 } 5284} 5285class LiteralMapEntry { 5286 constructor(key, value, quoted) { 5287 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "key", void 0); 5288 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "value", void 0); 5289 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "quoted", void 0); 5290 this.key = key; 5291 this.value = value; 5292 this.quoted = quoted; 5293 } 5294 isEquivalent(e) { 5295 return this.key === e.key && this.value.isEquivalent(e.value); 5296 } 5297 clone() { 5298 return new LiteralMapEntry(this.key, this.value.clone(), this.quoted); 5299 } 5300}
5301class LiteralMapExpr extends Expression { 5302 constructor(entries, type, sourceSpan) { 5303 super(type, sourceSpan); 5304 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "entries", void 0); 5305 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "valueType", null); 5306 this.entries = entries; 5307 if (type) { 5308 this.valueType = type.valueType; 5309 } 5310 } 5311 isEquivalent(e) { 5312 return e instanceof LiteralMapExpr && areAllEquivalent(this.entries, e.entries); 5313 } 5314 isConstant() { 5315 return this.entries.every(e => e.value.isConstant()); 5316 } 5317 visitExpression(visitor, context) { 5318 return visitor.visitLiteralMapExpr(this, context); 5319 } 5320 clone() { 5321 const entriesClone = this.entries.map(entry => entry.clone()); 5322 return new LiteralMapExpr(entriesClone, this.type, this.sourceSpan); 5323 } 5324} 5325class CommaExpr extends Expression { 5326 constructor(parts, sourceSpan) { 5327 super(parts[parts.length - 1].type, sourceSpan); 5328 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "parts", void 0); 5329 this.parts = parts; 5330 } 5331 isEquivalent(e) { 5332 return e instanceof CommaExpr && areAllEquivalent(this.parts, e.parts); 5333 } 5334 isConstant() { 5335 return false; 5336 } 5337 visitExpression(visitor, context) { 5338 return visitor.visitCommaExpr(this, context); 5339 } 5340 clone() { 5341 return new CommaExpr(this.parts.map(p => p.clone())); 5342 } 5343} 5344const NULL_EXPR = new LiteralExpr(null, null, null); 5345const TYPED_NULL_EXPR = new LiteralExpr(null, INFERRED_TYPE, null); 5346//// Statements 5347var StmtModifier = /*#__PURE__*/function (StmtModifier) { 5348 StmtModifier[StmtModifier["None"] = 0] = "None"; 5349 StmtModifier[StmtModifier["Final"] = 1] = "Final"; 5350 StmtModifier[StmtModifier["Private"] = 2] = "Private"; 5351 StmtModifier[StmtModifier["Exported"] = 4] = "Exported"; 5352 StmtModifier[StmtModifier["Static"] = 8] = "Static"; 5353 return StmtModifier; 5354}(StmtModifier || {}); 5355class LeadingComment { 5356 constructor(text, multiline, trailingNewline) { 5357 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "text", void 0); 5358 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "multiline", void 0); 5359 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "trailingNewline", void 0); 5360 this.text = text; 5361 this.multiline = multiline; 5362 this.trailingNewline = trailingNewline; 5363 } 5364 toString() { 5365 return this.multiline ? ` ${this.text} ` : this.text; 5366 } 5367} 5368class JSDocComment extends LeadingComment { 5369 constructor(tags) { 5370 super('', /* multiline */true, /* trailingNewline */true); 5371 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "tags", void 0); 5372 this.tags = tags; 5373 } 5374 toString() { 5375 return serializeTags(this.tags); 5376 } 5377} 5378class Statement { 5379 constructor(modifiers = StmtModifier.None, sourceSpan = null, leadingComments) { 5380 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "modifiers", void 0); 5381 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "sourceSpan", void 0); 5382 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "leadingComments", void 0); 5383 this.modifiers = modifiers; 5384 this.sourceSpan = sourceSpan; 5385 this.leadingComments = leadingComments; 5386 } 5387 hasModifier(modifier) { 5388 return (this.modifiers & modifier) !== 0; 5389 } 5390 addLeadingComment(leadingComment) { 5391 var _this$leadingComments; 5392 this.leadingComments = (_this$leadingComments = this.leadingComments) !== null && _this$leadingComments !== void 0 ? _this$leadingComments : []; 5393 this.leadingComments.push(leadingComment); 5394 } 5395} 5396class DeclareVarStmt extends Statement { 5397 constructor(name, value, type, modifiers, sourceSpan, leadingComments) { 5398 super(modifiers, sourceSpan, leadingComments); 5399 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "name", void 0); 5400 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "value", void 0); 5401 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "type", void 0); 5402 this.name = name; 5403 this.value = value; 5404 this.type = type || value && value.type || null; 5405 } 5406 isEquivalent(stmt) { 5407 return stmt instanceof DeclareVarStmt && this.name === stmt.name && (this.value ? !!stmt.value && this.value.isEquivalent(stmt.value) : !stmt.value); 5408 }
5409 visitStatement(visitor, context) { 5410 return visitor.visitDeclareVarStmt(this, context); 5411 } 5412} 5413class DeclareFunctionStmt extends Statement { 5414 constructor(name, params, statements, type, modifiers, sourceSpan, leadingComments) { 5415 super(modifiers, sourceSpan, leadingComments); 5416 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "name", void 0); 5417 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "params", void 0); 5418 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "statements", void 0); 5419 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "type", void 0); 5420 this.name = name; 5421 this.params = params; 5422 this.statements = statements; 5423 this.type = type || null; 5424 } 5425 isEquivalent(stmt) { 5426 return stmt instanceof DeclareFunctionStmt && areAllEquivalent(this.params, stmt.params) && areAllEquivalent(this.statements, stmt.statements); 5427 } 5428 visitStatement(visitor, context) { 5429 return visitor.visitDeclareFunctionStmt(this, context); 5430 } 5431} 5432class ExpressionStatement extends Statement { 5433 constructor(expr, sourceSpan, leadingComments) { 5434 super(StmtModifier.None, sourceSpan, leadingComments); 5435 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "expr", void 0); 5436 this.expr = expr; 5437 } 5438 isEquivalent(stmt) { 5439 return stmt instanceof ExpressionStatement && this.expr.isEquivalent(stmt.expr); 5440 } 5441 visitStatement(visitor, context) { 5442 return visitor.visitExpressionStmt(this, context); 5443 } 5444} 5445class ReturnStatement extends Statement { 5446 constructor(value, sourceSpan = null, leadingComments) { 5447 super(StmtModifier.None, sourceSpan, leadingComments); 5448 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "value", void 0); 5449 this.value = value; 5450 } 5451 isEquivalent(stmt) { 5452 return stmt instanceof ReturnStatement && this.value.isEquivalent(stmt.value); 5453 } 5454 visitStatement(visitor, context) { 5455 return visitor.visitReturnStmt(this, context); 5456 } 5457} 5458class IfStmt extends Statement { 5459 constructor(condition, trueCase, falseCase = [], sourceSpan, leadingComments) { 5460 super(StmtModifier.None, sourceSpan, leadingComments); 5461 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "condition", void 0); 5462 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "trueCase", void 0); 5463 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "falseCase", void 0); 5464 this.condition = condition; 5465 this.trueCase = trueCase; 5466 this.falseCase = falseCase; 5467 } 5468 isEquivalent(stmt) { 5469 return stmt instanceof IfStmt && this.condition.isEquivalent(stmt.condition) && areAllEquivalent(this.trueCase, stmt.trueCase) && areAllEquivalent(this.falseCase, stmt.falseCase); 5470 } 5471 visitStatement(visitor, context) { 5472 return visitor.visitIfStmt(this, context); 5473 } 5474} 5475let RecursiveAstVisitor$1 = class RecursiveAstVisitor { 5476 visitType(ast, context) { 5477 return ast; 5478 } 5479 visitExpression(ast, context) { 5480 if (ast.type) { 5481 ast.type.visitType(this, context); 5482 } 5483 return ast; 5484 } 5485 visitBuiltinType(type, context) { 5486 return this.visitType(type, context); 5487 } 5488 visitExpressionType(type, context) { 5489 type.value.visitExpression(this, context); 5490 if (type.typeParams !== null) {
5491 type.typeParams.forEach(param => this.visitType(param, context)); 5492 } 5493 return this.visitType(type, context); 5494 } 5495 visitArrayType(type, context) { 5496 return this.visitType(type, context); 5497 } 5498 visitMapType(type, context) { 5499 return this.visitType(type, context); 5500 } 5501 visitTransplantedType(type, context) { 5502 return type; 5503 } 5504 visitWrappedNodeExpr(ast, context) { 5505 return ast; 5506 } 5507 visitTypeofExpr(ast, context) { 5508 return this.visitExpression(ast, context); 5509 } 5510 visitReadVarExpr(ast, context) { 5511 return this.visitExpression(ast, context); 5512 } 5513 visitWriteVarExpr(ast, context) { 5514 ast.value.visitExpression(this, context); 5515 return this.visitExpression(ast, context); 5516 } 5517 visitWriteKeyExpr(ast, context) { 5518 ast.receiver.visitExpression(this, context); 5519 ast.index.visitExpression(this, context); 5520 ast.value.visitExpression(this, context); 5521 return this.visitExpression(ast, context); 5522 } 5523 visitWritePropExpr(ast, context) { 5524 ast.receiver.visitExpression(this, context); 5525 ast.value.visitExpression(this, context); 5526 return this.visitExpression(ast, context); 5527 } 5528 visitDynamicImportExpr(ast, context) { 5529 return this.visitExpression(ast, context); 5530 } 5531 visitInvokeFunctionExpr(ast, context) { 5532 ast.fn.visitExpression(this, context); 5533 this.visitAllExpressions(ast.args, context); 5534 return this.visitExpression(ast, context); 5535 } 5536 visitTaggedTemplateLiteralExpr(ast, context) { 5537 ast.tag.visitExpression(this, context); 5538 ast.template.visitExpression(this, context); 5539 return this.visitExpression(ast, context); 5540 } 5541 visitInstantiateExpr(ast, context) { 5542 ast.classExpr.visitExpression(this, context); 5543 this.visitAllExpressions(ast.args, context); 5544 return this.visitExpression(ast, context); 5545 } 5546 visitLiteralExpr(ast, context) { 5547 return this.visitExpression(ast, context); 5548 } 5549 visitLocalizedString(ast, context) { 5550 return this.visitExpression(ast, context); 5551 } 5552 visitExternalExpr(ast, context) { 5553 if (ast.typeParams) { 5554 ast.typeParams.forEach(type => type.visitType(this, context)); 5555 } 5556 return this.visitExpression(ast, context); 5557 } 5558 visitConditionalExpr(ast, context) { 5559 ast.condition.visitExpression(this, context); 5560 ast.trueCase.visitExpression(this, context); 5561 ast.falseCase.visitExpression(this, context); 5562 return this.visitExpression(ast, context); 5563 } 5564 visitNotExpr(ast, context) { 5565 ast.condition.visitExpression(this, context); 5566 return this.visitExpression(ast, context); 5567 } 5568 visitFunctionExpr(ast, context) { 5569 this.visitAllStatements(ast.statements, context); 5570 return this.visitExpression(ast, context); 5571 } 5572 visitArrowFunctionExpr(ast, context) { 5573 if (Array.isArray(ast.body)) { 5574 this.visitAllStatements(ast.body, context); 5575 } else { 5576 // Note: `body.visitExpression`, rather than `this.visitExpressiont(body)`, 5577 // because the latter won't recurse into the sub-expressions. 5578 ast.body.visitExpression(this, context); 5579 } 5580 return this.visitExpression(ast, context); 5581 } 5582 visitUnaryOperatorExpr(ast, context) { 5583 ast.expr.visitExpression(this, context); 5584 return this.visitExpression(ast, context); 5585 } 5586 visitBinaryOperatorExpr(ast, context) { 5587 ast.lhs.visitExpression(this, context); 5588 ast.rhs.visitExpression(this, context); 5589 return this.visitExpression(ast, context); 5590 } 5591 visitReadPropExpr(ast, context) { 5592 ast.receiver.visitExpression(this, context); 5593 return this.visitExpression(ast, context); 5594 } 5595 visitReadKeyExpr(ast, context) { 5596 ast.receiver.visitExpression(this, context); 5597 ast.index.visitExpression(this, context); 5598 return this.visitExpression(ast, context); 5599 } 5600 visitLiteralArrayExpr(ast, context) { 5601 this.visitAllExpressions(ast.entries, context); 5602 return this.visitExpression(ast, context); 5603 } 5604 visitLiteralMapExpr(ast, context) { 5605 ast.entries.forEach(entry => entry.value.visitExpression(this, context)); 5606 return this.visitExpression(ast, context); 5607 } 5608 visitCommaExpr(ast, context) { 5609 this.visitAllExpressions(ast.parts, context); 5610 return this.visitExpression(ast, context); 5611 } 5612 visitTemplateLiteralExpr(ast, context) { 5613 this.visitAllExpressions(ast.elements, context); 5614 this.visitAllExpressions(ast.expressions, context); 5615 return this.visitExpression(ast, context); 5616 } 5617 visitTemplateLiteralElementExpr(ast, context) { 5618 return this.visitExpression(ast, context); 5619 } 5620 visitAllExpressions(exprs, context) {
5621 exprs.forEach(expr => expr.visitExpression(this, context)); 5622 } 5623 visitDeclareVarStmt(stmt, context) { 5624 if (stmt.value) { 5625 stmt.value.visitExpression(this, context); 5626 } 5627 if (stmt.type) { 5628 stmt.type.visitType(this, context); 5629 } 5630 return stmt; 5631 } 5632 visitDeclareFunctionStmt(stmt, context) { 5633 this.visitAllStatements(stmt.statements, context); 5634 if (stmt.type) { 5635 stmt.type.visitType(this, context); 5636 } 5637 return stmt; 5638 } 5639 visitExpressionStmt(stmt, context) { 5640 stmt.expr.visitExpression(this, context); 5641 return stmt; 5642 } 5643 visitReturnStmt(stmt, context) { 5644 stmt.value.visitExpression(this, context); 5645 return stmt; 5646 } 5647 visitIfStmt(stmt, context) { 5648 stmt.condition.visitExpression(this, context); 5649 this.visitAllStatements(stmt.trueCase, context); 5650 this.visitAllStatements(stmt.falseCase, context); 5651 return stmt; 5652 } 5653 visitAllStatements(stmts, context) { 5654 stmts.forEach(stmt => stmt.visitStatement(this, context)); 5655 } 5656}; 5657function leadingComment(text, multiline = false, trailingNewline = true) { 5658 return new LeadingComment(text, multiline, trailingNewline); 5659} 5660function jsDocComment(tags = []) { 5661 return new JSDocComment(tags); 5662} 5663function variable(name, type, sourceSpan) { 5664 return new ReadVarExpr(name, type, sourceSpan); 5665} 5666function importExpr(id, typeParams = null, sourceSpan) { 5667 return new ExternalExpr(id, null, typeParams, sourceSpan); 5668} 5669function importType(id, typeParams, typeModifiers) { 5670 return id != null ? expressionType(importExpr(id, typeParams, null), typeModifiers) : null; 5671} 5672function expressionType(expr, typeModifiers, typeParams) { 5673 return new ExpressionType(expr, typeModifiers, typeParams); 5674} 5675function transplantedType(type, typeModifiers) { 5676 return new TransplantedType(type, typeModifiers); 5677} 5678function typeofExpr(expr) { 5679 return new TypeofExpr(expr); 5680} 5681function literalArr(values, type, sourceSpan) { 5682 return new LiteralArrayExpr(values, type, sourceSpan); 5683} 5684function literalMap(values, type = null) { 5685 return new LiteralMapExpr(values.map(e => new LiteralMapEntry(e.key, e.value, e.quoted)), type, null); 5686} 5687function unary(operator, expr, type, sourceSpan) { 5688 return new UnaryOperatorExpr(operator, expr, type, sourceSpan); 5689} 5690function not(expr, sourceSpan) { 5691 return new NotExpr(expr, sourceSpan); 5692} 5693function fn(params, body, type, sourceSpan, name) { 5694 return new FunctionExpr(params, body, type, sourceSpan, name); 5695} 5696function arrowFn(params, body, type, sourceSpan) { 5697 return new ArrowFunctionExpr(params, body, type, sourceSpan); 5698} 5699function ifStmt(condition, thenClause, elseClause, sourceSpan, leadingComments) { 5700 return new IfStmt(condition, thenClause, elseClause, sourceSpan, leadingComments); 5701} 5702function taggedTemplate(tag, template, type, sourceSpan) { 5703 return new TaggedTemplateLiteralExpr(tag, template, type, sourceSpan); 5704} 5705function literal(value, type, sourceSpan) { 5706 return new LiteralExpr(value, type, sourceSpan); 5707} 5708function localizedString(metaBlock, messageParts, placeholderNames, expressions, sourceSpan) { 5709 return new LocalizedString(metaBlock, messageParts, placeholderNames, expressions, sourceSpan); 5710} 5711function isNull(exp) { 5712 return exp instanceof LiteralExpr && exp.value === null; 5713} 5714/* 5715 * Serializes a `Tag` into a string. 5716 * Returns a string like " @foo {bar} baz" (note the leading whitespace before `@foo`). 5717 */ 5718function tagToString(tag) { 5719 let out = ''; 5720 if (tag.tagName) { 5721 out += ` @${tag.tagName}`; 5722 } 5723 if (tag.text) { 5724 if (tag.text.match(/\/\*|\*\//)) { 5725 throw new Error('JSDoc text cannot contain "/*" and "*/"'); 5726 } 5727 out += ' ' + tag.text.replace(/@/g, '\\@'); 5728 } 5729 return out; 5730} 5731function serializeTags(tags) { 5732 if (tags.length === 0) return ''; 5733 if (tags.length === 1 && tags[0].tagName && !tags[0].text) { 5734 // The JSDOC comment is a single simple tag: e.g `/** @tagname */`. 5735 return `*${tagToString(tags[0])} `; 5736 } 5737 let out = '*\n'; 5738 for (const tag of tags) { 5739 out += ' *'; 5740 // If the tagToString is multi-line, insert " * " prefixes on lines. 5741 out += tagToString(tag).replace(/\n/g, '\n * '); 5742 out += '\n'; 5743 } 5744 out += ' '; 5745 return out; 5746} 5747var output_ast = /*#__PURE__*/Object.freeze({ 5748 __proto__: null, 5749 ArrayType: ArrayType, 5750 ArrowFunctionExpr: ArrowFunctionExpr, 5751 BOOL_TYPE: BOOL_TYPE, 5752 get BinaryOperator() { 5753 return BinaryOperator; 5754 }, 5755 BinaryOperatorExpr: BinaryOperatorExpr, 5756 BuiltinType: BuiltinType, 5757 get BuiltinTypeName() { 5758 return BuiltinTypeName; 5759 }, 5760 CommaExpr: CommaExpr, 5761 ConditionalExpr: ConditionalExpr, 5762 DYNAMIC_TYPE: DYNAMIC_TYPE, 5763 DeclareFunctionStmt: DeclareFunctionStmt, 5764 DeclareVarStmt: DeclareVarStmt, 5765 DynamicImportExpr: DynamicImportExpr, 5766 Expression: Expression, 5767 ExpressionStatement: ExpressionStatement, 5768 ExpressionType: ExpressionType, 5769 ExternalExpr: ExternalExpr, 5770 ExternalReference: ExternalReference, 5771 FUNCTION_TYPE: FUNCTION_TYPE, 5772 FnParam: FnParam, 5773 FunctionExpr: FunctionExpr, 5774 INFERRED_TYPE: INFERRED_TYPE, 5775 INT_TYPE: INT_TYPE, 5776 IfStmt: IfStmt, 5777 InstantiateExpr: InstantiateExpr, 5778 InvokeFunctionExpr: InvokeFunctionExpr, 5779 JSDocComment: JSDocComment, 5780 LeadingComment: LeadingComment, 5781 LiteralArrayExpr: LiteralArrayExpr, 5782 LiteralExpr: LiteralExpr, 5783 LiteralMapEntry: LiteralMapEntry, 5784 LiteralMapExpr: LiteralMapExpr, 5785 LiteralPiece: LiteralPiece, 5786 LocalizedString: LocalizedString, 5787 MapType: MapType, 5788 NONE_TYPE: NONE_TYPE, 5789 NULL_EXPR: NULL_EXPR, 5790 NUMBER_TYPE: NUMBER_TYPE, 5791 NotExpr: NotExpr, 5792 PlaceholderPiece: PlaceholderPiece, 5793 ReadKeyExpr: ReadKeyExpr, 5794 ReadPropExpr: ReadPropExpr, 5795 ReadVarExpr: ReadVarExpr, 5796 RecursiveAstVisitor: RecursiveAstVisitor$1, 5797 ReturnStatement: ReturnStatement, 5798 STRING_TYPE: STRING_TYPE, 5799 Statement: Statement, 5800 get StmtModifier() { 5801 return StmtModifier; 5802 }, 5803 TYPED_NULL_EXPR: TYPED_NULL_EXPR, 5804 TaggedTemplateLiteralExpr: TaggedTemplateLiteralExpr, 5805 TemplateLiteralElementExpr: TemplateLiteralElementExpr, 5806 TemplateLiteralExpr: TemplateLiteralExpr,
5807 TransplantedType: TransplantedType, 5808 Type: Type, 5809 get TypeModifier() { 5810 return TypeModifier; 5811 }, 5812 TypeofExpr: TypeofExpr, 5813 get UnaryOperator() { 5814 return UnaryOperator; 5815 }, 5816 UnaryOperatorExpr: UnaryOperatorExpr, 5817 WrappedNodeExpr: WrappedNodeExpr, 5818 WriteKeyExpr: WriteKeyExpr, 5819 WritePropExpr: WritePropExpr, 5820 WriteVarExpr: WriteVarExpr, 5821 areAllEquivalent: areAllEquivalent, 5822 arrowFn: arrowFn, 5823 expressionType: expressionType, 5824 fn: fn, 5825 ifStmt: ifStmt, 5826 importExpr: importExpr, 5827 importType: importType, 5828 isNull: isNull, 5829 jsDocComment: jsDocComment, 5830 leadingComment: leadingComment, 5831 literal: literal, 5832 literalArr: literalArr, 5833 literalMap: literalMap, 5834 localizedString: localizedString, 5835 not: not, 5836 nullSafeIsEquivalent: nullSafeIsEquivalent, 5837 taggedTemplate: taggedTemplate, 5838 transplantedType: transplantedType, 5839 typeofExpr: typeofExpr, 5840 unary: unary, 5841 variable: variable 5842}); 5843const CONSTANT_PREFIX = '_c'; 5844/** 5845 * `ConstantPool` tries to reuse literal factories when two or more literals are identical. 5846 * We determine whether literals are identical by creating a key out of their AST using the 5847 * `KeyVisitor`. This constant is used to replace dynamic expressions which can't be safely 5848 * converted into a key. E.g. given an expression `{foo: bar()}`, since we don't know what 5849 * the result of `bar` will be, we create a key that looks like `{foo: <unknown>}`. Note 5850 * that we use a variable, rather than something like `null` in order to avoid collisions. 5851 */ 5852const UNKNOWN_VALUE_KEY = variable('<unknown>'); 5853/** 5854 * Context to use when producing a key. 5855 * 5856 * This ensures we see the constant not the reference variable when producing 5857 * a key. 5858 */ 5859const KEY_CONTEXT = {}; 5860/** 5861 * Generally all primitive values are excluded from the `ConstantPool`, but there is an exclusion 5862 * for strings that reach a certain length threshold. This constant defines the length threshold for 5863 * strings. 5864 */ 5865const POOL_INCLUSION_LENGTH_THRESHOLD_FOR_STRINGS = 50; 5866/** 5867 * A node that is a place-holder that allows the node to be replaced when the actual 5868 * node is known. 5869 * 5870 * This allows the constant pool to change an expression from a direct reference to 5871 * a constant to a shared constant. It returns a fix-up node that is later allowed to 5872 * change the referenced expression. 5873 */ 5874class FixupExpression extends Expression { 5875 constructor(resolved) { 5876 super(resolved.type); 5877 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "resolved", void 0); 5878 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "original", void 0); 5879 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "shared", false); 5880 this.resolved = resolved; 5881 this.original = resolved; 5882 } 5883 visitExpression(visitor, context) { 5884 if (context === KEY_CONTEXT) { 5885 // When producing a key we want to traverse the constant not the 5886 // variable used to refer to it. 5887 return this.original.visitExpression(visitor, context); 5888 } else { 5889 return this.resolved.visitExpression(visitor, context); 5890 } 5891 } 5892 isEquivalent(e) { 5893 return e instanceof FixupExpression && this.resolved.isEquivalent(e.resolved); 5894 } 5895 isConstant() { 5896 return true; 5897 } 5898 clone() { 5899 throw new Error(`Not supported.`); 5900 } 5901 fixup(expression) { 5902 this.resolved = expression; 5903 this.shared = true; 5904 } 5905} 5906/** 5907 * A constant pool allows a code emitter to share constant in an output context. 5908 * 5909 * The constant pool also supports sharing access to ivy definitions references. 5910 */ 5911class ConstantPool { 5912 constructor(isClosureCompilerEnabled = false) { 5913 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "isClosureCompilerEnabled", void 0); 5914 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "statements", []); 5915 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "literals", new Map()); 5916 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "literalFactories", new Map()); 5917 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "sharedConstants", new Map()); 5918 /** 5919 * Constant pool also tracks claimed names from {@link uniqueName}. 5920 * This is useful to avoid collisions if variables are intended to be 5921 * named a certain way- but may conflict. We wouldn't want to always suffix 5922 * them with unique numbers. 5923 */ 5924 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_claimedNames", new Map()); 5925 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "nextNameIndex", 0); 5926 this.isClosureCompilerEnabled = isClosureCompilerEnabled; 5927 } 5928 getConstLiteral(literal, forceShared) { 5929 if (literal instanceof LiteralExpr && !isLongStringLiteral(literal) || literal instanceof FixupExpression) {
5930 // Do no put simple literals into the constant pool or try to produce a constant for a 5931 // reference to a constant. 5932 return literal; 5933 } 5934 const key = GenericKeyFn.INSTANCE.keyOf(literal); 5935 let fixup = this.literals.get(key); 5936 let newValue = false; 5937 if (!fixup) { 5938 fixup = new FixupExpression(literal); 5939 this.literals.set(key, fixup); 5940 newValue = true; 5941 } 5942 if (!newValue && !fixup.shared || newValue && forceShared) { 5943 // Replace the expression with a variable 5944 const name = this.freshName(); 5945 let definition; 5946 let usage; 5947 if (this.isClosureCompilerEnabled && isLongStringLiteral(literal)) { 5948 // For string literals, Closure will **always** inline the string at 5949 // **all** usages, duplicating it each time. For large strings, this 5950 // unnecessarily bloats bundle size. To work around this restriction, we 5951 // wrap the string in a function, and call that function for each usage. 5952 // This tricks Closure into using inline logic for functions instead of 5953 // string literals. Function calls are only inlined if the body is small 5954 // enough to be worth it. By doing this, very large strings will be 5955 // shared across multiple usages, rather than duplicating the string at 5956 // each usage site. 5957 // 5958 // const myStr = function() { return "very very very long string"; }; 5959 // const usage1 = myStr(); 5960 // const usage2 = myStr(); 5961 definition = variable(name).set(new FunctionExpr([], 5962 // Params. 5963 [ 5964 // Statements.
5965 new ReturnStatement(literal)])); 5966 usage = variable(name).callFn([]); 5967 } else { 5968 // Just declare and use the variable directly, without a function call 5969 // indirection. This saves a few bytes and avoids an unnecessary call. 5970 definition = variable(name).set(literal); 5971 usage = variable(name); 5972 } 5973 this.statements.push(definition.toDeclStmt(INFERRED_TYPE, StmtModifier.Final)); 5974 fixup.fixup(usage); 5975 } 5976 return fixup; 5977 } 5978 getSharedConstant(def, expr) { 5979 const key = def.keyOf(expr); 5980 if (!this.sharedConstants.has(key)) { 5981 const id = this.freshName(); 5982 this.sharedConstants.set(key, variable(id)); 5983 this.statements.push(def.toSharedConstantDeclaration(id, expr)); 5984 } 5985 return this.sharedConstants.get(key); 5986 } 5987 getLiteralFactory(literal) { 5988 // Create a pure function that builds an array of a mix of constant and variable expressions 5989 if (literal instanceof LiteralArrayExpr) { 5990 const argumentsForKey = literal.entries.map(e => e.isConstant() ? e : UNKNOWN_VALUE_KEY); 5991 const key = GenericKeyFn.INSTANCE.keyOf(literalArr(argumentsForKey)); 5992 return this._getLiteralFactory(key, literal.entries, entries => literalArr(entries)); 5993 } else { 5994 const expressionForKey = literalMap(literal.entries.map(e => ({ 5995 key: e.key, 5996 value: e.value.isConstant() ? e.value : UNKNOWN_VALUE_KEY, 5997 quoted: e.quoted 5998 }))); 5999 const key = GenericKeyFn.INSTANCE.keyOf(expressionForKey); 6000 return this._getLiteralFactory(key, literal.entries.map(e => e.value), entries => literalMap(entries.map((value, index) => ({ 6001 key: literal.entries[index].key, 6002 value, 6003 quoted: literal.entries[index].quoted 6004 })))); 6005 } 6006 } 6007 // TODO: useUniqueName(false) is necessary for naming compatibility with 6008 // TemplateDefinitionBuilder, but should be removed once Template Pipeline is the default. 6009 getSharedFunctionReference(fn, prefix, useUniqueName = true) { 6010 const isArrow = fn instanceof ArrowFunctionExpr; 6011 for (const current of this.statements) { 6012 var _current$value; 6013 // Arrow functions are saved as variables so we check if the 6014 // value of the variable is the same as the arrow function. 6015 if (isArrow && current instanceof DeclareVarStmt && (_current$value = current.value) !== null && _current$value !== void 0 && _current$value.isEquivalent(fn)) { 6016 return variable(current.name); 6017 } 6018 // Function declarations are saved as function statements 6019 // so we compare them directly to the passed-in function. 6020 if (!isArrow && current instanceof DeclareFunctionStmt && fn instanceof FunctionExpr && fn.isEquivalent(current)) { 6021 return variable(current.name); 6022 } 6023 } 6024 // Otherwise declare the function. 6025 const name = useUniqueName ? this.uniqueName(prefix) : prefix; 6026 this.statements.push(fn instanceof FunctionExpr ? fn.toDeclStmt(name, StmtModifier.Final) : new DeclareVarStmt(name, fn, INFERRED_TYPE, StmtModifier.Final, fn.sourceSpan)); 6027 return variable(name); 6028 } 6029 _getLiteralFactory(key, values, resultMap) { 6030 let literalFactory = this.literalFactories.get(key); 6031 const literalFactoryArguments = values.filter(e => !e.isConstant()); 6032 if (!literalFactory) { 6033 const resultExpressions = values.map((e, index) => e.isConstant() ? this.getConstLiteral(e, true) : variable(`a${index}`)); 6034 const parameters = resultExpressions.filter(isVariable).map(e => new FnParam(e.name, DYNAMIC_TYPE)); 6035 const pureFunctionDeclaration = arrowFn(parameters, resultMap(resultExpressions), INFERRED_TYPE); 6036 const name = this.freshName(); 6037 this.statements.push(variable(name).set(pureFunctionDeclaration).toDeclStmt(INFERRED_TYPE, StmtModifier.Final)); 6038 literalFactory = variable(name); 6039 this.literalFactories.set(key, literalFactory); 6040 } 6041 return { 6042 literalFactory, 6043 literalFactoryArguments 6044 }; 6045 } 6046 /** 6047 * Produce a unique name in the context of this pool. 6048 * 6049 * The name might be unique among different prefixes if any of the prefixes end in 6050 * a digit so the prefix should be a constant string (not based on user input) and 6051 * must not end in a digit. 6052 */ 6053 uniqueName(name, alwaysIncludeSuffix = true) { 6054 var _this$_claimedNames$g; 6055 const count = (_this$_claimedNames$g = this._claimedNames.get(name)) !== null && _this$_claimedNames$g !== void 0 ? _this$_claimedNames$g : 0; 6056 const result = count === 0 && !alwaysIncludeSuffix ? `${name}` : `${name}${count}`; 6057 this._claimedNames.set(name, count + 1); 6058 return result; 6059 } 6060 freshName() { 6061 return this.uniqueName(CONSTANT_PREFIX); 6062 } 6063} 6064class GenericKeyFn { 6065 keyOf(expr) { 6066 if (expr instanceof LiteralExpr && typeof expr.value === 'string') { 6067 return `"${expr.value}"`; 6068 } else if (expr instanceof LiteralExpr) { 6069 return String(expr.value); 6070 } else if (expr instanceof LiteralArrayExpr) { 6071 const entries = []; 6072 for (const entry of expr.entries) {
6073 entries.push(this.keyOf(entry)); 6074 } 6075 return `[${entries.join(',')}]`; 6076 } else if (expr instanceof LiteralMapExpr) { 6077 const entries = []; 6078 for (const entry of expr.entries) { 6079 let key = entry.key; 6080 if (entry.quoted) { 6081 key = `"${key}"`; 6082 } 6083 entries.push(key + ':' + this.keyOf(entry.value)); 6084 } 6085 return `{${entries.join(',')}}`; 6086 } else if (expr instanceof ExternalExpr) { 6087 return `import("${expr.value.moduleName}", ${expr.value.name})`; 6088 } else if (expr instanceof ReadVarExpr) { 6089 return `read(${expr.name})`; 6090 } else if (expr instanceof TypeofExpr) { 6091 return `typeof(${this.keyOf(expr.expr)})`; 6092 } else { 6093 throw new Error(`${this.constructor.name} does not handle expressions of type ${expr.constructor.name}`); 6094 } 6095 } 6096} 6097_GenericKeyFn = GenericKeyFn; 6098(0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(GenericKeyFn, "INSTANCE", new _GenericKeyFn()); 6099function isVariable(e) { 6100 return e instanceof ReadVarExpr; 6101} 6102function isLongStringLiteral(expr) { 6103 return expr instanceof LiteralExpr && typeof expr.value === 'string' && expr.value.length >= POOL_INCLUSION_LENGTH_THRESHOLD_FOR_STRINGS; 6104} 6105const CORE = '@angular/core'; 6106let Identifiers = /*#__PURE__*/(() => { 6107 class Identifiers {} 6108 /* Methods */ 6109 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "NEW_METHOD", 'factory'); 6110 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "TRANSFORM_METHOD", 'transform'); 6111 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "PATCH_DEPS", 'patchedDeps'); 6112 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "core", { 6113 name: null, 6114 moduleName: CORE 6115 }); 6116 /* Instructions */ 6117 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "namespaceHTML", { 6118 name: 'ɵɵnamespaceHTML', 6119 moduleName: CORE 6120 }); 6121 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "namespaceMathML", { 6122 name: 'ɵɵnamespaceMathML', 6123 moduleName: CORE 6124 }); 6125 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "namespaceSVG", { 6126 name: 'ɵɵnamespaceSVG', 6127 moduleName: CORE 6128 }); 6129 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "element", { 6130 name: 'ɵɵelement', 6131 moduleName: CORE 6132 }); 6133 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "elementStart", { 6134 name: 'ɵɵelementStart', 6135 moduleName: CORE 6136 }); 6137 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "elementEnd", { 6138 name: 'ɵɵelementEnd', 6139 moduleName: CORE 6140 }); 6141 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "advance", { 6142 name: 'ɵɵadvance', 6143 moduleName: CORE 6144 }); 6145 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "syntheticHostProperty", { 6146 name: 'ɵɵsyntheticHostProperty', 6147 moduleName: CORE 6148 }); 6149 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "syntheticHostListener", { 6150 name: 'ɵɵsyntheticHostListener', 6151 moduleName: CORE 6152 }); 6153 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "attribute", { 6154 name: 'ɵɵattribute', 6155 moduleName: CORE 6156 }); 6157 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "attributeInterpolate1", { 6158 name: 'ɵɵattributeInterpolate1', 6159 moduleName: CORE 6160 }); 6161 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "attributeInterpolate2", { 6162 name: 'ɵɵattributeInterpolate2', 6163 moduleName: CORE 6164 }); 6165 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "attributeInterpolate3", { 6166 name: 'ɵɵattributeInterpolate3', 6167 moduleName: CORE 6168 }); 6169 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "attributeInterpolate4", { 6170 name: 'ɵɵattributeInterpolate4', 6171 moduleName: CORE 6172 }); 6173 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "attributeInterpolate5", { 6174 name: 'ɵɵattributeInterpolate5', 6175 moduleName: CORE 6176 }); 6177 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "attributeInterpolate6", { 6178 name: 'ɵɵattributeInterpolate6', 6179 moduleName: CORE 6180 }); 6181 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "attributeInterpolate7", { 6182 name: 'ɵɵattributeInterpolate7', 6183 moduleName: CORE 6184 }); 6185 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "attributeInterpolate8", { 6186 name: 'ɵɵattributeInterpolate8', 6187 moduleName: CORE 6188 }); 6189 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "attributeInterpolateV", { 6190 name: 'ɵɵattributeInterpolateV', 6191 moduleName: CORE 6192 }); 6193 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "classProp", { 6194 name: 'ɵɵclassProp', 6195 moduleName: CORE 6196 }); 6197 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "elementContainerStart", { 6198 name: 'ɵɵelementContainerStart', 6199 moduleName: CORE 6200 }); 6201 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "elementContainerEnd", { 6202 name: 'ɵɵelementContainerEnd', 6203 moduleName: CORE 6204 }); 6205 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "elementContainer", { 6206 name: 'ɵɵelementContainer', 6207 moduleName: CORE 6208 }); 6209 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "styleMap", { 6210 name: 'ɵɵstyleMap', 6211 moduleName: CORE 6212 }); 6213 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "styleMapInterpolate1", { 6214 name: 'ɵɵstyleMapInterpolate1', 6215 moduleName: CORE 6216 }); 6217 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "styleMapInterpolate2", { 6218 name: 'ɵɵstyleMapInterpolate2', 6219 moduleName: CORE 6220 }); 6221 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "styleMapInterpolate3", { 6222 name: 'ɵɵstyleMapInterpolate3', 6223 moduleName: CORE 6224 }); 6225 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "styleMapInterpolate4", { 6226 name: 'ɵɵstyleMapInterpolate4', 6227 moduleName: CORE 6228 }); 6229 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "styleMapInterpolate5", { 6230 name: 'ɵɵstyleMapInterpolate5', 6231 moduleName: CORE 6232 }); 6233 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "styleMapInterpolate6", { 6234 name: 'ɵɵstyleMapInterpolate6', 6235 moduleName: CORE 6236 }); 6237 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "styleMapInterpolate7", { 6238 name: 'ɵɵstyleMapInterpolate7', 6239 moduleName: CORE 6240 }); 6241 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "styleMapInterpolate8", { 6242 name: 'ɵɵstyleMapInterpolate8', 6243 moduleName: CORE 6244 }); 6245 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "styleMapInterpolateV", { 6246 name: 'ɵɵstyleMapInterpolateV', 6247 moduleName: CORE 6248 }); 6249 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "classMap", { 6250 name: 'ɵɵclassMap', 6251 moduleName: CORE 6252 }); 6253 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "classMapInterpolate1", { 6254 name: 'ɵɵclassMapInterpolate1', 6255 moduleName: CORE 6256 }); 6257 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "classMapInterpolate2", { 6258 name: 'ɵɵclassMapInterpolate2', 6259 moduleName: CORE 6260 }); 6261 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "classMapInterpolate3", { 6262 name: 'ɵɵclassMapInterpolate3', 6263 moduleName: CORE 6264 }); 6265 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "classMapInterpolate4", { 6266 name: 'ɵɵclassMapInterpolate4', 6267 moduleName: CORE 6268 }); 6269 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "classMapInterpolate5", { 6270 name: 'ɵɵclassMapInterpolate5', 6271 moduleName: CORE 6272 }); 6273 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "classMapInterpolate6", { 6274 name: 'ɵɵclassMapInterpolate6', 6275 moduleName: CORE 6276 }); 6277 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "classMapInterpolate7", { 6278 name: 'ɵɵclassMapInterpolate7', 6279 moduleName: CORE 6280 }); 6281 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "classMapInterpolate8", { 6282 name: 'ɵɵclassMapInterpolate8', 6283 moduleName: CORE 6284 }); 6285 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "classMapInterpolateV", { 6286 name: 'ɵɵclassMapInterpolateV', 6287 moduleName: CORE 6288 }); 6289 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "styleProp", { 6290 name: 'ɵɵstyleProp', 6291 moduleName: CORE 6292 }); 6293 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "stylePropInterpolate1", { 6294 name: 'ɵɵstylePropInterpolate1', 6295 moduleName: CORE 6296 }); 6297 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "stylePropInterpolate2", { 6298 name: 'ɵɵstylePropInterpolate2', 6299 moduleName: CORE 6300 }); 6301 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "stylePropInterpolate3", { 6302 name: 'ɵɵstylePropInterpolate3', 6303 moduleName: CORE 6304 }); 6305 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "stylePropInterpolate4", { 6306 name: 'ɵɵstylePropInterpolate4', 6307 moduleName: CORE 6308 }); 6309 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "stylePropInterpolate5", { 6310 name: 'ɵɵstylePropInterpolate5', 6311 moduleName: CORE 6312 }); 6313 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "stylePropInterpolate6", { 6314 name: 'ɵɵstylePropInterpolate6', 6315 moduleName: CORE 6316 }); 6317 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "stylePropInterpolate7", { 6318 name: 'ɵɵstylePropInterpolate7', 6319 moduleName: CORE 6320 }); 6321 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "stylePropInterpolate8", { 6322 name: 'ɵɵstylePropInterpolate8', 6323 moduleName: CORE 6324 }); 6325 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "stylePropInterpolateV", { 6326 name: 'ɵɵstylePropInterpolateV', 6327 moduleName: CORE 6328 }); 6329 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "nextContext", { 6330 name: 'ɵɵnextContext', 6331 moduleName: CORE 6332 }); 6333 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "resetView", {
6334 name: 'ɵɵresetView', 6335 moduleName: CORE 6336 }); 6337 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "templateCreate", { 6338 name: 'ɵɵtemplate', 6339 moduleName: CORE 6340 }); 6341 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "defer", { 6342 name: 'ɵɵdefer', 6343 moduleName: CORE 6344 }); 6345 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "deferWhen", { 6346 name: 'ɵɵdeferWhen', 6347 moduleName: CORE 6348 }); 6349 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "deferOnIdle", { 6350 name: 'ɵɵdeferOnIdle', 6351 moduleName: CORE 6352 }); 6353 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "deferOnImmediate", { 6354 name: 'ɵɵdeferOnImmediate', 6355 moduleName: CORE 6356 }); 6357 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "deferOnTimer", { 6358 name: 'ɵɵdeferOnTimer', 6359 moduleName: CORE 6360 }); 6361 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "deferOnHover", { 6362 name: 'ɵɵdeferOnHover', 6363 moduleName: CORE 6364 }); 6365 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "deferOnInteraction", { 6366 name: 'ɵɵdeferOnInteraction', 6367 moduleName: CORE 6368 }); 6369 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "deferOnViewport", { 6370 name: 'ɵɵdeferOnViewport', 6371 moduleName: CORE 6372 }); 6373 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "deferPrefetchWhen", { 6374 name: 'ɵɵdeferPrefetchWhen', 6375 moduleName: CORE 6376 }); 6377 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "deferPrefetchOnIdle", { 6378 name: 'ɵɵdeferPrefetchOnIdle', 6379 moduleName: CORE 6380 }); 6381 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "deferPrefetchOnImmediate", { 6382 name: 'ɵɵdeferPrefetchOnImmediate', 6383 moduleName: CORE 6384 }); 6385 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "deferPrefetchOnTimer", { 6386 name: 'ɵɵdeferPrefetchOnTimer', 6387 moduleName: CORE 6388 }); 6389 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "deferPrefetchOnHover", { 6390 name: 'ɵɵdeferPrefetchOnHover', 6391 moduleName: CORE 6392 }); 6393 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "deferPrefetchOnInteraction", { 6394 name: 'ɵɵdeferPrefetchOnInteraction', 6395 moduleName: CORE 6396 }); 6397 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "deferPrefetchOnViewport", { 6398 name: 'ɵɵdeferPrefetchOnViewport', 6399 moduleName: CORE 6400 }); 6401 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "deferHydrateWhen", { 6402 name: 'ɵɵdeferHydrateWhen', 6403 moduleName: CORE 6404 }); 6405 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "deferHydrateNever", { 6406 name: 'ɵɵdeferHydrateNever', 6407 moduleName: CORE 6408 }); 6409 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "deferHydrateOnIdle", { 6410 name: 'ɵɵdeferHydrateOnIdle', 6411 moduleName: CORE 6412 }); 6413 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "deferHydrateOnImmediate", { 6414 name: 'ɵɵdeferHydrateOnImmediate', 6415 moduleName: CORE 6416 }); 6417 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "deferHydrateOnTimer", { 6418 name: 'ɵɵdeferHydrateOnTimer', 6419 moduleName: CORE 6420 }); 6421 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "deferHydrateOnHover", { 6422 name: 'ɵɵdeferHydrateOnHover', 6423 moduleName: CORE 6424 }); 6425 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "deferHydrateOnInteraction", { 6426 name: 'ɵɵdeferHydrateOnInteraction', 6427 moduleName: CORE 6428 }); 6429 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "deferHydrateOnViewport", { 6430 name: 'ɵɵdeferHydrateOnViewport', 6431 moduleName: CORE 6432 }); 6433 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "deferEnableTimerScheduling", { 6434 name: 'ɵɵdeferEnableTimerScheduling', 6435 moduleName: CORE 6436 }); 6437 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "conditional", { 6438 name: 'ɵɵconditional', 6439 moduleName: CORE 6440 }); 6441 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "repeater", { 6442 name: 'ɵɵrepeater', 6443 moduleName: CORE 6444 }); 6445 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "repeaterCreate", { 6446 name: 'ɵɵrepeaterCreate', 6447 moduleName: CORE 6448 }); 6449 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "repeaterTrackByIndex", { 6450 name: 'ɵɵrepeaterTrackByIndex', 6451 moduleName: CORE 6452 }); 6453 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "repeaterTrackByIdentity", { 6454 name: 'ɵɵrepeaterTrackByIdentity', 6455 moduleName: CORE 6456 }); 6457 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "componentInstance", { 6458 name: 'ɵɵcomponentInstance', 6459 moduleName: CORE 6460 }); 6461 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "text", { 6462 name: 'ɵɵtext', 6463 moduleName: CORE 6464 }); 6465 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "enableBindings", { 6466 name: 'ɵɵenableBindings', 6467 moduleName: CORE 6468 }); 6469 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "disableBindings", { 6470 name: 'ɵɵdisableBindings', 6471 moduleName: CORE 6472 }); 6473 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "getCurrentView", { 6474 name: 'ɵɵgetCurrentView', 6475 moduleName: CORE 6476 }); 6477 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "textInterpolate", { 6478 name: 'ɵɵtextInterpolate', 6479 moduleName: CORE 6480 }); 6481 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "textInterpolate1", { 6482 name: 'ɵɵtextInterpolate1', 6483 moduleName: CORE 6484 }); 6485 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "textInterpolate2", { 6486 name: 'ɵɵtextInterpolate2', 6487 moduleName: CORE 6488 }); 6489 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "textInterpolate3", { 6490 name: 'ɵɵtextInterpolate3', 6491 moduleName: CORE 6492 }); 6493 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "textInterpolate4", { 6494 name: 'ɵɵtextInterpolate4', 6495 moduleName: CORE 6496 }); 6497 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "textInterpolate5", { 6498 name: 'ɵɵtextInterpolate5', 6499 moduleName: CORE 6500 }); 6501 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "textInterpolate6", { 6502 name: 'ɵɵtextInterpolate6', 6503 moduleName: CORE 6504 }); 6505 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "textInterpolate7", { 6506 name: 'ɵɵtextInterpolate7', 6507 moduleName: CORE 6508 }); 6509 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "textInterpolate8", { 6510 name: 'ɵɵtextInterpolate8', 6511 moduleName: CORE 6512 }); 6513 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "textInterpolateV", { 6514 name: 'ɵɵtextInterpolateV', 6515 moduleName: CORE 6516 }); 6517 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "restoreView", { 6518 name: 'ɵɵrestoreView', 6519 moduleName: CORE 6520 }); 6521 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "pureFunction0", { 6522 name: 'ɵɵpureFunction0', 6523 moduleName: CORE 6524 }); 6525 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "pureFunction1", { 6526 name: 'ɵɵpureFunction1', 6527 moduleName: CORE 6528 }); 6529 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "pureFunction2", { 6530 name: 'ɵɵpureFunction2', 6531 moduleName: CORE 6532 }); 6533 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "pureFunction3", { 6534 name: 'ɵɵpureFunction3', 6535 moduleName: CORE 6536 }); 6537 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "pureFunction4", { 6538 name: 'ɵɵpureFunction4', 6539 moduleName: CORE 6540 }); 6541 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "pureFunction5", { 6542 name: 'ɵɵpureFunction5', 6543 moduleName: CORE 6544 }); 6545 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "pureFunction6", { 6546 name: 'ɵɵpureFunction6', 6547 moduleName: CORE 6548 }); 6549 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "pureFunction7", { 6550 name: 'ɵɵpureFunction7', 6551 moduleName: CORE 6552 }); 6553 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "pureFunction8", { 6554 name: 'ɵɵpureFunction8', 6555 moduleName: CORE 6556 }); 6557 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "pureFunctionV", { 6558 name: 'ɵɵpureFunctionV', 6559 moduleName: CORE 6560 }); 6561 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "pipeBind1", { 6562 name: 'ɵɵpipeBind1', 6563 moduleName: CORE 6564 }); 6565 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "pipeBind2", { 6566 name: 'ɵɵpipeBind2', 6567 moduleName: CORE 6568 }); 6569 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "pipeBind3", { 6570 name: 'ɵɵpipeBind3', 6571 moduleName: CORE 6572 }); 6573 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "pipeBind4", { 6574 name: 'ɵɵpipeBind4', 6575 moduleName: CORE 6576 }); 6577 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "pipeBindV", { 6578 name: 'ɵɵpipeBindV', 6579 moduleName: CORE 6580 }); 6581 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "hostProperty", { 6582 name: 'ɵɵhostProperty', 6583 moduleName: CORE 6584 }); 6585 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "property", { 6586 name: 'ɵɵproperty', 6587 moduleName: CORE 6588 }); 6589 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "propertyInterpolate", { 6590 name: 'ɵɵpropertyInterpolate', 6591 moduleName: CORE 6592 }); 6593 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "propertyInterpolate1", { 6594 name: 'ɵɵpropertyInterpolate1', 6595 moduleName: CORE 6596 }); 6597 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "propertyInterpolate2", { 6598 name: 'ɵɵpropertyInterpolate2', 6599 moduleName: CORE
6600 }); 6601 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "propertyInterpolate3", { 6602 name: 'ɵɵpropertyInterpolate3', 6603 moduleName: CORE 6604 }); 6605 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "propertyInterpolate4", { 6606 name: 'ɵɵpropertyInterpolate4', 6607 moduleName: CORE 6608 }); 6609 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "propertyInterpolate5", { 6610 name: 'ɵɵpropertyInterpolate5', 6611 moduleName: CORE 6612 }); 6613 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "propertyInterpolate6", { 6614 name: 'ɵɵpropertyInterpolate6', 6615 moduleName: CORE 6616 }); 6617 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "propertyInterpolate7", { 6618 name: 'ɵɵpropertyInterpolate7', 6619 moduleName: CORE 6620 }); 6621 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "propertyInterpolate8", { 6622 name: 'ɵɵpropertyInterpolate8', 6623 moduleName: CORE 6624 }); 6625 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "propertyInterpolateV", { 6626 name: 'ɵɵpropertyInterpolateV', 6627 moduleName: CORE 6628 }); 6629 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "i18n", { 6630 name: 'ɵɵi18n', 6631 moduleName: CORE 6632 }); 6633 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "i18nAttributes", { 6634 name: 'ɵɵi18nAttributes', 6635 moduleName: CORE 6636 }); 6637 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "i18nExp", { 6638 name: 'ɵɵi18nExp', 6639 moduleName: CORE 6640 }); 6641 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "i18nStart", { 6642 name: 'ɵɵi18nStart', 6643 moduleName: CORE 6644 }); 6645 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "i18nEnd", { 6646 name: 'ɵɵi18nEnd', 6647 moduleName: CORE 6648 }); 6649 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "i18nApply", { 6650 name: 'ɵɵi18nApply', 6651 moduleName: CORE 6652 }); 6653 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "i18nPostprocess", { 6654 name: 'ɵɵi18nPostprocess', 6655 moduleName: CORE 6656 }); 6657 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "pipe", { 6658 name: 'ɵɵpipe', 6659 moduleName: CORE 6660 }); 6661 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "projection", { 6662 name: 'ɵɵprojection', 6663 moduleName: CORE 6664 }); 6665 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "projectionDef", { 6666 name: 'ɵɵprojectionDef', 6667 moduleName: CORE 6668 }); 6669 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "reference", { 6670 name: 'ɵɵreference', 6671 moduleName: CORE 6672 }); 6673 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "inject", { 6674 name: 'ɵɵinject', 6675 moduleName: CORE 6676 }); 6677 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "injectAttribute", { 6678 name: 'ɵɵinjectAttribute', 6679 moduleName: CORE 6680 }); 6681 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "directiveInject", { 6682 name: 'ɵɵdirectiveInject', 6683 moduleName: CORE 6684 }); 6685 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "invalidFactory", { 6686 name: 'ɵɵinvalidFactory', 6687 moduleName: CORE 6688 }); 6689 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "invalidFactoryDep", { 6690 name: 'ɵɵinvalidFactoryDep', 6691 moduleName: CORE 6692 }); 6693 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "templateRefExtractor", { 6694 name: 'ɵɵtemplateRefExtractor', 6695 moduleName: CORE 6696 }); 6697 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "forwardRef", { 6698 name: 'forwardRef', 6699 moduleName: CORE 6700 }); 6701 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "resolveForwardRef", { 6702 name: 'resolveForwardRef', 6703 moduleName: CORE 6704 }); 6705 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "replaceMetadata", { 6706 name: 'ɵɵreplaceMetadata', 6707 moduleName: CORE 6708 }); 6709 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "getReplaceMetadataURL", { 6710 name: 'ɵɵgetReplaceMetadataURL', 6711 moduleName: CORE 6712 }); 6713 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "\u0275\u0275defineInjectable", { 6714 name: 'ɵɵdefineInjectable', 6715 moduleName: CORE 6716 }); 6717 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "declareInjectable", { 6718 name: 'ɵɵngDeclareInjectable', 6719 moduleName: CORE 6720 }); 6721 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "InjectableDeclaration", { 6722 name: 'ɵɵInjectableDeclaration', 6723 moduleName: CORE 6724 }); 6725 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "resolveWindow", { 6726 name: 'ɵɵresolveWindow', 6727 moduleName: CORE 6728 }); 6729 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "resolveDocument", { 6730 name: 'ɵɵresolveDocument', 6731 moduleName: CORE 6732 }); 6733 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "resolveBody", { 6734 name: 'ɵɵresolveBody', 6735 moduleName: CORE 6736 }); 6737 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "getComponentDepsFactory", { 6738 name: 'ɵɵgetComponentDepsFactory', 6739 moduleName: CORE 6740 }); 6741 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "defineComponent", { 6742 name: 'ɵɵdefineComponent', 6743 moduleName: CORE 6744 }); 6745 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "declareComponent", { 6746 name: 'ɵɵngDeclareComponent', 6747 moduleName: CORE 6748 }); 6749 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "setComponentScope", { 6750 name: 'ɵɵsetComponentScope', 6751 moduleName: CORE 6752 }); 6753 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "ChangeDetectionStrategy", { 6754 name: 'ChangeDetectionStrategy', 6755 moduleName: CORE 6756 }); 6757 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "ViewEncapsulation", { 6758 name: 'ViewEncapsulation', 6759 moduleName: CORE 6760 }); 6761 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "ComponentDeclaration", { 6762 name: 'ɵɵComponentDeclaration', 6763 moduleName: CORE 6764 }); 6765 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "FactoryDeclaration", { 6766 name: 'ɵɵFactoryDeclaration', 6767 moduleName: CORE 6768 }); 6769 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "declareFactory", { 6770 name: 'ɵɵngDeclareFactory', 6771 moduleName: CORE 6772 }); 6773 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "FactoryTarget", { 6774 name: 'ɵɵFactoryTarget', 6775 moduleName: CORE 6776 }); 6777 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "defineDirective", { 6778 name: 'ɵɵdefineDirective', 6779 moduleName: CORE 6780 }); 6781 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "declareDirective", { 6782 name: 'ɵɵngDeclareDirective', 6783 moduleName: CORE 6784 }); 6785 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "DirectiveDeclaration", { 6786 name: 'ɵɵDirectiveDeclaration', 6787 moduleName: CORE 6788 }); 6789 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "InjectorDef", { 6790 name: 'ɵɵInjectorDef', 6791 moduleName: CORE 6792 }); 6793 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "InjectorDeclaration", { 6794 name: 'ɵɵInjectorDeclaration', 6795 moduleName: CORE 6796 }); 6797 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "defineInjector", { 6798 name: 'ɵɵdefineInjector', 6799 moduleName: CORE 6800 }); 6801 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "declareInjector", { 6802 name: 'ɵɵngDeclareInjector', 6803 moduleName: CORE 6804 }); 6805 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "NgModuleDeclaration", { 6806 name: 'ɵɵNgModuleDeclaration', 6807 moduleName: CORE 6808 }); 6809 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "ModuleWithProviders", { 6810 name: 'ModuleWithProviders', 6811 moduleName: CORE 6812 }); 6813 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "defineNgModule", { 6814 name: 'ɵɵdefineNgModule', 6815 moduleName: CORE 6816 }); 6817 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "declareNgModule", { 6818 name: 'ɵɵngDeclareNgModule', 6819 moduleName: CORE 6820 }); 6821 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "setNgModuleScope", { 6822 name: 'ɵɵsetNgModuleScope', 6823 moduleName: CORE 6824 }); 6825 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "registerNgModuleType", { 6826 name: 'ɵɵregisterNgModuleType', 6827 moduleName: CORE 6828 }); 6829 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "PipeDeclaration", { 6830 name: 'ɵɵPipeDeclaration', 6831 moduleName: CORE 6832 }); 6833 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "definePipe", { 6834 name: 'ɵɵdefinePipe', 6835 moduleName: CORE 6836 }); 6837 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "declarePipe", { 6838 name: 'ɵɵngDeclarePipe', 6839 moduleName: CORE 6840 }); 6841 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "declareClassMetadata", { 6842 name: 'ɵɵngDeclareClassMetadata', 6843 moduleName: CORE 6844 }); 6845 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "declareClassMetadataAsync", { 6846 name: 'ɵɵngDeclareClassMetadataAsync', 6847 moduleName: CORE 6848 }); 6849 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "setClassMetadata", { 6850 name: 'ɵsetClassMetadata', 6851 moduleName: CORE 6852 }); 6853 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "setClassMetadataAsync", { 6854 name: 'ɵsetClassMetadataAsync', 6855 moduleName: CORE 6856 }); 6857 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "setClassDebugInfo", { 6858 name: 'ɵsetClassDebugInfo', 6859 moduleName: CORE 6860 }); 6861 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "queryRefresh", { 6862 name: 'ɵɵqueryRefresh', 6863 moduleName: CORE 6864 }); 6865 (0,C_Build
6865_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "viewQuery", { 6866 name: 'ɵɵviewQuery', 6867 moduleName: CORE 6868 }); 6869 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "loadQuery", { 6870 name: 'ɵɵloadQuery', 6871 moduleName: CORE 6872 }); 6873 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "contentQuery", { 6874 name: 'ɵɵcontentQuery', 6875 moduleName: CORE 6876 }); 6877 // Signal queries 6878 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "viewQuerySignal", { 6879 name: 'ɵɵviewQuerySignal', 6880 moduleName: CORE 6881 }); 6882 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "contentQuerySignal", { 6883 name: 'ɵɵcontentQuerySignal', 6884 moduleName: CORE 6885 }); 6886 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "queryAdvance", { 6887 name: 'ɵɵqueryAdvance', 6888 moduleName: CORE 6889 }); 6890 // Two-way bindings 6891 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "twoWayProperty", { 6892 name: 'ɵɵtwoWayProperty', 6893 moduleName: CORE 6894 }); 6895 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "twoWayBindingSet", { 6896 name: 'ɵɵtwoWayBindingSet', 6897 moduleName: CORE 6898 }); 6899 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "twoWayListener", { 6900 name: 'ɵɵtwoWayListener', 6901 moduleName: CORE 6902 }); 6903 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "declareLet", { 6904 name: 'ɵɵdeclareLet', 6905 moduleName: CORE 6906 }); 6907 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "storeLet", { 6908 name: 'ɵɵstoreLet', 6909 moduleName: CORE 6910 }); 6911 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "readContextLet", { 6912 name: 'ɵɵreadContextLet', 6913 moduleName: CORE 6914 }); 6915 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "attachSourceLocations", { 6916 name: 'ɵɵattachSourceLocations', 6917 moduleName: CORE 6918 }); 6919 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "NgOnChangesFeature", { 6920 name: 'ɵɵNgOnChangesFeature', 6921 moduleName: CORE 6922 }); 6923 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "InheritDefinitionFeature", { 6924 name: 'ɵɵInheritDefinitionFeature', 6925 moduleName: CORE 6926 }); 6927 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "CopyDefinitionFeature", { 6928 name: 'ɵɵCopyDefinitionFeature', 6929 moduleName: CORE 6930 }); 6931 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "ProvidersFeature", { 6932 name: 'ɵɵProvidersFeature', 6933 moduleName: CORE 6934 }); 6935 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "HostDirectivesFeature", { 6936 name: 'ɵɵHostDirectivesFeature', 6937 moduleName: CORE 6938 }); 6939 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "ExternalStylesFeature", { 6940 name: 'ɵɵExternalStylesFeature', 6941 moduleName: CORE 6942 }); 6943 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "listener", { 6944 name: 'ɵɵlistener', 6945 moduleName: CORE 6946 }); 6947 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "getInheritedFactory", { 6948 name: 'ɵɵgetInheritedFactory', 6949 moduleName: CORE 6950 }); 6951 // sanitization-related functions 6952 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "sanitizeHtml", { 6953 name: 'ɵɵsanitizeHtml', 6954 moduleName: CORE 6955 }); 6956 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "sanitizeStyle", { 6957 name: 'ɵɵsanitizeStyle', 6958 moduleName: CORE 6959 }); 6960 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "sanitizeResourceUrl", { 6961 name: 'ɵɵsanitizeResourceUrl', 6962 moduleName: CORE 6963 }); 6964 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "sanitizeScript", { 6965 name: 'ɵɵsanitizeScript', 6966 moduleName: CORE 6967 }); 6968 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "sanitizeUrl", { 6969 name: 'ɵɵsanitizeUrl', 6970 moduleName: CORE 6971 }); 6972 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "sanitizeUrlOrResourceUrl", { 6973 name: 'ɵɵsanitizeUrlOrResourceUrl', 6974 moduleName: CORE 6975 }); 6976 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "trustConstantHtml", {
6977 name: 'ɵɵtrustConstantHtml', 6978 moduleName: CORE 6979 }); 6980 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "trustConstantResourceUrl", { 6981 name: 'ɵɵtrustConstantResourceUrl', 6982 moduleName: CORE 6983 }); 6984 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "validateIframeAttribute", { 6985 name: 'ɵɵvalidateIframeAttribute', 6986 moduleName: CORE 6987 }); 6988 // type-checking 6989 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "InputSignalBrandWriteType", { 6990 name: 'ɵINPUT_SIGNAL_BRAND_WRITE_TYPE', 6991 moduleName: CORE 6992 }); 6993 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "UnwrapDirectiveSignalInputs", { 6994 name: 'ɵUnwrapDirectiveSignalInputs', 6995 moduleName: CORE 6996 }); 6997 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Identifiers, "unwrapWritableSignal", { 6998 name: 'ɵunwrapWritableSignal', 6999 moduleName: CORE 7000 }); 7001 return Identifiers; 7002})(); 7003const DASH_CASE_REGEXP = /-+([a-z0-9])/g; 7004function dashCaseToCamelCase(input) { 7005 return input.replace(DASH_CASE_REGEXP, (...m) => m[1].toUpperCase()); 7006} 7007function splitAtColon(input, defaultValues) { 7008 return _splitAt(input, ':', defaultValues); 7009} 7010function splitAtPeriod(input, defaultValues) { 7011 return _splitAt(input, '.', defaultValues); 7012} 7013function _splitAt(input, character, defaultValues) { 7014 const characterIndex = input.indexOf(character); 7015 if (characterIndex == -1) return defaultValues; 7016 return [input.slice(0, characterIndex).trim(), input.slice(characterIndex + 1).trim()]; 7017} 7018function noUndefined(val) { 7019 return val === undefined ? null : val; 7020} 7021// Escape characters that have a special meaning in Regular Expressions 7022function escapeRegExp(s) { 7023 return s.replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1'); 7024} 7025function utf8Encode(str) { 7026 let encoded = []; 7027 for (let index = 0; index < str.length; index++) {
7028 let codePoint = str.charCodeAt(index); 7029 // decode surrogate 7030 // see https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae 7031 if (codePoint >= 0xd800 && codePoint <= 0xdbff && str.length > index + 1) { 7032 const low = str.charCodeAt(index + 1); 7033 if (low >= 0xdc00 && low <= 0xdfff) { 7034 index++; 7035 codePoint = (codePoint - 0xd800 << 10) + low - 0xdc00 + 0x10000; 7036 } 7037 } 7038 if (codePoint <= 0x7f) { 7039 encoded.push(codePoint); 7040 } else if (codePoint <= 0x7ff) { 7041 encoded.push(codePoint >> 6 & 0x1f | 0xc0, codePoint & 0x3f | 0x80); 7042 } else if (codePoint <= 0xffff) { 7043 encoded.push(codePoint >> 12 | 0xe0, codePoint >> 6 & 0x3f | 0x80, codePoint & 0x3f | 0x80); 7044 } else if (codePoint <= 0x1fffff) { 7045 encoded.push(codePoint >> 18 & 0x07 | 0xf0, codePoint >> 12 & 0x3f | 0x80, codePoint >> 6 & 0x3f | 0x80, codePoint & 0x3f | 0x80); 7046 } 7047 } 7048 return encoded; 7049} 7050function stringify(token) { 7051 if (typeof token === 'string') { 7052 return token; 7053 } 7054 if (Array.isArray(token)) { 7055 return `[${token.map(stringify).join(', ')}]`; 7056 } 7057 if (token == null) { 7058 return '' + token; 7059 } 7060 const name = token.overriddenName || token.name; 7061 if (name) { 7062 return `${name}`; 7063 } 7064 if (!token.toString) { 7065 return 'object'; 7066 } 7067 // WARNING: do not try to `JSON.stringify(token)` here 7068 // see https://github.com/angular/angular/issues/23440 7069 const result = token.toString(); 7070 if (result == null) { 7071 return '' + result; 7072 } 7073 const newLineIndex = result.indexOf('\n'); 7074 return newLineIndex >= 0 ? result.slice(0, newLineIndex) : result; 7075} 7076class Version { 7077 constructor(full) { 7078 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "full", void 0); 7079 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "major", void 0); 7080 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "minor", void 0); 7081 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "patch", void 0); 7082 this.full = full; 7083 const splits = full.split('.'); 7084 this.major = splits[0]; 7085 this.minor = splits[1]; 7086 this.patch = splits.slice(2).join('.'); 7087 } 7088} 7089const _global = globalThis; 7090const V1_TO_18 = /^([1-9]|1[0-8])\./; 7091function getJitStandaloneDefaultForVersion(version) { 7092 if (version.startsWith('0.')) { 7093 // 0.0.0 is always "latest", default is true. 7094 return true; 7095 } 7096 if (V1_TO_18.test(version)) { 7097 // Angular v2 - v18 default is false. 7098 return false; 7099 } 7100 // All other Angular versions (v19+) default to true. 7101 return true; 7102} 7103 7104// https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit 7105const VERSION$1 = 3; 7106const JS_B64_PREFIX = '# sourceMappingURL=data:application/json;base64,'; 7107class SourceMapGenerator { 7108 constructor(file = null) { 7109 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "file", void 0); 7110 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "sourcesContent", new Map()); 7111 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "lines", []); 7112 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "lastCol0", 0); 7113 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "hasMappings", false); 7114 this.file = file; 7115 } 7116 // The content is `null` when the content is expected to be loaded using the URL 7117 addSource(url, content = null) { 7118 if (!this.sourcesContent.has(url)) { 7119 this.sourcesContent.set(url, content); 7120 } 7121 return this; 7122 } 7123 addLine() { 7124 this.lines.push([]); 7125 this.lastCol0 = 0; 7126 return this; 7127 } 7128 addMapping(col0, sourceUrl, sourceLine0, sourceCol0) { 7129 if (!this.currentLine) { 7130 throw new Error(`A line must be added before mappings can be added`); 7131 } 7132 if (sourceUrl != null && !this.sourcesContent.has(sourceUrl)) { 7133 throw new Error(`Unknown source file "${sourceUrl}"`); 7134 } 7135 if (col0 == null) { 7136 throw new Error(`The column in the generated code must be provided`); 7137 } 7138 if (col0 < this.lastCol0) { 7139 throw new Error(`Mapping should be added in output order`); 7140 } 7141 if (sourceUrl && (sourceLine0 == null || sourceCol0 == null)) { 7142 throw new Error(`The source location must be provided when a source url is provided`); 7143 } 7144 this.hasMappings = true; 7145 this.lastCol0 = col0; 7146 this.currentLine.push({ 7147 col0, 7148 sourceUrl, 7149 sourceLine0, 7150 sourceCol0 7151 }); 7152 return this; 7153 } 7154 /** 7155 * @internal strip this from published d.ts files due to 7156 * https://github.com/microsoft/TypeScript/issues/36216 7157 */ 7158 get currentLine() { 7159 return this.lines.slice(-1)[0]; 7160 } 7161 toJSON() { 7162 if (!this.hasMappings) { 7163 return null; 7164 } 7165 const sourcesIndex = new Map(); 7166 const sources = []; 7167 const sourcesContent = [];
7168 Array.from(this.sourcesContent.keys()).forEach((url, i) => { 7169 sourcesIndex.set(url, i); 7170 sources.push(url); 7171 sourcesContent.push(this.sourcesContent.get(url) || null); 7172 }); 7173 let mappings = ''; 7174 let lastCol0 = 0; 7175 let lastSourceIndex = 0; 7176 let lastSourceLine0 = 0; 7177 let lastSourceCol0 = 0; 7178 this.lines.forEach(segments => { 7179 lastCol0 = 0; 7180 mappings += segments.map(segment => { 7181 // zero-based starting column of the line in the generated code 7182 let segAsStr = toBase64VLQ(segment.col0 - lastCol0); 7183 lastCol0 = segment.col0; 7184 if (segment.sourceUrl != null) { 7185 // zero-based index into the âsourcesâ list 7186 segAsStr += toBase64VLQ(sourcesIndex.get(segment.sourceUrl) - lastSourceIndex); 7187 lastSourceIndex = sourcesIndex.get(segment.sourceUrl); 7188 // the zero-based starting line in the original source 7189 segAsStr += toBase64VLQ(segment.sourceLine0 - lastSourceLine0); 7190 lastSourceLine0 = segment.sourceLine0; 7191 // the zero-based starting column in the original source 7192 segAsStr += toBase64VLQ(segment.sourceCol0 - lastSourceCol0); 7193 lastSourceCol0 = segment.sourceCol0; 7194 } 7195 return segAsStr; 7196 }).join(','); 7197 mappings += ';'; 7198 }); 7199 mappings = mappings.slice(0, -1); 7200 return { 7201 'file': this.file || '', 7202 'version': VERSION$1, 7203 'sourceRoot': '', 7204 'sources': sources, 7205 'sourcesContent': sourcesContent, 7206 'mappings': mappings 7207 }; 7208 } 7209 toJsComment() { 7210 return this.hasMappings ? '//' + JS_B64_PREFIX + toBase64String(JSON.stringify(this, null, 0)) : ''; 7211 } 7212} 7213function toBase64String(value) { 7214 let b64 = ''; 7215 const encoded = utf8Encode(value); 7216 for (let i = 0; i < encoded.length;) { 7217 const i1 = encoded[i++]; 7218 const i2 = i < encoded.length ? encoded[i++] : null; 7219 const i3 = i < encoded.length ? encoded[i++] : null; 7220 b64 += toBase64Digit(i1 >> 2); 7221 b64 += toBase64Digit((i1 & 3) << 4 | (i2 === null ? 0 : i2 >> 4)); 7222 b64 += i2 === null ? '=' : toBase64Digit((i2 & 15) << 2 | (i3 === null ? 0 : i3 >> 6)); 7223 b64 += i2 === null || i3 === null ? '=' : toBase64Digit(i3 & 63); 7224 } 7225 return b64; 7226} 7227function toBase64VLQ(value) { 7228 value = value < 0 ? (-value << 1) + 1 : value << 1; 7229 let out = ''; 7230 do { 7231 let digit = value & 31; 7232 value = value >> 5; 7233 if (value > 0) { 7234 digit = digit | 32; 7235 } 7236 out += toBase64Digit(digit); 7237 } while (value > 0); 7238 return out; 7239} 7240const B64_DIGITS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; 7241function toBase64Digit(value) { 7242 if (value < 0 || value >= 64) { 7243 throw new Error(`Can only encode value in the range [0, 63]`); 7244 } 7245 return B64_DIGITS[value]; 7246} 7247const _SINGLE_QUOTE_ESCAPE_STRING_RE = /'|\\|\n|\r|\$/g; 7248const _LEGAL_IDENTIFIER_RE = /^[$A-Z_][0-9A-Z_$]*$/i; 7249const _INDENT_WITH = ' '; 7250class _EmittedLine { 7251 constructor(indent) { 7252 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "indent", void 0); 7253 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "partsLength", 0); 7254 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "parts", []); 7255 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "srcSpans", []); 7256 this.indent = indent; 7257 } 7258} 7259class EmitterVisitorContext { 7260 static createRoot() { 7261 return new EmitterVisitorContext(0); 7262 } 7263 constructor(_indent) { 7264 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_indent", void 0); 7265 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_lines", void 0); 7266 this._indent = _indent; 7267 this._lines = [new _EmittedLine(_indent)]; 7268 } 7269 /** 7270 * @internal strip this from published d.ts files due to 7271 * https://github.com/microsoft/TypeScript/issues/36216 7272 */ 7273 get _currentLine() { 7274 return this._lines[this._lines.length - 1]; 7275 } 7276 println(from, lastPart = '') { 7277 this.print(from || null, lastPart, true); 7278 } 7279 lineIsEmpty() { 7280 return this._currentLine.parts.length === 0; 7281 } 7282 lineLength() { 7283 return this._currentLine.indent * _INDENT_WITH.length + this._currentLine.partsLength; 7284 } 7285 print(from, part, newLine = false) { 7286 if (part.length > 0) { 7287 this._currentLine.parts.push(part); 7288 this._currentLine.partsLength += part.length; 7289 this._currentLine.srcSpans.push(from && from.sourceSpan || null); 7290 } 7291 if (newLine) { 7292 this._lines.push(new _EmittedLine(this._indent)); 7293 } 7294 } 7295 removeEmptyLastLine() { 7296 if (this.lineIsEmpty()) { 7297 this._lines.pop(); 7298 } 7299 } 7300 incIndent() { 7301 this._indent++; 7302 if (this.lineIsEmpty()) { 7303 this._currentLine.indent = this._indent; 7304 } 7305 } 7306 decIndent() { 7307 this._indent--; 7308 if (this.lineIsEmpty()) { 7309 this._currentLine.indent = this._indent; 7310 } 7311 } 7312 toSource() { 7313 return this.sourceLines.map(l => l.parts.length > 0 ? _createIndent(l.indent) + l.parts.join('') : '').join('\n'); 7314 } 7315 toSourceMapGenerator(genFilePath, startsAtLine = 0) { 7316 const map = new SourceMapGenerator(genFilePath); 7317 let firstOffsetMapped = false;
7318 const mapFirstOffsetIfNeeded = () => { 7319 if (!firstOffsetMapped) { 7320 // Add a single space so that tools won't try to load the file from disk. 7321 // Note: We are using virtual urls like `ng:///`, so we have to 7322 // provide a content here. 7323 map.addSource(genFilePath, ' ').addMapping(0, genFilePath, 0, 0); 7324 firstOffsetMapped = true; 7325 } 7326 }; 7327 for (let i = 0; i < startsAtLine; i++) { 7328 map.addLine(); 7329 mapFirstOffsetIfNeeded(); 7330 } 7331 this.sourceLines.forEach((line, lineIdx) => { 7332 map.addLine(); 7333 const spans = line.srcSpans; 7334 const parts = line.parts; 7335 let col0 = line.indent * _INDENT_WITH.length; 7336 let spanIdx = 0; 7337 // skip leading parts without source spans 7338 while (spanIdx < spans.length && !spans[spanIdx]) { 7339 col0 += parts[spanIdx].length; 7340 spanIdx++; 7341 } 7342 if (spanIdx < spans.length && lineIdx === 0 && col0 === 0) { 7343 firstOffsetMapped = true; 7344 } else { 7345 mapFirstOffsetIfNeeded(); 7346 } 7347 while (spanIdx < spans.length) { 7348 const span = spans[spanIdx]; 7349 const source = span.start.file; 7350 const sourceLine = span.start.line; 7351 const sourceCol = span.start.col; 7352 map.addSource(source.url, source.content).addMapping(col0, source.url, sourceLine, sourceCol); 7353 col0 += parts[spanIdx].length; 7354 spanIdx++; 7355 // assign parts without span or the same span to the previous segment 7356 while (spanIdx < spans.length && (span === spans[spanIdx] || !spans[spanIdx])) { 7357 col0 += parts[spanIdx].length; 7358 spanIdx++; 7359 } 7360 } 7361 }); 7362 return map; 7363 } 7364 spanOf(line, column) { 7365 const emittedLine = this._lines[line]; 7366 if (emittedLine) { 7367 let columnsLeft = column - _createIndent(emittedLine.indent).length; 7368 for (let partIndex = 0; partIndex < emittedLine.parts.length; partIndex++) { 7369 const part = emittedLine.parts[partIndex]; 7370 if (part.length > columnsLeft) { 7371 return emittedLine.srcSpans[partIndex]; 7372 } 7373 columnsLeft -= part.length; 7374 } 7375 } 7376 return null; 7377 } 7378 /** 7379 * @internal strip this from published d.ts files due to 7380 * https://github.com/microsoft/TypeScript/issues/36216 7381 */ 7382 get sourceLines() { 7383 if (this._lines.length && this._lines[this._lines.length - 1].parts.length === 0) { 7384 return this._lines.slice(0, -1); 7385 } 7386 return this._lines; 7387 } 7388} 7389class AbstractEmitterVisitor { 7390 constructor(_escapeDollarInStrings) { 7391 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_escapeDollarInStrings", void 0); 7392 this._escapeDollarInStrings = _escapeDollarInStrings; 7393 } 7394 printLeadingComments(stmt, ctx) { 7395 if (stmt.leadingComments === undefined) { 7396 return; 7397 } 7398 for (const comment of stmt.leadingComments) { 7399 if (comment instanceof JSDocComment) { 7400 ctx.print(stmt, `/*${comment.toString()}*/`, comment.trailingNewline); 7401 } else { 7402 if (comment.multiline) { 7403 ctx.print(stmt, `/* ${comment.text} */`, comment.trailingNewline); 7404 } else { 7405 comment.text.split('\n').forEach(line => { 7406 ctx.println(stmt, `// ${line}`); 7407 }); 7408 } 7409 } 7410 } 7411 } 7412 visitExpressionStmt(stmt, ctx) { 7413 this.printLeadingComments(stmt, ctx); 7414 stmt.expr.visitExpression(this, ctx); 7415 ctx.println(stmt, ';'); 7416 return null; 7417 } 7418 visitReturnStmt(stmt, ctx) { 7419 this.printLeadingComments(stmt, ctx); 7420 ctx.print(stmt, `return `); 7421 stmt.value.visitExpression(this, ctx); 7422 ctx.println(stmt, ';'); 7423 return null; 7424 } 7425 visitIfStmt(stmt, ctx) { 7426 this.printLeadingComments(stmt, ctx); 7427 ctx.print(stmt, `if (`); 7428 stmt.condition.visitExpression(this, ctx); 7429 ctx.print(stmt, `) {`); 7430 const hasElseCase = stmt.falseCase != null && stmt.falseCase.length > 0; 7431 if (stmt.trueCase.length <= 1 && !hasElseCase) { 7432 ctx.print(stmt, ` `); 7433 this.visitAllStatements(stmt.trueCase, ctx); 7434 ctx.removeEmptyLastLine(); 7435 ctx.print(stmt, ` `); 7436 } else { 7437 ctx.println(); 7438 ctx.incIndent();
7439 this.visitAllStatements(stmt.trueCase, ctx); 7440 ctx.decIndent(); 7441 if (hasElseCase) { 7442 ctx.println(stmt, `} else {`); 7443 ctx.incIndent(); 7444 this.visitAllStatements(stmt.falseCase, ctx); 7445 ctx.decIndent(); 7446 } 7447 } 7448 ctx.println(stmt, `}`); 7449 return null; 7450 } 7451 visitWriteVarExpr(expr, ctx) { 7452 const lineWasEmpty = ctx.lineIsEmpty(); 7453 if (!lineWasEmpty) { 7454 ctx.print(expr, '('); 7455 } 7456 ctx.print(expr, `${expr.name} = `); 7457 expr.value.visitExpression(this, ctx); 7458 if (!lineWasEmpty) { 7459 ctx.print(expr, ')'); 7460 } 7461 return null; 7462 } 7463 visitWriteKeyExpr(expr, ctx) { 7464 const lineWasEmpty = ctx.lineIsEmpty(); 7465 if (!lineWasEmpty) { 7466 ctx.print(expr, '('); 7467 } 7468 expr.receiver.visitExpression(this, ctx); 7469 ctx.print(expr, `[`); 7470 expr.index.visitExpression(this, ctx); 7471 ctx.print(expr, `] = `); 7472 expr.value.visitExpression(this, ctx); 7473 if (!lineWasEmpty) { 7474 ctx.print(expr, ')'); 7475 } 7476 return null; 7477 } 7478 visitWritePropExpr(expr, ctx) { 7479 const lineWasEmpty = ctx.lineIsEmpty(); 7480 if (!lineWasEmpty) { 7481 ctx.print(expr, '('); 7482 } 7483 expr.receiver.visitExpression(this, ctx); 7484 ctx.print(expr, `.${expr.name} = `); 7485 expr.value.visitExpression(this, ctx); 7486 if (!lineWasEmpty) { 7487 ctx.print(expr, ')'); 7488 } 7489 return null; 7490 } 7491 visitInvokeFunctionExpr(expr, ctx) { 7492 const shouldParenthesize = expr.fn instanceof ArrowFunctionExpr; 7493 if (shouldParenthesize) { 7494 ctx.print(expr.fn, '('); 7495 } 7496 expr.fn.visitExpression(this, ctx); 7497 if (shouldParenthesize) { 7498 ctx.print(expr.fn, ')'); 7499 } 7500 ctx.print(expr, `(`); 7501 this.visitAllExpressions(expr.args, ctx, ','); 7502 ctx.print(expr, `)`); 7503 return null; 7504 } 7505 visitTaggedTemplateLiteralExpr(expr, ctx) { 7506 expr.tag.visitExpression(this, ctx); 7507 expr.template.visitExpression(this, ctx); 7508 return null; 7509 } 7510 visitTemplateLiteralExpr(expr, ctx) { 7511 ctx.print(expr, '`'); 7512 for (let i = 0; i < expr.elements.length; i++) { 7513 expr.elements[i].visitExpression(this, ctx); 7514 const expression = i < expr.expressions.length ? expr.expressions[i] : null; 7515 if (expression !== null) { 7516 ctx.print(expression, '${'); 7517 expression.visitExpression(this, ctx); 7518 ctx.print(expression, '}'); 7519 } 7520 } 7521 ctx.print(expr, '`'); 7522 } 7523 visitTemplateLiteralElementExpr(expr, ctx) { 7524 ctx.print(expr, expr.rawText); 7525 } 7526 visitWrappedNodeExpr(ast, ctx) { 7527 throw new Error('Abstract emitter cannot visit WrappedNodeExpr.'); 7528 } 7529 visitTypeofExpr(expr, ctx) { 7530 ctx.print(expr, 'typeof '); 7531 expr.expr.visitExpression(this, ctx); 7532 } 7533 visitReadVarExpr(ast, ctx) { 7534 ctx.print(ast, ast.name); 7535 return null; 7536 } 7537 visitInstantiateExpr(ast, ctx) { 7538 ctx.print(ast, `new `); 7539 ast.classExpr.visitExpression(this, ctx); 7540 ctx.print(ast, `(`); 7541 this.visitAllExpressions(ast.args, ctx, ','); 7542 ctx.print(ast, `)`); 7543 return null; 7544 } 7545 visitLiteralExpr(ast, ctx) { 7546 const value = ast.value; 7547 if (typeof value === 'string') { 7548 ctx.print(ast, escapeIdentifier(value, this._escapeDollarInStrings)); 7549 } else { 7550 ctx.print(ast, `${value}`); 7551 } 7552 return null; 7553 } 7554 visitLocalizedString(ast, ctx) { 7555 const head = ast.serializeI18nHead(); 7556 ctx.print(ast, '$localize `' + head.raw); 7557 for (let i = 1; i < ast.messageParts.length; i++) { 7558 ctx.print(ast, '${'); 7559 ast.expressions[i - 1].visitExpression(this, ctx); 7560 ctx.print(ast, `}${ast.serializeI18nTemplatePart(i).raw}`); 7561 } 7562 ctx.print(ast, '`'); 7563 return null; 7564 } 7565 visitConditionalExpr(ast, ctx) { 7566 ctx.print(ast, `(`); 7567 ast.condition.visitExpression(this, ctx); 7568 ctx.print(ast, '? '); 7569 ast.trueCase.visitExpression(this, ctx); 7570 ctx.print(ast, ': '); 7571 ast.falseCase.visitExpression(this, ctx); 7572 ctx.print(ast, `)`); 7573 return null; 7574 } 7575 visitDynamicImportExpr(ast, ctx) { 7576 ctx.print(ast, `import(${ast.url})`); 7577 } 7578 visitNotExpr(ast, ctx) { 7579 ctx.print(ast, '!'); 7580 ast.condition.visitExpression(this, ctx); 7581 return null; 7582 } 7583 visitUnaryOperatorExpr(ast, ctx) { 7584 let opStr; 7585 switch (ast.operator) { 7586 case UnaryOperator.Plus: 7587 opStr = '+'; 7588 break; 7589 case UnaryOperator.Minus: 7590 opStr = '-'; 7591 break; 7592 default: 7593 throw new Error(`Unknown operator ${ast.operator}`); 7594 } 7595 if (ast.parens) ctx.print(ast, `(`); 7596 ctx.print(ast, opStr); 7597 ast.expr.visitExpression(this, ctx); 7598 if (ast.parens) ctx.print(ast, `)`); 7599 return null; 7600 } 7601 visitBinaryOperatorExpr(ast, ctx) { 7602 let opStr; 7603 switch (ast.operator) { 7604 case BinaryOperator.Equals: 7605 opStr = '=='; 7606 break; 7607 case BinaryOperator.Identical: 7608 opStr = '==='; 7609 break; 7610 case BinaryOperator.NotEquals: 7611 opStr = '!='; 7612 break; 7613 case BinaryOperator.NotIdentical: 7614 opStr = '!=='; 7615 break; 7616 case BinaryOperator.And: 7617 opStr = '&&'; 7618 break; 7619 case BinaryOperator.BitwiseOr: 7620 opStr = '|'; 7621 break; 7622 case BinaryOperator.BitwiseAnd: 7623 opStr = '&'; 7624 break; 7625 case BinaryOperator.Or: 7626 opStr = '||'; 7627 break; 7628 case BinaryOperator.Plus: 7629 opStr = '+'; 7630 break; 7631 case BinaryOperator.Minus: 7632 opStr = '-'; 7633 break; 7634 case BinaryOperator.Divide: 7635 opStr = '/'; 7636 break; 7637 case BinaryOperator.Multiply: 7638 opStr = '*'; 7639 break; 7640 case BinaryOperator.Modulo: 7641 opStr = '%'; 7642 break; 7643 case BinaryOperator.Lower: 7644 opStr = '<'; 7645 break; 7646 case BinaryOperator.LowerEquals: 7647 opStr = '<='; 7648 break; 7649 case BinaryOperator.Bigger: 7650 opStr = '>'; 7651 break; 7652 case BinaryOperator.BiggerEquals: 7653 opStr = '>='; 7654 break; 7655 case BinaryOperator.NullishCoalesce: 7656 opStr = '??'; 7657 break; 7658 default: 7659 throw new Error(`Unknown operator ${ast.operator}`); 7660 } 7661 if (ast.parens) ctx.print(ast, `(`); 7662 ast.lhs.visitExpression(this, ctx); 7663 ctx.print(ast, ` ${opStr} `); 7664 ast.rhs.visitExpression(this, ctx); 7665 if (ast.parens) ctx.print(ast, `)`); 7666 return null; 7667 } 7668 visitReadPropExpr(ast, ctx) { 7669 ast.receiver.visitExpression(this, ctx); 7670 ctx.print(ast, `.`); 7671 ctx.print(ast, ast.name); 7672 return null; 7673 } 7674 visitReadKeyExpr(ast, ctx) { 7675 ast.receiver.visitExpression(this, ctx); 7676 ctx.print(ast, `[`); 7677 ast.index.visitExpression(this, ctx); 7678 ctx.print(ast, `]`); 7679 return null; 7680 } 7681 visitLiteralArrayExpr(ast, ctx) { 7682 ctx.print(ast, `[`); 7683 this.visitAllExpressions(ast.entries, ctx, ','); 7684 ctx.print(ast, `]`); 7685 return null; 7686 } 7687 visitLiteralMapExpr(ast, ctx) { 7688 ctx.print(ast, `{`); 7689 this.visitAllObjects(entry => { 7690 ctx.print(ast, `${escapeIdentifier(entry.key, this._escapeDollarInStrings, entry.quoted)}:`); 7691 entry.value.visitExpression(this, ctx); 7692 }, ast.entries, ctx, ','); 7693 ctx.print(ast, `}`); 7694 return null; 7695 } 7696 visitCommaExpr(ast, ctx) { 7697 ctx.print(ast, '('); 7698 this.visitAllExpressions(ast.parts, ctx, ','); 7699 ctx.print(ast, ')'); 7700 return null; 7701 } 7702 visitAllExpressions(expressions, ctx, separator) { 7703 this.visitAllObjects(expr => expr.visitExpression(this, ctx), expressions, ctx, separator); 7704 } 7705 visitAllObjects(handler, expressions, ctx, separator) { 7706 let incrementedIndent = false;
7707 for (let i = 0; i < expressions.length; i++) { 7708 if (i > 0) { 7709 if (ctx.lineLength() > 80) { 7710 ctx.print(null, separator, true); 7711 if (!incrementedIndent) { 7712 // continuation are marked with double indent. 7713 ctx.incIndent(); 7714 ctx.incIndent(); 7715 incrementedIndent = true; 7716 } 7717 } else { 7718 ctx.print(null, separator, false); 7719 } 7720 } 7721 handler(expressions[i]); 7722 } 7723 if (incrementedIndent) { 7724 // continuation are marked with double indent. 7725 ctx.decIndent(); 7726 ctx.decIndent(); 7727 } 7728 } 7729 visitAllStatements(statements, ctx) { 7730 statements.forEach(stmt => stmt.visitStatement(this, ctx)); 7731 } 7732} 7733function escapeIdentifier(input, escapeDollar, alwaysQuote = true) { 7734 if (input == null) { 7735 return null; 7736 } 7737 const body = input.replace(_SINGLE_QUOTE_ESCAPE_STRING_RE, (...match) => { 7738 if (match[0] == '$') { 7739 return escapeDollar ? '\\$' : '$'; 7740 } else if (match[0] == '\n') { 7741 return '\\n'; 7742 } else if (match[0] == '\r') { 7743 return '\\r'; 7744 } else { 7745 return `\\${match[0]}`; 7746 } 7747 }); 7748 const requiresQuotes = alwaysQuote || !_LEGAL_IDENTIFIER_RE.test(body); 7749 return requiresQuotes ? `'${body}'` : body; 7750} 7751function _createIndent(count) { 7752 let res = ''; 7753 for (let i = 0; i < count; i++) { 7754 res += _INDENT_WITH; 7755 } 7756 return res; 7757} 7758function typeWithParameters(type, numParams) { 7759 if (numParams === 0) { 7760 return expressionType(type); 7761 } 7762 const params = []; 7763 for (let i = 0; i < numParams; i++) { 7764 params.push(DYNAMIC_TYPE); 7765 } 7766 return expressionType(type, undefined, params); 7767} 7768function getSafePropertyAccessString(accessor, name) { 7769 const escapedName = escapeIdentifier(name, false, false); 7770 return escapedName !== name ? `${accessor}[${escapedName}]` : `${accessor}.${name}`; 7771} 7772function jitOnlyGuardedExpression(expr) { 7773 return guardedExpression('ngJitMode', expr); 7774} 7775function devOnlyGuardedExpression(expr) { 7776 return guardedExpression('ngDevMode', expr); 7777} 7778function guardedExpression(guard, expr) { 7779 const guardExpr = new ExternalExpr({ 7780 name: guard, 7781 moduleName: null 7782 }); 7783 const guardNotDefined = new BinaryOperatorExpr(BinaryOperator.Identical, new TypeofExpr(guardExpr), literal('undefined')); 7784 const guardUndefinedOrTrue = new BinaryOperatorExpr(BinaryOperator.Or, guardNotDefined, guardExpr, /* type */undefined, /* sourceSpan */undefined, true); 7785 return new BinaryOperatorExpr(BinaryOperator.And, guardUndefinedOrTrue, expr); 7786} 7787function wrapReference(value) { 7788 const wrapped = new WrappedNodeExpr(value); 7789 return { 7790 value: wrapped, 7791 type: wrapped 7792 }; 7793} 7794function refsToArray(refs, shouldForwardDeclare) { 7795 const values = literalArr(refs.map(ref => ref.value)); 7796 return shouldForwardDeclare ? arrowFn([], values) : values; 7797} 7798function createMayBeForwardRefExpression(expression, forwardRef) { 7799 return { 7800 expression, 7801 forwardRef 7802 }; 7803} 7804/** 7805 * Convert a `MaybeForwardRefExpression` to an `Expression`, possibly wrapping its expression in a 7806 * `forwardRef()` call. 7807 * 7808 * If `MaybeForwardRefExpression.forwardRef` is `ForwardRefHandling.Unwrapped` then the expression 7809 * was originally wrapped in a `forwardRef()` call to prevent the value from being eagerly evaluated 7810 * in the code. 7811 * 7812 * See `packages/compiler-cli/src/ngtsc/annotations/src/injectable.ts` and 7813 * `packages/compiler/src/jit_compiler_facade.ts` for more information. 7814 */ 7815function convertFromMaybeForwardRefExpression({ 7816 expression, 7817 forwardRef 7818}) { 7819 switch (forwardRef) { 7820 case 0 /* ForwardRefHandling.None */: 7821 case 1 /* ForwardRefHandling.Wrapped */: 7822 return expression; 7823 case 2 /* ForwardRefHandling.Unwrapped */: 7824 return generateForwardRef(expression); 7825 } 7826} 7827/** 7828 * Generate an expression that has the given `expr` wrapped in the following form: 7829 * 7830 * ```ts 7831 * forwardRef(() => expr) 7832 * ``` 7833 */ 7834function generateForwardRef(expr) { 7835 return importExpr(Identifiers.forwardRef).callFn([arrowFn([], expr)]); 7836} 7837var R3FactoryDelegateType = /*#__PURE__*/function (R3FactoryDelegateType) { 7838 R3FactoryDelegateType[R3FactoryDelegateType["Class"] = 0] = "Class"; 7839 R3FactoryDelegateType[R3FactoryDelegateType["Function"] = 1] = "Function"; 7840 return R3FactoryDelegateType; 7841}(R3FactoryDelegateType || {}); 7842/** 7843 * Construct a factory function expression for the given `R3FactoryMetadata`. 7844 */ 7845function compileFactoryFunction(meta) { 7846 const t = variable('__ngFactoryType__'); 7847 let baseFactoryVar = null; 7848 // The type to instantiate via constructor invocation. If there is no delegated factory, meaning 7849 // this type is always created by constructor invocation, then this is the type-to-create 7850 // parameter provided by the user (t) if specified, or the current type if not. If there is a 7851 // delegated factory (which is used to create the current type) then this is only the type-to- 7852 // create parameter (t). 7853 const typeForCtor = !isDelegatedFactoryMetadata(meta) ? new BinaryOperatorExpr(BinaryOperator.Or, t, meta.type.value) : t; 7854 let ctorExpr = null; 7855 if (meta.deps !== null) { 7856 // There is a constructor (either explicitly or implicitly defined).
7857 if (meta.deps !== 'invalid') { 7858 ctorExpr = new InstantiateExpr(typeForCtor, injectDependencies(meta.deps, meta.target)); 7859 } 7860 } else { 7861 // There is no constructor, use the base class' factory to construct typeForCtor. 7862 baseFactoryVar = variable(`ɵ${meta.name}_BaseFactory`); 7863 ctorExpr = baseFactoryVar.callFn([typeForCtor]); 7864 } 7865 const body = []; 7866 let retExpr = null; 7867 function makeConditionalFactory(nonCtorExpr) { 7868 const r = variable('__ngConditionalFactory__'); 7869 body.push(r.set(NULL_EXPR).toDeclStmt()); 7870 const ctorStmt = ctorExpr !== null ? r.set(ctorExpr).toStmt() : importExpr(Identifiers.invalidFactory).callFn([]).toStmt(); 7871 body.push(ifStmt(t, [ctorStmt], [r.set(nonCtorExpr).toStmt()])); 7872 return r; 7873 } 7874 if (isDelegatedFactoryMetadata(meta)) { 7875 // This type is created with a delegated factory. If a type parameter is not specified, call 7876 // the factory instead. 7877 const delegateArgs = injectDependencies(meta.delegateDeps, meta.target); 7878 // Either call `new delegate(...)` or `delegate(...)` depending on meta.delegateType. 7879 const factoryExpr = new (meta.delegateType === R3FactoryDelegateType.Class ? InstantiateExpr : InvokeFunctionExpr)(meta.delegate, delegateArgs); 7880 retExpr = makeConditionalFactory(factoryExpr); 7881 } else if (isExpressionFactoryMetadata(meta)) { 7882 // TODO(alxhub): decide whether to lower the value here or in the caller 7883 retExpr = makeConditionalFactory(meta.expression); 7884 } else { 7885 retExpr = ctorExpr; 7886 } 7887 if (retExpr === null) { 7888 // The expression cannot be formed so render an `ɵɵinvalidFactory()` call. 7889 body.push(importExpr(Identifiers.invalidFactory).callFn([]).toStmt()); 7890 } else if (baseFactoryVar !== null) { 7891 // This factory uses a base factory, so call `ɵɵgetInheritedFactory()` to compute it. 7892 const getInheritedFactoryCall = importExpr(Identifiers.getInheritedFactory).callFn([meta.type.value]); 7893 // Memoize the base factoryFn: `baseFactory || (baseFactory = ɵɵgetInheritedFactory(...))` 7894 const baseFactory = new BinaryOperatorExpr(BinaryOperator.Or, baseFactoryVar, baseFactoryVar.set(getInheritedFactoryCall));
7895 body.push(new ReturnStatement(baseFactory.callFn([typeForCtor]))); 7896 } else { 7897 // This is straightforward factory, just return it. 7898 body.push(new ReturnStatement(retExpr)); 7899 } 7900 let factoryFn = fn([new FnParam(t.name, DYNAMIC_TYPE)], body, INFERRED_TYPE, undefined, `${meta.name}_Factory`); 7901 if (baseFactoryVar !== null) { 7902 // There is a base factory variable so wrap its declaration along with the factory function into 7903 // an IIFE. 7904 factoryFn = arrowFn([], [new DeclareVarStmt(baseFactoryVar.name), new ReturnStatement(factoryFn)]).callFn([], /* sourceSpan */undefined, /* pure */true); 7905 } 7906 return { 7907 expression: factoryFn, 7908 statements: [], 7909 type: createFactoryType(meta) 7910 }; 7911} 7912function createFactoryType(meta) { 7913 const ctorDepsType = meta.deps !== null && meta.deps !== 'invalid' ? createCtorDepsType(meta.deps) : NONE_TYPE; 7914 return expressionType(importExpr(Identifiers.FactoryDeclaration, [typeWithParameters(meta.type.type, meta.typeArgumentCount), ctorDepsType])); 7915} 7916function injectDependencies(deps, target) { 7917 return deps.map((dep, index) => compileInjectDependency(dep, target, index)); 7918} 7919function compileInjectDependency(dep, target, index) { 7920 // Interpret the dependency according to its resolved type. 7921 if (dep.token === null) { 7922 return importExpr(Identifiers.invalidFactoryDep).callFn([literal(index)]); 7923 } else if (dep.attributeNameType === null) { 7924 // Build up the injection flags according to the metadata. 7925 const flags = 0 /* InjectFlags.Default */ | (dep.self ? 2 /* InjectFlags.Self */ : 0) | (dep.skipSelf ? 4 /* InjectFlags.SkipSelf */ : 0) | (dep.host ? 1 /* InjectFlags.Host */ : 0) | (dep.optional ? 8 /* InjectFlags.Optional */ : 0) | (target === FactoryTarget.Pipe ? 16 /* InjectFlags.ForPipe */ : 0); 7926 // If this dependency is optional or otherwise has non-default flags, then additional 7927 // parameters describing how to inject the dependency must be passed to the inject function 7928 // that's being used. 7929 let flagsParam = flags !== 0 /* InjectFlags.Default */ || dep.optional ? literal(flags) : null; 7930 // Build up the arguments to the injectFn call. 7931 const injectArgs = [dep.token]; 7932 if (flagsParam) { 7933 injectArgs.push(flagsParam); 7934 } 7935 const injectFn = getInjectFn(target); 7936 return importExpr(injectFn).callFn(injectArgs); 7937 } else { 7938 // The `dep.attributeTypeName` value is defined, which indicates that this is an `@Attribute()` 7939 // type dependency. For the generated JS we still want to use the `dep.token` value in case the 7940 // name given for the attribute is not a string literal. For example given `@Attribute(foo())`, 7941 // we want to generate `ɵɵinjectAttribute(foo())`. 7942 // 7943 // The `dep.attributeTypeName` is only actually used (in `createCtorDepType()`) to generate 7944 // typings. 7945 return importExpr(Identifiers.injectAttribute).callFn([dep.token]); 7946 } 7947} 7948function createCtorDepsType(deps) { 7949 let hasTypes = false; 7950 const attributeTypes = deps.map(dep => { 7951 const type = createCtorDepType(dep); 7952 if (type !== null) { 7953 hasTypes = true; 7954 return type; 7955 } else { 7956 return literal(null); 7957 } 7958 }); 7959 if (hasTypes) { 7960 return expressionType(literalArr(attributeTypes)); 7961 } else { 7962 return NONE_TYPE; 7963 } 7964} 7965function createCtorDepType(dep) { 7966 const entries = []; 7967 if (dep.attributeNameType !== null) { 7968 entries.push({ 7969 key: 'attribute', 7970 value: dep.attributeNameType, 7971 quoted: false 7972 }); 7973 } 7974 if (dep.optional) { 7975 entries.push({ 7976 key: 'optional', 7977 value: literal(true), 7978 quoted: false 7979 }); 7980 } 7981 if (dep.host) { 7982 entries.push({ 7983 key: 'host', 7984 value: literal(true), 7985 quoted: false 7986 }); 7987 } 7988 if (dep.self) { 7989 entries.push({ 7990 key: 'self', 7991 value: literal(true), 7992 quoted: false 7993 }); 7994 } 7995 if (dep.skipSelf) { 7996 entries.push({ 7997 key: 'skipSelf', 7998 value: literal(true), 7999 quoted: false 8000 }); 8001 } 8002 return entries.length > 0 ? literalMap(entries) : null; 8003} 8004function isDelegatedFactoryMetadata(meta) { 8005 return meta.delegateType !== undefined; 8006} 8007function isExpressionFactoryMetadata(meta) { 8008 return meta.expression !== undefined; 8009} 8010function getInjectFn(target) { 8011 switch (target) { 8012 case FactoryTarget.Component: 8013 case FactoryTarget.Directive: 8014 case FactoryTarget.Pipe: 8015 return Identifiers.directiveInject; 8016 case FactoryTarget.NgModule: 8017 case FactoryTarget.Injectable: 8018 default: 8019 return Identifiers.inject; 8020 } 8021} 8022class ParserError { 8023 constructor(message, input, errLocation, ctxLocation) { 8024 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "input", void 0); 8025 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "errLocation", void 0); 8026 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "ctxLocation", void 0); 8027 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "message", void 0); 8028 this.input = input; 8029 this.errLocation = errLocation; 8030 this.ctxLocation = ctxLocation; 8031 this.message = `Parser Error: ${message} ${errLocation} [${input}] in ${ctxLocation}`; 8032 } 8033} 8034class ParseSpan { 8035 constructor(start, end) { 8036 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "start", void 0); 8037 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "end", void 0); 8038 this.start = start; 8039 this.end = end; 8040 } 8041 toAbsolute(absoluteOffset) { 8042 return new AbsoluteSourceSpan(absoluteOffset + this.start, absoluteOffset + this.end); 8043 } 8044} 8045class AST { 8046 constructor(span, 8047 /** 8048 * Absolute location of the expression AST in a source code file. 8049 */ 8050 sourceSpan) { 8051 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "span", void 0); 8052 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "sourceSpan", void 0); 8053 this.span = span; 8054 this.sourceSpan = sourceSpan; 8055 } 8056 toString() { 8057 return 'AST'; 8058 } 8059} 8060class ASTWithName extends AST { 8061 constructor(span, sourceSpan, nameSpan) { 8062 super(span, sourceSpan); 8063 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "nameSpan", void 0); 8064 this.nameSpan = nameSpan; 8065 } 8066} 8067let EmptyExpr$1 = class EmptyExpr extends AST { 8068 visit(visitor, context = null) { 8069 // do nothing 8070 } 8071}; 8072class ImplicitReceiver extends AST { 8073 visit(visitor, context = null) { 8074 return visitor.visitImplicitReceiver(this, context); 8075 } 8076} 8077/** 8078 * Receiver when something is accessed through `this` (e.g. `this.foo`). Note that this class 8079 * inherits from `ImplicitReceiver`, because accessing something through `this` is treated the 8080 * same as accessing it implicitly inside of an Angular template (e.g. `[attr.title]="this.title"` 8081 * is the same as `[attr.title]="title"`.). Inheriting allows for the `this` accesses to be treated 8082 * the same as implicit ones, except for a couple of exceptions like `$event` and `$any`. 8083 * TODO: we should find a way for this class not to extend from `ImplicitReceiver` in the future. 8084 */ 8085class ThisReceiver extends ImplicitReceiver { 8086 visit(visitor, context = null) { 8087 var _visitor$visitThisRec; 8088 return (_visitor$visitThisRec = visitor.visitThisReceiver) === null || _visitor$visitThisRec === void 0 ? void 0 : _visitor$visitThisRec.call(visitor, this, context); 8089 } 8090} 8091/** 8092 * Multiple expressions separated by a semicolon. 8093 */ 8094class Chain extends AST { 8095 constructor(span, sourceSpan, expressions) { 8096 super(span, sourceSpan); 8097 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "expressions", void 0); 8098 this.expressions = expressions; 8099 } 8100 visit(visitor, context = null) { 8101 return visitor.visitChain(this, context); 8102 } 8103} 8104class Conditional extends AST { 8105 constructor(span, sourceSpan, condition, trueExp, falseExp) { 8106 super(span, sourceSpan); 8107 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "condition", void 0); 8108 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "trueExp", void 0); 8109 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "falseExp", void 0); 8110 this.condition = condition; 8111 this.trueExp = trueExp; 8112 this.falseExp = falseExp; 8113 } 8114 visit(visitor, context = null) { 8115 return visitor.visitConditional(this, context); 8116 } 8117} 8118class PropertyRead extends ASTWithName { 8119 constructor(span, sourceSpan, nameSpan, receiver, name) { 8120 super(span, sourceSpan, nameSpan); 8121 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "receiver", void 0); 8122 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "name", void 0); 8123 this.receiver = receiver; 8124 this.name = name; 8125 } 8126 visit(visitor, context = null) { 8127 return visitor.visitPropertyRead(this, context); 8128 } 8129} 8130class PropertyWrite extends ASTWithName { 8131 constructor(span, sourceSpan, nameSpan, receiver, name, value) { 8132 super(span, sourceSpan, nameSpan); 8133 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "receiver", void 0); 8134 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "name", void 0); 8135 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "value", void 0); 8136 this.receiver = receiver; 8137 this.name = name; 8138 this.value = value; 8139 } 8140 visit(visitor, context = null) { 8141 return visitor.visitPropertyWrite(this, context); 8142 } 8143} 8144class SafePropertyRead extends ASTWithName { 8145 constructor(span, sourceSpan, nameSpan, receiver, name) { 8146 super(span, sourceSpan, nameSpan); 8147 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "receiver", void 0); 8148 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "name", void 0); 8149 this.receiver = receiver; 8150 this.name = name; 8151 } 8152 visit(visitor, context = null) { 8153 return visitor.visitSafePropertyRead(this, context); 8154 } 8155} 8156class KeyedRead extends AST { 8157 constructor(span, sourceSpan, receiver, key) { 8158 super(span, sourceSpan); 8159 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "receiver", void 0); 8160 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "key", void 0); 8161 this.receiver = receiver; 8162 this.key = key; 8163 } 8164 visit(visitor, context = null) { 8165 return visitor.visitKeyedRead(this, context); 8166 } 8167} 8168class SafeKeyedRead extends AST { 8169 constructor(span, sourceSpan, receiver, key) { 8170 super(span, sourceSpan); 8171 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "receiver", void 0); 8172 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "key", void 0); 8173 this.receiver = receiver; 8174 this.key = key; 8175 } 8176 visit(visitor, context = null) { 8177 return visitor.visitSafeKeyedRead(this, context); 8178 } 8179} 8180class KeyedWrite extends AST { 8181 constructor(span, sourceSpan, receiver, key, value) { 8182 super(span, sourceSpan); 8183 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "receiver", void 0); 8184 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "key", void 0); 8185 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "value", void 0); 8186 this.receiver = receiver; 8187 this.key = key; 8188 this.value = value; 8189 } 8190 visit(visitor, context = null) { 8191 return visitor.visitKeyedWrite(this, context); 8192 } 8193} 8194class BindingPipe extends ASTWithName { 8195 constructor(span, sourceSpan, exp, name, args, nameSpan) { 8196 super(span, sourceSpan, nameSpan); 8197 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "exp", void 0); 8198 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "name", void 0); 8199 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "args", void 0); 8200 this.exp = exp; 8201 this.name = name; 8202 this.args = args; 8203 } 8204 visit(visitor, context = null) { 8205 return visitor.visitPipe(this, context); 8206 } 8207} 8208class LiteralPrimitive extends AST { 8209 constructor(span, sourceSpan, value) { 8210 super(span, sourceSpan); 8211 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "value", void 0); 8212 this.value = value; 8213 } 8214 visit(visitor, context = null) { 8215 return visitor.visitLiteralPrimitive(this, context); 8216 } 8217} 8218class LiteralArray extends AST { 8219 constructor(span, sourceSpan, expressions) { 8220 super(span, sourceSpan); 8221 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "expressions", void 0); 8222 this.expressions = expressions; 8223 } 8224 visit(visitor, context = null) { 8225 return visitor.visitLiteralArray(this, context); 8226 } 8227} 8228class LiteralMap extends AST { 8229 constructor(span, sourceSpan, keys, values) { 8230 super(span, sourceSpan); 8231 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "keys", void 0); 8232 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "values", void 0); 8233 this.keys = keys; 8234 this.values = values; 8235 } 8236 visit(visitor, context = null) { 8237 return visitor.visitLiteralMap(this, context); 8238 } 8239} 8240let Interpolation$1 = class Interpolation extends AST { 8241 constructor(span, sourceSpan, strings, expressions) { 8242 super(span, sourceSpan); 8243 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "strings", void 0); 8244 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__
8244WEBPACK_IMPORTED_MODULE_1__["default"])(this, "expressions", void 0); 8245 this.strings = strings; 8246 this.expressions = expressions; 8247 } 8248 visit(visitor, context = null) { 8249 return visitor.visitInterpolation(this, context); 8250 } 8251}; 8252class Binary extends AST { 8253 constructor(span, sourceSpan, operation, left, right) { 8254 super(span, sourceSpan); 8255 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "operation", void 0); 8256 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "left", void 0); 8257 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "right", void 0); 8258 this.operation = operation; 8259 this.left = left; 8260 this.right = right; 8261 } 8262 visit(visitor, context = null) { 8263 return visitor.visitBinary(this, context); 8264 } 8265} 8266/** 8267 * For backwards compatibility reasons, `Unary` inherits from `Binary` and mimics the binary AST 8268 * node that was originally used. This inheritance relation can be deleted in some future major, 8269 * after consumers have been given a chance to fully support Unary. 8270 */ 8271class Unary extends Binary { 8272 /** 8273 * Creates a unary minus expression "-x", represented as `Binary` using "0 - x". 8274 */ 8275 static createMinus(span, sourceSpan, expr) { 8276 return new Unary(span, sourceSpan, '-', expr, '-', new LiteralPrimitive(span, sourceSpan, 0), expr); 8277 } 8278 /** 8279 * Creates a unary plus expression "+x", represented as `Binary` using "x - 0". 8280 */ 8281 static createPlus(span, sourceSpan, expr) { 8282 return new Unary(span, sourceSpan, '+', expr, '-', expr, new LiteralPrimitive(span, sourceSpan, 0)); 8283 } 8284 /** 8285 * During the deprecation period this constructor is private, to avoid consumers from creating 8286 * a `Unary` with the fallback properties for `Binary`. 8287 */ 8288 constructor(span, sourceSpan, operator, expr, binaryOp, binaryLeft, binaryRight) { 8289 super(span, sourceSpan, binaryOp, binaryLeft, binaryRight); 8290 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "operator", void 0); 8291 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "expr", void 0); 8292 // Redeclare the properties that are inherited from `Binary` as `never`, as consumers should not 8293 // depend on these fields when operating on `Unary`. 8294 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "left", null); 8295 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "right", null); 8296 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "operation", null); 8297 this.operator = operator; 8298 this.expr = expr; 8299 } 8300 visit(visitor, context = null) { 8301 if (visitor.visitUnary !== undefined) { 8302 return visitor.visitUnary(this, context); 8303 } 8304 return visitor.visitBinary(this, context); 8305 } 8306} 8307class PrefixNot extends AST { 8308 constructor(span, sourceSpan, expression) { 8309 super(span, sourceSpan); 8310 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "expression", void 0); 8311 this.expression = expression; 8312 } 8313 visit(visitor, context = null) { 8314 return visitor.visitPrefixNot(this, context); 8315 } 8316} 8317class TypeofExpression extends AST { 8318 constructor(span, sourceSpan, expression) { 8319 super(span, sourceSpan); 8320 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "expression", void 0); 8321 this.expression = expression; 8322 } 8323 visit(visitor, context = null) { 8324 return visitor.visitTypeofExpression(this, context); 8325 } 8326} 8327class NonNullAssert extends AST { 8328 constructor(span, sourceSpan, expression) { 8329 super(span, sourceSpan); 8330 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "expression", void 0); 8331 this.expression = expression; 8332 } 8333 visit(visitor, context = null) { 8334 return visitor.visitNonNullAssert(this, context); 8335 } 8336} 8337class Call extends AST { 8338 constructor(span, sourceSpan, receiver, args, argumentSpan) { 8339 super(span, sourceSpan); 8340 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "receiver", void 0); 8341 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "args", void 0); 8342 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "argumentSpan", void 0); 8343 this.receiver = receiver; 8344 this.args = args; 8345 this.argumentSpan = argumentSpan; 8346 } 8347 visit(visitor, context = null) { 8348 return visitor.visitCall(this, context); 8349 } 8350} 8351class SafeCall extends AST { 8352 constructor(span, sourceSpan, receiver, args, argumentSpan) { 8353 super(span, sourceSpan); 8354 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "receiver", void 0); 8355 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "args", void 0); 8356 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "argumentSpan", void 0); 8357 this.receiver = receiver; 8358 this.args = args; 8359 this.argumentSpan = argumentSpan; 8360 } 8361 visit(visitor, context = null) { 8362 return visitor.visitSafeCall(this, context); 8363 } 8364} 8365class TemplateLiteral extends AST { 8366 constructor(span, sourceSpan, elements, expressions) { 8367 super(span, sourceSpan); 8368 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "elements", void 0); 8369 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "expressions", void 0); 8370 this.elements = elements; 8371 this.expressions = expressions; 8372 } 8373 visit(visitor, context) { 8374 return visitor.visitTemplateLiteral(this, context); 8375 } 8376} 8377class TemplateLiteralElement extends AST { 8378 constructor(span, sourceSpan, text) { 8379 super(span, sourceSpan); 8380 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "text", void 0); 8381 this.text = text; 8382 } 8383 visit(visitor, context) { 8384 return visitor.visitTemplateLiteralElement(this, context); 8385 } 8386} 8387/** 8388 * Records the absolute position of a text span in a source file, where `start` and `end` are the 8389 * starting and ending byte offsets, respectively, of the text span in a source file. 8390 */ 8391class AbsoluteSourceSpan { 8392 constructor(start, end) { 8393 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "start", void 0); 8394 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "end", void 0); 8395 this.start = start; 8396 this.end = end; 8397 } 8398} 8399class ASTWithSource extends AST { 8400 constructor(ast, source, location, absoluteOffset, errors) { 8401 super(new ParseSpan(0, source === null ? 0 : source.length), new AbsoluteSourceSpan(absoluteOffset, source === null ? absoluteOffset : absoluteOffset + source.length)); 8402 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "ast", void 0); 8403 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "source", void 0); 8404 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "location", void 0); 8405 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "errors", void 0); 8406 this.ast = ast; 8407 this.source = source; 8408 this.location = location; 8409 this.errors = errors; 8410 } 8411 visit(visitor, context = null) { 8412 if (visitor.visitASTWithSource) { 8413 return visitor.visitASTWithSource(this, context); 8414 } 8415 return this.ast.visit(visitor, context); 8416 } 8417 toString() { 8418 return `${this.source} in ${this.location}`; 8419 } 8420} 8421class VariableBinding { 8422 /** 8423 * @param sourceSpan entire span of the binding. 8424 * @param key name of the LHS along with its span. 8425 * @param value optional value for the RHS along with its span. 8426 */ 8427 constructor(sourceSpan, key, value) { 8428 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "sourceSpan", void 0); 8429 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "key", void 0); 8430 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "value", void 0); 8431 this.sourceSpan = sourceSpan; 8432 this.key = key; 8433 this.value = value; 8434 } 8435} 8436class ExpressionBinding { 8437 /** 8438 * @param sourceSpan entire span of the binding. 8439 * @param key binding name, like ngForOf, ngForTrackBy, ngIf, along with its 8440 * span. Note that the length of the span may not be the same as 8441 * `key.source.length`. For example,
8442 * 1. key.source = ngFor, key.span is for "ngFor" 8443 * 2. key.source = ngForOf, key.span is for "of" 8444 * 3. key.source = ngForTrackBy, key.span is for "trackBy" 8445 * @param value optional expression for the RHS. 8446 */ 8447 constructor(sourceSpan, key, value) { 8448 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "sourceSpan", void 0); 8449 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "key", void 0); 8450 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "value", void 0); 8451 this.sourceSpan = sourceSpan; 8452 this.key = key; 8453 this.value = value; 8454 } 8455} 8456class RecursiveAstVisitor { 8457 visit(ast, context) { 8458 // The default implementation just visits every node. 8459 // Classes that extend RecursiveAstVisitor should override this function 8460 // to selectively visit the specified node. 8461 ast.visit(this, context); 8462 } 8463 visitUnary(ast, context) { 8464 this.visit(ast.expr, context); 8465 } 8466 visitBinary(ast, context) { 8467 this.visit(ast.left, context); 8468 this.visit(ast.right, context); 8469 } 8470 visitChain(ast, context) { 8471 this.visitAll(ast.expressions, context); 8472 } 8473 visitConditional(ast, context) { 8474 this.visit(ast.condition, context); 8475 this.visit(ast.trueExp, context); 8476 this.visit(ast.falseExp, context); 8477 } 8478 visitPipe(ast, context) { 8479 this.visit(ast.exp, context); 8480 this.visitAll(ast.args, context); 8481 } 8482 visitImplicitReceiver(ast, context) {} 8483 visitThisReceiver(ast, context) {} 8484 visitInterpolation(ast, context) { 8485 this.visitAll(ast.expressions, context); 8486 } 8487 visitKeyedRead(ast, context) { 8488 this.visit(ast.receiver, context); 8489 this.visit(ast.key, context); 8490 } 8491 visitKeyedWrite(ast, context) { 8492 this.visit(ast.receiver, context); 8493 this.visit(ast.key, context); 8494 this.visit(ast.value, context); 8495 } 8496 visitLiteralArray(ast, context) { 8497 this.visitAll(ast.expressions, context); 8498 } 8499 visitLiteralMap(ast, context) { 8500 this.visitAll(ast.values, context); 8501 } 8502 visitLiteralPrimitive(ast, context) {} 8503 visitPrefixNot(ast, context) { 8504 this.visit(ast.expression, context); 8505 } 8506 visitTypeofExpression(ast, context) { 8507 this.visit(ast.expression, context); 8508 } 8509 visitNonNullAssert(ast, context) { 8510 this.visit(ast.expression, context); 8511 } 8512 visitPropertyRead(ast, context) { 8513 this.visit(ast.receiver, context); 8514 } 8515 visitPropertyWrite(ast, context) { 8516 this.visit(ast.receiver, context); 8517 this.visit(ast.value, context); 8518 } 8519 visitSafePropertyRead(ast, context) { 8520 this.visit(ast.receiver, context); 8521 } 8522 visitSafeKeyedRead(ast, context) { 8523 this.visit(ast.receiver, context); 8524 this.visit(ast.key, context); 8525 } 8526 visitCall(ast, context) { 8527 this.visit(ast.receiver, context); 8528 this.visitAll(ast.args, context); 8529 } 8530 visitSafeCall(ast, context) { 8531 this.visit(ast.receiver, context); 8532 this.visitAll(ast.args, context); 8533 } 8534 visitTemplateLiteral(ast, context) { 8535 // Iterate in the declaration order. Note that there will 8536 // always be one expression less than the number of elements. 8537 for (let i = 0; i < ast.elements.length; i++) { 8538 this.visit(ast.elements[i], context); 8539 const expression = i < ast.expressions.length ? ast.expressions[i] : null; 8540 if (expression !== null) { 8541 this.visit(expression, context); 8542 } 8543 } 8544 } 8545 visitTemplateLiteralElement(ast, context) {} 8546 // This is not part of the AstVisitor interface, just a helper method 8547 visitAll(asts, context) { 8548 for (const ast of asts) { 8549 this.visit(ast, context); 8550 } 8551 } 8552} 8553// Bindings 8554class ParsedProperty { 8555 constructor(name, expression, type, sourceSpan, keySpan, valueSpan) { 8556 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "name", void 0); 8557 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "expression", void 0); 8558 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "type", void 0); 8559 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "sourceSpan", void 0); 8560 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "keySpan", void 0); 8561 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "valueSpan", void 0); 8562 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "isLiteral", void 0); 8563 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "isAnimation", void 0); 8564 this.name = name; 8565 this.expression = expression; 8566 this.type = type; 8567 this.sourceSpan = sourceSpan; 8568 this.keySpan = keySpan; 8569 this.valueSpan = valueSpan; 8570 this.isLiteral = this.type === ParsedPropertyType.LITERAL_ATTR; 8571 this.isAnimation = this.type === ParsedPropertyType.ANIMATION; 8572 } 8573} 8574var ParsedPropertyType = /*#__PURE__*/function (ParsedPropertyType) { 8575 ParsedPropertyType[ParsedPropertyType["DEFAULT"] = 0] = "DEFAULT"; 8576 ParsedPropertyType[ParsedPropertyType["LITERAL_ATTR"] = 1] = "LITERAL_ATTR"; 8577 ParsedPropertyType[ParsedPropertyType["ANIMATION"] = 2] = "ANIMATION"; 8578 ParsedPropertyType[ParsedPropertyType["TWO_WAY"] = 3] = "TWO_WAY"; 8579 return ParsedPropertyType; 8580}(ParsedPropertyType || {}); 8581var ParsedEventType = /*#__PURE__*/function (ParsedEventType) { 8582 // DOM or Directive event 8583 ParsedEventType[ParsedEventType["Regular"] = 0] = "Regular"; 8584 // Animation specific event 8585 ParsedEventType[ParsedEventType["Animation"] = 1] = "Animation"; 8586 // Event side of a two-way binding (e.g. `[(property)]="expression"`). 8587 ParsedEventType[ParsedEventType["TwoWay"] = 2] = "TwoWay"; 8588 return ParsedEventType; 8589}(ParsedEventType || {}); 8590class ParsedEvent { 8591 constructor(name, targetOrPhase, type, handler, sourceSpan, handlerSpan, keySpan) { 8592 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "name", void 0); 8593 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "targetOrPhase", void 0); 8594 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "type", void 0); 8595 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "handler", void 0); 8596 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "sourceSpan", void 0); 8597 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "handlerSpan", void 0); 8598 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "keySpan", void 0); 8599 this.name = name; 8600 this.targetOrPhase = targetOrPhase; 8601 this.type = type; 8602 this.handler = handler; 8603 this.sourceSpan = sourceSpan; 8604 this.handlerSpan = handlerSpan; 8605 this.keySpan = keySpan; 8606 } 8607} 8608/** 8609 * ParsedVariable represents a variable declaration in a microsyntax expression. 8610 */ 8611class ParsedVariable { 8612 constructor(name, value, sourceSpan, keySpan, valueSpan) { 8613 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "name", void 0); 8614 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "value", void 0); 8615 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "sourceSpan", void 0); 8616 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "keySpan", void 0); 8617 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "valueSpan", void 0); 8618 this.name = name; 8619 this.value = value; 8620 this.sourceSpan = sourceSpan; 8621 this.keySpan = keySpan; 8622 this.valueSpan = valueSpan; 8623 } 8624} 8625var BindingType = /*#__PURE__*/function (BindingType) { 8626 // A regular binding to a property (e.g. `[property]="expression"`). 8627 BindingType[BindingType["Property"] = 0] = "Property"; 8628 // A binding to an element attribute (e.g. `[attr.name]="expression"`). 8629 BindingType[BindingType["Attribute"] = 1] = "Attribute"; 8630 // A binding to a CSS class (e.g. `[class.name]="condition"`). 8631 BindingType[BindingType["Class"] = 2] = "Class"; 8632 // A binding to a style rule (e.g. `[style.rule]="expression"`). 8633 BindingType[BindingType["Style"] = 3] = "Style"; 8634 // A binding to an animation reference (e.g. `[animate.key]="expression"`). 8635 BindingType[BindingType["Animation"] = 4] = "Animation"; 8636 // Property side of a two-way binding (e.g. `[(property)]="expression"`). 8637 BindingType[BindingType["TwoWay"] = 5] = "TwoWay"; 8638 return BindingType; 8639}(BindingType || {}); 8640class BoundElementProperty { 8641 constructor(name, type, securityContext, value, unit, sourceSpan, keySpan, valueSpan) { 8642 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "name", void 0); 8643 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "type", void 0); 8644 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "securityContext", void 0); 8645 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "value", void 0); 8646 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "unit", void 0); 8647 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "sourceSpan", void 0); 8648 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "keySpan", void 0); 8649 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "valueSpan", void 0); 8650 this.name = name; 8651 this.type = type; 8652 this.securityContext = securityContext; 8653 this.value = value; 8654 this.unit = unit; 8655 this.sourceSpan = sourceSpan; 8656 this.keySpan = keySpan; 8657 this.valueSpan = valueSpan; 8658 } 8659} 8660var TagContentType = /*#__PURE__*/function (TagContentType) { 8661 TagContentType[TagContentType["RAW_TEXT"] = 0] = "RAW_TEXT"; 8662 TagContentType[TagContentType["ESCAPABLE_RAW_TEXT"] = 1] = "ESCAPABLE_RAW_TEXT"; 8663 TagContentType[TagContentType["PARSABLE_DATA"] = 2] = "PARSABLE_DATA"; 8664 return TagContentType; 8665}(TagContentType || {}); 8666function splitNsName(elementName, fatal = true) { 8667 if (elementName[0] != ':') { 8668 return [null, elementName]; 8669 } 8670 const colonIndex = elementName.indexOf(':', 1); 8671 if (colonIndex === -1) { 8672 if (fatal) { 8673 throw new Error(`Unsupported format "${elementName}" expecting ":namespace:name"`); 8674 } else { 8675 return [null, elementName]; 8676 } 8677 } 8678 return [elementName.slice(1, colonIndex), elementName.slice(colonIndex + 1)]; 8679} 8680// `<ng-container>` tags work the same regardless the namespace 8681function isNgContainer(tagName) { 8682 return splitNsName(tagName)[1] === 'ng-container'; 8683} 8684// `<ng-content>` tags work the same regardless the namespace 8685function isNgContent(tagName) { 8686 return splitNsName(tagName)[1] === 'ng-content'; 8687} 8688// `<ng-template>` tags work the same regardless the namespace 8689function isNgTemplate(tagName) { 8690 return splitNsName(tagName)[1] === 'ng-template'; 8691} 8692function getNsPrefix(fullName) { 8693 return fullName === null ? null : splitNsName(fullName)[0]; 8694} 8695function mergeNsAndName(prefix, localName) { 8696 return prefix ? `:${prefix}:${localName}` : localName; 8697} 8698
8699/** 8700 * This is an R3 `Node`-like wrapper for a raw `html.Comment` node. We do not currently 8701 * require the implementation of a visitor for Comments as they are only collected at 8702 * the top-level of the R3 AST, and only if `Render3ParseOptions['collectCommentNodes']` 8703 * is true. 8704 */ 8705let Comment$1 = class Comment { 8706 constructor(value, sourceSpan) { 8707 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "value", void 0); 8708 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "sourceSpan", void 0); 8709 this.value = value; 8710 this.sourceSpan = sourceSpan; 8711 } 8712 visit(_visitor) { 8713 throw new Error('visit() not implemented for Comment'); 8714 } 8715}; 8716let Text$3 = class Text { 8717 constructor(value, sourceSpan) { 8718 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "value", void 0); 8719 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "sourceSpan", void 0); 8720 this.value = value; 8721 this.sourceSpan = sourceSpan; 8722 } 8723 visit(visitor) { 8724 return visitor.visitText(this); 8725 } 8726}; 8727class BoundText { 8728 constructor(value, sourceSpan, i18n) { 8729 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "value", void 0); 8730 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "sourceSpan", void 0); 8731 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "i18n", void 0); 8732 this.value = value; 8733 this.sourceSpan = sourceSpan; 8734 this.i18n = i18n; 8735 } 8736 visit(visitor) { 8737 return visitor.visitBoundText(this); 8738 } 8739} 8740/** 8741 * Represents a text attribute in the template. 8742 * 8743 * `valueSpan` may not be present in cases where there is no value `<div a></div>`. 8744 * `keySpan` may also not be present for synthetic attributes from ICU expansions. 8745 */ 8746class TextAttribute { 8747 constructor(name, value, sourceSpan, keySpan, valueSpan, i18n) { 8748 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "name", void 0); 8749 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "value", void 0); 8750 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "sourceSpan", void 0); 8751 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "keySpan", void 0); 8752 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "valueSpan", void 0); 8753 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "i18n", void 0); 8754 this.name = name; 8755 this.value = value; 8756 this.sourceSpan = sourceSpan; 8757 this.keySpan = keySpan; 8758 this.valueSpan = valueSpan; 8759 this.i18n = i18n; 8760 } 8761 visit(visitor) { 8762 return visitor.visitTextAttribute(this); 8763 } 8764} 8765class BoundAttribute { 8766 constructor(name, type, securityContext, value, unit, sourceSpan, keySpan, valueSpan, i18n) { 8767 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "name", void 0); 8768 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "type", void 0); 8769 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "securityContext", void 0); 8770 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "value", void 0); 8771 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "unit", void 0); 8772 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "sourceSpan", void 0); 8773 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "keySpan", void 0); 8774 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "valueSpan", void 0); 8775 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "i18n", void 0); 8776 this.name = name; 8777 this.type = type; 8778 this.securityContext = securityContext; 8779 this.value = value; 8780 this.unit = unit; 8781 this.sourceSpan = sourceSpan; 8782 this.keySpan = keySpan; 8783 this.valueSpan = valueSpan; 8784 this.i18n = i18n; 8785 } 8786 static fromBoundElementProperty(prop, i18n) {
8787 if (prop.keySpan === undefined) { 8788 throw new Error(`Unexpected state: keySpan must be defined for bound attributes but was not for ${prop.name}: ${prop.sourceSpan}`); 8789 } 8790 return new BoundAttribute(prop.name, prop.type, prop.securityContext, prop.value, prop.unit, prop.sourceSpan, prop.keySpan, prop.valueSpan, i18n); 8791 } 8792 visit(visitor) { 8793 return visitor.visitBoundAttribute(this); 8794 } 8795} 8796class BoundEvent { 8797 constructor(name, type, handler, target, phase, sourceSpan, handlerSpan, keySpan) { 8798 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "name", void 0); 8799 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "type", void 0); 8800 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "handler", void 0); 8801 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "target", void 0); 8802 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "phase", void 0); 8803 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "sourceSpan", void 0); 8804 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "handlerSpan", void 0); 8805 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "keySpan", void 0); 8806 this.name = name; 8807 this.type = type; 8808 this.handler = handler; 8809 this.target = target; 8810 this.phase = phase; 8811 this.sourceSpan = sourceSpan; 8812 this.handlerSpan = handlerSpan; 8813 this.keySpan = keySpan; 8814 } 8815 static fromParsedEvent(event) { 8816 const target = event.type === ParsedEventType.Regular ? event.targetOrPhase : null; 8817 const phase = event.type === ParsedEventType.Animation ? event.targetOrPhase : null; 8818 if (event.keySpan === undefined) { 8819 throw new Error(`Unexpected state: keySpan must be defined for bound event but was not for ${event.name}: ${event.sourceSpan}`); 8820 } 8821 return new BoundEvent(event.name, event.type, event.handler, target, phase, event.sourceSpan, event.handlerSpan, event.keySpan); 8822 } 8823 visit(visitor) { 8824 return visitor.visitBoundEvent(this); 8825 } 8826} 8827let Element$1 = class Element { 8828 constructor(name, attributes, inputs, outputs, children, references, sourceSpan, startSourceSpan, endSourceSpan, i18n) { 8829 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "name", void 0); 8830 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "attributes", void 0); 8831 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "inputs", void 0); 8832 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "outputs", void 0); 8833 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "children", void 0); 8834 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "references", void 0); 8835 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "sourceSpan", void 0); 8836 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "startSourceSpan", void 0); 8837 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "endSourceSpan", void 0); 8838 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "i18n", void 0); 8839 this.name = name; 8840 this.attributes = attributes;
8841 this.inputs = inputs; 8842 this.outputs = outputs; 8843 this.children = children; 8844 this.references = references; 8845 this.sourceSpan = sourceSpan; 8846 this.startSourceSpan = startSourceSpan; 8847 this.endSourceSpan = endSourceSpan; 8848 this.i18n = i18n; 8849 } 8850 visit(visitor) { 8851 return visitor.visitElement(this); 8852 } 8853}; 8854class DeferredTrigger { 8855 constructor(nameSpan, sourceSpan, prefetchSpan, whenOrOnSourceSpan, hydrateSpan) { 8856 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "nameSpan", void 0); 8857 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "sourceSpan", void 0); 8858 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "prefetchSpan", void 0); 8859 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "whenOrOnSourceSpan", void 0); 8860 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "hydrateSpan", void 0); 8861 this.nameSpan = nameSpan; 8862 this.sourceSpan = sourceSpan; 8863 this.prefetchSpan = prefetchSpan; 8864 this.whenOrOnSourceSpan = whenOrOnSourceSpan; 8865 this.hydrateSpan = hydrateSpan; 8866 } 8867 visit(visitor) { 8868 return visitor.visitDeferredTrigger(this); 8869 } 8870} 8871class BoundDeferredTrigger extends DeferredTrigger { 8872 constructor(value, sourceSpan, prefetchSpan, whenSourceSpan, hydrateSpan) { 8873 // BoundDeferredTrigger is for 'when' triggers. These aren't really "triggers" and don't have a 8874 // nameSpan. Trigger names are the built in event triggers like hover, interaction, etc. 8875 super(/** nameSpan */null, sourceSpan, prefetchSpan, whenSourceSpan, hydrateSpan); 8876 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "value", void 0); 8877 this.value = value; 8878 } 8879} 8880class NeverDeferredTrigger extends DeferredTrigger {} 8881class IdleDeferredTrigger extends DeferredTrigger {} 8882class ImmediateDeferredTrigger extends DeferredTrigger {} 8883class HoverDeferredTrigger extends DeferredTrigger { 8884 constructor(reference, nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan) { 8885 super(nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan); 8886 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "reference", void 0); 8887 this.reference = reference; 8888 } 8889} 8890class TimerDeferredTrigger extends DeferredTrigger { 8891 constructor(delay, nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan) { 8892 super(nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan); 8893 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "delay", void 0); 8894 this.delay = delay; 8895 } 8896} 8897class InteractionDeferredTrigger extends DeferredTrigger { 8898 constructor(reference, nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan) { 8899 super(nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan); 8900 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "reference", void 0); 8901 this.reference = reference; 8902 } 8903} 8904class ViewportDeferredTrigger extends DeferredTrigger { 8905 constructor(reference, nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan) { 8906 super(nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan); 8907 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "reference", void 0); 8908 this.reference = reference; 8909 } 8910} 8911class BlockNode { 8912 constructor(nameSpan, sourceSpan, startSourceSpan, endSourceSpan) { 8913 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "nameSpan", void 0); 8914 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "sourceSpan", void 0); 8915 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "startSourceSpan", void 0); 8916 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "endSourceSpan", void 0); 8917 this.nameSpan = nameSpan; 8918 this.sourceSpan = sourceSpan; 8919 this.startSourceSpan = startSourceSpan; 8920 this.endSourceSpan = endSourceSpan; 8921 } 8922} 8923class DeferredBlockPlaceholder extends BlockNode { 8924 constructor(children, minimumTime, nameSpan, sourceSpan, startSourceSpan, endSourceSpan, i18n) { 8925 super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan); 8926 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "children", void 0); 8927 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "minimumTime", void 0); 8928 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "i18n", void 0); 8929 this.children = children; 8930 this.minimumTime = minimumTime; 8931 this.i18n = i18n; 8932 } 8933 visit(visitor) { 8934 return visitor.visitDeferredBlockPlaceholder(this); 8935 } 8936} 8937class DeferredBlockLoading extends BlockNode { 8938 constructor(children, afterTime, minimumTime, nameSpan, sourceSpan, startSourceSpan, endSourceSpan, i18n) { 8939 super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan); 8940 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "children", void 0); 8941 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "afterTime", void 0); 8942 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "minimumTime", void 0); 8943 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "i18n", void 0); 8944 this.children = children; 8945 this.afterTime = afterTime; 8946 this.minimumTime = minimumTime; 8947 this.i18n = i18n; 8948 } 8949 visit(visitor) { 8950 return visitor.visitDeferredBlockLoading(this); 8951 } 8952} 8953class DeferredBlockError extends BlockNode { 8954 constructor(children, nameSpan, sourceSpan, startSourceSpan, endSourceSpan, i18n) { 8955 super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan); 8956 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "children", void 0); 8957 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "i18n", void 0); 8958 this.children = children; 8959 this.i18n = i18n; 8960 } 8961 visit(visitor) { 8962 return visitor.visitDeferredBlockError(this); 8963 } 8964} 8965class DeferredBlock extends BlockNode { 8966 constructor(children, triggers, prefetchTriggers, hydrateTriggers, placeholder, loading, error, nameSpan, sourceSpan, mainBlockSpan, startSourceSpan, endSourceSpan, i18n) { 8967 super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan); 8968 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "children", void 0); 8969 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "placeholder", void 0); 8970 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "loading", void 0); 8971 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "error", void 0); 8972 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "mainBlockSpan", void 0); 8973 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "i18n", void 0); 8974 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "triggers", void 0); 8975 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "prefetchTriggers", void 0); 8976 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "hydrateTriggers", void 0); 8977 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "definedTriggers", void 0); 8978 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "definedPrefetchTriggers", void 0); 8979 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "definedHydrateTriggers", void 0); 8980 this.children = children; 8981 this.placeholder = placeholder; 8982 this.loading = loading; 8983 this.error = error; 8984 this.mainBlockSpan = mainBlockSpan; 8985 this.i18n = i18n; 8986 this.triggers = triggers; 8987 this.prefetchTriggers = prefetchTriggers; 8988 this.hydrateTriggers = hydrateTriggers; 8989 // We cache the keys since we know that they won't change and we 8990 // don't want to enumarate them every time we're traversing the AST. 8991 this.definedTriggers = Object.keys(triggers); 8992 this.definedPrefetchTriggers = Object.keys(prefetchTriggers); 8993 this.definedHydrateTriggers = Object.keys(hydrateTriggers); 8994 } 8995 visit(visitor) { 8996 return visitor.visitDeferredBlock(this); 8997 } 8998 visitAll(visitor) { 8999 // Visit the hydrate triggers first to match their insertion order. 9000 this.visitTriggers(this.definedHydrateTriggers, this.hydrateTriggers, visitor); 9001 this.visitTriggers(this.definedTriggers, this.triggers, visitor); 9002 this.visitTriggers(this.definedPrefetchTriggers, this.prefetchTriggers, visitor); 9003 visitAll$1(visitor, this.children); 9004 const remainingBlocks = [this.placeholder, this.loading, this.error].filter(x => x !== null); 9005 visitAll$1(visitor, remainingBlocks); 9006 } 9007 visitTriggers(keys, triggers, visitor) { 9008 visitAll$1(visitor, keys.map(k => triggers[k])); 9009 } 9010} 9011class SwitchBlock extends BlockNode { 9012 constructor(expression, cases, 9013 /** 9014 * These blocks are only captured to allow for autocompletion in the language service. They 9015 * aren't meant to be processed in any other way. 9016 */ 9017 unknownBlocks, sourceSpan, startSourceSpan, endSourceSpan, nameSpan) { 9018 super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan); 9019 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "expression", void 0); 9020 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "cases", void 0); 9021 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "unknownBlocks", void 0); 9022 this.expression = expression; 9023 this.cases = cases; 9024 this.unknownBlocks = unknownBlocks; 9025 } 9026 visit(visitor) { 9027 return visitor.visitSwitchBlock(this); 9028 } 9029} 9030class SwitchBlockCase extends BlockNode { 9031 constructor(expression, children, sourceSpan, startSourceSpan, endSourceSpan, nameSpan, i18n) { 9032 super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan); 9033 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "expression", void 0); 9034 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "children", void 0); 9035 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "i18n", void 0); 9036 this.expression = expression; 9037 this.children = children; 9038 this.i18n = i18n; 9039 } 9040 visit(visitor) { 9041 return visitor.visitSwitchBlockCase(this); 9042 } 9043} 9044class ForLoopBlock extends BlockNode { 9045 constructor(item, expression, trackBy, trackKeywordSpan, contextVariables, children, empty, sourceSpan, mainBlockSpan, startSourceSpan, endSourceSpan, nameSpan, i18n) { 9046 super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan); 9047 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "item", void 0); 9048 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "expression", void 0); 9049 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "trackBy", void 0); 9050 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "trackKeywordSpan", void 0); 9051 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "contextVariables", void 0); 9052 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "children", void 0); 9053 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "empty", void 0); 9054 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "mainBlockSpan", void 0); 9055 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "i18n", void 0); 9056 this.item = item; 9057 this.expression = expression; 9058 this.trackBy = trackBy; 9059 this.trackKeywordSpan = trackKeywordSpan; 9060 this.contextVariables = contextVariables; 9061 this.children = children; 9062 this.empty = empty; 9063 this.mainBlockSpan = mainBlockSpan; 9064 this.i18n = i18n; 9065 } 9066 visit(visitor) { 9067 return visitor.visitForLoopBlock(this); 9068 } 9069} 9070class ForLoopBlockEmpty extends BlockNode { 9071 constructor(children, sourceSpan, startSourceSpan, endSourceSpan, nameSpan, i18n) { 9072 super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan); 9073 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this
9073, "children", void 0); 9074 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "i18n", void 0); 9075 this.children = children; 9076 this.i18n = i18n; 9077 } 9078 visit(visitor) { 9079 return visitor.visitForLoopBlockEmpty(this); 9080 } 9081} 9082class IfBlock extends BlockNode { 9083 constructor(branches, sourceSpan, startSourceSpan, endSourceSpan, nameSpan) { 9084 super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan); 9085 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "branches", void 0); 9086 this.branches = branches; 9087 } 9088 visit(visitor) { 9089 return visitor.visitIfBlock(this); 9090 } 9091} 9092class IfBlockBranch extends BlockNode { 9093 constructor(expression, children, expressionAlias, sourceSpan, startSourceSpan, endSourceSpan, nameSpan, i18n) { 9094 super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan); 9095 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "expression", void 0); 9096 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "children", void 0); 9097 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "expressionAlias", void 0); 9098 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "i18n", void 0); 9099 this.expression = expression; 9100 this.children = children; 9101 this.expressionAlias = expressionAlias; 9102 this.i18n = i18n; 9103 } 9104 visit(visitor) { 9105 return visitor.visitIfBlockBranch(this); 9106 } 9107} 9108class UnknownBlock { 9109 constructor(name, sourceSpan, nameSpan) { 9110 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "name", void 0); 9111 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "sourceSpan", void 0); 9112 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "nameSpan", void 0); 9113 this.name = name; 9114 this.sourceSpan = sourceSpan; 9115 this.nameSpan = nameSpan; 9116 } 9117 visit(visitor) { 9118 return visitor.visitUnknownBlock(this); 9119 } 9120} 9121let LetDeclaration$1 = class LetDeclaration { 9122 constructor(name, value, sourceSpan, nameSpan, valueSpan) { 9123 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "name", void 0); 9124 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "value", void 0); 9125 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "sourceSpan", void 0); 9126 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "nameSpan", void 0); 9127 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "valueSpan", void 0); 9128 this.name = name; 9129 this.value = value; 9130 this.sourceSpan = sourceSpan; 9131 this.nameSpan = nameSpan; 9132 this.valueSpan = valueSpan; 9133 } 9134 visit(visitor) { 9135 return visitor.visitLetDeclaration(this); 9136 } 9137}; 9138class Template { 9139 constructor( 9140 // tagName is the name of the container element, if applicable. 9141 // `null` is a special case for when there is a structural directive on an `ng-template` so 9142 // the renderer can differentiate between the synthetic template and the one written in the 9143 // file. 9144 tagName, attributes, inputs, outputs, templateAttrs, children, references, variables, sourceSpan, startSourceSpan, endSourceSpan, i18n) { 9145 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "tagName", void 0); 9146 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "attributes", void 0); 9147 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "inputs", void 0); 9148 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "outputs", void 0); 9149 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "templateAttrs", void 0); 9150 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "children", void 0); 9151 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "references", void 0); 9152 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "variables", void 0); 9153 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "sourceSpan", void 0); 9154 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "startSourceSpan", void 0); 9155 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "endSourceSpan", void 0); 9156 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "i18n", void 0); 9157 this.tagName = tagName; 9158 this.attributes = attributes;
9159 this.inputs = inputs; 9160 this.outputs = outputs; 9161 this.templateAttrs = templateAttrs; 9162 this.children = children; 9163 this.references = references; 9164 this.variables = variables; 9165 this.sourceSpan = sourceSpan; 9166 this.startSourceSpan = startSourceSpan; 9167 this.endSourceSpan = endSourceSpan; 9168 this.i18n = i18n; 9169 } 9170 visit(visitor) { 9171 return visitor.visitTemplate(this); 9172 } 9173} 9174class Content { 9175 constructor(selector, attributes, children, sourceSpan, i18n) { 9176 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "selector", void 0); 9177 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "attributes", void 0); 9178 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "children", void 0); 9179 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "sourceSpan", void 0); 9180 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "i18n", void 0); 9181 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "name", 'ng-content'); 9182 this.selector = selector; 9183 this.attributes = attributes; 9184 this.children = children; 9185 this.sourceSpan = sourceSpan; 9186 this.i18n = i18n; 9187 } 9188 visit(visitor) { 9189 return visitor.visitContent(this); 9190 } 9191} 9192class Variable { 9193 constructor(name, value, sourceSpan, keySpan, valueSpan) { 9194 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "name", void 0); 9195 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "value", void 0); 9196 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "sourceSpan", void 0); 9197 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "keySpan", void 0); 9198 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "valueSpan", void 0); 9199 this.name = name; 9200 this.value = value; 9201 this.sourceSpan = sourceSpan; 9202 this.keySpan = keySpan; 9203 this.valueSpan = valueSpan; 9204 } 9205 visit(visitor) { 9206 return visitor.visitVariable(this); 9207 } 9208} 9209class Reference { 9210 constructor(name, value, sourceSpan, keySpan, valueSpan) { 9211 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "name", void 0); 9212 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "value", void 0); 9213 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "sourceSpan", void 0); 9214 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "keySpan", void 0); 9215 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "valueSpan", void 0); 9216 this.name = name; 9217 this.value = value; 9218 this.sourceSpan = sourceSpan; 9219 this.keySpan = keySpan; 9220 this.valueSpan = valueSpan; 9221 } 9222 visit(visitor) { 9223 return visitor.visitReference(this); 9224 } 9225} 9226let Icu$1 = class Icu { 9227 constructor(vars, placeholders, sourceSpan, i18n) { 9228 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "vars", void 0); 9229 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "placeholders", void 0); 9230 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "sourceSpan", void 0); 9231 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "i18n", void 0); 9232 this.vars = vars; 9233 this.placeholders = placeholders; 9234 this.sourceSpan = sourceSpan; 9235 this.i18n = i18n; 9236 } 9237 visit(visitor) { 9238 return visitor.visitIcu(this); 9239 } 9240}; 9241let RecursiveVisitor$1 = class RecursiveVisitor { 9242 visitElement(element) { 9243 visitAll$1(this, element.attributes); 9244 visitAll$1(this, element.inputs); 9245 visitAll$1(this, element.outputs); 9246 visitAll$1(this, element.children); 9247 visitAll$1(this, element.references); 9248 } 9249 visitTemplate(template) { 9250 visitAll$1(this, template.attributes); 9251 visitAll$1(this, template.inputs); 9252 visitAll$1(this, template.outputs); 9253 visitAll$1(this, template.children); 9254 visitAll$1(this, template.references); 9255 visitAll$1(this, template.variables); 9256 } 9257 visitDeferredBlock(deferred) { 9258 deferred.visitAll(this); 9259 } 9260 visitDeferredBlockPlaceholder(block) { 9261 visitAll$1(this, block.children); 9262 } 9263 visitDeferredBlockError(block) { 9264 visitAll$1(this, block.children); 9265 } 9266 visitDeferredBlockLoading(block) { 9267 visitAll$1(this, block.children); 9268 } 9269 visitSwitchBlock(block) { 9270 visitAll$1(this, block.cases); 9271 } 9272 visitSwitchBlockCase(block) { 9273 visitAll$1(this, block.children); 9274 } 9275 visitForLoopBlock(block) { 9276 const blockItems = [block.item, ...block.contextVariables, ...block.children]; 9277 block.empty && blockItems.push(block.empty); 9278 visitAll$1(this, blockItems); 9279 } 9280 visitForLoopBlockEmpty(block) { 9281 visitAll$1(this, block.children); 9282 } 9283 visitIfBlock(block) { 9284 visitAll$1(this, block.branches); 9285 } 9286 visitIfBlockBranch(block) { 9287 const blockItems = block.children; 9288 block.expressionAlias && blockItems.push(block.expressionAlias); 9289 visitAll$1(this, blockItems); 9290 } 9291 visitContent(content) { 9292 visitAll$1(this, content.children); 9293 } 9294 visitVariable(variable) {} 9295 visitReference(reference) {} 9296 visitTextAttribute(attribute) {} 9297 visitBoundAttribute(attribute) {} 9298 visitBoundEvent(attribute) {} 9299 visitText(text) {} 9300 visitBoundText(text) {} 9301 visitIcu(icu) {} 9302 visitDeferredTrigger(trigger) {} 9303 visitUnknownBlock(block) {} 9304 visitLetDeclaration(decl) {} 9305}; 9306function visitAll$1(visitor, nodes) { 9307 const result = []; 9308 if (visitor.visit) { 9309 for (const node of nodes) { 9310 visitor.visit(node) || node.visit(visitor); 9311 } 9312 } else { 9313 for (const node of nodes) { 9314 const newNode = node.visit(visitor); 9315 if (newNode) { 9316 result.push(newNode); 9317 } 9318 } 9319 } 9320 return result; 9321} 9322class Message { 9323 /** 9324 * @param nodes message AST 9325 * @param placeholders maps placeholder names to static content and their source spans 9326 * @param placeholderToMessage maps placeholder names to messages (used for nested ICU messages) 9327 * @param meaning 9328 * @param description 9329 * @param customId 9330 */ 9331 constructor(nodes, placeholders, placeholderToMessage, meaning, description, customId) { 9332 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "nodes", void 0); 9333 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "placeholders", void 0); 9334 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "placeholderToMessage", void 0); 9335 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "meaning", void 0); 9336 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "description", void 0); 9337 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "customId", void 0); 9338 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "sources", void 0); 9339 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "id", void 0); 9340 /** The ids to use if there are no custom id and if `i18nLegacyMessageIdFormat` is not empty */ 9341 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "legacyIds", []); 9342 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "messageString", void 0); 9343 this.nodes = nodes; 9344 this.placeholders = placeholders; 9345 this.placeholderToMessage = placeholderToMessage; 9346 this.meaning = meaning; 9347 this.description = description; 9348 this.customId = customId; 9349 this.id = this.customId; 9350 this.messageString = serializeMessage(this.nodes); 9351 if (nodes.length) { 9352 this.sources = [{ 9353 filePath: nodes[0].sourceSpan.start.file.url, 9354 startLine: nodes[0].sourceSpan.start.line + 1, 9355 startCol: nodes[0].sourceSpan.start.col + 1, 9356 endLine: nodes[nodes.length - 1].sourceSpan.end.line + 1, 9357 endCol: nodes[0].sourceSpan.start.col + 1 9358 }]; 9359 } else { 9360 this.sources = []; 9361 } 9362 } 9363} 9364let Text$2 = class Text { 9365 constructor(value, sourceSpan) { 9366 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "value", void 0); 9367 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "sourceSpan", void 0); 9368 this.value = value; 9369 this.sourceSpan = sourceSpan; 9370 } 9371 visit(visitor, context) { 9372 return visitor.visitText(this, context); 9373 } 9374}; 9375// TODO(vicb): do we really need this node (vs an array) ? 9376class Container { 9377 constructor(children, sourceSpan) { 9378 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "children", void 0); 9379 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "sourceSpan", void 0); 9380 this.children = children; 9381 this.sourceSpan = sourceSpan; 9382 } 9383 visit(visitor, context) { 9384 return visitor.visitContainer(this, context); 9385 } 9386} 9387class Icu { 9388 constructor(expression, type, cases, sourceSpan, expressionPlaceholder) { 9389 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "expression", void 0); 9390 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "type", void 0); 9391 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "cases", void 0); 9392 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "sourceSpan", void 0); 9393 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "expressionPlaceholder", void 0); 9394 this.expression = expression; 9395 this.type = type; 9396 this.cases = cases; 9397 this.sourceSpan = sourceSpan; 9398 this.expressionPlaceholder = expressionPlaceholder; 9399 } 9400 visit(visitor, context) { 9401 return visitor.visitIcu(this, context); 9402 } 9403} 9404class TagPlaceholder { 9405 constructor(tag, attrs, startName, closeName, children, isVoid, 9406 // TODO sourceSpan should cover all (we need a startSourceSpan and endSourceSpan) 9407 sourceSpan, startSourceSpan, endSourceSpan) { 9408 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "tag", void 0); 9409 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "attrs", void 0); 9410 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "startName", void 0); 9411 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "closeName", void 0); 9412 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "children", void 0); 9413 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "isVoid", void 0); 9414 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "sourceSpan", void 0); 9415 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "startSourceSpan", void 0); 9416 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "endSourceSpan", void 0); 9417 this.tag = tag; 9418 this.attrs = attrs; 9419 this.startName = startName; 9420 this.closeName = closeName; 9421 this.children = children; 9422 this.isVoid = isVoid; 9423 this.sourceSpan = sourceSpan; 9424 this.startSourceSpan = startSourceSpan; 9425 this.endSourceSpan = endSourceSpan; 9426 } 9427 visit(visitor, context) { 9428 return visitor.visitTagPlaceholder(this, context); 9429 } 9430} 9431class Placeholder { 9432 constructor(value, name, sourceSpan) { 9433 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "value", void 0); 9434 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "name", void 0); 9435 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "sourceSpan", void 0); 9436 this.value = value; 9437 this.name = name; 9438 this.sourceSpan = sourceSpan; 9439 } 9440 visit(visitor, context) { 9441 return visitor.visitPlaceholder(this, context); 9442 } 9443} 9444class IcuPlaceholder { 9445 constructor(value, name, sourceSpan) { 9446 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "value", void 0); 9447 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "name", void 0); 9448 (0,C_Build_Source_WebPortal_RC_Dev_Webs_Retail
9448Portal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "sourceSpan", void 0); 9449 /** Used to capture a message computed from a previous processing pass (see `setI18nRefs()`). */ 9450 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "previousMessage", void 0); 9451 this.value = value; 9452 this.name = name; 9453 this.sourceSpan = sourceSpan; 9454 } 9455 visit(visitor, context) { 9456 return visitor.visitIcuPlaceholder(this, context); 9457 } 9458} 9459class BlockPlaceholder { 9460 constructor(name, parameters, startName, closeName, children, sourceSpan, startSourceSpan, endSourceSpan) { 9461 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "name", void 0); 9462 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "parameters", void 0); 9463 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "startName", void 0); 9464 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "closeName", void 0); 9465 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "children", void 0); 9466 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "sourceSpan", void 0); 9467 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "startSourceSpan", void 0); 9468 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "endSourceSpan", void 0); 9469 this.name = name; 9470 this.parameters = parameters; 9471 this.startName = startName; 9472 this.closeName = closeName; 9473 this.children = children; 9474 this.sourceSpan = sourceSpan; 9475 this.startSourceSpan = startSourceSpan; 9476 this.endSourceSpan = endSourceSpan; 9477 } 9478 visit(visitor, context) { 9479 return visitor.visitBlockPlaceholder(this, context); 9480 } 9481} 9482// Clone the AST 9483class CloneVisitor { 9484 visitText(text, context) { 9485 return new Text$2(text.value, text.sourceSpan); 9486 } 9487 visitContainer(container, context) { 9488 const children = container.children.map(n => n.visit(this, context)); 9489 return new Container(children, container.sourceSpan); 9490 } 9491 visitIcu(icu, context) { 9492 const cases = {}; 9493 Object.keys(icu.cases).forEach(key => cases[key] = icu.cases[key].visit(this, context)); 9494 const msg = new Icu(icu.expression, icu.type, cases, icu.sourceSpan, icu.expressionPlaceholder); 9495 return msg; 9496 } 9497 visitTagPlaceholder(ph, context) { 9498 const children = ph.children.map(n => n.visit(this, context)); 9499 return new TagPlaceholder(ph.tag, ph.attrs, ph.startName, ph.closeName, children, ph.isVoid, ph.sourceSpan, ph.startSourceSpan, ph.endSourceSpan); 9500 } 9501 visitPlaceholder(ph, context) { 9502 return new Placeholder(ph.value, ph.name, ph.sourceSpan); 9503 } 9504 visitIcuPlaceholder(ph, context) { 9505 return new IcuPlaceholder(ph.value, ph.name, ph.sourceSpan); 9506 } 9507 visitBlockPlaceholder(ph, context) { 9508 const children = ph.children.map(n => n.visit(this, context)); 9509 return new BlockPlaceholder(ph.name, ph.parameters, ph.startName, ph.closeName, children, ph.sourceSpan, ph.startSourceSpan, ph.endSourceSpan); 9510 } 9511} 9512// Visit all the nodes recursively 9513class RecurseVisitor { 9514 visitText(text, context) {} 9515 visitContainer(container, context) { 9516 container.children.forEach(child => child.visit(this)); 9517 } 9518 visitIcu(icu, context) {
9519 Object.keys(icu.cases).forEach(k => { 9520 icu.cases[k].visit(this); 9521 }); 9522 } 9523 visitTagPlaceholder(ph, context) { 9524 ph.children.forEach(child => child.visit(this)); 9525 } 9526 visitPlaceholder(ph, context) {} 9527 visitIcuPlaceholder(ph, context) {} 9528 visitBlockPlaceholder(ph, context) { 9529 ph.children.forEach(child => child.visit(this)); 9530 } 9531} 9532/** 9533 * Serialize the message to the Localize backtick string format that would appear in compiled code. 9534 */ 9535function serializeMessage(messageNodes) { 9536 const visitor = new LocalizeMessageStringVisitor(); 9537 const str = messageNodes.map(n => n.visit(visitor)).join(''); 9538 return str; 9539} 9540class LocalizeMessageStringVisitor { 9541 visitText(text) { 9542 return text.value; 9543 } 9544 visitContainer(container) { 9545 return container.children.map(child => child.visit(this)).join(''); 9546 } 9547 visitIcu(icu) { 9548 const strCases = Object.keys(icu.cases).map(k => `${k} {${icu.cases[k].visit(this)}}`); 9549 return `{${icu.expressionPlaceholder}, ${icu.type}, ${strCases.join(' ')}}`; 9550 } 9551 visitTagPlaceholder(ph) { 9552 const children = ph.children.map(child => child.visit(this)).join(''); 9553 return `{$${ph.startName}}${children}{$${ph.closeName}}`; 9554 } 9555 visitPlaceholder(ph) { 9556 return `{$${ph.name}}`; 9557 } 9558 visitIcuPlaceholder(ph) { 9559 return `{$${ph.name}}`; 9560 } 9561 visitBlockPlaceholder(ph) { 9562 const children = ph.children.map(child => child.visit(this)).join(''); 9563 return `{$${ph.startName}}${children}{$${ph.closeName}}`; 9564 } 9565} 9566class Serializer { 9567 // Creates a name mapper, see `PlaceholderMapper` 9568 // Returning `null` means that no name mapping is used. 9569 createNameMapper(message) { 9570 return null; 9571 } 9572} 9573/** 9574 * A simple mapper that take a function to transform an internal name to a public name 9575 */ 9576class SimplePlaceholderMapper extends RecurseVisitor { 9577 // create a mapping from the message 9578 constructor(message, mapName) { 9579 super(); 9580 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "mapName", void 0); 9581 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "internalToPublic", {}); 9582 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "publicToNextId", {}); 9583 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "publicToInternal", {}); 9584 this.mapName = mapName; 9585 message.nodes.forEach(node => node.visit(this)); 9586 } 9587 toPublicName(internalName) { 9588 return this.internalToPublic.hasOwnProperty(internalName) ? this.internalToPublic[internalName] : null; 9589 } 9590 toInternalName(publicName) { 9591 return this.publicToInternal.hasOwnProperty(publicName) ? this.publicToInternal[publicName] : null; 9592 } 9593 visitText(text, context) { 9594 return null; 9595 } 9596 visitTagPlaceholder(ph, context) { 9597 this.visitPlaceholderName(ph.startName); 9598 super.visitTagPlaceholder(ph, context); 9599 this.visitPlaceholderName(ph.closeName); 9600 } 9601 visitPlaceholder(ph, context) { 9602 this.visitPlaceholderName(ph.name); 9603 } 9604 visitBlockPlaceholder(ph, context) { 9605 this.visitPlaceholderName(ph.startName); 9606 super.visitBlockPlaceholder(ph, context); 9607 this.visitPlaceholderName(ph.closeName); 9608 } 9609 visitIcuPlaceholder(ph, context) { 9610 this.visitPlaceholderName(ph.name); 9611 } 9612 // XMB placeholders could only contains A-Z, 0-9 and _ 9613 visitPlaceholderName(internalName) { 9614 if (!internalName || this.internalToPublic.hasOwnProperty(internalName)) { 9615 return; 9616 } 9617 let publicName = this.mapName(internalName); 9618 if (this.publicToInternal.hasOwnProperty(publicName)) { 9619 // Create a new XMB when it has already been used 9620 const nextId = this.publicToNextId[publicName]; 9621 this.publicToNextId[publicName] = nextId + 1; 9622 publicName = `${publicName}_${nextId}`; 9623 } else { 9624 this.publicToNextId[publicName] = 1; 9625 } 9626 this.internalToPublic[internalName] = publicName; 9627 this.publicToInternal[publicName] = internalName; 9628 } 9629} 9630let _Visitor$2 = class _Visitor { 9631 visitTag(tag) { 9632 const strAttrs = this._serializeAttributes(tag.attrs); 9633 if (tag.children.length == 0) { 9634 return `<${tag.name}${strAttrs}/>`; 9635 } 9636 const strChildren = tag.children.map(node =>
9636 node.visit(this)); 9637 return `<${tag.name}${strAttrs}>${strChildren.join('')}</${tag.name}>`; 9638 } 9639 visitText(text) { 9640 return text.value; 9641 } 9642 visitDeclaration(decl) { 9643 return `<?xml${this._serializeAttributes(decl.attrs)} ?>`; 9644 } 9645 _serializeAttributes(attrs) { 9646 const strAttrs = Object.keys(attrs).map(name => `${name}="${attrs[name]}"`).join(' '); 9647 return strAttrs.length > 0 ? ' ' + strAttrs : ''; 9648 } 9649 visitDoctype(doctype) { 9650 return `<!DOCTYPE ${doctype.rootTag} [\n${doctype.dtd}\n]>`; 9651 } 9652}; 9653const _visitor = new _Visitor$2(); 9654function serialize$1(nodes) { 9655 return nodes.map(node => node.visit(_visitor)).join(''); 9656} 9657class Declaration { 9658 constructor(unescapedAttrs) { 9659 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "attrs", {}); 9660 Object.keys(unescapedAttrs).forEach(k => { 9661 this.attrs[k] = escapeXml(unescapedAttrs[k]); 9662 }); 9663 } 9664 visit(visitor) { 9665 return visitor.visitDeclaration(this); 9666 } 9667} 9668class Doctype { 9669 constructor(rootTag, dtd) { 9670 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "rootTag", void 0); 9671 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "dtd", void 0); 9672 this.rootTag = rootTag; 9673 this.dtd = dtd; 9674 } 9675 visit(visitor) { 9676 return visitor.visitDoctype(this); 9677 } 9678} 9679class Tag { 9680 constructor(name, unescapedAttrs = {}, children = []) { 9681 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "name", void 0); 9682 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "children", void 0); 9683 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "attrs", {}); 9684 this.name = name; 9685 this.children = children; 9686 Object.keys(unescapedAttrs).forEach(k => { 9687 this.attrs[k] = escapeXml(unescapedAttrs[k]); 9688 }); 9689 } 9690 visit(visitor) { 9691 return visitor.visitTag(this); 9692 } 9693} 9694let Text$1 = class Text { 9695 constructor(unescapedValue) { 9696 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "value", void 0); 9697 this.value = escapeXml(unescapedValue); 9698 } 9699 visit(visitor) { 9700 return visitor.visitText(this); 9701 } 9702}; 9703class CR extends Text$1 { 9704 constructor(ws = 0) { 9705 super(`\n${new Array(ws + 1).join(' ')}`); 9706 } 9707} 9708const _ESCAPED_CHARS = [[/&/g, '&'], [/"/g, '"'], [/'/g, '''], [/</g, '<'], [/>/g, '>']]; 9709// Escape `_ESCAPED_CHARS` characters in the given text with encoded entities 9710function escapeXml(text) { 9711 return _ESCAPED_CHARS.reduce((text, entry) => text.replace(entry[0], entry[1]), text); 9712} 9713 9714/** 9715 * Defines the `handler` value on the serialized XMB, indicating that Angular 9716 * generated the bundle. This is useful for analytics in Translation Console. 9717 * 9718 * NOTE: Keep in sync with 9719 * packages/localize/tools/src/extract/translation_files/xmb_translation_serializer.ts. 9720 */ 9721const _XMB_HANDLER = 'angular'; 9722const _MESSAGES_TAG = 'messagebundle'; 9723const _MESSAGE_TAG = 'msg'; 9724const _PLACEHOLDER_TAG$3 = 'ph'; 9725const _EXAMPLE_TAG = 'ex'; 9726const _SOURCE_TAG$2 = 'source'; 9727const _DOCTYPE = `<!ELEMENT messagebundle (msg)*> 9728<!ATTLIST messagebundle class CDATA #IMPLIED> 9729 9730<!ELEMENT msg (#PCDATA|ph|source)*> 9731<!ATTLIST msg id CDATA #IMPLIED> 9732<!ATTLIST msg seq CDATA #IMPLIED> 9733<!ATTLIST msg name CDATA #IMPLIED> 9734<!ATTLIST msg desc CDATA #IMPLIED> 9735<!ATTLIST msg meaning CDATA #IMPLIED> 9736<!ATTLIST msg obsolete (obsolete) #IMPLIED> 9737<!ATTLIST msg xml:space (default|preserve) "default"> 9738<!ATTLIST msg is_hidden CDATA #IMPLIED> 9739 9740<!ELEMENT source (#PCDATA)> 9741 9742<!ELEMENT ph (#PCDATA|ex)*> 9743<!ATTLIST ph name CDATA #REQUIRED> 9744 9745<!ELEMENT ex (#PCDATA)>`; 9746class Xmb extends Serializer { 9747 write(messages, locale) { 9748 const exampleVisitor = new ExampleVisitor(); 9749 const visitor = new _Visitor$1(); 9750 const rootNode = new Tag(_MESSAGES_TAG); 9751 rootNode.attrs['handler'] = _XMB_HANDLER;
9752 messages.forEach(message => { 9753 const attrs = { 9754 id: message.id 9755 }; 9756 if (message.description) { 9757 attrs['desc'] = message.description; 9758 } 9759 if (message.meaning) { 9760 attrs['meaning'] = message.meaning; 9761 } 9762 let sourceTags = []; 9763 message.sources.forEach(source => { 9764 sourceTags.push(new Tag(_SOURCE_TAG$2, {}, [new Text$1(`${source.filePath}:${source.startLine}${source.endLine !== source.startLine ? ',' + source.endLine : ''}`)])); 9765 }); 9766 rootNode.children.push(new CR(2), new Tag(_MESSAGE_TAG, attrs, [...sourceTags, ...visitor.serialize(message.nodes)])); 9767 }); 9768 rootNode.children.push(new CR()); 9769 return serialize$1([new Declaration({ 9770 version: '1.0', 9771 encoding: 'UTF-8' 9772 }), new CR(), new Doctype(_MESSAGES_TAG, _DOCTYPE), new CR(), exampleVisitor.addDefaultExamples(rootNode), new CR()]); 9773 } 9774 load(content, url) { 9775 throw new Error('Unsupported'); 9776 } 9777 digest(message) { 9778 return digest(message); 9779 } 9780 createNameMapper(message) { 9781 return new SimplePlaceholderMapper(message, toPublicName); 9782 } 9783} 9784let _Visitor$1 = class _Visitor { 9785 visitText(text, context) { 9786 return [new Text$1(text.value)]; 9787 } 9788 visitContainer(container, context) { 9789 const nodes = []; 9790 container.children.forEach(node => nodes.push(...node.visit(this))); 9791 return nodes; 9792 } 9793 visitIcu(icu, context) { 9794 const nodes = [new Text$1(`{${icu.expressionPlaceholder}, ${icu.type}, `)]; 9795 Object.keys(icu.cases).forEach(c => { 9796 nodes.push(new Text$1(`${c} {`), ...icu.cases[c].visit(this), new Text$1(`} `)); 9797 }); 9798 nodes.push(new Text$1(`}`)); 9799 return nodes; 9800 } 9801 visitTagPlaceholder(ph, context) { 9802 const startTagAsText = new Text$1(`<${ph.tag}>`); 9803 const startEx = new Tag(_EXAMPLE_TAG, {}, [startTagAsText]); 9804 // TC requires PH to have a non empty EX, and uses the text node to show the "original" value. 9805 const startTagPh = new Tag(_PLACEHOLDER_TAG$3, { 9806 name: ph.startName 9807 }, [startEx, startTagAsText]); 9808 if (ph.isVoid) { 9809 // void tags have no children nor closing tags 9810 return [startTagPh]; 9811 } 9812 const closeTagAsText = new Text$1(`</${ph.tag}>`); 9813 const closeEx = new Tag(_EXAMPLE_TAG, {}, [closeTagAsText]); 9814 // TC requires PH to have a non empty EX, and uses the text node to show the "original" value. 9815 const closeTagPh = new Tag(_PLACEHOLDER_TAG$3, { 9816 name: ph.closeName 9817 }, [closeEx, closeTagAsText]); 9818 return [startTagPh, ...this.serialize(ph.children), closeTagPh]; 9819 } 9820 visitPlaceholder(ph, context) { 9821 const interpolationAsText = new Text$1(`{{${ph.value}}}`); 9822 // Example tag needs to be not-empty for TC. 9823 const exTag = new Tag(_EXAMPLE_TAG, {}, [interpolationAsText]); 9824 return [ 9825 // TC requires PH to have a non empty EX, and uses the text node to show the "original" value. 9826 new Tag(_PLACEHOLDER_TAG$3, { 9827 name: ph.name 9828 }, [exTag, interpolationAsText])]; 9829 } 9830 visitBlockPlaceholder(ph, context) { 9831 const startAsText = new Text$1(`@${ph.name}`); 9832 const startEx = new Tag(_EXAMPLE_TAG, {}, [startAsText]); 9833 // TC requires PH to have a non empty EX, and uses the text node to show the "original" value. 9834 const startTagPh = new Tag(_PLACEHOLDER_TAG$3, { 9835 name: ph.startName 9836 }, [startEx, startAsText]); 9837 const closeAsText = new Text$1(`}`); 9838 const closeEx = new Tag(_EXAMPLE_TAG, {}, [closeAsText]); 9839 // TC requires PH to have a non empty EX, and uses the text node to show the "original" value. 9840 const closeTagPh = new Tag(_PLACEHOLDER_TAG$3, { 9841 name: ph.closeName 9842 }, [closeEx, closeAsText]); 9843 return [startTagPh, ...this.serialize(ph.children), closeTagPh]; 9844 } 9845 visitIcuPlaceholder(ph, context) { 9846 const icuExpression = ph.value.expression; 9847 const icuType = ph.value.type; 9848 const icuCases = Object.keys(ph.value.cases).map(value => value + ' {...}').join(' '); 9849 const icuAsText = new Text$1(`{${icuExpression}, ${icuType}, ${icuCases}}`); 9850 const exTag = new Tag(_EXAMPLE_TAG, {}, [icuAsText]); 9851 return [ 9852 // TC requires PH to have a non empty EX, and uses the text node to show the "original" value. 9853 new Tag(_PLACEHOLDER_TAG$3, { 9854 name: ph.name 9855 }, [exTag, icuAsText])]; 9856 } 9857 serialize(nodes) { 9858 return [].concat(...nodes.map(node =>
9858 node.visit(this))); 9859 } 9860}; 9861function digest(message) { 9862 return decimalDigest(message); 9863} 9864// TC requires at least one non-empty example on placeholders 9865class ExampleVisitor { 9866 addDefaultExamples(node) { 9867 node.visit(this); 9868 return node; 9869 } 9870 visitTag(tag) { 9871 if (tag.name === _PLACEHOLDER_TAG$3) { 9872 if (!tag.children || tag.children.length == 0) { 9873 const exText = new Text$1(tag.attrs['name'] || '...'); 9874 tag.children = [new Tag(_EXAMPLE_TAG, {}, [exText])]; 9875 } 9876 } else if (tag.children) { 9877 tag.children.forEach(node => node.visit(this)); 9878 } 9879 } 9880 visitText(text) {} 9881 visitDeclaration(decl) {} 9882 visitDoctype(doctype) {} 9883} 9884// XMB/XTB placeholders can only contain A-Z, 0-9 and _ 9885function toPublicName(internalName) { 9886 return internalName.toUpperCase().replace(/[^A-Z0-9_]/g, '_'); 9887} 9888 9889/** Name of the i18n attributes **/ 9890const I18N_ATTR = 'i18n'; 9891const I18N_ATTR_PREFIX = 'i18n-'; 9892/** Prefix of var expressions used in ICUs */ 9893const I18N_ICU_VAR_PREFIX = 'VAR_'; 9894function isI18nAttribute(name) { 9895 return name === I18N_ATTR || name.startsWith(I18N_ATTR_PREFIX); 9896} 9897function hasI18nAttrs(element) { 9898 return element.attrs.some(attr => isI18nAttribute(attr.name)); 9899} 9900function icuFromI18nMessage(message) { 9901 return message.nodes[0]; 9902} 9903/** 9904 * Format the placeholder names in a map of placeholders to expressions. 9905 * 9906 * The placeholder names are converted from "internal" format (e.g. `START_TAG_DIV_1`) to "external" 9907 * format (e.g. `startTagDiv_1`). 9908 * 9909 * @param params A map of placeholder names to expressions. 9910 * @param useCamelCase whether to camelCase the placeholder name when formatting. 9911 * @returns A new map of formatted placeholder names to expressions. 9912 */ 9913function formatI18nPlaceholderNamesInMap(params = {}, useCamelCase) { 9914 const _params = {}; 9915 if (params && Object.keys(params).length) { 9916 Object.keys(params).forEach(key => _params[formatI18nPlaceholderName(key, useCamelCase)] = params[key]); 9917 } 9918 return _params; 9919} 9920/** 9921 * Converts internal placeholder names to public-facing format 9922 * (for example to use in goog.getMsg call). 9923 * Example: `START_TAG_DIV_1` is converted to `startTagDiv_1`. 9924 * 9925 * @param name The placeholder name that should be formatted 9926 * @returns Formatted placeholder name 9927 */ 9928function formatI18nPlaceholderName(name, useCamelCase = true) { 9929 const publicName = toPublicName(name); 9930 if (!useCamelCase) { 9931 return publicName; 9932 } 9933 const chunks = publicName.split('_'); 9934 if (chunks.length === 1) { 9935 // if no "_" found - just lowercase the value 9936 return name.toLowerCase(); 9937 } 9938 let postfix; 9939 // eject last element if it's a number 9940 if (/^\d+$/.test(chunks[chunks.length - 1])) { 9941 postfix = chunks.pop(); 9942 } 9943 let raw = chunks.shift().toLowerCase(); 9944 if (chunks.length) { 9945 raw += chunks.map(c => c.charAt(0).toUpperCase() + c.slice(1).toLowerCase()).join(''); 9946 } 9947 return postfix ? `${raw}_${postfix}` : raw; 9948} 9949 9950/** 9951 * Checks whether an object key contains potentially unsafe chars, thus the key should be wrapped in 9952 * quotes. Note: we do not wrap all keys into quotes, as it may have impact on minification and may 9953 * not work in some cases when object keys are mangled by a minifier. 9954 * 9955 * TODO(FW-1136): this is a temporary solution, we need to come up with a better way of working with 9956 * inputs that contain potentially unsafe chars. 9957 */ 9958const UNSAFE_OBJECT_KEY_NAME_REGEXP = /[-.]/; 9959/** Name of the temporary to use during data binding */ 9960const TEMPORARY_NAME = '_t'; 9961/** Name of the context parameter passed into a template function */ 9962const CONTEXT_NAME = 'ctx'; 9963/** Name of the RenderFlag passed into a template function */ 9964const RENDER_FLAGS = 'rf'; 9965/** 9966 * Creates an allocator for a temporary variable. 9967 * 9968 * A variable declaration is added to the statements the first time the allocator is invoked. 9969 */ 9970function temporaryAllocator(pushStatement, name) { 9971 let temp = null; 9972 return () => { 9973 if (!temp) { 9974 pushStatement(new DeclareVarStmt(TEMPORARY_NAME, undefined, DYNAMIC_TYPE)); 9975 temp = variable(name); 9976 } 9977 return temp; 9978 }; 9979} 9980function asLiteral(value) { 9981 if (Array.isArray(value)) { 9982 return literalArr(value.map(asLiteral)); 9983 } 9984 return literal(value, INFERRED_TYPE); 9985} 9986/** 9987 * Serializes inputs and outputs for `defineDirective` and `defineComponent`. 9988 * 9989 * This will attempt to generate optimized data structures to minimize memory or 9990 * file size of fully compiled applications. 9991 */ 9992function conditionallyCreateDirectiveBindingLiteral(map, forInputs) { 9993 const keys = Object.getOwnPropertyNames(map); 9994 if (keys.length === 0) { 9995 return null; 9996 } 9997 return literalMap(keys.map(key => { 9998 const value = map[key]; 9999 let declaredName; 10000 let publicName; 10001 let minifiedName; 10002 let expressionValue; 10003 if (typeof value === 'string') { 10004 // canonical syntax: `dirProp: publicProp` 10005 declaredName = key; 10006 minifiedName = key; 10007 publicName = value; 10008 expressionValue = asLiteral(publicName); 10009 } else { 10010 minifiedName = key; 10011 declaredName = value.classPropertyName; 10012 publicName = value.bindingPropertyName; 10013 const differentDeclaringName = publicName !== declaredName; 10014 const hasDecoratorInputTransform = value.transformFunction !== null; 10015 let flags = InputFlags.None; 10016 // Build up input flags 10017 if (value.isSignal) { 10018 flags |= InputFlags.SignalBased; 10019 } 10020 if (hasDecoratorInputTransform) { 10021 flags |= InputFlags.HasDecoratorInputTransform; 10022 }
10023 // Inputs, compared to outputs, will track their declared name (for `ngOnChanges`), support 10024 // decorator input transform functions, or store flag information if there is any. 10025 if (forInputs && (differentDeclaringName || hasDecoratorInputTransform || flags !== InputFlags.None)) { 10026 const result = [literal(flags), asLiteral(publicName)]; 10027 if (differentDeclaringName || hasDecoratorInputTransform) { 10028 result.push(asLiteral(declaredName)); 10029 if (hasDecoratorInputTransform) { 10030 result.push(value.transformFunction); 10031 } 10032 } 10033 expressionValue = literalArr(result); 10034 } else { 10035 expressionValue = asLiteral(publicName); 10036 } 10037 } 10038 return { 10039 key: minifiedName, 10040 // put quotes around keys that contain potentially unsafe characters 10041 quoted: UNSAFE_OBJECT_KEY_NAME_REGEXP.test(minifiedName), 10042 value: expressionValue 10043 }; 10044 })); 10045} 10046/** 10047 * A representation for an object literal used during codegen of definition objects. The generic 10048 * type `T` allows to reference a documented type of the generated structure, such that the 10049 * property names that are set can be resolved to their documented declaration. 10050 */ 10051class DefinitionMap { 10052 constructor() { 10053 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "values", []); 10054 } 10055 set(key, value) { 10056 if (value) { 10057 const existing = this.values.find(value => value.key === key); 10058 if (existing) { 10059 existing.value = value; 10060 } else { 10061 this.values.push({ 10062 key: key, 10063 value, 10064 quoted: false 10065 }); 10066 } 10067 } 10068 } 10069 toLiteralMap() { 10070 return literalMap(this.values); 10071 } 10072} 10073/** 10074 * Creates a `CssSelector` from an AST node. 10075 */ 10076function createCssSelectorFromNode(node) { 10077 const elementName = node instanceof Element$1 ? node.name : 'ng-template'; 10078 const attributes = getAttrsForDirectiveMatching(node); 10079 const cssSelector = new CssSelector(); 10080 const elementNameNoNs = splitNsName(elementName)[1]; 10081 cssSelector.setElement(elementNameNoNs); 10082 Object.getOwnPropertyNames(attributes).forEach(name => { 10083 const nameNoNs = splitNsName(name)[1]; 10084 const value = attributes[name]; 10085 cssSelector.addAttribute(nameNoNs, value); 10086 if (name.toLowerCase() === 'class') { 10087 const classes = value.trim().split(/\s+/); 10088 classes.forEach(className => cssSelector.addClassName(className)); 10089 } 10090 }); 10091 return cssSelector; 10092} 10093/** 10094 * Extract a map of properties to values for a given element or template node, which can be used 10095 * by the directive matching machinery. 10096 * 10097 * @param elOrTpl the element or template in question 10098 * @return an object set up for directive matching. For attributes on the element/template, this 10099 * object maps a property name to its (static) value. For any bindings, this map simply maps the 10100 * property name to an empty string. 10101 */ 10102function getAttrsForDirectiveMatching(elOrTpl) { 10103 const attributesMap = {}; 10104 if (elOrTpl instanceof Template && elOrTpl.tagName !== 'ng-template') { 10105 elOrTpl.templateAttrs.forEach(a => attributesMap[a.name] = ''); 10106 } else { 10107 elOrTpl.attributes.forEach(a => { 10108 if (!isI18nAttribute(a.name)) { 10109 attributesMap[a.name] = a.value; 10110 } 10111 }); 10112 elOrTpl.inputs.forEach(i => { 10113 if (i.type === BindingType.Property || i.type === BindingType.TwoWay) { 10114 attributesMap[i.name] = ''; 10115 } 10116 }); 10117 elOrTpl.outputs.forEach(o => { 10118 attributesMap[o.name] = ''; 10119 }); 10120 } 10121 return attributesMap; 10122} 10123function compileInjectable(meta, resolveForwardRefs) { 10124 let result = null; 10125 const factoryMeta = { 10126 name: meta.name, 10127 type: meta.type, 10128 typeArgumentCount: meta.typeArgumentCount, 10129 deps: [], 10130 target: FactoryTarget.Injectable 10131 }; 10132 if (meta.useClass !== undefined) { 10133 // meta.useClass has two modes of operation. Either deps are specified, in which case `new` is 10134 // used to instantiate the class with dependencies injected, or deps are not specified and 10135 // the factory of the class is used to instantiate it. 10136 // 10137 // A special case exists for useClass: Type where Type is the injectable type itself and n
10137o 10138 // deps are specified, in which case 'useClass' is effectively ignored. 10139 const useClassOnSelf = meta.useClass.expression.isEquivalent(meta.type.value); 10140 let deps = undefined; 10141 if (meta.deps !== undefined) { 10142 deps = meta.deps; 10143 } 10144 if (deps !== undefined) { 10145 // factory: () => new meta.useClass(...deps) 10146 result = compileFactoryFunction((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({}, factoryMeta), {}, { 10147 delegate: meta.useClass.expression, 10148 delegateDeps: deps, 10149 delegateType: R3FactoryDelegateType.Class 10150 })); 10151 } else if (useClassOnSelf) { 10152 result = compileFactoryFunction(factoryMeta); 10153 } else { 10154 result = { 10155 statements: [], 10156 expression: delegateToFactory(meta.type.value, meta.useClass.expression, resolveForwardRefs) 10157 }; 10158 } 10159 } else if (meta.useFactory !== undefined) { 10160 if (meta.deps !== undefined) { 10161 result = compileFactoryFunction((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({}, factoryMeta), {}, { 10162 delegate: meta.useFactory, 10163 delegateDeps: meta.deps || [], 10164 delegateType: R3FactoryDelegateType.Function 10165 })); 10166 } else { 10167 result = { 10168 statements: [], 10169 expression: arrowFn([], meta.useFactory.callFn([])) 10170 }; 10171 } 10172 } else if (meta.useValue !== undefined) { 10173 // Note: it's safe to use `meta.useValue` instead of the `USE_VALUE in meta` check used for 10174 // client code because meta.useValue is an Expression which will be defined even if the actual 10175 // value is undefined. 10176 result = compileFactoryFunction((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({}, factoryMeta), {}, { 10177 expression: meta.useValue.expression 10178 })); 10179 } else if (meta.useExisting !== undefined) { 10180 // useExisting is an `inject` call on the existing token. 10181 result = compileFactoryFunction((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({}, factoryMeta), {}, { 10182 expression: importExpr(Identifiers.inject).callFn([meta.useExisting.expression]) 10183 })); 10184 } else { 10185 result = { 10186 statements: [], 10187 expression: delegateToFactory(meta.type.value, meta.type.value, resolveForwardRefs) 10188 }; 10189 } 10190 const token = meta.type.value; 10191 const injectableProps = new DefinitionMap(); 10192 injectableProps.set('token', token); 10193 injectableProps.set('factory', result.expression); 10194 // Only generate providedIn property if it has a non-null value 10195 if (meta.providedIn.expression.value !== null) { 10196 injectableProps.set('providedIn', convertFromMaybeForwardRefExpression(meta.providedIn)); 10197 } 10198 const expression = importExpr(Identifiers.ɵɵdefineInjectable).callFn([injectableProps.toLiteralMap()], undefined, true); 10199 return { 10200 expression, 10201 type: createInjectableType(meta), 10202 statements: result.statements 10203 }; 10204} 10205function createInjectableType(meta) { 10206 return new ExpressionType(importExpr(Identifiers.InjectableDeclaration, [typeWithParameters(meta.type.type, meta.typeArgumentCount)])); 10207} 10208function delegateToFactory(type, useType, unwrapForwardRefs) { 10209 if (type.node === useType.node) { 10210 // The types are the same, so we can simply delegate directly to the type's factory. 10211 // ``` 10212 // factory: type.ɵfac 10213 // ``` 10214 return useType.prop('ɵfac'); 10215 } 10216 if (!unwrapForwardRefs) { 10217 // The type is not wrapped in a `forwardRef()`, so we create a simple factory function that 10218 // accepts a sub-type as an argument. 10219 // ``` 10220 // factory: function(t) { return useType.ɵfac(t); } 10221 // ``` 10222 return createFactoryFunction(useType); 10223 } 10224 // The useType is actually wrapped in a `forwardRef()` so we need to resolve that before 10225 // calling its factory. 10226 // ``` 10227 // factory: function(t) { return core.resolveForwardRef(type).ɵfac(t); } 10228 // ``` 10229 const unwrappedType = importExpr(Identifiers.resolveForwardRef).callFn([useType]); 10230 return createFactoryFunction(unwrappedType); 10231} 10232function createFactoryFunction(type) { 10233 const t = new FnParam('__ngFactoryType__', DYNAMIC_TYPE); 10234 return arrowFn([t], type.prop('ɵfac').callFn([variable(t.name)])); 10235} 10236const UNUSABLE_INTERPOLATION_REGEXPS = [/@/, 10237// control flow reserved symbol 10238/^\s*$/, 10239// empty 10240/[<>]/, 10241// html tag 10242/^[{}]$/, 10243// i18n expansion 10244/&(#|[a-z])/i, 10245// character reference, 10246/^\/\// // comment 10247]; 10248function assertInterpolationSymbols(identifier, value) { 10249 if (value != null && !(Array.isArray(value) && value.length == 2)) { 10250 throw new Error(`Expected '${identifier}' to be an array, [start, end].`); 10251 } else if (value != null) { 10252 const start = value[0]; 10253 const end = value[1]; 10254 // Check for unusable interpolation symbols
10255 UNUSABLE_INTERPOLATION_REGEXPS.forEach(regexp => { 10256 if (regexp.test(start) || regexp.test(end)) { 10257 throw new Error(`['${start}', '${end}'] contains unusable interpolation symbol.`); 10258 } 10259 }); 10260 } 10261} 10262class InterpolationConfig { 10263 static fromArray(markers) { 10264 if (!markers) { 10265 return DEFAULT_INTERPOLATION_CONFIG; 10266 } 10267 assertInterpolationSymbols('interpolation', markers); 10268 return new InterpolationConfig(markers[0], markers[1]); 10269 } 10270 constructor(start, end) { 10271 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "start", void 0); 10272 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "end", void 0); 10273 this.start = start; 10274 this.end = end; 10275 } 10276} 10277const DEFAULT_INTERPOLATION_CONFIG = new InterpolationConfig('{{', '}}'); 10278const DEFAULT_CONTAINER_BLOCKS = new Set(['switch']); 10279const $EOF = 0; 10280const $BSPACE = 8; 10281const $TAB = 9; 10282const $LF = 10; 10283const $VTAB = 11; 10284const $FF = 12; 10285const $CR = 13; 10286const $SPACE = 32; 10287const $BANG = 33; 10288const $DQ = 34; 10289const $HASH = 35; 10290const $$ = 36; 10291const $PERCENT = 37; 10292const $AMPERSAND = 38; 10293const $SQ = 39; 10294const $LPAREN = 40; 10295const $RPAREN = 41; 10296const $STAR = 42; 10297const $PLUS = 43; 10298const $COMMA = 44; 10299const $MINUS = 45; 10300const $PERIOD = 46; 10301const $SLASH = 47; 10302const $COLON = 58; 10303const $SEMICOLON = 59; 10304const $LT = 60; 10305const $EQ = 61; 10306const $GT = 62; 10307const $QUESTION = 63; 10308const $0 = 48; 10309const $7 = 55; 10310const $9 = 57; 10311const $A = 65; 10312const $E = 69; 10313const $F = 70; 10314const $X = 88; 10315const $Z = 90; 10316const $LBRACKET = 91; 10317const $BACKSLASH = 92; 10318const $RBRACKET = 93; 10319const $CARET = 94; 10320const $_ = 95; 10321const $a = 97; 10322const $b = 98; 10323const $e = 101; 10324const $f = 102; 10325const $n = 110; 10326const $r = 114; 10327const $t = 116; 10328const $u = 117; 10329const $v = 118; 10330const $x = 120; 10331const $z = 122; 10332const $LBRACE = 123; 10333const $BAR = 124; 10334const $RBRACE = 125; 10335const $NBSP = 160; 10336const $AT = 64; 10337const $BT = 96; 10338function isWhitespace(code) { 10339 return code >= $TAB && code <= $SPACE || code == $NBSP; 10340} 10341function isDigit(code) { 10342 return $0 <= code && code <= $9; 10343} 10344function isAsciiLetter(code) { 10345 return code >= $a && code <= $z || code >= $A && code <= $Z; 10346} 10347function isAsciiHexDigit(code) { 10348 return code >= $a && code <= $f || code >= $A && code <= $F || isDigit(code); 10349} 10350function isNewLine(code) { 10351 return code === $LF || code === $CR; 10352} 10353function isOctalDigit(code) { 10354 return $0 <= code && code <= $7; 10355} 10356function isQuote(code) { 10357 return code === $SQ || code === $DQ || code === $BT; 10358} 10359class ParseLocation { 10360 constructor(file, offset, line, col) { 10361 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "file", void 0); 10362 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "offset", void 0); 10363 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "line", void 0); 10364 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "col", void 0); 10365 this.file = file; 10366 this.offset = offset; 10367 this.line = line; 10368 this.col = col; 10369 } 10370 toString() { 10371 return this.offset != null ? `${this.file.url}@${this.line}:${this.col}` : this.file.url; 10372 } 10373 moveBy(delta) { 10374 const source = this.file.content; 10375 const len = source.length; 10376 let offset = this.offset; 10377 let line = this.line; 10378 let col = this.col; 10379 while (offset > 0 && delta < 0) { 10380 offset--; 10381 delta++; 10382 const ch = source.charCodeAt(offset); 10383 if (ch == $LF) { 10384 line--; 10385 const priorLine = source.substring(0, offset - 1).lastIndexOf(String.fromCharCode($LF)); 10386 col = priorLine > 0 ? offset - priorLine : offset; 10387 } else { 10388 col--; 10389 } 10390 } 10391 while (offset < len && delta > 0) { 10392 const ch = source.charCodeAt(offset); 10393 offset++; 10394 delta--; 10395 if (ch == $LF) { 10396 line++; 10397 col = 0; 10398 } else { 10399 col++; 10400 } 10401 } 10402 return new ParseLocation(this.file, offset, line, col); 10403 } 10404 // Return the source around the location 10405 // Up to `maxChars` or `maxLines` on each side of the location 10406 getContext(maxChars, maxLines) { 10407 const content = this.file.content; 10408 let startOffset = this.offset; 10409 if (startOffset != null) { 10410 if (startOffset > content.length - 1) { 10411 startOffset = content.length - 1; 10412 } 10413 let endOffset = startOffset; 10414 let ctxChars = 0; 10415 let ctxLines = 0; 10416 while (ctxChars < maxChars && startOffset > 0) { 10417 startOffset--; 10418 ctxChars++; 10419 if (content[startOffset] == '\n') { 10420 if (++ctxLines == maxLines) { 10421 break; 10422 } 10423 } 10424 } 10425 ctxChars = 0; 10426 ctxLines = 0; 10427 while (ctxChars < maxChars && endOffset < content.length - 1) { 10428 endOffset++; 10429 ctxChars++; 10430 if (content[endOffset] == '\n') { 10431 if (++ctxLines == maxLines) { 10432 break; 10433 } 10434 } 10435 } 10436 return { 10437 before: content.substring(startOffset, this.offset), 10438 after: content.substring(this.offset, endOffset + 1) 10439 }; 10440 } 10441 return null; 10442 } 10443} 10444class ParseSourceFile {
10445 constructor(content, url) { 10446 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "content", void 0); 10447 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "url", void 0); 10448 this.content = content; 10449 this.url = url; 10450 } 10451} 10452class ParseSourceSpan { 10453 /** 10454 * Create an object that holds information about spans of tokens/nodes captured during 10455 * lexing/parsing of text. 10456 * 10457 * @param start 10458 * The location of the start of the span (having skipped leading trivia). 10459 * Skipping leading trivia makes source-spans more "user friendly", since things like HTML 10460 * elements will appear to begin at the start of the opening tag, rather than at the start of any 10461 * leading trivia, which could include newlines. 10462 * 10463 * @param end 10464 * The location of the end of the span. 10465 * 10466 * @param fullStart 10467 * The start of the token without skipping the leading trivia. 10468 * This is used by tooling that splits tokens further, such as extracting Angular interpolations 10469 * from text tokens. Such tooling creates new source-spans relative to the original token's 10470 * source-span. If leading trivia characters have been skipped then the new source-spans may be 10471 * incorrectly offset. 10472 * 10473 * @param details 10474 * Additional information (such as identifier names) that should be associated with the span. 10475 */ 10476 constructor(start, end, fullStart = start, details = null) { 10477 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "start", void 0); 10478 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "end", void 0); 10479 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "fullStart", void 0); 10480 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "details", void 0); 10481 this.start = start; 10482 this.end = end; 10483 this.fullStart = fullStart; 10484 this.details = details; 10485 } 10486 toString() { 10487 return this.start.file.content.substring(this.start.offset, this.end.offset); 10488 } 10489} 10490var ParseErrorLevel = /*#__PURE__*/function (ParseErrorLevel) { 10491 ParseErrorLevel[ParseErrorLevel["WARNING"] = 0] = "WARNING"; 10492 ParseErrorLevel[ParseErrorLevel["ERROR"] = 1] = "ERROR"; 10493 return ParseErrorLevel; 10494}(ParseErrorLevel || {}); 10495class ParseError { 10496 constructor(/** Location of the error. */ 10497 span, /** Error message. */ 10498 msg, /** Severity level of the error. */ 10499 level = ParseErrorLevel.ERROR, 10500 /** 10501 * Error that caused the error to be surfaced. For example, an error in a sub-expression that 10502 * couldn't be parsed. Not guaranteed to be defined, but can be used to provide more context. 10503 */ 10504 relatedError) { 10505 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "span", void 0); 10506 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "msg", void 0); 10507 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "level", void 0); 10508 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "relatedError", void 0); 10509 this.span = span; 10510 this.msg = msg; 10511 this.level = level; 10512 this.relatedError = relatedError; 10513 } 10514 contextualMessage() { 10515 const ctx = this.span.start.getContext(100, 3); 10516 return ctx ? `${this.msg} ("${ctx.before}[${ParseErrorLevel[this.level]} ->]${ctx.after}")` : this.msg; 10517 } 10518 toString() { 10519 const details = this.span.details ? `, ${this.span.details}` : ''; 10520 return `${this.contextualMessage()}: ${this.span.start}${details}`; 10521 } 10522} 10523/** 10524 * Generates Source Span object for a given R3 Type for JIT mode. 10525 * 10526 * @param kind Component or Directive. 10527 * @param typeName name of the Component or Directive. 10528 * @param sourceUrl reference to Component or Directive source. 10529 * @returns instance of ParseSourceSpan that represent a given Component or Directive. 10530 */ 10531function r3JitTypeSourceSpan(kind, typeName, sourceUrl) { 10532 const sourceFileName = `in ${kind} ${typeName} in ${sourceUrl}`; 10533 const sourceFile = new ParseSourceFile('', sourceFileName); 10534 return new ParseSourceSpan(new ParseLocation(sourceFile, -1, -1, -1), new ParseLocation(sourceFile, -1, -1, -1)); 10535} 10536let _anonymousTypeIndex = 0; 10537function identifierName(compileIdentifier) { 10538 if (!compileIdentifier || !compileIdentifier.reference) { 10539 return null; 10540 } 10541 const ref = compileIdentifier.reference; 10542 if (ref['__anonymousType']) { 10543 return ref['__anonymousType']; 10544 } 10545 if (ref['__forward_ref__']) {
10546 // We do not want to try to stringify a `forwardRef()` function because that would cause the 10547 // inner function to be evaluated too early, defeating the whole point of the `forwardRef`. 10548 return '__forward_ref__'; 10549 } 10550 let identifier = stringify(ref); 10551 if (identifier.indexOf('(') >= 0) { 10552 // case: anonymous functions! 10553 identifier = `anonymous_${_anonymousTypeIndex++}`; 10554 ref['__anonymousType'] = identifier; 10555 } else { 10556 identifier = sanitizeIdentifier(identifier); 10557 } 10558 return identifier; 10559} 10560function sanitizeIdentifier(name) { 10561 return name.replace(/\W/g, '_'); 10562} 10563 10564/** 10565 * In TypeScript, tagged template functions expect a "template object", which is an array of 10566 * "cooked" strings plus a `raw` property that contains an array of "raw" strings. This is 10567 * typically constructed with a function called `__makeTemplateObject(cooked, raw)`, but it may not 10568 * be available in all environments. 10569 * 10570 * This is a JavaScript polyfill that uses __makeTemplateObject when it's available, but otherwise 10571 * creates an inline helper with the same functionality. 10572 * 10573 * In the inline function, if `Object.defineProperty` is available we use that to attach the `raw` 10574 * array. 10575 */
10576const makeTemplateObjectPolyfill = '(this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e})'; 10577class AbstractJsEmitterVisitor extends AbstractEmitterVisitor { 10578 constructor() { 10579 super(false); 10580 } 10581 visitWrappedNodeExpr(ast, ctx) { 10582 throw new Error('Cannot emit a WrappedNodeExpr in Javascript.'); 10583 } 10584 visitDeclareVarStmt(stmt, ctx) { 10585 ctx.print(stmt, `var ${stmt.name}`); 10586 if (stmt.value) { 10587 ctx.print(stmt, ' = '); 10588 stmt.value.visitExpression(this, ctx); 10589 } 10590 ctx.println(stmt, `;`); 10591 return null; 10592 } 10593 visitTaggedTemplateLiteralExpr(ast, ctx) { 10594 // The following convoluted piece of code is effectively the downlevelled equivalent of 10595 // ``` 10596 // tag`...` 10597 // ``` 10598 // which is effectively like: 10599 // ``` 10600 // tag(__makeTemplateObject(cooked, raw), expression1, expression2, ...); 10601 // ``` 10602 const elements = ast.template.elements; 10603 ast.tag.visitExpression(this, ctx); 10604 ctx.print(ast, `(${makeTemplateOb
10604jectPolyfill}(`); 10605 ctx.print(ast, `[${elements.map(part => escapeIdentifier(part.text, false)).join(', ')}], `); 10606 ctx.print(ast, `[${elements.map(part => escapeIdentifier(part.rawText, false)).join(', ')}])`); 10607 ast.template.expressions.forEach(expression => { 10608 ctx.print(ast, ', '); 10609 expression.visitExpression(this, ctx); 10610 }); 10611 ctx.print(ast, ')'); 10612 return null; 10613 } 10614 visitTemplateLiteralExpr(expr, ctx) { 10615 ctx.print(expr, '`'); 10616 for (let i = 0; i < expr.elements.length; i++) { 10617 expr.elements[i].visitExpression(this, ctx); 10618 const expression = i < expr.expressions.length ? expr.expressions[i] : null; 10619 if (expression !== null) { 10620 ctx.print(expression, '${'); 10621 expression.visitExpression(this, ctx); 10622 ctx.print(expression, '}'); 10623 } 10624 } 10625 ctx.print(expr, '`'); 10626 } 10627 visitTemplateLiteralElementExpr(expr, ctx) { 10628 ctx.print(expr, expr.rawText); 10629 return null; 10630 } 10631 visitFunctionExpr(ast, ctx) { 10632 ctx.print(ast, `function${ast.name ? ' ' + ast.name : ''}(`); 10633 this._visitParams(ast.params, ctx); 10634 ctx.println(ast, `) {`); 10635 ctx.incIndent(); 10636 this.visitAllStatements(ast.statements, ctx); 10637 ctx.decIndent(); 10638 ctx.print(ast, `}`); 10639 return null; 10640 } 10641 visitArrowFunctionExpr(ast, ctx) { 10642 ctx.print(ast, '('); 10643 this._visitParams(ast.params, ctx); 10644 ctx.print(ast, ') =>'); 10645 if (Array.isArray(ast.body)) { 10646 ctx.println(ast, `{`); 10647 ctx.incIndent(); 10648 this.visitAllStatements(ast.body, ctx); 10649 ctx.decIndent(); 10650 ctx.print(ast, `}`); 10651 } else { 10652 const isObjectLiteral = ast.body instanceof LiteralMapExpr; 10653 if (isObjectLiteral) { 10654 ctx.print(ast, '('); 10655 } 10656 ast.body.visitExpression(this, ctx); 10657 if (isObjectLiteral) { 10658 ctx.print(ast, ')'); 10659 } 10660 } 10661 return null; 10662 } 10663 visitDeclareFunctionStmt(stmt, ctx) { 10664 ctx.print(stmt, `function ${stmt.name}(`); 10665 this._visitParams(stmt.params, ctx); 10666 ctx.println(stmt, `) {`); 10667 ctx.incIndent(); 10668 this.visitAllStatements(stmt.statements, ctx); 10669 ctx.decIndent(); 10670 ctx.println(stmt, `}`); 10671 return null; 10672 } 10673 visitLocalizedString(ast, ctx) { 10674 // The following convoluted piece of code is effectively the downlevelled equivalent of 10675 // ``` 10676 // $localize `...` 10677 // ``` 10678 // which is effectively like: 10679 // ```
10680 // $localize(__makeTemplateObject(cooked, raw), expression1, expression2, ...); 10681 // ``` 10682 ctx.print(ast, `$localize(${makeTemplateObjectPolyfill}(`); 10683 const parts = [ast.serializeI18nHead()]; 10684 for (let i = 1; i < ast.messageParts.length; i++) { 10685 parts.push(ast.serializeI18nTemplatePart(i)); 10686 } 10687 ctx.print(ast, `[${parts.map(part => escapeIdentifier(part.cooked, false)).join(', ')}], `); 10688 ctx.print(ast, `[${parts.map(part => escapeIdentifier(part.raw, false)).join(', ')}])`); 10689 ast.expressions.forEach(expression => { 10690 ctx.print(ast, ', '); 10691 expression.visitExpression(this, ctx); 10692 }); 10693 ctx.print(ast, ')'); 10694 return null; 10695 } 10696 _visitParams(params, ctx) { 10697 this.visitAllObjects(param => ctx.print(null, param.name), params, ctx, ','); 10698 } 10699} 10700 10701/** 10702 * @fileoverview 10703 * A module to facilitate use of a Trusted Types policy within the JIT 10704 * compiler. It lazily constructs the Trusted Types policy, providing helper 10705 * utilities for promoting strings to Trusted Types. When Trusted Types are not 10706 * available, strings are used as a fallback. 10707 * @security All use of this module is security-sensitive and should go through 10708 * security review. 10709 */ 10710/** 10711 * The Trusted Types policy, or null if Trusted Types are not 10712 * enabled/supported, or undefined if the policy has not been created yet. 10713 */ 10714let policy; 10715/** 10716 * Returns the Trusted Types policy, or null if Trusted Types are not 10717 * enabled/supported. The first call to this function will create the policy. 10718 */ 10719function getPolicy() { 10720 if (policy === undefined) { 10721 const trustedTypes = _global['trustedTypes']; 10722 policy = null; 10723 if (trustedTypes) { 10724 try { 10725 policy = trustedTypes.createPolicy('angular#unsafe-jit', { 10726 createScript: s => s 10727 }); 10728 } catch (_unused) { 10729 // trustedTypes.createPolicy throws if called with a name that is 10730 // already registered, even in report-only mode. Until the API changes, 10731 // catch the error not to break the applications functionally. In such 10732 // cases, the code will fall back to using strings. 10733 } 10734 } 10735 } 10736 return policy; 10737} 10738/** 10739 * Unsafely promote a string to a TrustedScript, falling back to strings when 10740 * Trusted Types are not available. 10741 * @security In particular, it must be assured that the provided string will 10742 * never cause an XSS vulnerability if used in a context that will be 10743 * interpreted and executed as a script by a browser, e.g. when calling eval. 10744 */ 10745function trustedScriptFromString(script) { 10746 var _getPolicy; 10747 return ((_getPolicy = getPolicy()) === null || _getPolicy === void 0 ? void 0 : _getPolicy.createScript(script)) || script; 10748} 10749/** 10750 * Unsafely call the Function constructor with the given string arguments. 10751 * @security This is a security-sensitive function; any use of this function 10752 * must go through security review. In particular, it must be assured that it 10753 * is only called from the JIT compiler, as use in other code can lead to XSS 10754 * vulnerabilities. 10755 */ 10756function newTrustedFunctionForJIT(...args) { 10757 if (!_global['trustedTypes']) { 10758 // In environments that don't support Trusted Types, fall back to the most 10759 // straightforward implementation: 10760 return new Function(...args); 10761 } 10762 // Chrome currently does not support passing TrustedScript to the Function 10763 // constructor. The following implements the workaround proposed on the page 10764 // below, where the Chromium bug is also referenced: 10765 // https://github.com/w3c/webappsec-trusted-types/wiki/Trusted-Types-for-function-constructor 10766 const fnArgs = args.slice(0, -1).join(','); 10767 const fnBody = args[args.length - 1]; 10768 const body = `(function anonymous(${fnArgs} 10769) { ${fnBody} 10770})`; 10771 // Using eval directly confuses the compiler and prevents this module from 10772 // being stripped out of JS binaries even if not used. The global['eval'] 10773 // indirection fixes that. 10774 const fn = _global['eval'](trustedScriptFromString(body)); 10775 if (fn.bind === undefined) { 10776 // Workaround for a browser bug that only exists in Chrome 83, where passing 10777 // a TrustedScript to eval just returns the TrustedScript back without 10778 // evaluating it. In that case, fall back to the most straightforward 10779 // implementation: 10780 return new Function(...args); 10781 } 10782 // To completely mimic the behavior of calling "new Function", two more 10783 // things need to happen: 10784 // 1. Stringifying the resulting function should return its source code 10785 fn.toString = () => body; 10786 // 2. When calling the resulting function, `this` should refer to `global` 10787 return fn.bind(_global); 10788 // When Trusted Types support in Function constructors is widely available, 10789 // the implementation of this function can be simplified to: 10790 // return new Function(...args.map(a => trustedScriptFromString(a))); 10791} 10792 10793/** 10794 * A helper class to manage the evaluation of JIT generated code. 10795 */ 10796class JitEvaluator { 10797 /** 10798 * 10799 * @param sourceUrl The URL of the generated code. 10800 * @param statements An array of Angular statement AST nodes to be evaluated. 10801 * @param refResolver Resolves `o.ExternalReference`s into values. 10802 * @param createSourceMaps If true then create a source-map for the generated code and include it 10803 * inline as a source-map comment. 10804 * @returns A map of all the variables in the generated code. 10805 */ 10806 evaluateStatements(sourceUrl, statements, refResolver, createSourceMaps) { 10807 const converter = new JitEmitterVisitor(refResolver); 10808 const ctx = EmitterVisitorContext.createRoot(); 10809 // Ensure generated code is in strict mode 10810 if (statements.length >
10810 0 && !isUseStrictStatement(statements[0])) { 10811 statements = [literal('use strict').toStmt(), ...statements]; 10812 } 10813 converter.visitAllStatements(statements, ctx); 10814 converter.createReturnStmt(ctx); 10815 return this.evaluateCode(sourceUrl, ctx, converter.getArgs(), createSourceMaps); 10816 } 10817 /** 10818 * Evaluate a piece of JIT generated code. 10819 * @param sourceUrl The URL of this generated code. 10820 * @param ctx A context object that contains an AST of the code to be evaluated. 10821 * @param vars A map containing the names and values of variables that the evaluated code might 10822 * reference. 10823 * @param createSourceMap If true then create a source-map for the generated code and include it 10824 * inline as a source-map comment. 10825 * @returns The result of evaluating the code. 10826 */ 10827 evaluateCode(sourceUrl, ctx, vars, createSourceMap) { 10828 let fnBody = `"use strict";${ctx.toSource()}\n//# sourceURL=${sourceUrl}`; 10829 const fnArgNames = []; 10830 const fnArgValues = []; 10831 for (const argName in vars) { 10832 fnArgValues.push(vars[argName]); 10833 fnArgNames.push(argName); 10834 } 10835 if (createSourceMap) { 10836 // using `new Function(...)` generates a header, 1 line of no arguments, 2 lines otherwise 10837 // E.g. ``` 10838 // function anonymous(a,b,c 10839 // /**/) { ... }``` 10840 // We don't want to hard code this fact, so we auto detect it via an empty function first. 10841 const emptyFn = newTrustedFunctionForJIT(...fnArgNames.concat('return null;')).toString(); 10842 const headerLines = emptyFn.slice(0, emptyFn.indexOf('return null;')).split('\n').length - 1; 10843 fnBody += `\n${ctx.toSourceMapGenerator(sourceUrl, headerLines).toJsComment()}`; 10844 } 10845 const fn = newTrustedFunctionForJIT(...fnArgNames.concat(fnBody)); 10846 return this.executeFunction(fn, fnArgValues); 10847 } 10848 /** 10849 * Execute a JIT generated function by calling it. 10850 * 10851 * This method can be overridden in tests to capture the functions that are generated 10852 * by this `JitEvaluator` class. 10853 * 10854 * @param fn A function to execute. 10855 * @param args The arguments to pass to the function being executed. 10856 * @returns The return value of the executed function. 10857 */ 10858 executeFunction(fn, args) { 10859 return fn(...args); 10860 } 10861} 10862/** 10863 * An Angular AST visitor that converts AST nodes into executable JavaScript code. 10864 */ 10865class JitEmitterVisitor extends AbstractJsEmitterVisitor { 10866 constructor(refResolver) { 10867 super(); 10868 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "refResolver", void 0); 10869 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_evalArgNames", []); 10870 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_evalArgValues", []); 10871 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_evalExportedVars", []); 10872 this.refResolver = refResolver; 10873 } 10874 createReturnStmt(ctx) {
10875 const stmt = new ReturnStatement(new LiteralMapExpr(this._evalExportedVars.map(resultVar => new LiteralMapEntry(resultVar, variable(resultVar), false)))); 10876 stmt.visitStatement(this, ctx); 10877 } 10878 getArgs() { 10879 const result = {}; 10880 for (let i = 0; i < this._evalArgNames.length; i++) { 10881 result[this._evalArgNames[i]] = this._evalArgValues[i]; 10882 } 10883 return result; 10884 } 10885 visitExternalExpr(ast, ctx) { 10886 this._emitReferenceToExternal(ast, this.refResolver.resolveExternalReference(ast.value), ctx); 10887 return null; 10888 } 10889 visitWrappedNodeExpr(ast, ctx) { 10890 this._emitReferenceToExternal(ast, ast.node, ctx); 10891 return null; 10892 } 10893 visitDeclareVarStmt(stmt, ctx) { 10894 if (stmt.hasModifier(StmtModifier.Exported)) { 10895 this._evalExportedVars.push(stmt.name); 10896 } 10897 return super.visitDeclareVarStmt(stmt, ctx); 10898 } 10899 visitDeclareFunctionStmt(stmt, ctx) { 10900 if (stmt.hasModifier(StmtModifier.Exported)) { 10901 this._evalExportedVars.push(stmt.name); 10902 } 10903 return super.visitDeclareFunctionStmt(stmt, ctx); 10904 } 10905 _emitReferenceToExternal(ast, value, ctx) { 10906 let id = this._evalArgValues.indexOf(value); 10907 if (id === -1) { 10908 id = this._evalArgValues.length; 10909 this._evalArgValues.push(value); 10910 const name = identifierName({ 10911 reference: value 10912 }) || 'val'; 10913 this._evalArgNames.push(`jit_${name}_${id}`); 10914 } 10915 ctx.print(ast, this._evalArgNames[id]); 10916 } 10917} 10918function isUseStrictStatement(statement) { 10919 return statement.isEquivalent(literal('use strict').toStmt()); 10920} 10921function compileInjector(meta) { 10922 const definitionMap = new DefinitionMap(); 10923 if (meta.providers !== null) { 10924 definitionMap.set('providers', meta.providers); 10925 } 10926 if (meta.imports.length > 0) { 10927 definitionMap.set('imports', literalArr(meta.imports)); 10928 } 10929 const expression = importExpr(Identifiers.defineInjector).callFn([definitionMap.toLiteralMap()], undefined, true); 10930 const type = createInjectorType(meta); 10931 return { 10932 expression, 10933 type, 10934 statements: [] 10935 }; 10936} 10937function createInjectorType(meta) { 10938 return new ExpressionType(importExpr(Identifiers.InjectorDeclaration, [new ExpressionType(meta.type.type)])); 10939} 10940 10941/** 10942 * Implementation of `CompileReflector` which resolves references to @angular/core 10943 * symbols at runtime, according to a consumer-provided mapping. 10944 * 10945 * Only supports `resolveExternalReference`, all other methods throw. 10946 */ 10947class R3JitReflector { 10948 constructor(context) { 10949 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "context", void 0); 10950 this.context = context; 10951 } 10952 resolveExternalReference(ref) { 10953 // This reflector only handles @angular/core imports. 10954 if (ref.moduleName !== '@angular/core') { 10955 throw new Error(`Cannot resolve external reference to ${ref.moduleName}, only references to @angular/core are supported.`); 10956 }
10957 if (!this.context.hasOwnProperty(ref.name)) { 10958 throw new Error(`No value provided for @angular/core symbol '${ref.name}'.`); 10959 } 10960 return this.context[ref.name]; 10961 } 10962} 10963 10964/** 10965 * How the selector scope of an NgModule (its declarations, imports, and exports) should be emitted 10966 * as a part of the NgModule definition. 10967 */ 10968var R3SelectorScopeMode = /*#__PURE__*/function (R3SelectorScopeMode) { 10969 /** 10970 * Emit the declarations inline into the module definition. 10971 * 10972 * This option is useful in certain contexts where it's known that JIT support is required. The 10973 * tradeoff here is that this emit style prevents directives and pipes from being tree-shaken if 10974 * they are unused, but the NgModule is used. 10975 */ 10976 R3SelectorScopeMode[R3SelectorScopeMode["Inline"] = 0] = "Inline"; 10977 /** 10978 * Emit the declarations using a side effectful function call, `ɵɵsetNgModuleScope`, that is 10979 * guarded with the `ngJitMode` flag. 10980 * 10981 * This form of emit supports JIT and can be optimized away if the `ngJitMode` flag is set to 10982 * false, which allows unused directives and pipes to be tree-shaken. 10983 */ 10984 R3SelectorScopeMode[R3SelectorScopeMode["SideEffect"] = 1] = "SideEffect"; 10985 /** 10986 * Don't generate selector scopes at all. 10987 * 10988 * This is useful for contexts where JIT support is known to be unnecessary. 10989 */ 10990 R3SelectorScopeMode[R3SelectorScopeMode["Omit"] = 2] = "Omit"; 10991 return R3SelectorScopeMode; 10992}(R3SelectorScopeMode || {}); 10993/** 10994 * The type of the NgModule meta data. 10995 * - Global: Used for full and partial compilation modes which mainly includes R3References. 10996 * - Local: Used for the local compilation mode which mainly includes the raw expressions as appears 10997 * in the NgModule decorator. 10998 */ 10999var R3NgModuleMetadataKind = /*#__PURE__*/function (R3NgModuleMetadataKind) { 11000 R3NgModuleMetadataKind[R3NgModuleMetadataKind["Global"] = 0] = "Global"; 11001 R3NgModuleMetadataKind[R3NgModuleMetadataKind["Local"] = 1] = "Local"; 11002 return R3NgModuleMetadataKind; 11003}(R3NgModuleMetadataKind || {}); 11004/** 11005 * Construct an `R3NgModuleDef` for the given `R3NgModuleMetadata`. 11006 */ 11007function compileNgModule(meta) { 11008 const statements = []; 11009 const definitionMap = new DefinitionMap(); 11010 definitionMap.set('type', meta.type.value); 11011 // Assign bootstrap definition. In local compilation mode (i.e., for 11012 // `R3NgModuleMetadataKind.LOCAL`) we assign the bootstrap field using the runtime 11013 // `ɵɵsetNgModuleScope`. 11014 if (meta.kind === R3NgModuleMetadataKind.Global && meta.bootstrap.length > 0) { 11015 definitionMap.set('bootstrap', refsToArray(meta.bootstrap, meta.containsForwardDecls)); 11016 } 11017 if (meta.selectorScopeMode === R3SelectorScopeMode.Inline) { 11018 // If requested to emit scope information inline, pass the `declarations`, `imports` and 11019 // `exports` to the `ɵɵdefineNgModule()` call directly. 11020 if (meta.declarations.length > 0) { 11021 definitionMap.set('declarations', refsToArray(meta.declarations, meta.containsForwardDecls)); 11022 } 11023 if (meta.imports.length > 0) { 11024 definitionMap.set('imports', refsToArray(meta.imports, meta.containsForwardDecls)); 11025 } 11026 if (meta.exports.length > 0) { 11027 definitionMap.set('exports', refsToArray(meta.exports, meta.containsForwardDecls)); 11028 } 11029 } else if (meta.selectorScopeMode === R3SelectorScopeMode.SideEffect) { 11030 // In this mode, scope information is not passed into `ɵɵdefineNgModule` as it 11031 // would prevent tree-shaking of the declarations, imports and exports references. Instead, it's 11032 // patched onto the NgModule definition with a `ɵɵsetNgModuleScope` call that's guarded by the 11033 // `ngJitMode` flag. 11034 const setNgModuleScopeCall = generateSetNgModuleScopeCall(meta); 11035 if (setNgModuleScopeCall !== null) { 11036 statements.push(setNgModuleScopeCall); 11037 } 11038 } else ; 11039 if (meta.schemas !== null && meta.schemas.length > 0) { 11040 definitionMap.set('schemas', literalArr(meta.schemas.map(ref => ref.value))); 11041 } 11042 if (meta.id !== null) { 11043 definitionMap.set('id', meta.id); 11044 // Generate a side-effectful call to register this NgModule by its id, as per the semantics of 11045 // NgModule ids. 11046 statements.push(importExpr(Identifiers.registerNgModuleType).callFn([meta.type.value, meta.id]).toStmt()); 11047 } 11048 const expression = importExpr(Identifiers.defineNgModule).callFn([definitionMap.toLiteralMap()], undefined, true); 11049 const type = createNgModuleType(meta); 11050 return { 11051 expression, 11052 type, 11053 statements 11054 }; 11055} 11056/** 11057 * This function is used in JIT mode to generate the call to `ɵɵdefineNgModule(
11057)` from a call to 11058 * `ɵɵngDeclareNgModule()`. 11059 */ 11060function compileNgModuleDeclarationExpression(meta) { 11061 const definitionMap = new DefinitionMap(); 11062 definitionMap.set('type', new WrappedNodeExpr(meta.type)); 11063 if (meta.bootstrap !== undefined) { 11064 definitionMap.set('bootstrap', new WrappedNodeExpr(meta.bootstrap)); 11065 } 11066 if (meta.declarations !== undefined) { 11067 definitionMap.set('declarations', new WrappedNodeExpr(meta.declarations)); 11068 } 11069 if (meta.imports !== undefined) { 11070 definitionMap.set('imports', new WrappedNodeExpr(meta.imports)); 11071 } 11072 if (meta.exports !== undefined) { 11073 definitionMap.set('exports', new WrappedNodeExpr(meta.exports)); 11074 } 11075 if (meta.schemas !== undefined) { 11076 definitionMap.set('schemas', new WrappedNodeExpr(meta.schemas)); 11077 } 11078 if (meta.id !== undefined) { 11079 definitionMap.set('id', new WrappedNodeExpr(meta.id)); 11080 } 11081 return importExpr(Identifiers.defineNgModule).callFn([definitionMap.toLiteralMap()]); 11082} 11083function createNgModuleType(meta) { 11084 if (meta.kind === R3NgModuleMetadataKind.Local) { 11085 return new ExpressionType(meta.type.value); 11086 } 11087 const { 11088 type: moduleType, 11089 declarations, 11090 exports, 11091 imports, 11092 includeImportTypes, 11093 publicDeclarationTypes 11094 } = meta; 11095 return new ExpressionType(importExpr(Identifiers.NgModuleDeclaration, [new ExpressionType(moduleType.type), publicDeclarationTypes === null ? tupleTypeOf(declarations) : tupleOfTypes(publicDeclarationTypes), includeImportTypes ? tupleTypeOf(imports) : NONE_TYPE, tupleTypeOf(exports)])); 11096} 11097/** 11098 * Generates a function call to `ɵɵsetNgModuleScope` with all necessary information so that the 11099 * transitive module scope can be computed during runtime in JIT mode. This call is marked pure 11100 * such that the references to declarations, imports and exports may be elided causing these 11101 * symbols to become tree-shakeable. 11102 */ 11103function generateSetNgModuleScopeCall(meta) { 11104 const scopeMap = new DefinitionMap(); 11105 if (meta.kind === R3NgModuleMetadataKind.Global) { 11106 if (meta.declarations.length > 0) { 11107 scopeMap.set('declarations', refsToArray(meta.declarations, meta.containsForwardDecls)); 11108 } 11109 } else { 11110 if (meta.declarationsExpression) { 11111 scopeMap.set('declarations', meta.declarationsExpression); 11112 } 11113 } 11114 if (meta.kind === R3NgModuleMetadataKind.Global) { 11115 if (meta.imports.length > 0) { 11116 scopeMap.set('imports', refsToArray(meta.imports, meta.containsForwardDecls)); 11117 } 11118 } else { 11119 if (meta.importsExpression) { 11120 scopeMap.set('imports', meta.importsExpression); 11121 } 11122 } 11123 if (meta.kind === R3NgModuleMetadataKind.Global) { 11124 if (meta.exports.length > 0) { 11125 scopeMap.set('exports', refsToArray(meta.exports, meta.containsForwardDecls)); 11126 } 11127 } else { 11128 if (meta.exportsExpression) { 11129 scopeMap.set('exports', meta.exportsExpression); 11130 } 11131 } 11132 if (meta.kind === R3NgModuleMetadataKind.Local && meta.bootstrapExpression) { 11133 scopeMap.set('bootstrap', meta.bootstrapExpression); 11134 } 11135 if (Object.keys(scopeMap.values).length === 0) { 11136 return null; 11137 } 11138 // setNgModuleScope(...) 11139 const fnCall = new InvokeFunctionExpr(/* fn */importExpr(Identifiers.setNgModuleScope), /* args */[meta.type.value, scopeMap.toLiteralMap()]); 11140 // (ngJitMode guard) && setNgModuleScope(...) 11141 const guardedCall = jitOnlyGuardedExpression(fnCall); 11142 // function() { (ngJitMode guard) && setNgModuleScope(...); } 11143 const iife = new FunctionExpr(/* params */[], /* statements */[guardedCall.toStmt()]); 11144 // (function() { (ngJitMode guard) && setNgModuleScope(...); })() 11145 const iifeCall = new InvokeFunctionExpr(/* fn */iife, /* args */[]); 11146 return iifeCall.toStmt(); 11147} 11148function tupleTypeOf(exp) { 11149 const types = exp.map(ref => typeofExpr(ref.type)); 11150 return exp.length > 0 ? expressionType(literalArr(types)) : NONE_TYPE; 11151} 11152function tupleOfTypes(types) { 11153 const typeofTypes = types.map(type => typeofExpr(type)); 11154 return types.length > 0 ? expressionType(literalArr(typeofTypes)) : NONE_TYPE; 11155} 11156function compilePipeFromMetadata(metadata) { 11157 const definitionMapValues = []; 11158 // e.g. `name: 'myPipe'` 11159 definitionMapValues.push({ 11160 key: 'name', 11161 value: literal(metadata.pipeName), 11162 quoted: false 11163 }); 11164 // e.g. `type: MyPipe` 11165 definitionMapValues.push({ 11166 key: 'type', 11167 value: metadata.type.value, 11168 quoted: false 11169 }); 11170 // e.g. `pure: true` 11171 definitionMapValues.push({ 11172 key: 'pure', 11173 value: literal(metadata.pure), 11174 quoted: false 11175 }); 11176 if (metadata.isStandalone === false) { 11177 definitionMapValues.push({ 11178 key: 'standalone', 11179 value: literal(false), 11180 quoted: false 11181 }); 11182 } 11183 const expression = importExpr(Identifiers.definePipe).callFn([literalMap(definitionMapValues)], undefined, true); 11184 const type = createPipeType(metadata); 11185 return { 11186 expression, 11187 type, 11188 statements: [] 11189 }; 11190} 11191function createPipeType(metadata) { 11192 return new ExpressionType(importExpr(Identifiers.PipeDeclaration, [typeWithParameters(metadata.type.type, metadata.typeArgumentCount), new ExpressionType(new LiteralExpr(metadata.pipeName)), new ExpressionType(new LiteralExpr(metadata.isStandalone))])); 11193} 11194var R3TemplateDependencyKind = /*#__PURE__*/function (R3TemplateDependencyKind) { 11195 R3TemplateDependencyKind[R3TemplateDependencyKind["Directive"] = 0] = "Directive"; 11196 R3TemplateDependencyKind[R3TemplateDependencyKind["Pipe"] = 1] = "Pipe"; 11197 R3TemplateDependencyKind[R3TemplateDependencyKind["NgModule"] = 2] = "NgModule"; 11198 return R3TemplateDependencyKind; 11199}(R3TemplateDependencyKind || {}); 11200/** 11201 * The following set contains all keywords that can be used in the animation css shorthand 11202 * property and is used during the scoping of keyframes to make sure such keywords 11203 * are not modified. 11204 */ 11205const animationKeywords = new Set([ 11206// global values 11207'inherit', 'initial', 'revert', 'unset', 11208// animation-direction 11209'alternate', 'alternate-reverse', 'normal', 'reverse', 11210// animation-fill-mode 11211'backwards', 'both', 'forwards', 'none', 11212// animation-play-state 11213'paused', 'running', 11214// animation-timing-function 11215'ease', 'ease-in', 'ease-in-out', 'ease-out', 'linear', 'step-start', 'step-end', 11216// `steps()` function 11217'end', 'jump-both', 'jump-end', 'jump-none', 'jump-start', 'start']); 11218/** 11219 * The following array contains all of the CSS at-rule identifiers which are scoped. 11220 */ 11221const scopedAtRuleIdentifiers = ['@media', '@supports', '@document', '@layer', '@container', '@scope', '@starting-style']; 11222/** 11223 * The following class has its origin from a port of shadowCSS from webcomponents.js to TypeScript. 11224 * It has since diverge in many ways to tailor Angular's needs. 11225 * 11226 * Source: 11227 * https://github.com/webcomponents/webcomponentsjs/blob/4efecd7e0e/src/ShadowCSS/ShadowCSS.js 11228 * 11229 * The original file level comment is reproduced below 11230 */ 11231/* 11232 This is a limited shim for ShadowDOM css styling. 11233 https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#styles 11234 11235 The intention here is to support only the styling features which can be 11236 relatively simply implemented. The goal is to allow users to avoid the 11237 most obvious pitfalls and do so without compromising performance significantly. 11238 For ShadowDOM styling that's not covered here, a set of best practices 11239 can be provided that should allow users to accomplish more complex styling. 11240 11241 The following is a list of specific ShadowDOM styling features and a brief 11242 discussion of the approach used to shim. 11243 11244 Shimmed features: 11245 11246 * :host, :host-context: ShadowDOM allows styling of the shadowRoot's host 11247 element using the :host rule. To shim this feature, the :host styles are 11248 reformatted and prefixed with a given scope name and promoted to a 11249 document level stylesheet. 11250 For example, given a scope name of .foo, a rule like this: 11251 11252 :host { 11253 background: red; 11254 } 11255 } 11256 11257 becomes: 11258 11259 .foo { 11260 background: red; 11261 } 11262 11263 * encapsulation: Styles defined within ShadowDOM, apply only to 11264 dom inside the ShadowDOM. 11265 The selectors are scoped by adding an attribute selector suffix to each
11266 simple selector that contains the host element tag name. Each element 11267 in the element's ShadowDOM template is also given the scope attribute. 11268 Thus, these rules match only elements that have the scope attribute. 11269 For example, given a scope name of x-foo, a rule like this: 11270 11271 div { 11272 font-weight: bold; 11273 } 11274 11275 becomes: 11276 11277 div[x-foo] { 11278 font-weight: bold; 11279 } 11280 11281 Note that elements that are dynamically added to a scope must have the scope 11282 selector added to them manually. 11283 11284 * upper/lower bound encapsulation: Styles which are defined outside a 11285 shadowRoot should not cross the ShadowDOM boundary and should not apply 11286 inside a shadowRoot. 11287 11288 This styling behavior is not emulated. Some possible ways to do this that 11289 were rejected due to complexity and/or performance concerns include: (1) reset 11290 every possible property for every possible selector for a given scope name; 11291 (2) re-implement css in javascript. 11292 11293 As an alternative, users should make sure to use selectors 11294 specific to the scope in which they are working. 11295 11296 * ::distributed: This behavior is not emulated. It's often not necessary 11297 to style the contents of a specific insertion point and instead, descendants 11298 of the host element can be styled selectively. Users can also create an 11299 extra node around an insertion point and style that node's contents 11300 via descendent selectors. For example, with a shadowRoot like this: 11301 11302 <style> 11303 ::content(div) { 11304 background: red; 11305 } 11306 </style> 11307 <content></content> 11308 11309 could become: 11310 11311 <style> 11312 / *@polyfill .content-container div * / 11313 ::content(div) { 11314 background: red; 11315 } 11316 </style> 11317 <div class="content-container"> 11318 <content></content> 11319 </div> 11320 11321 Note the use of @polyfill in the comment above a ShadowDOM specific style 11322 declaration. This is a directive to the styling shim to use the selector 11323 in comments in lieu of the next selector when running under polyfill. 11324*/ 11325class ShadowCss { 11326 constructor() { 11327 /** 11328 * Regular expression used to extrapolate the possible keyframes from an 11329 * animation declaration (with possibly multiple animation definitions) 11330 * 11331 * The regular expression can be divided in three parts 11332 * - (^|\s+|,) 11333 * captures how many (if any) leading whitespaces are present or a comma 11334 * - (?:(?:(['"])((?:\\\\|\\\2|(?!\2).)+)\2)|(-?[A-Za-z][\w\-]*)) 11335 * captures two different possible keyframes, ones which are quoted or ones which are valid css 11336 * indents (custom properties excluded) 11337 * - (?=[,\s;]|$) 11338 * simply matches the end of the possible keyframe, valid endings are: a comma, a space, a 11339 * semicolon or the end of the string 11340 */ 11341 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_animationDeclarationKeyframesRe", /(^|\s+|,)(?:(?:(['"])((?:\\\\|\\\2|(?!\2).)+)\2)|(-?[A-Za-z][\w\-]*))(?=[,\s]|$)/g); 11342 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_safeSelector", void 0); 11343 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_shouldScopeIndicator", void 0); 11344 } 11345 /* 11346 * Shim some cssText with the given selector. Returns cssText that can be included in the document 11347 * 11348 * The selector is the attribute added to all elements inside the host, 11349 * The hostSelector is the attribute added to the host itself. 11350 */ 11351 shimCssText(cssText, selector, hostSelector = '') { 11352 // **NOTE**: Do not strip comments as this will cause component sourcemaps to break 11353 // due to shift in lines. 11354 // Collect comments and replace them with a placeholder, this is done to avoid complicating 11355 // the rule parsing RegExp and keep it safer. 11356 const comments = []; 11357 cssText = cssText.replace(_commentRe, m => { 11358 if (m.match(_commentWithHashRe)) { 11359 comments.push(m); 11360 } else { 11361 var _newLinesMatches$join; 11362 // Replace non hash comments with empty lines. 11363 // This is done so that we do not leak any sensitive data in comments. 11364 const newLinesMatches = m.match(_newLinesRe); 11365 comments.push(((_newLinesMatches$join = newLinesMatches === null || newLinesMatches === void 0 ? void 0 : newLinesMatches.join('')) !== null && _newLinesMatches$join !== void 0 ? _newLinesMatches$join : '') + '\n'); 11366 } 11367 return COMMENT_PLACEHOLDER; 11368 }); 11369 cssText = this._insertDirectives(cssText); 11370 const scopedCssText = this._scopeCssText(cssText, selector, hostSelector); 11371 // Add back comments at the original position.
11372 let commentIdx = 0; 11373 return scopedCssText.replace(_commentWithHashPlaceHolderRe, () => comments[commentIdx++]); 11374 } 11375 _insertDirectives(cssText) { 11376 cssText = this._insertPolyfillDirectivesInCssText(cssText); 11377 return this._insertPolyfillRulesInCssText(cssText); 11378 } 11379 /** 11380 * Process styles to add scope to keyframes. 11381 * 11382 * Modify both the names of the keyframes defined in the component styles and also the css 11383 * animation rules using them. 11384 * 11385 * Animation rules using keyframes defined elsewhere are not modified to allow for globally 11386 * defined keyframes. 11387 * 11388 * For example, we convert this css: 11389 * 11390 * ```scss 11391 * .box { 11392 * animation: box-animation 1s forwards; 11393 * } 11394 * 11395 * @keyframes box-animation { 11396 * to { 11397 * background-color: green; 11398 * } 11399 * } 11400 * ``` 11401 * 11402 * to this: 11403 * 11404 * ```scss 11405 * .box { 11406 * animation: scopeName_box-animation 1s forwards; 11407 * } 11408 * 11409 * @keyframes scopeName_box-animation { 11410 * to { 11411 * background-color: green; 11412 * } 11413 * } 11414 * ``` 11415 * 11416 * @param cssText the component's css text that needs to be scoped. 11417 * @param scopeSelector the component's scope selector. 11418 * 11419 * @returns the scoped css text. 11420 */ 11421 _scopeKeyframesRelatedCss(cssText, scopeSelector) { 11422 const unscopedKeyframesSet = new Set(); 11423 const scopedKeyframesCssText = processRules(cssText, rule => this._scopeLocalKeyframeDeclarations(rule, scopeSelector, unscopedKeyframesSet)); 11424 return processRules(scopedKeyframesCssText, rule => this._scopeAnimationRule(rule, scopeSelector, unscopedKeyframesSet)); 11425 } 11426 /** 11427 * Scopes local keyframes names, returning the updated css rule and it also 11428 * adds the original keyframe name to a provided set to collect all keyframes names 11429 * so that it can later be used to scope the animation rules. 11430 * 11431 * For example, it takes a rule such as: 11432 * 11433 * ```scss 11434 * @keyframes box-animation { 11435 * to { 11436 * background-color: green; 11437 * } 11438 * } 11439 * ``` 11440 * 11441 * and returns: 11442 * 11443 * ```scss 11444 * @keyframes scopeName_box-animation { 11445 * to { 11446 * background-color: green; 11447 * } 11448 * } 11449 * ``` 11450 * and as a side effect it adds "box-animation" to the `unscopedKeyframesSet` set 11451 * 11452 * @param cssRule the css rule to process. 11453 * @param scopeSelector the component's scope selector. 11454 * @param unscopedKeyframesSet the set of unscoped keyframes names (which can be 11455 * modified as a side effect) 11456 * 11457 * @returns the css rule modified with the scoped keyframes name. 11458 */ 11459 _scopeLocalKeyframeDeclarations(rule, scopeSelector, unscopedKeyframesSet) { 11460 return (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({}, rule), {}, { 11461 selector: rule.selector.replace(/(^@(?:-webkit-)?keyframes(?:\s+))(['"]?)(.+)\2(\s*)$/, (_, start, quote, keyframeName, endSpaces) => { 11462 unscopedKeyframesSet.add(unescapeQuotes(keyframeName, quote)); 11463 return `${start}${quote}${scopeSelector}_${keyframeName}${quote}${endSpaces}`; 11464 }) 11465 }); 11466 } 11467 /** 11468 * Function used to scope a keyframes name (obtained from an animation declaration) 11469 * using an existing set of unscopedKeyframes names to discern if the scoping needs to be 11470 * performed (keyframes names of keyframes not defined in the component's css need not to be 11471 * scoped). 11472 * 11473 * @param keyframe the keyframes name to check. 11474 * @param scopeSelector the component's scope selector. 11475 * @param unscopedKeyframesSet the set of unscoped keyframes names. 11476 * 11477 * @returns the scoped name of the keyframe, or the original name is the name need not to be 11478 * scoped. 11479 */ 11480 _scopeAnimationKeyframe(keyframe, scopeSelector, unscopedKeyframesSet) { 11481 return keyframe.replace(/^(\s*)(['"]?)(.+?)\2(\s*)$/, (_, spaces1, quote, name, spaces2) => { 11482 name = `${unscopedKeyframesSet.has(unescapeQuotes(name, quote)) ? scopeSelector + '_' : ''}${name}`; 11483 return `${spaces1}${quote}${name}${quote}${spaces2}`; 11484 }); 11485 } 11486 /** 11487 * Scope an animation rule so that the keyframes mentioned in such rule 11488 * are scoped if defined in the component's css and left untouched otherwise. 11489 * 11490 * It can scope values of both the 'animation' and 'animation-name' properties. 11491 * 11492 * @param rule css rule to scope. 11493 * @param scopeSelector the component's scope selector. 11494 * @param unscopedKeyframesSet the set of unscoped keyframes names. 11495 * 11496 * @returns the updated css rule. 11497 **/ 11498 _scopeAnimationRule(rule, scopeSelector, unscopedKeyframesSet) {
11499 let content = rule.content.replace(/((?:^|\s+|;)(?:-webkit-)?animation\s*:\s*),*([^;]+)/g, (_, start, animationDeclarations) => start + animationDeclarations.replace(this._animationDeclarationKeyframesRe, (original, leadingSpaces, quote = '', quotedName, nonQuotedName) => { 11500 if (quotedName) { 11501 return `${leadingSpaces}${this._scopeAnimationKeyframe(`${quote}${quotedName}${quote}`, scopeSelector, unscopedKeyframesSet)}`; 11502 } else { 11503 return animationKeywords.has(nonQuotedName) ? original : `${leadingSpaces}${this._scopeAnimationKeyframe(nonQuotedName, scopeSelector, unscopedKeyframesSet)}`; 11504 } 11505 })); 11506 content = content.replace(/((?:^|\s+|;)(?:-webkit-)?animation-name(?:\s*):(?:\s*))([^;]+)/g, (_match, start, commaSeparatedKeyframes) => `${start}${commaSeparatedKeyframes.split(',').map(keyframe => this._scopeAnimationKeyframe(keyframe, scopeSelector, unscopedKeyframesSet)).join(',')}`); 11507 return (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({}, rule), {}, { 11508 content 11509 }); 11510 } 11511 /* 11512 * Process styles to convert native ShadowDOM rules that will trip 11513 * up the css parser; we rely on decorating the stylesheet with inert rules. 11514 * 11515 * For example, we convert this rule: 11516 * 11517 * polyfill-next-selector { content: ':host menu-item'; } 11518 * ::content menu-item { 11519 * 11520 * to this: 11521 * 11522 * scopeName menu-item { 11523 * 11524 **/ 11525 _insertPolyfillDirectivesInCssText(cssText) { 11526 return cssText.replace(_cssContentNextSelectorRe, function (...m) { 11527 return m[2] + '{'; 11528 }); 11529 } 11530 /* 11531 * Process styles to add rules which will only apply under the polyfill 11532 * 11533 * For example, we convert this rule: 11534 * 11535 * polyfill-rule { 11536 * content: ':host menu-item'; 11537 * ... 11538 * } 11539 * 11540 * to this: 11541 * 11542 * scopeName menu-item {...} 11543 * 11544 **/ 11545 _insertPolyfillRulesInCssText(cssText) { 11546 return cssText.replace(_cssContentRuleRe, (...m) => { 11547 const rule = m[0].replace(m[1], '').replace(m[2], ''); 11548 return m[4] + rule; 11549 }); 11550 } 11551 /* Ensure styles are scoped. Pseudo-scoping takes a rule like: 11552 * 11553 * .foo {... } 11554 * 11555 * and converts this to 11556 * 11557 * scopeName .foo { ... } 11558 */ 11559 _scopeCssText(cssText, scopeSelector, hostSelector) { 11560 const unscopedRules = this._extractUnscopedRulesFromCssText(cssText); 11561 // replace :host and :host-context with -shadowcsshost and -shadowcsshostcontext respectively 11562 cssText = this._insertPolyfillHostInCssText(cssText); 11563 cssText = this._convertColonHost(cssText); 11564 cssText = this._convertColonHostContext(cssText); 11565 cssText = this._convertShadowDOMSelectors(cssText); 11566 if (scopeSelector) { 11567 cssText = this._scopeKeyframesRelatedCss(cssText, scopeSelector); 11568 cssText = this._scopeSelectors(cssText, scopeSelector, hostSelector); 11569 } 11570 cssText = cssText + '\n' + unscopedRules; 11571 return cssText.trim(); 11572 } 11573 /* 11574 * Process styles to add rules which will only apply under the polyfill 11575 * and do not process via CSSOM. (CSSOM is destructive to rules on rare 11576 * occasions, e.g. -webkit-calc on Safari.) 11577 * For example, we convert this rule: 11578 * 11579 * @polyfill-unscoped-rule { 11580 * content: 'menu-item'; 11581 * ... } 11582 * 11583 * to this: 11584 * 11585 * menu-item {...} 11586 * 11587 **/ 11588 _extractUnscopedRulesFromCssText(cssText) { 11589 let r = ''; 11590 let m; 11591 _cssContentUnscopedRuleRe.lastIndex = 0; 11592 while ((m = _cssContentUnscopedRuleRe.exec(cssText)) !== null) { 11593 const rule = m[0].replace(m[2], '').replace(m[1], m[4]); 11594 r += rule + '\n\n'; 11595 } 11596 return r; 11597 } 11598 /* 11599 * convert a rule like :host(.foo) > .bar { } 11600 * 11601 * to 11602 * 11603 * .foo<scopeName> > .bar 11604 */ 11605 _convertColonHost(cssText) { 11606 return cssText.replace(_cssColonHostRe, (_, hostSelectors, otherSelectors) => { 11607 if (hostSelectors) { 11608 const convertedSelectors = []; 11609 const hostSelectorArray = hostSelectors.split(',').map(p => p.trim()); 11610 for (const hostSelector of hostSelectorArray) { 11611 if (!hostSelector) break; 11612 const convertedSelector = _polyfillHostNoCombinator + hostSelector.replace(_polyfillHost, '') + otherSelectors; 11613 convertedSelectors.push(convertedSelector); 11614 } 11615 return convertedSelectors.join(','); 11616 } else { 11617 return _polyfillHostNoCombinator + otherSelectors; 11618 } 11619 }); 11620 } 11621 /* 11622 * convert a rule like :host-context(.foo) > .bar { } 11623 * 11624 * to 11625 * 11626 * .foo<scopeName> > .bar, .foo <scopeName> > .bar { } 11627 * 11628 * and 11629 * 11630 * :host-context(.foo:host) .bar { ... } 11631 * 11632 * to 11633 * 11634 * .foo<scopeName> .bar { ... } 11635 */
11636 _convertColonHostContext(cssText) { 11637 const length = cssText.length; 11638 let parens = 0; 11639 let prev = 0; 11640 let result = ''; 11641 // Splits up the selectors on their top-level commas, processes the :host-context in them 11642 // individually and stitches them back together. This ensures that individual selectors don't 11643 // affect each other. 11644 for (let i = 0; i < length; i++) { 11645 const char = cssText[i]; 11646 // If we hit a comma and there are no open parentheses, take the current chunk and process it. 11647 if (char === ',' && parens === 0) { 11648 result += this._convertColonHostContextInSelectorPart(cssText.slice(prev, i)) + ','; 11649 prev = i + 1; 11650 continue; 11651 } 11652 // We've hit the end. Take everything since the last comma. 11653 if (i === length - 1) { 11654 result += this._convertColonHostContextInSelectorPart(cssText.slice(prev)); 11655 break; 11656 } 11657 if (char === '(') { 11658 parens++; 11659 } else if (char === ')') { 11660 parens--; 11661 } 11662 } 11663 return result; 11664 } 11665 _convertColonHostContextInSelectorPart(cssText) { 11666 return cssText.replace(_cssColonHostContextReGlobal, (selectorText, pseudoPrefix) => { 11667 // We have captured a selector that contains a `:host-context` rule. 11668 // For backward compatibility `:host-context` may contain a comma separated list of selectors. 11669 // Each context selector group will contain a list of host-context selectors that must match 11670 // an ancestor of the host. 11671 // (Normally `contextSelectorGroups` will only contain a single array of context selectors.) 11672 const contextSelectorGroups = [[]]; 11673 // There may be more than `:host-context` in this selector so `selectorText` could look like: 11674 // `:host-context(.one):host-context(.two)`. 11675 // Execute `_cssColonHostContextRe` over and over until we have extracted all the 11676 // `:host-context` selectors from this selector. 11677 let match; 11678 while (match = _cssColonHostContextRe.exec(selectorText)) { 11679 var _match$; 11680 // `match` = [':host-context(<selectors>)<rest>', <selectors>, <rest>] 11681 // The `<selectors>` could actually be a comma separated list: `:host-context(.one, .two)`. 11682 const newContextSelectors = ((_match$ = match[1]) !== null && _match$ !== void 0 ? _match$ : '').trim().split(',').map(m => m.trim()).filter(m => m !== ''); 11683 // We must duplicate the current selector group for each of these new selectors. 11684 // For example if the current groups are: 11685 // ``` 11686 // [ 11687 // ['a', 'b', 'c'], 11688 // ['x', 'y', 'z'], 11689 // ] 11690 // ``` 11691 // And we have a new set of comma separated selectors: `:host-context(m,n)` then the new 11692 // groups are: 11693 // ``` 11694 // [ 11695 // ['a', 'b', 'c', 'm'], 11696 // ['x', 'y', 'z', 'm'], 11697 // ['a', 'b', 'c', 'n'], 11698 // ['x', 'y', 'z', 'n'], 11699 // ] 11700 // ``` 11701 const contextSelectorGroupsLength = contextSelectorGroups.length; 11702 repeatGroups(contextSelectorGroups, newContextSelectors.length); 11703 for (let i = 0; i < newContextSelectors.length; i++) { 11704 for (let j = 0; j < contextSelectorGroupsLength; j++) { 11705 contextSelectorGroups[j + i * contextSelectorGroupsLength].push(newContextSelectors[i]); 11706 } 11707 } 11708 // Update the `selectorText` and see repeat to see if there are more `:host-context`s. 11709 selectorText = match[2]; 11710 } 11711 // The context selectors now must be combined with each other to capture all the possible 11712 // selectors that `:host-context` can match. See `_combineHostContextSelectors()` for more 11713 // info about how this is done. 11714 return contextSelectorGroups.map(contextSelectors => _combineHostContextSelectors(contextSelectors, selectorText, pseudoPrefix)).join(', '); 11715 }); 11716 } 11717 /* 11718 * Convert combinators like ::shadow and pseudo-elements like ::content 11719 * by replacing with space. 11720 */ 11721 _convertShadowDOMSelectors(cssText) { 11722 return _shadowDOMSelectorsRe.reduce((result, pattern) => result.replace(pattern, ' '), cssText); 11723 } 11724 // change a selector like 'div' to 'name div' 11725 _scopeSelectors(cssText, scopeSelector, hostSelector) { 11726 return processRules(cssText, rule => { 11727 let selector = rule.selector; 11728 let content = rule.content; 11729 if (rule.selector[0] !== '@') { 11730 selector = this._scopeSelector({ 11731 selector, 11732 scopeSelector, 11733 hostSelector, 11734 isParentSelector: true 11735 }); 11736 } else if (scopedAtRuleIdentifiers.some(atRule => rule.selector.startsWith(atRule))) { 11737 content = this._scopeSelectors(rule.content, scopeSelector, hostSelector); 11738 } else if (rule.selector.startsWith('@font-face') || rule.selector.startsWith('@page')) { 11739 content = this._stripScopingSelectors(rule.content); 11740 } 11741 return new CssRule(selector, content); 11742 }); 11743 } 11744 /** 11745 * Handle a css text that is within a rule that should not contain scope selectors by simply 11746 * removing them! An example of such a rule is `@font-face`. 11747 * 11748 * `@font-face` rules cannot contain nested selectors. Nor can they be nested under a selector. 11749 * Normally this would be a syntax error by the author of the styles. But in some rare cases, such 11750 * as importing styles from a library, and applying `:host ::ng-deep` to the imported styles, we 11751 * can end up with broken css if the imported styles happen to contain @font-face rules. 11752 * 11753 * For example: 11754 * 11755 * ``` 11756 * :host ::ng-deep { 11757 * import 'some/lib/containing/font-face'; 11758 * } 11759 * 11760 * Similar logic applies to `@page` rules which can contain a particular set of properties, 11761 * as well as some specific at-rules. Since they can't be encapsulated, we have to strip 11762 * any scoping selectors from them. For more information: https://www.w3.org/TR/css-page-3 11763 * ``` 11764 */ 11765 _stripScopingSelectors(cssText) { 11766 return processRules(cssText, rule => { 11767 const selector = rule.selector.replace(_shadowDeepSelectors, ' ').replace(_polyfillHostNoCombinatorRe, ' '); 11768 return new CssRule(selector, rule.content); 11769 }); 11770 } 11771 // `isParentSelector` is used to distinguish the selectors which are coming from 11772 // the initial selector string and any nested selectors, parsed re
11772cursively, 11773 // for example `selector = 'a:where(.one)'` could be the parent, while recursive call 11774 // would have `selector = '.one'`. 11775 _scopeSelector({ 11776 selector, 11777 scopeSelector, 11778 hostSelector, 11779 isParentSelector = false 11780 }) { 11781 // Split the selector into independent parts by `,` (comma) unless 11782 // comma is within parenthesis, for example `:is(.one, two)`. 11783 // Negative lookup after comma allows not splitting inside nested parenthesis, 11784 // up to three levels (((,))). 11785 const selectorSplitRe = / ?,(?!(?:[^)(]*(?:\([^)(]*(?:\([^)(]*(?:\([^)(]*\)[^)(]*)*\)[^)(]*)*\)[^)(]*)*\))) ?/; 11786 return selector.split(selectorSplitRe).map(part => part.split(_shadowDeepSelectors)).map(deepParts => { 11787 const [shallowPart, ...otherParts] = deepParts; 11788 const applyScope = shallowPart => { 11789 if (this._selectorNeedsScoping(shallowPart, scopeSelector)) { 11790 return this._applySelectorScope({ 11791 selector: shallowPart, 11792 scopeSelector, 11793 hostSelector, 11794 isParentSelector 11795 }); 11796 } else { 11797 return shallowPart; 11798 } 11799 }; 11800 return [applyScope(shallowPart), ...otherParts].join(' '); 11801 }).join(', '); 11802 } 11803 _selectorNeedsScoping(selector, scopeSelector) { 11804 const re = this._makeScopeMatcher(scopeSelector); 11805 return !re.test(selector); 11806 } 11807 _makeScopeMatcher(scopeSelector) { 11808 const lre = /\[/g; 11809 const rre = /\]/g; 11810 scopeSelector = scopeSelector.replace(lre, '\\[').replace(rre, '\\]'); 11811 return new RegExp('^(' + scopeSelector + ')' + _selectorReSuffix, 'm'); 11812 } 11813 // scope via name and [is=name] 11814 _applySimpleSelectorScope(selector, scopeSelector, hostSelector) { 11815 // In Android browser, the lastIndex is not reset when the regex is used in String.replace() 11816 _polyfillHostRe.lastIndex = 0; 11817 if (_polyfillHostRe.test(selector)) { 11818 const replaceBy = `[${hostSelector}]`; 11819 let result = selector; 11820 while (result.match(_polyfillHostNoCombinatorRe)) { 11821 result = result.replace(_polyfillHostNoCombinatorRe, (_hnc, selector) => { 11822 return selector.replace(/([^:\)]*)(:*)(.*)/, (_, before, colon, after) => { 11823 return before + replaceBy + colon + after; 11824 }); 11825 }); 11826 } 11827 return result.replace(_polyfillHostRe, replaceBy); 11828 } 11829 return scopeSelector + ' ' + selector; 11830 } 11831 // return a selector with [name] suffix on each simple selector 11832 // e.g. .foo.bar > .zot becomes .foo[name].bar[name] > .zot[name] /** @internal */ 11833 _applySelectorScope({ 11834 selector, 11835 scopeSelector, 11836 hostSelector, 11837 isParentSelector 11838 }) { 11839 const isRe = /\[is=([^\]]*)\]/g; 11840 scopeSelector = scopeSelector.replace(isRe, (_, ...parts) => parts[0]); 11841 const attrName = `[${scopeSelector}]`; 11842 const _scopeSelectorPart = p => { 11843 let scopedP = p.trim(); 11844 if (!scopedP) { 11845 return p; 11846 } 11847 if (p.includes(_polyfillHostNoCombinator)) { 11848 scopedP = this._applySimpleSelectorScope(p, scopeSelector, hostSelector); 11849 if (!p.match(_polyfillHostNoCombinatorOutsidePseudoFunction)) { 11850 const [_, before, colon, after] = scopedP.match(/([^:]*)(:*)([\s\S]*)/); 11851 scopedP = before + attrName + colon + after; 11852 } 11853 } else { 11854 // remove :host since it should be unnecessary 11855 const t = p.replace(_polyfillHostRe, ''); 11856 if (t.length > 0) { 11857 const matches = t.match(/([^:]*)(:*)([\s\S]*)/); 11858 if (matches) { 11859 scopedP = matches[1] + attrName + matches[2] + matches[3]; 11860 } 11861 } 11862 } 11863 return scopedP; 11864 }; 11865 // Wraps `_scopeSelectorPart()` to not use it directly on selectors with 11866 // pseudo selector functions like `:where()`. Selectors within pseudo selector 11867 // functions are recursively sent to `_scopeSelector()`. 11868 const _pseudoFunctionAwareScopeSelectorPart = selectorPart => { 11869 let scopedPart = ''; 11870 // Collect all outer `:where()` and `:is()` selectors, 11871 // counting parenthesis to keep nested selectors intact. 11872 const pseudoSelectorParts = []; 11873 let pseudoSelectorMatch; 11874 while ((pseudoSelectorMatch = _cssPrefixWithPseudoSelectorFunction.exec(selectorPart)) !== null) { 11875 let openedBrackets = 1; 11876 let index = _cssPrefixWithPseudoSelectorFunction.lastIndex; 11877 while (index < selectorPart.length) { 11878 const currentSymbol = selectorPart[index]; 11879 index++; 11880 if (currentSymbol === '(') { 11881 openedBrackets++; 11882 continue; 11883 } 11884 if (currentSymbol === ')') { 11885 openedBrackets--; 11886 if (openedBrackets === 0) { 11887 break; 11888 } 11889 continue; 11890 } 11891 } 11892 pseudoSelectorParts.push(`${pseudoSelectorMatch[0]}${selectorPart.slice(_cssPrefixWithPseudoSelectorFunction.lastIndex, index)}`); 11893 _cssPrefixWithPseudoSelectorFunction.lastIndex = index; 11894 } 11895 // If selector consists of only `:where()` and `:is()` on the outer level 11896 // scope those pseudo-selectors individually, otherwise scope the whole 11897 // selector. 11898 if (pseudoSelectorParts.join('') === selectorPart) { 11899 scopedPart = pseudoSelectorParts.map(selectorPart => { 11900 var _selectorPart$match; 11901 const [cssPseudoSelectorFunction] = (_selectorPart$match = selectorPart.match(_cssPrefixWithPseudoSelectorFunction)) !== null && _selectorPart$match !== void 0 ? _selectorPart$match : []; 11902 // Unwrap the pseudo selector to scope its contents. 11903 // For example, 11904 // - `:where(selectorToScope)` -> `selectorToScope`; 11905 // - `:is(.foo, .bar)` -> `.foo, .bar`. 11906 const selectorToScope = selectorPart.slice(cssPseudoSelectorFunction === null || cssPseudoSelectorFunction === void 0 ? void 0 : cssPseudoSelectorFunction.length, -1); 11907 if (selectorToScope.includes(_polyfillHostNoCombinator)) { 11908 this._shouldScopeIndicator = true; 11909 } 11910 const scopedInnerPart = this._scopeSelector({ 11911 selector: selectorToScope, 11912 scopeSelector, 11913 hostSelector 11914 }); 11915 // Put the result back into the pseudo selector function. 11916 return `${cssPseudoSelectorFunction}${scopedInnerPart})`; 11917 }).join(''); 11918 } else { 11919 this._shouldScopeIndicator = this._shouldScopeIndicator || selectorPart.includes(_polyfillHostNoCombinator); 11920 scopedPart = this._shouldScopeIndicator ? _scopeSelectorPart(selectorPart) : selectorPart; 11921 } 11922 return scopedPart; 11923 }; 11924 if (isParentSelector) { 11925 this._safeSelector = new SafeSelector(selector); 11926 selector = this._safeSelector.content(); 11927 } 11928 let scopedSelector = ''; 11929 let startIndex = 0; 11930 let res; 11931 // Combinators aren't used as a delimiter if they are within parenthesis, 11932 // for example `:where(.one .two)` stays intact. 11933 // Similarly to selector separation by comma initially, negative lookahead 11934 // is used here to not break selectors within nested parenthesis up to three 11935 // nested layers. 11936 const sep = /( |>|\+|~(?!=))(?!([^)(]*(?:\([^)(]*(?:\([^)(]*(?:\([^)(]*\)[^)(]*)*\)[^)(]*)*\)[^)(]*)*\)))\s*/g; 11937 // If a selector appears before :host it should not be shimmed as it 11938 // matches on ancestor elements and not on elements in the host's shadow 11939 // `:host-context(div)` is transformed to 11940 // `-shadowcsshost-no-combinatordiv, div -shadowcsshost-no-combinator` 11941 // the `div` is not part of the component in the 2nd selectors and should not be scoped. 11942 // Historically `component-tag:host` was matching the component so we also want to preserve 11943 // this behavior to avoid breaking legacy apps (it should not match). 11944 // The behavior should be: 11945 // - `tag:host` -> `tag[h]` (this is to avoid breaking legacy apps, should not match anything) 11946 // - `tag :host` -> `tag [h]` (`tag` is not scoped because it's considered part of a 11947 // `:host-context(tag)`) 11948 const hasHost = selector.includes(_polyfillHostNoCombinator); 11949 // Only scope parts after or on the same level as the first `-shadowcsshost-no-combinator` 11950 // when it is present. The selector has the same level when it is a part of a pseudo 11951 // selector, like `:where()`, for example `:where(:host, .foo)` would result in `.foo` 11952 // being scoped. 11953 if (isParentSelector || this._shouldScopeIndicator) { 11954 this._shouldScopeIndicator = !hasHost; 11955 } 11956 while ((res = sep.exec(selector)) !== null) { 11957 var _selector2; 11958 const separator = res[1];
11959 // Do not trim the selector, as otherwise this will break sourcemaps 11960 // when they are defined on multiple lines 11961 // Example: 11962 // div, 11963 // p { color: red} 11964 const part = selector.slice(startIndex, res.index); 11965 // A space following an escaped hex value and followed by another hex character 11966 // (ie: ".\fc ber" for ".über") is not a separator between 2 selectors 11967 // also keep in mind that backslashes are replaced by a placeholder by SafeSelector 11968 // These escaped selectors happen for example when esbuild runs with optimization.minify. 11969 if (part.match(/__esc-ph-(\d+)__/) && (_selector2 = selector[res.index + 1]) !== null && _selector2 !== void 0 && _selector2.match(/[a-fA-F\d]/)) { 11970 continue; 11971 } 11972 const scopedPart = _pseudoFunctionAwareScopeSelectorPart(part); 11973 scopedSelector += `${scopedPart} ${separator} `; 11974 startIndex = sep.lastIndex; 11975 } 11976 const part = selector.substring(startIndex); 11977 scopedSelector += _pseudoFunctionAwareScopeSelectorPart(part); 11978 // replace the placeholders with their original values 11979 // using values stored inside the `safeSelector` instance. 11980 return this._safeSelector.restore(scopedSelector); 11981 } 11982 _insertPolyfillHostInCssText(selector) { 11983 return selector.replace(_colonHostContextRe, _polyfillHostContext).replace(_colonHostRe, _polyfillHost); 11984 } 11985} 11986class SafeSelector { 11987 constructor(selector) { 11988 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "placeholders", []); 11989 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "index", 0); 11990 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_content", void 0); 11991 // Replaces attribute selectors with placeholders. 11992 // The WS in [attr="va lue"] would otherwise be interpreted as a selector separator. 11993 selector = this._escapeRegexMatches(selector, /(\[[^\]]*\])/g); 11994 // CSS allows for certain special characters to be used in selectors if they're escaped. 11995 // E.g. `.foo:blue` won't match a class called `foo:blue`, because the colon denotes a 11996 // pseudo-class, but writing `.foo\:blue` will match, because the colon was escaped. 11997 // Replace all escape sequences (`\` followed by a character) with a placeholder so 11998 // that our handling of pseudo-selectors doesn't mess with them. 11999 // Escaped characters have a specific placeholder so they can be detected separately. 12000 selector = selector.replace(/(\\.)/g, (_, keep) => { 12001 const replaceBy = `__esc-ph-${this.index}__`; 12002 this.placeholders.push(keep); 12003 this.index++; 12004 return replaceBy; 12005 }); 12006 // Replaces the expression in `:nth-child(2n + 1)` with a placeholder. 12007 // WS and "+" would otherwise be interpreted as selector separators. 12008 this._content = selector.replace(/(:nth-[-\w]+)(\([^)]+\))/g, (_, pseudo, exp) => { 12009 const replaceBy = `__ph-${this.index}__`; 12010 this.placeholders.push(exp); 12011 this.index++; 12012 return pseudo + replaceBy; 12013 }); 12014 } 12015 restore(content) { 12016 return content.replace(/__(?:ph|esc-ph)-(\d+)__/g, (_ph, index) => this.placeholders[+index]); 12017 } 12018 content() { 12019 return this._content; 12020 } 12021 /** 12022 * Replaces all of the substrings that match a regex within a 12023 * special string (e.g. `__ph-0__`, `__ph-1__`, etc). 12024 */ 12025 _escapeRegexMatches(content, pattern) { 12026 return content.replace(pattern, (_, keep) => { 12027 const replaceBy = `__ph-${this.index}__`; 12028 this.placeholders.push(keep); 12029 this.index++; 12030 return replaceBy; 12031 }); 12032 } 12033} 12034const _cssScopedPseudoFunctionPrefix = '(:(where|is)\\()?'; 12035const _cssPrefixWithPseudoSelectorFunction = /:(where|is)\(/gi; 12036const _cssContentNextSelectorRe = /polyfill-next-selector[^}]*content:[\s]*?(['"])(.*?)\1[;\s]*}([^{]*?){/gim; 12037const _cssContentRuleRe = /(polyfill-rule)[^}]*(content:[\s]*(['"])(.*?)\3)[;\s]*[^}]*}/gim;
12038const _cssContentUnscopedRuleRe = /(polyfill-unscoped-rule)[^}]*(content:[\s]*(['"])(.*?)\3)[;\s]*[^}]*}/gim; 12039const _polyfillHost = '-shadowcsshost'; 12040// note: :host-context pre-processed to -shadowcsshostcontext. 12041const _polyfillHostContext = '-shadowcsscontext'; 12042const _parenSuffix = '(?:\\((' + '(?:\\([^)(]*\\)|[^)(]*)+?' + ')\\))'; 12043const _cssColonHostRe = new RegExp(_polyfillHost + _parenSuffix + '?([^,{]*)', 'gim'); 12044// note: :host-context patterns are terminated with `{`, as opposed to :host which 12045// is both `{` and `,` because :host-context handles top-level commas differently. 12046const _hostContextPattern = _polyfillHostContext + _parenSuffix + '?([^{]*)'; 12047const _cssColonHostContextReGlobal = new RegExp(`${_cssScopedPseudoFunctionPrefix}(${_hostContextPattern})`, 'gim'); 12048const _cssColonHostContextRe = new RegExp(_hostContextPattern, 'im'); 12049const _polyfillHostNoCombinator = _polyfillHost + '-no-combinator'; 12050const _polyfillHostNoCombinatorOutsidePseudoFunction = new RegExp(`${_polyfillHostNoCombinator}(?![^(]*\\))`, 'g'); 12051const _polyfillHostNoCombinatorRe = /-shadowcsshost-no-combinator([^\s,]*)/; 12052const _shadowDOMSelectorsRe = [/::shadow/g, /::content/g, 12053// Deprecated selectors 12054/\/shadow-deep\//g, /\/shadow\//g]; 12055// The deep combinator is deprecated in the CSS spec 12056// Support for `>>>`, `deep`, `::ng-deep` is then also deprecated and will be removed in the future. 12057// see https://github.com/angular/angular/pull/17677 12058const _shadowDeepSelectors = /(?:>>>)|(?:\/deep\/)|(?:::ng-deep)/g; 12059const _selectorReSuffix = '([>\\s~+[.,{:][\\s\\S]*)?$'; 12060const _polyfillHostRe = /-shadowcsshost/gim; 12061const _colonHostRe = /:host/gim; 12062const _colonHostContextRe = /:host-context/gim; 12063const _newLinesRe = /\r?\n/g; 12064const _commentRe = /\/\*[\s\S]*?\*\//g; 12065const _commentWithHashRe = /\/\*\s*#\s*source(Mapping)?URL=/g; 12066const COMMENT_PLACEHOLDER = '%COMMENT%'; 12067const _commentWithHashPlaceHolderRe = new RegExp(COMMENT_PLACEHOLDER, 'g'); 12068const BLOCK_PLACEHOLDER = '%BLOCK%'; 12069const _ruleRe = new RegExp(`(\\s*(?:${COMMENT_PLACEHOLDER}\\s*)*)([^;\\{\\}]+?)(\\s*)((?:{%BLOCK%}?\\s*;?)|(?:\\s*;))`, 'g'); 12070const CONTENT_PAIRS = new Map([['{', '}']]); 12071const COMMA_IN_PLACEHOLDER = '%COMMA_IN_PLACEHOLDER%'; 12072const SEMI_IN_PLACEHOLDER = '%SEMI_IN_PLACEHOLDER%'; 12073const COLON_IN_PLACEHOLDER = '%COLON_IN_PLACEHOLDER%'; 12074const _cssCommaInPlaceholderReGlobal = new RegExp(COMMA_IN_PLACEHOLDER, 'g'); 12075const _cssSemiInPlaceholderReGlobal = new RegExp(SEMI_IN_PLACEHOLDER, 'g'); 12076const _cssColonInPlaceholderReGlobal = new RegExp(COLON_IN_PLACEHOLDER, 'g'); 12077class CssRule { 12078 constructor(selector, content) { 12079 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "selector", void 0); 12080 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "content", void 0); 12081 this.selector = selector; 12082 this.content = content; 12083 } 12084} 12085function processRules(input, ruleCallback) { 12086 const escaped = escapeInStrings(input); 12087 const inputWithEscapedBlocks = escapeBlocks(escaped, CONTENT_PAIRS, BLOCK_PLACEHOLDER); 12088 let nextBlockIndex = 0; 12089 const escapedResult = inputWithEscapedBlocks.escapedString.replace(_ruleRe, (...m) => { 12090 const selector = m[2]; 12091 let content = ''; 12092 let suffix = m[4]; 12093 let contentPrefix = ''; 12094 if (suffix && suffix.startsWith('{' + BLOCK_PLACEHOLDER)) { 12095 content = inputWithEscapedBlocks.blocks[nextBlockIndex++]; 12096 suffix = suffix.substring(BLOCK_PLACEHOLDER.length + 1); 12097 contentPrefix = '{'; 12098 } 12099 const rule = ruleCallback(new CssRule(selector, content)); 12100 return `${m[1]}${rule.selector}${m[3]}${contentPrefix}${rule.content}${suffix}`; 12101 }); 12102 return unescapeInStrings(escapedResult); 12103} 12104class StringWithEscapedBlocks { 12105 constructor(escapedString, blocks) { 12106 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "escapedString", void 0); 12107 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "blocks", void 0); 12108 this.escapedString = escapedString; 12109 this.blocks = blocks; 12110 } 12111} 12112function escapeBlocks(input, charPairs, placeholder) { 12113 const resultParts = []; 12114 const escapedBlocks = []; 12115 let openCharCount = 0; 12116 let nonBlockStartIndex = 0; 12117 let blockStartIndex = -1; 12118 let openChar; 12119 let closeChar; 12120 for (let i = 0; i < input.length; i++) {
12121 const char = input[i]; 12122 if (char === '\\') { 12123 i++; 12124 } else if (char === closeChar) { 12125 openCharCount--; 12126 if (openCharCount === 0) { 12127 escapedBlocks.push(input.substring(blockStartIndex, i)); 12128 resultParts.push(placeholder); 12129 nonBlockStartIndex = i; 12130 blockStartIndex = -1; 12131 openChar = closeChar = undefined; 12132 } 12133 } else if (char === openChar) { 12134 openCharCount++; 12135 } else if (openCharCount === 0 && charPairs.has(char)) { 12136 openChar = char; 12137 closeChar = charPairs.get(char); 12138 openCharCount = 1; 12139 blockStartIndex = i + 1; 12140 resultParts.push(input.substring(nonBlockStartIndex, blockStartIndex)); 12141 } 12142 } 12143 if (blockStartIndex !== -1) { 12144 escapedBlocks.push(input.substring(blockStartIndex)); 12145 resultParts.push(placeholder); 12146 } else { 12147 resultParts.push(input.substring(nonBlockStartIndex)); 12148 } 12149 return new StringWithEscapedBlocks(resultParts.join(''), escapedBlocks); 12150} 12151/** 12152 * Object containing as keys characters that should be substituted by placeholders 12153 * when found in strings during the css text parsing, and as values the respective 12154 * placeholders 12155 */ 12156const ESCAPE_IN_STRING_MAP = { 12157 ';': SEMI_IN_PLACEHOLDER, 12158 ',': COMMA_IN_PLACEHOLDER, 12159 ':': COLON_IN_PLACEHOLDER 12160}; 12161/** 12162 * Parse the provided css text and inside strings (meaning, inside pairs of unescaped single or 12163 * double quotes) replace specific characters with their respective placeholders as indicated 12164 * by the `ESCAPE_IN_STRING_MAP` map. 12165 * 12166 * For example convert the text 12167 * `animation: "my-anim:at\"ion" 1s;` 12168 * to 12169 * `animation: "my-anim%COLON_IN_PLACEHOLDER%at\"ion" 1s;` 12170 * 12171 * This is necessary in order to remove the meaning of some characters when found inside strings 12172 * (for example `;` indicates the end of a css declaration, `,` the sequence of values and `:` the 12173 * division between property and value during a declaration, none of these meanings apply when such 12174 * characters are within strings and so in order to prevent parsing issues they need to be replaced 12175 * with placeholder text for the duration of the css manipulation process). 12176 * 12177 * @param input the original css text. 12178 * 12179 * @returns the css text with specific characters in strings replaced by placeholders. 12180 **/ 12181function escapeInStrings(input) { 12182 let result = input; 12183 let currentQuoteChar = null; 12184 for (let i = 0; i < result.length; i++) { 12185 const char = result[i]; 12186 if (char === '\\') { 12187 i++; 12188 } else { 12189 if (currentQuoteChar !== null) { 12190 // index i is inside a quoted sub-string 12191 if (char === currentQuoteChar) { 12192 currentQuoteChar = null; 12193 } else { 12194 const placeholder = ESCAPE_IN_STRING_MAP[char]; 12195 if (placeholder) { 12196 result = `${result.substr(0, i)}${placeholder}${result.substr(i + 1)}`; 12197 i += placeholder.length - 1; 12198 } 12199 } 12200 } else if (char === "'" || char === '"') { 12201 currentQuoteChar = char; 12202 } 12203 } 12204 } 12205 return result; 12206} 12207/** 12208 * Replace in a string all occurrences of keys in the `ESCAPE_IN_STRING_MAP` map with their 12209 * original representation, this is simply used to revert the changes applied by the 12210 * escapeInStrings function. 12211 * 12212 * For example it reverts the text: 12213 * `animation: "my-anim%COLON_IN_PLACEHOLDER%at\"ion" 1s;` 12214 * to it's original form of: 12215 * `animation: "my-anim:at\"ion" 1s;` 12216 * 12217 * Note: For the sake of simplicity this function does not check that the placeholders are 12218 * actually inside strings as it would anyway be extremely unlikely to find them outside of strings. 12219 * 12220 * @param input the css text containing the placeholders. 12221 * 12222 * @returns the css text without the placeholders. 12223 */ 12224function unescapeInStrings(input) { 12225 let result = input.replace(_cssCommaInPlaceholderReGlobal, ','); 12226 result = result.replace(_cssSemiInPlaceholderReGlobal, ';'); 12227 result = result.replace(_cssColonInPlaceholderReGlobal, ':'); 12228 return result; 12229} 12230/** 12231 * Unescape all quotes present in a string, but only if the string was actually already 12232 * quoted. 12233 *
12234 * This generates a "canonical" representation of strings which can be used to match strings 12235 * which would otherwise only differ because of differently escaped quotes. 12236 * 12237 * For example it converts the string (assumed to be quoted): 12238 * `this \\"is\\" a \\'\\\\'test` 12239 * to: 12240 * `this "is" a '\\\\'test` 12241 * (note that the latter backslashes are not removed as they are not actually escaping the single 12242 * quote) 12243 * 12244 * 12245 * @param input the string possibly containing escaped quotes. 12246 * @param isQuoted boolean indicating whether the string was quoted inside a bigger string (if not 12247 * then it means that it doesn't represent an inner string and thus no unescaping is required) 12248 * 12249 * @returns the string in the "canonical" representation without escaped quotes. 12250 */ 12251function unescapeQuotes(str, isQuoted) { 12252 return !isQuoted ? str : str.replace(/((?:^|[^\\])(?:\\\\)*)\\(?=['"])/g, '$1'); 12253} 12254/** 12255 * Combine the `contextSelectors` with the `hostMarker` and the `otherSelectors` 12256 * to create a selector that matches the same as `:host-context()`. 12257 * 12258 * Given a single context selector `A` we need to output selectors that match on the host and as an 12259 * ancestor of the host: 12260 * 12261 * ``` 12262 * A <hostMarker>, A<hostMarker> {} 12263 * ``` 12264 * 12265 * When there is more than one context selector we also have to create combinations of those 12266 * selectors with each other. For example if there are `A` and `B` selectors the output is: 12267 * 12268 * ``` 12269 * AB<hostMarker>, AB <hostMarker>, A B<hostMarker>, 12270 * B A<hostMarker>, A B <hostMarker>, B A <hostMarker> {} 12271 * ``` 12272 * 12273 * And so on... 12274 * 12275 * @param contextSelectors an array of context selectors that will be combined. 12276 * @param otherSelectors the rest of the selectors that are not context selectors. 12277 */ 12278function _combineHostContextSelectors(contextSelectors, otherSelectors, pseudoPrefix = '') { 12279 const hostMarker = _polyfillHostNoCombinator; 12280 _polyfillHostRe.lastIndex = 0; // reset the regex to ensure we get an accurate test 12281 const otherSelectorsHasHost = _polyfillHostRe.test(otherSelectors); 12282 // If there are no context selectors then just output a host marker 12283 if (contextSelectors.length === 0) { 12284 return hostMarker + otherSelectors; 12285 } 12286 const combined = [contextSelectors.pop() || '']; 12287 while (contextSelectors.length > 0) { 12288 const length = combined.length; 12289 const contextSelector = contextSelectors.pop(); 12290 for (let i = 0; i < length; i++) { 12291 const previousSelectors = combined[i]; 12292 // Add the new selector as a descendant of the previous selectors 12293 combined[length * 2 + i] = previousSelectors + ' ' + contextSelector; 12294 // Add the new selector as an ancestor of the previous selectors 12295 combined[length + i] = contextSelector + ' ' + previousSelectors; 12296 // Add the new selector to act on the same element as the previous selectors 12297 combined[i] = contextSelector + previousSelectors; 12298 } 12299 } 12300 // Finally connect the selector to the `hostMarker`s: either acting directly on the host 12301 // (A<hostMarker>) or as an ancestor (A <hostMarker>). 12302 return combined.map(s => otherSelectorsHasHost ? `${pseudoPrefix}${s}${otherSelectors}` : `${pseudoPrefix}${s}${hostMarker}${otherSelectors}, ${pseudoPrefix}${s} ${hostMarker}${otherSelectors}`).join(','); 12303} 12304/** 12305 * Mutate the given `groups` array so that there are `multiples` clones of the original array 12306 * stored. 12307 * 12308 * For example `repeatGroups([a, b], 3)` will result in `[a, b, a, b, a, b]` - but importantly the 12309 * newly added groups will be clones of the original. 12310 * 12311 * @param groups An array of groups of strings that will be repeated. This array is mutated 12312 * in-place. 12313 * @param multiples The number of times the current groups should appear. 12314 */ 12315function repeatGroups(groups, multiples) { 12316 const length = groups.length; 12317 for (let i = 1; i < multiples; i++) { 12318 for (let j = 0; j < length; j++) { 12319 groups[j + i * length] = groups[j].slice(0); 12320 } 12321 } 12322} 12323 12324/** 12325 * Distinguishes different kinds of IR operations. 12326 * 12327 * Includes both creation and update operations. 12328 */ 12329var OpKind = /*#__PURE__*/function (OpKind) { 12330 /** 12331 * A special operation type which is used to represent the beginning and end nodes of a linked 12332 * list of operations. 12333 */ 12334 OpKind[OpKind["ListEnd"] = 0] = "ListEnd"; 12335 /** 12336 * An operation which wraps an output AST statement. 12337 */ 12338 OpKind[OpKind["Statement"] = 1] = "Statement";
12339 /** 12340 * An operation which declares and initializes a `SemanticVariable`. 12341 */ 12342 OpKind[OpKind["Variable"] = 2] = "Variable"; 12343 /** 12344 * An operation to begin rendering of an element. 12345 */ 12346 OpKind[OpKind["ElementStart"] = 3] = "ElementStart"; 12347 /** 12348 * An operation to render an element with no children. 12349 */ 12350 OpKind[OpKind["Element"] = 4] = "Element"; 12351 /** 12352 * An operation which declares an embedded view. 12353 */ 12354 OpKind[OpKind["Template"] = 5] = "Template"; 12355 /** 12356 * An operation to end rendering of an element previously started with `ElementStart`. 12357 */ 12358 OpKind[OpKind["ElementEnd"] = 6] = "ElementEnd"; 12359 /** 12360 * An operation to begin an `ng-container`. 12361 */ 12362 OpKind[OpKind["ContainerStart"] = 7] = "ContainerStart"; 12363 /** 12364 * An operation for an `ng-container` with no children. 12365 */ 12366 OpKind[OpKind["Container"] = 8] = "Container"; 12367 /** 12368 * An operation to end an `ng-container`. 12369 */ 12370 OpKind[OpKind["ContainerEnd"] = 9] = "ContainerEnd"; 12371 /** 12372 * An operation disable binding for subsequent elements, which are descendants of a non-bindable 12373 * node. 12374 */ 12375 OpKind[OpKind["DisableBindings"] = 10] = "DisableBindings"; 12376 /** 12377 * An op to conditionally render a template. 12378 */ 12379 OpKind[OpKind["Conditional"] = 11] = "Conditional"; 12380 /** 12381 * An operation to re-enable binding, after it was previously disabled. 12382 */ 12383 OpKind[OpKind["EnableBindings"] = 12] = "EnableBindings"; 12384 /** 12385 * An operation to render a text node. 12386 */ 12387 OpKind[OpKind["Text"] = 13] = "Text"; 12388 /** 12389 * An operation declaring an event listener for an element. 12390 */ 12391 OpKind[OpKind["Listener"] = 14] = "Listener"; 12392 /** 12393 * An operation to interpolate text into a text node. 12394 */ 12395 OpKind[OpKind["InterpolateText"] = 15] = "InterpolateText"; 12396 /** 12397 * An intermediate binding op, that has not yet been processed into an individual property, 12398 * attribute, style, etc. 12399 */ 12400 OpKind[OpKind["Binding"] = 16] = "Binding"; 12401 /** 12402 * An operation to bind an expression to a property of an element. 12403 */ 12404 OpKind[OpKind["Property"] = 17] = "Property"; 12405 /** 12406 * An operation to bind an expression to a style property of an element. 12407 */ 12408 OpKind[OpKind["StyleProp"] = 18] = "StyleProp"; 12409 /** 12410 * An operation to bind an expression to a class property of an element. 12411 */ 12412 OpKind[OpKind["ClassProp"] = 19] = "ClassProp"; 12413 /** 12414 * An operation to bind an expression to the styles of an element. 12415 */ 12416 OpKind[OpKind["StyleMap"] = 20] = "StyleMap"; 12417 /** 12418 * An operation to bind an expression to the classes of an element. 12419 */ 12420 OpKind[OpKind["ClassMap"] = 21] = "ClassMap"; 12421 /** 12422 * An operation to advance the runtime's implicit slot context during the update phase of a view. 12423 */ 12424 OpKind[OpKind["Advance"] = 22] = "Advance"; 12425 /** 12426 * An operation to instantiate a pipe. 12427 */ 12428 OpKind[OpKind["Pipe"] = 23] = "Pipe"; 12429 /** 12430 * An operation to associate an attribute with an element. 12431 */ 12432 OpKind[OpKind["Attribute"] = 24] = "Attribute"; 12433 /** 12434 * An attribute that has been extracted for inclusion in the consts array. 12435 */ 12436 OpKind[OpKind["ExtractedAttribute"] = 25] = "ExtractedAttribute"; 12437 /** 12438 * An operation that configures a `@defer` block. 12439 */ 12440 OpKind[OpKind["Defer"] = 26] = "Defer"; 12441 /** 12442 * An operation that controls when a `@defer` loads. 12443 */ 12444 OpKind[OpKind["DeferOn"] = 27] = "DeferOn"; 12445 /** 12446 * An operation that controls when a `@defer` loads, using a custom expression as the condition. 12447 */ 12448 OpKind[OpKind["DeferWhen"] = 28] = "DeferWhen"; 12449 /** 12450 * An i18n message that has been extracted for inclusion in the consts array. 12451 */ 12452 OpKind[OpKind["I18nMessage"] = 29] = "I18nMessage"; 12453 /** 12454 * A host binding property. 12455 */ 12456 OpKind[OpKind["HostProperty"] = 30] = "HostProperty"; 12457 /** 12458 * A namespace change, which causes the subsequent elements to be processed as either HTML or SVG. 12459 */ 12460 OpKind[OpKind["Namespace"] = 31] = "Namespace"; 12461 /** 12462 * Configure a content projeciton definition for the view. 12463 */ 12464 OpKind[OpKind["ProjectionDef"] = 32] = "ProjectionDef"; 12465 /** 12466 * Create a content projection slot. 12467 */ 12468 OpKind[OpKind["Projection"] = 33] = "Projection"; 12469 /** 12470 * Create a repeater creation instruction op. 12471 */ 12472 OpKind[OpKind["RepeaterCreate"] = 34] = "RepeaterCreate"; 12473 /** 12474 * An update up for a repeater. 12475 */ 12476 OpKind[OpKind["Repeater"] = 35] = "Repeater"; 12477 /** 12478 * An operation to bind an expression to the property side of a two-way binding. 12479 */ 12480 OpKind[OpKind["TwoWayProperty"] = 36] = "TwoWayProperty"; 12481 /** 12482 * An operation declaring the event side of a two-way binding. 12483 */ 12484 OpKind[OpKind["TwoWayListener"] = 37] = "TwoWayListener"; 12485 /** 12486 * A creation-time operation that initializes the slot for a `@let` declaration. 12487 */ 12488 OpKind[OpKind["DeclareLet"] = 38] = "DeclareLet"; 12489 /** 12490 * An update-time operation that stores the current value of a `@let` declaration. 12491 */ 12492 OpKind[OpKind["StoreLet"] = 39] = "StoreLet"; 12493 /** 12494 * The start of an i18n block. 12495 */ 12496 OpKind[OpKind["I18nStart"] = 40] = "I18nStart"; 12497 /**
12498 * A self-closing i18n on a single element. 12499 */ 12500 OpKind[OpKind["I18n"] = 41] = "I18n"; 12501 /** 12502 * The end of an i18n block. 12503 */ 12504 OpKind[OpKind["I18nEnd"] = 42] = "I18nEnd"; 12505 /** 12506 * An expression in an i18n message. 12507 */ 12508 OpKind[OpKind["I18nExpression"] = 43] = "I18nExpression"; 12509 /** 12510 * An instruction that applies a set of i18n expressions. 12511 */ 12512 OpKind[OpKind["I18nApply"] = 44] = "I18nApply"; 12513 /** 12514 * An instruction to create an ICU expression. 12515 */ 12516 OpKind[OpKind["IcuStart"] = 45] = "IcuStart"; 12517 /** 12518 * An instruction to update an ICU expression. 12519 */ 12520 OpKind[OpKind["IcuEnd"] = 46] = "IcuEnd"; 12521 /** 12522 * An instruction representing a placeholder in an ICU expression. 12523 */ 12524 OpKind[OpKind["IcuPlaceholder"] = 47] = "IcuPlaceholder"; 12525 /** 12526 * An i18n context containing information needed to generate an i18n message. 12527 */ 12528 OpKind[OpKind["I18nContext"] = 48] = "I18nContext"; 12529 /** 12530 * A creation op that corresponds to i18n attributes on an element. 12531 */ 12532 OpKind[OpKind["I18nAttributes"] = 49] = "I18nAttributes"; 12533 /** 12534 * Creation op that attaches the location at which an element was defined in a template to it. 12535 */ 12536 OpKind[OpKind["SourceLocation"] = 50] = "SourceLocation"; 12537 return OpKind; 12538}(OpKind || {}); 12539/** 12540 * Distinguishes different kinds of IR expressions. 12541 */ 12542var ExpressionKind = /*#__PURE__*/function (ExpressionKind) { 12543 /** 12544 * Read of a variable in a lexical scope. 12545 */ 12546 ExpressionKind[ExpressionKind["LexicalRead"] = 0] = "LexicalRead"; 12547 /** 12548 * A reference to the current view context. 12549 */ 12550 ExpressionKind[ExpressionKind["Context"] = 1] = "Context"; 12551 /** 12552 * A reference to the view context, for use inside a track function. 12553 */ 12554 ExpressionKind[ExpressionKind["TrackContext"] = 2] = "TrackContext"; 12555 /** 12556 * Read of a variable declared in a `VariableOp`. 12557 */ 12558 ExpressionKind[ExpressionKind["ReadVariable"] = 3] = "ReadVariable"; 12559 /** 12560 * Runtime operation to navigate to the next view context in the view hierarchy. 12561 */ 12562 ExpressionKind[ExpressionKind["NextContext"] = 4] = "NextContext"; 12563 /** 12564 * Runtime operation to retrieve the value of a local reference. 12565 */ 12566 ExpressionKind[ExpressionKind["Reference"] = 5] = "Reference"; 12567 /** 12568 * A call storing the value of a `@let` declaration. 12569 */ 12570 ExpressionKind[ExpressionKind["StoreLet"] = 6] = "StoreLet"; 12571 /** 12572 * A reference to a `@let` declaration read from the context view. 12573 */ 12574 ExpressionKind[ExpressionKind["ContextLetReference"] = 7] = "ContextLetReference"; 12575 /** 12576 * Runtime operation to snapshot the current view context. 12577 */ 12578 ExpressionKind[ExpressionKind["GetCurrentView"] = 8] = "GetCurrentView"; 12579 /** 12580 * Runtime operation to restore a snapshotted view. 12581 */ 12582 ExpressionKind[ExpressionKind["RestoreView"] = 9] = "RestoreView"; 12583 /** 12584 * Runtime operation to reset the current view context after `RestoreView`. 12585 */ 12586 ExpressionKind[ExpressionKind["ResetView"] = 10] = "ResetView"; 12587 /** 12588 * Defines and calls a function with change-detected arguments. 12589 */ 12590 ExpressionKind[ExpressionKind["PureFunctionExpr"] = 11] = "PureFunctionExpr"; 12591 /** 12592 * Indicates a positional parameter to a pure function definition. 12593 */ 12594 ExpressionKind[ExpressionKind["PureFunctionParameterExpr"] = 12] = "PureFunctionParameterExpr"; 12595 /** 12596 * Binding to a pipe transformation. 12597 */ 12598 ExpressionKind[ExpressionKind["PipeBinding"] = 13] = "PipeBinding"; 12599 /** 12600 * Binding to a pipe transformation with a variable number of arguments. 12601 */ 12602 ExpressionKind[ExpressionKind["PipeBindingVariadic"] = 14] = "PipeBindingVariadic"; 12603 /* 12604 * A safe property read requiring expansion into a null check. 12605 */ 12606 ExpressionKind[ExpressionKind["SafePropertyRead"] = 15] = "SafePropertyRead"; 12607 /** 12608 * A safe keyed read requiring expansion into a null check. 12609 */ 12610 ExpressionKind[ExpressionKind["SafeKeyedRead"] = 16] = "SafeKeyedRead"; 12611 /** 12612 * A safe function call requiring expansion into a null check. 12613 */ 12614 ExpressionKind[ExpressionKind["SafeInvokeFunction"] = 17] = "SafeInvokeFunction"; 12615 /** 12616 * An intermediate expression that will be expanded from a safe read into an explicit ternary. 12617 */ 12618 ExpressionKind[ExpressionKind["SafeTernaryExpr"] = 18] = "SafeTernaryExpr"; 12619 /** 12620 * An empty expression that will be stipped before generating the final output. 12621 */ 12622 ExpressionKind[ExpressionKind["EmptyExpr"] = 19] = "EmptyExpr"; 12623 /* 12624 * An assignment to a temporary variable. 12625 */ 12626 ExpressionKind[ExpressionKind["AssignTemporaryExpr"] = 20] = "AssignTemporaryExpr"; 12627 /** 12628 * A reference to a temporary variable. 12629 */ 12630 ExpressionKind[ExpressionKind["ReadTemporaryExpr"] = 21] = "ReadTemporaryExpr"; 12631 /** 12632 * An expression that will cause a literal slot index to be emitted. 12633 */ 12634 ExpressionKind[ExpressionKind["SlotLiteralExpr"] = 22] = "SlotLiteralExpr"; 12635 /** 12636 * A test expression for a conditional op. 12637 */ 12638 ExpressionKind[ExpressionKind["ConditionalCase"] = 23] = "ConditionalCase"; 12639 /** 12640 * An expression that will be automatically extracted to the component const array. 12641 */ 12642 ExpressionKind[ExpressionKind["ConstCollected"] = 24] = "ConstCollected"; 12643 /** 12644 * Operation that sets the value of a two-way binding. 12645 */ 12646 ExpressionKind[ExpressionKind["TwoWayBindingSet"] = 25] = "TwoWayBindingSet"; 12647 return ExpressionKind; 12648}(ExpressionKind || {}); 12649var VariableFlags = /*#__PURE__*/function (VariableFlags) { 12650 VariableFlags[VariableFlags["None"] = 0] = "None"; 12651 /** 12652 * Always inline this variable, regardless of the number of times it's used. 12653 * An `AlwaysInline` variable may not depend on context, because doing so may cause side effects 12654 * that are illegal when multi-inlined. (The optimizer will enforce this constraint.) 12655 */ 12656 VariableFlags[VariableFlags["AlwaysInline"] = 1] = "AlwaysInline"; 12657 return VariableFlags; 12658}(VariableFlags || {}); 12659/** 12660 * Distinguishes between different kinds of `SemanticVariable`s. 12661 */ 12662var SemanticVariableKind = /*#__PURE__*/function (SemanticVariableKind) { 12663 /** 12664 * Represents the context of a particular view. 12665 */ 12666 SemanticVariableKind[SemanticVariableKind["Context"] = 0] = "Context"; 12667 /** 12668 * Represents an identifier declared in the lexical scope of a view. 12669 */ 12670 SemanticVariableKind[SemanticVariableKind["Identifier"] = 1] = "Identifier"; 12671 /** 12672 * Represents a saved state that can be used to restore a view in a listener handler function. 12673 */ 12674 SemanticVariableKind[SemanticVariableKind["SavedView"] = 2] = "SavedView"; 12675 /** 12676 * An alias generated by a special embedded view type (e.g. a `@for` block). 12677 */ 12678 SemanticVariableKind[SemanticVariableKind["Alias"] = 3] = "Alias"; 12679 return SemanticVariableKind; 12680}(SemanticVariableKind || {}); 12681/** 12682 * Whether to compile in compatibilty mode. In compatibility mode, the template pipeline will 12683 * attempt to match the output of `TemplateDefinitionBuilder` as exactly as possible, at the cost 12684 * of producing quirky or larger code in some cases. 12685 */ 12686var CompatibilityMode = /*#__PURE__*/function (CompatibilityMode) { 12687 CompatibilityMode[CompatibilityMode["Normal"] = 0] = "Normal"; 12688 CompatibilityMode[CompatibilityMode["TemplateDefinitionBuilder"] = 1] = "TemplateDefinitionBuilder"; 12689 return CompatibilityMode; 12690}(CompatibilityMode || {}); 12691/** 12692 * Enumeration of the types of attributes which can be applied to an element. 12693 */ 12694var BindingKind = /*#__PURE__*/function (BindingKind) { 12695 /** 12696 * Static attributes. 12697 */ 12698 BindingKind[BindingKind["Attribute"] = 0] = "Attribute"; 12699 /** 12700 * Class bindings. 12701 */ 12702 BindingKind[BindingKind["ClassName"] = 1] = "ClassName"; 12703 /** 12704 * Style bindings. 12705 */ 12706 BindingKind[BindingKind["StyleProperty"] = 2] = "StyleProperty"; 12707 /** 12708 * Dynamic property bindings. 12709 */ 12710 BindingKind[BindingKind["Property"] = 3] = "Property"; 12711 /** 12712 * Property or attribute bindings on a template. 12713 */ 12714 BindingKind[BindingKind["Template"] = 4] = "Template"; 12715 /** 12716 * Internationalized attributes. 12717 */ 12718 BindingKind[BindingKind["I18n"] = 5] = "I18n"; 12719 /** 12720 * Animation property bindings. 12721 */ 12722 BindingKind[BindingKind["Animation"] = 6] = "Animation"; 12723 /** 12724 * Property side of a two-way binding. 12725 */ 12726 BindingKind[BindingKind["TwoWayProperty"] = 7] = "TwoWayProperty"; 12727 return BindingKind; 12728}(BindingKind || {}); 12729/** 12730 * Enumeration of possible times i18n params can be resolved. 12731 */ 12732var I18nParamResolutionTime = /*#__PURE__*/function (I18nParamResolutionTime) { 12733 /** 12734 * Param is resolved at message creation time. Most params should be resolved at message creation 12735 * time. However, ICU params need to be handled in post-processing. 12736 */ 12737 I18nParamResolutionTime[I18nParamResolutionTime["Creation"] = 0] = "Creation"; 12738 /** 12739 * Param is resolved during post-processing. This should be used for params whose value comes from 12740 * an ICU. 12741 */ 12742 I18nParamResolutionTime[I18nParamResolutionTime["Postproccessing"] = 1] = "Postproccessing"; 12743 return I18nParamResolutionTime; 12744}(I18nParamResolutionTime || {}); 12745/** 12746 * The contexts in which an i18n expression can be used. 12747 */ 12748var I18nExpressionFor = /*#__PURE__*/function (I18nExpressionFor) { 12749 /** 12750 * This expression is used as a value (i.e. inside an i18n block). 12751 */ 12752 I18nExpressionFor[I18nExpressionFor["I18nText"] = 0] = "I18nText"; 12753 /** 12754 * This expression is used in a binding. 12755 */ 12756 I18nExpressionFor[I18nExpressionFor["I18nAttribute"] = 1] = "I18nAttribute"; 12757 return I18nExpressionFor; 12758}(I18nExpressionFor || {}); 12759/** 12760 * Flags that describe what an i18n param value. These determine how the value is serialized into 12761 * the final map. 12762 */ 12763var I18nParamValueFlags = /*#__PURE__*/function (I18nParamValueFlags) { 12764 I18nParamValueFlags[I18nParamValueFlags["None"] = 0] = "None"; 12765 /** 12766 * This value represents an element tag. 12767 */ 12768 I18nParamValueFlags[I18nParamValueFlags["ElementTag"] = 1] = "ElementTag"; 12769 /** 12770 * This value represents a template tag. 12771 */ 12772 I18nParamValueFlags[I18nParamValueFlags["TemplateTag"] = 2] = "TemplateTag"; 12773 /** 12774 * This value represents the opening of a tag. 12775 */ 12776 I18nParamValueFlags[I18nParamValueFlags["OpenTag"] = 4] = "OpenTag"; 12777 /** 12778 * This value represents the closing of a tag. 12779 */ 12780 I18nParamValueFlags[I18nParamValueFlags["CloseTag"] = 8] = "CloseTag"; 12781 /** 12782 * This value represents an i18n expression index. 12783 */ 12784 I18nParamValueFlags[I18nParamValueFlags["ExpressionIndex"] = 16] = "ExpressionIndex"; 12785 return I18nParamValueFlags; 12786}(I18nParamValueFlags || {}); 12787/** 12788 * Whether the active namespace is HTML, MathML, or SVG mode. 12789 */ 12790var Namespace = /*#__PURE__*/function (Namespace) { 12791 Namespace[Namespace["HTML"] = 0] = "HTML"; 12792 Namespace[Namespace["SVG"] = 1] = "SVG"; 12793 Namespace[Namespace["Math"] = 2] = "Math"; 12794 return Namespace; 12795}(Namespace || {}); 12796/** 12797 * The type of a `@defer` trigger, for use in the ir. 12798 */ 12799var DeferTriggerKind = /*#__PURE__*/function (DeferTriggerKind) { 12800 DeferTriggerKind[DeferTriggerKind["Idle"] = 0] = "Idle"; 12801 DeferTriggerKind[DeferTriggerKind["Immediate"] = 1] = "Immediate"; 12802 DeferTriggerKind[DeferTriggerKind["Timer"] = 2] = "Timer"; 12803 DeferTriggerKind[DeferTriggerKind["Hover"] = 3] = "Hover"; 12804 DeferTriggerKind[DeferTriggerKind["Interaction"] = 4] = "Interaction"; 12805 DeferTriggerKind[DeferTriggerKind["Viewport"] = 5] = "Viewport"; 12806 DeferTriggerKind[DeferTriggerKind["Never"] = 6] = "Never"; 12807 return DeferTriggerKind; 12808}(DeferTriggerKind || {}); 12809/** 12810 * Kinds of i18n contexts. They can be created because of root i18n blocks, or ICUs. 12811 */ 12812var I18nContextKind = /*#__PURE__*/function (I18nContextKind) { 12813 I18nContextKind[I18nContextKind["RootI18n"] = 0] = "RootI18n"; 12814 I18nContextKind[I18nContextKind["Icu"] = 1] = "Icu"; 12815 I18nContextKind[I18nContextKind["Attr"] = 2] = "Attr"; 12816 return I18nContextKind; 12817}(I18nContextKind || {}); 12818var TemplateKind = /*#__PURE__*/function (TemplateKind) { 12819 TemplateKind[TemplateKind["NgTemplate"] = 0] = "NgTemplate"; 12820 TemplateKind[TemplateKind["Structural"] = 1] = "Structural"; 12821 TemplateKind[TemplateKind["Block"] = 2] = "Block"; 12822 return TemplateKind; 12823}(TemplateKind || {}); 12824/** 12825 * Marker symbol for `ConsumesSlotOpTrait`. 12826 */ 12827const ConsumesSlot = Symbol('ConsumesSlot'); 12828/** 12829 * Marker symbol for `DependsOnSlotContextOpTrait`. 12830 */ 12831const DependsOnSlotContext = Symbol('DependsOnSlotContext'); 12832/** 12833 * Marker symbol for `ConsumesVars` trait. 12834 */ 12835const ConsumesVarsTrait = Symbol('ConsumesVars'); 12836/** 12837 * Marker symbol for `UsesVarOffset` trait. 12838 */ 12839const UsesVarOffset = Symbol('UsesVarOffset'); 12840/** 12841 * Default values for most `ConsumesSlotOpTrait` fields (used with the spread operator to initialize 12842 * implementors of the trait). 12843 */ 12844const TRAIT_CONSUMES_SLOT = { 12845 [ConsumesSlot]: true, 12846 numSlotsUsed: 1 12847}; 12848/** 12849 * Default values for most `DependsOnSlotContextOpTrait` fields (used with the spread operator to 12850 * initialize implementors of the trait). 12851 */ 12852const TRAIT_DEPENDS_ON_SLOT_CONTEXT = { 12853 [DependsOnSlotContext]: true 12854}; 12855/** 12856 * Default values for `UsesVars` fields (used with the spread operator to initialize 12857 * implementors of the trait). 12858 */ 12859const TRAIT_CONSUMES_VARS = { 12860 [ConsumesVarsTrait]: true 12861}; 12862/** 12863 * Test whether an operation implements `ConsumesSlotOpTrait`. 12864 */ 12865function hasConsumesSlotTrait(op) { 12866 return op[ConsumesSlot] === true; 12867} 12868function hasDependsOnSlotContextTrait(value) { 12869 return value[DependsOnSlotContext] === true; 12870} 12871function hasConsumesVarsTrait(value) { 12872 return value[ConsumesVarsTrait] === true; 12873} 12874/** 12875 * Test whether an expression implements `UsesVarOffsetTrait`. 12876 */ 12877function hasUsesVarOffsetTrait(expr) { 12878 return expr[UsesVarOffset] === true; 12879} 12880 12881/** 12882 * Create a `StatementOp`. 12883 */ 12884function createStatementOp(statement) { 12885 return (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({ 12886 kind: OpKind.Statement, 12887 statement 12888 }, NEW_OP); 12889} 12890/** 12891 * Create a `VariableOp`. 12892 */ 12893function createVariableOp(xref, variable, initializer, flags) { 12894 return (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({ 12895 kind: OpKind.Variable, 12896 xref, 12897 variable, 12898 initializer, 12899 flags 12900 }, NEW_OP); 12901} 12902/** 12903 * Static structure shared by all operations. 12904 * 12905 * Used as a convenience via the spread operator (`...NEW_OP`) when creating new operations, and 12906 * ensures the fields are always in the same order. 12907 */ 12908const NEW_OP = { 12909 debugListId: null, 12910 prev: null, 12911 next: null 12912}; 12913 12914/** 12915 * Create an `InterpolationTextOp`. 12916 */ 12917function createInterpolateTextOp(xref, interpolation, sourceSpan) { 12918 return (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({ 12919 kind: OpKind.InterpolateText, 12920 target: xref, 12921 interpolation, 12922 sourceSpan 12923 }, TRAIT_DEPENDS_ON_SLOT_CONTEXT), TRAIT_CONSUMES_VARS), NEW_OP); 12924} 12925class Interpolation { 12926 constructor(strings, expressions, i18nPlaceholders) { 12927 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "strings", void 0); 12928 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "expressions", void 0); 12929 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "i18nPlaceholders", void 0); 12930 this.strings = strings; 12931 this.expressions = expressions; 12932 this.i18nPlaceholders = i18nPlaceholders; 12933 if (i18nPlaceholders.length !== 0 && i18nPlaceholders.length !== expressions.length) { 12934 throw new Error(`Expected ${expressions.length} placeholders to match interpolation expression count, but got ${i18nPlaceholders.length}`); 12935 } 12936 } 12937} 12938/** 12939 * Create a `BindingOp`, not yet transformed into a particular type of binding. 12940 */ 12941function createBindingOp(target, kind, name, expression, unit, securityContext, isText
12941Attribute, isStructuralTemplateAttribute, templateKind, i18nMessage, sourceSpan) { 12942 return (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({ 12943 kind: OpKind.Binding, 12944 bindingKind: kind, 12945 target, 12946 name, 12947 expression, 12948 unit, 12949 securityContext, 12950 isTextAttribute, 12951 isStructuralTemplateAttribute, 12952 templateKind, 12953 i18nContext: null, 12954 i18nMessage, 12955 sourceSpan 12956 }, NEW_OP); 12957} 12958/** 12959 * Create a `PropertyOp`. 12960 */ 12961function createPropertyOp(target, name, expression, isAnimationTrigger, securityContext, isStructuralTemplateAttribute, templateKind, i18nContext, i18nMessage, sourceSpan) { 12962 return (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({ 12963 kind: OpKind.Property, 12964 target, 12965 name, 12966 expression, 12967 isAnimationTrigger, 12968 securityContext, 12969 sanitizer: null, 12970 isStructuralTemplateAttribute, 12971 templateKind, 12972 i18nContext, 12973 i18nMessage, 12974 sourceSpan 12975 }, TRAIT_DEPENDS_ON_SLOT_CONTEXT), TRAIT_CONSUMES_VARS), NEW_OP); 12976} 12977/** 12978 * Create a `TwoWayPropertyOp`. 12979 */ 12980function createTwoWayPropertyOp(target, name, expression, securityContext, isStructuralTemplateAttribute, templateKind, i18nContext, i18nMessage, sourceSpan) { 12981 return (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({ 12982 kind: OpKind.TwoWayProperty, 12983 target, 12984 name, 12985 expression, 12986 securityContext, 12987 sanitizer: null, 12988 isStructuralTemplateAttribute, 12989 templateKind, 12990 i18nContext, 12991 i18nMessage, 12992 sourceSpan 12993 }, TRAIT_DEPENDS_ON_SLOT_CONTEXT), TRAIT_CONSUMES_VARS), NEW_OP); 12994} 12995/** Create a `StylePropOp`. */ 12996function createStylePropOp(xref, name, expression, unit, sourceSpan) { 12997 return (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({ 12998 kind: OpKind.StyleProp, 12999 target: xref, 13000 name, 13001 expression, 13002 unit, 13003 sourceSpan 13004 }, TRAIT_DEPENDS_ON_SLOT_CONTEXT), TRAIT_CONSUMES_VARS), NEW_OP); 13005} 13006/** 13007 * Create a `ClassPropOp`. 13008 */ 13009function createClassPropOp(xref, name, expression, sourceSpan) { 13010 return (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({ 13011 kind: OpKind.ClassProp, 13012 target: xref, 13013 name, 13014 expression, 13015 sourceSpan 13016 }, TRAIT_DEPENDS_ON_SLOT_CONTEXT), TRAIT_CONSUMES_VARS), NEW_OP); 13017} 13018/** Create a `StyleMapOp`. */ 13019function createStyleMapOp(xref, expression, sourceSpan) { 13020 return (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({ 13021 kind: OpKind.StyleMap, 13022 target: xref, 13023 expression, 13024 sourceSpan 13025 }, TRAIT_DEPENDS_ON_SLOT_CONTEXT), TRAIT_CONSUMES_VARS), NEW_OP); 13026} 13027/** 13028 * Create a `ClassMapOp`. 13029 */ 13030function createClassMapOp(xref, expression, sourceSpan) { 13031 return (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({ 13032 kind: OpKind.ClassMap, 13033 target: xref, 13034 expression, 13035 sourceSpan 13036 }, TRAIT_DEPENDS_ON_SLOT_CONTEXT), TRAIT_CONSUMES_VARS), NEW_OP); 13037} 13038/** 13039 * Create an `AttributeOp`. 13040 */ 13041function createAttributeOp(target, namespace, name, expression, securityContext, isTextAttribute, isStru
13041cturalTemplateAttribute, templateKind, i18nMessage, sourceSpan) { 13042 return (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({ 13043 kind: OpKind.Attribute, 13044 target, 13045 namespace, 13046 name, 13047 expression, 13048 securityContext, 13049 sanitizer: null, 13050 isTextAttribute, 13051 isStructuralTemplateAttribute, 13052 templateKind, 13053 i18nContext: null, 13054 i18nMessage, 13055 sourceSpan 13056 }, TRAIT_DEPENDS_ON_SLOT_CONTEXT), TRAIT_CONSUMES_VARS), NEW_OP); 13057} 13058/** 13059 * Create an `AdvanceOp`. 13060 */ 13061function createAdvanceOp(delta, sourceSpan) { 13062 return (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({ 13063 kind: OpKind.Advance, 13064 delta, 13065 sourceSpan 13066 }, NEW_OP); 13067} 13068/** 13069 * Create a conditional op, which will display an embedded view according to a condtion. 13070 */ 13071function createConditionalOp(target, test, conditions, sourceSpan) { 13072 return (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({ 13073 kind: OpKind.Conditional, 13074 target, 13075 test, 13076 conditions, 13077 processed: null, 13078 sourceSpan, 13079 contextValue: null 13080 }, NEW_OP), TRAIT_DEPENDS_ON_SLOT_CONTEXT), TRAIT_CONSUMES_VARS); 13081} 13082function createRepeaterOp(repeaterCreate, targetSlot, collection, sourceSpan) { 13083 return (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({ 13084 kind: OpKind.Repeater, 13085 target: repeaterCreate, 13086 targetSlot, 13087 collection, 13088 sourceSpan 13089 }, NEW_OP), TRAIT_DEPENDS_ON_SLOT_CONTEXT); 13090} 13091function createDeferWhenOp(target, expr, modifier, sourceSpan) { 13092 return (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({ 13093 kind: OpKind.DeferWhen, 13094 target, 13095 expr, 13096 modifier, 13097 sourceSpan 13098 }, NEW_OP), TRAIT_DEPENDS_ON_SLOT_CONTEXT), TRAIT_CONSUMES_VARS); 13099} 13100/** 13101 * Create an i18n expression op. 13102 */ 13103function createI18nExpressionOp(context, target, i18nOwner, handle, expression, icuPlaceholder, i18nPlaceholder, resolutionTime, usage, name, sourceSpan) { 13104 return (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({ 13105 kind: OpKind.I18nExpression, 13106 context, 13107 target, 13108 i18nOwner, 13109 handle, 13110 expression, 13111 icuPlaceholder, 13112 i18nPlaceholder, 13113 resolutionTime, 13114 usage, 13115 name, 13116 sourceSpan 13117 }, NEW_OP), TRAIT_CONSUMES_VARS), TRAIT_DEPENDS_ON_SLOT_CONTEXT); 13118} 13119/**
13120 * Creates an op to apply i18n expression ops. 13121 */ 13122function createI18nApplyOp(owner, handle, sourceSpan) { 13123 return (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({ 13124 kind: OpKind.I18nApply, 13125 owner, 13126 handle, 13127 sourceSpan 13128 }, NEW_OP); 13129} 13130/** 13131 * Creates a `StoreLetOp`. 13132 */ 13133function createStoreLetOp(target, declaredName, value, sourceSpan) { 13134 return (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({ 13135 kind: OpKind.StoreLet, 13136 target, 13137 declaredName, 13138 value, 13139 sourceSpan 13140 }, TRAIT_DEPENDS_ON_SLOT_CONTEXT), TRAIT_CONSUMES_VARS), NEW_OP); 13141} 13142 13143/** 13144 * Check whether a given `o.Expression` is a logical IR expression type. 13145 */ 13146function isIrExpression(expr) { 13147 return expr instanceof ExpressionBase; 13148} 13149/** 13150 * Base type used for all logical IR expressions. 13151 */ 13152class ExpressionBase extends Expression { 13153 constructor(sourceSpan = null) { 13154 super(null, sourceSpan); 13155 } 13156} 13157/** 13158 * Logical expression representing a lexical read of a variable name. 13159 */ 13160class LexicalReadExpr extends ExpressionBase { 13161 constructor(name) { 13162 super(); 13163 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "name", void 0); 13164 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "kind", ExpressionKind.LexicalRead); 13165 this.name = name; 13166 } 13167 visitExpression(visitor, context) {} 13168 isEquivalent(other) { 13169 // We assume that the lexical reads are in the same context, which must be true for parent 13170 // expressions to be equivalent. 13171 // TODO: is this generally safe? 13172 return this.name === other.name; 13173 } 13174 isConstant() { 13175 return false; 13176 } 13177 transformInternalExpressions() {} 13178 clone() { 13179 return new LexicalReadExpr(this.name); 13180 } 13181} 13182/** 13183 * Runtime operation to retrieve the value of a local reference. 13184 */ 13185class ReferenceExpr extends ExpressionBase { 13186 constructor(target, targetSlot, offset) { 13187 super(); 13188 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "target", void 0); 13189 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "targetSlot", void 0); 13190 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "offset", void 0); 13191 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "kind", ExpressionKind.Reference); 13192 this.target = target; 13193 this.targetSlot = targetSlot; 13194 this.offset = offset; 13195 } 13196 visitExpression() {} 13197 isEquivalent(e) { 13198 return e instanceof ReferenceExpr && e.target === this.target; 13199 } 13200 isConstant() { 13201 return false; 13202 } 13203 transformInternalExpressions() {} 13204 clone() { 13205 return new ReferenceExpr(this.target, this.targetSlot, this.offset); 13206 } 13207} 13208class StoreLetExpr extends ExpressionBase { 13209 constructor(target, value, sourceSpan) { 13210 super(); 13211 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "target", void 0); 13212 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "value", void 0); 13213 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "sourceSpan", void 0); 13214 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "kind", ExpressionKind.StoreLet); 13215 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, ConsumesVarsTrait, true); 13216 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, DependsOnSlotContext, true); 13217 this.target = target; 13218 this.value = value; 13219 this.sourceSpan = sourceSpan; 13220 } 13221 visitExpression() {} 13222 isEquivalent(e) { 13223 return e instanceof StoreLetExpr && e.target === this.target && e.value.isEquivalent(this.value); 13224 } 13225 isConstant() { 13226 return false;
13227 } 13228 transformInternalExpressions(transform, flags) { 13229 this.value = transformExpressionsInExpression(this.value, transform, flags); 13230 } 13231 clone() { 13232 return new StoreLetExpr(this.target, this.value, this.sourceSpan); 13233 } 13234} 13235class ContextLetReferenceExpr extends ExpressionBase { 13236 constructor(target, targetSlot) { 13237 super(); 13238 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "target", void 0); 13239 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "targetSlot", void 0); 13240 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "kind", ExpressionKind.ContextLetReference); 13241 this.target = target; 13242 this.targetSlot = targetSlot; 13243 } 13244 visitExpression() {} 13245 isEquivalent(e) { 13246 return e instanceof ContextLetReferenceExpr && e.target === this.target; 13247 } 13248 isConstant() { 13249 return false; 13250 } 13251 transformInternalExpressions() {} 13252 clone() { 13253 return new ContextLetReferenceExpr(this.target, this.targetSlot); 13254 } 13255} 13256/** 13257 * A reference to the current view context (usually the `ctx` variable in a template function). 13258 */ 13259class ContextExpr extends ExpressionBase { 13260 constructor(view) { 13261 super(); 13262 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "view", void 0); 13263 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "kind", ExpressionKind.Context); 13264 this.view = view; 13265 } 13266 visitExpression() {} 13267 isEquivalent(e) { 13268 return e instanceof ContextExpr && e.view === this.view; 13269 } 13270 isConstant() { 13271 return false; 13272 } 13273 transformInternalExpressions() {} 13274 clone() { 13275 return new ContextExpr(this.view); 13276 } 13277} 13278/** 13279 * A reference to the current view context inside a track function. 13280 */ 13281class TrackContextExpr extends ExpressionBase { 13282 constructor(view) { 13283 super(); 13284 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "view", void 0); 13285 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "kind", ExpressionKind.TrackContext); 13286 this.view = view; 13287 } 13288 visitExpression() {} 13289 isEquivalent(e) { 13290 return e instanceof TrackContextExpr && e.view === this.view; 13291 } 13292 isConstant() { 13293 return false; 13294 } 13295 transformInternalExpressions() {} 13296 clone() { 13297 return new TrackContextExpr(this.view); 13298 } 13299} 13300/** 13301 * Runtime operation to navigate to the next view context in the view hierarchy. 13302 */ 13303class NextContextExpr extends ExpressionBase { 13304 constructor() { 13305 super(); 13306 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "kind", ExpressionKind.NextContext); 13307 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "steps", 1); 13308 } 13309 visitExpression() {} 13310 isEquivalent(e) { 13311 return e instanceof NextContextExpr && e.steps === this.steps; 13312 } 13313 isConstant() { 13314 return false; 13315 } 13316 transformInternalExpressions() {} 13317 clone() { 13318 const expr = new NextContextExpr(); 13319 expr.steps = this.steps; 13320 return expr; 13321 } 13322} 13323/** 13324 * Runtime operation to snapshot the current view context. 13325 * 13326 * The result of this operation can be stored in a variable and later used with the `RestoreView` 13327 * operation. 13328 */ 13329class GetCurrentViewExpr extends ExpressionBase { 13330 constructor() { 13331 super(); 13332 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "kind", ExpressionKind.GetCurrentView); 13333 } 13334 visitExpression() {} 13335 isEquivalent(e) { 13336 return e instanceof GetCurrentViewExpr; 13337 } 13338 isConstant() { 13339 return false;
13340 } 13341 transformInternalExpressions() {} 13342 clone() { 13343 return new GetCurrentViewExpr(); 13344 } 13345} 13346/** 13347 * Runtime operation to restore a snapshotted view. 13348 */ 13349class RestoreViewExpr extends ExpressionBase { 13350 constructor(view) { 13351 super(); 13352 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "view", void 0); 13353 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "kind", ExpressionKind.RestoreView); 13354 this.view = view; 13355 } 13356 visitExpression(visitor, context) { 13357 if (typeof this.view !== 'number') { 13358 this.view.visitExpression(visitor, context); 13359 } 13360 } 13361 isEquivalent(e) { 13362 if (!(e instanceof RestoreViewExpr) || typeof e.view !== typeof this.view) { 13363 return false; 13364 } 13365 if (typeof this.view === 'number') { 13366 return this.view === e.view; 13367 } else { 13368 return this.view.isEquivalent(e.view); 13369 } 13370 } 13371 isConstant() { 13372 return false; 13373 } 13374 transformInternalExpressions(transform, flags) { 13375 if (typeof this.view !== 'number') { 13376 this.view = transformExpressionsInExpression(this.view, transform, flags); 13377 } 13378 } 13379 clone() { 13380 return new RestoreViewExpr(this.view instanceof Expression ? this.view.clone() : this.view); 13381 } 13382} 13383/** 13384 * Runtime operation to reset the current view context after `RestoreView`. 13385 */ 13386class ResetViewExpr extends ExpressionBase { 13387 constructor(expr) { 13388 super(); 13389 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "expr", void 0); 13390 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "kind", ExpressionKind.ResetView); 13391 this.expr = expr; 13392 } 13393 visitExpression(visitor, context) { 13394 this.expr.visitExpression(visitor, context); 13395 } 13396 isEquivalent(e) { 13397 return e instanceof ResetViewExpr && this.expr.isEquivalent(e.expr); 13398 } 13399 isConstant() { 13400 return false; 13401 } 13402 transformInternalExpressions(transform, flags) { 13403 this.expr = transformExpressionsInExpression(this.expr, transform, flags); 13404 } 13405 clone() { 13406 return new ResetViewExpr(this.expr.clone()); 13407 } 13408} 13409class TwoWayBindingSetExpr extends ExpressionBase { 13410 constructor(target, value) { 13411 super(); 13412 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "target", void 0); 13413 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "value", void 0); 13414 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "kind", ExpressionKind.TwoWayBindingSet); 13415 this.target = target; 13416 this.value = value; 13417 } 13418 visitExpression(visitor, context) { 13419 this.target.visitExpression(visitor, context); 13420 this.value.visitExpression(visitor, context); 13421 } 13422 isEquivalent(other) { 13423 return this.target.isEquivalent(other.target) && this.value.isEquivalent(other.value); 13424 } 13425 isConstant() { 13426 return false; 13427 } 13428 transformInternalExpressions(transform, flags) { 13429 this.target = transformExpressionsInExpression(this.target, transform, flags); 13430 this.value = transformExpressionsInExpression(this.value, transform, flags); 13431 } 13432 clone() { 13433 return new TwoWayBindingSetExpr(this.target, this.value); 13434 } 13435} 13436/** 13437 * Read of a variable declared as an `ir.VariableOp` and referenced through its `ir.XrefId`. 13438 */ 13439class ReadVariableExpr extends ExpressionBase { 13440 constructor(xref) { 13441 super(); 13442 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "xref", void 0); 13443 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "kind", ExpressionKind.ReadVariable); 13444 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "name", null); 13445 this.xref = xref; 13446 } 13447 visitExpression() {} 13448 isEquivalent(other) { 13449 return other instanceof ReadVariableExpr && other.xref === this.xref; 13450 } 13451 isConstant() { 13452 return false;
13453 } 13454 transformInternalExpressions() {} 13455 clone() { 13456 const expr = new ReadVariableExpr(this.xref); 13457 expr.name = this.name; 13458 return expr; 13459 } 13460} 13461class PureFunctionExpr extends ExpressionBase { 13462 constructor(expression, args) { 13463 super(); 13464 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "kind", ExpressionKind.PureFunctionExpr); 13465 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, ConsumesVarsTrait, true); 13466 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, UsesVarOffset, true); 13467 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "varOffset", null); 13468 /** 13469 * The expression which should be memoized as a pure computation. 13470 * 13471 * This expression contains internal `PureFunctionParameterExpr`s, which are placeholders for the 13472 * positional argument expressions in `args. 13473 */ 13474 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "body", void 0); 13475 /** 13476 * Positional arguments to the pure function which will memoize the `body` expression, which act 13477 * as memoization keys. 13478 */ 13479 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "args", void 0); 13480 /** 13481 * Once extracted to the `ConstantPool`, a reference to the function which defines the computation 13482 * of `body`. 13483 */ 13484 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "fn", null); 13485 this.body = expression; 13486 this.args = args; 13487 } 13488 visitExpression(visitor, context) { 13489 var _this$body; 13490 (_this$body = this.body) === null || _this$body === void 0 || _this$body.visitExpression(visitor, context); 13491 for (const arg of this.args) { 13492 arg.visitExpression(visitor, context); 13493 } 13494 } 13495 isEquivalent(other) { 13496 if (!(other instanceof PureFunctionExpr) || other.args.length !== this.args.length) { 13497 return false; 13498 } 13499 return other.body !== null && this.body !== null && other.body.isEquivalent(this.body) && other.args.every((arg, idx) => arg.isEquivalent(this.args[idx])); 13500 } 13501 isConstant() { 13502 return false; 13503 } 13504 transformInternalExpressions(transform, flags) { 13505 if (this.body !== null) {
13506 // TODO: figure out if this is the right flag to pass here. 13507 this.body = transformExpressionsInExpression(this.body, transform, flags | VisitorContextFlag.InChildOperation); 13508 } else if (this.fn !== null) { 13509 this.fn = transformExpressionsInExpression(this.fn, transform, flags); 13510 } 13511 for (let i = 0; i < this.args.length; i++) { 13512 this.args[i] = transformExpressionsInExpression(this.args[i], transform, flags); 13513 } 13514 } 13515 clone() { 13516 var _this$body$clone, _this$body2, _this$fn$clone, _this$fn; 13517 const expr = new PureFunctionExpr((_this$body$clone = (_this$body2 = this.body) === null || _this$body2 === void 0 ? void 0 : _this$body2.clone()) !== null && _this$body$clone !== void 0 ? _this$body$clone : null, this.args.map(arg => arg.clone())); 13518 expr.fn = (_this$fn$clone = (_this$fn = this.fn) === null || _this$fn === void 0 ? void 0 : _this$fn.clone()) !== null && _this$fn$clone !== void 0 ? _this$fn$clone : null; 13519 expr.varOffset = this.varOffset; 13520 return expr; 13521 } 13522} 13523class PureFunctionParameterExpr extends ExpressionBase { 13524 constructor(index) { 13525 super(); 13526 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "index", void 0); 13527 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "kind", ExpressionKind.PureFunctionParameterExpr); 13528 this.index = index; 13529 } 13530 visitExpression() {} 13531 isEquivalent(other) { 13532 return other instanceof PureFunctionParameterExpr && other.index === this.index; 13533 } 13534 isConstant() { 13535 return true; 13536 } 13537 transformInternalExpressions() {} 13538 clone() { 13539 return new PureFunctionParameterExpr(this.index); 13540 } 13541} 13542class PipeBindingExpr extends ExpressionBase { 13543 constructor(target, targetSlot, name, args) { 13544 super(); 13545 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "target", void 0); 13546 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "targetSlot", void 0); 13547 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "name", void 0); 13548 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "args", void 0); 13549 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "kind", ExpressionKind.PipeBinding); 13550 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, ConsumesVarsTrait, true); 13551 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, UsesVarOffset, true); 13552 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "varOffset", null); 13553 this.target = target; 13554 this.targetSlot = targetSlot; 13555 this.name = name; 13556 this.args = args; 13557 } 13558 visitExpression(visitor, context) { 13559 for (const arg of this.args) { 13560 arg.visitExpression(visitor, context); 13561 } 13562 } 13563 isEquivalent() { 13564 return false; 13565 } 13566 isConstant() { 13567 return false; 13568 } 13569 transformInternalExpressions(transform, flags) { 13570 for (let idx = 0; idx < this.args.length; idx++) { 13571 this.args[idx] = transformExpressionsInExpression(this.args[idx], transform, flags); 13572 } 13573 } 13574 clone() { 13575 const r = new PipeBindingExpr(this.target, this.targetSlot, this.name, this.args.map(a => a.clone())); 13576 r.varOffset = this.varOffset; 13577 return r; 13578 } 13579}
13580class PipeBindingVariadicExpr extends ExpressionBase { 13581 constructor(target, targetSlot, name, args, numArgs) { 13582 super(); 13583 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "target", void 0); 13584 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "targetSlot", void 0); 13585 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "name", void 0); 13586 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "args", void 0); 13587 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "numArgs", void 0); 13588 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "kind", ExpressionKind.PipeBindingVariadic); 13589 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, ConsumesVarsTrait, true); 13590 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, UsesVarOffset, true); 13591 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "varOffset", null); 13592 this.target = target; 13593 this.targetSlot = targetSlot; 13594 this.name = name; 13595 this.args = args; 13596 this.numArgs = numArgs; 13597 } 13598 visitExpression(visitor, context) { 13599 this.args.visitExpression(visitor, context); 13600 } 13601 isEquivalent() { 13602 return false; 13603 } 13604 isConstant() { 13605 return false; 13606 } 13607 transformInternalExpressions(transform, flags) { 13608 this.args = transformExpressionsInExpression(this.args, transform, flags); 13609 } 13610 clone() { 13611 const r = new PipeBindingVariadicExpr(this.target, this.targetSlot, this.name, this.args.clone(), this.numArgs); 13612 r.varOffset = this.varOffset; 13613 return r; 13614 } 13615} 13616class SafePropertyReadExpr extends ExpressionBase { 13617 constructor(receiver, name) { 13618 super(); 13619 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "receiver", void 0); 13620 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "name", void 0); 13621 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "kind", ExpressionKind.SafePropertyRead); 13622 this.receiver = receiver; 13623 this.name = name; 13624 } 13625 // An alias for name, which allows other logic to handle property reads and keyed reads together. 13626 get index() { 13627 return this.name; 13628 } 13629 visitExpression(visitor, context) { 13630 this.receiver.visitExpression(visitor, context); 13631 } 13632 isEquivalent() { 13633 return false; 13634 } 13635 isConstant() { 13636 return false; 13637 } 13638 transformInternalExpressions(transform, flags) { 13639 this.receiver = transformExpressionsInExpression(this.receiver, transform, flags); 13640 } 13641 clone() { 13642 return new SafePropertyReadExpr(this.receiver.clone(), this.name); 13643 } 13644} 13645class SafeKeyedReadExpr extends ExpressionBase { 13646 constructor(receiver, index, sourceSpan) { 13647 super(sourceSpan); 13648 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "receiver", void 0); 13649 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "index", void 0); 13650 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "kind", ExpressionKind.SafeKeyedRead); 13651 this.receiver = receiver; 13652 this.index = index; 13653 } 13654 visitExpression(visitor, context) { 13655 this.receiver.visitExpression(visitor, context); 13656 this.index.visitExpression(visitor, context); 13657 } 13658 isEquivalent() { 13659 return false;
13660 } 13661 isConstant() { 13662 return false; 13663 } 13664 transformInternalExpressions(transform, flags) { 13665 this.receiver = transformExpressionsInExpression(this.receiver, transform, flags); 13666 this.index = transformExpressionsInExpression(this.index, transform, flags); 13667 } 13668 clone() { 13669 return new SafeKeyedReadExpr(this.receiver.clone(), this.index.clone(), this.sourceSpan); 13670 } 13671} 13672class SafeInvokeFunctionExpr extends ExpressionBase { 13673 constructor(receiver, args) { 13674 super(); 13675 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "receiver", void 0); 13676 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "args", void 0); 13677 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "kind", ExpressionKind.SafeInvokeFunction); 13678 this.receiver = receiver; 13679 this.args = args; 13680 } 13681 visitExpression(visitor, context) { 13682 this.receiver.visitExpression(visitor, context); 13683 for (const a of this.args) { 13684 a.visitExpression(visitor, context); 13685 } 13686 } 13687 isEquivalent() { 13688 return false; 13689 } 13690 isConstant() { 13691 return false; 13692 } 13693 transformInternalExpressions(transform, flags) { 13694 this.receiver = transformExpressionsInExpression(this.receiver, transform, flags); 13695 for (let i = 0; i < this.args.length; i++) { 13696 this.args[i] = transformExpressionsInExpression(this.args[i], transform, flags); 13697 } 13698 } 13699 clone() { 13700 return new SafeInvokeFunctionExpr(this.receiver.clone(), this.args.map(a => a.clone())); 13701 } 13702} 13703class SafeTernaryExpr extends ExpressionBase { 13704 constructor(guard, expr) { 13705 super(); 13706 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "guard", void 0); 13707 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "expr", void 0); 13708 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "kind", ExpressionKind.SafeTernaryExpr); 13709 this.guard = guard; 13710 this.expr = expr; 13711 } 13712 visitExpression(visitor, context) { 13713 this.guard.visitExpression(visitor, context); 13714 this.expr.visitExpression(visitor, context); 13715 } 13716 isEquivalent() { 13717 return false; 13718 } 13719 isConstant() { 13720 return false; 13721 } 13722 transformInternalExpressions(transform, flags) { 13723 this.guard = transformExpressionsInExpression(this.guard, transform, flags); 13724 this.expr = transformExpressionsInExpression(this.expr, transform, flags); 13725 } 13726 clone() { 13727 return new SafeTernaryExpr(this.guard.clone(), this.expr.clone()); 13728 } 13729} 13730class EmptyExpr extends ExpressionBase { 13731 constructor(...args) { 13732 super(...args); 13733 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "kind", ExpressionKind.EmptyExpr); 13734 } 13735 visitExpression(visitor, context) {} 13736 isEquivalent(e) { 13737 return e instanceof EmptyExpr; 13738 } 13739 isConstant() { 13740 return true; 13741 } 13742 clone() { 13743 return new EmptyExpr(); 13744 } 13745 transformInternalExpressions() {} 13746} 13747class AssignTemporaryExpr extends ExpressionBase { 13748 constructor(expr, xref) { 13749 super(); 13750 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "expr", void 0); 13751 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "xref", void 0); 13752 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "kind", ExpressionKind.AssignTemporaryExpr); 13753 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "name", null); 13754 this.expr = expr; 13755 this.xref = xref; 13756 } 13757 visitExpression(visitor, context) { 13758 this.expr.visitExpression(visitor, context); 13759 } 13760 isEquivalent() { 13761 return false;
13762 } 13763 isConstant() { 13764 return false; 13765 } 13766 transformInternalExpressions(transform, flags) { 13767 this.expr = transformExpressionsInExpression(this.expr, transform, flags); 13768 } 13769 clone() { 13770 const a = new AssignTemporaryExpr(this.expr.clone(), this.xref); 13771 a.name = this.name; 13772 return a; 13773 } 13774} 13775class ReadTemporaryExpr extends ExpressionBase { 13776 constructor(xref) { 13777 super(); 13778 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "xref", void 0); 13779 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "kind", ExpressionKind.ReadTemporaryExpr); 13780 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "name", null); 13781 this.xref = xref; 13782 } 13783 visitExpression(visitor, context) {} 13784 isEquivalent() { 13785 return this.xref === this.xref; 13786 } 13787 isConstant() { 13788 return false; 13789 } 13790 transformInternalExpressions(transform, flags) {} 13791 clone() { 13792 const r = new ReadTemporaryExpr(this.xref); 13793 r.name = this.name; 13794 return r; 13795 } 13796} 13797class SlotLiteralExpr extends ExpressionBase { 13798 constructor(slot) { 13799 super(); 13800 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "slot", void 0); 13801 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "kind", ExpressionKind.SlotLiteralExpr); 13802 this.slot = slot; 13803 } 13804 visitExpression(visitor, context) {} 13805 isEquivalent(e) { 13806 return e instanceof SlotLiteralExpr && e.slot === this.slot; 13807 } 13808 isConstant() { 13809 return true; 13810 } 13811 clone() { 13812 return new SlotLiteralExpr(this.slot); 13813 } 13814 transformInternalExpressions() {} 13815} 13816class ConditionalCaseExpr extends ExpressionBase { 13817 /** 13818 * Create an expression for one branch of a conditional. 13819 * @param expr The expression to be tested for this case. Might be null, as in an `else` case. 13820 * @param target The Xref of the view to be displayed if this condition is true. 13821 */ 13822 constructor(expr, target, targetSlot, alias = null) { 13823 super(); 13824 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "expr", void 0); 13825 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "target", void 0); 13826 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "targetSlot", void 0); 13827 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "alias", void 0); 13828 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "kind", ExpressionKind.ConditionalCase); 13829 this.expr = expr; 13830 this.target = target; 13831 this.targetSlot = targetSlot; 13832 this.alias = alias; 13833 } 13834 visitExpression(visitor, context) { 13835 if (this.expr !== null) { 13836 this.expr.visitExpression(visitor, context); 13837 } 13838 } 13839 isEquivalent(e) { 13840 return e instanceof ConditionalCaseExpr && e.expr === this.expr; 13841 } 13842 isConstant() { 13843 return true; 13844 } 13845 clone() { 13846 return new ConditionalCaseExpr(this.expr, this.target, this.targetSlot); 13847 } 13848 transformInternalExpressions(transform, flags) { 13849 if (this.expr !== null) { 13850 this.expr = transformExpressionsInExpression(this.expr, transform, flags); 13851 } 13852 } 13853} 13854class ConstCollectedExpr extends ExpressionBase { 13855 constructor(expr) { 13856 super(); 13857 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "expr", void 0); 13858 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "kind", ExpressionKind.Const
13858Collected); 13859 this.expr = expr; 13860 } 13861 transformInternalExpressions(transform, flags) { 13862 this.expr = transform(this.expr, flags); 13863 } 13864 visitExpression(visitor, context) { 13865 this.expr.visitExpression(visitor, context); 13866 } 13867 isEquivalent(e) { 13868 if (!(e instanceof ConstCollectedExpr)) { 13869 return false; 13870 } 13871 return this.expr.isEquivalent(e.expr); 13872 } 13873 isConstant() { 13874 return this.expr.isConstant(); 13875 } 13876 clone() { 13877 return new ConstCollectedExpr(this.expr); 13878 } 13879} 13880/** 13881 * Visits all `Expression`s in the AST of `op` with the `visitor` function. 13882 */ 13883function visitExpressionsInOp(op, visitor) { 13884 transformExpressionsInOp(op, (expr, flags) => { 13885 visitor(expr, flags); 13886 return expr; 13887 }, VisitorContextFlag.None); 13888} 13889var VisitorContextFlag = /*#__PURE__*/function (VisitorContextFlag) { 13890 VisitorContextFlag[VisitorContextFlag["None"] = 0] = "None"; 13891 VisitorContextFlag[VisitorContextFlag["InChildOperation"] = 1] = "InChildOperation"; 13892 return VisitorContextFlag; 13893}(VisitorContextFlag || {}); 13894function transformExpressionsInInterpolation(interpolation, transform, flags) { 13895 for (let i = 0; i < interpolation.expressions.length; i++) { 13896 interpolation.expressions[i] = transformExpressionsInExpression(interpolation.expressions[i], transform, flags); 13897 } 13898} 13899/** 13900 * Transform all `Expression`s in the AST of `op` with the `transform` function. 13901 * 13902 * All such operations will be replaced with the result of applying `transform`, which may be an 13903 * identity transformation. 13904 */ 13905function transformExpressionsInOp(op, transform, flags) { 13906 switch (op.kind) { 13907 case OpKind.StyleProp: 13908 case OpKind.StyleMap: 13909 case OpKind.ClassProp: 13910 case OpKind.ClassMap: 13911 case OpKind.Binding: 13912 if (op.expression instanceof Interpolation) { 13913 transformExpressionsInInterpolation(op.expression, transform, flags); 13914 } else { 13915 op.expression = transformExpressionsInExpression(op.expression, transform, flags); 13916 } 13917 break; 13918 case OpKind.Property: 13919 case OpKind.HostProperty: 13920 case OpKind.Attribute: 13921 if (op.expression instanceof Interpolation) { 13922 transformExpressionsInInterpolation(op.expression, transform, flags); 13923 } else { 13924 op.expression = transformExpressionsInExpression(op.expression, transform, flags); 13925 } 13926 op.sanitizer = op.sanitizer && transformExpressionsInExpression(op.sanitizer, transform, flags); 13927 break; 13928 case OpKind.TwoWayProperty: 13929 op.expression = transformExpressionsInExpression(op.expression, transform, flags); 13930 op.sanitizer = op.sanitizer && transformExpressionsInExpression(op.sanitizer, transform, flags); 13931 break; 13932 case OpKind.I18nExpression: 13933 op.expression = transformExpressionsInExpression(op.expression, transform, flags); 13934 break; 13935 case OpKind.InterpolateText: 13936 transformExpressionsInInterpolation(op.interpolation, transform, flags); 13937 break; 13938 case OpKind.Statement: 13939 transformExpressionsInStatement(op.statement, transform, flags); 13940 break; 13941 case OpKind.Variable: 13942 op.initializer = transformExpressionsInExpression(op.initializer, transform, flags); 13943 break; 13944 case OpKind.Conditional: 13945 for (const condition of op.conditions) { 13946 if (condition.expr === null) { 13947 // This is a default case. 13948 continue; 13949 } 13950 condition.expr = transformExpressionsInExpression(condition.expr, transform, flags); 13951 } 13952 if (op.processed !== null) { 13953 op.processed = transformExpressionsInExpression(op.processed, transform, flags); 13954 } 13955 if (op.contextValue !== null) { 13956 op.contextValue = transformExpressionsInExpression(op.contextValue, transform, flags); 13957 } 13958 break; 13959 case OpKind.Listener: 13960 case OpKind.TwoWayListener: 13961 for (const innerOp of op.handlerOps) { 13962 transformExpressionsInOp(innerOp, transform, flags | VisitorContextFlag.InChildOperation); 13963 } 13964 break; 13965 case OpKind.ExtractedAttribute: 13966 op.expression = op.expression && transformExpressionsInExpression(op.expression, transform, flags); 13967 op.trustedValueFn = op.trustedValueFn && transformExpressionsInExpression(op.trustedValueFn, transform, flags); 13968 break; 13969 case OpKind.RepeaterCreate:
13970 if (op.trackByOps === null) { 13971 op.track = transformExpressionsInExpression(op.track, transform, flags); 13972 } else { 13973 for (const innerOp of op.trackByOps) { 13974 transformExpressionsInOp(innerOp, transform, flags | VisitorContextFlag.InChildOperation); 13975 } 13976 } 13977 if (op.trackByFn !== null) { 13978 op.trackByFn = transformExpressionsInExpression(op.trackByFn, transform, flags); 13979 } 13980 break; 13981 case OpKind.Repeater: 13982 op.collection = transformExpressionsInExpression(op.collection, transform, flags); 13983 break; 13984 case OpKind.Defer: 13985 if (op.loadingConfig !== null) { 13986 op.loadingConfig = transformExpressionsInExpression(op.loadingConfig, transform, flags); 13987 } 13988 if (op.placeholderConfig !== null) { 13989 op.placeholderConfig = transformExpressionsInExpression(op.placeholderConfig, transform, flags); 13990 } 13991 if (op.resolverFn !== null) { 13992 op.resolverFn = transformExpressionsInExpression(op.resolverFn, transform, flags); 13993 } 13994 break; 13995 case OpKind.I18nMessage: 13996 for (const [placeholder, expr] of op.params) { 13997 op.params.set(placeholder, transformExpressionsInExpression(expr, transform, flags)); 13998 } 13999 for (const [placeholder, expr] of op.postprocessingParams) { 14000 op.postprocessingParams.set(placeholder, transformExpressionsInExpression(expr, transform, flags)); 14001 } 14002 break; 14003 case OpKind.DeferWhen: 14004 op.expr = transformExpressionsInExpression(op.expr, transform, flags); 14005 break; 14006 case OpKind.StoreLet: 14007 op.value = transformExpressionsInExpression(op.value, transform, flags); 14008 break; 14009 case OpKind.Advance: 14010 case OpKind.Container: 14011 case OpKind.ContainerEnd: 14012 case OpKind.ContainerStart: 14013 case OpKind.DeferOn: 14014 case OpKind.DisableBindings: 14015 case OpKind.Element: 14016 case OpKind.ElementEnd: 14017 case OpKind.ElementStart: 14018 case OpKind.EnableBindings: 14019 case OpKind.I18n: 14020 case OpKind.I18nApply: 14021 case OpKind.I18nContext: 14022 case OpKind.I18nEnd: 14023 case OpKind.I18nStart: 14024 case OpKind.IcuEnd: 14025 case OpKind.IcuStart: 14026 case OpKind.Namespace: 14027 case OpKind.Pipe: 14028 case OpKind.Projection: 14029 case OpKind.ProjectionDef: 14030 case OpKind.Template: 14031 case OpKind.Text: 14032 case OpKind.I18nAttributes: 14033 case OpKind.IcuPlaceholder: 14034 case OpKind.DeclareLet: 14035 case OpKind.SourceLocation: 14036 // These operations contain no expressions. 14037 break; 14038 default: 14039 throw new Error(`AssertionError: transformExpressionsInOp doesn't handle ${OpKind[op.kind]}`); 14040 } 14041} 14042/** 14043 * Transform all `Expression`s in the AST of `expr` with the `transform` function. 14044 * 14045 * All such operations will be replaced with the result of applying `transform`, which may be an 14046 * identity transformation. 14047 */ 14048function transformExpressionsInExpression(expr, transform, flags) { 14049 if (expr instanceof ExpressionBase) { 14050 expr.transformInternalExpressions(transform, flags); 14051 } else if (expr instanceof BinaryOperatorExpr) { 14052 expr.lhs = transformExpressionsInExpression(expr.lhs, transform, flags); 14053 expr.rhs = transformExpressionsInExpression(expr.rhs, transform, flags); 14054 } else if (expr instanceof UnaryOperatorExpr) { 14055 expr.expr = transformExpressionsInExpression(expr.expr, transform, flags); 14056 } else if (expr instanceof ReadPropExpr) { 14057 expr.receiver = transformExpressionsInExpression(expr.receiver, transform, flags); 14058 } else if (expr instanceof ReadKeyExpr) { 14059 expr.receiver = transformExpressionsInExpression(expr.receiver, transform, flags); 14060 expr.index = transformExpressionsInExpression(expr.index, transform, flags); 14061 } else if (expr instanceof WritePropExpr) { 14062 expr.receiver = transformExpressionsInExpression(expr.receiver, transform, flags); 14063 expr.value = transformExpressionsInExpression(expr.value, transform, flags); 14064 } else if (expr instanceof WriteKeyExpr) { 14065 expr.receiver = transformExpressionsInExpression(expr.receiver, transform, flags); 14066 expr.index = transformExpressionsInExpression(expr.index, transform, flags); 14067 expr.value = transformExpressionsInExpression(expr.value, transform, flags); 14068 } else if (expr instanceof InvokeFunctionExpr) { 14069 expr.fn = transformExpressionsInExpression(expr.fn, transform, flags); 14070 for (let i = 0; i < expr.args.length; i++) { 14071 expr.args[i] = transformExpressionsInExpression(expr.args[i], transform, flags); 14072 } 14073 } else if (expr instanceof LiteralArrayExpr) { 14074 for (let i = 0; i < expr.entries.length; i++) { 14075 expr.entries[i] = transformExpressionsInExpression(expr.entries[i], transform, flags); 14076 } 14077 } else if (expr instanceof LiteralMapExpr) { 14078 for (let i = 0; i < expr.entries.length; i++) { 14079 expr.entries[i].value = transformExpressionsInExpression(expr.entries[i].value, transform, flags); 14080 } 14081 } else if (expr instanceof ConditionalExpr) { 14082 expr.condition = transformExpressionsInExpression(expr.condition, transform, flags); 14083 expr.trueCase = transformExpressionsInExpression(expr.trueCase, transform, flags); 14084 if (expr.falseCase !== null) { 14085 expr.falseCase = transformExpressionsInExpression(expr.falseCase, transform, flags); 14086 } 14087 } else if (expr instanceof TypeofExpr) { 14088 expr.expr = transformExpressionsInExpression(expr.expr, transform, flags); 14089 }
14089 else if (expr instanceof WriteVarExpr) { 14090 expr.value = transformExpressionsInExpression(expr.value, transform, flags); 14091 } else if (expr instanceof LocalizedString) { 14092 for (let i = 0; i < expr.expressions.length; i++) { 14093 expr.expressions[i] = transformExpressionsInExpression(expr.expressions[i], transform, flags); 14094 } 14095 } else if (expr instanceof NotExpr) { 14096 expr.condition = transformExpressionsInExpression(expr.condition, transform, flags); 14097 } else if (expr instanceof TaggedTemplateLiteralExpr) { 14098 expr.tag = transformExpressionsInExpression(expr.tag, transform, flags); 14099 expr.template.expressions = expr.template.expressions.map(e => transformExpressionsInExpression(e, transform, flags)); 14100 } else if (expr instanceof ArrowFunctionExpr) { 14101 if (Array.isArray(expr.body)) { 14102 for (let i = 0; i < expr.body.length; i++) { 14103 transformExpressionsInStatement(expr.body[i], transform, flags); 14104 } 14105 } else { 14106 expr.body = transformExpressionsInExpression(expr.body, transform, flags); 14107 } 14108 } else if (expr instanceof WrappedNodeExpr) ;else if (expr instanceof TemplateLiteralExpr) { 14109 for (let i = 0; i < expr.expressions.length; i++) { 14110 expr.expressions[i] = transformExpressionsInExpression(expr.expressions[i], transform, flags); 14111 } 14112 } else if (expr instanceof ReadVarExpr || expr instanceof ExternalExpr || expr instanceof LiteralExpr) ;else { 14113 throw new Error(`Unhandled expression kind: ${expr.constructor.name}`); 14114 } 14115 return transform(expr, flags); 14116} 14117/** 14118 * Transform all `Expression`s in the AST of `stmt` with the `transform` function. 14119 * 14120 * All such operations will be replaced with the result of applying `transform`, which may be an 14121 * identity transformation. 14122 */ 14123function transformExpressionsInStatement(stmt, transform, flags) { 14124 if (stmt instanceof ExpressionStatement) { 14125 stmt.expr = transformExpressionsInExpression(stmt.expr, transform, flags); 14126 } else if (stmt instanceof ReturnStatement) { 14127 stmt.value = transformExpressionsInExpression(stmt.value, transform, flags); 14128 } else if (stmt instanceof DeclareVarStmt) { 14129 if (stmt.value !== undefined) { 14130 stmt.value = transformExpressionsInExpression(stmt.value, transform, flags); 14131 } 14132 } else if (stmt instanceof IfStmt) { 14133 stmt.condition = transformExpressionsInExpression(stmt.condition, transform, flags); 14134 for (const caseStatement of stmt.trueCase) { 14135 transformExpressionsInStatement(caseStatement, transform, flags); 14136 } 14137 for (const caseStatement of stmt.falseCase) { 14138 transformExpressionsInStatement(caseStatement, transform, flags); 14139 } 14140 } else { 14141 throw new Error(`Unhandled statement kind: ${stmt.constructor.name}`); 14142 } 14143} 14144/** 14145 * Checks whether the given expression is a string literal. 14146 */ 14147function isStringLiteral(expr) { 14148 return expr instanceof LiteralExpr && typeof expr.value === 'string'; 14149} 14150 14151/** 14152 * A linked list of `Op` nodes of a given subtype. 14153 * 14154 * @param OpT specific subtype of `Op` nodes which this list contains. 14155 */ 14156let OpList = /*#__PURE__*/(() => { 14157 class OpList { 14158 constructor() { 14159 /** 14160 * Debug ID of this `OpList` instance. 14161 */ 14162 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "debugListId", OpList.nextListId++); 14163 // OpList uses static head/tail nodes of a special `ListEnd` type. 14164 // This avoids the need for special casing of the first and last list 14165 // elements in all list operations. 14166 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "head", { 14167 kind: OpKind.ListEnd, 14168 next: null, 14169 prev: null, 14170 debugListId: this.debugListId 14171 }); 14172 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "tail", { 14173 kind: OpKind.ListEnd, 14174 next: null, 14175 prev: null, 14176 debugListId: this.debugListId 14177 }); 14178 // Link `head` and `tail` together at the start (list is empty). 14179 this.head.next = this.tail; 14180 this.tail.prev = this.head; 14181 } 14182 /** 14183 * Push a new operation to the tail of the list. 14184 */ 14185 push(op) { 14186 if (Array.isArray(op)) { 14187 for (const o of op) { 14188 this.push(o); 14189 } 14190 return; 14191 } 14192 OpList.assertIsNotEnd(op); 14193 OpList.assertIsUnowned(op); 14194 op.debugListId = this.debugListId; 14195 // The old "previous" node (which might be the head, if the list is empty). 14196 const oldLast = this.tail.prev; 14197 // Insert `op` following the old last node. 14198 op.prev = oldLast; 14199 oldLast.next = op; 14200 // Connect `op` with the list tail. 14201 op.next = this.tail; 14202 this.tail.prev = op; 14203 } 14204 /** 14205 * Prepend one or more nodes to the start of the list. 14206 */ 14207 prepend(ops) { 14208 if (ops.length === 0) { 14209 return; 14210 } 14211 for (const op of ops) { 14212 OpList.assertIsNotEnd(op); 14213 OpList.assertIsUnowned(op); 14214 op.debugListId = this.debugListId; 14215 } 14216 const first = this.head.next; 14217 let prev = this.head; 14218 for (const op of ops) { 14219 prev.next = op; 14220 op.prev = prev; 14221 prev = op; 14222 } 14223 prev.next = first; 14224 first.prev = prev; 14225 } 14226 /** 14227 * `OpList` is iterable via the iteration protocol. 14228 * 14229 * It's safe to mutate the part of the list that has already been returned by the iterator, up to 14230 * and including the last operation returned. Mutations beyond that point _may_ be safe, but may 14231 * also corrupt the iteration position and should be avoided. 14232 */ 14233 *[Symbol.iterator]() { 14234 let current = this.head.next; 14235 while (current !== this.tail) { 14236 // Guards against corruption of the iterator state by mutations to the tail of the list during 14237 // iteration. 14238 OpList.assertIsOwned(current, this.debugListId); 14239 const next = current.next; 14240 yield current; 14241 current = next; 14242 } 14243 } 14244 *reversed() { 14245 let current = this.tail.prev; 14246 while (current !== this.head) { 14247 OpList.assertIsOwned(current, this.debugListId); 14248 const prev = current.prev; 14249 yield current; 14250 current = prev; 14251 } 14252 } 14253 /** 14254 * Replace `oldOp` with `newOp` in the list. 14255 */ 14256 static replace(oldOp, newOp) { 14257 OpList.assertIsNotEnd(oldOp); 14258 OpList.assertIsNotEnd(newOp); 14259 OpList.assertIsOwned(oldOp); 14260 OpList.assertIsUnowned(newOp); 14261 newOp.debugListId = oldOp.debugListId; 14262 if (oldOp.prev !== null) { 14263 oldOp.prev.next = newOp; 14264 newOp.prev = oldOp.prev; 14265 } 14266 if (oldOp.next !== null) { 14267 oldOp.next.prev = newOp; 14268 newOp.next = oldOp.next; 14269 } 14270 oldOp.debugListId = null; 14271 oldOp.prev = null; 14272 oldOp.next = null; 14273 } 14274 /** 14275 * Replace `oldOp` with some number of new operations in the list (which may include `oldOp`). 14276 */ 14277 static replaceWithMany(oldOp, newOps) { 14278 if (newOps.length === 0) { 14279 // Replacing with an empty list -> pure removal. 14280 OpList.remove(oldOp); 14281 return; 14282 } 14283 OpList.assertIsNotEnd(oldOp); 14284 OpList.assertIsOwned(oldOp); 14285 const listId = oldOp.debugListId; 14286 oldOp.debugListId = null; 14287 for (const newOp of newOps) { 14288 OpList.assertIsNotEnd(newOp); 14289 // `newOp` might be `oldOp`, but at this point it's been marked as unowned. 14290 OpList.assertIsUnowned(newOp); 14291 } 14292 // It should be safe to reuse `oldOp` in the `newOps` list - maybe you want to sandwich an 14293 // operation between two new ops. 14294 const { 14295 prev: oldPrev, 14296 next: oldNext 14297 } = oldOp; 14298 oldOp.prev = null; 14299 oldOp.next = null; 14300 let prev = oldPrev; 14301 for (const newOp of newOps) { 14302 this.assertIsUnowned(newOp); 14303 newOp.debugListId = listId; 14304 prev.next = newOp; 14305 newOp.prev = prev; 14306 // This _should_ be the case, but set it just in case. 14307 newOp.next = null; 14308 prev = newOp; 14309 } 14310 // At the end of iteration, `prev` holds the last node in the list. 14311 const first = newOps[0]; 14312 const last = prev; 14313 // Replace `oldOp` with the chain `first` -> `last`. 14314 if (oldPrev !== null) { 14315 oldPrev.next = first; 14316 first.prev = oldPrev; 14317 } 14318 if (oldNext !== null) { 14319 oldNext.prev = last; 14320 last.next = oldNext; 14321 } 14322 } 14323 /** 14324 * Remove the given node from the list which contains it. 14325 */ 14326 static remove(op) { 14327 OpList.assertIsNotEnd(op); 14328 OpList.assertIsOwned(op); 14329 op.prev.next = op.next; 14330 op.next.prev = op.prev; 14331 // Break any link between the node and this list to safeguard against its usage in future 14332 // operations. 14333 op.debugListId = null; 14334 op.prev = null; 14335 op.next = null; 14336 } 14337 /** 14338 * Insert `op` before `target`. 14339 */ 14340 static insertBefore(op, target) { 14341 if (Array.isArray(op)) { 14342 for (const o of op) { 14343 this.insertBefore(o, target); 14344 } 14345 return; 14346 } 14347 OpList.assertIsOwned(target); 14348 if (target.prev === null) { 14349 throw new Error(`AssertionError: illegal operation on list start`); 14350 } 14351 OpList.assertIsNotEnd(op); 14352 OpList.assertIsUnowned(op); 14353 op.debugListId = target.debugListId; 14354 // Just in case. 14355 op.prev = null; 14356 target.prev.next = op; 14357 op.prev = target.prev; 14358 op.next = target; 14359 target.prev = op; 14360 } 14361 /** 14362 * Insert `op` after `target`. 14363 */ 14364 static insertAfter(op, target) { 14365 OpList.assertIsOwned(target); 14366 if (target.next === null) { 14367 throw new Error(`AssertionError: illegal operation on list end`); 14368 } 14369 OpList.assertIsNotEnd(op); 14370 OpList.assertIsUnowned(op); 14371 op.debugListId = target.debugListId; 14372 target.next.prev = op; 14373 op.next = target.next; 14374 op.prev = target; 14375 target.next = op; 14376 } 14377 /** 14378 * Asserts that `op` does not currently belong to a list. 14379 */ 14380 static assertIsUnowned(op) { 14381 if (op.debugListId !== null) { 14382 throw new Error(`AssertionError: illegal operation on owned node: ${OpKind[op.kind]}`); 14383 } 14384 } 14385 /** 14386 * Asserts that `op` currently belongs to a list. If `byList` is passed, `op` is asserted to 14387 * specifically belong to that list. 14388 */ 14389 static assertIsOwned(op, byList) { 14390 if (op.debugListId === null) { 14391 throw new Error(`AssertionError: illegal operation on unowned node: ${OpKind[op.kind]}`); 14392 } else if (byList !== undefined && op.debugListId !== byList) { 14393 throw new Error(`AssertionError: node belongs to the wrong list (expected ${byList}, actual ${op.debugListId})`); 14394 } 14395 } 14396 /** 14397 * Asserts that `op` is not a special `ListEnd` node. 14398 */ 14399 static assertIsNotEnd(op) { 14400 if (op.kind === OpKind.ListEnd) { 14401 throw new Error(`AssertionError: illegal operation on list head or tail`); 14402 } 14403 } 14404 } 14405 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(OpList, "nextListId", 0); 14406 return OpList; 14407})(); 14408class SlotHandle { 14409 constructor() { 14410 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "slot", null); 14411 } 14412} 14413 14414/** 14415 * The set of OpKinds that represent the creation of an element or container 14416 */ 14417const elementContainerOpKinds = new Set([OpKind.Element, OpKind.ElementStart, OpKind.Container, OpKind.ContainerStart, OpKind.Template, OpKind.RepeaterCreate]); 14418/** 14419 * Checks whether the given operation represents the creation of an element or container. 14420 */ 14421function isElementOrContainerOp(op) { 14422 return elementContainerOpKinds.has(op.kind); 14423} 14424/** 14425 * Create an `ElementStartOp`. 14426 */ 14427function createElementStartOp(tag, xref, namespace, i18nPlaceholder, startSourceSpan, wholeSourceSpan) { 14428 return (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({ 14429 kind: OpKind.ElementStart, 14430 xref, 14431 tag, 14432 handle: new SlotHandle(), 14433 attributes: null, 14434 localRefs: [], 14435 nonBindable: false, 14436 namespace, 14437 i18nPlaceholder, 14438 startSourceSpan, 14439 wholeSourceSpan 14440 }, TRAIT_CONSUMES_SLOT), NEW_OP); 14441} 14442/** 14443 * Create a `TemplateOp`. 14444 */ 14445function createTemplateOp(xref, templateKind, tag, functionNameSuffix, namespace, i18nPlaceholder, startSourceSpan, wholeSourceSpan) { 14446 return (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({ 14447 kind: OpKind.Template, 14448 xref, 14449 templateKind, 14450 attributes: null, 14451 tag, 14452 handle: new SlotHandle(), 14453 functionNameSuffix, 14454 decls: null, 14455 vars: null, 14456 localRefs: [], 14457 nonBindable: false, 14458 namespace, 14459 i18nPlaceholder, 14460 startSourceSpan, 14461 wholeSourceSpan 14462 }, TRAIT_CONSUMES_SLOT), NEW_OP); 14463} 14464function createRepeaterCreateOp(primaryView, emptyView, tag, track, varNames, emptyTag, i18nPlaceholder, emptyI18nPlaceholder, startSourceSpan, wholeSourceSpan) { 14465 return (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({ 14466 kind: OpKind.RepeaterCreate, 14467 attributes: null, 14468 xref: primaryView, 14469 handle: new SlotHandle(), 14470 emptyView, 14471 track, 14472 trackByFn: null, 14473 trackByOps: null, 14474 tag, 14475 emptyTag, 14476 emptyAttributes: null, 14477 functionNameSuffix: 'For', 14478 namespace: Namespace.HTML, 14479 nonBindable: false, 14480 localRefs: [], 14481 decls: null, 14482 vars: null, 14483 varNames, 14484 usesComponentInstance: false, 14485 i18nPlaceholder, 14486 emptyI18nPlaceholder, 14487 startSourceSpan, 14488 wholeSourceSpan 14489 }, TRAIT_CONSUMES_SLOT), NEW_OP), TRAIT_CONSUMES_VARS), {}, { 14490 numSlotsUsed: emptyView === null ? 2 : 3 14491 }); 14492} 14493/** 14494 * Create an `ElementEndOp`. 14495 */ 14496function createElementEndOp(xref, sourceSpan) { 14497 return (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({ 14498 kind: OpKind.ElementEnd, 14499 xref, 14500 sourceSpan 14501 }, NEW_OP); 14502} 14503function createDisableBindingsOp(xref) { 14504 return (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({ 14505 kind: OpKind.DisableBindings, 14506 xref 14507 }, NEW_OP); 14508} 14509function createEnableBindingsOp(xref) { 14510 return (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({ 14511 kind: OpKind.EnableBindings, 14512 xref 14513 }, NEW_OP); 14514} 14515/** 14516 * Create a `TextOp`. 14517 */ 14518function createTextOp(xref, initialValue, icuPlaceholder, sourceSpan) { 14519 return (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({ 14520 kind: OpKind.Text, 14521 xref, 14522 handle: new SlotHandle(), 14523 initialValue, 14524 icuPlaceholder, 14525 sourceSpan 14526 }, TRAIT_CONSUMES_SLOT), NEW_OP); 14527} 14528/** 14529 * Create a `ListenerOp`. Ho
14529st bindings reuse all the listener logic. 14530 */ 14531function createListenerOp(target, targetSlot, name, tag, handlerOps, animationPhase, eventTarget, hostListener, sourceSpan) { 14532 const handlerList = new OpList(); 14533 handlerList.push(handlerOps); 14534 return (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({ 14535 kind: OpKind.Listener, 14536 target, 14537 targetSlot, 14538 tag, 14539 hostListener, 14540 name, 14541 handlerOps: handlerList, 14542 handlerFnName: null, 14543 consumesDollarEvent: false, 14544 isAnimationListener: animationPhase !== null, 14545 animationPhase, 14546 eventTarget, 14547 sourceSpan 14548 }, NEW_OP); 14549} 14550/** 14551 * Create a `TwoWayListenerOp`. 14552 */ 14553function createTwoWayListenerOp(target, targetSlot, name, tag, handlerOps, sourceSpan) { 14554 const handlerList = new OpList(); 14555 handlerList.push(handlerOps); 14556 return (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({ 14557 kind: OpKind.TwoWayListener, 14558 target, 14559 targetSlot, 14560 tag, 14561 name, 14562 handlerOps: handlerList, 14563 handlerFnName: null, 14564 sourceSpan 14565 }, NEW_OP); 14566} 14567function createPipeOp(xref, slot, name) { 14568 return (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({ 14569 kind: OpKind.Pipe, 14570 xref, 14571 handle: slot, 14572 name 14573 }, NEW_OP), TRAIT_CONSUMES_SLOT); 14574} 14575function createNamespaceOp(namespace) { 14576 return (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({ 14577 kind: OpKind.Namespace, 14578 active: namespace 14579 }, NEW_OP); 14580} 14581function createProjectionDefOp(def) { 14582 return (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({ 14583 kind: OpKind.ProjectionDef, 14584 def 14585 }, NEW_OP); 14586} 14587function createProjectionOp(xref, selector, i18nPlaceholder, fallbackView, sourceSpan) { 14588 return (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({ 14589 kind: OpKind.Projection, 14590 xref, 14591 handle: new SlotHandle(), 14592 selector, 14593 i18nPlaceholder, 14594 fallbackView, 14595 projectionSlotIndex: 0, 14596 attributes: null, 14597 localRefs: [], 14598 sourceSpan 14599 }, NEW_OP), TRAIT_CONSUMES_SLOT), {}, { 14600 numSlotsUsed: fallbackView === null ? 1 : 2 14601 }); 14602} 14603/** 14604 * Create an `ExtractedAttributeOp`. 14605 */ 14606function createExtractedAttributeOp(target, bindingKind, namespace, name, expression, i18nContext, i18nMessage, securityContext) { 14607 return (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({ 14608 kind: OpKind.ExtractedAttribute, 14609 target, 14610 bindingKind, 14611 namespace, 14612 name, 14613 expression, 14614 i18nContext, 14615 i18nMessage, 14616 securityContext, 14617 trustedValueFn: null 14618 }, NEW_OP); 14619} 14620function createDeferOp(xref, main, mainSlot, ownResolverFn, resolverFn, sourceSpan) { 14621 return (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({ 14622 kind: OpKind.Defer, 14623 xref, 14624 handle: new SlotHandle(), 14625 mainView: main, 14626 mainSlot, 14627 loadingView: null, 14628 loadingSlot: null, 14629 loadingConfig: null, 14630 loadingMinimumTime: null, 14631 loadingAfterTime: null, 14632 placeholderView: null, 14633 placeholderSlot: null, 14634 placeholderConfig: null, 14635 placeholderMinimumTime: null, 14636 errorView: null, 14637 errorSlot: null, 14638 ownResolverFn, 14639 resolverFn, 14640 flags: null, 14641 sourceSpan 14642 }, NEW_OP), TRAIT_CONSUMES_SLOT), {}, { 14643 numSlotsUsed: 2 14644 }); 14645} 14646function createDeferOnOp(defer, trigger, modifier, sourceSpan) { 14647 return (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({ 14648 kind: OpKind.DeferOn, 14649 defer, 14650 trigger, 14651 modifier, 14652 sourceSpan 14653 }, NEW_OP); 14654} 14655/** 14656 * Creates a `DeclareLetOp`. 14657 */ 14658function createDeclareLetOp(xref, declaredName, sourceSpan) { 14659 return (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({ 14660 kind: OpKind.DeclareLet, 14661 xref, 14662 declaredName, 14663 sourceSpan, 14664 handle: new SlotHandle() 14665 }, TRAIT_CONSUMES_SLOT), NEW_OP); 14666} 14667/** 14668 * Create an `ExtractedMessageOp`. 14669 */ 14670function createI18nMessageOp(xref, i18nContext, i18nBlock, message, messagePlaceholder, params, postprocessingParams, needsPostprocessing) { 14671 return (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({ 14672 kind: OpKind.I18nMessage, 14673 xref, 14674 i18nContext, 14675 i18nBlock, 14676 message, 14677 messagePlaceholder, 14678 params, 14679 postprocessingParams, 14680 needsPostprocessing, 14681 subMessages: [] 14682 }, NEW_OP); 14683} 14684/** 14685 * Create an `I18nStartOp`. 14686 */ 14687function createI18nStartOp(xref, message, root, sourceSpan) { 14688 return (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({ 14689 kind: OpKind.I18nStart, 14690 xref, 14691 handle: new SlotHandle(), 14692 root: root !== null && root !== void 0 ? root : xref, 14693 message, 14694 messageIndex: null, 14695 subTemplateIndex: null, 14696 context: null, 14697 sourceSpan 14698 }, NEW_OP), TRAIT_CONSUMES_SLOT); 14699} 14700/** 14701 * Create an `I18nEndOp`. 14702 */ 14703function createI18nEndOp(xref, sourceSpan) { 14704 return (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({ 14705 kind: OpKind.I18nEnd, 14706 xref, 14707 sourceSpan 14708 }, NEW_OP); 14709} 14710/** 14711 * Creates an ICU start op. 14712 */ 14713function createIcuStartOp(xref, message, messagePlaceholder, sourceSpan) { 14714 return (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({ 14715 kind: OpKind.IcuStart, 14716 xref, 14717 message, 14718 messagePlaceholder, 14719 context: null, 14720 sourceSpan 14721 }, NEW_OP); 14722} 14723/** 14724 * Creates an ICU end op. 14725 */ 14726function createIcuEndOp(xref) { 14727 return (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({ 14728 kind: OpKind.IcuEnd, 14729 xref 14730 }, NEW_OP); 14731} 14732/** 14733 * Creates an ICU placeholder op. 14734 */ 14735function createIcuPlaceholderOp(xref, name, strings) { 14736 return (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({ 14737 kind: OpKind.IcuPlaceholder, 14738 xref, 14739 name, 14740 strings, 14741 expressionPlaceholders: [] 14742 }, NEW_OP); 14743} 14744function createI18nContextOp(contextKind, xref, i18nBlock, message, sourceSpan) { 14745 if (i18nBlock === null && contextKind !== I18nContextKind.Attr) { 14746 throw new Error('AssertionError: i18nBlock must be provided for non-attribute contexts.'); 14747 } 14748 return (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({ 14749 kind: OpKind.I18nContext, 14750 contextKind, 14751 xref, 14752 i18nBlock, 14753 message, 14754 sourceSpan, 14755 params: new Map(), 14756 postprocessingParams: new Map() 14757 }, NEW_OP); 14758} 14759function createI18nAttributesOp(xref, handle, target) { 14760 return (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({ 14761 kind: OpKind.I18nAttributes, 14762 xref, 14763 handle, 14764 target, 14765 i18nAttributesConfig: null 14766 }, NEW_OP), TRAIT_CONSUMES_SLOT); 14767} 14768/** Create a `SourceLocationOp`. */ 14769function createSourceLocationOp(templatePath, locations) { 14770 return (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({ 14771 kind: OpKind.SourceLocation, 14772 templatePath, 14773 locations 14774 }, NEW_OP); 14775} 14776function createHostPropertyOp(name, expression, isAnimationTrigger, i18nContext, securityContext, sourceSpan) { 14777 return (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({ 14778 kind: OpKind.HostProperty, 14779 name, 14780 expression, 14781 isAnimationTrigger, 14782 i18nContext, 14783 securityContext, 14784 sanitizer: null, 14785 sourceSpan 14786 }, TRAIT_CONSUMES_VARS), NEW_OP); 14787} 14788 14789/** 14790 * When referenced in the template's context parameters, this indicates a reference to the entire 14791 * context object, rather than a specific parameter. 14792 */ 14793const CTX_REF = 'CTX_REF_MARKER'; 14794var CompilationJobKind = /*#__PURE__*/function (CompilationJobKind) { 14795 CompilationJobKind[CompilationJobKind["Tmpl"] = 0] = "Tmpl"; 14796 CompilationJobKind[CompilationJobKind["Host"] = 1] = "Host"; 14797 CompilationJobKind[CompilationJobKind["Both"] = 2] = "Both"; 14798 return CompilationJobKind; 14799}(CompilationJobKind || {}); 14800/** 14801 * An entire ongoing compilation, which will result in one or more template functions when complete. 14802 * Contains one or more corresponding compilation units. 14803 */ 14804class CompilationJob { 14805 constructor(componentName, pool, compatibility) { 14806 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "componentName", void 0); 14807 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "pool", void 0); 14808 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "compatibility", void 0); 14809 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "kind", CompilationJobKind.Both); 14810 /** 14811 * Tracks the next `ir.XrefId` which can be assigned as template structures are ingested. 14812 */ 14813 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "nextXrefId", 0); 14814 this.componentName = componentName; 14815 this.pool = pool; 14816 this.compatibility = compatibility; 14817 } 14818 /** 14819 * Generate a new unique `ir.XrefId` in this job. 14820 */ 14821 allocateXrefId() { 14822 return this.nextXrefId++; 14823 } 14824} 14825/** 14826 * Compilation-in-progress of a whole component's template, including the main template and any 14827 * embedded views or host bindings. 14828 */ 14829class ComponentCompilationJob extends CompilationJob { 14830 constructor(componentName, pool, compatibility, relativeContextFilePath, i18nUseExternalIds, deferMeta, allDeferrableDepsFn, relativeTemplatePath, enableDebugLocations) { 14831 super(componentName, pool, compatibility); 14832 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "relativeContextFilePath", void 0); 14833 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "i18nUseExternalIds", void 0); 14834 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "deferMeta", void 0); 14835 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "allDeferrableDepsFn", void 0); 14836 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "relativeTemplatePath", void 0); 14837 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "enableDebugLocations", void 0); 14838 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "kind", CompilationJobKind.Tmpl); 14839 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "fnSuffix", 'Template'); 14840 /** 14841 * The root view, representing the component's template. 14842 */ 14843 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "root", void 0); 14844 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "views", new Map()); 14845 /** 14846 * Causes ngContentSelectors to be emitted, for content projection slots in the view. Possibly a 14847 * reference into the constant pool. 14848 */ 14849 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "contentSelectors", null); 14850 /** 14851 * Constant expressions used by operations within this component's compilation. 14852 * 14853 * This will eventually become the `consts` array in the component definition. 14854 */ 14855 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "consts", []); 14856 /** 14857 * Initialization statements needed to set up the consts. 14858 */ 14859 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "constsInitializer
14859s", []); 14860 this.relativeContextFilePath = relativeContextFilePath; 14861 this.i18nUseExternalIds = i18nUseExternalIds; 14862 this.deferMeta = deferMeta; 14863 this.allDeferrableDepsFn = allDeferrableDepsFn; 14864 this.relativeTemplatePath = relativeTemplatePath; 14865 this.enableDebugLocations = enableDebugLocations; 14866 this.root = new ViewCompilationUnit(this, this.allocateXrefId(), null); 14867 this.views.set(this.root.xref, this.root); 14868 } 14869 /** 14870 * Add a `ViewCompilation` for a new embedded view to this compilation. 14871 */ 14872 allocateView(parent) { 14873 const view = new ViewCompilationUnit(this, this.allocateXrefId(), parent); 14874 this.views.set(view.xref, view); 14875 return view; 14876 } 14877 get units() { 14878 return this.views.values(); 14879 } 14880 /** 14881 * Add a constant `o.Expression` to the compilation and return its index in the `consts` array. 14882 */ 14883 addConst(newConst, initializers) { 14884 for (let idx = 0; idx < this.consts.length; idx++) { 14885 if (this.consts[idx].isEquivalent(newConst)) { 14886 return idx; 14887 } 14888 } 14889 const idx = this.consts.length; 14890 this.consts.push(newConst); 14891 if (initializers) { 14892 this.constsInitializers.push(...initializers); 14893 } 14894 return idx; 14895 } 14896} 14897/** 14898 * A compilation unit is compiled into a template function. Some example units are views and host 14899 * bindings. 14900 */ 14901class CompilationUnit { 14902 constructor(xref) { 14903 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "xref", void 0); 14904 /** 14905 * List of creation operations for this view. 14906 * 14907 * Creation operations may internally contain other operations, including update operations. 14908 */ 14909 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "create", new OpList()); 14910 /** 14911 * List of update operations for this view. 14912 */ 14913 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "update", new OpList()); 14914 /** 14915 * Name of the function which will be generated for this unit. 14916 * 14917 * May be `null` if not yet determined. 14918 */ 14919 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "fnName", null); 14920 /** 14921 * Number of variable slots used within this view, or `null` if variables have not yet been 14922 * counted. 14923 */ 14924 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "vars", null); 14925 this.xref = xref; 14926 } 14927 /** 14928 * Iterate over all `ir.Op`s within this view. 14929 * 14930 * Some operations may have child operations, which this iterator will visit. 14931 */ 14932 *ops() { 14933 for (const op of this.create) { 14934 yield op; 14935 if (op.kind === OpKind.Listener || op.kind === OpKind.TwoWayListener) { 14936 for (const listenerOp of op.handlerOps) { 14937 yield listenerOp; 14938 } 14939 } else if (op.kind === OpKind.RepeaterCreate && op.trackByOps !== null) { 14940 for (const trackOp of op.trackByOps) { 14941 yield trackOp; 14942 } 14943 } 14944 } 14945 for (const op of this.update) { 14946 yield op; 14947 } 14948 } 14949} 14950/** 14951 * Compilation-in-progress of an individual view within a template. 14952 */ 14953class ViewCompilationUnit extends CompilationUnit { 14954 constructor(job, xref, parent) { 14955 super(xref); 14956 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "job", void 0); 14957 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "parent", void 0); 14958 /** 14959 * Map of declared variables available within this view to the property on the context object 14960 * which they alias. 14961 */ 14962 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "contextVariables", new Map()); 14963 /** 14964 * Set of aliases available within this view. An alias is a variable whose provided expression is
14965 * inlined at every location it is used. It may also depend on context variables, by name. 14966 */ 14967 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "aliases", new Set()); 14968 /** 14969 * Number of declaration slots used within this view, or `null` if slots have not yet been 14970 * allocated. 14971 */ 14972 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "decls", null); 14973 this.job = job; 14974 this.parent = parent; 14975 } 14976} 14977/** 14978 * Compilation-in-progress of a host binding, which contains a single unit for that host binding. 14979 */ 14980class HostBindingCompilationJob extends CompilationJob { 14981 constructor(componentName, pool, compatibility) { 14982 super(componentName, pool, compatibility); 14983 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "kind", CompilationJobKind.Host); 14984 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "fnSuffix", 'HostBindings'); 14985 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "root", void 0); 14986 this.root = new HostBindingCompilationUnit(this); 14987 } 14988 get units() { 14989 return [this.root]; 14990 } 14991} 14992class HostBindingCompilationUnit extends CompilationUnit { 14993 constructor(job) { 14994 super(0); 14995 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "job", void 0); 14996 /** 14997 * Much like an element can have attributes, so can a host binding function. 14998 */ 14999 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "attributes", null); 15000 this.job = job; 15001 } 15002} 15003 15004/** 15005 * Find any function calls to `$any`, excluding `this.$any`, and delete them, since they have no 15006 * runtime effects. 15007 */ 15008function deleteAnyCasts(job) { 15009 for (const unit of job.units) { 15010 for (const op of unit.ops()) { 15011 transformExpressionsInOp(op, removeAnys, VisitorContextFlag.None); 15012 } 15013 } 15014} 15015function removeAnys(e) { 15016 if (e instanceof InvokeFunctionExpr && e.fn instanceof LexicalReadExpr && e.fn.name === '$any') { 15017 if (e.args.length !== 1) { 15018 throw new Error('The $any builtin function expects exactly one argument.'); 15019 } 15020 return e.args[0]; 15021 } 15022 return e; 15023} 15024 15025/** 15026 * Adds apply operations after i18n expressions. 15027 */ 15028function applyI18nExpressions(job) { 15029 const i18nContexts = new Map(); 15030 for (const unit of job.units) { 15031 for (const op of unit.create) { 15032 if (op.kind === OpKind.I18nContext) { 15033 i18nContexts.set(op.xref, op); 15034 } 15035 } 15036 } 15037 for (const unit of job.units) { 15038 for (const op of unit.update) { 15039 // Only add apply after expressions that are not followed by more expressions. 15040 if (op.kind === OpKind.I18nExpression && needsApplication(i18nContexts, op)) { 15041 // TODO: what should be the source span for the apply op? 15042 OpList.insertAfter(createI18nApplyOp(op.i18nOwner, op.handle, null), op); 15043 } 15044 } 15045 } 15046} 15047/** 15048 * Checks whether the given expression op needs to be followed with an apply op. 15049 */ 15050function needsApplication(i18nContexts, op) { 15051 var _op$next; 15052 // If the next op is not another expression, we need to apply. 15053 if (((_op$next = op.next) === null || _op$next === void 0 ? void 0 : _op$next.kind) !== OpKind.I18nExpression) { 15054 return true; 15055 } 15056 const context = i18nContexts.get(op.context); 15057 const nextContext = i18nContexts.get(op.next.context); 15058 if (context === undefined) { 15059 throw new Error("AssertionError: expected an I18nContextOp to exist for the I18nExpressionOp's context"); 15060 } 15061 if (nextContext === undefined) { 15062 throw new Error("AssertionError: expected an I18nContextOp to exist for the next I18
15062nExpressionOp's context"); 15063 } 15064 // If the next op is an expression targeting a different i18n block (or different element, in the 15065 // case of i18n attributes), we need to apply. 15066 // First, handle the case of i18n blocks. 15067 if (context.i18nBlock !== null) { 15068 // This is a block context. Compare the blocks. 15069 if (context.i18nBlock !== nextContext.i18nBlock) { 15070 return true; 15071 } 15072 return false; 15073 } 15074 // Second, handle the case of i18n attributes. 15075 if (op.i18nOwner !== op.next.i18nOwner) { 15076 return true; 15077 } 15078 return false; 15079} 15080 15081/** 15082 * Updates i18n expression ops to target the last slot in their owning i18n block, and moves them 15083 * after the last update instruction that depends on that slot. 15084 */ 15085function assignI18nSlotDependencies(job) { 15086 for (const unit of job.units) { 15087 // The first update op. 15088 let updateOp = unit.update.head; 15089 // I18n expressions currently being moved during the iteration. 15090 let i18nExpressionsInProgress = []; 15091 // Non-null while we are iterating through an i18nStart/i18nEnd pair 15092 let state = null; 15093 for (const createOp of unit.create) { 15094 if (createOp.kind === OpKind.I18nStart) { 15095 state = { 15096 blockXref: createOp.xref, 15097 lastSlotConsumer: createOp.xref 15098 }; 15099 } else if (createOp.kind === OpKind.I18nEnd) { 15100 for (const op of i18nExpressionsInProgress) { 15101 op.target = state.lastSlotConsumer; 15102 OpList.insertBefore(op, updateOp); 15103 } 15104 i18nExpressionsInProgress.length = 0; 15105 state = null; 15106 } 15107 if (hasConsumesSlotTrait(createOp)) { 15108 if (state !== null) { 15109 state.lastSlotConsumer = createOp.xref; 15110 } 15111 while (true) { 15112 if (updateOp.next === null) { 15113 break; 15114 } 15115 if (state !== null && updateOp.kind === OpKind.I18nExpression && updateOp.usage === I18nExpressionFor.I18nText && updateOp.i18nOwner === state.blockXref) { 15116 const opToRemove = updateOp; 15117 updateOp = updateOp.next; 15118 OpList.remove(opToRemove); 15119 i18nExpressionsInProgress.push(opToRemove); 15120 continue; 15121 } 15122 if (hasDependsOnSlotContextTrait(updateOp) && updateOp.target !== createOp.xref) { 15123 break; 15124 } 15125 updateOp = updateOp.next; 15126 } 15127 } 15128 } 15129 } 15130} 15131 15132/** 15133 * Gets a map of all elements in the given view by their xref id. 15134 */ 15135function createOpXrefMap(unit) { 15136 const map = new Map(); 15137 for (const op of unit.create) { 15138 if (!hasConsumesSlotTrait(op)) { 15139 continue; 15140 } 15141 map.set(op.xref, op); 15142 // TODO(dylhunn): `@for` loops with `@empty` blocks need to be special-cased here, 15143 // because the slot consumer trait currently only supports one slot per consumer and we 15144 // need two. This should be revisited when making the refactors mentioned in: 15145 // https://github.com/angular/angular/pull/53620#discussion_r1430918822 15146 if (op.kind === OpKind.RepeaterCreate && op.emptyView !== null) { 15147 map.set(op.emptyView, op); 15148 } 15149 } 15150 return map; 15151} 15152 15153/** 15154 * Find all extractable attribute and binding ops, and create ExtractedAttributeOps for them. 15155 * In cases where no instruction needs to be generated for the attribute or binding, it is removed. 15156 */ 15157function extractAttributes(job) { 15158 for (const unit of job.units) { 15159 const elements = createOpXrefMap(unit); 15160 for (const op of unit.ops()) { 15161 switch (op.kind) { 15162 case OpKind.Attribute: 15163 extractAttributeOp(unit, op, elements); 15164 break; 15165 case OpKind.Property: 15166 if (!op.isAnimationTrigger) { 15167 let bindingKind; 15168 if (op.i18nMessage !== null && op.templateKind === null) { 15169 // If the binding has an i18n context, it is an i18n attribute, and should have that 15170 // kind in the consts array. 15171 bindingKind = BindingKind.I18n; 15172 } else if (op.isStructuralTemplateAttribute) { 15173 bindingKind = BindingKind.Template; 15174 } else { 15175 bindingKind = BindingKind.Property; 15176 } 15177 OpList.insertBefore( 15178 // Deliberately null i18nMessage value 15179 createExtractedAttributeOp(op.target, bindingKind, null, op.name, /* expression */null, /* i18nContext */null, /* i18nMessage */null, op.securityContext), lookupElement$2(elements, op.target)); 15180 } 15181 break; 15182 case OpKind.TwoWayProperty: 15183 OpList.insertBefore(createExtractedAttributeOp(op.target, BindingKind.TwoWayProperty, null, op.name, /* expression */null, /* i18nContext */null, /* i18nMessage */null, op.securityContext), lookupElement$2(elements, op.target)); 15184 break; 15185 case OpKind.StyleProp: 15186 case OpKind.ClassProp: 15187 // TODO: Can style or class bindings be i18n attributes? 15188 // The old compiler treated empty style bindings as regular bindings for the purpose of 15189 // directive matching. That behavior is incorrect, but we emulate it in compatibility 15190 // mode. 15191 if (unit.job.compatibility === CompatibilityMode.TemplateDefinitionBuilder && op.expression instanceof EmptyExpr) { 15192 OpList.insertBefore(createExtractedAttributeOp(op.target, BindingKind.Property, null, op.name, /* expression */null, /* i18nContext */null, /* i18nMessage */null, SecurityContext.STYLE), lookupElement$2(elements, op.target)); 15193 } 15194 break; 15195 case OpKind.Listener: 15196 if (!op.isAnimationListener) { 15197 const extractedAttributeOp = createExtractedAttributeOp(op.target, BindingKind.Property, null, op.name, /* expression */null, /* i18nContext */null, /* i18nMessage */null, SecurityContext.NONE); 15198 if (job.kind === CompilationJobKind.Host) { 15199 if (job.compatibility) { 15200 // TemplateDefinitionBuilder does not extract listener bindings to the const array 15201 // (which is honestly pretty inconsistent). 15202 break; 15203 } 15204 // This attribute will apply to the enclosing host binding compilation unit, so order 15205 // doesn't matter. 15206 unit.create.push(extractedAttributeOp); 15207 } else { 15208 OpList.insertBefore(extractedAttributeOp, lookupElement$2(elements, op.target)); 15209 } 15210 } 15211 break; 15212 case OpKind.TwoWayListener: 15213 // Two-way listeners aren't supported in host bindings. 15214 if (job.kind !== CompilationJobKind.Host) { 15215 const extractedAttributeOp = createExtractedAttributeOp(op.target, BindingKind.Property, null, op.name, /* expression */null, /* i18nContext */null, /* i18nMessage */null, SecurityContext.NONE); 15216 OpList.insertBefore(extractedAttributeOp, lookupElement$2(elements, op.target)); 15217 } 15218 break; 15219 } 15220 } 15221 } 15222} 15223/** 15224 * Looks up an element in the given map by xref ID. 15225 */ 15226function lookupElement$2(elements, xref) { 15227 const el = elements.get(xref); 15228 if (el === undefined) { 15229 throw new Error('All attributes should have an element-like target.'); 15230 } 15231 return el; 15232} 15233/** 15234 * Extracts an attribute binding. 15235 */ 15236function extractAttributeOp(unit, op, elements) { 15237 if (op.expression instanceof Interpolation) { 15238 return; 15239 } 15240 let extractable = op.isTextAttribute || op.expression.isConstant(); 15241 if (unit.job.compatibility === CompatibilityMode.TemplateDefinitionBuilder) { 15242 // TemplateDefinitionBuilder only extracts text attributes. It does not extract attriibute 15243 // bindings, even if they are constants. 15244 extractable && (extractable = op.isTextAttribute); 15245 } 15246 if (extractable) { 15247 const extractedAttributeOp = createExtractedAttributeOp(op.target, op.isStructuralTemplateAttribute ? BindingKind.Template : BindingKind.Attribute, op.namespace, op.name, op.expression, op.i18nContext, op.i18nMessage, op.securityContext); 15248 if (unit.job.kind === CompilationJobKind.Host) { 15249 // This attribute will apply to the enclosing host binding compilation unit, so order doesn't 15250 // matter. 15251 unit.create.push(extractedAttributeOp); 15252 } else { 15253 const ownerOp = lookupElement$2(elements, op.target); 15254 OpList.insertBefore(extractedAttributeOp, ownerOp); 15255 } 15256 OpList.remove(op); 15257 } 15258} 15259 15260/** 15261 * Looks up an element in the given map by xref ID. 15262 */ 15263function lookupElement$1(elements, xref) { 15264 const el = elements.get(xref); 15265 if (el === undefined) { 15266 throw new Error('All attributes should have an element-like target.'); 15267 } 15268 return el; 15269} 15270function specializeBindings(job) { 15271 const elements = new Map(); 15272 for (const unit of job.units) { 15273 for (const op of unit.create) { 15274 if (!isElementOrContainerOp(op)) { 15275 continue; 15276 } 15277 elements.set(op.xref, op); 15278 } 15279 } 15280 for (const unit of job.units) { 15281 for (const op of unit.ops()) { 15282 if (op.kind !== OpKind.Binding) { 15283 continue; 15284 } 15285 switch (op.bindingKind) { 15286 case BindingKind.Attribute: 15287 if (op.name === 'ngNonBindable') { 15288 OpList.remove(op); 15289 const target = lookupElement$1(elements, op.target); 15290 target.nonBindable = true; 15291 } else { 15292 const [namespace, name] = splitNsName(op.name); 15293 OpList.replace(op, createAttributeOp(op.target, namespace, name, op.expression, op.securityContext, op.isTextAttribute, op.isStructuralTemplateAttribute, op.templateKind, op.i18nMessage, op.sourceSpan)); 15294 } 15295 break; 15296 case BindingKind.Property: 15297 case BindingKind.Animation: 15298 if (job.kind === CompilationJobKind.Host) { 15299 OpList.replace(op, createHostPropertyOp(op.name, op.expression, op.bindingKind === BindingKind.Animation, op.i18nContext, op.securityContext, op.sourceSpan)); 15300 } else { 15301 OpList.replace(op, createPropertyOp(op.target, op.name, op.expression, op.bindingKind === BindingKind.Animation, op.securityContext, op.isStructuralTemplateAttribute, op.templateKind, op.i18nContext, op.i18nMessage, op.sourceSpan)); 15302 } 15303 break; 15304 case BindingKind.TwoWayProperty: 15305 if (!(op.expression instanceof Expression)) { 15306 // We shouldn't be able to hit this code path since interpolations in two-way bindings 15307 // result in a parser error. We assert here so that downstream we can assume that 15308 // the value is always an expression. 15309 throw new Error(`Expected value of two-way property binding "${op.name}" to be an expression`); 15310 } 15311 OpList.replace(op, createTwoWayPropertyOp(op.target, op.name, op.expression, op.securityContext, op.isStructuralTemplateAttribute, op.templateKind, op.i18nContext, op.i18nMessage, op.sourceSpan)); 15312 break; 15313 case BindingKind.I18n: 15314 case BindingKind.ClassName: 15315 case BindingKind.StyleProperty: 15316 throw new Error(`Unhandled binding of kind ${BindingKind[op.bindingKind]}`); 15317 } 15318 } 15319 } 15320} 15321const CHAINABLE = new Set([Identifiers.attribute, Identifiers.classProp, Identifiers.element, Identifiers.elementContainer, Identifiers.elementContainerEnd, Identifiers.elementContainerStart, Identifiers.elementEnd, Identifiers.elementStart, Identifiers.hostProperty, Identifiers.i18nExp, Identifiers.listener, Identifiers.listener, Identifiers.property, Identifiers.styleProp, Identifiers.stylePropInterpolate1, Identifiers.stylePropInterpolate2, Identifiers.stylePropInterpolate3, Identifiers.stylePropInterpolate4, Identifiers.stylePropInterpolate5, Identifiers.stylePropInterpolate6, Identifiers.stylePropInterpolate7, Identifiers.stylePropInterpolate8, Identifiers.stylePropInterpolateV, Identifiers.syntheticHostListener, Identifiers.syntheticHostProperty, Identifiers.templateCreate, Identifiers.twoWayProperty, Identifiers.twoWayListener, Identifiers.declareLet]); 15322/** 15323 * Chaining results in repeated call expressions, causing a deep AST of receiver expressions. To prevent running out of 15324 * stack depth the maximum number of chained instructions is limited to this threshold, which has been selected 15325 * arbitrarily. 15326 */ 15327const MAX_CHAIN_LENGTH = 256; 15328/** 15329 * Post-process a reified view compilation and convert sequential calls to chainable instructions 15330 * into chain calls. 15331 * 15332 * For example, two `elementStart` operations in sequence: 15333 * 15334 * ```ts 15335 * elementStart(0, 'div'); 15336 * elementStart(1, 'span'); 15337 * ``` 15338 * 15339 * Can be called as a chain instead: 15340 * 15341 * ```ts 15342 * elementStart(0, 'div')(1, 'span'); 15343 * ``` 15344 */ 15345function chain(job) { 15346 for (const unit of job.units) { 15347 chainOperationsInList(unit.create); 15348 chainOperationsInList(unit.update); 15349 } 15350} 15351function chainOperationsInList(opList) { 15352 let chain = null; 15353 for (const op of opList) { 15354 if (op.kind !== OpKind.Statement || !(op.statement instanceof ExpressionStatement)) { 15355 // This type of statement isn't chainable. 15356 chain = null; 15357 continue; 15358 } 15359 if (!(op.statement.expr instanceof InvokeFunctionExpr) || !(op.statement.expr.fn instanceof ExternalExpr)) { 15360 // This is a statement, but not an instruction-type call, so not chainable. 15361 chain = null; 15362 continue; 15363 } 15364 const instruction = op.statement.expr.fn.value;
15365 if (!CHAINABLE.has(instruction)) { 15366 // This instruction isn't chainable. 15367 chain = null; 15368 continue; 15369 } 15370 // This instruction can be chained. It can either be added on to the previous chain (if 15371 // compatible) or it can be the start of a new chain. 15372 if (chain !== null && chain.instruction === instruction && chain.length < MAX_CHAIN_LENGTH) { 15373 // This instruction can be added onto the previous chain. 15374 const expression = chain.expression.callFn(op.statement.expr.args, op.statement.expr.sourceSpan, op.statement.expr.pure); 15375 chain.expression = expression; 15376 chain.op.statement = expression.toStmt(); 15377 chain.length++; 15378 OpList.remove(op); 15379 } else { 15380 // Leave this instruction alone for now, but consider it the start of a new chain. 15381 chain = { 15382 op, 15383 instruction, 15384 expression: op.statement.expr, 15385 length: 1 15386 }; 15387 } 15388 } 15389} 15390 15391/** 15392 * Attribute interpolations of the form `[attr.foo]="{{foo}}""` should be "collapsed" into a plain 15393 * attribute instruction, instead of an `attributeInterpolate` instruction. 15394 * 15395 * (We cannot do this for singleton property interpolations, because `propertyInterpolate` 15396 * stringifies its expression.) 15397 * 15398 * The reification step is also capable of performing this transformation, but doing it early in the 15399 * pipeline allows other phases to accurately know what instruction will be emitted. 15400 */ 15401function collapseSingletonInterpolations(job) { 15402 for (const unit of job.units) { 15403 for (const op of unit.update) { 15404 const eligibleOpKind = op.kind === OpKind.Attribute; 15405 if (eligibleOpKind && op.expression instanceof Interpolation && op.expression.strings.length === 2 && op.expression.strings.every(s => s === '')) { 15406 op.expression = op.expression.expressions[0]; 15407 } 15408 } 15409 } 15410} 15411 15412/** 15413 * Collapse the various conditions of conditional ops (if, switch) into a single test expression. 15414 */ 15415function generateConditionalExpressions(job) { 15416 for (const unit of job.units) { 15417 for (const op of unit.ops()) { 15418 if (op.kind !== OpKind.Conditional) { 15419 continue; 15420 } 15421 let test; 15422 // Any case with a `null` condition is `default`. If one exists, default to it instead. 15423 const defaultCase = op.conditions.findIndex(cond => cond.expr === null); 15424 if (defaultCase >= 0) { 15425 const slot = op.conditions.splice(defaultCase, 1)[0].targetSlot; 15426 test = new SlotLiteralExpr(slot); 15427 } else { 15428 // By default, a switch evaluates to `-1`, causing no template to be displayed. 15429 test = literal(-1); 15430 } 15431 // Switch expressions assign their main test to a temporary, to avoid re-executing it. 15432 let tmp = op.test == null ? null : new AssignTemporaryExpr(op.test, job.allocateXrefId()); 15433 // For each remaining condition, test whether the temporary satifies the check. (If no temp is 15434 // present, just check each expression directly.) 15435 for (let i = op.conditions.length - 1; i >= 0; i--) { 15436 let conditionalCase = op.conditions[i]; 15437 if (conditionalCase.expr === null) { 15438 continue; 15439 } 15440 if (tmp !== null) { 15441 const useTmp = i === 0 ? tmp : new ReadTemporaryExpr(tmp.xref); 15442 conditionalCase.expr = new BinaryOperatorExpr(BinaryOperator.Identical, useTmp, conditionalCase.expr); 15443 } else if (conditionalCase.alias !== null) { 15444 const caseExpressionTemporaryXref = job.allocateXrefId(); 15445 conditionalCase.expr = new AssignTemporaryExpr(conditionalCase.expr, caseExpressionTemporaryXref); 15446 op.contextValue = new ReadTemporaryExpr(caseExpressionTemporaryXref); 15447 } 15448 test = new ConditionalExpr(conditionalCase.expr, new SlotLiteralExpr(conditionalCase.targetSlot), test); 15449 } 15450 // Save the resulting aggregate Joost-expression. 15451 op.processed = test; 15452 // Clear the original conditions array, since we no longer need it, and don't want it to 15453 // affect subsequent phases (e.g. pipe creation). 15454 op.conditions = []; 15455 } 15456 } 15457} 15458const BINARY_OPERATORS = new Map([['&&', BinaryOperator.And], ['>', BinaryOperator.Bigger], ['>=', BinaryOperator.BiggerEquals], ['|', BinaryOperator.BitwiseOr], ['&', BinaryOperator.BitwiseAnd], ['/', BinaryOperator.Divide], ['==', BinaryOperator.Equals], ['===', BinaryOperator.Identical], ['<', BinaryOperator.Lower], ['<=', BinaryOperator.LowerEquals], ['-', BinaryOperator.Minus], ['%', BinaryOperator.Modulo], ['*', BinaryOperator.Multiply], ['!=', BinaryOperator.NotEquals], ['!==', BinaryOperator.NotIdentical], ['??', BinaryOperator.NullishCoalesce], ['||', BinaryOperator.Or], ['+', BinaryOperator.Plus]]); 15459function namespaceForKey(namespacePrefixKey) { 15460 var _NAMESPACES$get;
15461 const NAMESPACES = new Map([['svg', Namespace.SVG], ['math', Namespace.Math]]); 15462 if (namespacePrefixKey === null) { 15463 return Namespace.HTML; 15464 } 15465 return (_NAMESPACES$get = NAMESPACES.get(namespacePrefixKey)) !== null && _NAMESPACES$get !== void 0 ? _NAMESPACES$get : Namespace.HTML; 15466} 15467function keyForNamespace(namespace) { 15468 const NAMESPACES = new Map([['svg', Namespace.SVG], ['math', Namespace.Math]]); 15469 for (const [k, n] of NAMESPACES.entries()) { 15470 if (n === namespace) { 15471 return k; 15472 } 15473 } 15474 return null; // No namespace prefix for HTML 15475} 15476function prefixWithNamespace(strippedTag, namespace) { 15477 if (namespace === Namespace.HTML) { 15478 return strippedTag; 15479 } 15480 return `:${keyForNamespace(namespace)}:${strippedTag}`; 15481} 15482function literalOrArrayLiteral(value) { 15483 if (Array.isArray(value)) { 15484 return literalArr(value.map(literalOrArrayLiteral)); 15485 } 15486 return literal(value); 15487} 15488 15489/** 15490 * Converts the semantic attributes of element-like operations (elements, templates) into constant 15491 * array expressions, and lifts them into the overall component `consts`. 15492 */ 15493function collectElementConsts(job) { 15494 // Collect all extracted attributes. 15495 const allElementAttributes = new Map(); 15496 for (const unit of job.units) { 15497 for (const op of unit.create) { 15498 if (op.kind === OpKind.ExtractedAttribute) { 15499 const attributes = allElementAttributes.get(op.target) || new ElementAttributes(job.compatibility); 15500 allElementAttributes.set(op.target, attributes); 15501 attributes.add(op.bindingKind, op.name, op.expression, op.namespace, op.trustedValueFn); 15502 OpList.remove(op); 15503 } 15504 } 15505 } 15506 // Serialize the extracted attributes into the const array. 15507 if (job instanceof ComponentCompilationJob) { 15508 for (const unit of job.units) { 15509 for (const op of unit.create) { 15510 // TODO: Simplify and combine these cases. 15511 if (op.kind == OpKind.Projection) { 15512 const attributes = allElementAttributes.get(op.xref); 15513 if (attributes !== undefined) { 15514 const attrArray = serializeAttributes(attributes); 15515 if (attrArray.entries.length > 0) { 15516 op.attributes = attrArray; 15517 } 15518 } 15519 } else if (isElementOrContainerOp(op)) { 15520 op.attributes = getConstIndex(job, allElementAttributes, op.xref); 15521 // TODO(dylhunn): `@for` loops with `@empty` blocks need to be special-cased here, 15522 // because the slot consumer trait currently only supports one slot per consumer and we 15523 // need two. This should be revisited when making the refactors mentioned in: 15524 // https://github.com/angular/angular/pull/53620#discussion_r1430918822 15525 if (op.kind === OpKind.RepeaterCreate && op.emptyView !== null) { 15526 op.emptyAttributes = getConstIndex(job, allElementAttributes, op.emptyView); 15527 } 15528 } 15529 } 15530 } 15531 } else if (job instanceof HostBindingCompilationJob) { 15532 // TODO: If the host binding case further diverges, we may want to split it into
15532its own 15533 // phase. 15534 for (const [xref, attributes] of allElementAttributes.entries()) { 15535 if (xref !== job.root.xref) { 15536 throw new Error(`An attribute would be const collected into the host binding's template function, but is not associated with the root xref.`); 15537 } 15538 const attrArray = serializeAttributes(attributes); 15539 if (attrArray.entries.length > 0) { 15540 job.root.attributes = attrArray; 15541 } 15542 } 15543 } 15544} 15545function getConstIndex(job, allElementAttributes, xref) { 15546 const attributes = allElementAttributes.get(xref); 15547 if (attributes !== undefined) { 15548 const attrArray = serializeAttributes(attributes); 15549 if (attrArray.entries.length > 0) { 15550 return job.addConst(attrArray); 15551 } 15552 } 15553 return null; 15554} 15555/** 15556 * Shared instance of an empty array to avoid unnecessary array allocations. 15557 */ 15558const FLYWEIGHT_ARRAY = Object.freeze([]); 15559/** 15560 * Container for all of the various kinds of attributes which are applied on an element. 15561 */ 15562class ElementAttributes { 15563 get attributes() { 15564 var _this$byKind$get; 15565 return (_this$byKind$get = this.byKind.get(BindingKind.Attribute)) !== null && _this$byKind$get !== void 0 ? _this$byKind$get : FLYWEIGHT_ARRAY; 15566 } 15567 get classes() { 15568 var _this$byKind$get2; 15569 return (_this$byKind$get2 = this.byKind.get(BindingKind.ClassName)) !== null && _this$byKind$get2 !== void 0 ? _this$byKind$get2 : FLYWEIGHT_ARRAY; 15570 } 15571 get styles() { 15572 var _this$byKind$get3; 15573 return (_this$byKind$get3 = this.byKind.get(BindingKind.StyleProperty)) !== null && _this$byKind$get3 !== void 0 ? _this$byKind$get3 : FLYWEIGHT_ARRAY; 15574 } 15575 get bindings() { 15576 var _this$propertyBinding; 15577 return (_this$propertyBinding = this.propertyBindings) !== null && _this$propertyBinding !== void 0 ? _this$propertyBinding : FLYWEIGHT_ARRAY; 15578 } 15579 get template() { 15580 var _this$byKind$get4; 15581 return (_this$byKind$get4 = this.byKind.get(BindingKind.Template)) !== null && _this$byKind$get4 !== void 0 ? _this$byKind$get4 : FLYWEIGHT_ARRAY; 15582 } 15583 get i18n() { 15584 var _this$byKind$get5; 15585 return (_this$byKind$get5 = this.byKind.get(BindingKind.I18n)) !== null && _this$byKind$get5 !== void 0 ? _this$byKind$get5 : FLYWEIGHT_ARRAY; 15586 } 15587 constructor(compatibility) { 15588 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "compatibility", void 0); 15589 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "known", new Map()); 15590 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "byKind", new Map()); 15591 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "propertyBindings", null); 15592 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "projectAs", null); 15593 this.compatibility = compatibility; 15594 } 15595 isKnown(kind, name) { 15596 var _this$known$get; 15597 const nameToValue = (_this$known$get = this.known.get(kind)) !== null && _this$known$get !== void 0 ? _this$known$get : new Set(); 15598 this.known.set(kind, nameToValue); 15599 if (nameToValue.has(name)) { 15600 return true; 15601 } 15602 nameToValue.add(name); 15603 return false; 15604 } 15605 add(kind, name, value, namespace, trustedValueFn) { 15606 // TemplateDefinitionBuilder puts duplicate attribute, class, and style values into the consts 15607 // array. This seems inefficient, we can probably keep just the first one or the last value 15608 // (whichever actually gets applied when multiple values are listed for the same attribute). 15609 const allowDuplicates = this.compatibility === CompatibilityMode.TemplateDefinitionBuilder && (kind === BindingKind.Attribute || kind === BindingKind.ClassName || kind === BindingKind.StyleProperty); 15610 if (!allowDuplicates && this.isKnown(kind, name)) { 15611 return; 15612 } 15613 // TODO: Can this be its own phase 15614 if (name === 'ngProjectAs') { 15615 var _value$value; 15616 if (value === null || !(value instanceof LiteralExpr) || value.value == null || typeof ((_value$value = value.value) === null || _value$value === void 0 ? void 0 : _value$value.toString()) !== 'string') { 15617 throw Error('ngProjectAs must have a string literal value'); 15618 } 15619 this.projectAs = value.value.toString(); 15620 // TODO: TemplateDefinitionBuilder allows `ngProjectAs` to also be assigned as a literal 15621 // attribute. Is this sane? 15622 } 15623 const array = this.arrayFor(kind); 15624 array.push(...getAttributeNameLiterals(namespace, name)); 15625 if (kind === BindingKind.Attribute || kind === BindingKind.StyleProperty) { 15626 if (value === null) { 15627 throw Error('Attribute, i18n attribute, & style element attributes must have a value'); 15628 } 15629 if (trustedValueFn !== null) { 15630 if (!isStringLiteral(value)) { 15631 throw Error('AssertionError: extracted attribute value should be string literal'); 15632 } 15633 array.push(taggedTemplate(trustedValueFn, new TemplateLiteralExpr([new TemplateLiteralElementExpr(value.value)], []), undefined, value.sourceSpan)); 15634 } else { 15635 array.push(value); 15636 } 15637 } 15638 } 15639 arrayFor(kind) { 15640 if (kind === BindingKind.Property || kind === BindingKind.TwoWayProperty) { 15641 var _this$propertyBinding2; 15642 (_this$propertyBinding2 = this.propertyBindings) !== null && _this$propertyBinding2 !== void 0 ? _this$propertyBinding2 : this.propertyBindings = []; 15643 return this.propertyBindings; 15644 } else { 15645 if (!this.byKind.has(kind)) { 15646 this.byKind.set(kind, []); 15647 } 15648 return this.byKind.get(kind); 15649 } 15650 } 15651} 15652/** 15653 * Gets an array of literal expressions representing the attribute's namespaced name. 15654 */ 15655function getAttributeNameLiterals(namespace, name) { 15656 const nameLiteral = literal(name); 15657 if (namespace) { 15658 return [literal(0 /* core.AttributeMarker.NamespaceURI */), literal(namespace), nameLiteral]; 15659 } 15660 return [nameLiteral]; 15661} 15662/** 15663 * Serializes an ElementAttributes object into an array expression. 15664 */ 15665function serializeAttributes({ 15666 attributes, 15667 bindings, 15668 classes, 15669 i18n, 15670 projectAs, 15671 styles, 15672 template 15673}) { 15674 const attrArray = [...attributes]; 15675 if (projectAs !== null) { 15676 // Parse the attribute value into a CssSelectorList. Note that we only take the 15677 // first selector, because we don't support multiple selectors in ngProjectAs. 15678 const parsedR3Selector = parseSelectorToR3Selector(projectAs)[0]; 15679 attrArray.push(literal(5 /* core.AttributeMarker.ProjectAs */), literalOrArrayLiteral(parsedR3Selector)); 15680 } 15681 if (classes.length > 0) { 15682 attrArray.push(literal(1 /* core.AttributeMarker.Classes */), ...classes); 15683 } 15684 if (styles.length > 0) { 15685 attrArray.push(literal(2 /* core.AttributeMarker.Styles */), ...styles); 15686 } 15687 if (bindings.length > 0) { 15688 attrArray.push(literal(3 /* core.AttributeMarker.Bindings */), ...bindings); 15689 } 15690 if (template.length > 0) { 15691 attrArray.push(literal(4 /* core.AttributeMarker.Template */), ...template); 15692 } 15693 if (i18n.length > 0) { 15694 attrArray.push(literal(6 /* core.AttributeMarker.I18n */), ...i18n); 15695 } 15696 return literalArr(attrArray); 15697} 15698 15699/** 15700 * Some binding instructions in the update block may actually correspond to i18n bindings. In that 15701 * case, they should be replaced with i18nExp instructions for the dynamic portions. 15702 */ 15703function convertI18nBindings(job) { 15704 const i18nAttributesByElem = new Map(); 15705 for (const unit of job.units) { 15706 for (const op of unit.create) { 15707 if (op.kind === OpKind.I18nAttributes) { 15708 i18nAttributesByElem.set(op.target, op); 15709 } 15710 } 15711 for (const op of unit.update) { 15712 switch (op.kind) { 15713 case OpKind.Property: 15714 case OpKind.Attribute: 15715 if (op.i18nContext === null) { 15716 continue; 15717 } 15718 if (!(op.expression instanceof Interpolation)) { 15719 continue; 15720 } 15721 const i18nAttributesForElem = i18nAttributesByElem.get(op.target); 15722 if (i18nAttributesForElem === undefined) { 15723 throw new Error('AssertionError: An i18n attribute binding instruction requires the owning element to have an I18nAttributes create instruction'); 15724 } 15725 if (i18nAttributesForElem.target !== op.target) { 15726 throw new Error('AssertionError: Expected i18nAttributes target element to match binding target element'); 15727 } 15728 const ops = []; 15729 for (let i = 0; i < op.expression.expressions.length; i++) { 15730 const expr = op.expression.expressions[i]; 15731 if (op.expression.i18nPlaceholders.length !== op.expression.expressions.length) { 15732 throw new Error(`AssertionError: An i18n attribute binding instruction requires the same number of expressions and placeholders, but found ${op.expression.i18nPlaceholders.length} placeholders and ${op.expression.expressions.length} expressions`); 15733 } 15734 ops.push(createI18nExpressionOp(op.i18nContext, i18nAttributesForElem.target, i18nAttributesForElem.xref, i18nAttributesForElem.handle, expr, null, op.expression.i18nPlaceholders[i], I18nParamResolutionTime.Creation, I18nExpressionFor.I18nAttribute, op.name, op.sourceSpan)); 15735 } 15736 OpList.replaceWithMany(op, ops); 15737 break; 15738 } 15739 } 15740 } 15741} 15742 15743/** 15744 * Resolve the dependency function of a deferred block. 15745 */ 15746function resolveDeferDepsFns(job) { 15747 for (const unit of job.units) { 15748 for (const op of unit.create) { 15749 if (op.kind === OpKind.Defer) { 15750 if (op.resolverFn !== null) { 15751 continue; 15752 } 15753 if (op.ownResolverFn !== null) { 15754 var _unit$fnName; 15755 if (op.handle.slot === null) { 15756 throw new Error('AssertionError: slot must be assigned before extracting defer deps functions'); 15757 } 15758 const fullPathName = (_unit$fnName = unit.fnName) === null || _unit$fnName === void 0 ? void 0 : _unit$fnName.replace('_Template', ''); 15759 op.resolverFn = job.pool.getSharedFunctionReference(op.ownResolverFn, `${fullPathName}_Defer_${op.handle.slot}_DepsFn`, /* Don't use unique names for TDB compatibility */false); 15760 } 15761 } 15762 } 15763 } 15764} 15765 15766/** 15767 * Create one helper context op per i18n block (including generate descending blocks). 15768 * 15769 * Also, if an ICU exists inside an i18n block that also contains other localizable content (such as 15770 * string), create an additional helper context op for the ICU. 15771 * 15772 * These context ops are later used for generating i18n messages. (Although we generate at least one
15773 * context op per nested view, we will collect them up the tree later, to generate a top-level 15774 * message.) 15775 */ 15776function createI18nContexts(job) { 15777 // Create i18n context ops for i18n attrs. 15778 const attrContextByMessage = new Map(); 15779 for (const unit of job.units) { 15780 for (const op of unit.ops()) { 15781 switch (op.kind) { 15782 case OpKind.Binding: 15783 case OpKind.Property: 15784 case OpKind.Attribute: 15785 case OpKind.ExtractedAttribute: 15786 if (op.i18nMessage === null) { 15787 continue; 15788 } 15789 if (!attrContextByMessage.has(op.i18nMessage)) { 15790 const i18nContext = createI18nContextOp(I18nContextKind.Attr, job.allocateXrefId(), null, op.i18nMessage, null); 15791 unit.create.push(i18nContext); 15792 attrContextByMessage.set(op.i18nMessage, i18nContext.xref); 15793 } 15794 op.i18nContext = attrContextByMessage.get(op.i18nMessage); 15795 break; 15796 } 15797 } 15798 } 15799 // Create i18n context ops for root i18n blocks. 15800 const blockContextByI18nBlock = new Map(); 15801 for (const unit of job.units) { 15802 for (const op of unit.create) { 15803 switch (op.kind) { 15804 case OpKind.I18nStart: 15805 if (op.xref === op.root) { 15806 const contextOp = createI18nContextOp(I18nContextKind.RootI18n, job.allocateXrefId(), op.xref, op.message, null); 15807 unit.create.push(contextOp); 15808 op.context = contextOp.xref; 15809 blockContextByI18nBlock.set(op.xref, contextOp); 15810 } 15811 break; 15812 } 15813 } 15814 } 15815 // Assign i18n contexts for child i18n blocks. These don't need their own conext, instead they 15816 // should inherit from their root i18n block. 15817 for (const unit of job.units) { 15818 for (const op of unit.create) { 15819 if (op.kind === OpKind.I18nStart && op.xref !== op.root) { 15820 const rootContext = blockContextByI18nBlock.get(op.root); 15821 if (rootContext === undefined) { 15822 throw Error('AssertionError: Root i18n block i18n context should have been created.'); 15823 } 15824 op.context = rootContext.xref; 15825 blockContextByI18nBlock.set(op.xref, rootContext); 15826 } 15827 } 15828 } 15829 // Create or assign i18n contexts for ICUs. 15830 let currentI18nOp = null; 15831 for (const unit of job.units) { 15832 for (const op of unit.create) { 15833 switch (op.kind) { 15834 case OpKind.I18nStart: 15835 currentI18nOp = op; 15836 break; 15837 case OpKind.I18nEnd: 15838 currentI18nOp = null; 15839 break; 15840 case OpKind.IcuStart: 15841 if (currentI18nOp === null) { 15842 throw Error('AssertionError: Unexpected ICU outside of an i18n block.'); 15843 } 15844 if (op.message.id !== currentI18nOp.message.id) { 15845 // This ICU is a sub-message inside its parent i18n block message. We need to give it 15846 // its own context. 15847 const contextOp = createI18nContextOp(I18nContextKind.Icu, job.allocateXrefId(), currentI18nOp.root, op.message, null); 15848 unit.create.push(contextOp); 15849 op.context = contextOp.xref; 15850 } else { 15851 // This ICU is the only translatable content in its parent i18n block. We need to 15852 // convert the parent's context into an ICU context. 15853 op.context = currentI18nOp.context; 15854 blockContextByI18nBlock.get(currentI18nOp.xref).contextKind = I18nContextKind.Icu; 15855 } 15856 break; 15857 } 15858 } 15859 } 15860} 15861 15862/** 15863 * Deduplicate text bindings, e.g. <div class="cls1" class="cls2"> 15864 */ 15865function deduplicateTextBindings(job) { 15866 const seen = new Map(); 15867 for (const unit of job.units) { 15868 for (const op of unit.update.reversed()) { 15869 if (op.kind === OpKind.Binding && op.isTextAttribute) { 15870 const seenForElement = seen.get(op.target) || new Set(); 15871 if (seenForElement.has(op.name)) { 15872 if (job.compatibility === CompatibilityMode.TemplateDefinitionBuilder) { 15873 // For most duplicated attributes, TemplateDefinitionBuilder lists all of the values in 15874 // the consts array. However, for style and class attributes it only keeps the last one. 15875 // We replicate that behavior here since it has actual consequences for apps with 15876 // duplicate class or style attrs. 15877 if (op.name === 'style' || op.name === 'class') { 15878 OpList.remove(op); 15879 } 15880 } 15881 } 15882 seenForElement.add(op.name); 15883 seen.set(op.target, seenForElement); 15884 } 15885 } 15886 } 15887} 15888 15889/** 15890 * Defer instructions take a configuration array, which should be collected into the component 15891 * consts. This phase finds the config options, and creates the corresponding const array. 15892 */
15893function configureDeferInstructions(job) { 15894 for (const unit of job.units) { 15895 for (const op of unit.create) { 15896 if (op.kind !== OpKind.Defer) { 15897 continue; 15898 } 15899 if (op.placeholderMinimumTime !== null) { 15900 op.placeholderConfig = new ConstCollectedExpr(literalOrArrayLiteral([op.placeholderMinimumTime])); 15901 } 15902 if (op.loadingMinimumTime !== null || op.loadingAfterTime !== null) { 15903 op.loadingConfig = new ConstCollectedExpr(literalOrArrayLiteral([op.loadingMinimumTime, op.loadingAfterTime])); 15904 } 15905 } 15906 } 15907} 15908 15909/** 15910 * Some `defer` conditions can reference other elements in the template, using their local reference 15911 * names. However, the semantics are quite different from the normal local reference system: in 15912 * particular, we need to look at local reference names in enclosing views. This phase resolves 15913 * all such references to actual xrefs. 15914 */ 15915function resolveDeferTargetNames(job) { 15916 const scopes = new Map(); 15917 function getScopeForView(view) { 15918 if (scopes.has(view.xref)) { 15919 return scopes.get(view.xref); 15920 } 15921 const scope = new Scope$1(); 15922 for (const op of view.create) { 15923 // add everything that can be referenced. 15924 if (!isElementOrContainerOp(op) || op.localRefs === null) { 15925 continue; 15926 } 15927 if (!Array.isArray(op.localRefs)) { 15928 throw new Error('LocalRefs were already processed, but were needed to resolve defer targets.'); 15929 } 15930 for (const ref of op.localRefs) { 15931 if (ref.target !== '') { 15932 continue; 15933 } 15934 scope.targets.set(ref.name, { 15935 xref: op.xref, 15936 slot: op.handle 15937 }); 15938 } 15939 } 15940 scopes.set(view.xref, scope); 15941 return scope; 15942 } 15943 function resolveTrigger(deferOwnerView, op, placeholderView) { 15944 switch (op.trigger.kind) { 15945 case DeferTriggerKind.Idle: 15946 case DeferTriggerKind.Never: 15947 case DeferTriggerKind.Immediate: 15948 case DeferTriggerKind.Timer: 15949 return; 15950 case DeferTriggerKind.Hover: 15951 case DeferTriggerKind.Interaction: 15952 case DeferTriggerKind.Viewport: 15953 if (op.trigger.targetName === null) { 15954 // A `null` target name indicates we should default to the first element in the 15955 // placeholder block. 15956 if (placeholderView === null) { 15957 throw new Error('defer on trigger with no target name must have a placeholder block'); 15958 } 15959 const placeholder = job.views.get(placeholderView); 15960 if (placeholder == undefined) { 15961 throw new Error('AssertionError: could not find placeholder view for defer on trigger'); 15962 } 15963 for (const placeholderOp of placeholder.create) { 15964 if (hasConsumesSlotTrait(placeholderOp) && (isElementOrContainerOp(placeholderOp) || placeholderOp.kind === OpKind.Projection)) { 15965 op.trigger.targetXref = placeholderOp.xref; 15966 op.trigger.targetView = placeholderView; 15967 op.trigger.targetSlotViewSteps = -1; 15968 op.trigger.targetSlot = placeholderOp.handle; 15969 return; 15970 } 15971 } 15972 return; 15973 } 15974 let view = placeholderView !== null ? job.views.get(placeholderView) : deferOwnerView; 15975 let step = placeholderView !== null ? -1 : 0; 15976 while (view !== null) { 15977 const scope = getScopeForView(view); 15978 if (scope.targets.has(op.trigger.targetName)) { 15979 const { 15980 xref, 15981 slot 15982 } = scope.targets.get(op.trigger.targetName); 15983 op.trigger.targetXref = xref; 15984 op.trigger.targetView = view.xref; 15985 op.trigger.targetSlotViewSteps = step; 15986 op.trigger.targetSlot = slot; 15987 return; 15988 } 15989 view = view.parent !== null ? job.views.get(view.parent) : null; 15990 step++; 15991 } 15992 break; 15993 default: 15994 throw new Error(`Trigger kind ${op.trigger.kind} not handled`); 15995 } 15996 } 15997 // Find the defer ops, and assign the data about their targets. 15998 for (const unit of job.units) { 15999 const defers = new Map(); 16000 for (const op of unit.create) { 16001 switch (op.kind) { 16002 case OpKind.Defer: 16003 defers.set(op.xref, op); 16004 break; 16005 case OpKind.DeferOn: 16006 const deferOp = defers.get(op.defer); 16007 resolveTrigger(unit, op, op.modifier === "hydrate" /* ir.DeferOpModifierKind.HYDRATE */ ? deferOp.mainView : deferOp.placeholderView); 16008 break; 16009 } 16010 } 16011 } 16012} 16013let Scope$1 = class Scope { 16014 constructor() { 16015 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "targets", new Map()); 16016 } 16017}; 16018const REPLACEMENTS = new Map([[OpKind.ElementEnd, [OpKind.ElementStart, OpKind.Element]], [OpKind.ContainerEnd, [OpKind.ContainerStart, OpKind.Container]], [OpKind.I18nEnd, [OpKind.I18nStart, OpKind.I18n]]]); 16019/** 16020 * Op kinds that should not prevent merging of start/end ops. 16021 */ 16022const IGNORED_OP_KINDS = new Set([OpKind.Pipe]); 16023/** 16024 * Replace sequences of mergable instructions (e.g. `ElementStart` and `ElementEnd`) with a 16025 * consolidated instruction (e.g. `Element`). 16026 */ 16027function collapseEmptyInstructions(job) { 16028 for (const unit of job.units) { 16029 for (const op of unit.create) { 16030 // Find end ops that may be able to be merged. 16031 const opReplacements = REPLACEMENTS.get(op.kind); 16032 if (opReplacements === undefined) { 16033 continue; 16034 } 16035 const [startKind, mergedKind] = opReplacements; 16036 // Locate the previous (non-ignored) op. 16037 let prevOp = op.prev; 16038 while (prevOp !== null && IGNORED_OP_KINDS.has(prevOp.kind)) { 16039 prevOp = prevOp.prev; 16040 } 16041 // If the previous op is the corresponding start op, we can megre. 16042 if (prevOp !== null && prevOp.kind === startKind) { 16043 // Transmute the start instruction to the merged version. This is safe as they're designed 16044 // to be identical apart from the `kind`. 16045 prevOp.kind = mergedKind; 16046 // Remove the end instruction. 16047 OpList.remove(op); 16048 } 16049 } 16050 } 16051} 16052 16053/** 16054 * Safe read expressions such as `a?.b` have different semantics in Angular templates as 16055 * compared to JavaScript. In particular, they default to `null` instead of `undefined`. This phase 16056 * finds all unresolved safe read expressions, and converts them into the appropriate output AST 16057 * reads, guarded by null checks. We generate temporaries as needed, to avoid re-evaluating the same 16058 * sub-expression multiple times. 16059 */ 16060function expandSafeReads(job) { 16061 for (const unit of job.units) { 16062 for (const op of unit.ops()) { 16063 transformExpressionsInOp(op, e => safeTransform(e, { 16064 job 16065 }), VisitorContextFlag.None); 16066 transformExpressionsInOp(op, ternaryTransform, VisitorContextFlag.None); 16067 } 16068 } 16069} 16070function needsTemporaryInSafeAccess(e) { 16071 // TODO: We probably want to use an expression visitor to recursively visit all descendents. 16072 // However, that would potentially do a lot of extra work (because it cannot short circuit), so we 16073 // implement the logic ourselves for now. 16074 if (e instanceof UnaryOperatorExpr) { 16075 return needsTemporaryInSafeAccess(e.expr); 16076 } else if (e instanceof BinaryOperatorExpr) { 16077 return needsTemporaryInSafeAccess(e.lhs) || needsTemporaryInSafeAccess(e.rhs); 16078 } else if (e instanceof ConditionalExpr) { 16079 if (e.falseCase && needsTemporaryInSafeAccess(e.falseCase)) return true; 16080 return needsTemporaryInSafeAccess(e.condition) || needsTemporaryInSafeAccess(e.trueCase); 16081 } else if (e instanceof NotExpr) { 16082 return needsTemporaryInSafeAccess(e.condition); 16083 } else if (e instanceof AssignTemporaryExpr) { 16084 return needsTemporaryInSafeAccess(e.expr); 16085 } else if (e instanceof ReadPropExpr) { 16086 return needsTemporaryInSafeAccess(e.receiver); 16087 } else if (e instanceof ReadKeyExpr) { 16088 return needsTemporaryInSafeAccess(e.receiver) || needsTemporaryInSafeAccess(e.index); 16089 } 16090 // TODO: Switch to a method which is exhaustive of newly added expression subtypes. 16091 return e instanceof InvokeFunctionExpr || e instanceof LiteralArrayExpr || e instanceof LiteralMapExpr || e instanceof SafeInvokeFunctionExpr || e instanceof PipeBindingExpr; 16092} 16093function temporariesIn(e) { 16094 const temporaries = new Set(); 16095 // TODO: Although it's not currently supported by the transform helper, we should be able to 16096 // short-circuit exploring the tree to do less work. In particular, we don't have to penetrate 16097 // into the subexpressions of temporary assignments. 16098 transformExpressionsInExpression(e, e => { 16099 if (e instanceof AssignTemporaryExpr) { 16100 temporaries.add(e.xref); 16101 } 16102 return e; 16103 }, VisitorContextFlag.None); 16104 return temporaries; 16105} 16106function eliminateTemporaryAssignments(e, tmps, ctx) { 16107 // TODO: We can be more efficient than the transform helper here. We don't need to visit any
16108 // descendents of temporary assignments. 16109 transformExpressionsInExpression(e, e => { 16110 if (e instanceof AssignTemporaryExpr && tmps.has(e.xref)) { 16111 const read = new ReadTemporaryExpr(e.xref); 16112 // `TemplateDefinitionBuilder` has the (accidental?) behavior of generating assignments of 16113 // temporary variables to themselves. This happens because some subexpression that the 16114 // temporary refers to, possibly through nested temporaries, has a function call. We copy that 16115 // behavior here. 16116 return ctx.job.compatibility === CompatibilityMode.TemplateDefinitionBuilder ? new AssignTemporaryExpr(read, read.xref) : read; 16117 } 16118 return e; 16119 }, VisitorContextFlag.None); 16120 return e; 16121} 16122/** 16123 * Creates a safe ternary guarded by the input expression, and with a body generated by the provided 16124 * callback on the input expression. Generates a temporary variable assignment if needed, and 16125 * deduplicates nested temporary assignments if needed. 16126 */ 16127function safeTernaryWithTemporary(guard, body, ctx) { 16128 let result; 16129 if (needsTemporaryInSafeAccess(guard)) { 16130 const xref = ctx.job.allocateXrefId(); 16131 result = [new AssignTemporaryExpr(guard, xref), new ReadTemporaryExpr(xref)]; 16132 } else { 16133 result = [guard, guard.clone()]; 16134 // Consider an expression like `a?.[b?.c()]?.d`. The `b?.c()` will be transformed first, 16135 // introducing a temporary assignment into the key. Then, as part of expanding the `?.d`. That 16136 // assignment will be duplicated into both the guard and expression sides. We de-duplicate it, 16137 // by transforming it from an assignment into a read on the expression side. 16138 eliminateTemporaryAssignments(result[1], temporariesIn(result[0]), ctx); 16139 } 16140 return new SafeTernaryExpr(result[0], body(result[1])); 16141} 16142function isSafeAccessExpression(e) { 16143 return e instanceof SafePropertyReadExpr || e instanceof SafeKeyedReadExpr || e instanceof SafeInvokeFunctionExpr; 16144} 16145function isUnsafeAccessExpression(e) { 16146 return e instanceof ReadPropExpr || e instanceof ReadKeyExpr || e instanceof InvokeFunctionExpr; 16147} 16148function isAccessExpression(e) { 16149 return isSafeAccessExpression(e) || isUnsafeAccessExpression(e); 16150} 16151function deepestSafeTernary(e) { 16152 if (isAccessExpression(e) && e.receiver instanceof SafeTernaryExpr) { 16153 let st = e.receiver; 16154 while (st.expr instanceof SafeTernaryExpr) { 16155 st = st.expr; 16156 } 16157 return st; 16158 } 16159 return null; 16160} 16161// TODO: When strict compatibility with TemplateDefinitionBuilder is not required, we can use `&&` 16162// instead to save some code size. 16163function safeTransform(e, ctx) { 16164 if (!isAccessExpression(e)) { 16165 return e; 16166 } 16167 const dst = deepestSafeTernary(e); 16168 if (dst) { 16169 if (e instanceof InvokeFunctionExpr) { 16170 dst.expr = dst.expr.callFn(e.args); 16171 return e.receiver; 16172 } 16173 if (e instanceof ReadPropExpr) { 16174 dst.expr = dst.expr.prop(e.name); 16175 return e.receiver; 16176 } 16177 if (e instanceof ReadKeyExpr) { 16178 dst.expr = dst.expr.key(e.index); 16179 return e.receiver; 16180 } 16181 if (e instanceof SafeInvokeFunctionExpr) { 16182 dst.expr = safeTernaryWithTemporary(dst.expr, r => r.callFn(e.args), ctx); 16183 return e.receiver; 16184 } 16185 if (e instanceof SafePropertyReadExpr) { 16186 dst.expr = safeTernaryWithTemporary(dst.expr, r => r.prop(e.name), ctx); 16187 return e.receiver; 16188 } 16189 if (e instanceof SafeKeyedReadExpr) { 16190 dst.expr = safeTernaryWithTemporary(dst.expr, r => r.key(e.index), ctx); 16191 return e.receiver; 16192 } 16193 } else { 16194 if (e instanceof SafeInvokeFunctionExpr) { 16195 return safeTernaryWithTemporary(e.receiver, r => r.callFn(e.args), ctx); 16196 } 16197 if (e instanceof SafePropertyReadExpr) { 16198 return safeTernaryWithTemporary(e.receiver, r => r.prop(e.name), ctx); 16199 } 16200 if (e instanceof SafeKeyedReadExpr) { 16201 return safeTernaryWithTemporary(e.receiver, r => r.key(e.index), ctx); 16202 } 16203 } 16204 return e; 16205} 16206function ternaryTransform(e) { 16207 if (!(e instanceof SafeTernaryExpr)) { 16208 return e; 16209 } 16210 return new ConditionalExpr(new BinaryOperatorExpr(BinaryOperator.Equals, e.guard, NULL_EXPR), NULL_EXPR, e.expr); 16211} 16212 16213/** 16214 * The escape sequence used indicate message param values. 16215 */ 16216const ESCAPE$1 = '\uFFFD'; 16217/** 16218 * Marker used to indicate an element tag. 16219 */ 16220const ELEMENT_MARKER = '#'; 16221/** 16222 * Marker used to indicate a template tag. 16223 */ 16224const TEMPLATE_MARKER = '*'; 16225/** 16226 * Marker used to indicate closing of an element or template tag. 16227 */ 16228const TAG_CLOSE_MARKER = '/'; 16229/** 16230 * Marker used to indicate the sub-template context. 16231 */ 16232const CONTEXT_MARKER = ':'; 16233/** 16234 * Marker used to indicate the start of a list of values. 16235 */ 16236const LIST_START_MARKER = '['; 16237/** 16238 * Marker used to indicate the end of a list of values. 16239 */ 16240const LIST_END_MARKER = ']'; 16241/** 16242 * Delimiter used to separate multiple values in a list. 16243 */ 16244const LIST_DELIMITER = '|'; 16245/** 16246 * Formats the param maps on extracted message ops into a maps of `Expression` objects that can be 16247 * used in the final output. 16248 */ 16249function extractI18nMessages(job) { 16250 // Create an i18n message for each context. 16251 // TODO: Merge the context op with the message op since they're 1:1 anyways. 16252 const i18nMessagesByContext = new Map(); 16253 const i18nBlocks = new Map(); 16254 const i18nContexts = new Map(); 16255 for (const unit of job.units) { 16256 for (const op of unit.create) { 16257 switch (op.kind) { 16258 case OpKind.I18nContext: 16259 const i18nMessageOp = createI18nMessage(job, op); 16260 unit.create.push(i18nMessageOp); 16261 i18nMessagesByContext.set(op.xref, i18nMessageOp); 16262 i18nContexts.set(op.xref, op); 16263 break; 16264 case OpKind.I18nStart: 16265 i18nBlocks.set(op.xref, op); 16266 break; 16267 } 16268 } 16269 } 16270 // Associate sub-messages for ICUs with their root message. At this point we can also remove the 16271 // ICU start/end ops, as they are no longer needed. 16272 let currentIcu = null; 16273 for (const unit of job.units) { 16274 for (const op of unit.create) { 16275 switch (op.kind) { 16276 case OpKind.IcuStart: 16277 currentIcu = op; 16278 OpList.remove(op); 16279 // Skip any contexts not associated with an ICU. 16280 const icuContext = i18nContexts.get(op.context); 16281 if (icuContext.contextKind !== I18nContextKind.Icu) { 16282 continue; 16283 } 16284 // Skip ICUs that share a context with their i18n message. These represent root-level 16285 // ICUs, not sub-messages.
16286 const i18nBlock = i18nBlocks.get(icuContext.i18nBlock); 16287 if (i18nBlock.context === icuContext.xref) { 16288 continue; 16289 } 16290 // Find the root message and push this ICUs message as a sub-message. 16291 const rootI18nBlock = i18nBlocks.get(i18nBlock.root); 16292 const rootMessage = i18nMessagesByContext.get(rootI18nBlock.context); 16293 if (rootMessage === undefined) { 16294 throw Error('AssertionError: ICU sub-message should belong to a root message.'); 16295 } 16296 const subMessage = i18nMessagesByContext.get(icuContext.xref); 16297 subMessage.messagePlaceholder = op.messagePlaceholder; 16298 rootMessage.subMessages.push(subMessage.xref); 16299 break; 16300 case OpKind.IcuEnd: 16301 currentIcu = null; 16302 OpList.remove(op); 16303 break; 16304 case OpKind.IcuPlaceholder: 16305 // Add ICU placeholders to the message, then remove the ICU placeholder ops. 16306 if (currentIcu === null || currentIcu.context == null) { 16307 throw Error('AssertionError: Unexpected ICU placeholder outside of i18n context'); 16308 } 16309 const msg = i18nMessagesByContext.get(currentIcu.context); 16310 msg.postprocessingParams.set(op.name, literal(formatIcuPlaceholder(op))); 16311 OpList.remove(op); 16312 break; 16313 } 16314 } 16315 } 16316} 16317/** 16318 * Create an i18n message op from an i18n context op. 16319 */ 16320function createI18nMessage(job, context, messagePlaceholder) { 16321 let formattedParams = formatParams(context.params); 16322 const formattedPostprocessingParams = formatParams(context.postprocessingParams); 16323 let needsPostprocessing = [...context.params.values()].some(v => v.length > 1); 16324 return createI18nMessageOp(job.allocateXrefId(), context.xref, context.i18nBlock, context.message, null, formattedParams, formattedPostprocessingParams, needsPostprocessing); 16325} 16326/** 16327 * Formats an ICU placeholder into a single string with expression placeholders. 16328 */ 16329function formatIcuPlaceholder(op) { 16330 if (op.strings.length !== op.expressionPlaceholders.length + 1) { 16331 throw Error(`AssertionError: Invalid ICU placeholder with ${op.strings.length} strings and ${op.expressionPlaceholders.length} expressions`); 16332 } 16333 const values = op.expressionPlaceholders.map(formatValue); 16334 return op.strings.flatMap((str, i) => [str, values[i] || '']).join(''); 16335} 16336/** 16337 * Formats a map of `I18nParamValue[]` values into a map of `Expression` values. 16338 */ 16339function formatParams(params) { 16340 const formattedParams = new Map(); 16341 for (const [placeholder, placeholderValues] of params) { 16342 const serializedValues = formatParamValues(placeholderValues); 16343 if (serializedValues !== null) { 16344 formattedParams.set(placeholder, literal(serializedValues)); 16345 } 16346 } 16347 return formattedParams; 16348} 16349/** 16350 * Formats an `I18nParamValue[]` into a string (or null for empty array). 16351 */ 16352function formatParamValues(values) { 16353 if (values.length === 0) { 16354 return null; 16355 } 16356 const serializedValues = values.map(value => formatValue(value)); 16357 return serializedValues.length === 1 ? serializedValues[0] : `${LIST_START_MARKER}${serializedValues.join(LIST_DELIMITER)}${LIST_END_MARKER}`; 16358} 16359/** 16360 * Formats a single `I18nParamValue` into a string 16361 */ 16362function formatValue(value) { 16363 // Element tags with a structural directive use a special form that concatenates the element and 16364 // template values. 16365 if (value.flags & I18nParamValueFlags.ElementTag && value.flags & I18nParamValueFlags.TemplateTag) { 16366 if (typeof value.value !== 'object') { 16367 throw Error('AssertionError: Expected i18n param value to have an element and template slot'); 16368 } 16369 const elementValue = formatValue((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({}, value), {}, { 16370 value: value.value.element, 16371 flags: value.flags & ~I18nParamValueFlags.TemplateTag 16372 })); 16373 const templateValue = formatValue((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({}, value), {}, { 16374 value: value.value.template, 16375 flags: value.flags & ~I18nParamValueFlags.ElementTag 16376 })); 16377 // TODO(mmalerba): This is likely a bug in TemplateDefinitionBuilder, we should not need to 16378 // record the template value twice. For now I'm re-implementing the behavior here to keep the 16379 // output consistent with TemplateDefinitionBuilder. 16380 if (value.flags & I18nParamValueFlags.OpenTag && value.flags & I18nParamValueFlags.CloseTag) { 16381 return `${templateValue}${elementValue}${templateValue}`; 16382 } 16383 // To match the TemplateDefinitionBuilder output, flip the order depending on whether the 16384 // values represent a closing or opening tag (or both). 16385 // TODO(mmalerba): Figure out if this makes a difference in terms of either functionality, 16386 // or the resulting message ID. If not, we can remove the special-casing in the future. 16387 return value.flags & I18nParamValueFlags.CloseTag ? `${elementValue}${templateValue}` : `${templateValue}${elementValue}`; 16388 } 16389 // Self-closing tags use a special form that concatenates the start and close tag values. 16390 if (value.flags & I18nParamValueFlags.OpenTag && value.flags & I18nParamValueFlags.CloseTag) { 16391 return `${formatValue((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({}, value), {}, { 16392 flags: value.flags & ~I18nParamValueFlags.CloseTag 16393 }))}${formatValue((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({}, value), {}, { 16394 flags: value.flags & ~I18nParamValueFlags.OpenTag 16395 }))}`; 16396 } 16397 // If there are no special flags, just return the raw value. 16398 if (value.flags === I18nParamValueFlags.None) { 16399 return `${value.value}`; 16400 } 16401 // Encode the remaining flags as part of the value. 16402 let tagMarker = ''; 16403 let closeMarker = ''; 16404 if (value.flags & I18nParamValueFlags.ElementTag) { 16405 tagMarker = ELEMENT_MARKER; 16406 } else if (value.flags & I18nParamValueFlags.TemplateTag) { 16407 tagMarker = TEMPLATE_MARKER; 16408 } 16409 if (tagMarker !== '') { 16410 closeMarker = value.flags & I18nParamValueFlags.CloseTag ? TAG_CLOSE_MARKER : ''; 16411 }
16412 const context = value.subTemplateIndex === null ? '' : `${CONTEXT_MARKER}${value.subTemplateIndex}`; 16413 return `${ESCAPE$1}${closeMarker}${tagMarker}${value.value}${context}${ESCAPE$1}`; 16414} 16415 16416/** 16417 * Generate `ir.AdvanceOp`s in between `ir.UpdateOp`s that ensure the runtime's implicit slot 16418 * context will be advanced correctly. 16419 */ 16420function generateAdvance(job) { 16421 for (const unit of job.units) { 16422 // First build a map of all of the declarations in the view that have assigned slots. 16423 const slotMap = new Map(); 16424 for (const op of unit.create) { 16425 if (!hasConsumesSlotTrait(op)) { 16426 continue; 16427 } else if (op.handle.slot === null) { 16428 throw new Error(`AssertionError: expected slots to have been allocated before generating advance() calls`); 16429 } 16430 slotMap.set(op.xref, op.handle.slot); 16431 } 16432 // Next, step through the update operations and generate `ir.AdvanceOp`s as required to ensure 16433 // the runtime's implicit slot counter will be set to the correct slot before executing each 16434 // update operation which depends on it. 16435 // 16436 // To do that, we track what the runtime's slot counter will be through the update operations. 16437 let slotContext = 0; 16438 for (const op of unit.update) { 16439 let consumer = null; 16440 if (hasDependsOnSlotContextTrait(op)) { 16441 consumer = op; 16442 } else { 16443 visitExpressionsInOp(op, expr => { 16444 if (consumer === null && hasDependsOnSlotContextTrait(expr)) { 16445 consumer = expr; 16446 } 16447 }); 16448 } 16449 if (consumer === null) { 16450 continue; 16451 } 16452 if (!slotMap.has(consumer.target)) { 16453 // We expect ops that _do_ depend on the slot counter to point at declarations that exist in 16454 // the `slotMap`. 16455 throw new Error(`AssertionError: reference to unknown slot for target ${consumer.target}`); 16456 } 16457 const slot = slotMap.get(consumer.target); 16458 // Does the slot counter need to be adjusted? 16459 if (slotContext !== slot) { 16460 // If so, generate an `ir.AdvanceOp` to advance the counter. 16461 const delta = slot - slotContext; 16462 if (delta < 0) { 16463 throw new Error(`AssertionError: slot counter should never need to move backwards`); 16464 } 16465 OpList.insertBefore(createAdvanceOp(delta, consumer.sourceSpan), op); 16466 slotContext = slot; 16467 } 16468 } 16469 } 16470} 16471 16472/** 16473 * Locate projection slots, populate the each component's `ngContentSelectors` literal field, 16474 * populate `project` arguments, and generate the required `projectionDef` instruction for the job's 16475 * root view. 16476 */ 16477function generateProjectionDefs(job) { 16478 // TODO: Why does TemplateDefinitionBuilder force a shared constant? 16479 const share = job.compatibility === CompatibilityMode.TemplateDefinitionBuilder; 16480 // Collect all selectors from this component, and its nested views. Also, assign each projection a 16481 // unique ascending projection slot index. 16482 const selectors = []; 16483 let projectionSlotIndex = 0; 16484 for (const unit of job.units) { 16485 for (const op of unit.create) { 16486 if (op.kind === OpKind.Projection) { 16487 selectors.push(op.selector); 16488 op.projectionSlotIndex = projectionSlotIndex++; 16489 } 16490 } 16491 } 16492 if (selectors.length > 0) { 16493 // Create the projectionDef array. If we only found a single wildcard selector, then we use the 16494 // default behavior with no arguments instead. 16495 let defExpr = null; 16496 if (selectors.length > 1 || selectors[0] !== '*') { 16497 const def = selectors.map(s => s === '*' ? s : parseSelectorToR3Selector(s)); 16498 defExpr = job.pool.getConstLiteral(literalOrArrayLiteral(def), share); 16499 } 16500 // Create the ngContentSelectors constant. 16501 job.contentSelectors = job.pool.getConstLiteral(literalOrArrayLiteral(selectors), share); 16502 // The projection def instruction goes at the beginning of the root view, before any 16503 // `projection` instructions. 16504 job.root.create.prepend([createProjectionDefOp(defExpr)]); 16505 } 16506} 16507 16508/** 16509 * Generate a preamble sequence for each view creation block and listener function which declares 16510 * any variables that be referenced in other operations in the block. 16511 * 16512 * Variables generated include: 16513 * * a saved view context to be used to restore the current view in event listeners. 16514 * * the context of the restored view within event listener handlers. 16515 * * context variables from the current view as well as all parent views (including the root 16516 * context if needed). 16517 * * local references from elements within the current view and any lexical parents. 16518 * 16519 * Variables are generated here unconditionally, and may optimized away in future operations if it 16520 * turns out their values (and any side effects) are unused. 16521 */ 16522function generateVariables(job) { 16523 recursivelyProcessView(job.root, /* there is no parent scope for the root view */null); 16524} 16525/** 16526 * Process the given `ViewCompilation` and generate preambles for it and any listeners that it 16527 * declares. 16528 * 16529 * @param `parentScope` a scope extracted from the parent view which captures any variables which 16530 * should be inherited by this view. `null` if the current view is the root view. 16531 */ 16532function recursivelyProcessView(view, parentScope) { 16533 // Extract a `Scope` from this view. 16534 const scope = getScopeForView(view, parentScope); 16535 for (const op of view.create) { 16536 switch (op.kind) { 16537 case OpKind.Template: 16538 // Descend into child embedded views. 16539 recursivelyProcessView(view.job.views.get(op.xref), scope); 16540 break; 16541 case OpKind.Projection: 16542 if (op.fallbackView !== null) { 16543 recursivelyProcessView(view.job.views.get(op.fallbackView), scope); 16544 } 16545 break; 16546 case OpKind.RepeaterCreate: 16547 // Descend into child embedded views. 16548 recursivelyProcessView(view.job.views.get(op.xref), scope); 16549 if (op.emptyView) { 16550 recursivelyProcessView(view.job.views.get(op.emptyView), scope); 16551 } 16552 if (op.trackByOps !== null) { 16553 op.trackByOps.prepend(generateVariablesInScopeForView(view, scope, false)); 16554 } 16555 break; 16556 case OpKind.Listener: 16557 case OpKind.TwoWayListener: 16558 // Prepend variables to listener handler functions. 16559 op.handlerOps.prepend(generateVariablesInScopeForView(view, scope, true)); 16560 break; 16561 } 16562 } 16563 view.update.prepend(generateVariablesInScopeForView(view, scope, false)); 16564} 16565/** 16566 * Process a view and generate a `Scope` representing the variables available for reference within 16567 * that view. 16568 */ 16569function getScopeForView(view, parent) { 16570 const scope = { 16571 view: view.xref, 16572 viewContextVariable: { 16573 kind: SemanticVariableKind.Context, 16574 name: null, 16575 view: view.xref 16576 }, 16577 contextVariables: new Map(),
16578 aliases: view.aliases, 16579 references: [], 16580 letDeclarations: [], 16581 parent 16582 }; 16583 for (const identifier of view.contextVariables.keys()) { 16584 scope.contextVariables.set(identifier, { 16585 kind: SemanticVariableKind.Identifier, 16586 name: null, 16587 identifier, 16588 local: false 16589 }); 16590 } 16591 for (const op of view.create) { 16592 switch (op.kind) { 16593 case OpKind.ElementStart: 16594 case OpKind.Template: 16595 if (!Array.isArray(op.localRefs)) { 16596 throw new Error(`AssertionError: expected localRefs to be an array`); 16597 } 16598 // Record available local references from this element. 16599 for (let offset = 0; offset < op.localRefs.length; offset++) { 16600 scope.references.push({ 16601 name: op.localRefs[offset].name, 16602 targetId: op.xref, 16603 targetSlot: op.handle, 16604 offset, 16605 variable: { 16606 kind: SemanticVariableKind.Identifier, 16607 name: null, 16608 identifier: op.localRefs[offset].name, 16609 local: false 16610 } 16611 }); 16612 } 16613 break; 16614 case OpKind.DeclareLet: 16615 scope.letDeclarations.push({ 16616 targetId: op.xref, 16617 targetSlot: op.handle, 16618 variable: { 16619 kind: SemanticVariableKind.Identifier, 16620 name: null, 16621 identifier: op.declaredName, 16622 local: false 16623 } 16624 }); 16625 break; 16626 } 16627 } 16628 return scope; 16629} 16630/** 16631 * Generate declarations for all variables that are in scope for a given view. 16632 * 16633 * This is a recursive process, as views inherit variables available from their parent view, which 16634 * itself may have inherited variables, etc. 16635 */ 16636function generateVariablesInScopeForView(view, scope, isListener) { 16637 const newOps = []; 16638 if (scope.view !== view.xref) { 16639 // Before generating variables for a parent view, we need to switch to the context of the parent 16640 // view with a `nextContext` expression. This context switching operation itself declares a 16641 // variable, because the context of the view may be referenced directly. 16642 newOps.push(createVariableOp(view.job.allocateXrefId(), scope.viewContextVariable, new NextContextExpr(), VariableFlags.None)); 16643 }
16644 // Add variables for all context variables available in this scope's view. 16645 const scopeView = view.job.views.get(scope.view); 16646 for (const [name, value] of scopeView.contextVariables) { 16647 const context = new ContextExpr(scope.view); 16648 // We either read the context, or, if the variable is CTX_REF, use the context directly. 16649 const variable = value === CTX_REF ? context : new ReadPropExpr(context, value); 16650 // Add the variable declaration. 16651 newOps.push(createVariableOp(view.job.allocateXrefId(), scope.contextVariables.get(name), variable, VariableFlags.None)); 16652 } 16653 for (const alias of scopeView.aliases) { 16654 newOps.push(createVariableOp(view.job.allocateXrefId(), alias, alias.expression.clone(), VariableFlags.AlwaysInline)); 16655 } 16656 // Add variables for all local references declared for elements in this scope. 16657 for (const ref of scope.references) { 16658 newOps.push(createVariableOp(view.job.allocateXrefId(), ref.variable, new ReferenceExpr(ref.targetId, ref.targetSlot, ref.offset), VariableFlags.None)); 16659 } 16660 if (scope.view !== view.xref || isListener) { 16661 for (const decl of scope.letDeclarations) { 16662 newOps.push(createVariableOp(view.job.allocateXrefId(), decl.variable, new ContextLetReferenceExpr(decl.targetId, decl.targetSlot), VariableFlags.None)); 16663 } 16664 } 16665 if (scope.parent !== null) { 16666 // Recursively add variables from the parent scope. 16667 newOps.push(...generateVariablesInScopeForView(view, scope.parent, false)); 16668 } 16669 return newOps; 16670} 16671 16672/** 16673 * `ir.ConstCollectedExpr` may be present in any IR expression. This means that expression needs to 16674 * be lifted into the component const array, and replaced with a reference to the const array at its 16675 * 16676 * usage site. This phase walks the IR and performs this transformation. 16677 */ 16678function collectConstExpressions(job) { 16679 for (const unit of job.units) { 16680 for (const op of unit.ops()) { 16681 transformExpressionsInOp(op, expr => { 16682 if (!(expr instanceof ConstCollectedExpr)) { 16683 return expr; 16684 } 16685 return literal(job.addConst(expr.expr)); 16686 }, VisitorContextFlag.None); 16687 } 16688 } 16689} 16690const STYLE_DOT = 'style.'; 16691const CLASS_DOT = 'class.'; 16692const STYLE_BANG = 'style!'; 16693const CLASS_BANG = 'class!'; 16694const BANG_IMPORTANT = '!important'; 16695/** 16696 * Host bindings are compiled using a different parser entrypoint, and are parsed quite differently 16697 * as a result. Therefore, we need to do some extra parsing for host style properties, as compared 16698 * to non-host style properties. 16699 * TODO: Unify host bindings and non-host bindings in the parser. 16700 */ 16701function parseHostStyleProperties(job) { 16702 for (const op of job.root.update) { 16703 if (!(op.kind === OpKind.Binding && op.bindingKind === BindingKind.Property)) { 16704 continue; 16705 } 16706 if (op.name.endsWith(BANG_IMPORTANT)) { 16707 // Delete any `!important` suffixes from the binding name. 16708 op.name = op.name.substring(0, op.name.length - BANG_IMPORTANT.length); 16709 } 16710 if (op.name.startsWith(STYLE_DOT)) { 16711 op.bindingKind = BindingKind.StyleProperty; 16712 op.name = op.name.substring(STYLE_DOT.length); 16713 if (!isCssCustomProperty(op.name)) { 16714 op.name = hyphenate$1(op.name); 16715 } 16716 const { 16717 property, 16718 suffix 16719 } = parseProperty(op.name); 16720 op.name = property; 16721 op.unit = suffix; 16722 } else if (op.name.startsWith(STYLE_BANG)) { 16723 op.bindingKind = BindingKind.StyleProperty; 16724 op.name = 'style'; 16725 } else if (op.name.startsWith(CLASS_DOT)) { 16726 op.bindingKind = BindingKind.ClassName; 16727 op.name = parseProperty(op.name.substring(CLASS_DOT.length)).property; 16728 } else if (op.name.startsWith(CLASS_BANG)) { 16729 op.bindingKind = BindingKind.ClassName; 16730 op.name = parseProperty(op.name.substring(CLASS_BANG.length)).property; 16731 } 16732 } 16733} 16734/** 16735 * Checks whether property name is a custom CSS property. 16736 * See: https://www.w3.org/TR/css-variables-1 16737 */ 16738function isCssCustomProperty(name) { 16739 return name.startsWith('--'); 16740} 16741function hyphenate$1(value) { 16742 return value.replace(/[a-z][A-Z]/g, v => { 16743 return v.charAt(0) + '-' + v.charAt(1); 16744 }).toLowerCase(); 16745} 16746function parseProperty(name) { 16747 const overrideIndex = name.indexOf('!important'); 16748 if (overrideIndex !== -1) { 16749 name = overrideIndex > 0 ? name.substring(0, overrideIndex) : ''; 16750 } 16751 let suffix = null; 16752 let property = name; 16753 const unitIndex = name.lastIndexOf('.'); 16754 if (unitIndex > 0) { 16755 suffix = name.slice(unitIndex + 1); 16756 property = name.substring(0, unitIndex); 16757 } 16758 return { 16759 property, 16760 suffix 16761 }; 16762} 16763function mapLiteral(obj, quoted = false) { 16764 return literalMap(Object.keys(obj).map(key => ({ 16765 key, 16766 quoted,
16767 value: obj[key] 16768 }))); 16769} 16770class IcuSerializerVisitor { 16771 visitText(text) { 16772 return text.value; 16773 } 16774 visitContainer(container) { 16775 return container.children.map(child => child.visit(this)).join(''); 16776 } 16777 visitIcu(icu) { 16778 const strCases = Object.keys(icu.cases).map(k => `${k} {${icu.cases[k].visit(this)}}`); 16779 const result = `{${icu.expressionPlaceholder}, ${icu.type}, ${strCases.join(' ')}}`; 16780 return result; 16781 } 16782 visitTagPlaceholder(ph) { 16783 return ph.isVoid ? this.formatPh(ph.startName) : `${this.formatPh(ph.startName)}${ph.children.map(child => child.visit(this)).join('')}${this.formatPh(ph.closeName)}`; 16784 } 16785 visitPlaceholder(ph) { 16786 return this.formatPh(ph.name); 16787 } 16788 visitBlockPlaceholder(ph) { 16789 return `${this.formatPh(ph.startName)}${ph.children.map(child => child.visit(this)).join('')}${this.formatPh(ph.closeName)}`; 16790 } 16791 visitIcuPlaceholder(ph, context) { 16792 return this.formatPh(ph.name); 16793 } 16794 formatPh(value) { 16795 return `{${formatI18nPlaceholderName(value, /* useCamelCase */false)}}`; 16796 } 16797} 16798const serializer = new IcuSerializerVisitor(); 16799function serializeIcuNode(icu) { 16800 return icu.visit(serializer); 16801} 16802class NodeWithI18n { 16803 constructor(sourceSpan, i18n) { 16804 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "sourceSpan", void 0); 16805 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "i18n", void 0); 16806 this.sourceSpan = sourceSpan; 16807 this.i18n = i18n; 16808 } 16809} 16810class Text extends NodeWithI18n { 16811 constructor(value, sourceSpan, tokens, i18n) { 16812 super(sourceSpan, i18n); 16813 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "value", void 0); 16814 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "tokens", void 0); 16815 this.value = value; 16816 this.tokens = tokens; 16817 } 16818 visit(visitor, context) { 16819 return visitor.visitText(this, context); 16820 } 16821} 16822class Expansion extends NodeWithI18n { 16823 constructor(switchValue, type, cases, sourceSpan, switchValueSourceSpan, i18n) { 16824 super(sourceSpan, i18n); 16825 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "switchValue", void 0); 16826 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "type", void 0); 16827 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "cases", void 0); 16828 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "switchValueSourceSpan", void 0); 16829 this.switchValue = switchValue; 16830 this.type = type; 16831 this.cases = cases; 16832 this.switchValueSourceSpan = switchValueSourceSpan; 16833 } 16834 visit(visitor, context) { 16835 return visitor.visitExpansion(this, context); 16836 } 16837} 16838class ExpansionCase { 16839 constructor(value, expression, sourceSpan, valueSourceSpan, expSourceSpan) { 16840 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "value", void 0); 16841 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "expression", void 0); 16842 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "sourceSpan", void 0); 16843 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "valueSourceSpan", void 0); 16844 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "expSourceSpan", void 0); 16845 this.value = value; 16846 this.expression = expression; 16847 this.sourceSpan = sourceSpan; 16848 this.valueSourceSpan = valueSourceSpan; 16849 this.expSourceSpan = expSourceSpan; 16850 } 16851 visit(visitor, context) { 16852 return visitor.visitExpansionCase(this, context); 16853 } 16854} 16855class Attribute extends NodeWithI18n { 16856 constructor(name, value, sourceSpan, keySpan, valueSpan, valueTokens, i18n) { 16857 super(sourceSpan, i18n); 16858 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "name", void 0); 16859 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "value", void 0); 16860 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "keySpan", void 0); 16861 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "valueSpan", void 0); 16862 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "valueTokens", void 0); 16863 this.name = name; 16864 this.value = value; 16865 this.keySpan = keySpan; 16866 this.valueSpan = valueSpan; 16867 this.valueTokens = valueTokens; 16868 } 16869 visit(visitor, context) { 16870 return visitor.visitAttribute(this, context); 16871 } 16872} 16873class Element extends NodeWithI18n { 16874 constructor(name, attrs, children, sourceSpan, startSourceSpan, endSourceSpan = null, i18n) { 16875 super(sourceSpan, i18n); 16876 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "name", void 0); 16877 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "attrs", void 0); 16878 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "children", void 0); 16879 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "startSourceSpan", void 0); 16880 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "endSourceSpan", void 0); 16881 this.name = name; 16882 this.attrs = attrs; 16883 this.children = children; 16884 this.startSourceSpan = startSourceSpan; 16885 this.endSourceSpan = endSourceSpan; 16886 } 16887 visit(visitor, context) { 16888 return visitor.visitElement(this, context); 16889 } 16890} 16891class Comment {
16892 constructor(value, sourceSpan) { 16893 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "value", void 0); 16894 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "sourceSpan", void 0); 16895 this.value = value; 16896 this.sourceSpan = sourceSpan; 16897 } 16898 visit(visitor, context) { 16899 return visitor.visitComment(this, context); 16900 } 16901} 16902class Block extends NodeWithI18n { 16903 constructor(name, parameters, children, sourceSpan, nameSpan, startSourceSpan, endSourceSpan = null, i18n) { 16904 super(sourceSpan, i18n); 16905 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "name", void 0); 16906 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "parameters", void 0); 16907 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "children", void 0); 16908 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "nameSpan", void 0); 16909 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "startSourceSpan", void 0); 16910 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "endSourceSpan", void 0); 16911 this.name = name; 16912 this.parameters = parameters; 16913 this.children = children; 16914 this.nameSpan = nameSpan; 16915 this.startSourceSpan = startSourceSpan; 16916 this.endSourceSpan = endSourceSpan; 16917 } 16918 visit(visitor, context) { 16919 return visitor.visitBlock(this, context); 16920 } 16921} 16922class BlockParameter { 16923 constructor(expression, sourceSpan) { 16924 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "expression", void 0); 16925 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "sourceSpan", void 0); 16926 this.expression = expression; 16927 this.sourceSpan = sourceSpan; 16928 } 16929 visit(visitor, context) { 16930 return visitor.visitBlockParameter(this, context); 16931 } 16932} 16933class LetDeclaration { 16934 constructor(name, value, sourceSpan, nameSpan, valueSpan) { 16935 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "name", void 0); 16936 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "value", void 0); 16937 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "sourceSpan", void 0); 16938 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "nameSpan", void 0); 16939 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "valueSpan", void 0); 16940 this.name = name; 16941 this.value = value; 16942 this.sourceSpan = sourceSpan; 16943 this.nameSpan = nameSpan; 16944 this.valueSpan = valueSpan; 16945 } 16946 visit(visitor, context) { 16947 return visitor.visitLetDeclaration(this, context); 16948 } 16949} 16950function visitAll(visitor, nodes, context = null) { 16951 const result = []; 16952 const visit = visitor.visit ? ast => visitor.visit(ast, context) || ast.visit(visitor, context) : ast => ast.visit(visitor, context);
16953 nodes.forEach(ast => { 16954 const astResult = visit(ast); 16955 if (astResult) { 16956 result.push(astResult); 16957 } 16958 }); 16959 return result; 16960} 16961class RecursiveVisitor { 16962 constructor() {} 16963 visitElement(ast, context) { 16964 this.visitChildren(context, visit => { 16965 visit(ast.attrs); 16966 visit(ast.children); 16967 }); 16968 } 16969 visitAttribute(ast, context) {} 16970 visitText(ast, context) {} 16971 visitComment(ast, context) {} 16972 visitExpansion(ast, context) { 16973 return this.visitChildren(context, visit => { 16974 visit(ast.cases); 16975 }); 16976 } 16977 visitExpansionCase(ast, context) {} 16978 visitBlock(block, context) { 16979 this.visitChildren(context, visit => { 16980 visit(block.parameters); 16981 visit(block.children); 16982 }); 16983 } 16984 visitBlockParameter(ast, context) {} 16985 visitLetDeclaration(decl, context) {} 16986 visitChildren(context, cb) { 16987 let results = []; 16988 let t = this; 16989 function visit(children) { 16990 if (children) results.push(visitAll(t, children, context)); 16991 } 16992 cb(visit); 16993 return Array.prototype.concat.apply([], results); 16994 } 16995} 16996 16997// Mapping between all HTML entity names and their unicode representation. 16998// Generated from https://html.spec.whatwg.org/multipage/entities.json by stripping 16999// the `&` and `;` from the keys and removing the duplicates. 17000// see https://www.w3.org/TR/html51/syntax.html#named-character-references 17001const NAMED_ENTITIES = { 17002 'AElig': '\u00C6', 17003 'AMP': '\u0026', 17004 'amp': '\u0026', 17005 'Aacute': '\u00C1', 17006 'Abreve': '\u0102', 17007 'Acirc': '\u00C2', 17008 'Acy': '\u0410', 17009 'Afr': '\uD835\uDD04', 17010 'Agrave': '\u00C0', 17011 'Alpha': '\u0391', 17012 'Amacr': '\u0100', 17013 'And': '\u2A53', 17014 'Aogon': '\u0104', 17015 'Aopf': '\uD835\uDD38', 17016 'ApplyFunction': '\u2061', 17017 'af': '\u2061', 17018 'Aring': '\u00C5', 17019 'angst': '\u00C5', 17020 'Ascr': '\uD835\uDC9C', 17021 'Assign': '\u2254', 17022 'colone': '\u2254', 17023 'coloneq': '\u2254', 17024 'Atilde': '\u00C3', 17025 'Auml': '\u00C4', 17026 'Backslash': '\u2216', 17027 'setminus': '\u2216', 17028 'setmn': '\u2216', 17029 'smallsetminus': '\u2216', 17030 'ssetmn': '\u2216', 17031 'Barv': '\u2AE7', 17032 'Barwed': '\u2306', 17033 'doublebarwedge': '\u2306', 17034 'Bcy': '\u0411', 17035 'Because': '\u2235', 17036 'becaus': '\u2235', 17037 'because': '\u2235', 17038 'Bernoullis': '\u212C', 17039 'Bscr': '\u212C', 17040 'bernou': '\u212C', 17041 'Beta': '\u0392', 17042 'Bfr': '\uD835\uDD05', 17043 'Bopf': '\uD835\uDD39', 17044 'Breve': '\u02D8', 17045 'breve': '\u02D8', 17046 'Bumpeq': '\u224E', 17047 'HumpDownHump': '\u224E', 17048 'bump': '\u224E', 17049 'CHcy': '\u0427', 17050 'COPY': '\u00A9', 17051 'copy': '\u00A9', 17052 'Cacute': '\u0106', 17053 'Cap': '\u22D2', 17054 'CapitalDifferentialD': '\u2145', 17055 'DD': '\u2145', 17056 'Cayleys': '\u212D', 17057 'Cfr': '\u212D', 17058 'Ccaron': '\u010C', 17059 'Ccedil': '\u00C7', 17060 'Ccirc': '\u0108', 17061 'Cconint': '\u2230', 17062 'Cdot': '\u010A', 17063 'Cedilla': '\u00B8', 17064 'cedil': '\u00B8', 17065 'CenterDot': '\u00B7', 17066 'centerdot': '\u00B7', 17067 'middot': '\u00B7', 17068 'Chi': '\u03A7', 17069 'CircleDot': '\u2299', 17070 'odot': '\u2299', 17071 'CircleMinus': '\u2296', 17072 'ominus': '\u2296', 17073 'CirclePlus': '\u2295', 17074 'oplus': '\u2295', 17075 'CircleTimes': '\u2297', 17076 'otimes': '\u2297', 17077 'ClockwiseContourIntegral': '\u2232', 17078 'cwconint': '\u2232', 17079 'CloseCurlyDoubleQuote': '\u201D', 17080 'rdquo': '\u201D', 17081 'rdquor': '\u201D', 17082 'CloseCurlyQuote': '\u2019', 17083 'rsquo': '\u2019', 17084 'rsquor': '\u2019', 17085 'Colon': '\u2237', 17086 'Proportion': '\u2237', 17087 'Colone': '\u2A74', 17088 'Congruent': '\u2261', 17089 'equiv': '\u2261', 17090 'Conint': '\u222F', 17091 'DoubleContourIntegral': '\u222F', 17092 'ContourIntegral': '\u222E', 17093 'conint': '\u222E', 17094 'oint': '\u222E', 17095 'Copf': '\u2102', 17096 'complexes': '\u2102', 17097 'Coproduct': '\u2210', 17098 'coprod': '\u2210', 17099 'CounterClockwiseContourIntegral': '\u2233', 17100 'awconint': '\u2233', 17101 'Cross': '\u2A2F', 17102 'Cscr': '\uD835\uDC9E', 17103 'Cup': '\u22D3', 17104 'CupCap': '\u224D', 17105 'asympeq': '\u224D', 17106 'DDotrahd': '\u2911', 17107 'DJcy': '\u0402', 17108 'DScy': '\u0405', 17109 'DZcy': '\u040F', 17110 'Dagger': '\u2021', 17111 'ddagger': '\u2021', 17112 'Darr': '\u21A1', 17113 'Dashv': '\u2AE4', 17114 'DoubleLeftTee': '\u2AE4', 17115 'Dcaron': '\u010E', 17116 'Dcy': '\u0414', 17117 'Del': '\u2207', 17118 'nabla': '\u2207', 17119 'Delta': '\u0394', 17120 'Dfr': '\uD835\uDD07', 17121 'DiacriticalAcute': '\u00B4', 17122 'acute': '\u00B4', 17123 'DiacriticalDot': '\u02D9', 17124 'dot': '\u02D9', 17125 'DiacriticalDoubleAcute': '\u02DD', 17126 'dblac': '\u02DD', 17127 'DiacriticalGrave': '\u0060', 17128 'grave': '\u0060', 17129 'DiacriticalTilde': '\u02DC', 17130 'tilde': '\u02DC', 17131 'Diamond': '\u22C4', 17132 'diam': '\u22C4', 17133 'diamond': '\u22C4', 17134 'DifferentialD': '\u2146', 17135 'dd': '\u2146', 17136 'Dopf': '\uD835\uDD3B', 17137 'Dot': '\u00A8', 17138 'DoubleDot': '\u00A8', 17139 'die': '\u00A8', 17140 'uml': '\u00A8', 17141 'DotDot': '\u20DC', 17142 'DotEqual': '\u2250', 17143 'doteq': '\u2250', 17144 'esdot': '\u2250', 17145 'DoubleDownArrow': '\u21D3', 17146 'Downarrow': '\u21D3', 17147 'dArr': '\u21D3', 17148 'DoubleLeftArrow': '\u21D0', 17149 'Leftarrow': '\u21D0', 17150 'lArr': '\u21D0', 17151 'DoubleLeftRightArrow': '\u21D4', 17152 'Leftrightarrow': '\u21D4', 17153 'hArr': '\u21D4', 17154 'iff': '\u21D4', 17155 'DoubleLongLeftArrow': '\u27F8', 17156 'Longleftarrow': '\u27F8', 17157 'xlArr': '\u27F8', 17158 'DoubleLongLeftRightArrow': '\u27FA', 17159 'Longleftrightarrow': '\u27FA', 17160 'xhArr': '\u27FA', 17161 'DoubleLongRightArrow': '\u27F9', 17162 'Longrightarrow': '\u27F9', 17163 'xrArr': '\u27F9', 17164 'DoubleRightArrow': '\u21D2', 17165 'Implies': '\u21D2', 17166 'Rightarrow': '\u21D2', 17167 'rArr': '\u21D2', 17168 'DoubleRightTee': '\u22A8', 17169 'vDash': '\u22A8', 17170 'DoubleUpArrow': '\u21D1', 17171 'Uparrow': '\u21D1', 17172 'uArr': '\u21D1', 17173 'DoubleUpDownArrow': '\u21D5', 17174 'Updownarrow': '\u21D5', 17175 'vArr': '\u21D5', 17176 'DoubleVerticalBar': '\u2225', 17177 'par': '\u2225', 17178 'parallel': '\u2225', 17179 'shortparallel': '\u2225', 17180 'spar': '\u2225', 17181 'DownArrow': '\u2193', 17182 'ShortDownArrow': '\u2193', 17183 'darr': '\u2193', 17184 'downarrow': '\u2193', 17185 'DownArrowBar': '\u2913', 17186 'DownArrowUpArrow': '\u21F5', 17187 'duarr': '\u21F5', 17188 'DownBreve': '\u0311', 17189 'DownLeftRightVector': '\u2950', 17190 'DownLeftTeeVector': '\u295E', 17191 'DownLeftVector': '\u21BD', 17192 'leftharpoondown': '\u21BD', 17193 'lhard': '\u21BD', 17194 'DownLeftVectorBar': '\u2956', 17195 'DownRightTeeVector': '\u295F', 17196 'DownRightVector': '\u21C1', 17197 'rhard': '\u21C1', 17198 'rightharpoondown': '\u21C1', 17199 'DownRightVectorBar': '\u2957', 17200 'DownTee': '\u22A4', 17201 'top': '\u22A4', 17202 'DownTeeArrow': '\u21A7', 17203 'mapstodown': '\u21A7', 17204 'Dscr': '\uD835\uDC9F', 17205 'Dstrok': '\u0110', 17206 'ENG': '\u014A', 17207 'ETH': '\u00D0', 17208 'Eacute': '\u00C9', 17209 'Ecaron': '\u011A', 17210 'Ecirc': '\u00CA', 17211 'Ecy': '\u042D', 17212 'Edot': '\u0116', 17213 'Efr': '\uD835\uDD08', 17214 'Egrave': '\u00C8', 17215 'Element': '\u2208', 17216 'in': '\u2208', 17217 'isin': '\u2208', 17218 'isinv': '\u2208', 17219 'Emacr': '\u0112', 17220 'EmptySmallSquare': '\u25FB', 17221 'EmptyVerySmallSquare': '\u25AB', 17222 'Eogon': '\u0118', 17223 'Eopf': '\uD835\uDD3C', 17224 'Epsilon': '\u0395', 17225 'Equal': '\u2A75', 17226 'EqualTilde': '\u2242', 17227 'eqsim': '\u2242', 17228 'esim': '\u2242', 17229 'Equilibrium': '\u21CC', 17230 'rightleftharpoons': '\u21CC', 17231 'rlhar': '\u21CC', 17232 'Escr': '\u2130', 17233 'expectation': '\u2130', 17234 'Esim': '\u2A73', 17235 'Eta': '\u0397', 17236 'Euml': '\u00CB', 17237 'Exists': '\u2203', 17238 'exist': '\u2203', 17239 'ExponentialE': '\u2147', 17240 'ee': '\u2147', 17241 'exponentiale': '\u2147', 17242 'Fcy': '\u0424', 17243 'Ffr': '\uD835\uDD09', 17244 'FilledSmallSquare': '\u25FC', 17245 'FilledVerySmallSquare': '\u25AA', 17246 'blacksquare': '\u25AA', 17247 'squarf': '\u25AA', 17248 'squf': '\u25AA', 17249 'Fopf': '\uD835\uDD3D', 17250 'ForAll': '\u2200', 17251 'forall': '\u2200', 17252 'Fouriertrf': '\u2131', 17253 'Fscr': '\u2131', 17254 'GJcy': '\u0403', 17255 'GT': '\u003E', 17256 'gt': '\u003E', 17257 'Gamma': '\u0393', 17258 'Gammad': '\u03DC', 17259 'Gbreve': '\u011E', 17260 'Gcedil': '\u0122', 17261 'Gcirc': '\u011C', 17262 'Gcy': '\u0413', 17263 'Gdot': '\u0120', 17264 'Gfr': '\uD835\uDD0A', 17265 'Gg': '\u22D9', 17266 'ggg': '\u22D9', 17267 'Gopf': '\uD835\uDD3E', 17268 'GreaterEqual': '\u2265', 17269 'ge': '\u2265', 17270 'geq': '\u2265', 17271 'GreaterEqualLess': '\u22DB', 17272 'gel': '\u22DB', 17273 'gtreqless': '\u22DB', 17274 'GreaterFullEqual': '\u2267', 17275 'gE': '\u2267', 17276 'geqq': '\u2267', 17277 'GreaterGreater': '\u2AA2', 17278 'GreaterLess': '\u2277', 17279 'gl': '\u2277', 17280 'gtrless': '\u2277', 17281 'GreaterSlantEqual': '\u2A7E', 17282 'geqslant': '\u2A7E', 17283 'ges': '\u2A7E', 17284 'GreaterTilde': '\u2273', 17285 'gsim': '\u2273', 17286 'gtrsim': '\u2273', 17287 'Gscr': '\uD835\uDCA2', 17288 'Gt': '\u226B', 17289 'NestedGreaterGreater': '\u226B', 17290 'gg': '\u226B', 17291 'HARDcy': '\u042A', 17292 'Hacek': '\u02C7', 17293 'caron': '\u02C7', 17294 'Hat': '\u005E', 17295 'Hcirc': '\u0124', 17296 'Hfr': '\u210C', 17297 'Poincareplane': '\u210C', 17298 'HilbertSpace': '\u210B', 17299 'Hscr': '\u210B', 17300 'hamilt': '\u210B', 17301 'Hopf': '\u210D', 17302 'quaternions': '\u210D', 17303 'HorizontalLine': '\u2500', 17304 'boxh': '\u2500', 17305 'Hstrok': '\u0126', 17306 'HumpEqual': '\u224F', 17307 'bumpe': '\u224F', 17308 'bumpeq': '\u224F', 17309 'IEcy': '\u0415', 17310 'IJlig': '\u0132', 17311 'IOcy': '\u0401', 17312 'Iacute': '\u00CD', 17313 'Icirc': '\u00CE', 17314 'Icy': '\u0418', 17315 'Idot': '\u0130', 17316 'Ifr': '\u2111', 17317 'Im': '\u2111', 17318 'image': '\u2111', 17319 'imagpart': '\u2111', 17320 'Igrave': '\u00CC', 17321 'Imacr': '\u012A', 17322 'ImaginaryI': '\u2148', 17323 'ii': '\u2148', 17324 'Int': '\u222C', 17325 'Integral': '\u222B', 17326 'int': '\u222B', 17327 'Intersection': '\u22C2', 17328 'bigcap': '\u22C2', 17329 'xcap': '\u22C2', 17330 'InvisibleComma': '\u2063', 17331 'ic': '\u2063', 17332 'InvisibleTimes': '\u2062', 17333 'it': '\u2062', 17334 'Iogon': '\u012E', 17335 'Iopf': '\uD835\uDD40', 17336 'Iota': '\u0399', 17337 'Iscr': '\u2110', 17338 'imagline': '\u2110', 17339 'Itilde': '\u0128', 17340 'Iukcy': '\u0406', 17341 'Iuml': '\u00CF', 17342 'Jcirc': '\u0134', 17343 'Jcy': '\u0419', 17344 'Jfr': '\uD835\uDD0D', 17345 'Jopf': '\uD835\uDD41', 17346 'Jscr': '\uD835\uDCA5', 17347 'Jsercy': '\u0408', 17348 'Jukcy': '\u0404', 17349 'KHcy': '\u0425', 17350 'KJcy': '\u040C', 17351 'Kappa': '\u039A', 17352 'Kcedil': '\u0136', 17353 'Kcy': '\u041A', 17354 'Kfr': '\uD835\uDD0E', 17355 'Kopf': '\uD835\uDD42', 17356 'Kscr': '\uD835\uDCA6', 17357 'LJcy': '\u0409', 17358 'LT': '\u003C', 17359 'lt': '\u003C', 17360 'Lacute': '\u0139', 17361 'Lambda': '\u039B', 17362 'Lang': '\u27EA', 17363 'Laplacetrf': '\u2112', 17364 'Lscr': '\u2112', 17365 'lagran': '\u2112', 17366 'Larr': '\u219E', 17367 'twoheadleftarrow': '\u219E', 17368 'Lcaron': '\u013D', 17369 'Lcedil': '\u013B', 17370 'Lcy': '\u041B', 17371 'LeftAngleBracket': '\u27E8', 17372 'lang': '\u27E8', 17373 'langle': '\u27E8', 17374 'LeftArrow': '\u2190', 17375 'ShortLeftArrow': '\u2190', 17376 'larr': '\u2190', 17377 'leftarrow': '\u2190', 17378 'slarr': '\u2190', 17379 'LeftArrowBar': '\u21E4', 17380 'larrb': '\u21E4', 17381 'LeftArrowRightArrow': '\u21C6', 17382 'leftrightarrows': '\u21C6', 17383 'lrarr': '\u21C6', 17384 'LeftCeiling': '\u2308', 17385 'lceil': '\u2308', 17386 'LeftDoubleBracket': '\u27E6', 17387 'lobrk': '\u27E6', 17388 'LeftDownTeeVector': '\u2961', 17389 'LeftDownVector': '\u21C3', 17390 'dharl': '\u21C3', 17391 'downharpoonleft': '\u21C3', 17392 'LeftDownVectorBar': '\u2959', 17393 'LeftFloor': '\u230A', 17394 'lfloor': '\u230A', 17395 'LeftRightArrow': '\u2194', 17396 'harr': '\u2194', 17397 'leftrightarrow': '\u2194', 17398 'LeftRightVector': '\u294E', 17399 'LeftTee': '\u22A3', 17400 'dashv': '\u22A3', 17401 'LeftTeeArrow': '\u21A4', 17402 'mapstoleft': '\u21A4', 17403 'LeftTeeVector': '\u295A', 17404 'LeftTriangle': '\u22B2', 17405 'vartriangleleft': '\u22B2', 17406 'vltri': '\u22B2', 17407 'LeftTriangleBar': '\u29CF', 17408 'LeftTriangleEqual': '\u22B4', 17409 'ltrie': '\u22B4', 17410 'trianglelefteq': '\u22B4', 17411 'LeftUpDownVector': '\u2951', 17412 'LeftUpTeeVector': '\u2960', 17413 'LeftUpVector': '\u21BF', 17414 'uharl': '\u21BF', 17415 'upharpoonleft': '\u21BF', 17416 'LeftUpVectorBar': '\u2958', 17417 'LeftVector': '\u21BC', 17418 'leftharpoonup': '\u21BC', 17419 'lharu': '\u21BC', 17420 'LeftVectorBar': '\u2952', 17421 'LessEqualGreater': '\u22DA', 17422 'leg': '\u22DA', 17423 'lesseqgtr': '\u22DA', 17424 'LessFullEqual': '\u2266', 17425 'lE': '\u2266', 17426 'leqq': '\u2266', 17427 'LessGreater': '\u2276', 17428 'lessgtr': '\u2276', 17429 'lg': '\u2276', 17430 'LessLess': '\u2AA1', 17431 'LessSlantEqual': '\u2A7D', 17432 'leqslant': '\u2A7D', 17433 'les': '\u2A7D', 17434 'LessTilde': '\u2272', 17435 'lesssim': '\u2272', 17436 'lsim': '\u2272', 17437 'Lfr': '\uD835\uDD0F', 17438 'Ll': '\u22D8', 17439 'Lleftarrow': '\u21DA', 17440 'lAarr': '\u21DA', 17441 'Lmidot': '\u013F', 17442 'LongLeftArrow': '\u27F5', 17443 'longleftarrow': '\u27F5', 17444 'xlarr': '\u27F5', 17445 'LongLeftRightArrow': '\u27F7', 17446 'longleftrightarrow': '\u27F7', 17447 'xharr': '\u27F7', 17448 'LongRightArrow': '\u27F6', 17449 'longrightarrow': '\u27F6', 17450 'xrarr': '\u27F6', 17451 'Lopf': '\uD835\uDD43', 17452 'LowerLeftArrow': '\u2199', 17453 'swarr': '\u2199', 17454 'swarrow': '\u2199', 17455 'LowerRightArrow': '\u2198', 17456 'searr': '\u2198', 17457 'searrow': '\u2198', 17458 'Lsh': '\u21B0', 17459 'lsh': '\u21B0', 17460 'Lstrok': '\u0141', 17461 'Lt': '\u226A', 17462 'NestedLessLess': '\u226A', 17463 'll': '\u226A', 17464 'Map': '\u2905', 17465 'Mcy': '\u041C', 17466 'MediumSpace': '\u205F', 17467 'Mellintrf': '\u2133', 17468 'Mscr': '\u2133', 17469 'phmmat': '\u2133', 17470 'Mfr': '\uD835\uDD10', 17471 'MinusPlus': '\u2213', 17472 'mnplus': '\u2213', 17473 'mp': '\u2213', 17474 'Mopf': '\uD835\uDD44', 17475 'Mu': '\u039C', 17476 'NJcy': '\u040A', 17477 'Nacute': '\u0143', 17478 'Ncaron': '\u0147', 17479 'Ncedil': '\u0145', 17480 'Ncy': '\u041D', 17481 'NegativeMediumSpace': '\u200B', 17482 'NegativeThickSpace': '\u200B', 17483 'NegativeThinSpace': '\u200B', 17484 'NegativeVeryThinSpace': '\u200B', 17485 'ZeroWidthSpace': '\u200B', 17486 'NewLine': '\u000A', 17487 'Nfr': '\uD835\uDD11', 17488 'NoBreak': '\u2060', 17489 'NonBreakingSpace': '\u00A0', 17490 'nbsp': '\u00A0', 17491 'Nopf': '\u2115', 17492 'naturals': '\u2115', 17493 'Not': '\u2AEC', 17494 'NotCongruent': '\u2262', 17495 'nequiv': '\u2262', 17496 'NotCupCap': '\u226D', 17497 'NotDoubleVerticalBar': '\u2226', 17498 'npar': '\u2226', 17499 'nparallel': '\u2226', 17500 'nshortparallel': '\u2226', 17501 'nspar': '\u2226', 17502 'NotElement': '\u2209', 17503 'notin': '\u2209', 17504 'notinva': '\u2209', 17505 'NotEqual': '\u2260', 17506 'ne': '\u2260', 17507 'NotEqualTilde': '\u2242\u0338', 17508 'nesim': '\u2242\u0338', 17509 'NotExists': '\u2204', 17510 'nexist': '\u2204', 17511 'nexists': '\u2204', 17512 'NotGreater': '\u226F', 17513 'ngt': '\u226F', 17514 'ngtr': '\u226F', 17515 'NotGreaterEqual': '\u2271', 17516 'nge': '\u2271', 17517 'ngeq': '\u2271', 17518 'NotGreaterFullEqual': '\u2267\u0338', 17519 'ngE': '\u2267\u0338', 17520 'ngeqq': '\u2267\u0338', 17521 'NotGreaterGreater': '\u226B\u0338', 17522 'nGtv': '\u226B\u0338', 17523 'NotGreaterLess': '\u2279', 17524 'ntgl': '\u2279', 17525 'NotGreaterSlantEqual': '\u2A7E\u0338', 17526 'ngeqslant': '\u2A7E\u0338', 17527 'nges': '\u2A7E\u0338', 17528 'NotGreaterTilde': '\u2275', 17529 'ngsim': '\u2275', 17530 'NotHumpDownHump': '\u224E\u0338', 17531 'nbump': '\u224E\u0338', 17532 'NotHumpEqual': '\u224F\u0338', 17533 'nbumpe': '\u224F\u0338', 17534 'NotLeftTriangle': '\u22EA', 17535 'nltri': '\u22EA', 17536 'ntriangleleft': '\u22EA', 17537 'NotLeftTriangleBar': '\u29CF\u0338', 17538 'NotLeftTriangleEqual': '\u22EC',
17539 'nltrie': '\u22EC', 17540 'ntrianglelefteq': '\u22EC', 17541 'NotLess': '\u226E', 17542 'nless': '\u226E', 17543 'nlt': '\u226E', 17544 'NotLessEqual': '\u2270', 17545 'nle': '\u2270', 17546 'nleq': '\u2270', 17547 'NotLessGreater': '\u2278', 17548 'ntlg': '\u2278', 17549 'NotLessLess': '\u226A\u0338', 17550 'nLtv': '\u226A\u0338', 17551 'NotLessSlantEqual': '\u2A7D\u0338', 17552 'nleqslant': '\u2A7D\u0338', 17553 'nles': '\u2A7D\u0338', 17554 'NotLessTilde': '\u2274', 17555 'nlsim': '\u2274', 17556 'NotNestedGreaterGreater': '\u2AA2\u0338', 17557 'NotNestedLessLess': '\u2AA1\u0338', 17558 'NotPrecedes': '\u2280', 17559 'npr': '\u2280', 17560 'nprec': '\u2280', 17561 'NotPrecedesEqual': '\u2AAF\u0338', 17562 'npre': '\u2AAF\u0338', 17563 'npreceq': '\u2AAF\u0338', 17564 'NotPrecedesSlantEqual': '\u22E0', 17565 'nprcue': '\u22E0', 17566 'NotReverseElement': '\u220C', 17567 'notni': '\u220C', 17568 'notniva': '\u220C', 17569 'NotRightTriangle': '\u22EB', 17570 'nrtri': '\u22EB', 17571 'ntriangleright': '\u22EB', 17572 'NotRightTriangleBar': '\u29D0\u0338', 17573 'NotRightTriangleEqual': '\u22ED', 17574 'nrtrie': '\u22ED', 17575 'ntrianglerighteq': '\u22ED', 17576 'NotSquareSubset': '\u228F\u0338', 17577 'NotSquareSubsetEqual': '\u22E2', 17578 'nsqsube': '\u22E2', 17579 'NotSquareSuperset': '\u2290\u0338', 17580 'NotSquareSupersetEqual': '\u22E3', 17581 'nsqsupe': '\u22E3', 17582 'NotSubset': '\u2282\u20D2', 17583 'nsubset': '\u2282\u20D2', 17584 'vnsub': '\u2282\u20D2', 17585 'NotSubsetEqual': '\u2288', 17586 'nsube': '\u2288', 17587 'nsubseteq': '\u2288', 17588 'NotSucceeds': '\u2281', 17589 'nsc': '\u2281', 17590 'nsucc': '\u2281', 17591 'NotSucceedsEqual': '\u2AB0\u0338', 17592 'nsce': '\u2AB0\u0338', 17593 'nsucceq': '\u2AB0\u0338', 17594 'NotSucceedsSlantEqual': '\u22E1', 17595 'nsccue': '\u22E1', 17596 'NotSucceedsTilde': '\u227F\u0338', 17597 'NotSuperset': '\u2283\u20D2', 17598 'nsupset': '\u2283\u20D2', 17599 'vnsup': '\u2283\u20D2', 17600 'NotSupersetEqual': '\u2289', 17601 'nsupe': '\u2289', 17602 'nsupseteq': '\u2289', 17603 'NotTilde': '\u2241', 17604 'nsim': '\u2241', 17605 'NotTildeEqual': '\u2244', 17606 'nsime': '\u2244', 17607 'nsimeq': '\u2244', 17608 'NotTildeFullEqual': '\u2247', 17609 'ncong': '\u2247', 17610 'NotTildeTilde': '\u2249', 17611 'nap': '\u2249', 17612 'napprox': '\u2249', 17613 'NotVerticalBar': '\u2224', 17614 'nmid': '\u2224', 17615 'nshortmid': '\u2224', 17616 'nsmid': '\u2224', 17617 'Nscr': '\uD835\uDCA9', 17618 'Ntilde': '\u00D1', 17619 'Nu': '\u039D', 17620 'OElig': '\u0152', 17621 'Oacute': '\u00D3', 17622 'Ocirc': '\u00D4', 17623 'Ocy': '\u041E', 17624 'Odblac': '\u0150', 17625 'Ofr': '\uD835\uDD12', 17626 'Ograve': '\u00D2', 17627 'Omacr': '\u014C', 17628 'Omega': '\u03A9', 17629 'ohm': '\u03A9', 17630 'Omicron': '\u039F', 17631 'Oopf': '\uD835\uDD46', 17632 'OpenCurlyDoubleQuote': '\u201C', 17633 'ldquo': '\u201C', 17634 'OpenCurlyQuote': '\u2018', 17635 'lsquo': '\u2018', 17636 'Or': '\u2A54', 17637 'Oscr': '\uD835\uDCAA', 17638 'Oslash': '\u00D8', 17639 'Otilde': '\u00D5', 17640 'Otimes': '\u2A37', 17641 'Ouml': '\u00D6', 17642 'OverBar': '\u203E', 17643 'oline': '\u203E', 17644 'OverBrace': '\u23DE', 17645 'OverBracket': '\u23B4', 17646 'tbrk': '\u23B4', 17647 'OverParenthesis': '\u23DC', 17648 'PartialD': '\u2202', 17649 'part': '\u2202', 17650 'Pcy': '\u041F', 17651 'Pfr': '\uD835\uDD13', 17652 'Phi': '\u03A6', 17653 'Pi': '\u03A0', 17654 'PlusMinus': '\u00B1', 17655 'plusmn': '\u00B1', 17656 'pm': '\u00B1', 17657 'Popf': '\u2119', 17658 'primes': '\u2119', 17659 'Pr': '\u2ABB', 17660 'Precedes': '\u227A', 17661 'pr': '\u227A', 17662 'prec': '\u227A', 17663 'PrecedesEqual': '\u2AAF', 17664 'pre': '\u2AAF', 17665 'preceq': '\u2AAF', 17666 'PrecedesSlantEqual': '\u227C', 17667 'prcue': '\u227C', 17668 'preccurlyeq': '\u227C', 17669 'PrecedesTilde': '\u227E', 17670 'precsim': '\u227E', 17671 'prsim': '\u227E', 17672 'Prime': '\u2033', 17673 'Product': '\u220F', 17674 'prod': '\u220F', 17675 'Proportional': '\u221D', 17676 'prop': '\u221D', 17677 'propto': '\u221D', 17678 'varpropto': '\u221D', 17679 'vprop': '\u221D', 17680 'Pscr': '\uD835\uDCAB', 17681 'Psi': '\u03A8', 17682 'QUOT': '\u0022', 17683 'quot': '\u0022', 17684 'Qfr': '\uD835\uDD14', 17685 'Qopf': '\u211A', 17686 'rationals': '\u211A', 17687 'Qscr': '\uD835\uDCAC', 17688 'RBarr': '\u2910', 17689 'drbkarow': '\u2910', 17690 'REG': '\u00AE', 17691 'circledR': '\u00AE', 17692 'reg': '\u00AE', 17693 'Racute': '\u0154', 17694 'Rang': '\u27EB', 17695 'Rarr': '\u21A0', 17696 'twoheadrightarrow': '\u21A0', 17697 'Rarrtl': '\u2916', 17698 'Rcaron': '\u0158', 17699 'Rcedil': '\u0156', 17700 'Rcy': '\u0420', 17701 'Re': '\u211C', 17702 'Rfr': '\u211C', 17703 'real': '\u211C', 17704 'realpart': '\u211C', 17705 'ReverseElement': '\u220B', 17706 'SuchThat': '\u220B', 17707 'ni': '\u220B', 17708 'niv': '\u220B', 17709 'ReverseEquilibrium': '\u21CB', 17710 'leftrightharpoons': '\u21CB', 17711 'lrhar': '\u21CB', 17712 'ReverseUpEquilibrium': '\u296F', 17713 'duhar': '\u296F', 17714 'Rho': '\u03A1', 17715 'RightAngleBracket': '\u27E9', 17716 'rang': '\u27E9', 17717 'rangle': '\u27E9', 17718 'RightArrow': '\u2192', 17719 'ShortRightArrow': '\u2192', 17720 'rarr': '\u2192', 17721 'rightarrow': '\u2192', 17722 'srarr': '\u2192', 17723 'RightArrowBar': '\u21E5', 17724 'rarrb': '\u21E5', 17725 'RightArrowLeftArrow': '\u21C4', 17726 'rightleftarrows': '\u21C4', 17727 'rlarr': '\u21C4', 17728 'RightCeiling': '\u2309',
17729 'rceil': '\u2309', 17730 'RightDoubleBracket': '\u27E7', 17731 'robrk': '\u27E7', 17732 'RightDownTeeVector': '\u295D', 17733 'RightDownVector': '\u21C2', 17734 'dharr': '\u21C2', 17735 'downharpoonright': '\u21C2', 17736 'RightDownVectorBar': '\u2955', 17737 'RightFloor': '\u230B', 17738 'rfloor': '\u230B', 17739 'RightTee': '\u22A2', 17740 'vdash': '\u22A2', 17741 'RightTeeArrow': '\u21A6', 17742 'map': '\u21A6', 17743 'mapsto': '\u21A6', 17744 'RightTeeVector': '\u295B', 17745 'RightTriangle': '\u22B3', 17746 'vartriangleright': '\u22B3', 17747 'vrtri': '\u22B3', 17748 'RightTriangleBar': '\u29D0', 17749 'RightTriangleEqual': '\u22B5', 17750 'rtrie': '\u22B5', 17751 'trianglerighteq': '\u22B5', 17752 'RightUpDownVector': '\u294F', 17753 'RightUpTeeVector': '\u295C', 17754 'RightUpVector': '\u21BE', 17755 'uharr': '\u21BE', 17756 'upharpoonright': '\u21BE', 17757 'RightUpVectorBar': '\u2954', 17758 'RightVector': '\u21C0', 17759 'rharu': '\u21C0', 17760 'rightharpoonup': '\u21C0', 17761 'RightVectorBar': '\u2953', 17762 'Ropf': '\u211D', 17763 'reals': '\u211D', 17764 'RoundImplies': '\u2970', 17765 'Rrightarrow': '\u21DB', 17766 'rAarr': '\u21DB', 17767 'Rscr': '\u211B', 17768 'realine': '\u211B', 17769 'Rsh': '\u21B1', 17770 'rsh': '\u21B1', 17771 'RuleDelayed': '\u29F4', 17772 'SHCHcy': '\u0429', 17773 'SHcy': '\u0428', 17774 'SOFTcy': '\u042C', 17775 'Sacute': '\u015A', 17776 'Sc': '\u2ABC', 17777 'Scaron': '\u0160', 17778 'Scedil': '\u015E', 17779 'Scirc': '\u015C', 17780 'Scy': '\u0421', 17781 'Sfr': '\uD835\uDD16', 17782 'ShortUpArrow': '\u2191', 17783 'UpArrow': '\u2191', 17784 'uarr': '\u2191', 17785 'uparrow': '\u2191', 17786 'Sigma': '\u03A3', 17787 'SmallCircle': '\u2218', 17788 'compfn': '\u2218', 17789 'Sopf': '\uD835\uDD4A', 17790 'Sqrt': '\u221A', 17791 'radic': '\u221A', 17792 'Square': '\u25A1', 17793 'squ': '\u25A1', 17794 'square': '\u25A1', 17795 'SquareIntersection': '\u2293', 17796 'sqcap': '\u2293', 17797 'SquareSubset': '\u228F', 17798 'sqsub': '\u228F', 17799 'sqsubset': '\u228F', 17800 'SquareSubsetEqual': '\u2291', 17801 'sqsube': '\u2291', 17802 'sqsubseteq': '\u2291', 17803 'SquareSuperset': '\u2290', 17804 'sqsup': '\u2290', 17805 'sqsupset': '\u2290', 17806 'SquareSupersetEqual': '\u2292', 17807 'sqsupe': '\u2292', 17808 'sqsupseteq': '\u2292', 17809 'SquareUnion': '\u2294', 17810 'sqcup': '\u2294', 17811 'Sscr': '\uD835\uDCAE', 17812 'Star': '\u22C6', 17813 'sstarf': '\u22C6', 17814 'Sub': '\u22D0', 17815 'Subset': '\u22D0', 17816 'SubsetEqual': '\u2286', 17817 'sube': '\u2286', 17818 'subseteq': '\u2286', 17819 'Succeeds': '\u227B', 17820 'sc': '\u227B', 17821 'succ': '\u227B', 17822 'SucceedsEqual': '\u2AB0', 17823 'sce': '\u2AB0', 17824 'succeq': '\u2AB0', 17825 'SucceedsSlantEqual': '\u227D', 17826 'sccue': '\u227D', 17827 'succcurlyeq': '\u227D', 17828 'SucceedsTilde': '\u227F', 17829 'scsim': '\u227F', 17830 'succsim': '\u227F', 17831 'Sum': '\u2211', 17832 'sum': '\u2211', 17833 'Sup': '\u22D1', 17834 'Supset': '\u22D1', 17835 'Superset': '\u2283', 17836 'sup': '\u2283', 17837 'supset': '\u2283', 17838 'SupersetEqual': '\u2287', 17839 'supe': '\u2287', 17840 'supseteq': '\u2287', 17841 'THORN': '\u00DE', 17842 'TRADE': '\u2122', 17843 'trade': '\u2122', 17844 'TSHcy': '\u040B', 17845 'TScy': '\u0426', 17846 'Tab': '\u0009', 17847 'Tau': '\u03A4', 17848 'Tcaron': '\u0164', 17849 'Tcedil': '\u0162', 17850 'Tcy': '\u0422', 17851 'Tfr': '\uD835\uDD17', 17852 'Therefore': '\u2234', 17853 'there4': '\u2234', 17854 'therefore': '\u2234', 17855 'Theta': '\u0398', 17856 'ThickSpace': '\u205F\u200A', 17857 'ThinSpace': '\u2009', 17858 'thinsp': '\u2009', 17859 'Tilde': '\u223C', 17860 'sim': '\u223C', 17861 'thicksim': '\u223C', 17862 'thksim': '\u223C', 17863 'TildeEqual': '\u2243', 17864 'sime': '\u2243', 17865 'simeq': '\u2243', 17866 'TildeFullEqual': '\u2245', 17867 'cong': '\u2245', 17868 'TildeTilde': '\u2248', 17869 'ap': '\u2248', 17870 'approx': '\u2248', 17871 'asymp': '\u2248', 17872 'thickapprox': '\u2248', 17873 'thkap': '\u2248', 17874 'Topf': '\uD835\uDD4B', 17875 'TripleDot': '\u20DB', 17876 'tdot': '\u20DB', 17877 'Tscr': '\uD835\uDCAF', 17878 'Tstrok': '\u0166', 17879 'Uacute': '\u00DA', 17880 'Uarr': '\u219F', 17881 'Uarrocir': '\u2949', 17882 'Ubrcy': '\u040E', 17883 'Ubreve': '\u016C', 17884 'Ucirc': '\u00DB', 17885 'Ucy': '\u0423', 17886 'Udblac': '\u0170', 17887 'Ufr': '\uD835\uDD18', 17888 'Ugrave': '\u00D9', 17889 'Umacr': '\u016A', 17890 'UnderBar': '\u005F', 17891 'lowbar': '\u005F', 17892 'UnderBrace': '\u23DF', 17893 'UnderBracket': '\u23B5', 17894 'bbrk': '\u23B5', 17895 'UnderParenthesis': '\u23DD', 17896 'Union': '\u22C3', 17897 'bigcup': '\u22C3', 17898 'xcup': '\u22C3', 17899 'UnionPlus': '\u228E', 17900 'uplus': '\u228E', 17901 'Uogon': '\u0172', 17902 'Uopf': '\uD835\uDD4C', 17903 'UpArrowBar': '\u2912', 17904 'UpArrowDownArrow': '\u21C5', 17905 'udarr': '\u21C5', 17906 'UpDownArrow': '\u2195', 17907 'updownarrow': '\u2195', 17908 'varr': '\u2195', 17909 'UpEquilibrium': '\u296E', 17910 'udhar': '\u296E', 17911 'UpTee': '\u22A5', 17912 'bot': '\u22A5', 17913 'bottom': '\u22A5', 17914 'perp': '\u22A5', 17915 'UpTeeArrow': '\u21A5', 17916 'mapstoup': '\u21A5', 17917 'UpperLeftArrow': '\u2196', 17918 'nwarr': '\u2196', 17919 'nwarrow': '\u2196', 17920 'UpperRightArrow': '\u2197', 17921 'nearr': '\u2197', 17922 'nearrow': '\u2197', 17923 'Upsi': '\u03D2', 17924 'upsih': '\u03D2', 17925 'Upsilon': '\u03A5', 17926 'Uring': '\u016E', 17927 'Uscr': '\uD835\uDCB0', 17928 'Utilde': '\u0168', 17929 'Uuml': '\u00DC',
17930 'VDash': '\u22AB', 17931 'Vbar': '\u2AEB', 17932 'Vcy': '\u0412', 17933 'Vdash': '\u22A9', 17934 'Vdashl': '\u2AE6', 17935 'Vee': '\u22C1', 17936 'bigvee': '\u22C1', 17937 'xvee': '\u22C1', 17938 'Verbar': '\u2016', 17939 'Vert': '\u2016', 17940 'VerticalBar': '\u2223', 17941 'mid': '\u2223', 17942 'shortmid': '\u2223', 17943 'smid': '\u2223', 17944 'VerticalLine': '\u007C', 17945 'verbar': '\u007C', 17946 'vert': '\u007C', 17947 'VerticalSeparator': '\u2758', 17948 'VerticalTilde': '\u2240', 17949 'wr': '\u2240', 17950 'wreath': '\u2240', 17951 'VeryThinSpace': '\u200A', 17952 'hairsp': '\u200A', 17953 'Vfr': '\uD835\uDD19', 17954 'Vopf': '\uD835\uDD4D', 17955 'Vscr': '\uD835\uDCB1', 17956 'Vvdash': '\u22AA', 17957 'Wcirc': '\u0174', 17958 'Wedge': '\u22C0', 17959 'bigwedge': '\u22C0', 17960 'xwedge': '\u22C0', 17961 'Wfr': '\uD835\uDD1A', 17962 'Wopf': '\uD835\uDD4E', 17963 'Wscr': '\uD835\uDCB2', 17964 'Xfr': '\uD835\uDD1B', 17965 'Xi': '\u039E', 17966 'Xopf': '\uD835\uDD4F', 17967 'Xscr': '\uD835\uDCB3', 17968 'YAcy': '\u042F', 17969 'YIcy': '\u0407', 17970 'YUcy': '\u042E', 17971 'Yacute': '\u00DD', 17972 'Ycirc': '\u0176', 17973 'Ycy': '\u042B', 17974 'Yfr': '\uD835\uDD1C', 17975 'Yopf': '\uD835\uDD50', 17976 'Yscr': '\uD835\uDCB4', 17977 'Yuml': '\u0178', 17978 'ZHcy': '\u0416', 17979 'Zacute': '\u0179', 17980 'Zcaron': '\u017D', 17981 'Zcy': '\u0417', 17982 'Zdot': '\u017B', 17983 'Zeta': '\u0396', 17984 'Zfr': '\u2128', 17985 'zeetrf': '\u2128', 17986 'Zopf': '\u2124', 17987 'integers': '\u2124', 17988 'Zscr': '\uD835\uDCB5', 17989 'aacute': '\u00E1', 17990 'abreve': '\u0103', 17991 'ac': '\u223E', 17992 'mstpos': '\u223E', 17993 'acE': '\u223E\u0333', 17994 'acd': '\u223F', 17995 'acirc': '\u00E2', 17996 'acy': '\u0430', 17997 'aelig': '\u00E6', 17998 'afr': '\uD835\uDD1E', 17999 'agrave': '\u00E0', 18000 'alefsym': '\u2135', 18001 'aleph': '\u2135', 18002 'alpha': '\u03B1', 18003 'amacr': '\u0101', 18004 'amalg': '\u2A3F', 18005 'and': '\u2227', 18006 'wedge': '\u2227', 18007 'andand': '\u2A55', 18008 'andd': '\u2A5C', 18009 'andslope': '\u2A58', 18010 'andv': '\u2A5A', 18011 'ang': '\u2220', 18012 'angle': '\u2220', 18013 'ange': '\u29A4', 18014 'angmsd': '\u2221', 18015 'measuredangle': '\u2221', 18016 'angmsdaa': '\u29A8', 18017 'angmsdab': '\u29A9', 18018 'angmsdac': '\u29AA', 18019 'angmsdad': '\u29AB', 18020 'angmsdae': '\u29AC', 18021 'angmsdaf': '\u29AD', 18022 'angmsdag': '\u29AE', 18023 'angmsdah': '\u29AF', 18024 'angrt': '\u221F', 18025 'angrtvb': '\u22BE', 18026 'angrtvbd': '\u299D', 18027 'angsph': '\u2222', 18028 'angzarr': '\u237C', 18029 'aogon': '\u0105', 18030 'aopf': '\uD835\uDD52', 18031 'apE': '\u2A70', 18032 'apacir': '\u2A6F', 18033 'ape': '\u224A', 18034 'approxeq': '\u224A', 18035 'apid': '\u224B', 18036 'apos': '\u0027', 18037 'aring': '\u00E5', 18038 'ascr': '\uD835\uDCB6', 18039 'ast': '\u002A', 18040 'midast': '\u002A', 18041 'atilde': '\u00E3', 18042 'auml': '\u00E4', 18043 'awint': '\u2A11', 18044 'bNot': '\u2AED', 18045 'backcong': '\u224C', 18046 'bcong': '\u224C', 18047 'backepsilon': '\u03F6', 18048 'bepsi': '\u03F6', 18049 'backprime': '\u2035', 18050 'bprime': '\u2035', 18051 'backsim': '\u223D', 18052 'bsim': '\u223D', 18053 'backsimeq': '\u22CD', 18054 'bsime': '\u22CD', 18055 'barvee': '\u22BD', 18056 'barwed': '\u2305', 18057 'barwedge': '\u2305', 18058 'bbrktbrk': '\u23B6', 18059 'bcy': '\u0431', 18060 'bdquo': '\u201E', 18061 'ldquor': '\u201E', 18062 'bemptyv': '\u29B0', 18063 'beta': '\u03B2', 18064 'beth': '\u2136', 18065 'between': '\u226C', 18066 'twixt': '\u226C', 18067 'bfr': '\uD835\uDD1F', 18068 'bigcirc': '\u25EF', 18069 'xcirc': '\u25EF', 18070 'bigodot': '\u2A00', 18071 'xodot': '\u2A00', 18072 'bigoplus': '\u2A01', 18073 'xoplus': '\u2A01', 18074 'bigotimes': '\u2A02', 18075 'xotime': '\u2A02', 18076 'bigsqcup': '\u2A06', 18077 'xsqcup': '\u2A06', 18078 'bigstar': '\u2605', 18079 'starf': '\u2605', 18080 'bigtriangledown': '\u25BD', 18081 'xdtri': '\u25BD', 18082 'bigtriangleup': '\u25B3', 18083 'xutri': '\u25B3', 18084 'biguplus': '\u2A04', 18085 'xuplus': '\u2A04', 18086 'bkarow': '\u290D', 18087 'rbarr': '\u290D', 18088 'blacklozenge': '\u29EB', 18089 'lozf': '\u29EB', 18090 'blacktriangle': '\u25B4', 18091 'utrif': '\u25B4', 18092 'blacktriangledown': '\u25BE', 18093 'dtrif': '\u25BE', 18094 'blacktriangleleft': '\u25C2', 18095 'ltrif': '\u25C2', 18096 'blacktriangleright': '\u25B8', 18097 'rtrif': '\u25B8', 18098 'blank': '\u2423', 18099 'blk12': '\u2592', 18100 'blk14': '\u2591', 18101 'blk34': '\u2593', 18102 'block': '\u2588', 18103 'bne': '\u003D\u20E5', 18104 'bnequiv': '\u2261\u20E5', 18105 'bnot': '\u2310', 18106 'bopf': '\uD835\uDD53', 18107 'bowtie': '\u22C8', 18108 'boxDL': '\u2557', 18109 'boxDR': '\u2554', 18110 'boxDl': '\u2556', 18111 'boxDr': '\u2553', 18112 'boxH': '\u2550', 18113 'boxHD': '\u2566', 18114 'boxHU': '\u2569', 18115 'boxHd': '\u2564', 18116 'boxHu': '\u2567', 18117 'boxUL': '\u255D', 18118 'boxUR': '\u255A', 18119 'boxUl': '\u255C', 18120 'boxUr': '\u2559', 18121 'boxV': '\u2551', 18122 'boxVH': '\u256C', 18123 'boxVL': '\u2563', 18124 'boxVR': '\u2560', 18125 'boxVh': '\u256B', 18126 'boxVl': '\u2562', 18127 'boxVr': '\u255F', 18128 'boxbox': '\u29C9', 18129 'boxdL': '\u2555', 18130 'boxdR': '\u2552', 18131 'boxdl': '\u2510', 18132 'boxdr': '\u250C', 18133 'boxhD': '\u2565', 18134 'boxhU': '\u2568', 18135 'boxhd': '\u252C', 18136 'boxhu': '\u2534', 18137 'boxminus': '\u229F', 18138 'minusb': '\u229F', 18139 'boxplus': '\u229E', 18140 'plusb': '\u229E', 18141 'boxtimes': '\u22A0', 18142 'timesb': '\u22A0', 18143 'boxuL': '\u255B', 18144 'boxuR': '\u2558', 18145 'boxul': '\u2518', 18146 'boxur': '\u2514', 18147 'boxv': '\u2502', 18148 'boxvH': '\u256A', 18149 'boxvL': '\u2561', 18150 'boxvR': '\u255E', 18151 'boxvh': '\u253C', 18152 'boxvl': '\u2524', 18153 'boxvr': '\u251C', 18154 'brvbar': '\u00A6', 18155 'bscr': '\uD835\uDCB7', 18156 'bsemi': '\u204F', 18157 'bsol': '\u005C', 18158 'bsolb': '\u29C5', 18159 'bsolhsub': '\u27C8', 18160 'bull': '\u2022', 18161 'bullet': '\u2022', 18162 'bumpE': '\u2AAE', 18163 'cacute': '\u0107', 18164 'cap': '\u2229', 18165 'capand': '\u2A44', 18166 'capbrcup': '\u2A49', 18167 'capcap': '\u2A4B', 18168 'capcup': '\u2A47', 18169 'capdot': '\u2A40', 18170 'caps': '\u2229\uFE00', 18171 'caret': '\u2041', 18172 'ccaps': '\u2A4D', 18173 'ccaron': '\u010D', 18174 'ccedil': '\u00E7', 18175 'ccirc': '\u0109', 18176 'ccups': '\u2A4C', 18177 'ccupssm': '\u2A50', 18178 'cdot': '\u010B', 18179 'cemptyv': '\u29B2', 18180 'cent': '\u00A2', 18181 'cfr': '\uD835\uDD20', 18182 'chcy': '\u0447', 18183 'check': '\u2713', 18184 'checkmark': '\u2713', 18185 'chi': '\u03C7', 18186 'cir': '\u25CB', 18187 'cirE': '\u29C3', 18188 'circ': '\u02C6', 18189 'circeq': '\u2257', 18190 'cire': '\u2257', 18191 'circlearrowleft': '\u21BA', 18192 'olarr': '\u21BA', 18193 'circlearrowright': '\u21BB', 18194 'orarr': '\u21BB', 18195 'circledS': '\u24C8', 18196 'oS': '\u24C8', 18197 'circledast': '\u229B', 18198 'oast': '\u229B', 18199 'circledcirc': '\u229A', 18200 'ocir': '\u229A', 18201 'circleddash': '\u229D', 18202 'odash': '\u229D', 18203 'cirfnint': '\u2A10', 18204 'cirmid': '\u2AEF', 18205 'cirscir': '\u29C2', 18206 'clubs': '\u2663', 18207 'clubsuit': '\u2663', 18208 'colon': '\u003A', 18209 'comma': '\u002C', 18210 'commat': '\u0040', 18211 'comp': '\u2201', 18212 'complement': '\u2201', 18213 'congdot': '\u2A6D', 18214 'copf': '\uD835\uDD54', 18215 'copysr': '\u2117', 18216 'crarr': '\u21B5', 18217 'cross': '\u2717', 18218 'cscr': '\uD835\uDCB8', 18219 'csub': '\u2ACF', 18220 'csube': '\u2AD1', 18221 'csup': '\u2AD0', 18222 'csupe': '\u2AD2', 18223 'ctdot': '\u22EF', 18224 'cudarrl': '\u2938', 18225 'cudarrr': '\u2935', 18226 'cuepr': '\u22DE', 18227 'curlyeqprec': '\u22DE', 18228 'cuesc': '\u22DF', 18229 'curlyeqsucc': '\u22DF', 18230 'cularr': '\u21B6', 18231 'curvearrowleft': '\u21B6', 18232 'cularrp': '\u293D', 18233 'cup': '\u222A', 18234 'cupbrcap': '\u2A48', 18235 'cupcap': '\u2A46', 18236 'cupcup': '\u2A4A', 18237 'cupdot': '\u228D', 18238 'cupor': '\u2A45', 18239 'cups': '\u222A\uFE00', 18240 'curarr': '\u21B7', 18241 'curvearrowright': '\u21B7', 18242 'curarrm': '\u293C', 18243 'curlyvee': '\u22CE', 18244 'cuvee': '\u22CE', 18245 'curlywedge': '\u22CF', 18246 'cuwed': '\u22CF', 18247 'curren': '\u00A4', 18248 'cwint': '\u2231', 18249 'cylcty': '\u232D', 18250 'dHar': '\u2965', 18251 'dagger': '\u2020', 18252 'daleth': '\u2138', 18253 'dash': '\u2010', 18254 'hyphen': '\u2010', 18255 'dbkarow': '\u290F', 18256 'rBarr': '\u290F', 18257 'dcaron': '\u010F', 18258 'dcy': '\u0434', 18259 'ddarr': '\u21CA', 18260 'downdownarrows': '\u21CA', 18261 'ddotseq': '\u2A77', 18262 'eDDot': '\u2A77', 18263 'deg': '\u00B0', 18264 'delta': '\u03B4', 18265 'demptyv': '\u29B1', 18266 'dfisht': '\u297F', 18267 'dfr': '\uD835\uDD21', 18268 'diamondsuit': '\u2666', 18269 'diams': '\u2666', 18270 'digamma': '\u03DD', 18271 'gammad': '\u03DD', 18272 'disin': '\u22F2', 18273 'div': '\u00F7', 18274 'divide': '\u00F7', 18275 'divideontimes': '\u22C7', 18276 'divonx': '\u22C7', 18277 'djcy': '\u0452', 18278 'dlcorn': '\u231E', 18279 'llcorner': '\u231E', 18280 'dlcrop': '\u230D', 18281 'dollar': '\u0024', 18282 'dopf': '\uD835\uDD55', 18283 'doteqdot': '\u2251', 18284 'eDot': '\u2251', 18285 'dotminus': '\u2238', 18286 'minusd': '\u2238', 18287 'dotplus': '\u2214', 18288 'plusdo': '\u2214', 18289 'dotsquare': '\u22A1', 18290 'sdotb': '\u22A1', 18291 'drcorn': '\u231F', 18292 'lrcorner': '\u231F', 18293 'drcrop': '\u230C', 18294 'dscr': '\uD835\uDCB9', 18295 'dscy': '\u0455', 18296 'dsol': '\u29F6', 18297 'dstrok': '\u0111', 18298 'dtdot': '\u22F1', 18299 'dtri': '\u25BF', 18300 'triangledown': '\u25BF', 18301 'dwangle': '\u29A6', 18302 'dzcy': '\u045F', 18303 'dzigrarr': '\u27FF', 18304 'eacute': '\u00E9', 18305 'easter': '\u2A6E', 18306 'ecaron': '\u011B', 18307 'ecir': '\u2256', 18308 'eqcirc': '\u2256', 18309 'ecirc': '\u00EA', 18310 'ecolon': '\u2255', 18311 'eqcolon': '\u2255', 18312 'ecy': '\u044D', 18313 'edot': '\u0117', 18314 'efDot': '\u2252', 18315 'fallingdotseq': '\u2252', 18316 'efr': '\uD835\uDD22', 18317 'eg': '\u2A9A', 18318 'egrave': '\u00E8', 18319 'egs': '\u2A96', 18320 'eqslantgtr': '\u2A96', 18321 'egsdot': '\u2A98', 18322 'el': '\u2A99', 18323 'elinters': '\u23E7', 18324 'ell': '\u2113', 18325 'els': '\u2A95', 18326 'eqslantless': '\u2A95', 18327 'elsdot': '\u2A97', 18328 'emacr': '\u0113', 18329 'empty': '\u2205', 18330 'emptyset': '\u2205', 18331 'emptyv': '\u2205', 18332 'varnothing': '\u2205', 18333 'emsp13': '\u2004', 18334 'emsp14': '\u2005', 18335 'emsp': '\u2003', 18336 'eng': '\u014B', 18337 'ensp': '\u2002', 18338 'eogon': '\u0119', 18339 'eopf': '\uD835\uDD56', 18340 'epar': '\u22D5', 18341 'eparsl': '\u29E3', 18342 'eplus': '\u2A71', 18343 'epsi': '\u03B5', 18344 'epsilon': '\u03B5', 18345 'epsiv': '\u03F5', 18346 'straightepsilon': '\u03F5', 18347 'varepsilon': '\u03F5', 18348 'equals': '\u003D', 18349 'equest': '\u225F', 18350 'questeq': '\u225F', 18351 'equivDD': '\u2A78', 18352 'eqvparsl': '\u29E5', 18353 'erDot': '\u2253', 18354 'risingdotseq': '\u2253', 18355 'erarr': '\u2971', 18356 'escr': '\u212F', 18357 'eta': '\u03B7', 18358 'eth': '\u00F0', 18359 'euml': '\u00EB', 18360 'euro': '\u20AC', 18361 'excl': '\u0021', 18362 'fcy': '\u0444', 18363 'female': '\u2640', 18364 'ffilig': '\uFB03', 18365 'fflig': '\uFB00', 18366 'ffllig': '\uFB04', 18367 'ffr': '\uD835\uDD23', 18368 'filig': '\uFB01', 18369 'fjlig': '\u0066\u006A', 18370 'flat': '\u266D', 18371 'fllig': '\uFB02', 18372 'fltns': '\u25B1', 18373 'fnof': '\u0192', 18374 'fopf': '\uD835\uDD57', 18375 'fork': '\u22D4', 18376 'pitchfork': '\u22D4', 18377 'forkv': '\u2AD9', 18378 'fpartint': '\u2A0D', 18379 'frac12': '\u00BD', 18380 'half': '\u00BD', 18381 'frac13': '\u2153', 18382 'frac14': '\u00BC', 18383 'frac15': '\u2155', 18384 'frac16': '\u2159', 18385 'frac18': '\u215B', 18386 'frac23': '\u2154', 18387 'frac25': '\u2156', 18388 'frac34': '\u00BE', 18389 'frac35': '\u2157', 18390 'frac38': '\u215C', 18391 'frac45': '\u2158', 18392 'frac56': '\u215A',
18393 'frac58': '\u215D', 18394 'frac78': '\u215E', 18395 'frasl': '\u2044', 18396 'frown': '\u2322', 18397 'sfrown': '\u2322', 18398 'fscr': '\uD835\uDCBB', 18399 'gEl': '\u2A8C', 18400 'gtreqqless': '\u2A8C', 18401 'gacute': '\u01F5', 18402 'gamma': '\u03B3', 18403 'gap': '\u2A86', 18404 'gtrapprox': '\u2A86', 18405 'gbreve': '\u011F', 18406 'gcirc': '\u011D', 18407 'gcy': '\u0433', 18408 'gdot': '\u0121', 18409 'gescc': '\u2AA9', 18410 'gesdot': '\u2A80', 18411 'gesdoto': '\u2A82', 18412 'gesdotol': '\u2A84', 18413 'gesl': '\u22DB\uFE00', 18414 'gesles': '\u2A94', 18415 'gfr': '\uD835\uDD24', 18416 'gimel': '\u2137', 18417 'gjcy': '\u0453', 18418 'glE': '\u2A92', 18419 'gla': '\u2AA5', 18420 'glj': '\u2AA4', 18421 'gnE': '\u2269', 18422 'gneqq': '\u2269', 18423 'gnap': '\u2A8A', 18424 'gnapprox': '\u2A8A', 18425 'gne': '\u2A88', 18426 'gneq': '\u2A88', 18427 'gnsim': '\u22E7', 18428 'gopf': '\uD835\uDD58', 18429 'gscr': '\u210A', 18430 'gsime': '\u2A8E', 18431 'gsiml': '\u2A90', 18432 'gtcc': '\u2AA7', 18433 'gtcir': '\u2A7A', 18434 'gtdot': '\u22D7', 18435 'gtrdot': '\u22D7', 18436 'gtlPar': '\u2995', 18437 'gtquest': '\u2A7C', 18438 'gtrarr': '\u2978', 18439 'gvertneqq': '\u2269\uFE00', 18440 'gvnE': '\u2269\uFE00', 18441 'hardcy': '\u044A', 18442 'harrcir': '\u2948', 18443 'harrw': '\u21AD', 18444 'leftrightsquigarrow': '\u21AD', 18445 'hbar': '\u210F', 18446 'hslash': '\u210F', 18447 'planck': '\u210F', 18448 'plankv': '\u210F', 18449 'hcirc': '\u0125', 18450 'hearts': '\u2665', 18451 'heartsuit': '\u2665', 18452 'hellip': '\u2026', 18453 'mldr': '\u2026', 18454 'hercon': '\u22B9', 18455 'hfr': '\uD835\uDD25', 18456 'hksearow': '\u2925', 18457 'searhk': '\u2925', 18458 'hkswarow': '\u2926', 18459 'swarhk': '\u2926', 18460 'hoarr': '\u21FF', 18461 'homtht': '\u223B', 18462 'hookleftarrow': '\u21A9', 18463 'larrhk': '\u21A9', 18464 'hookrightarrow': '\u21AA', 18465 'rarrhk': '\u21AA', 18466 'hopf': '\uD835\uDD59', 18467 'horbar': '\u2015', 18468 'hscr': '\uD835\uDCBD', 18469 'hstrok': '\u0127', 18470 'hybull': '\u2043', 18471 'iacute': '\u00ED', 18472 'icirc': '\u00EE', 18473 'icy': '\u0438', 18474 'iecy': '\u0435', 18475 'iexcl': '\u00A1', 18476 'ifr': '\uD835\uDD26', 18477 'igrave': '\u00EC', 18478 'iiiint': '\u2A0C', 18479 'qint': '\u2A0C', 18480 'iiint': '\u222D', 18481 'tint': '\u222D', 18482 'iinfin': '\u29DC', 18483 'iiota': '\u2129', 18484 'ijlig': '\u0133', 18485 'imacr': '\u012B', 18486 'imath': '\u0131', 18487 'inodot': '\u0131', 18488 'imof': '\u22B7', 18489 'imped': '\u01B5', 18490 'incare': '\u2105', 18491 'infin': '\u221E', 18492 'infintie': '\u29DD', 18493 'intcal': '\u22BA', 18494 'intercal': '\u22BA', 18495 'intlarhk': '\u2A17', 18496 'intprod': '\u2A3C', 18497 'iprod': '\u2A3C', 18498 'iocy': '\u0451', 18499 'iogon': '\u012F', 18500 'iopf': '\uD835\uDD5A', 18501 'iota': '\u03B9', 18502 'iquest': '\u00BF', 18503 'iscr': '\uD835\uDCBE', 18504 'isinE': '\u22F9', 18505 'isindot': '\u22F5', 18506 'isins': '\u22F4', 18507 'isinsv': '\u22F3', 18508 'itilde': '\u0129', 18509 'iukcy': '\u0456', 18510 'iuml': '\u00EF', 18511 'jcirc': '\u0135', 18512 'jcy': '\u0439', 18513 'jfr': '\uD835\uDD27', 18514 'jmath': '\u0237', 18515 'jopf': '\uD835\uDD5B', 18516 'jscr': '\uD835\uDCBF', 18517 'jsercy': '\u0458', 18518 'jukcy': '\u0454', 18519 'kappa': '\u03BA', 18520 'kappav': '\u03F0', 18521 'varkappa': '\u03F0', 18522 'kcedil': '\u0137', 18523 'kcy': '\u043A', 18524 'kfr': '\uD835\uDD28', 18525 'kgreen': '\u0138', 18526 'khcy': '\u0445', 18527 'kjcy': '\u045C', 18528 'kopf': '\uD835\uDD5C', 18529 'kscr': '\uD835\uDCC0', 18530 'lAtail': '\u291B', 18531 'lBarr': '\u290E', 18532 'lEg': '\u2A8B', 18533 'lesseqqgtr': '\u2A8B', 18534 'lHar': '\u2962', 18535 'lacute': '\u013A', 18536 'laemptyv': '\u29B4', 18537 'lambda': '\u03BB', 18538 'langd': '\u2991', 18539 'lap': '\u2A85', 18540 'lessapprox': '\u2A85', 18541 'laquo': '\u00AB', 18542 'larrbfs': '\u291F', 18543 'larrfs': '\u291D', 18544 'larrlp': '\u21AB', 18545 'looparrowleft': '\u21AB', 18546 'larrpl': '\u2939', 18547 'larrsim': '\u2973', 18548 'larrtl': '\u21A2', 18549 'leftarrowtail': '\u21A2', 18550 'lat': '\u2AAB', 18551 'latail': '\u2919', 18552 'late': '\u2AAD', 18553 'lates': '\u2AAD\uFE00', 18554 'lbarr': '\u290C', 18555 'lbbrk': '\u2772', 18556 'lbrace': '\u007B', 18557 'lcub': '\u007B', 18558 'lbrack': '\u005B', 18559 'lsqb': '\u005B', 18560 'lbrke': '\u298B', 18561 'lbrksld': '\u298F', 18562 'lbrkslu': '\u298D', 18563 'lcaron': '\u013E', 18564 'lcedil': '\u013C', 18565 'lcy': '\u043B', 18566 'ldca': '\u2936', 18567 'ldrdhar': '\u2967', 18568 'ldrushar': '\u294B', 18569 'ldsh': '\u21B2', 18570 'le': '\u2264', 18571 'leq': '\u2264', 18572 'leftleftarrows': '\u21C7', 18573 'llarr': '\u21C7', 18574 'leftthreetimes': '\u22CB', 18575 'lthree': '\u22CB', 18576 'lescc': '\u2AA8', 18577 'lesdot': '\u2A7F', 18578 'lesdoto': '\u2A81', 18579 'lesdotor': '\u2A83', 18580 'lesg': '\u22DA\uFE00', 18581 'lesges': '\u2A93', 18582 'lessdot': '\u22D6', 18583 'ltdot': '\u22D6', 18584 'lfisht': '\u297C', 18585 'lfr': '\uD835\uDD29', 18586 'lgE': '\u2A91', 18587 'lharul': '\u296A', 18588 'lhblk': '\u2584', 18589 'ljcy': '\u0459', 18590 'llhard': '\u296B', 18591 'lltri': '\u25FA', 18592 'lmidot': '\u0140', 18593 'lmoust': '\u23B0', 18594 'lmoustache': '\u23B0', 18595 'lnE': '\u2268', 18596 'lneqq': '\u2268', 18597 'lnap': '\u2A89', 18598 'lnapprox': '\u2A89', 18599 'lne': '\u2A87', 18600 'lneq': '\u2A87', 18601 'lnsim': '\u22E6', 18602 'loang': '\u27EC', 18603 'loarr': '\u21FD', 18604 'longmapsto': '\u27FC', 18605 'xmap': '\u27FC', 18606 'looparrowright': '\u21AC', 18607 'rarrlp': '\u21AC', 18608 'lopar': '\u2985', 18609 'lopf': '\uD835\uDD5D', 18610 'loplus': '\u2A2D', 18611 'lotimes': '\u2A34', 18612 'lowast': '\u2217', 18613 'loz': '\u25CA', 18614 'lozenge': '\u25CA', 18615 'lpar': '\u0028', 18616 'lparlt': '\u2993', 18617 'lrhard': '\u296D', 18618 'lrm': '\u200E', 18619 'lrtri': '\u22BF', 18620 'lsaquo': '\u2039', 18621 'lscr': '\uD835\uDCC1', 18622 'lsime': '\u2A8D', 18623 'lsimg': '\u2A8F', 18624 'lsquor': '\u201A', 18625 'sbquo': '\u201A', 18626 'lstrok': '\u0142', 18627 'ltcc': '\u2AA6', 18628 'ltcir': '\u2A79', 18629 'ltimes': '\u22C9', 18630 'ltlarr': '\u2976', 18631 'ltquest': '\u2A7B', 18632 'ltrPar': '\u2996', 18633 'ltri': '\u25C3', 18634 'triangleleft': '\u25C3', 18635 'lurdshar': '\u294A', 18636 'luruhar': '\u2966', 18637 'lvertneqq': '\u2268\uFE00', 18638 'lvnE': '\u2268\uFE00', 18639 'mDDot': '\u223A', 18640 'macr': '\u00AF', 18641 'strns': '\u00AF', 18642 'male': '\u2642', 18643 'malt': '\u2720', 18644 'maltese': '\u2720', 18645 'marker': '\u25AE', 18646 'mcomma': '\u2A29', 18647 'mcy': '\u043C', 18648 'mdash': '\u2014', 18649 'mfr': '\uD835\uDD2A', 18650 'mho': '\u2127', 18651 'micro': '\u00B5', 18652 'midcir': '\u2AF0', 18653 'minus': '\u2212', 18654 'minusdu': '\u2A2A', 18655 'mlcp': '\u2ADB', 18656 'models': '\u22A7', 18657 'mopf': '\uD835\uDD5E', 18658 'mscr': '\uD835\uDCC2', 18659 'mu': '\u03BC', 18660 'multimap': '\u22B8', 18661 'mumap': '\u22B8', 18662 'nGg': '\u22D9\u0338', 18663 'nGt': '\u226B\u20D2', 18664 'nLeftarrow': '\u21CD', 18665 'nlArr': '\u21CD', 18666 'nLeftrightarrow': '\u21CE', 18667 'nhArr': '\u21CE', 18668 'nLl': '\u22D8\u0338', 18669 'nLt': '\u226A\u20D2', 18670 'nRightarrow': '\u21CF', 18671 'nrArr': '\u21CF', 18672 'nVDash': '\u22AF', 18673 'nVdash': '\u22AE', 18674 'nacute': '\u0144', 18675 'nang': '\u2220\u20D2', 18676 'napE': '\u2A70\u0338', 18677 'napid': '\u224B\u0338', 18678 'napos': '\u0149', 18679 'natur': '\u266E', 18680 'natural': '\u266E', 18681 'ncap': '\u2A43', 18682 'ncaron': '\u0148', 18683 'ncedil': '\u0146', 18684 'ncongdot': '\u2A6D\u0338', 18685 'ncup': '\u2A42', 18686 'ncy': '\u043D', 18687 'ndash': '\u2013', 18688 'neArr': '\u21D7', 18689 'nearhk': '\u2924', 18690 'nedot': '\u2250\u0338', 18691 'nesear': '\u2928', 18692 'toea': '\u2928', 18693 'nfr': '\uD835\uDD2B', 18694 'nharr': '\u21AE', 18695 'nleftrightarrow': '\u21AE', 18696 'nhpar': '\u2AF2', 18697 'nis': '\u22FC', 18698 'nisd': '\u22FA', 18699 'njcy': '\u045A', 18700 'nlE': '\u2266\u0338', 18701 'nleqq': '\u2266\u0338', 18702 'nlarr': '\u219A', 18703 'nleftarrow': '\u219A', 18704 'nldr': '\u2025', 18705 'nopf': '\uD835\uDD5F', 18706 'not': '\u00AC', 18707 'notinE': '\u22F9\u0338', 18708 'notindot': '\u22F5\u0338', 18709 'notinvb': '\u22F7', 18710 'notinvc': '\u22F6', 18711 'notnivb': '\u22FE', 18712 'notnivc': '\u22FD', 18713 'nparsl': '\u2AFD\u20E5',
18714 'npart': '\u2202\u0338', 18715 'npolint': '\u2A14', 18716 'nrarr': '\u219B', 18717 'nrightarrow': '\u219B', 18718 'nrarrc': '\u2933\u0338', 18719 'nrarrw': '\u219D\u0338', 18720 'nscr': '\uD835\uDCC3', 18721 'nsub': '\u2284', 18722 'nsubE': '\u2AC5\u0338', 18723 'nsubseteqq': '\u2AC5\u0338', 18724 'nsup': '\u2285', 18725 'nsupE': '\u2AC6\u0338', 18726 'nsupseteqq': '\u2AC6\u0338', 18727 'ntilde': '\u00F1', 18728 'nu': '\u03BD', 18729 'num': '\u0023', 18730 'numero': '\u2116', 18731 'numsp': '\u2007', 18732 'nvDash': '\u22AD', 18733 'nvHarr': '\u2904', 18734 'nvap': '\u224D\u20D2', 18735 'nvdash': '\u22AC', 18736 'nvge': '\u2265\u20D2', 18737 'nvgt': '\u003E\u20D2', 18738 'nvinfin': '\u29DE', 18739 'nvlArr': '\u2902', 18740 'nvle': '\u2264\u20D2', 18741 'nvlt': '\u003C\u20D2', 18742 'nvltrie': '\u22B4\u20D2', 18743 'nvrArr': '\u2903', 18744 'nvrtrie': '\u22B5\u20D2', 18745 'nvsim': '\u223C\u20D2', 18746 'nwArr': '\u21D6', 18747 'nwarhk': '\u2923', 18748 'nwnear': '\u2927', 18749 'oacute': '\u00F3', 18750 'ocirc': '\u00F4', 18751 'ocy': '\u043E', 18752 'odblac': '\u0151', 18753 'odiv': '\u2A38', 18754 'odsold': '\u29BC', 18755 'oelig': '\u0153', 18756 'ofcir': '\u29BF', 18757 'ofr': '\uD835\uDD2C', 18758 'ogon': '\u02DB', 18759 'ograve': '\u00F2', 18760 'ogt': '\u29C1', 18761 'ohbar': '\u29B5', 18762 'olcir': '\u29BE', 18763 'olcross': '\u29BB', 18764 'olt': '\u29C0', 18765 'omacr': '\u014D', 18766 'omega': '\u03C9', 18767 'omicron': '\u03BF', 18768 'omid': '\u29B6', 18769 'oopf': '\uD835\uDD60', 18770 'opar': '\u29B7', 18771 'operp': '\u29B9', 18772 'or': '\u2228', 18773 'vee': '\u2228', 18774 'ord': '\u2A5D', 18775 'order': '\u2134', 18776 'orderof': '\u2134', 18777 'oscr': '\u2134', 18778 'ordf': '\u00AA', 18779 'ordm': '\u00BA', 18780 'origof': '\u22B6', 18781 'oror': '\u2A56', 18782 'orslope': '\u2A57', 18783 'orv': '\u2A5B', 18784 'oslash': '\u00F8', 18785 'osol': '\u2298', 18786 'otilde': '\u00F5', 18787 'otimesas': '\u2A36', 18788 'ouml': '\u00F6', 18789 'ovbar': '\u233D', 18790 'para': '\u00B6', 18791 'parsim': '\u2AF3', 18792 'parsl': '\u2AFD', 18793 'pcy': '\u043F', 18794 'percnt': '\u0025', 18795 'period': '\u002E', 18796 'permil': '\u2030', 18797 'pertenk': '\u2031', 18798 'pfr': '\uD835\uDD2D', 18799 'phi': '\u03C6', 18800 'phiv': '\u03D5', 18801 'straightphi': '\u03D5', 18802 'varphi': '\u03D5', 18803 'phone': '\u260E', 18804 'pi': '\u03C0', 18805 'piv': '\u03D6', 18806 'varpi': '\u03D6', 18807 'planckh': '\u210E', 18808 'plus': '\u002B', 18809 'plusacir': '\u2A23', 18810 'pluscir': '\u2A22', 18811 'plusdu': '\u2A25', 18812 'pluse': '\u2A72', 18813 'plussim': '\u2A26', 18814 'plustwo': '\u2A27', 18815 'pointint': '\u2A15', 18816 'popf': '\uD835\uDD61', 18817 'pound': '\u00A3', 18818 'prE': '\u2AB3', 18819 'prap': '\u2AB7', 18820 'precapprox': '\u2AB7', 18821 'precnapprox': '\u2AB9', 18822 'prnap': '\u2AB9', 18823 'precneqq': '\u2AB5', 18824 'prnE': '\u2AB5', 18825 'precnsim': '\u22E8', 18826 'prnsim': '\u22E8', 18827 'prime': '\u2032', 18828 'profalar': '\u232E', 18829 'profline': '\u2312', 18830 'profsurf': '\u2313', 18831 'prurel': '\u22B0', 18832 'pscr': '\uD835\uDCC5', 18833 'psi': '\u03C8', 18834 'puncsp': '\u2008', 18835 'qfr': '\uD835\uDD2E', 18836 'qopf': '\uD835\uDD62', 18837 'qprime': '\u2057', 18838 'qscr': '\uD835\uDCC6', 18839 'quatint': '\u2A16', 18840 'quest': '\u003F', 18841 'rAtail': '\u291C', 18842 'rHar': '\u2964', 18843 'race': '\u223D\u0331', 18844 'racute': '\u0155', 18845 'raemptyv': '\u29B3', 18846 'rangd': '\u2992', 18847 'range': '\u29A5', 18848 'raquo': '\u00BB', 18849 'rarrap': '\u2975', 18850 'rarrbfs': '\u2920', 18851 'rarrc': '\u2933', 18852 'rarrfs': '\u291E', 18853 'rarrpl': '\u2945', 18854 'rarrsim': '\u2974', 18855 'rarrtl': '\u21A3', 18856 'rightarrowtail': '\u21A3', 18857 'rarrw': '\u219D', 18858 'rightsquigarrow': '\u219D', 18859 'ratail': '\u291A', 18860 'ratio': '\u2236', 18861 'rbbrk': '\u2773', 18862 'rbrace': '\u007D', 18863 'rcub': '\u007D', 18864 'rbrack': '\u005D', 18865 'rsqb': '\u005D', 18866 'rbrke': '\u298C', 18867 'rbrksld': '\u298E', 18868 'rbrkslu': '\u2990', 18869 'rcaron': '\u0159', 18870 'rcedil': '\u0157', 18871 'rcy': '\u0440', 18872 'rdca': '\u2937', 18873 'rdldhar': '\u2969', 18874 'rdsh': '\u21B3', 18875 'rect': '\u25AD', 18876 'rfisht': '\u297D', 18877 'rfr': '\uD835\uDD2F', 18878 'rharul': '\u296C', 18879 'rho': '\u03C1', 18880 'rhov': '\u03F1', 18881 'varrho': '\u03F1', 18882 'rightrightarrows': '\u21C9', 18883 'rrarr': '\u21C9', 18884 'rightthreetimes': '\u22CC', 18885 'rthree': '\u22CC', 18886 'ring': '\u02DA', 18887 'rlm': '\u200F', 18888 'rmoust': '\u23B1', 18889 'rmoustache': '\u23B1', 18890 'rnmid': '\u2AEE', 18891 'roang': '\u27ED', 18892 'roarr': '\u21FE', 18893 'ropar': '\u2986', 18894 'ropf': '\uD835\uDD63', 18895 'roplus': '\u2A2E', 18896 'rotimes': '\u2A35', 18897 'rpar': '\u0029', 18898 'rpargt': '\u2994', 18899 'rppolint': '\u2A12', 18900 'rsaquo': '\u203A', 18901 'rscr': '\uD835\uDCC7', 18902 'rtimes': '\u22CA', 18903 'rtri': '\u25B9', 18904 'triangleright': '\u25B9', 18905 'rtriltri': '\u29CE', 18906 'ruluhar': '\u2968', 18907 'rx': '\u211E', 18908 'sacute': '\u015B', 18909 'scE': '\u2AB4', 18910 'scap': '\u2AB8', 18911 'succapprox': '\u2AB8', 18912 'scaron': '\u0161', 18913 'scedil': '\u015F', 18914 'scirc': '\u015D', 18915 'scnE': '\u2AB6', 18916 'succneqq': '\u2AB6', 18917 'scnap': '\u2ABA', 18918 'succnapprox': '\u2ABA', 18919 'scnsim': '\u22E9', 18920 'succnsim': '\u22E9', 18921 'scpolint': '\u2A13', 18922 'scy': '\u0441', 18923 'sdot': '\u22C5', 18924 'sdote': '\u2A66', 18925 'seArr': '\u21D8', 18926 'sect': '\u00A7', 18927 'semi': '\u003B', 18928 'seswar': '\u2929', 18929 'tosa': '\u2929', 18930 'sext': '\u2736', 18931 'sfr': '\uD835\uDD30', 18932 'sharp': '\u266F', 18933 'shchcy': '\u0449', 18934 'shcy': '\u0448', 18935 'shy': '\u00AD', 18936 'sigma': '\u03C3', 18937 'sigmaf': '\u03C2', 18938 'sigmav': '\u03C2', 18939 'varsigma': '\u03C2', 18940 'simdot': '\u2A6A', 18941 'simg': '\u2A9E', 18942 'simgE': '\u2AA0', 18943 'siml': '\u2A9D', 18944 'simlE': '\u2A9F', 18945 'simne': '\u2246', 18946 'simplus': '\u2A24', 18947 'simrarr': '\u2972', 18948 'smashp': '\u2A33', 18949 'smeparsl': '\u29E4', 18950 'smile': '\u2323', 18951 'ssmile': '\u2323', 18952 'smt': '\u2AAA', 18953 'smte': '\u2AAC', 18954 'smtes': '\u2AAC\uFE00', 18955 'softcy': '\u044C', 18956 'sol': '\u002F', 18957 'solb': '\u29C4', 18958 'solbar': '\u233F', 18959 'sopf': '\uD835\uDD64', 18960 'spades': '\u2660', 18961 'spadesuit': '\u2660', 18962 'sqcaps': '\u2293\uFE00', 18963 'sqcups': '\u2294\uFE00', 18964 'sscr': '\uD835\uDCC8', 18965 'star': '\u2606', 18966 'sub': '\u2282', 18967 'subset': '\u2282', 18968 'subE': '\u2AC5', 18969 'subseteqq': '\u2AC5', 18970 'subdot': '\u2ABD', 18971 'subedot': '\u2AC3', 18972 'submult': '\u2AC1', 18973 'subnE': '\u2ACB', 18974 'subsetneqq': '\u2ACB', 18975 'subne': '\u228A', 18976 'subsetneq': '\u228A', 18977 'subplus': '\u2ABF', 18978 'subrarr': '\u2979', 18979 'subsim': '\u2AC7', 18980 'subsub': '\u2AD5', 18981 'subsup': '\u2AD3', 18982 'sung': '\u266A', 18983 'sup1': '\u00B9', 18984 'sup2': '\u00B2', 18985 'sup3': '\u00B3', 18986 'supE': '\u2AC6', 18987 'supseteqq': '\u2AC6', 18988 'supdot': '\u2ABE', 18989 'supdsub': '\u2AD8', 18990 'supedot': '\u2AC4', 18991 'suphsol': '\u27C9', 18992 'suphsub': '\u2AD7', 18993 'suplarr': '\u297B',
18994 'supmult': '\u2AC2', 18995 'supnE': '\u2ACC', 18996 'supsetneqq': '\u2ACC', 18997 'supne': '\u228B', 18998 'supsetneq': '\u228B', 18999 'supplus': '\u2AC0', 19000 'supsim': '\u2AC8', 19001 'supsub': '\u2AD4', 19002 'supsup': '\u2AD6', 19003 'swArr': '\u21D9', 19004 'swnwar': '\u292A', 19005 'szlig': '\u00DF', 19006 'target': '\u2316', 19007 'tau': '\u03C4', 19008 'tcaron': '\u0165', 19009 'tcedil': '\u0163', 19010 'tcy': '\u0442', 19011 'telrec': '\u2315', 19012 'tfr': '\uD835\uDD31', 19013 'theta': '\u03B8', 19014 'thetasym': '\u03D1', 19015 'thetav': '\u03D1', 19016 'vartheta': '\u03D1', 19017 'thorn': '\u00FE', 19018 'times': '\u00D7', 19019 'timesbar': '\u2A31', 19020 'timesd': '\u2A30', 19021 'topbot': '\u2336', 19022 'topcir': '\u2AF1', 19023 'topf': '\uD835\uDD65', 19024 'topfork': '\u2ADA', 19025 'tprime': '\u2034', 19026 'triangle': '\u25B5', 19027 'utri': '\u25B5', 19028 'triangleq': '\u225C', 19029 'trie': '\u225C', 19030 'tridot': '\u25EC', 19031 'triminus': '\u2A3A', 19032 'triplus': '\u2A39', 19033 'trisb': '\u29CD', 19034 'tritime': '\u2A3B', 19035 'trpezium': '\u23E2', 19036 'tscr': '\uD835\uDCC9', 19037 'tscy': '\u0446', 19038 'tshcy': '\u045B', 19039 'tstrok': '\u0167', 19040 'uHar': '\u2963', 19041 'uacute': '\u00FA', 19042 'ubrcy': '\u045E', 19043 'ubreve': '\u016D', 19044 'ucirc': '\u00FB', 19045 'ucy': '\u0443', 19046 'udblac': '\u0171', 19047 'ufisht': '\u297E', 19048 'ufr': '\uD835\uDD32', 19049 'ugrave': '\u00F9', 19050 'uhblk': '\u2580', 19051 'ulcorn': '\u231C', 19052 'ulcorner': '\u231C', 19053 'ulcrop': '\u230F', 19054 'ultri': '\u25F8', 19055 'umacr': '\u016B', 19056 'uogon': '\u0173', 19057 'uopf': '\uD835\uDD66', 19058 'upsi': '\u03C5', 19059 'upsilon': '\u03C5', 19060 'upuparrows': '\u21C8', 19061 'uuarr': '\u21C8', 19062 'urcorn': '\u231D', 19063 'urcorner': '\u231D', 19064 'urcrop': '\u230E', 19065 'uring': '\u016F', 19066 'urtri': '\u25F9', 19067 'uscr': '\uD835\uDCCA', 19068 'utdot': '\u22F0', 19069 'utilde': '\u0169', 19070 'uuml': '\u00FC', 19071 'uwangle': '\u29A7', 19072 'vBar': '\u2AE8', 19073 'vBarv': '\u2AE9', 19074 'vangrt': '\u299C', 19075 'varsubsetneq': '\u228A\uFE00', 19076 'vsubne': '\u228A\uFE00', 19077 'varsubsetneqq': '\u2ACB\uFE00', 19078 'vsubnE': '\u2ACB\uFE00', 19079 'varsupsetneq': '\u228B\uFE00', 19080 'vsupne': '\u228B\uFE00', 19081 'varsupsetneqq': '\u2ACC\uFE00', 19082 'vsupnE': '\u2ACC\uFE00', 19083 'vcy': '\u0432', 19084 'veebar': '\u22BB', 19085 'veeeq': '\u225A', 19086 'vellip': '\u22EE', 19087 'vfr': '\uD835\uDD33', 19088 'vopf': '\uD835\uDD67', 19089 'vscr': '\uD835\uDCCB', 19090 'vzigzag': '\u299A', 19091 'wcirc': '\u0175', 19092 'wedbar': '\u2A5F', 19093 'wedgeq': '\u2259', 19094 'weierp': '\u2118', 19095 'wp': '\u2118', 19096 'wfr': '\uD835\uDD34', 19097 'wopf': '\uD835\uDD68', 19098 'wscr': '\uD835\uDCCC', 19099 'xfr': '\uD835\uDD35', 19100 'xi': '\u03BE', 19101 'xnis': '\u22FB', 19102 'xopf': '\uD835\uDD69', 19103 'xscr': '\uD835\uDCCD', 19104 'yacute': '\u00FD', 19105 'yacy': '\u044F', 19106 'ycirc': '\u0177', 19107 'ycy': '\u044B', 19108 'yen': '\u00A5', 19109 'yfr': '\uD835\uDD36', 19110 'yicy': '\u0457', 19111 'yopf': '\uD835\uDD6A', 19112 'yscr': '\uD835\uDCCE', 19113 'yucy': '\u044E', 19114 'yuml': '\u00FF', 19115 'zacute': '\u017A', 19116 'zcaron': '\u017E', 19117 'zcy': '\u0437', 19118 'zdot': '\u017C', 19119 'zeta': '\u03B6', 19120 'zfr': '\uD835\uDD37', 19121 'zhcy': '\u0436', 19122 'zigrarr': '\u21DD', 19123 'zopf': '\uD835\uDD6B', 19124 'zscr': '\uD835\uDCCF', 19125 'zwj': '\u200D', 19126 'zwnj': '\u200C' 19127}; 19128// The &ngsp; pseudo-entity is denoting a space. 19129// 0xE500 is a PUA (Private Use Areas) unicode character 19130// This is inspired by the Angular Dart implementation. 19131const NGSP_UNICODE = '\uE500'; 19132NAMED_ENTITIES['ngsp'] = NGSP_UNICODE; 19133class TokenError extends ParseError { 19134 constructor(errorMsg, tokenType, span) { 19135 super(span, errorMsg); 19136 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "tokenType", void 0); 19137 this.tokenType = tokenType; 19138 } 19139} 19140class TokenizeResult { 19141 constructor(tokens, errors, nonNormalizedIcuExpressions) { 19142 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "tokens", void 0); 19143 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "errors", void 0); 19144 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "nonNormalizedIcuExpressions", void 0); 19145 this.tokens = tokens; 19146 this.errors = errors; 19147 this.nonNormalizedIcuExpressions = nonNormalizedIcuExpressions; 19148 } 19149} 19150function tokenize(source, url, getTagDefinition, options = {}) { 19151 const tokenizer = new _Tokenizer(new ParseSourceFile(source, url), getTagDefinition, options); 19152 tokenizer.tokenize(); 19153 return new TokenizeResult(mergeTextTokens(tokenizer.tokens), tokenizer.errors, tokenizer.nonNormalizedIcuExpressions); 19154} 19155const _CR_OR_CRLF_REGEXP = /\r\n?/g; 19156function _unexpectedCharacterErrorMsg(charCode) { 19157 const char = charCode === $EOF ? 'EOF' : String.fromCharCode(charCode); 19158 return `Unexpected character "${char}"`; 19159} 19160function _unknownEntityErrorMsg(entitySrc) { 19161 return `Unknown entity "${entitySrc}" - use the "&#<decimal>;" or "&#x<hex>;" syntax`; 19162} 19163function _unparsableEntityErrorMsg(type, entityStr) { 19164 return `Unable to parse entity "${entityStr}" - ${type} character reference entities must end with ";"`; 19165} 19166var CharacterReferenceType = /*#__PURE__*/function (CharacterReferenceType) { 19167 CharacterReferenceType["HEX"] = "hexadecimal"; 19168 CharacterReferenceType["DEC"] = "decimal"; 19169 return CharacterReferenceType; 19170}(CharacterReferenceType || {}); 19171class _ControlFlowError { 19172 constructor(error) { 19173 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "error", void 0); 19174 this.error = error; 19175 } 19176} 19177// See https://www.w3.org/TR/html51/syntax.html#writing-html-documents 19178class _Tokenizer { 19179 /** 19180 * @param _file The html source file being tokenized. 19181 * @param _getTagDefinition A function that will retrieve a tag definition for a given tag name. 19182 * @param options Configuration of the tokenization. 19183 */ 19184 constructor(_file, _getTagDefinition, options) { 19185 var _options$tokenizeBloc, _options$tokenizeLet; 19186 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_getTagDefinition", void 0); 19187 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_cursor", void 0); 19188 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_tokenizeIcu", void 0); 19189 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_interpolationConfig", void 0); 19190 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_leadingTriviaCodePoints", void 0); 19191 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_currentTokenStart", null); 19192 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_currentTokenType", null); 19193 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_expansionCaseStack", []); 19194 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_inInterpolation", false); 19195 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_preserveLineEndings", void 0); 19196 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_i18nNormalizeLineEndingsInICUs", void 0); 19197 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_tokenizeBlocks", void 0); 19198 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_tokenizeLet", void 0); 19199 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "tokens", []); 19200 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "errors", []); 19201 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "nonNormalizedIcuExpressions", []); 19202 this._getTagDefinition = _getTagDefinition; 19203 this._tokenizeIcu = options.tokenizeExpansionForms || false; 19204 this._interpolationConfig = options.interpolationConfig || DEFAULT_INTERPOLATION_CONFIG; 19205 this._leadingTriviaCodePoints = options.leadingTriviaChars && options.leadingTriviaChars.map(c => c.codePointAt(0) || 0); 19206 const range = options.range || { 19207 endPos: _file.content.length, 19208 startPos: 0, 19209 startLine: 0, 19210 startCol: 0 19211 }; 19212 this._cursor = options.escapedString ? new EscapedCharacterCursor(_file, range) : new PlainCharacterCursor(_file, range); 19213 this._preserveLineEndings = options.preserveLineEndings || false;
19214 this._i18nNormalizeLineEndingsInICUs = options.i18nNormalizeLineEndingsInICUs || false; 19215 this._tokenizeBlocks = (_options$tokenizeBloc = options.tokenizeBlocks) !== null && _options$tokenizeBloc !== void 0 ? _options$tokenizeBloc : true; 19216 this._tokenizeLet = (_options$tokenizeLet = options.tokenizeLet) !== null && _options$tokenizeLet !== void 0 ? _options$tokenizeLet : true; 19217 try { 19218 this._cursor.init(); 19219 } catch (e) { 19220 this.handleError(e); 19221 } 19222 } 19223 _processCarriageReturns(content) { 19224 if (this._preserveLineEndings) { 19225 return content; 19226 } 19227 // https://www.w3.org/TR/html51/syntax.html#preprocessing-the-input-stream 19228 // In order to keep the original position in the source, we can not 19229 // pre-process it. 19230 // Instead CRs are processed right before instantiating the tokens. 19231 return content.replace(_CR_OR_CRLF_REGEXP, '\n'); 19232 } 19233 tokenize() { 19234 while (this._cursor.peek() !== $EOF) { 19235 const start = this._cursor.clone(); 19236 try { 19237 if (this._attemptCharCode($LT)) { 19238 if (this._attemptCharCode($BANG)) { 19239 if (this._attemptCharCode($LBRACKET)) { 19240 this._consumeCdata(start); 19241 } else if (this._attemptCharCode($MINUS)) { 19242 this._consumeComment(start); 19243 } else { 19244 this._consumeDocType(start); 19245 } 19246 } else if (this._attemptCharCode($SLASH)) { 19247 this._consumeTagClose(start); 19248 } else { 19249 this._consumeTagOpen(start); 19250 } 19251 } else if (this._tokenizeLet && 19252 // Use `peek` instead of `attempCharCode` since we 19253 // don't want to advance in case it's not `@let`. 19254 this._cursor.peek() === $AT && !this._inInterpolation && this._attemptStr('@let')) { 19255 this._consumeLetDeclaration(start); 19256 } else if (this._tokenizeBlocks && this._attemptCharCode($AT)) { 19257 this._consumeBlockStart(start); 19258 } else if (this._tokenizeBlocks && !this._inInterpolation && !this._isInExpansionCase() && !this._isInExpansionForm() && this._attemptCharCode($RBRACE)) { 19259 this._consumeBlockEnd(start); 19260 } else if (!(this._tokenizeIcu && this._tokenizeExpansionForm())) { 19261 // In (possibly interpolated) text the end of the text is given by `isTextEnd()`, while 19262 // the premature end of an interpolation is given by the start of a new HTML element. 19263 this._consumeWithInterpolation(5 /* TokenType.TEXT */, 8 /* TokenType.INTERPOLATION */, () => this._isTextEnd(), () => this._isTagStart()); 19264 } 19265 } catch (e) { 19266 this.handleError(e); 19267 } 19268 } 19269 this._beginToken(33 /* TokenType.EOF */); 19270 this._endToken([]); 19271 } 19272 _getBlockName() { 19273 // This allows us to capture up something like `@else if`, but not `@ if`. 19274 let spacesInNameAllowed = false; 19275 const nameCursor = this._cursor.clone(); 19276 this._attemptCharCodeUntilFn(code => { 19277 if (isWhitespace(code)) { 19278 return !spacesInNameAllowed; 19279 } 19280 if (isBlockNameChar(code)) { 19281 spacesInNameAllowed = true; 19282 return false; 19283 } 19284 return true; 19285 }); 19286 return this._cursor.getChars(nameCursor).trim(); 19287 } 19288 _consumeBlockStart(start) { 19289 this._beginToken(24 /* TokenType.BLOCK_OPEN_START */, start); 19290 const startToken = this._endToken([this._getBlockName()]); 19291 if (this._cursor.peek() === $LPAREN) { 19292 // Advance past the opening paren. 19293 this._cursor.advance(); 19294 // Capture the parameters. 19295 this._consumeBlockParameters(); 19296 // Allow spaces before the closing paren. 19297 this._attemptCharCodeUntilFn(isNotWhitespace); 19298 if (this._attemptCharCode($RPAREN)) { 19299 // Allow spaces after the paren. 19300 this._attemptCharCodeUntilFn(isNotWhitespace); 19301 } else { 19302 startToken.type = 28 /* TokenType.INCOMPLETE_BLOCK_OPEN */; 19303 return; 19304 } 19305 } 19306 if (this._attemptCharCode($LBRACE)) { 19307 this._beginToken(25 /* TokenType.BLOCK_OPEN_END */); 19308 this._endToken([]); 19309 } else { 19310 startToken.type = 28 /* TokenType.INCOMPLETE_BLOCK_OPEN */; 19311 } 19312 } 19313 _consumeBlockEnd(start) { 19314 this._beginToken(26 /* TokenType.BLOCK_CLOSE */, start); 19315 this._endToken([]); 19316 } 19317 _consumeBlockParameters() { 19318 // Trim the whitespace until the first parameter. 19319 this._attemptCharCodeUntilFn(isBlockParameterChar); 19320 while (this._cursor.peek() !== $RPAREN && this._cursor.peek() !== $EOF) { 19321 this._beginToken(27 /* TokenType.BLOCK_PARAMETER */); 19322 const start = this._cursor.clone(); 19323 let inQuote = null; 19324 let openParens = 0; 19325 // Consume the parameter until the next semicolon or brace. 19326 // Note that we skip over semicolons/braces inside of strings. 19327 while (this._cursor.peek() !== $SEMICOLON && this._cursor.peek() !== $EOF || inQuote !== null) { 19328 const char = this._cursor.peek(); 19329 // Skip to the next character if it was escaped. 19330 if (char === $BACKSLASH) { 19331 this._cursor.advance(); 19332 } else if (char === inQuote) { 19333 inQuote = null; 19334 } else if (inQuote === null && isQuote(char)) { 19335 inQuote = char; 19336 } else if (char === $LPAREN && inQuote === null) { 19337 openParens++; 19338 } else if (char === $RPAREN && inQuote === null) { 19339 if (openParens === 0) { 19340 break; 19341 } else if (openParens > 0) { 19342 openParens--; 19343 } 19344 } 19345 this._cursor.advance(); 19346 } 19347 this._endToken([this._cursor.getChars(start)]); 19348 // Skip to the next parameter. 19349 this._attemptCharCodeUntilFn(isBlockParameterChar); 19350 } 19351 } 19352 _consumeLetDeclaration(start) { 19353 this._beginToken(29 /* TokenType.LET_START */, start); 19354 // Require at least one white space after the `@let`. 19355 if (isWhitespace(this._cursor.peek())) { 19356 this._attemptCharCodeUntilFn(isNotWhitespace); 19357 } else { 19358 const token = this._endToken([this._cursor.getChars(start)]); 19359 token.type = 32 /* TokenType.INCOMPLETE_LET */; 19360 return; 19361 } 19362 const startToken = this._endToken([this._getLetDeclarationName()]); 19363 // Skip over white space before the equals character. 19364 this._attemptCharCodeUntilFn(isNotWhitespace); 19365 // Expect an equals sign. 19366 if (!this._attemptCharCode($EQ)) { 19367 startToken.type = 32 /* TokenType.INCOMPLETE_LET */; 19368 return; 19369 } 19370 // Skip spaces after the equals. 19371 this._attemptCharCodeUntilFn(code => isNotWhitespace(code) && !isNewLine(code)); 19372 this._consumeLetDeclarationValue(); 19373 // Terminate the `@let` with a semicolon. 19374 const endChar = this._cursor.peek(); 19375 if (endChar === $SEMICOLON) { 19376 this._beginToken(31 /* TokenType.LET_END */); 19377 this._endToken([]); 19378 this._cursor.advance(); 19379 } else { 19380 startToken.type = 32 /* TokenType.INCOMPLETE_LET */; 19381 startToken.sourceSpan = this._cursor.getSpan(start); 19382 } 19383 } 19384 _getLetDeclarationName() { 19385 const nameCursor = this._cursor.clone(); 19386 let allowDigit = false;
19387 this._attemptCharCodeUntilFn(code => { 19388 if (isAsciiLetter(code) || code === $$ || code === $_ || 19389 // `@let` names can't start with a digit, but digits are valid anywhere else in the name. 19390 allowDigit && isDigit(code)) { 19391 allowDigit = true; 19392 return false; 19393 } 19394 return true; 19395 }); 19396 return this._cursor.getChars(nameCursor).trim(); 19397 } 19398 _consumeLetDeclarationValue() { 19399 const start = this._cursor.clone(); 19400 this._beginToken(30 /* TokenType.LET_VALUE */, start); 19401 while (this._cursor.peek() !== $EOF) { 19402 const char = this._cursor.peek(); 19403 // `@let` declarations terminate with a semicolon. 19404 if (char === $SEMICOLON) { 19405 break; 19406 } 19407 // If we hit a quote, skip over its content since we don't care what's inside. 19408 if (isQuote(char)) { 19409 this._cursor.advance(); 19410 this._attemptCharCodeUntilFn(inner => { 19411 if (inner === $BACKSLASH) { 19412 this._cursor.advance(); 19413 return false; 19414 } 19415 return inner === char; 19416 }); 19417 } 19418 this._cursor.advance(); 19419 } 19420 this._endToken([this._cursor.getChars(start)]); 19421 } 19422 /** 19423 * @returns whether an ICU token has been created 19424 * @internal 19425 */ 19426 _tokenizeExpansionForm() { 19427 if (this.isExpansionFormStart()) { 19428 this._consumeExpansionFormStart(); 19429 return true; 19430 } 19431 if (isExpansionCaseStart(this._cursor.peek()) && this._isInExpansionForm()) { 19432 this._consumeExpansionCaseStart(); 19433 return true; 19434 } 19435 if (this._cursor.peek() === $RBRACE) { 19436 if (this._isInExpansionCase()) { 19437 this._consumeExpansionCaseEnd(); 19438 return true; 19439 } 19440 if (this._isInExpansionForm()) { 19441 this._consumeExpansionFormEnd(); 19442 return true; 19443 } 19444 } 19445 return false; 19446 } 19447 _beginToken(type, start = this._cursor.clone()) { 19448 this._currentTokenStart = start; 19449 this._currentTokenType = type; 19450 } 19451 _endToken(parts, end) { 19452 if (this._currentTokenStart === null) { 19453 throw new TokenError('Programming error - attempted to end a token when there was no start to the token', this._currentTokenType, this._cursor.getSpan(end)); 19454 } 19455 if (this._currentTokenType === null) { 19456 throw new TokenError('Programming error - attempted to end a token which has no token type', null, this._cursor.getSpan(this._currentTokenStart)); 19457 } 19458 const token = { 19459 type: this._currentTokenType, 19460 parts, 19461 sourceSpan: (end !== null && end !== void 0 ? end : this._cursor).getSpan(this._currentTokenStart, this._leadingTriviaCodePoints) 19462 }; 19463 this.tokens.push(token); 19464 this._currentTokenStart = null; 19465 this._currentTokenType = null; 19466 return token; 19467 } 19468 _createError(msg, span) { 19469 if (this._isInExpansionForm()) { 19470 msg += ` (Do you have an unescaped "{" in your template? Use "{{ '{' }}") to escape it.)`; 19471 } 19472 const error = new TokenError(msg, this._currentTokenType, span); 19473 this._currentTokenStart = null; 19474 this._currentTokenType = null; 19475 return new _ControlFlowError(error); 19476 } 19477 handleError(e) { 19478 if (e instanceof CursorError) { 19479 e = this._createError(e.msg, this._cursor.getSpan(e.cursor)); 19480 } 19481 if (e instanceof _ControlFlowError) { 19482 this.errors.push(e.error); 19483 } else { 19484 throw e; 19485 } 19486 } 19487 _attemptCharCode(charCode) { 19488 if (this._cursor.peek() === charCode) { 19489 this._cursor.advance(); 19490 return true; 19491 } 19492 return false; 19493 } 19494 _attemptCharCodeCaseInsensitive(charCode) { 19495 if (compareCharCodeCaseInsensitive(this._cursor.peek(), charCo
19495de)) { 19496 this._cursor.advance(); 19497 return true; 19498 } 19499 return false; 19500 } 19501 _requireCharCode(charCode) { 19502 const location = this._cursor.clone(); 19503 if (!this._attemptCharCode(charCode)) { 19504 throw this._createError(_unexpectedCharacterErrorMsg(this._cursor.peek()), this._cursor.getSpan(location)); 19505 } 19506 } 19507 _attemptStr(chars) { 19508 const len = chars.length; 19509 if (this._cursor.charsLeft() < len) { 19510 return false; 19511 } 19512 const initialPosition = this._cursor.clone(); 19513 for (let i = 0; i < len; i++) { 19514 if (!this._attemptCharCode(chars.charCodeAt(i))) { 19515 // If attempting to parse the string fails, we want to reset the parser 19516 // to where it was before the attempt 19517 this._cursor = initialPosition; 19518 return false; 19519 } 19520 } 19521 return true; 19522 } 19523 _attemptStrCaseInsensitive(chars) { 19524 for (let i = 0; i < chars.length; i++) { 19525 if (!this._attemptCharCodeCaseInsensitive(chars.charCodeAt(i))) { 19526 return false; 19527 } 19528 } 19529 return true; 19530 } 19531 _requireStr(chars) { 19532 const location = this._cursor.clone(); 19533 if (!this._attemptStr(chars)) { 19534 throw this._createError(_unexpectedCharacterErrorMsg(this._cursor.peek()), this._cursor.getSpan(location)); 19535 } 19536 } 19537 _attemptCharCodeUntilFn(predicate) { 19538 while (!predicate(this._cursor.peek())) { 19539 this._cursor.advance(); 19540 } 19541 } 19542 _requireCharCodeUntilFn(predicate, len) { 19543 const start = this._cursor.clone(); 19544 this._attemptCharCodeUntilFn(predicate); 19545 if (this._cursor.diff(start) < len) { 19546 throw this._createError(_unexpectedCharacterErrorMsg(this._cursor.peek()), this._cursor.getSpan(start)); 19547 } 19548 } 19549 _attemptUntilChar(char) { 19550 while (this._cursor.peek() !== char) { 19551 this._cursor.advance(); 19552 } 19553 } 19554 _readChar() { 19555 // Don't rely upon reading directly from `_input` as the actual char value 19556 // may have been generated from an escape sequence. 19557 const char = String.fromCodePoint(this._cursor.peek()); 19558 this._cursor.advance(); 19559 return char; 19560 } 19561 _consumeEntity(textTokenType) { 19562 this._beginToken(9 /* TokenType.ENCODED_ENTITY */); 19563 const start = this._cursor.clone(); 19564 this._cursor.advance(); 19565 if (this._attemptCharCode($HASH)) { 19566 const isHex = this._attemptCharCode($x) || this._attemptCharCode($X); 19567 const codeStart = this._cursor.clone(); 19568 this._attemptCharCodeUntilFn(isDigitEntityEnd); 19569 if (this._cursor.peek() != $SEMICOLON) { 19570 // Advance cursor to include the peeked character in the string provided to the error 19571 // message. 19572 this._cursor.advance(); 19573 const entityType = isHex ? CharacterReferenceType.HEX : CharacterReferenceType.DEC; 19574 throw this._createError(_unparsableEntityErrorMsg(entityType, this._cursor.getChars(start)), this._cursor.getSpan()); 19575 } 19576 const strNum = this._cursor.getChars(codeStart); 19577 this._cursor.advance(); 19578 try { 19579 const charCode = parseInt(strNum, isHex ? 16 : 10); 19580 this._endToken([String.fromCharCode(charCode), this._cursor.getChars(start)]); 19581 } catch (_unused2) { 19582 throw this._createError(_unknownEntityErrorMsg(this._cursor.getChars(start)), this._cursor.getSpan()); 19583 } 19584 } else { 19585 const nameStart = this._cursor.clone(); 19586 this._attemptCharCodeUntilFn(isNamedEntityEnd); 19587 if (this._cursor.peek() != $SEMICOLON) { 19588 // No semicolon was found so abort the encoded entity token that was in progress, and treat 19589 // this as a text token 19590 this._beginToken(textTokenType, start); 19591 this._cursor = nameStart; 19592 this._endToken(['&']); 19593 } else { 19594 const name = this._cursor.getChars(nameStart); 19595 this._cursor.advance(); 19596 const char = NAMED_ENTITIES.hasOwnProperty(name) && NAMED_ENTITIES[name]; 19597 if (!char) { 19598 throw this._createError(_unknownEntityErrorMsg(name), this._cursor.getSpan(start)); 19599 } 19600 this._endToken([char, `&${name};`]); 19601 } 19602 } 19603 } 19604 _consumeRawText(consumeEntities, endMarkerPredicate) { 19605 this._beginToken(consumeEntities ? 6 /* TokenType.ESCAPABLE_RAW_TEXT */ : 7 /* TokenType.RAW_TEXT */); 19606 const parts = []; 19607 while (true) { 19608 const tagCloseStart = this._cursor.clone(); 19609 const foundEndMarker = endMarkerPredicate(); 19610 this._cursor = tagCloseStart; 19611 if (foundEndMarker) { 19612 break; 19613 } 19614 if (consumeEntities && this._cursor.peek() === $AMPERSAND) { 19615 this._endToken([this._processCarriageReturns(parts.join(''))]); 19616 parts.length = 0; 19617 this._consumeEntity(6 /* TokenType.ESCAPABLE_RAW_TEXT */); 19618 this._beginToken(6 /* TokenType.ESCAPABLE_RAW_TEXT */); 19619 } else { 19620 parts.push(this._readChar()); 19621 } 19622 } 19623 this._endToken([this._processCarriageReturns(parts.join(''))]); 19624 } 19625 _consumeComment(start) { 19626 this._beginToken(10 /* TokenType.COMMENT_START */, start); 19627 this._requireCharCode($MINUS); 19628 this._endToken([]); 19629 this._consumeRawText(false, () => this._attemptStr('-->')); 19630 this._beginToken(11 /* TokenType.COMMENT_END */); 19631 this._requireStr('-->'); 19632 this._endToken([]); 19633 } 19634 _consumeCdata(start) { 19635 this._beginToken(12 /* TokenType.CDATA_START */, start); 19636 this._requireStr('CDATA['); 19637 this._endToken([]); 19638 this._consumeRawText(false, () => this._attemptStr(']]>')); 19639 this._beginToken(13 /* TokenType.CDATA_END */); 19640 this._requireStr(']]>'); 19641 this._endToken([]); 19642 } 19643 _consumeDocType(start) { 19644 this._beginToken(18 /* TokenType.DOC_TYPE */, start); 19645 const contentStart = this._cursor.clone(); 19646 this._attemptUntilChar($GT); 19647 const content = this._cursor.getChars(contentStart); 19648 this._cursor.advance(); 19649 this._endToken([content]); 19650 } 19651 _consumePrefixAndName() { 19652 const nameOrPrefixStart = this._cursor.clone(); 19653 let prefix = ''; 19654 while (this._cursor.peek() !== $COLON && !isPrefixEnd(this._cursor.peek())) { 19655 this._cursor.advance(); 19656 } 19657 let nameStart; 19658 if (this._cursor.peek() === $COLON) { 19659 prefix = this._cursor.getChars(nameOrPrefixStart); 19660 this._cursor.advance(); 19661 nameStart = this._cursor.clone(); 19662 } else { 19663 nameStart = nameOrPrefixStart; 19664 } 19665 this._requireCharCodeUntilFn(isNameEnd, prefix === '' ? 0 : 1); 19666 const name = this._cursor.getChars(nameStart); 19667 return [prefix, name]; 19668 } 19669 _consumeTagOpen(start) { 19670 let tagName; 19671 let prefix; 19672 let openTagToken; 19673 try { 19674 if (!isAsciiLetter(this._cursor.peek())) { 19675 throw this._createError(_unexpectedCharacterErrorMsg(this._cursor.peek()), this._cursor.getSpan(start)); 19676 } 19677 openTagToken = this._consumeTagOpenStart(start); 19678 prefix = openTagToken.parts[0]; 19679 tagName = openTagToken.parts[1]; 19680 this._attemptCharCodeUntilFn(isNotWhitespace); 19681 while (this._cursor.peek() !== $SLASH && this._cursor.peek() !== $GT && this._cursor.peek() !== $LT && this._cursor.peek() !== $EOF) { 19682 this._consumeAttributeName(); 19683 this._attemptCharCodeUntilFn(isNotWhitespace); 19684 if (this._attemptCharCode($EQ)) { 19685 this._attemptCharCodeUntilFn(isNotWhitespace); 19686 this._consumeAttributeValue(); 19687 } 19688 this._attemptCharCodeUntilFn(isNotWhitespace); 19689 } 19690 this._consumeTagOpenEnd(); 19691 } catch (e) { 19692 if (e instanceof _ControlFlowError) { 19693 if (openTagToken) { 19694 // We errored before we could close the opening tag, so it is incomplete. 19695 openTagToken.type = 4 /* TokenType.INCOMPLETE_TAG_OPEN */; 19696 } else {
19697 // When the start tag is invalid, assume we want a "<" as text. 19698 // Back to back text tokens are merged at the end. 19699 this._beginToken(5 /* TokenType.TEXT */, start); 19700 this._endToken(['<']); 19701 } 19702 return; 19703 } 19704 throw e; 19705 } 19706 const contentTokenType = this._getTagDefinition(tagName).getContentType(prefix); 19707 if (contentTokenType === TagContentType.RAW_TEXT) { 19708 this._consumeRawTextWithTagClose(prefix, tagName, false); 19709 } else if (contentTokenType === TagContentType.ESCAPABLE_RAW_TEXT) { 19710 this._consumeRawTextWithTagClose(prefix, tagName, true); 19711 } 19712 } 19713 _consumeRawTextWithTagClose(prefix, tagName, consumeEntities) { 19714 this._consumeRawText(consumeEntities, () => { 19715 if (!this._attemptCharCode($LT)) return false; 19716 if (!this._attemptCharCode($SLASH)) return false; 19717 this._attemptCharCodeUntilFn(isNotWhitespace); 19718 if (!this._attemptStrCaseInsensitive(tagName)) return false; 19719 this._attemptCharCodeUntilFn(isNotWhitespace); 19720 return this._attemptCharCode($GT); 19721 }); 19722 this._beginToken(3 /* TokenType.TAG_CLOSE */); 19723 this._requireCharCodeUntilFn(code => code === $GT, 3); 19724 this._cursor.advance(); // Consume the `>` 19725 this._endToken([prefix, tagName]); 19726 } 19727 _consumeTagOpenStart(start) { 19728 this._beginToken(0 /* TokenType.TAG_OPEN_START */, start); 19729 const parts = this._consumePrefixAndName(); 19730 return this._endToken(parts); 19731 } 19732 _consumeAttributeName() { 19733 const attrNameStart = this._cursor.peek(); 19734 if (attrNameStart === $SQ || attrNameStart === $DQ) { 19735 throw this._createError(_unexpectedCharacterErrorMsg(attrNameStart), this._cursor.getSpan()); 19736 } 19737 this._beginToken(14 /* TokenType.ATTR_NAME */); 19738 const prefixAndName = this._consumePrefixAndName(); 19739 this._endToken(prefixAndName); 19740 } 19741 _consumeAttributeValue() { 19742 if (this._cursor.peek() === $SQ || this._cursor.peek() === $DQ) { 19743 const quoteChar = this._cursor.peek(); 19744 this._consumeQuote(quoteChar); 19745 // In an attribute then end of the attribute value and the premature end to an interpolation 19746 // are both triggered by the `quoteChar`. 19747 const endPredicate = () => this._cursor.peek() === quoteChar; 19748 this._consumeWithInterpolation(16 /* TokenType.ATTR_VALUE_TEXT */, 17 /* TokenType.ATTR_VALUE_INTERPOLATION */, endPredicate, endPredicate); 19749 this._consumeQuote(quoteChar); 19750 } else { 19751 const endPredicate = () => isNameEnd(this._cursor.peek()); 19752 this._consumeWithInterpolation(16 /* TokenType.ATTR_VALUE_TEXT */, 17 /* TokenType.ATTR_VALUE_INTERPOLATION */, endPredicate, endPredicate); 19753 } 19754 } 19755 _consumeQuote(quoteChar) { 19756 this._beginToken(15 /* TokenType.ATTR_QUOTE */); 19757 this._requireCharCode(quoteChar); 19758 this._endToken([String.fromCodePoint(quoteChar)]); 19759 } 19760 _consumeTagOpenEnd() { 19761 const tokenType = this._attemptCharCode($SLASH) ? 2 /* TokenType.TAG_OPEN_END_VOID */ : 1 /* TokenType.TAG_OPEN_END */; 19762 this._beginToken(tokenType); 19763 this._requireCharCode($GT); 19764 this._endToken([]); 19765 } 19766 _consumeTagClose(start) { 19767 this._beginToken(3 /* TokenType.TAG_CLOSE */, start); 19768 this._attemptCharCodeUntilFn(isNotWhitespace); 19769 const prefixAndName = this._consumePrefixAndName(); 19770 this._attemptCharCodeUntilFn(isNotWhitespace); 19771 this._requireCharCode($GT); 19772 this._endToken(prefixAndName); 19773 } 19774 _consumeExpansionFormStart() { 19775 this._beginToken(19 /* TokenType.EXPANSION_FORM_START */); 19776 this._requireCharCode($LBRACE); 19777 this._endToken([]); 19778 this._expansionCaseStack.push(19 /* TokenType.EXPANSION_FORM_START */); 19779 this._beginToken(7 /* TokenType.RAW_TEXT */); 19780 const condition = this._readUntil($COMMA); 19781 const normalizedCondition = this._processCarriageReturns(condition); 19782 if (this._i18nNormalizeLineEndingsInICUs) { 19783 // We explicitly want to normalize line endings for this text. 19784 this._endToken([normalizedCondition]); 19785 } else { 19786 // We are not normalizing line endings. 19787 const conditionToken = this._endToken([condition]); 19788 if (normalizedCondition !== condition) { 19789 this.nonNormalizedIcuExpressions.push(conditionToken); 19790 } 19791 } 19792 this._requireCharCode($COMMA); 19793 this._attemptCharCodeUntilFn(isNotWhitespace); 19794 this._beginToken(7 /* TokenType.RAW_TEXT */); 19795 const type = this._readUntil($COMMA); 19796 this._endToken([type]); 19797 this._requireCharCode($COMMA); 19798 this._attemptCharCodeUntilFn(isNotWhitespace); 19799 } 19800 _consumeExpansionCaseStart() { 19801 this._beginToken(20 /* TokenType.EXPANSION_CASE_VALUE */); 19802 const value = this._readUntil($LBRACE).trim(); 19803 this._endToken([value]); 19804 this._attemptCharCodeUntilFn(isNotWhitespace); 19805 this._beginToken(21 /* TokenType.EXPANSION_CASE_EXP_START */); 19806 this._requireCharCode($LBRACE); 19807 this._endToken([]); 19808 this._attemptCharCodeUntilFn(isNotWhitespace); 19809 this._expansionCaseStack.push(21 /* TokenType.EXPANSION_CASE_EXP_START */); 19810 } 19811 _consumeExpansionCaseEnd() { 19812 this._beginToken(22 /* TokenType.EXPANSION_CASE_EXP_END */); 19813 this._requireCharCode($RBRACE); 19814 this._endToken([]); 19815 this._attemptCharCodeUntilFn(isNotWhitespace); 19816 this._expansionCaseStack.pop(); 19817 } 19818 _consumeExpansionFormEnd() { 19819 this._beginToken(23 /* TokenType.EXPANSION_FORM_END */); 19820 this._requireCharCode($RBRACE); 19821 this._endToken([]); 19822 this._expansionCaseStack.pop(); 19823 } 19824 /** 19825 * Consume a string that may contain interpolation expressions. 19826 * 19827 * The first token consumed will be of `tokenType` and then there will be alternating 19828 * `interpolationTokenType` and `tokenType` tokens until the `endPredicate()` returns true. 19829 * 19830 * If an interpolation token ends prematurely it will have no end marker in its `parts` array. 19831 * 19832 * @param textTokenType the kind of tokens to interleave around interpolation tokens. 19833 * @param interpolationTokenType the kind of tokens that contain interpolation. 19834 * @param endPredicate a function that should return true when we should stop consuming. 19835 * @param endInterpolation a function that should return true if there is a premature end to an 19836 * interpolation expression - i.e. before we get to the normal interpolation closing marker. 19837 */
19838 _consumeWithInterpolation(textTokenType, interpolationTokenType, endPredicate, endInterpolation) { 19839 this._beginToken(textTokenType); 19840 const parts = []; 19841 while (!endPredicate()) { 19842 const current = this._cursor.clone(); 19843 if (this._interpolationConfig && this._attemptStr(this._interpolationConfig.start)) { 19844 this._endToken([this._processCarriageReturns(parts.join(''))], current); 19845 parts.length = 0; 19846 this._consumeInterpolation(interpolationTokenType, current, endInterpolation); 19847 this._beginToken(textTokenType); 19848 } else if (this._cursor.peek() === $AMPERSAND) { 19849 this._endToken([this._processCarriageReturns(parts.join(''))]); 19850 parts.length = 0; 19851 this._consumeEntity(textTokenType); 19852 this._beginToken(textTokenType); 19853 } else { 19854 parts.push(this._readChar()); 19855 } 19856 } 19857 // It is possible that an interpolation was started but not ended inside this text token. 19858 // Make sure that we reset the state of the lexer correctly. 19859 this._inInterpolation = false; 19860 this._endToken([this._processCarriageReturns(parts.join(''))]); 19861 } 19862 /** 19863 * Consume a block of text that has been interpreted as an Angular interpolation. 19864 * 19865 * @param interpolationTokenType the type of the interpolation token to generate. 19866 * @param interpolationStart a cursor that points to the start of this interpolation. 19867 * @param prematureEndPredicate a function that should return true if the next characters indicate 19868 * an end to the interpolation before its normal closing marker. 19869 */ 19870 _consumeInterpolation(interpolationTokenType, interpolationStart, prematureEndPredicate) { 19871 const parts = []; 19872 this._beginToken(interpolationTokenType, interpolationStart); 19873 parts.push(this._interpolationConfig.start); 19874 // Find the end of the interpolation, ignoring content inside quotes. 19875 const expressionStart = this._cursor.clone(); 19876 let inQuote = null; 19877 let inComment = false; 19878 while (this._cursor.peek() !== $EOF && (prematureEndPredicate === null || !prematureEndPredicate())) { 19879 const current = this._cursor.clone(); 19880 if (this._isTagStart()) { 19881 // We are starting what looks like an HTML element in the middle of this interpolation. 19882 // Reset the cursor to before the `<` character and end the interpolation token. 19883 // (This is actually wrong but here for backward compatibility). 19884 this._cursor = current; 19885 parts.push(this._getProcessedChars(expressionStart, current)); 19886 this._endToken(parts); 19887 return; 19888 } 19889 if (inQuote === null) { 19890 if (this._attemptStr(this._interpolationConfig.end)) { 19891 // We are not in a string, and we hit the end interpolation marker 19892 parts.push(this._getProcessedChars(expressionStart, current)); 19893 parts.push(this._interpolationConfig.end); 19894 this._endToken(parts); 19895 return; 19896 } else if (this._attemptStr('//')) { 19897 // Once we are in a comment we ignore any quotes 19898 inComment = true; 19899 } 19900 } 19901 const char = this._cursor.peek(); 19902 this._cursor.advance(); 19903 if (char === $BACKSLASH) { 19904 // Skip the next character because it was escaped. 19905 this._cursor.advance(); 19906 } else if (char === inQuote) { 19907 // Exiting the current quoted string 19908 inQuote = null; 19909 } else if (!inComment && inQuote === null && isQuote(char)) { 19910 // Entering a new quoted string 19911 inQuote = char; 19912 } 19913 } 19914 // We hit EOF without finding a closing interpolation marker 19915 parts.push(this._getProcessedChars(expressionStart, this._cursor)); 19916 this._endToken(parts); 19917 } 19918 _getProcessedChars(start, end) { 19919 return this._processCarriageReturns(end.getChars(start)); 19920 } 19921 _isTextEnd() { 19922 if (this._isTagStart() || this._cursor.peek() === $EOF) { 19923 return true; 19924 } 19925 if (this._tokenizeIcu && !this._inInterpolation) { 19926 if (this.isExpansionFormStart()) { 19927 // start of an expansion form 19928 return true; 19929 } 19930 if (this._cursor.peek() === $RBRACE && this._isInExpansionCase()) { 19931 // end of and expansion case 19932 return true; 19933 } 19934 } 19935 if (this._tokenizeBlocks && !this._inInterpolation && !this._isInExpansion() && (this._cursor.peek() === $AT || this._cursor.peek() === $RBRACE)) { 19936 return true; 19937 } 19938 return false;
19939 } 19940 /** 19941 * Returns true if the current cursor is pointing to the start of a tag 19942 * (opening/closing/comments/cdata/etc). 19943 */ 19944 _isTagStart() { 19945 if (this._cursor.peek() === $LT) { 19946 // We assume that `<` followed by whitespace is not the start of an HTML element. 19947 const tmp = this._cursor.clone(); 19948 tmp.advance(); 19949 // If the next character is alphabetic, ! nor / then it is a tag start 19950 const code = tmp.peek(); 19951 if ($a <= code && code <= $z || $A <= code && code <= $Z || code === $SLASH || code === $BANG) { 19952 return true; 19953 } 19954 } 19955 return false; 19956 } 19957 _readUntil(char) { 19958 const start = this._cursor.clone(); 19959 this._attemptUntilChar(char); 19960 return this._cursor.getChars(start); 19961 } 19962 _isInExpansion() { 19963 return this._isInExpansionCase() || this._isInExpansionForm(); 19964 } 19965 _isInExpansionCase() { 19966 return this._expansionCaseStack.length > 0 && this._expansionCaseStack[this._expansionCaseStack.length - 1] === 21 /* TokenType.EXPANSION_CASE_EXP_START */; 19967 } 19968 _isInExpansionForm() { 19969 return this._expansionCaseStack.length > 0 && this._expansionCaseStack[this._expansionCaseStack.length - 1] === 19 /* TokenType.EXPANSION_FORM_START */; 19970 } 19971 isExpansionFormStart() { 19972 if (this._cursor.peek() !== $LBRACE) { 19973 return false; 19974 } 19975 if (this._interpolationConfig) { 19976 const start = this._cursor.clone(); 19977 const isInterpolation = this._attemptStr(this._interpolationConfig.start); 19978 this._cursor = start; 19979 return !isInterpolation; 19980 } 19981 return true; 19982 } 19983} 19984function isNotWhitespace(code) { 19985 return !isWhitespace(code) || code === $EOF; 19986} 19987function isNameEnd(code) { 19988 return isWhitespace(code) || code === $GT || code === $LT || code === $SLASH || code === $SQ || code === $DQ || code === $EQ || code === $EOF; 19989} 19990function isPrefixEnd(code) { 19991 return (code < $a || $z < code) && (code < $A || $Z < code) && (code < $0 || code > $9); 19992} 19993function isDigitEntityEnd(code) { 19994 return code === $SEMICOLON || code === $EOF || !isAsciiHexDigit(code); 19995} 19996function isNamedEntityEnd(code) { 19997 return code === $SEMICOLON || code === $EOF || !isAsciiLetter(code); 19998} 19999function isExpansionCaseStart(peek) { 20000 return peek !== $RBRACE; 20001} 20002function compareCharCodeCaseInsensitive(code1, code2) { 20003 return toUpperCaseCharCode(code1) === toUpperCaseCharCode(code2); 20004} 20005function toUpperCaseCharCode(code) { 20006 return code >= $a && code <= $z ? code - $a + $A : code; 20007} 20008function isBlockNameChar(code) { 20009 return isAsciiLetter(code) || isDigit(code) || code === $_; 20010} 20011function isBlockParameterChar(code) { 20012 return code !== $SEMICOLON && isNotWhitespace(code); 20013} 20014function mergeTextTokens(srcTokens) { 20015 const dstTokens = []; 20016 let lastDstToken = undefined; 20017 for (let i = 0; i < srcTokens.length; i++) { 20018 const token = srcTokens[i]; 20019 if (lastDstToken && lastDstToken.type === 5 /* TokenType.TEXT */ && token.type === 5 /* TokenType.TEXT */ || lastDstToken && lastDstToken.type === 16 /* TokenType.ATTR_VALUE_TEXT */ && token.type === 16 /* TokenType.ATTR_VALUE_TEXT */) { 20020 lastDstToken.parts[0] += token.parts[0]; 20021 lastDstToken.sourceSpan.end = token.sourceSpan.end; 20022 } else { 20023 lastDstToken = token; 20024 dstTokens.push(lastDstToken); 20025 } 20026 } 20027 return dstTokens; 20028} 20029class PlainCharacterCursor { 20030 constructor(fileOrCursor, range) { 20031 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "state", void 0); 20032 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "file", void 0); 20033 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "input", void 0); 20034 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "end", void 0); 20035 if (fileOrCursor instanceof PlainCharacterCursor) { 20036 this.file = fileOrCursor.file; 20037 this.input = fileOrCursor.input; 20038 this.end = fileOrCursor.end; 20039 const state = fileOrCursor.state; 20040 // Note: avoid using `{...fileOrCursor.state}` here as that has a severe performance penalty. 20041 // In ES5 bundles the object spread operator is translated into the `__assign` helper, which
20042 // is not optimized by VMs as efficiently as a raw object literal. Since this constructor is 20043 // called in tight loops, this difference matters. 20044 this.state = { 20045 peek: state.peek, 20046 offset: state.offset, 20047 line: state.line, 20048 column: state.column 20049 }; 20050 } else { 20051 if (!range) { 20052 throw new Error('Programming error: the range argument must be provided with a file argument.'); 20053 } 20054 this.file = fileOrCursor; 20055 this.input = fileOrCursor.content; 20056 this.end = range.endPos; 20057 this.state = { 20058 peek: -1, 20059 offset: range.startPos, 20060 line: range.startLine, 20061 column: range.startCol 20062 }; 20063 } 20064 } 20065 clone() { 20066 return new PlainCharacterCursor(this); 20067 } 20068 peek() { 20069 return this.state.peek; 20070 } 20071 charsLeft() { 20072 return this.end - this.state.offset; 20073 } 20074 diff(other) { 20075 return this.state.offset - other.state.offset; 20076 } 20077 advance() { 20078 this.advanceState(this.state); 20079 } 20080 init() { 20081 this.updatePeek(this.state); 20082 } 20083 getSpan(start, leadingTriviaCodePoints) { 20084 start = start || this; 20085 let fullStart = start; 20086 if (leadingTriviaCodePoints) { 20087 while (this.diff(start) > 0 && leadingTriviaCodePoints.indexOf(start.peek()) !== -1) { 20088 if (fullStart === start) { 20089 start = start.clone(); 20090 } 20091 start.advance(); 20092 } 20093 } 20094 const startLocation = this.locationFromCursor(start); 20095 const endLocation = this.locationFromCursor(this); 20096 const fullStartLocation = fullStart !== start ? this.locationFromCursor(fullStart) : startLocation; 20097 return new ParseSourceSpan(startLocation, endLocation, fullStartLocation); 20098 } 20099 getChars(start) { 20100 return this.input.substring(start.state.offset, this.state.offset); 20101 } 20102 charAt(pos) { 20103 return this.input.charCodeAt(pos); 20104 } 20105 advanceState(state) { 20106 if (state.offset >= this.end) { 20107 this.state = state; 20108 throw new CursorError('Unexpected character "EOF"', this); 20109 } 20110 const currentChar = this.charAt(state.offset); 20111 if (currentChar === $LF) { 20112 state.line++; 20113 state.column = 0; 20114 } else if (!isNewLine(currentChar)) { 20115 state.column++; 20116 } 20117 state.offset++; 20118 this.updatePeek(state); 20119 } 20120 updatePeek(state) { 20121 state.peek = state.offset >= this.end ? $EOF : this.charAt(state.offset); 20122 } 20123 locationFromCursor(cursor) { 20124 return new ParseLocation(cursor.file, cursor.state.offset, cursor.state.line, cursor.state.column); 20125 } 20126} 20127class EscapedCharacterCursor extends PlainCharacterCursor { 20128 constructor(fileOrCursor, range) { 20129 if (fileOrCursor instanceof EscapedCharacterCursor) { 20130 super(fileOrCursor); 20131 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "internalState", void 0); 20132 this.internalState = (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({}, fileOrCursor.internalState); 20133 } else { 20134 super(fileOrCursor, range); 20135 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "internalState", void 0); 20136 this.internalState = this.state; 20137 } 20138 } 20139 advance() { 20140 this.state = this.internalState; 20141 super.advance(); 20142 this.processEscapeSequence(); 20143 } 20144 init() { 20145 super.init(); 20146 this.processEscapeSequence(); 20147 } 20148 clone() { 20149 return new EscapedCharacterCursor(this); 20150 } 20151 getChars(start) { 20152 const cursor = start.clone(); 20153 let chars = ''; 20154 while (cursor.internalState.offset < this.internalState.offset) { 20155 chars += String.fromCodePoint(cursor.peek()); 20156 cursor.advance(); 20157 } 20158 return chars; 20159 } 20160 /** 20161 * Process the escape sequence that starts at the current position in the text. 20162 * 20163 * This method is called to ensure that `peek` has the unescaped value of escape sequences. 20164 */ 20165 processEscapeSequence() { 20166 const peek = () => this.internalState.peek; 20167 if (peek() === $BACKSLASH) { 20168 // We have hit an escape sequence so we need the internal state to become independent 20169 // of the external state. 20170 this.internalState = (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({}, this.state); 20171 // Move past the backslash 20172 this.advanceState(this.internalState); 20173 // First check for standard control char sequences 20174 if (peek() === $n) { 20175 this.state.peek = $LF; 20176 } else if (peek() === $r) { 20177 this.state.peek = $CR; 20178 } else if (peek() === $v) { 20179 this.state.peek = $VTAB; 20180 } else if (peek() === $t) { 20181 this.state.peek = $TAB; 20182 } else if (peek() === $b) { 20183 this.state.peek = $BSPACE; 20184 } else if (peek() === $f) { 20185 this.state.peek = $FF; 20186 } 20187 // Now consider more complex sequences 20188 else if (peek() === $u) { 20189 // Unicode code-point sequence 20190 this.advanceState(this.internalState); // advance past the `u` char 20191 if (peek() === $LBRACE) { 20192 // Variable length Unicode, e.g. `\x{123}` 20193 this.advanceState(this.internalState); // advance past the `{` char 20194 // Advance past the variable number of hex digits until we hit a `}` char 20195 const digitStart = this.clone(); 20196 let length = 0; 20197 while (peek() !== $RBRACE) { 20198 this.advanceState(this.internalState); 20199 length++; 20200 } 20201 this.state.peek = this.decodeHexDigits(digitStart, length); 20202 } else { 20203 // Fixed length Unicode, e.g. `\u1234` 20204 const digitStart = this.clone(); 20205 this.advanceState(this.internalState); 20206 this.advanceState(this.internalState); 20207 this.advanceState(this.internalState); 20208 this.state.peek = this.decodeHexDigits(digitStart, 4); 20209 } 20210 } else if (peek() === $x) { 20211 // Hex char code, e.g. `\x2F` 20212 this.advanceState(this.internalState); // advance past the `x` char 20213 const digitStart = this.clone(); 20214 this.advanceState(this.internalState); 20215 this.state.peek = this.decodeHexDigits(digitStart, 2); 20216 } else if (isOctalDigit(peek())) { 20217 // Octal char code, e.g. `\012`, 20218 let octal = ''; 20219 let length = 0; 20220 let previous = this.clone(); 20221 while (isOctalDigit(peek()) && length < 3) { 20222 previous = this.clone(); 20223 octal += String.fromCodePoint(peek()); 20224 this.advanceState(this.internalState); 20225 length++; 20226 } 20227 this.state.peek = parseInt(octal, 8); 20228 // Backup one char 20229 this.internalState = previous.internalState; 20230 } else if (isNewLine(this.internalState.peek)) { 20231 // Line continuation `\` followed by a new line 20232 this.advanceState(this.internalState); // advance over the newline 20233 this.state = this.internalState; 20234 } else { 20235 // If none of the `if` blocks were executed then we just have an escaped normal character. 20236 // In that case we just, effectively, skip the backslash from the character. 20237 this.state.peek = this.internalState.peek; 20238 } 20239 } 20240 } 20241 decodeHexDigits(start, length) { 20242 const hex = this.input.slice(start.internalState.offset, start.internalState.offset + length);
20243 const charCode = parseInt(hex, 16); 20244 if (!isNaN(charCode)) { 20245 return charCode; 20246 } else { 20247 start.state = start.internalState; 20248 throw new CursorError('Invalid hexadecimal escape sequence', start); 20249 } 20250 } 20251} 20252class CursorError { 20253 constructor(msg, cursor) { 20254 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "msg", void 0); 20255 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "cursor", void 0); 20256 this.msg = msg; 20257 this.cursor = cursor; 20258 } 20259} 20260class TreeError extends ParseError { 20261 static create(elementName, span, msg) { 20262 return new TreeError(elementName, span, msg); 20263 } 20264 constructor(elementName, span, msg) { 20265 super(span, msg); 20266 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "elementName", void 0); 20267 this.elementName = elementName; 20268 } 20269} 20270class ParseTreeResult { 20271 constructor(rootNodes, errors) { 20272 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "rootNodes", void 0); 20273 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "errors", void 0); 20274 this.rootNodes = rootNodes; 20275 this.errors = errors; 20276 } 20277} 20278let Parser$1 = class Parser { 20279 constructor(getTagDefinition) { 20280 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "getTagDefinition", void 0); 20281 this.getTagDefinition = getTagDefinition; 20282 } 20283 parse(source, url, options) { 20284 const tokenizeResult = tokenize(source, url, this.getTagDefinition, options); 20285 const parser = new _TreeBuilder(tokenizeResult.tokens, this.getTagDefinition); 20286 parser.build(); 20287 return new ParseTreeResult(parser.rootNodes, tokenizeResult.errors.concat(parser.errors)); 20288 } 20289}; 20290class _TreeBuilder { 20291 constructor(tokens, getTagDefinition) { 20292 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "tokens", void 0); 20293 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "getTagDefinition", void 0); 20294 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_index", -1); 20295 // `_peek` will be initialized by the call to `_advance()` in the constructor. 20296 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_peek", void 0); 20297 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_containerStack", []); 20298 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "rootNodes", []); 20299 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "errors", []); 20300 this.tokens = tokens; 20301 this.getTagDefinition = getTagDefinition; 20302 this._advance(); 20303 } 20304 build() { 20305 while (this._peek.type !== 33 /* TokenType.EOF */) { 20306 if (this._peek.type === 0 /* TokenType.TAG_OPEN_START */ || this._peek.type === 4 /* TokenType.INCOMPLETE_TAG_OPEN */) { 20307 this._consumeStartTag(this._advance()); 20308 } else if (this._peek.type === 3 /* TokenType.TAG_CLOSE */) { 20309 this._consumeEndTag(this._advance()); 20310 } else if (this._peek.type === 12 /* TokenType.CDATA_START */) { 20311 this._closeVoidElement(); 20312 this._consumeCdata(this._advance()); 20313 } else if (this._peek.type === 10 /* TokenType.COMMENT_START */) { 20314 this._closeVoidElement(); 20315 this._consumeComment(this._advance()); 20316 } else if (this._peek.type === 5 /* TokenType.TEXT */ || this._peek.type === 7 /* TokenType.RAW_TEXT */ || this._peek.type === 6 /* TokenType.ESCAPABLE_RAW_TEXT */) { 20317 this._closeVoidElement(); 20318 this._consumeText(this._advance()); 20319 } else if (this._peek.type === 19 /* TokenType.EXPANSION_FORM_START */) { 20320 this._consumeExpansion(this._advance()); 20321 } else if (this._peek.type === 24 /* TokenType.BLOCK_OPEN_START */) { 20322 this._closeVoidElement(); 20323 this._consumeBlockOpen(this._advance()); 20324 } else if (this._peek.type === 26 /* TokenType.BLOCK_CLOSE */) { 20325 this._closeVoidElement(); 20326 this._consumeBlockClose(this._advance()); 20327 } else if (this._peek.type === 28 /* TokenType.INCOMPLETE_BLOCK_OPEN */) { 20328 this._closeVoidElement(); 20329 this._consumeIncompleteBlock(this._advance()); 20330 } else if (this._peek.type === 29 /* TokenType.LET_START */) { 20331 this._closeVoidElement(); 20332 this._consumeLet(this._advance()); 20333 } else if (this._peek.type === 32 /* TokenType.INCOMPLETE_LET */) { 20334 this._closeVoidElement(); 20335 this._consumeIncompleteLet(this._advance()); 20336 } else { 20337 // Skip all other tokens... 20338 this._advance(); 20339 } 20340 } 20341 for (const leftoverContainer of this._containerStack) { 20342 // Unlike HTML elements, blocks aren't closed implicitly by the end of the file. 20343 if (leftoverContainer instanceof Block) { 20344 this.errors.push(TreeError.create(leftoverContainer.name, leftoverContainer.sourceSpan, `Unclosed block "${leftoverContainer.name}"`)); 20345 } 20346 } 20347 } 20348 _advance() { 20349 const prev = this._peek; 20350 if (this._index < this.tokens.length - 1) { 20351 // Note: there is always an EOF token at the end 20352 this._index++; 20353 } 20354 this._peek = this.tokens[this._index]; 20355 return prev; 20356 } 20357 _advanceIf(type) { 20358 if (this._peek.type === type) { 20359 return this._advance(); 20360 } 20361 return null; 20362 } 20363 _consumeCdata(_startToken) { 20364 this._consumeText(this._advance()); 20365 this._advanceIf(13 /* TokenType.CDATA_END */); 20366 } 20367 _consumeComment(token) { 20368 const text = this._advanceIf(7 /* TokenType.RAW_TEXT */); 20369 const endToken = this._advanceIf(11 /* TokenType.COMMENT_END */); 20370 const value = text != null ? text.parts[0].trim() : null; 20371 const sourceSpan = endToken == null ? token.sourceSpan : new ParseSourceSpan(token.sourceSpan.start, endToken.sourceSpan.end, token.sourceSpan.fullStart); 20372 this._addToParent(new Comment(value, sourceSpan)); 20373 } 20374 _consumeExpansion(token) { 20375 const switchValue = this._advance(); 20376 const type = this._advance(); 20377 const cases = []; 20378 // read = 20379 while (this._peek.type === 20 /* TokenType.EXPANSION_CASE_VALUE */) { 20380 const expCase = this._parseExpansionCase(); 20381 if (!expCase) return; // error 20382 cases.push(expCase); 20383 } 20384 // read the final } 20385 if (this._peek.type !== 23 /* TokenType.EXPANSION_FORM_END */) { 20386 this.errors.push(TreeError.create(null, this._peek.sourceSpan, `Invalid ICU message. Missing '}'.`)); 20387 return; 20388 } 20389 const sourceSpan = new ParseSourceSpan(token.sourceSpan.start, this._peek.sourceSpan.end, token.sourceSpan.fullStart); 20390 this._addToParent(new Expansion(switchValue.parts[0], type.parts[0], cases, sourceSpan, switchValue.sourceSpan)); 20391 this._advance(); 20392 } 20393 _parseExpansionCase() { 20394 const value = this._advance(); 20395 // read { 20396 if (this._peek.type !== 21 /* TokenType.EXPANSION_CASE_EXP_START */) { 20397 this.errors.push(TreeError.create(null, this._peek.sourceSpan, `Invalid ICU message. Missing '{'.`)); 20398 return null; 20399 } 20400 // read until } 20401 const start = this._advance(); 20402 const exp = this._collectExpansionExpTokens(start); 20403 if (!exp) return null; 20404 const end = this._advance(); 20405 exp.push({ 20406 type: 33 /* TokenType.EOF */, 20407 parts: [], 20408 sourceSpan: end.sourceSpan 20409 }); 20410 // parse everything in between { and } 20411 const expansionCaseParser = new _TreeBuilder(exp, this.getTagDefinition); 20412 expansionCaseParser.build(); 20413 if (expansionCaseParser.errors.length > 0) { 20414 this.errors = this.errors.concat(expansionCaseParser.errors); 20415 return null; 20416 } 20417 const sourceSpan = new ParseSourceSpan(value.sourceSpan.start, end.sourceSpan.end, value.sourceSpan.fullStart); 20418 const expSourceSpan = new ParseSourceSpan(start.sourceSpan.start, end.sourceSpan.end, start.sourceSpan.fullStart); 20419 return new ExpansionCase(value.parts[0], expansionCaseParser.rootNodes, sourceSpan, value.sourceSpan, expSourceSpan); 20420 } 20421 _collectExpansionExpTokens(start) { 20422 const exp = []; 20423 const expansionFormStack = [21 /* TokenType.EXPANSION_CASE_EXP_START */]; 20424 while (true) { 20425 if (this._peek.type === 19 /* TokenType.EXPANSION_FORM_START */ || this._peek.type === 21 /* TokenType.EXPANSION_CASE_EXP_START */) { 20426 expansionFormStack.push(this._peek.type); 20427 } 20428 if (this._peek.type === 22 /* TokenType.EXPANSION_CASE_EXP_END */) { 20429 if (lastOnStack(expansionFormStack, 21 /* TokenType.EXPANSION_CASE_EXP_START */)) { 20430 expansionFormStack.pop(); 20431 if (expansionFormStack.length === 0) return exp; 20432 } else { 20433 this.errors.push(TreeError.create(null, start.sourceSpan, `Invalid ICU message. Missing '}'.`)); 20434 return null; 20435 } 20436 } 20437 if (this._peek.type === 23 /* TokenType.EXPANSION_FORM_END */) { 20438 if (lastOnStack(expansionFormStack, 19 /* TokenType.EXPANSION_FORM_START */)) { 20439 expansionFormStack.pop(); 20440 } else { 20441 this.errors.push(TreeError.create(null, start.sourceSpan, `Invalid ICU message. Missing '}'.`)); 20442 return null; 20443 } 20444 } 20445 if (this._peek.type === 33 /* TokenType.EOF */) { 20446 this.errors.push(TreeError.create(null, start.sourceSpan, `Invalid ICU message. Missing '}'.`)); 20447 return null; 20448 } 20449 exp.push(this._advance()); 20450 } 20451 } 20452 _consumeText(token) { 20453 const tokens = [token]; 20454 const startSpan = token.sourceSpan; 20455 let text = token.parts[0]; 20456 if (text.length > 0 && text[0] === '\n') { 20457 const parent = this._getContainer(); 20458 if (parent != null && parent.children.length === 0 && this.getTagDefinition(parent.name).ignoreFirstLf) { 20459 text = text.substring(1); 20460 tokens[0] = { 20461 type: token.type, 20462 sourceSpan: token.sourceSpan, 20463 parts: [text] 20464 }; 20465 } 20466 } 20467 while (this._peek.type === 8 /* TokenType.INTERPOLATION */ || this._peek.type === 5 /* TokenType.TEXT */ || this._peek.type === 9 /* TokenType.ENCODED_ENTITY */) { 20468 token = this._advance(); 20469 tokens.push(token); 20470 if (token.type === 8 /* TokenType.INTERPOLATION */) { 20471 // For backward compatibility we decode HTML entities that appear in interpolation 20472 // expressions. This is arguably a bug, but it could be a considerable breaking change to 20473 // fix it. It should be addressed in a larger project to refactor the entire parser/lexer 20474 // chain after View Engine has been removed. 20475 text += token.parts.join('').replace(/&([^;]+);/g, decodeEntity); 20476 } else if (token.type === 9 /* TokenType.ENCODED_ENTITY */) { 20477 text += token.parts[0]; 20478 } else { 20479 text += token.parts.join(''); 20480 } 20481 } 20482 if (text.length > 0) { 20483 const endSpan = token.sourceSpan; 20484 this._addToParent(new Text(text, new ParseSourceSpan(start
20484Span.start, endSpan.end, startSpan.fullStart, startSpan.details), tokens)); 20485 } 20486 } 20487 _closeVoidElement() { 20488 const el = this._getContainer(); 20489 if (el instanceof Element && this.getTagDefinition(el.name).isVoid) { 20490 this._containerStack.pop(); 20491 } 20492 } 20493 _consumeStartTag(startTagToken) { 20494 const [prefix, name] = startTagToken.parts; 20495 const attrs = []; 20496 while (this._peek.type === 14 /* TokenType.ATTR_NAME */) { 20497 attrs.push(this._consumeAttr(this._advance())); 20498 } 20499 const fullName = this._getElementFullName(prefix, name, this._getClosestParentElement()); 20500 let selfClosing = false; 20501 // Note: There could have been a tokenizer error 20502 // so that we don't get a token for the end tag... 20503 if (this._peek.type === 2 /* TokenType.TAG_OPEN_END_VOID */) { 20504 this._advance(); 20505 selfClosing = true; 20506 const tagDef = this.getTagDefinition(fullName); 20507 if (!(tagDef.canSelfClose || getNsPrefix(fullName) !== null || tagDef.isVoid)) { 20508 this.errors.push(TreeError.create(fullName, startTagToken.sourceSpan, `Only void, custom and foreign elements can be self closed "${startTagToken.parts[1]}"`)); 20509 } 20510 } else if (this._peek.type === 1 /* TokenType.TAG_OPEN_END */) { 20511 this._advance(); 20512 selfClosing = false; 20513 } 20514 const end = this._peek.sourceSpan.fullStart; 20515 const span = new ParseSourceSpan(startTagToken.sourceSpan.start, end, startTagToken.sourceSpan.fullStart); 20516 // Create a separate `startSpan` because `span` will be modified when there is an `end` span. 20517 const startSpan = new ParseSourceSpan(startTagToken.sourceSpan.start, end, startTagToken.sourceSpan.fullStart); 20518 const el = new Element(fullName, attrs, [], span, startSpan, undefined); 20519 const parentEl = this._getContainer(); 20520 this._pushContainer(el, parentEl instanceof Element && this.getTagDefinition(parentEl.name).isClosedByChild(el.name)); 20521 if (selfClosing) { 20522 // Elements that are self-closed have their `endSourceSpan` set to the full span, as the 20523 // element start tag also represents the end tag. 20524 this._popContainer(fullName, Element, span); 20525 } else if (startTagToken.type === 4 /* TokenType.INCOMPLETE_TAG_OPEN */) { 20526 // We already know the opening tag is not complete, so it is unlikely it has a corresponding 20527 // close tag. Let's optimistically parse it as a full element and emit an error. 20528 this._popContainer(fullName, Element, null); 20529 this.errors.push(TreeError.create(fullName, span, `Opening tag "${fullName}" not terminated.`)); 20530 } 20531 } 20532 _pushContainer(node, isClosedByChild) { 20533 if (isClosedByChild) { 20534 this._containerStack.pop(); 20535 } 20536 this._addToParent(node); 20537 this._containerStack.push(node); 20538 } 20539 _consumeEndTag(endTagToken) { 20540 const fullName = this._getElementFullName(endTagToken.parts[0], endTagToken.parts[1], this._getClosestParentElement()); 20541 if (this.getTagDefinition(fullName).isVoid) { 20542 this.errors.push(TreeError.create(fullName, endTagToken.sourceSpan, `Void elements do not have end tags "${endTagToken.parts[1]}"`)); 20543 } else if (!this._popContainer(fullName, Element, endTagToken.sourceSpan)) { 20544 const errMsg = `Unexpected closing tag "${fullName}". It may happen when the tag has already been closed by another tag. For more info see https://www.w3.org/TR/html5/syntax.html#closing-elements-that-have-implied-end-tags`; 20545 this.errors.push(TreeError.create(fullName, endTagToken.sourceSpan, errMsg)); 20546 } 20547 } 20548 /** 20549 * Closes the nearest element with the tag name `fullName` in the parse tree. 20550 * `endSourceSpan` is the span of the closing tag, or null if the element does 20551 * not have a closing tag (for example, this happens when an incomplete 20552 * opening tag is recovered). 20553 */ 20554 _popContainer(expectedName, expectedType, endSourceSpan) { 20555 let unexpectedCloseTagDetected = false; 20556 for (let stackIndex = this._containerStack.length - 1; stackIndex >= 0; stackIndex--) { 20557 const node = this._containerStack[stackIndex]; 20558 if ((node.name === expectedName || expectedName === null) && node instanceof expectedType) { 20559 // Record the parse span with the element that is being closed. Any elements that are 20560 // removed from the element stack at this point are closed implicitly, so they won't get 20561 // an end source span (as there is no explicit closing element). 20562 node.endSourceSpan = endSourceSpan; 20563 node.sourceSpan.end = endSourceSpan !== null ? endSourceSpan.end : node.sourceSpan.end; 20564 this._containerStack.splice(stackIndex, this._containerStack.length - stackIndex); 20565 return !unexpectedCloseTagDetected; 20566 } 20567 // Blocks and most elements are not self closing. 20568 if (node instanceof Block || node instanceof Element && !this.getTagDefinition(node.name).closedByParent) { 20569 // Note that we encountered an unexpected close tag but continue processing the element 20570 // stack so we can assign an `endSourceSpan` if there is a corresponding start tag for this 20571 // end tag in the stack. 20572 unexpectedCloseTagDetected = true; 20573 } 20574 } 20575 return false;
20576 } 20577 _consumeAttr(attrName) { 20578 const fullName = mergeNsAndName(attrName.parts[0], attrName.parts[1]); 20579 let attrEnd = attrName.sourceSpan.end; 20580 // Consume any quote 20581 if (this._peek.type === 15 /* TokenType.ATTR_QUOTE */) { 20582 this._advance(); 20583 } 20584 // Consume the attribute value 20585 let value = ''; 20586 const valueTokens = []; 20587 let valueStartSpan = undefined; 20588 let valueEnd = undefined; 20589 // NOTE: We need to use a new variable `nextTokenType` here to hide the actual type of 20590 // `_peek.type` from TS. Otherwise TS will narrow the type of `_peek.type` preventing it from 20591 // being able to consider `ATTR_VALUE_INTERPOLATION` as an option. This is because TS is not 20592 // able to see that `_advance()` will actually mutate `_peek`. 20593 const nextTokenType = this._peek.type; 20594 if (nextTokenType === 16 /* TokenType.ATTR_VALUE_TEXT */) { 20595 valueStartSpan = this._peek.sourceSpan; 20596 valueEnd = this._peek.sourceSpan.end; 20597 while (this._peek.type === 16 /* TokenType.ATTR_VALUE_TEXT */ || this._peek.type === 17 /* TokenType.ATTR_VALUE_INTERPOLATION */ || this._peek.type === 9 /* TokenType.ENCODED_ENTITY */) { 20598 const valueToken = this._advance(); 20599 valueTokens.push(valueToken); 20600 if (valueToken.type === 17 /* TokenType.ATTR_VALUE_INTERPOLATION */) { 20601 // For backward compatibility we decode HTML entities that appear in interpolation 20602 // expressions. This is arguably a bug, but it could be a considerable breaking change to 20603 // fix it. It should be addressed in a larger project to refactor the entire parser/lexer 20604 // chain after View Engine has been removed. 20605 value += valueToken.parts.join('').replace(/&([^;]+);/g, decodeEntity); 20606 } else if (valueToken.type === 9 /* TokenType.ENCODED_ENTITY */) { 20607 value += valueToken.parts[0]; 20608 } else { 20609 value += valueToken.parts.join(''); 20610 } 20611 valueEnd = attrEnd = valueToken.sourceSpan.end; 20612 } 20613 } 20614 // Consume any quote 20615 if (this._peek.type === 15 /* TokenType.ATTR_QUOTE */) { 20616 const quoteToken = this._advance(); 20617 attrEnd = quoteToken.sourceSpan.end; 20618 } 20619 const valueSpan = valueStartSpan && valueEnd && new ParseSourceSpan(valueStartSpan.start, valueEnd, valueStartSpan.fullStart); 20620 return new Attribute(fullName, value, new ParseSourceSpan(attrName.sourceSpan.start, attrEnd, attrName.sourceSpan.fullStart), attrName.sourceSpan, valueSpan, valueTokens.length > 0 ? valueTokens : undefined, undefined); 20621 } 20622 _consumeBlockOpen(token) { 20623 const parameters = []; 20624 while (this._peek.type === 27 /* TokenType.BLOCK_PARAMETER */) { 20625 const paramToken = this._advance(); 20626 parameters.push(new BlockParameter(paramToken.parts[0], paramToken.sourceSpan)); 20627 } 20628 if (this._peek.type === 25 /* TokenType.BLOCK_OPEN_END */) { 20629 this._advance(); 20630 } 20631 const end = this._peek.sourceSpan.fullStart; 20632 const span = new ParseSourceSpan(token.sourceSpan.start, end, token.sourceSpan.fullStart); 20633 // Create a separate `startSpan` because `span` will be modified when there is an `end` span. 20634 const startSpan = new ParseSourceSpan(token.sourceSpan.start, end, token.sourceSpan.fullStart); 20635 const block = new Block(token.parts[0], parameters, [], span, token.sourceSpan, startSpan); 20636 this._pushContainer(block, false); 20637 } 20638 _consumeBlockClose(token) { 20639 if (!this._popContainer(null, Block, token.sourceSpan)) { 20640 this.errors.push(TreeError.create(null, token.sourceSpan, `Unexpected closing block. The block may have been closed earlier. ` + `If you meant to write the } character, you should use the "}" ` + `HTML entity instead.`)); 20641 } 20642 } 20643 _consumeIncompleteBlock(token) { 20644 const parameters = []; 20645 while (this._peek.type === 27 /* TokenType.BLOCK_PARAMETER */) { 20646 const paramToken = this._advance(); 20647 parameters.push(new BlockParameter(paramToken.parts[0], paramToken.sourceSpan)); 20648 } 20649 const end = this._peek.sourceSpan.fullStart; 20650 const span = new ParseSourceSpan(token.sourceSpan.start, end, token.sourceSpan.fullStart); 20651 // Create a separate `startSpan` because `span` will be modified when there is an `end` span. 20652 const startSpan = new ParseSourceSpan(token.sourceSpan.start, end, token.sourceSpan.fullStart); 20653 const block = new Block(token.parts[0], parameters, [], span, token.sourceSpan, startSpan); 20654 this._pushContainer(block, false); 20655 // Incomplete blocks don't have children so we close them immediately and report an error. 20656 this._popContainer(null, Block, null); 20657 this.errors.push(TreeError.create(token.parts[0], span, `Incomplete block "${token.parts[0]}". If you meant to write the @ character, ` + `you should use the "@" HTML entity instead.`)); 20658 } 20659 _consumeLet(startToken) { 20660 const name = startToken.parts[0]; 20661 let valueToken; 20662 let endToken; 20663 if (this._peek.type !== 30 /* TokenType.LET_VALUE */) { 20664 this.errors.push(TreeError.create(startToken.parts[0], startToken.sourceSpan, `Invalid @let declaration "${name}". Declaration must have a value.`)); 20665 return; 20666 } else { 20667 valueToken = this._advance(); 20668 } 20669 // Type cast is necessary here since TS narrowed the type of `peek` above. 20670 if (this._peek.type !== 31 /* TokenType.LET_END */) { 20671 this.errors.push(TreeError.create(startToken.parts[0], startToken.sourceSpan, `Unterminated @let declaration "${name}". Declaration must be terminated with a semicolon.`)); 20672 return; 20673 } else { 20674 endToken = this._advance(); 20675 } 20676 const end = endToken.sourceSpan.fullStart; 20677 const span = new ParseSourceSpan(startToken.sourceSpan.start, end, startToken.sourceSpan.fullStart); 20678 // The start token usually captures the `@let`. Construct a name span by 20679 // offsetting the start by the length of any text before the name. 20680 const startOffset = startToken.sourceSpan.toString().lastIndexOf(name); 20681 const nameStart = startToken.sourceSpan.start.moveBy(startOffset); 20682 const nameSpan = new ParseSourceSpan(nameStart, startToken.sourceSpan.end); 20683 const node = new LetDeclaration(name, valueToken.parts[0], span, nameSpan, valueToken.sourceSpan); 20684 this._addToParent(node); 20685 } 20686 _consumeIncompleteLet(token) { 20687 var _token$parts$; 20688 // Incomplete `@let` declaration may end up with an empty name. 20689 const name = (_token$parts$ = token.parts[0]) !== null && _token$parts$ !== void 0 ? _token$parts$ : ''; 20690 const nameString = name ? ` "${name}"` : ''; 20691 // If there's at least a name, we can salvage an AST node that can be used for c
20691ompletions. 20692 if (name.length > 0) { 20693 const startOffset = token.sourceSpan.toString().lastIndexOf(name); 20694 const nameStart = token.sourceSpan.start.moveBy(startOffset); 20695 const nameSpan = new ParseSourceSpan(nameStart, token.sourceSpan.end); 20696 const valueSpan = new ParseSourceSpan(token.sourceSpan.start, token.sourceSpan.start.moveBy(0)); 20697 const node = new LetDeclaration(name, '', token.sourceSpan, nameSpan, valueSpan); 20698 this._addToParent(node); 20699 } 20700 this.errors.push(TreeError.create(token.parts[0], token.sourceSpan, `Incomplete @let declaration${nameString}. ` + `@let declarations must be written as \`@let <name> = <value>;\``)); 20701 } 20702 _getContainer() { 20703 return this._containerStack.length > 0 ? this._containerStack[this._containerStack.length - 1] : null; 20704 } 20705 _getClosestParentElement() { 20706 for (let i = this._containerStack.length - 1; i > -1; i--) { 20707 if (this._containerStack[i] instanceof Element) { 20708 return this._containerStack[i]; 20709 } 20710 } 20711 return null; 20712 } 20713 _addToParent(node) { 20714 const parent = this._getContainer(); 20715 if (parent === null) { 20716 this.rootNodes.push(node); 20717 } else { 20718 parent.children.push(node); 20719 } 20720 } 20721 _getElementFullName(prefix, localName, parentElement) { 20722 if (prefix === '') { 20723 prefix = this.getTagDefinition(localName).implicitNamespacePrefix || ''; 20724 if (prefix === '' && parentElement != null) { 20725 const parentTagName = splitNsName(parentElement.name)[1]; 20726 const parentTagDefinition = this.getTagDefinition(parentTagName); 20727 if (!parentTagDefinition.preventNamespaceInheritance) { 20728 prefix = getNsPrefix(parentElement.name); 20729 } 20730 } 20731 } 20732 return mergeNsAndName(prefix, localName); 20733 } 20734} 20735function lastOnStack(stack, element) { 20736 return stack.length > 0 && stack[stack.length - 1] === element; 20737} 20738/** 20739 * Decode the `entity` string, which we believe is the contents of an HTML entity. 20740 * 20741 * If the string is not actually a valid/known entity then just return the original `match` string. 20742 */ 20743function decodeEntity(match, entity) { 20744 if (NAMED_ENTITIES[entity] !== undefined) { 20745 return NAMED_ENTITIES[entity] || match; 20746 } 20747 if (/^#x[a-f0-9]+$/i.test(entity)) { 20748 return String.fromCodePoint(parseInt(entity.slice(2), 16)); 20749 } 20750 if (/^#\d+$/.test(entity)) { 20751 return String.fromCodePoint(parseInt(entity.slice(1), 10)); 20752 } 20753 return match; 20754} 20755const PRESERVE_WS_ATTR_NAME = 'ngPreserveWhitespaces'; 20756const SKIP_WS_TRIM_TAGS = new Set(['pre', 'template', 'textarea', 'script', 'style']); 20757// Equivalent to \s with \u00a0 (non-breaking space) excluded. 20758// Based on https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp 20759const WS_CHARS = ' \f\n\r\t\v\u1680\u180e\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff'; 20760const NO_WS_REGEXP = new RegExp(`[^${WS_CHARS}]`); 20761const WS_REPLACE_REGEXP = new RegExp(`[${WS_CHARS}]{2,}`, 'g'); 20762function hasPreserveWhitespacesAttr(attrs) { 20763 return attrs.some(attr => attr.name === PRESERVE_WS_ATTR_NAME); 20764} 20765/** 20766 * &ngsp; is a placeholder for non-removable space 20767 * &ngsp; is converted to the 0xE500 PUA (Private Use Areas) unicode character 20768 * and later on replaced by a space. 20769 */ 20770function replaceNgsp(value) { 20771 // lexer is replacing the &ngsp; pseudo-entity with NGSP_UNICODE 20772 return value.replace(new RegExp(NGSP_UNICODE, 'g'), ' '); 20773} 20774/** 20775 * This visitor can walk HTML parse tree and remove / trim text nodes using the following rules: 20776 * - consider spaces, tabs and new lines as whitespace characters; 20777 * - drop text nodes consisting of whitespace characters only; 20778 * - for all other text nodes replace consecutive whitespace characters with one space; 20779 * - convert &ngsp; pseudo-entity to a single space; 20780 * 20781 * Removal and trimming of whitespaces have positive performance impact (less code to generate 20782 * while compiling templates, faster view creation). At the same time it can be "destructive" 20783 * in some cases (whitespaces can influence layout). Because of the potential of breaking layout 20784 * this visitor is not activated by default in Angular 5 and people need to explicitly opt-in for 20785 * whitespace removal. The default option for whitespace removal will be revisited in Angular 6 20786 * and might be changed to "on" by default. 20787 * 20788 * If `originalNodeMap` is provided, the transformed nodes will be mapped back to their original 20789 * inputs. Any output nodes not in the map were not transformed. This supports correlating and 20790 * porting information between the trimmed nodes and original nodes (such as `i18n` properties) 20791 * such that trimming whitespace does not does not drop required information from the node. 20792 */ 20793class WhitespaceVisitor { 20794 constructor(preserveSignificantWhitespace, originalNodeMap, requireContext = true) { 20795 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "preserveSignificantWhitespace", void 0); 20796 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "originalNodeMap", void 0); 20797 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "requireContext", void 0); 20798 // How many ICU expansions which are currently being visited. ICUs can be nested, so this 20799 // tracks the current depth of nesting. If this depth is greater than 0, then this visitor is 20800 // currently processing content inside an ICU expansion. 20801 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "icuExpansionDepth", 0); 20802 this.preserveSignificantWhitespace = preserveSignificantWhitespace; 20803 this.originalNodeMap = originalNodeMap; 20804 this.requireContext = requireContext; 20805 } 20806 visitElement(element, context) { 20807 var _this$originalNodeMap2; 20808 if (SKIP_WS_TRIM_TAGS.has(element.name) || hasPreserveWhitespace
20808sAttr(element.attrs)) { 20809 var _this$originalNodeMap; 20810 // don't descent into elements where we need to preserve whitespaces 20811 // but still visit all attributes to eliminate one used as a market to preserve WS 20812 const newElement = new Element(element.name, visitAllWithSiblings(this, element.attrs), element.children, element.sourceSpan, element.startSourceSpan, element.endSourceSpan, element.i18n); 20813 (_this$originalNodeMap = this.originalNodeMap) === null || _this$originalNodeMap === void 0 || _this$originalNodeMap.set(newElement, element); 20814 return newElement; 20815 } 20816 const newElement = new Element(element.name, element.attrs, visitAllWithSiblings(this, element.children), element.sourceSpan, element.startSourceSpan, element.endSourceSpan, element.i18n); 20817 (_this$originalNodeMap2 = this.originalNodeMap) === null || _this$originalNodeMap2 === void 0 || _this$originalNodeMap2.set(newElement, element); 20818 return newElement; 20819 } 20820 visitAttribute(attribute, context) { 20821 return attribute.name !== PRESERVE_WS_ATTR_NAME ? attribute : null; 20822 } 20823 visitText(text, context) { 20824 const isNotBlank = text.value.match(NO_WS_REGEXP); 20825 const hasExpansionSibling = context && (context.prev instanceof Expansion || context.next instanceof Expansion); 20826 // Do not trim whitespace within ICU expansions when preserving significant whitespace. 20827 // Historically, ICU whitespace was never trimmed and this is really a bug. However fixing it 20828 // would change message IDs which we can't easily do. Instead we only trim ICU whitespace within 20829 // ICU expansions when not preserving significant whitespace, which is the new behavior where it 20830 // most matters. 20831 const inIcuExpansion = this.icuExpansionDepth > 0; 20832 if (inIcuExpansion && this.preserveSignificantWhitespace) return text; 20833 if (isNotBlank || hasExpansionSibling) { 20834 var _this$originalNodeMap3; 20835 // Process the whitespace in the tokens of this Text node 20836 const tokens = text.tokens.map(token => token.type === 5 /* TokenType.TEXT */ ? createWhitespaceProcessedTextToken(token) : token); 20837 // Fully trim message when significant whitespace is not preserved. 20838 if (!this.preserveSignificantWhitespace && tokens.length > 0) { 20839 // The first token should only call `.trimStart()` and the last token 20840 // should only call `.trimEnd()`, but there might be only one token which 20841 // needs to call both. 20842 const firstToken = tokens[0]; 20843 tokens.splice(0, 1, trimLeadingWhitespace(firstToken, context)); 20844 const lastToken = tokens[tokens.length - 1]; // Could be the same as the first token. 20845 tokens.splice(tokens.length - 1, 1, trimTrailingWhitespace(lastToken, context)); 20846 } 20847 // Process the whitespace of the value of this Text node. Also trim the leading/trailing 20848 // whitespace when we don't need to preserve significant whitespace. 20849 const processed = processWhitespace(text.value); 20850 const value = this.preserveSignificantWhitespace ? processed : trimLeadingAndTrailingWhitespace(processed, context); 20851 const result = new Text(value, text.sourceSpan, tokens, text.i18n); 20852 (_this$originalNodeMap3 = this.originalNodeMap) === null || _this$originalNodeMap3 === void 0 || _this$originalNodeMap3.set(result, text); 20853 return result; 20854 } 20855 return null; 20856 } 20857 visitComment(comment, context) { 20858 return comment; 20859 } 20860 visitExpansion(expansion, context) { 20861 var _this$originalNodeMap4; 20862 this.icuExpansionDepth++; 20863 let newExpansion; 20864 try { 20865 newExpansion = new Expansion(expansion.switchValue, expansion.type, visitAllWithSiblings(this, expansion.cases), expansion.sourceSpan, expansion.switchValueSourceSpan, expansion.i18n); 20866 } finally { 20867 this.icuExpansionDepth--; 20868 } 20869 (_this$originalNodeMap4 = this.originalNodeMap) === null || _this$originalNodeMap4 === void 0 || _this$originalNodeMap4.set(newExpansion, expansion); 20870 return newExpansion; 20871 } 20872 visitExpansionCase(expansionCase, context) { 20873 var _this$originalNodeMap5; 20874 const newExpansionCase = new ExpansionCase(expansionCase.value, visitAllWithSiblings(this, expansionCase.expression), expansionCase.sourceSpan, expansionCase.valueSourceSpan, expansionCase.expSourceSpan); 20875 (_this$originalNodeMap5 = this.originalNodeMap) === null || _this$originalNodeMap5 === void 0 || _this$originalNodeMap5.set(newExpansionCase, expansionCase); 20876 return newExpansionCase; 20877 } 20878 visitBlock(block, context) { 20879 var _this$originalNodeMap6; 20880 const newBlock = new Block(block.name, block.parameters, visitAllWithSiblings(this, block.children), block.sourceSpan, block.nameSpan, block.startSourceSpan, block.endSourceSpan); 20881 (_this$originalNodeMap6 = this.originalNodeMap) === null || _this$originalNodeMap6 === void 0 || _this$originalNodeMap6.set(newBlock, block); 20882 return newBlock; 20883 } 20884 visitBlockParameter(parameter, context) { 20885 return parameter; 20886 } 20887 visitLetDeclaration(decl, context) { 20888 return decl; 20889 } 20890 visit(_node, context) { 20891 // `visitAllWithSiblings` provides context necessary for ICU messages to be handled correctly. 20892 // Prefer that over calling `html.visitAll` directly on this visitor. 20893 if (this.requireContext && !context) { 20894 throw new Error(`WhitespaceVisitor requires context. Visit via \`visitAllWithSiblings\` to get this context.`); 20895 } 20896 return false;
20897 } 20898} 20899function trimLeadingWhitespace(token, context) { 20900 if (token.type !== 5 /* TokenType.TEXT */) return token; 20901 const isFirstTokenInTag = !(context !== null && context !== void 0 && context.prev); 20902 if (!isFirstTokenInTag) return token; 20903 return transformTextToken(token, text => text.trimStart()); 20904} 20905function trimTrailingWhitespace(token, context) { 20906 if (token.type !== 5 /* TokenType.TEXT */) return token; 20907 const isLastTokenInTag = !(context !== null && context !== void 0 && context.next); 20908 if (!isLastTokenInTag) return token; 20909 return transformTextToken(token, text => text.trimEnd()); 20910} 20911function trimLeadingAndTrailingWhitespace(text, context) { 20912 const isFirstTokenInTag = !(context !== null && context !== void 0 && context.prev); 20913 const isLastTokenInTag = !(context !== null && context !== void 0 && context.next); 20914 const maybeTrimmedStart = isFirstTokenInTag ? text.trimStart() : text; 20915 const maybeTrimmed = isLastTokenInTag ? maybeTrimmedStart.trimEnd() : maybeTrimmedStart; 20916 return maybeTrimmed; 20917} 20918function createWhitespaceProcessedTextToken({ 20919 type, 20920 parts, 20921 sourceSpan 20922}) { 20923 return { 20924 type, 20925 parts: [processWhitespace(parts[0])], 20926 sourceSpan 20927 }; 20928} 20929function transformTextToken({ 20930 type, 20931 parts, 20932 sourceSpan 20933}, transform) { 20934 // `TextToken` only ever has one part as defined in its type, so we just transform the first element. 20935 return { 20936 type, 20937 parts: [transform(parts[0])], 20938 sourceSpan 20939 }; 20940} 20941function processWhitespace(text) { 20942 return replaceNgsp(text).replace(WS_REPLACE_REGEXP, ' '); 20943} 20944function visitAllWithSiblings(visitor, nodes) { 20945 const result = []; 20946 nodes.forEach((ast, i) => { 20947 const context = { 20948 prev: nodes[i - 1], 20949 next: nodes[i + 1] 20950 }; 20951 const astResult = ast.visit(visitor, context); 20952 if (astResult) { 20953 result.push(astResult); 20954 } 20955 }); 20956 return result; 20957} 20958var TokenType = /*#__PURE__*/function (TokenType) { 20959 TokenType[TokenType["Character"] = 0] = "Character"; 20960 TokenType[TokenType["Identifier"] = 1] = "Identifier"; 20961 TokenType[TokenType["PrivateIdentifier"] = 2] = "PrivateIdentifier"; 20962 TokenType[TokenType["Keyword"] = 3] = "Keyword"; 20963 TokenType[TokenType["String"] = 4] = "String"; 20964 TokenType[TokenType["Operator"] = 5] = "Operator"; 20965 TokenType[TokenType["Number"] = 6] = "Number"; 20966 TokenType[TokenType["Error"] = 7] = "Error"; 20967 return TokenType; 20968}(TokenType || {}); 20969var StringTokenKind = /*#__PURE__*/function (StringTokenKind) { 20970 StringTokenKind[StringTokenKind["Plain"] = 0] = "Plain"; 20971 StringTokenKind[StringTokenKind["TemplateLiteralPart"] = 1] = "TemplateLiteralPart"; 20972 StringTokenKind[StringTokenKind["TemplateLiteralEnd"] = 2] = "TemplateLiteralEnd"; 20973 return StringTokenKind; 20974}(StringTokenKind || {}); 20975const KEYWORDS = ['var', 'let', 'as', 'null', 'undefined', 'true', 'false', 'if', 'else', 'this', 'typeof']; 20976class Lexer { 20977 tokenize(text) { 20978 return new _Scanner(text).scan(); 20979 } 20980} 20981class Token { 20982 constructor(index, end, type, numValue, strValue) { 20983 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "index", void 0); 20984 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "end", void 0); 20985 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "type", void 0); 20986 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "numValue", void 0); 20987 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "strValue", void 0); 20988 this.index = index; 20989 this.end = end; 20990 this.type = type; 20991 this.numValue = numValue; 20992 this.strValue = strValue; 20993 } 20994 isCharacter(code) { 20995 return this.type === TokenType.Character && this.numValue === code; 20996 } 20997 isNumber() { 20998 return this.type === TokenType.Number; 20999 } 21000 isString() { 21001 return this.type === TokenType.String; 21002 } 21003 isOperator(operator) { 21004 return this.type === TokenType.Operator && this.strValue === operator; 21005 } 21006 isIdentifier() { 21007 return this.type === TokenType.Identifier; 21008 } 21009 isPrivateIdentifier() { 21010 return this.type === TokenType.PrivateIdentifier; 21011 } 21012 isKeyword() { 21013 return this.type === TokenType.Keyword; 21014 } 21015 isKeywordLet() { 21016 return this.type === TokenType.Keyword && this.strValue === 'let'; 21017 } 21018 isKeywordAs() { 21019 return this.type === TokenType.Keyword && this.strValue === 'as'; 21020 } 21021 isKeywordNull() { 21022 return this.type === TokenType.Keyword && this.strValue === 'null';
21023 } 21024 isKeywordUndefined() { 21025 return this.type === TokenType.Keyword && this.strValue === 'undefined'; 21026 } 21027 isKeywordTrue() { 21028 return this.type === TokenType.Keyword && this.strValue === 'true'; 21029 } 21030 isKeywordFalse() { 21031 return this.type === TokenType.Keyword && this.strValue === 'false'; 21032 } 21033 isKeywordThis() { 21034 return this.type === TokenType.Keyword && this.strValue === 'this'; 21035 } 21036 isKeywordTypeof() { 21037 return this.type === TokenType.Keyword && this.strValue === 'typeof'; 21038 } 21039 isError() { 21040 return this.type === TokenType.Error; 21041 } 21042 toNumber() { 21043 return this.type === TokenType.Number ? this.numValue : -1; 21044 } 21045 isTemplateLiteralPart() { 21046 return this.isString() && this.kind === StringTokenKind.TemplateLiteralPart; 21047 } 21048 isTemplateLiteralEnd() { 21049 return this.isString() && this.kind === StringTokenKind.TemplateLiteralEnd; 21050 } 21051 isTemplateLiteralInterpolationStart() { 21052 return this.isOperator('${'); 21053 } 21054 isTemplateLiteralInterpolationEnd() { 21055 return this.isOperator('}'); 21056 } 21057 toString() { 21058 switch (this.type) { 21059 case TokenType.Character: 21060 case TokenType.Identifier: 21061 case TokenType.Keyword: 21062 case TokenType.Operator: 21063 case TokenType.PrivateIdentifier: 21064 case TokenType.String: 21065 case TokenType.Error: 21066 return this.strValue; 21067 case TokenType.Number: 21068 return this.numValue.toString(); 21069 default: 21070 return null; 21071 } 21072 } 21073} 21074class StringToken extends Token { 21075 constructor(index, end, strValue, kind) { 21076 super(index, end, TokenType.String, 0, strValue); 21077 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "kind", void 0); 21078 this.kind = kind; 21079 } 21080} 21081function newCharacterToken(index, end, code) { 21082 return new Token(index, end, TokenType.Character, code, String.fromCharCode(code)); 21083} 21084function newIdentifierToken(index, end, text) { 21085 return new Token(index, end, TokenType.Identifier, 0, text); 21086} 21087function newPrivateIdentifierToken(index, end, text) { 21088 return new Token(index, end, TokenType.PrivateIdentifier, 0, text); 21089} 21090function newKeywordToken(index, end, text) { 21091 return new Token(index, end, TokenType.Keyword, 0, text); 21092} 21093function newOperatorToken(index, end, text) { 21094 return new Token(index, end, TokenType.Operator, 0, text); 21095} 21096function newNumberToken(index, end, n) { 21097 return new Token(index, end, TokenType.Number, n, ''); 21098} 21099function newErrorToken(index, end, message) { 21100 return new Token(index, end, TokenType.Error, 0, message); 21101} 21102const EOF = new Token(-1, -1, TokenType.Character, 0, ''); 21103class _Scanner { 21104 constructor(input) { 21105 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "input", void 0); 21106 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "tokens", []); 21107 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "length", void 0); 21108 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "peek", 0); 21109 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "index", -1); 21110 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "braceStack", []); 21111 this.input = input; 21112 this.length = input.length; 21113 this.advance(); 21114 } 21115 scan() { 21116 let token = this.scanToken(); 21117 while (token !== null) { 21118 this.tokens.push(token); 21119 token = this.scanToken(); 21120 } 21121 return this.tokens; 21122 } 21123 advance() { 21124 this.peek = ++this.index >= this.length ? $EOF : this.input.charCodeAt(this.index); 21125 } 21126 scanToken() { 21127 const input = this.input; 21128 const length = this.length; 21129 let peek = this.peek; 21130 let index = this.index; 21131 // Skip whitespace. 21132 while (peek <= $SPACE) { 21133 if (++index >= length) { 21134 peek = $EOF; 21135 break; 21136 } else { 21137 peek = input.charCodeAt(index); 21138 } 21139 } 21140 this.peek = peek; 21141 this.index = index; 21142 if (index >= length) { 21143 return null; 21144 } 21145 // Handle identifiers and numbers. 21146 if (isIdentifierStart(peek)) { 21147 return this.scanIdentifier(); 21148 } 21149 if (isDigit(peek)) { 21150 return this.scanNumber(index); 21151 } 21152 const start = index; 21153 switch (peek) { 21154 case $PERIOD: 21155 this.advance(); 21156 return isDigit(this.peek) ? this.scanNumber(start) : newCharacterToken(start, this.index, $PERIOD); 21157 case $LPAREN: 21158 case $RPAREN: 21159 case $LBRACKET: 21160 case $RBRACKET: 21161 case $COMMA: 21162 case $COLON: 21163 case $SEMICOLON: 21164 return this.scanCharacter(start, peek); 21165 case $LBRACE: 21166 return this.scanOpenBrace(start, peek); 21167 case $RBRACE: 21168 return this.scanCloseBrace(start, peek); 21169 case $SQ: 21170 case $DQ: 21171 return this.scanString(); 21172 case $BT: 21173 this.advance(); 21174 return this.scanTemplateLiteralPart(start); 21175 case $HASH: 21176 return this.scanPrivateIdentifier(); 21177 case $PLUS: 21178 case $MINUS: 21179 case $STAR: 21180 case $SLASH: 21181 case $PERCENT: 21182 case $CARET:
21183 return this.scanOperator(start, String.fromCharCode(peek)); 21184 case $QUESTION: 21185 return this.scanQuestion(start); 21186 case $LT: 21187 case $GT: 21188 return this.scanComplexOperator(start, String.fromCharCode(peek), $EQ, '='); 21189 case $BANG: 21190 case $EQ: 21191 return this.scanComplexOperator(start, String.fromCharCode(peek), $EQ, '=', $EQ, '='); 21192 case $AMPERSAND: 21193 return this.scanComplexOperator(start, '&', $AMPERSAND, '&'); 21194 case $BAR: 21195 return this.scanComplexOperator(start, '|', $BAR, '|'); 21196 case $NBSP: 21197 while (isWhitespace(this.peek)) this.advance(); 21198 return this.scanToken(); 21199 } 21200 this.advance(); 21201 return this.error(`Unexpected character [${String.fromCharCode(peek)}]`, 0); 21202 } 21203 scanCharacter(start, code) { 21204 this.advance(); 21205 return newCharacterToken(start, this.index, code); 21206 } 21207 scanOperator(start, str) { 21208 this.advance(); 21209 return newOperatorToken(start, this.index, str); 21210 } 21211 scanOpenBrace(start, code) { 21212 this.braceStack.push('expression'); 21213 this.advance(); 21214 return newCharacterToken(start, this.index, code); 21215 } 21216 scanCloseBrace(start, code) { 21217 this.advance(); 21218 const currentBrace = this.braceStack.pop(); 21219 if (currentBrace === 'interpolation') { 21220 this.tokens.push(newOperatorToken(start, this.index, '}')); 21221 return this.scanTemplateLiteralPart(this.index); 21222 } 21223 return newCharacterToken(start, this.index, code); 21224 } 21225 /** 21226 * Tokenize a 2/3 char long operator 21227 * 21228 * @param start start index in the expression 21229 * @param one first symbol (always part of the operator) 21230 * @param twoCode code point for the second symbol 21231 * @param two second symbol (part of the operator when the second code point matches) 21232 * @param threeCode code point for the third symbol 21233 * @param three third symbol (part of the operator when provided and matches source expression) 21234 */ 21235 scanComplexOperator(start, one, twoCode, two, threeCode, three) { 21236 this.advance(); 21237 let str = one; 21238 if (this.peek == twoCode) { 21239 this.advance(); 21240 str += two; 21241 } 21242 if (threeCode != null && this.peek == threeCode) { 21243 this.advance(); 21244 str += three; 21245 } 21246 return newOperatorToken(start, this.index, str); 21247 } 21248 scanIdentifier() { 21249 const start = this.index; 21250 this.advance(); 21251 while (isIdentifierPart(this.peek)) this.advance(); 21252 const str = this.input.substring(start, this.index); 21253 return KEYWORDS.indexOf(str) > -1 ? newKeywordToken(start, this.index, str) : newIdentifierToken(start, this.index, str); 21254 } 21255 /** Scans an ECMAScript private identifier. */ 21256 scanPrivateIdentifier() { 21257 const start = this.index; 21258 this.advance(); 21259 if (!isIdentifierStart(this.peek)) { 21260 return this.error('Invalid character [#]', -1); 21261 } 21262 while (isIdentifierPart(this.peek)) this.advance(); 21263 const identifierName = this.input.substring(start, this.index); 21264 return newPrivateIdentifierToken(start, this.index, identifierName); 21265 } 21266 scanNumber(start) { 21267 let simple = this.index === start; 21268 let hasSeparators = false; 21269 this.advance(); // Skip initial digit. 21270 while (true) { 21271 if (isDigit(this.peek)) ;else if (this.peek === $_) { 21272 // Separators are only valid when they're surrounded by digits. E.g. `1_0_1` is 21273 // valid while `_101` and `101_` are not. The separator can't be next to the decimal 21274 // point or another separator either. Note that it's unlikely that we'll hit a case where 21275 // the underscore is at the start, because that's a valid identifier and it will be picked 21276 // up earlier in the parsing. We validate for it anyway just in case. 21277 if (!isDigit(this.input.charCodeAt(this.index - 1)) || !isDigit(this.input.charCodeAt(this.index + 1))) { 21278 return this.error('Invalid numeric separator', 0); 21279 } 21280 hasSeparators = true; 21281 } else if (this.peek === $PERIOD) { 21282 simple = false; 21283 } else if (isExponentStart(this.peek)) { 21284 this.advance(); 21285 if (isExponentSign(this.peek)) this.advance(); 21286 if (!isDigit(this.peek)) return this.error('Invalid exponent', -1); 21287 simple = false;
21288 } else { 21289 break; 21290 } 21291 this.advance(); 21292 } 21293 let str = this.input.substring(start, this.index); 21294 if (hasSeparators) { 21295 str = str.replace(/_/g, ''); 21296 } 21297 const value = simple ? parseIntAutoRadix(str) : parseFloat(str); 21298 return newNumberToken(start, this.index, value); 21299 } 21300 scanString() { 21301 const start = this.index; 21302 const quote = this.peek; 21303 this.advance(); // Skip initial quote. 21304 let buffer = ''; 21305 let marker = this.index; 21306 const input = this.input; 21307 while (this.peek != quote) { 21308 if (this.peek == $BACKSLASH) { 21309 const result = this.scanStringBackslash(buffer, marker); 21310 if (typeof result !== 'string') { 21311 return result; // Error 21312 } 21313 buffer = result; 21314 marker = this.index; 21315 } else if (this.peek == $EOF) { 21316 return this.error('Unterminated quote', 0); 21317 } else { 21318 this.advance(); 21319 } 21320 } 21321 const last = input.substring(marker, this.index); 21322 this.advance(); // Skip terminating quote. 21323 return new StringToken(start, this.index, buffer + last, StringTokenKind.Plain); 21324 } 21325 scanQuestion(start) { 21326 this.advance(); 21327 let str = '?'; 21328 // Either `a ?? b` or 'a?.b'. 21329 if (this.peek === $QUESTION || this.peek === $PERIOD) { 21330 str += this.peek === $PERIOD ? '.' : '?'; 21331 this.advance(); 21332 } 21333 return newOperatorToken(start, this.index, str); 21334 } 21335 scanTemplateLiteralPart(start) { 21336 let buffer = ''; 21337 let marker = this.index; 21338 while (this.peek !== $BT) { 21339 if (this.peek === $BACKSLASH) { 21340 const result = this.scanStringBackslash(buffer, marker); 21341 if (typeof result !== 'string') { 21342 return result; // Error 21343 } 21344 buffer = result; 21345 marker = this.index; 21346 } else if (this.peek === $$) { 21347 const dollar = this.index; 21348 this.advance(); 21349 // @ts-expect-error 21350 if (this.peek === $LBRACE) { 21351 this.braceStack.push('interpolation'); 21352 this.tokens.push(new StringToken(start, dollar, buffer + this.input.substring(marker, dollar), StringTokenKind.TemplateLiteralPart)); 21353 this.advance(); 21354 return newOperatorToken(dollar, this.index, this.input.substring(dollar, this.index)); 21355 } 21356 } else if (this.peek === $EOF) { 21357 return this.error('Unterminated template literal', 0); 21358 } else { 21359 this.advance(); 21360 } 21361 } 21362 const last = this.input.substring(marker, this.index); 21363 this.advance(); 21364 return new StringToken(start, this.index, buffer + last, StringTokenKind.TemplateLiteralEnd); 21365 } 21366 error(message, offset) { 21367 const position = this.index + offset; 21368 return newErrorToken(position, this.index, `Lexer Error: ${message} at column ${position} in expression [${this.input}]`); 21369 } 21370 scanStringBackslash(buffer, marker) { 21371 buffer += this.input.substring(marker, this.index); 21372 let unescapedCode; 21373 this.advance(); 21374 if (this.peek === $u) { 21375 // 4 character hex code for unicode character. 21376 const hex = this.input.substring(this.index + 1, this.index + 5); 21377 if (/^[0-9a-f]+$/i.test(hex)) { 21378 unescapedCode = parseInt(hex, 16); 21379 } else { 21380 return this.error(`Invalid unicode escape [\\u${hex}]`, 0); 21381 } 21382 for (let i = 0; i < 5; i++) { 21383 this.advance(); 21384 } 21385 } else { 21386 unescapedCode = unescape(this.peek); 21387 this.advance(); 21388 } 21389 buffer += String.fromCharCode(unescapedCode); 21390 return buffer; 21391 } 21392} 21393function isIdentifierStart(code) { 21394 return $a <= code && code <= $z || $A <= code && code <= $Z || code == $_ || code == $$; 21395} 21396function isIdentifierPart(code) { 21397 return isAsciiLetter(code) || isDigit(code) || code == $_ || code == $$; 21398} 21399function isExponentStart(code) { 21400 return code == $e || code == $E; 21401} 21402function isExponentSign(code) { 21403 return code == $MINUS || code == $PLUS; 21404} 21405function unescape(code) { 21406 switch (code) { 21407 case $n: 21408 return $LF; 21409 case $f: 21410 return $FF; 21411 case $r: 21412 return $CR; 21413 case $t: 21414 return $TAB; 21415 case $v: 21416 return $VTAB; 21417 default: 21418 return code; 21419 } 21420} 21421function parseIntAutoRadix(text) { 21422 const result = parseInt(text); 21423 if (isNaN(result)) { 21424 throw new Error('Invalid integer literal when parsing ' + text); 21425 } 21426 return result; 21427} 21428class SplitInterpolation { 21429 constructor(strings, expressions, offsets) { 21430 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "strings", void 0); 21431 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "expressions", void 0); 21432 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "offsets", void 0); 21433 this.strings = strings; 21434 this.expressions = expressions; 21435 this.offsets = offsets; 21436 } 21437} 21438class TemplateBindingParseResult { 21439 constructor(templateBindings, warnings, errors) { 21440 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "templateBindings", void 0); 21441 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "warnings", void 0); 21442 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "errors", void 0); 21443 this.templateBindings = templateBindings; 21444 this.warnings = warnings; 21445 this.errors = errors; 21446 } 21447} 21448class Parser { 21449 constructor(_lexer) { 21450 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_lexer", void 0); 21451 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "errors", []); 21452 this._lexer = _lexer; 21453 } 21454 parseAction(input, location, absoluteOffset, interpolationConfig = DEFAULT_INTERPOLATION_CONFIG) { 21455 this._checkNoInterpolation(input, location, interpolationConfig); 21456 const sourceToLex = this._stripComments(input); 21457 const tokens = this._lexer.tokenize(sourceToLex); 21458 const ast = new _ParseAST(input, location, absoluteOffset, tokens, 1 /* ParseFlags.Action */, this.errors, 0).parseChain(); 21459 return new ASTWithSource(ast, input, location, absoluteOffset, this.errors); 21460 } 21461 parseBinding(input, location, absoluteOffset, interpolationConfig = DEFAULT_INTERPOLATION_CONFIG) { 21462 const ast = this._parseBindingAst(input, location, absoluteOffset, interpolationConfig); 21463 return new ASTWithSource(ast, input, location, absoluteOffset, this.errors); 21464 } 21465 checkSimpleExpression(ast) { 21466 const checker = new SimpleExpressionChecker(); 21467 ast.visit(checker); 21468 return checker.errors; 21469 } 21470 // Host bindings parsed here 21471 parseSimpleBinding(input, location, absoluteOffset, interpolationConfig = DEFAULT_INTERPOLATION_CONFIG) { 21472 const ast = this._parseBindingAst(input, location, absoluteOffset, interpolationConfig); 21473 const errors = this.checkSimpleExpression(ast); 21474 if (errors.length > 0) { 21475 this._reportError(`Host binding expression cannot contain ${errors.join(' ')}`, input, location); 21476 } 21477 return new ASTWithSource(ast, input, location, absoluteOffset, this.errors); 21478 } 21479 _reportError(message, input, errLocation, ctxLocation) { 21480 this.errors.push(new ParserError(message, input, errLocation, ctxLocation)); 21481 } 21482 _parseBindingAst(input, location, absoluteOffset, interpolationConfig) { 21483 this._checkNoInterpolation(input, location, interpolationConfig); 21484 const sourceToLex = this._stripComments(input); 21485 const tokens = this._lexer.tokenize(sourceToLex); 21486 return new _ParseAST(input, location, absoluteOffset, tokens, 0 /* ParseFlags.None */, this.errors, 0).parseChain(); 21487 } 21488 /** 21489 * Parse microsyntax template expression and return a list of bindings or
21490 * parsing errors in case the given expression is invalid. 21491 * 21492 * For example, 21493 * ```html 21494 * <div *ngFor="let item of items"> 21495 * ^ ^ absoluteValueOffset for `templateValue` 21496 * absoluteKeyOffset for `templateKey` 21497 * ``` 21498 * contains three bindings: 21499 * 1. ngFor -> null 21500 * 2. item -> NgForOfContext.$implicit 21501 * 3. ngForOf -> items 21502 * 21503 * This is apparent from the de-sugared template: 21504 * ```html 21505 * <ng-template ngFor let-item [ngForOf]="items"> 21506 * ``` 21507 * 21508 * @param templateKey name of directive, without the * prefix. For example: ngIf, ngFor 21509 * @param templateValue RHS of the microsyntax attribute 21510 * @param templateUrl template filename if it's external, component filename if it's inline 21511 * @param absoluteKeyOffset start of the `templateKey` 21512 * @param absoluteValueOffset start of the `templateValue` 21513 */ 21514 parseTemplateBindings(templateKey, templateValue, templateUrl, absoluteKeyOffset, absoluteValueOffset) { 21515 const tokens = this._lexer.tokenize(templateValue); 21516 const parser = new _ParseAST(templateValue, templateUrl, absoluteValueOffset, tokens, 0 /* ParseFlags.None */, this.errors, 0 /* relative offset */); 21517 return parser.parseTemplateBindings({ 21518 source: templateKey, 21519 span: new AbsoluteSourceSpan(absoluteKeyOffset, absoluteKeyOffset + templateKey.length) 21520 }); 21521 } 21522 parseInterpolation(input, location, absoluteOffset, interpolatedTokens, interpolationConfig = DEFAULT_INTERPOLATION_CONFIG) { 21523 const { 21524 strings, 21525 expressions, 21526 offsets 21527 } = this.splitInterpolation(input, location, interpolatedTokens, interpolationConfig); 21528 if (expressions.length === 0) return null; 21529 const expressionNodes = []; 21530 for (let i = 0; i < expressions.length; ++i) { 21531 const expressionText = expressions[i].text; 21532 const sourceToLex = this._stripComments(expressionText); 21533 const tokens = this._lexer.tokenize(sourceToLex); 21534 const ast = new _ParseAST(input, location, absoluteOffset, tokens, 0 /* ParseFlags.None */, this.errors, offsets[i]).parseChain(); 21535 expressionNodes.push(ast); 21536 } 21537 return this.createInterpolationAst(strings.map(s => s.text), expressionNodes, input, location, absoluteOffset); 21538 } 21539 /** 21540 * Similar to `parseInterpolation`, but treats the provided string as a single expression 21541 * element that would normally appear within the interpolation prefix and suffix (`{{` and `}}`). 21542 * This is used for parsing the switch expression in ICUs. 21543 */ 21544 parseInterpolationExpression(expression, location, absoluteOffset) { 21545 const sourceToLex = this._stripComments(expression); 21546 const tokens = this._lexer.tokenize(sourceToLex); 21547 const ast = new _ParseAST(expression, location, absoluteOffset, tokens, 0 /* ParseFlags.None */, this.errors, 0).parseChain(); 21548 const strings = ['', '']; // The prefix and suffix strings are both empty 21549 return this.createInterpolationAst(strings, [ast], expression, location, absoluteOffset); 21550 } 21551 createInterpolationAst(strings, expressions, input, location, absoluteOffset) { 21552 const span = new ParseSpan(0, input.length); 21553 const interpolation = new Interpolation$1(span, span.toAbsolute(absoluteOffset), strings, expressions); 21554 return new ASTWithSource(interpolation, input, location, absoluteOffset, this.errors); 21555 } 21556 /** 21557 * Splits a string of text into "raw" text segments and expressions present in interpolations in 21558 * the string. 21559 * Returns `null` if there are no interpolations, otherwise a 21560 * `SplitInterpolation` with splits that look like 21561 * <raw text> <expression> <raw text> ... <raw text> <expression> <raw text> 21562 */ 21563 splitInterpolation(input, location, interpolatedTokens, interpolationConfig = DEFAULT_INTERPOLATION_CONFIG) { 21564 const strings = []; 21565 const expressions = []; 21566 const offsets = []; 21567 const inputToTemplateIndexMap = interpolatedTokens ? getIndexMapForOriginalTemplate(interpolatedTokens) : null; 21568 let i = 0; 21569 let atInterpolation = false; 21570 let extendLastString = false; 21571 let { 21572 start: interpStart, 21573 end: interpEnd 21574 } = interpolationConfig; 21575 while (i < input.length) { 21576 if (!atInterpolation) { 21577 // parse until starting {{ 21578 const start = i; 21579 i = input.indexOf(interpStart, i); 21580 if (i === -1) { 21581 i = input.length; 21582 } 21583 const text = input.substring(start, i);
21584 strings.push({ 21585 text, 21586 start, 21587 end: i 21588 }); 21589 atInterpolation = true; 21590 } else { 21591 var _inputToTemplateIndex; 21592 // parse from starting {{ to ending }} while ignoring content inside quotes. 21593 const fullStart = i; 21594 const exprStart = fullStart + interpStart.length; 21595 const exprEnd = this._getInterpolationEndIndex(input, interpEnd, exprStart); 21596 if (exprEnd === -1) { 21597 // Could not find the end of the interpolation; do not parse an expression. 21598 // Instead we should extend the content on the last raw string. 21599 atInterpolation = false; 21600 extendLastString = true; 21601 break; 21602 } 21603 const fullEnd = exprEnd + interpEnd.length; 21604 const text = input.substring(exprStart, exprEnd); 21605 if (text.trim().length === 0) { 21606 this._reportError('Blank expressions are not allowed in interpolated strings', input, `at column ${i} in`, location); 21607 } 21608 expressions.push({ 21609 text, 21610 start: fullStart, 21611 end: fullEnd 21612 }); 21613 const startInOriginalTemplate = (_inputToTemplateIndex = inputToTemplateIndexMap === null || inputToTemplateIndexMap === void 0 ? void 0 : inputToTemplateIndexMap.get(fullStart)) !== null && _inputToTemplateIndex !== void 0 ? _inputToTemplateIndex : fullStart; 21614 const offset = startInOriginalTemplate + interpStart.length; 21615 offsets.push(offset); 21616 i = fullEnd; 21617 atInterpolation = false; 21618 } 21619 } 21620 if (!atInterpolation) { 21621 // If we are now at a text section, add the remaining content as a raw string. 21622 if (extendLastString) { 21623 const piece = strings[strings.length - 1]; 21624 piece.text += input.substring(i); 21625 piece.end = input.length; 21626 } else { 21627 strings.push({ 21628 text: input.substring(i), 21629 start: i, 21630 end: input.length 21631 }); 21632 } 21633 } 21634 return new SplitInterpolation(strings, expressions, offsets); 21635 } 21636 wrapLiteralPrimitive(input, location, absoluteOffset) { 21637 const span = new ParseSpan(0, input == null ? 0 : input.length); 21638 return new ASTWithSource(new LiteralPrimitive(span, span.toAbsolute(absoluteOffset), input), input, location, absoluteOffset, this.errors); 21639 } 21640 _stripComments(input) { 21641 const i = this._commentStart(input); 21642 return i != null ? input.substring(0, i) : input; 21643 } 21644 _commentStart(input) { 21645 let outerQuote = null; 21646 for (let i = 0; i < input.length - 1; i++) { 21647 const char = input.charCodeAt(i); 21648 const nextChar = input.charCodeAt(i + 1); 21649 if (char === $SLASH && nextChar == $SLASH && outerQuote == null) return i; 21650 if (outerQuote === char) { 21651 outerQuote = null; 21652 } else if (outerQuote == null && isQuote(char)) { 21653 outerQuote = char; 21654 } 21655 } 21656 return null; 21657 } 21658 _checkNoInterpolation(input, location, { 21659 start, 21660 end 21661 }) { 21662 let startIndex = -1; 21663 let endIndex = -1; 21664 for (const charIndex of this._forEachUnquotedChar(input, 0)) { 21665 if (startIndex === -1) { 21666 if (input.startsWith(start)) { 21667 startIndex = charIndex; 21668 } 21669 } else { 21670 endIndex = this._getInterpolationEndIndex(input, end, charIndex); 21671 if (endIndex > -1) { 21672 break; 21673 } 21674 } 21675 } 21676 if (startIndex > -1 && endIndex > -1) { 21677 this._reportError(`Got interpolation (${start}${end}) where expression was expected`, input, `at column ${startIndex} in`, location); 21678 } 21679 } 21680 /** 21681 * Finds the index of the end of an interpolation expression 21682 * while ignoring comments and quoted content. 21683 */ 21684 _getInterpolationEndIndex(input, expressionEnd, start) { 21685 for (const charIndex of this._forEachUnquotedChar(input, start)) { 21686 if (input.startsWith(expressionEnd, charIndex)) { 21687 return charIndex; 21688 } 21689 // Nothing else in the expression matters after we've 21690 // hit a comment so look directly for the end token. 21691 if (input.startsWith('//', charIndex)) { 21692 return input.indexOf(expressionEnd, charIndex); 21693 } 21694 } 21695 return -1; 21696 } 21697 /** 21698 * Generator used to iterate over the character indexes of a string that are outside of quotes. 21699 * @param input String to loop through. 21700 * @param start Index within the string at which to start. 21701 */ 21702 *_forEachUnquotedChar(input, start) {
21703 let currentQuote = null; 21704 let escapeCount = 0; 21705 for (let i = start; i < input.length; i++) { 21706 const char = input[i]; 21707 // Skip the characters inside quotes. Note that we only care about the outer-most 21708 // quotes matching up and we need to account for escape characters. 21709 if (isQuote(input.charCodeAt(i)) && (currentQuote === null || currentQuote === char) && escapeCount % 2 === 0) { 21710 currentQuote = currentQuote === null ? char : null; 21711 } else if (currentQuote === null) { 21712 yield i; 21713 } 21714 escapeCount = char === '\\' ? escapeCount + 1 : 0; 21715 } 21716 } 21717} 21718/** Describes a stateful context an expression parser is in. */ 21719var ParseContextFlags = /*#__PURE__*/function (ParseContextFlags) { 21720 ParseContextFlags[ParseContextFlags["None"] = 0] = "None"; 21721 /** 21722 * A Writable context is one in which a value may be written to an lvalue. 21723 * For example, after we see a property access, we may expect a write to the 21724 * property via the "=" operator. 21725 * prop 21726 * ^ possible "=" after 21727 */ 21728 ParseContextFlags[ParseContextFlags["Writable"] = 1] = "Writable"; 21729 return ParseContextFlags; 21730}(ParseContextFlags || {}); 21731class _ParseAST { 21732 constructor(input, location, absoluteOffset, tokens, parseFlags, errors, offset) { 21733 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "input", void 0); 21734 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "location", void 0); 21735 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "absoluteOffset", void 0); 21736 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "tokens", void 0); 21737 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "parseFlags", void 0); 21738 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "errors", void 0); 21739 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "offset", void 0); 21740 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "rparensExpected", 0); 21741 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "rbracketsExpected", 0); 21742 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "rbracesExpected", 0); 21743 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "context", ParseContextFlags.None); 21744 // Cache of expression start and input indeces to the absolute source span they map to, used to 21745 // prevent creating superfluous source spans in `sourceSpan`. 21746 // A serial of the expression start and input index is used for mapping because both are stateful 21747 // and may change for subsequent expressions visited by the parser. 21748 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "sourceSpanCache", new Map()); 21749 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "index", 0); 21750 this.input = input; 21751 this.location = location; 21752 this.absoluteOffset = absoluteOffset; 21753 this.tokens = tokens; 21754 this.parseFlags = parseFlags; 21755 this.errors = errors; 21756 this.offset = offset; 21757 } 21758 peek(offset) { 21759 const i = this.index + offset; 21760 return i < this.tokens.length ? this.tokens[i] : EOF; 21761 } 21762 get next() { 21763 return this.peek(0); 21764 } 21765 /** Whether all the parser input has been processed. */ 21766 get atEOF() { 21767 return this.index >= this.tokens.length; 21768 } 21769 /** 21770 * Index of the next token to be processed, or the end of the last token if all have been 21771 * processed. 21772 */ 21773 get inputIndex() { 21774 return this.atEOF ? this.currentEndIndex : this.next.index + this.offset; 21775 } 21776 /** 21777 * End index of the last processed token, or the start of the first token if none have been 21778 * processed. 21779 */ 21780 get currentEndIndex() { 21781 if (this.index > 0) { 21782 const curToken = this.peek(-1); 21783 return curToken.end + this.offset; 21784 } 21785 // No tokens have been processed yet; return the next token's start or the length of the input 21786 // if there is no token. 21787 if (this.tokens.length === 0) { 21788 return this.input.length + this.offset; 21789 } 21790 return this.next.index + this.offset; 21791 } 21792 /** 21793 * Returns the absolute offset of the start of the current token. 21794 */ 21795 get currentAbsoluteOffset() { 21796 return this.absoluteOffset + this.inputIndex; 21797 } 21798 /** 21799 * Retrieve a `ParseSpan` from `start` to the current position (or to `artificialEndIndex` if 21800 * provided). 21801 * 21802 * @param start Position from which the `ParseSpan` will start. 21803 * @param artificialEndIndex Optional ending index to be used if provided (and if greater than the 21804 * natural ending index) 21805 */ 21806 span(start, artificialEndIndex) { 21807 let endIndex = this.currentEndIndex; 21808 if (artificialEndIndex !== undefined && artificialEndIndex > this.currentEndIndex) { 21809 endIndex = artificialEndIndex; 21810 } 21811 // In some unusual parsing scenarios (like when certain tokens are missing and an `EmptyExpr` is 21812 // being created), the current token may already be advanced beyond the `currentEndIndex`. This 21813 // appears to be a deep-seated parser bug. 21814 // 21815 // As a workaround for now, swap the start and end indices to ensure a valid `ParseSpan`. 21816 // TODO(alxhub): fix the bug upstream in the parser state, and remove this workaround. 21817 if (start > endIndex) { 21818 const tmp = endIndex; 21819 endIndex = start; 21820 start = tmp; 21821 } 21822 return new ParseSpan(start, endIndex); 21823 } 21824 sourceSpan(start, artificialEndIndex) { 21825 const serial = `${start}@${this.inputIndex}:${artificialEndIndex}`; 21826 if (!this.sourceSpanCache.has(serial)) { 21827 this.sourceSpanCache.set(serial, this.span(start, artificialEndIndex).toAbsolute(this.absoluteOffset)); 21828 } 21829 return this.sourceSpanCache.get(serial); 21830 } 21831 advance() { 21832 this.index++; 21833 } 21834 /** 21835 * Executes a callback in the provided context. 21836 */ 21837 withContext(context, cb) { 21838 this.context |= context; 21839 const ret = cb(); 21840 this.context ^= context; 21841 return ret; 21842 } 21843 consumeOptionalCharacter(code) { 21844 if (this.next.isCharacter(code)) { 21845 this.advance(); 21846 return true; 21847 } else { 21848 return false;
21849 } 21850 } 21851 peekKeywordLet() { 21852 return this.next.isKeywordLet(); 21853 } 21854 peekKeywordAs() { 21855 return this.next.isKeywordAs(); 21856 } 21857 /** 21858 * Consumes an expected character, otherwise emits an error about the missing expected character 21859 * and skips over the token stream until reaching a recoverable point. 21860 * 21861 * See `this.error` and `this.skip` for more details. 21862 */ 21863 expectCharacter(code) { 21864 if (this.consumeOptionalCharacter(code)) return; 21865 this.error(`Missing expected ${String.fromCharCode(code)}`); 21866 } 21867 consumeOptionalOperator(op) { 21868 if (this.next.isOperator(op)) { 21869 this.advance(); 21870 return true; 21871 } else { 21872 return false; 21873 } 21874 } 21875 expectOperator(operator) { 21876 if (this.consumeOptionalOperator(operator)) return; 21877 this.error(`Missing expected operator ${operator}`); 21878 } 21879 prettyPrintToken(tok) { 21880 return tok === EOF ? 'end of input' : `token ${tok}`; 21881 } 21882 expectIdentifierOrKeyword() { 21883 const n = this.next; 21884 if (!n.isIdentifier() && !n.isKeyword()) { 21885 if (n.isPrivateIdentifier()) { 21886 this._reportErrorForPrivateIdentifier(n, 'expected identifier or keyword'); 21887 } else { 21888 this.error(`Unexpected ${this.prettyPrintToken(n)}, expected identifier or keyword`); 21889 } 21890 return null; 21891 } 21892 this.advance(); 21893 return n.toString(); 21894 } 21895 expectIdentifierOrKeywordOrString() { 21896 const n = this.next; 21897 if (!n.isIdentifier() && !n.isKeyword() && !n.isString()) { 21898 if (n.isPrivateIdentifier()) { 21899 this._reportErrorForPrivateIdentifier(n, 'expected identifier, keyword or string'); 21900 } else { 21901 this.error(`Unexpected ${this.prettyPrintToken(n)}, expected identifier, keyword, or string`); 21902 } 21903 return ''; 21904 } 21905 this.advance(); 21906 return n.toString(); 21907 } 21908 parseChain() { 21909 const exprs = []; 21910 const start = this.inputIndex; 21911 while (this.index < this.tokens.length) { 21912 const expr = this.parsePipe(); 21913 exprs.push(expr); 21914 if (this.consumeOptionalCharacter($SEMICOLON)) { 21915 if (!(this.parseFlags & 1 /* ParseFlags.Action */)) { 21916 this.error('Binding expression cannot contain chained expression'); 21917 } 21918 while (this.consumeOptionalCharacter($SEMICOLON)) {} // read all semicolons 21919 } else if (this.index < this.tokens.length) { 21920 const errorIndex = this.index; 21921 this.error(`Unexpected token '${this.next}'`); 21922 // The `error` call above will skip ahead to the next recovery point in an attempt to 21923 // recover part of the expression, but that might be the token we started from which will 21924 // lead to an infinite loop. If that's the case, break the loop assuming that we can't 21925 // parse further. 21926 if (this.index === errorIndex) { 21927 break; 21928 } 21929 } 21930 } 21931 if (exprs.length === 0) { 21932 // We have no expressions so create an empty expression that spans the entire input length 21933 const artificialStart = this.offset; 21934 const artificialEnd = this.offset + this.input.length; 21935 return new EmptyExpr$1(this.span(artificialStart, artificialEnd), this.sourceSpan(artificialStart, artificialEnd)); 21936 } 21937 if (exprs.length == 1) return exprs[0]; 21938 return new Chain(this.span(start), this.sourceSpan(start), exprs); 21939 } 21940 parsePipe() { 21941 const start = this.inputIndex; 21942 let result = this.parseExpression(); 21943 if (this.consumeOptionalOperator('|')) { 21944 if (this.parseFlags & 1 /* ParseFlags.Action */) { 21945 this.error(`Cannot have a pipe in an action expression`); 21946 } 21947 do { 21948 const nameStart = this.inputIndex; 21949 let nameId = this.expectIdentifierOrKeyword(); 21950 let nameSpan; 21951 let fullSpanEnd = undefined; 21952 if (nameId !== null) { 21953 nameSpan = this.sourceSpan(nameStart); 21954 } else { 21955 // No valid identifier was found, so we'll assume an empty pipe name (''). 21956 nameId = ''; 21957 // However, there may have been whitespace present between the pipe character and the next 21958 // token in the sequence (or the end of input). We want to track this whitespace so that 21959 // the `BindingPipe` we produce covers not just the pipe character, but any trailing 21960 // whitespace beyond it. Another way of thinking about this is that the zero-length name 21961 // is assumed to be at the end of any whitespace beyond the pipe character. 21962 // 21963 // Therefore, we push the end of the `ParseSpan` for this pipe all the way up to the 21964 // beginning of the next token, or until the end of input if the next token is EOF.
21965 fullSpanEnd = this.next.index !== -1 ? this.next.index : this.input.length + this.offset; 21966 // The `nameSpan` for an empty pipe name is zero-length at the end of any whitespace 21967 // beyond the pipe character. 21968 nameSpan = new ParseSpan(fullSpanEnd, fullSpanEnd).toAbsolute(this.absoluteOffset); 21969 } 21970 const args = []; 21971 while (this.consumeOptionalCharacter($COLON)) { 21972 args.push(this.parseExpression()); 21973 // If there are additional expressions beyond the name, then the artificial end for the 21974 // name is no longer relevant. 21975 } 21976 result = new BindingPipe(this.span(start), this.sourceSpan(start, fullSpanEnd), result, nameId, args, nameSpan); 21977 } while (this.consumeOptionalOperator('|')); 21978 } 21979 return result; 21980 } 21981 parseExpression() { 21982 return this.parseConditional(); 21983 } 21984 parseConditional() { 21985 const start = this.inputIndex; 21986 const result = this.parseLogicalOr(); 21987 if (this.consumeOptionalOperator('?')) { 21988 const yes = this.parsePipe(); 21989 let no; 21990 if (!this.consumeOptionalCharacter($COLON)) { 21991 const end = this.inputIndex; 21992 const expression = this.input.substring(start, end); 21993 this.error(`Conditional expression ${expression} requires all 3 expressions`); 21994 no = new EmptyExpr$1(this.span(start), this.sourceSpan(start)); 21995 } else { 21996 no = this.parsePipe(); 21997 } 21998 return new Conditional(this.span(start), this.sourceSpan(start), result, yes, no); 21999 } else { 22000 return result; 22001 } 22002 } 22003 parseLogicalOr() { 22004 // '||' 22005 const start = this.inputIndex; 22006 let result = this.parseLogicalAnd(); 22007 while (this.consumeOptionalOperator('||')) { 22008 const right = this.parseLogicalAnd(); 22009 result = new Binary(this.span(start), this.sourceSpan(start), '||', result, right); 22010 } 22011 return result; 22012 } 22013 parseLogicalAnd() { 22014 // '&&' 22015 const start = this.inputIndex; 22016 let result = this.parseNullishCoalescing(); 22017 while (this.consumeOptionalOperator('&&')) { 22018 const right = this.parseNullishCoalescing(); 22019 result = new Binary(this.span(start), this.sourceSpan(start), '&&', result, right); 22020 } 22021 return result; 22022 } 22023 parseNullishCoalescing() { 22024 // '??' 22025 const start = this.inputIndex; 22026 let result = this.parseEquality(); 22027 while (this.consumeOptionalOperator('??')) { 22028 const right = this.parseEquality(); 22029 result = new Binary(this.span(start), this.sourceSpan(start), '??', result, right); 22030 } 22031 return result; 22032 } 22033 parseEquality() { 22034 // '==','!=','===','!==' 22035 const start = this.inputIndex; 22036 let result = this.parseRelational(); 22037 while (this.next.type == TokenType.Operator) { 22038 const operator = this.next.strValue; 22039 switch (operator) { 22040 case '==': 22041 case '===': 22042 case '!=': 22043 case '!==': 22044 this.advance(); 22045 const right = this.parseRelational(); 22046 result = new Binary(this.span(start), this.sourceSpan(start), operator, result, right); 22047 continue; 22048 } 22049 break; 22050 } 22051 return result; 22052 } 22053 parseRelational() { 22054 // '<', '>', '<=', '>=' 22055 const start = this.inputIndex; 22056 let result = this.parseAdditive(); 22057 while (this.next.type == TokenType.Operator) { 22058 const operator = this.next.strValue; 22059 switch (operator) { 22060 case '<': 22061 case '>': 22062 case '<=': 22063 case '>=': 22064 this.advance(); 22065 const right = this.parseAdditive(); 22066 result = new Binary(this.span(start), this.sourceSpan(start), operator, result, right); 22067 continue; 22068 } 22069 break; 22070 } 22071 return result; 22072 } 22073 parseAdditive() { 22074 // '+', '-' 22075 const start = this.inputIndex; 22076 let result = this.parseMultiplicative(); 22077 while (this.next.type == TokenType.Operator) { 22078 const operator = this.next.strValue; 22079 switch (operator) { 22080 case '+': 22081 case '-': 22082 this.advance(); 22083 let right = this.parseMultiplicative(); 22084 result = new Binary(this.span(start), this.sourceSpan(start), operator, result, right); 22085 continue; 22086 } 22087 break; 22088 } 22089 return result; 22090 } 22091 parseMultiplicative() { 22092 // '*', '%', '/' 22093 const start = this.inputIndex; 22094 let result = this.parsePrefix(); 22095 while (this.next.type == TokenType.Operator) { 22096 const operator = this.next.strValue; 22097 switch (operator) { 22098 case '*': 22099 case '%': 22100 case '/': 22101 this.advance(); 22102 let right = this.parsePrefix(); 22103 result = new Binary(this.span(start), this.sourceSpan(start), operator, result, right); 22104 continue; 22105 } 22106 break; 22107 } 22108 return result; 22109 } 22110 parsePrefix() { 22111 if (this.next.type == TokenType.Operator) { 22112 const start = this.inputIndex; 22113 const operator = this.next.strValue; 22114 let result; 22115 switch (operator) { 22116 case '+': 22117 this.advance(); 22118 result = this.parsePrefix(); 22119 return Unary.createPlus(this.span(start), this.sourceSpan(start), result); 22120 case '-': 22121 this.advance(); 22122 result = this.parsePrefix(); 22123 return Unary.createMinus(this.span(start), this.sourceSpan(start), result); 22124 case '!': 22125 this.advance(); 22126 result = this.parsePrefix(); 22127 return new PrefixNot(this.span(start), this.sourceSpan(start), result); 22128 } 22129 } else if (this.next.isKeywordTypeof()) { 22130 this.advance(); 22131 const start = this.inputIndex; 22132 let result = this.parsePrefix(); 22133 return new TypeofExpression(this.span(start), this.sourceSpan(start), result); 22134 } 22135 return this.parseCallChain(); 22136 } 22137 parseCallChain() { 22138 const start = this.inputIndex; 22139 let result = this.parsePrimary(); 22140 while (true) { 22141 if (this.consumeOptionalCharacter($PERIOD)) { 22142 result = this.parseAccessMember(result, start, false); 22143 } else if (this.consumeOptionalOperator('?.')) { 22144 if (this.consumeOptionalCharacter($LPAREN)) { 22145 result = this.parseCall(result, start, true); 22146 } else { 22147 result = this.consumeOptionalCharacter($LBRACKET) ? this.parseKeyedReadOrWrite(result, start, true) : this.parseAccessMember(result, start, true); 22148 } 22149 } else if (this.consumeOptionalCharacter($LBRACKET)) { 22150 result = this.parseKeyedReadOrWrite(result, start, false); 22151 } else if (this.consumeOptionalCharacter($LPAREN)) { 22152 result = this.parseCall(result, start, false); 22153 } else if (this.consumeOptionalOperator('!')) { 22154 result = new NonNullAssert(this.span(start), this.sourceSpan(start), result); 22155 } else { 22156 return result; 22157 } 22158 } 22159 } 22160 parsePrimary() { 22161 const start = this.inputIndex; 22162 if (this.consumeOptionalCharacter($LPAREN)) { 22163 this.rparensExpected++; 22164 const result = this.parsePipe(); 22165 this.rparensExpected--; 22166 this.expectCharacter($RPAREN); 22167 return result; 22168 } else if (this.next.isKeywordNull()) { 22169 this.advance(); 22170 return new LiteralPrimitive(this.span(start), this.sourceSpan(start), null); 22171 } else if (this.next.isKeywordUndefined()) { 22172 this.advance(); 22173 return new LiteralPrimitive(this.span(start), this.sourceSpan(start), void 0); 22174 } else if (this.next.isKeywordTrue()) { 22175 this.advance(); 22176 return new LiteralPrimitive(this.span(start), this.sourceSpan(start), true); 22177 } else if (this.next.isKeywordFalse()) { 22178 this.advance(); 22179 return new LiteralPrimitive(this.span(start), this.sourceSpan(start), false); 22180 } else if (this.next.isKeywordThis()) { 22181 this.advance(); 22182 return new ThisReceiver(this.span(start), this.sourceSpan(start)); 22183 } else if (this.consumeOptionalCharacter($LBRACKET)) { 22184 this.rbracketsExpected++; 22185 const elements = this.parseExpressionList($RBRACKET); 22186 this.rbracketsExpected--; 22187 this.expectCharacter($RBRACKET); 22188 return new LiteralArray(this.span(start), this.sourceSpan(start), elements); 22189 } else if (this.next.isCharacter($LBRACE)) { 22190 return this.parseLiteralMap(); 22191 } else if (this.next.isIdentifier()) { 22192 return this.parseAccessMember(new ImplicitReceiver(this.span(start), this.sourceSpan(start)), start, false); 22193 } else if (this.next.isNumber()) { 22194 const value = this.next.toNumber(); 22195 this.advance(); 22196 return new LiteralPrimitive(this.span(start), this.sourceSpan(start), value); 22197 } else if (this.next.isTemplateLiteralEnd()) { 22198 return this.parseNoInterpolationTemplateLiteral(); 22199 } else if (this.next.isTemplateLiteralPart()) { 22200 return this.parseTemplateLiteral(); 22201 } else if (this.next.isString() && this.next.kind === StringTokenKind.Plain) { 22202 const literalValue = this.next.toString(); 22203 this.advance(); 22204 return new LiteralPrimitive(this.span(start), this.sourceSpan(start), literalValue); 22205 } else if (this.next.isPrivateIdentifier()) { 22206 this._reportErrorForPrivateIdentifier(this.next, null); 22207 return new EmptyExpr$1(this.span(start), this.sourceSpan(start)); 22208 } else if (this.index >= this.tokens.length) { 22209 this.error(`Unexpected end of expression: ${this.input}`); 22210 return new EmptyExpr$1(this.span(start), this.sourceSpan(start)); 22211 } else { 22212 this.error(`Unexpected token ${this.next}`); 22213 return new EmptyExpr$1(this.span(start), this.sourceSpan(start)); 22214 } 22215 } 22216 parseExpressionList(terminator) { 22217 const result = []; 22218 do { 22219 if (!this.next.isCharacter(terminator)) { 22220 result.push(this.parsePipe()); 22221 } else { 22222 break; 22223 } 22224 } while (this.consumeOptionalCharacter($COMMA)); 22225 return result; 22226 } 22227 parseLiteralMap() {
22228 const keys = []; 22229 const values = []; 22230 const start = this.inputIndex; 22231 this.expectCharacter($LBRACE); 22232 if (!this.consumeOptionalCharacter($RBRACE)) { 22233 this.rbracesExpected++; 22234 do { 22235 const keyStart = this.inputIndex; 22236 const quoted = this.next.isString(); 22237 const key = this.expectIdentifierOrKeywordOrString(); 22238 const literalMapKey = { 22239 key, 22240 quoted 22241 }; 22242 keys.push(literalMapKey); 22243 // Properties with quoted keys can't use the shorthand syntax. 22244 if (quoted) { 22245 this.expectCharacter($COLON); 22246 values.push(this.parsePipe()); 22247 } else if (this.consumeOptionalCharacter($COLON)) { 22248 values.push(this.parsePipe()); 22249 } else { 22250 literalMapKey.isShorthandInitialized = true; 22251 const span = this.span(keyStart); 22252 const sourceSpan = this.sourceSpan(keyStart); 22253 values.push(new PropertyRead(span, sourceSpan, sourceSpan, new ImplicitReceiver(span, sourceSpan), key)); 22254 } 22255 } while (this.consumeOptionalCharacter($COMMA) && !this.next.isCharacter($RBRACE)); 22256 this.rbracesExpected--; 22257 this.expectCharacter($RBRACE); 22258 } 22259 return new LiteralMap(this.span(start), this.sourceSpan(start), keys, values); 22260 } 22261 parseAccessMember(readReceiver, start, isSafe) { 22262 const nameStart = this.inputIndex; 22263 const id = this.withContext(ParseContextFlags.Writable, () => { 22264 var _this$expectIdentifie; 22265 const id = (_this$expectIdentifie = this.expectIdentifierOrKeyword()) !== null && _this$expectIdentifie !== void 0 ? _this$expectIdentifie : ''; 22266 if (id.length === 0) { 22267 this.error(`Expected identifier for property access`, readReceiver.span.end); 22268 } 22269 return id; 22270 }); 22271 const nameSpan = this.sourceSpan(nameStart); 22272 let receiver; 22273 if (isSafe) { 22274 if (this.consumeOptionalOperator('=')) { 22275 this.error("The '?.' operator cannot be used in the assignment"); 22276 receiver = new EmptyExpr$1(this.span(start), this.sourceSpan(start)); 22277 } else { 22278 receiver = new SafePropertyRead(this.span(start), this.sourceSpan(start), nameSpan, readReceiver, id); 22279 } 22280 } else { 22281 if (this.consumeOptionalOperator('=')) { 22282 if (!(this.parseFlags & 1 /* ParseFlags.Action */)) { 22283 this.error('Bindings cannot contain assignments'); 22284 return new EmptyExpr$1(this.span(start), this.sourceSpan(start)); 22285 } 22286 const value = this.parseConditional(); 22287 receiver = new PropertyWrite(this.span(start), this.sourceSpan(start), nameSpan, readReceiver, id, value); 22288 } else { 22289 receiver = new PropertyRead(this.span(start), this.sourceSpan(start), nameSpan, readReceiver, id); 22290 } 22291 } 22292 return receiver; 22293 } 22294 parseCall(receiver, start, isSafe) { 22295 const argumentStart = this.inputIndex; 22296 this.rparensExpected++; 22297 const args = this.parseCallArguments(); 22298 const argumentSpan = this.span(argumentStart, this.inputIndex).toAbsolute(this.absoluteOffset); 22299 this.expectCharacter($RPAREN); 22300 this.rparensExpected--; 22301 const span = this.span(start); 22302 const sourceSpan = this.sourceSpan(start); 22303 return isSafe ? new SafeCall(span, sourceSpan, receiver, args, argumentSpan) : new Call(span, sourceSpan, receiver, args, argumentSpan); 22304 } 22305 parseCallArguments() { 22306 if (this.next.isCharacter($RPAREN)) return []; 22307 const positionals = []; 22308 do { 22309 positionals.push(this.parsePipe()); 22310 } while (this.consumeOptionalCharacter($COMMA)); 22311 return positionals; 22312 } 22313 /** 22314 * Parses an identifier, a keyword, a string with an optional `-` in between, 22315 * and returns the string along with its absolute source span. 22316 */ 22317 expectTemplateBindingKey() { 22318 let result = ''; 22319 let operatorFound = false; 22320 const start = this.currentAbsoluteOffset; 22321 do { 22322 result += this.expectIdentifierOrKeywordOrString(); 22323 operatorFound = this.consumeOptionalOperator('-'); 22324 if (operatorFound) { 22325 result += '-'; 22326 } 22327 } while (operatorFound); 22328 return { 22329 source: result, 22330 span: new AbsoluteSourceSpan(start, start + result.length) 22331 }; 22332 } 22333 /** 22334 * Parse microsyntax template expression and return a list of bindings or
22335 * parsing errors in case the given expression is invalid. 22336 * 22337 * For example, 22338 * ```html 22339 * <div *ngFor="let item of items; index as i; trackBy: func"> 22340 * ``` 22341 * contains five bindings: 22342 * 1. ngFor -> null 22343 * 2. item -> NgForOfContext.$implicit 22344 * 3. ngForOf -> items 22345 * 4. i -> NgForOfContext.index 22346 * 5. ngForTrackBy -> func 22347 * 22348 * For a full description of the microsyntax grammar, see 22349 * https://gist.github.com/mhevery/d3530294cff2e4a1b3fe15ff75d08855 22350 * 22351 * @param templateKey name of the microsyntax directive, like ngIf, ngFor, 22352 * without the *, along with its absolute span. 22353 */ 22354 parseTemplateBindings(templateKey) { 22355 const bindings = []; 22356 // The first binding is for the template key itself 22357 // In *ngFor="let item of items", key = "ngFor", value = null 22358 // In *ngIf="cond | pipe", key = "ngIf", value = "cond | pipe" 22359 bindings.push(...this.parseDirectiveKeywordBindings(templateKey)); 22360 while (this.index < this.tokens.length) { 22361 // If it starts with 'let', then this must be variable declaration 22362 const letBinding = this.parseLetBinding(); 22363 if (letBinding) { 22364 bindings.push(letBinding); 22365 } else { 22366 // Two possible cases here, either `value "as" key` or 22367 // "directive-keyword expression". We don't know which case, but both 22368 // "value" and "directive-keyword" are template binding key, so consume 22369 // the key first. 22370 const key = this.expectTemplateBindingKey(); 22371 // Peek at the next token, if it is "as" then this must be variable 22372 // declaration. 22373 const binding = this.parseAsBinding(key); 22374 if (binding) { 22375 bindings.push(binding); 22376 } else { 22377 // Otherwise the key must be a directive keyword, like "of". Transform 22378 // the key to actual key. Eg. of -> ngForOf, trackBy -> ngForTrackBy 22379 key.source = templateKey.source + key.source.charAt(0).toUpperCase() + key.source.substring(1); 22380 bindings.push(...this.parseDirectiveKeywordBindings(key)); 22381 } 22382 } 22383 this.consumeStatementTerminator(); 22384 } 22385 return new TemplateBindingParseResult(bindings, [] /* warnings */, this.errors); 22386 } 22387 parseKeyedReadOrWrite(receiver, start, isSafe) { 22388 return this.withContext(ParseContextFlags.Writable, () => { 22389 this.rbracketsExpected++; 22390 const key = this.parsePipe(); 22391 if (key instanceof EmptyExpr$1) { 22392 this.error(`Key access cannot be empty`); 22393 } 22394 this.rbracketsExpected--; 22395 this.expectCharacter($RBRACKET); 22396 if (this.consumeOptionalOperator('=')) { 22397 if (isSafe) { 22398 this.error("The '?.' operator cannot be used in the assignment"); 22399 } else { 22400 const value = this.parseConditional(); 22401 return new KeyedWrite(this.span(start), this.sourceSpan(start), receiver, key, value); 22402 } 22403 } else { 22404 return isSafe ? new SafeKeyedRead(this.span(start), this.sourceSpan(start), receiver, key) : new KeyedRead(this.span(start), this.sourceSpan(start), receiver, key); 22405 } 22406 return new EmptyExpr$1(this.span(start), this.sourceSpan(start)); 22407 }); 22408 } 22409 /** 22410 * Parse a directive keyword, followed by a mandatory expression. 22411 * For example, "of items", "trackBy: func". 22412 * The bindings are: ngForOf -> items, ngForTrackBy -> func 22413 * There could be an optional "as" binding that follows the expression. 22414 * For example, 22415 * ``` 22416 * *ngFor="let item of items | slice:0:1 as collection". 22417 * ^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^ 22418 * keyword bound target optional 'as' binding 22419 * ``` 22420 * 22421 * @param key binding key, for example, ngFor, ngIf, ngForOf, along with its 22422 * absolute span. 22423 */ 22424 parseDirectiveKeywordBindings(key) { 22425 const bindings = []; 22426 this.consumeOptionalCharacter($COLON); // trackBy: trackByFunction 22427 const value = this.getDirectiveBoundTarget(); 22428 let spanEnd = this.currentAbsoluteOffset; 22429 // The binding could optionally be followed by "as". For example, 22430 // *ngIf="cond | pipe as x". In this case, the key in the "as" binding 22431 // is "x" and the value is the template key itself ("ngIf"). Note that the 22432 // 'key' in the current context now becomes the "value" in the next binding.
22433 const asBinding = this.parseAsBinding(key); 22434 if (!asBinding) { 22435 this.consumeStatementTerminator(); 22436 spanEnd = this.currentAbsoluteOffset; 22437 } 22438 const sourceSpan = new AbsoluteSourceSpan(key.span.start, spanEnd); 22439 bindings.push(new ExpressionBinding(sourceSpan, key, value)); 22440 if (asBinding) { 22441 bindings.push(asBinding); 22442 } 22443 return bindings; 22444 } 22445 /** 22446 * Return the expression AST for the bound target of a directive keyword 22447 * binding. For example, 22448 * ``` 22449 * *ngIf="condition | pipe" 22450 * ^^^^^^^^^^^^^^^^ bound target for "ngIf" 22451 * *ngFor="let item of items" 22452 * ^^^^^ bound target for "ngForOf" 22453 * ``` 22454 */ 22455 getDirectiveBoundTarget() { 22456 if (this.next === EOF || this.peekKeywordAs() || this.peekKeywordLet()) { 22457 return null; 22458 } 22459 const ast = this.parsePipe(); // example: "condition | async" 22460 const { 22461 start, 22462 end 22463 } = ast.span; 22464 const value = this.input.substring(start, end); 22465 return new ASTWithSource(ast, value, this.location, this.absoluteOffset + start, this.errors); 22466 } 22467 /** 22468 * Return the binding for a variable declared using `as`. Note that the order 22469 * of the key-value pair in this declaration is reversed. For example, 22470 * ``` 22471 * *ngFor="let item of items; index as i" 22472 * ^^^^^ ^ 22473 * value key 22474 * ``` 22475 * 22476 * @param value name of the value in the declaration, "ngIf" in the example 22477 * above, along with its absolute span. 22478 */ 22479 parseAsBinding(value) { 22480 if (!this.peekKeywordAs()) { 22481 return null; 22482 } 22483 this.advance(); // consume the 'as' keyword 22484 const key = this.expectTemplateBindingKey(); 22485 this.consumeStatementTerminator(); 22486 const sourceSpan = new AbsoluteSourceSpan(value.span.start, this.currentAbsoluteOffset); 22487 return new VariableBinding(sourceSpan, key, value); 22488 } 22489 /** 22490 * Return the binding for a variable declared using `let`. For example, 22491 * ``` 22492 * *ngFor="let item of items; let i=index;" 22493 * ^^^^^^^^ ^^^^^^^^^^^ 22494 * ``` 22495 * In the first binding, `item` is bound to `NgForOfContext.$implicit`. 22496 * In the second binding, `i` is bound to `NgForOfContext.index`. 22497 */ 22498 parseLetBinding() { 22499 if (!this.peekKeywordLet()) { 22500 return null; 22501 } 22502 const spanStart = this.currentAbsoluteOffset; 22503 this.advance(); // consume the 'let' keyword 22504 const key = this.expectTemplateBindingKey(); 22505 let value = null; 22506 if (this.consumeOptionalOperator('=')) { 22507 value = this.expectTemplateBindingKey(); 22508 } 22509 this.consumeStatementTerminator(); 22510 const sourceSpan = new AbsoluteSourceSpan(spanStart, this.currentAbsoluteOffset); 22511 return new VariableBinding(sourceSpan, key, value); 22512 } 22513 parseNoInterpolationTemplateLiteral() { 22514 const text = this.next.strValue; 22515 const start = this.inputIndex; 22516 this.advance(); 22517 const span = this.span(start); 22518 const sourceSpan = this.sourceSpan(start); 22519 return new TemplateLiteral(span, sourceSpan, [new TemplateLiteralElement(span, sourceSpan, text)], []); 22520 } 22521 parseTemplateLiteral() { 22522 const start = this.inputIndex; 22523 const elements = []; 22524 const expressions = []; 22525 while (this.next !== EOF) { 22526 const token = this.next; 22527 if (token.isTemplateLiteralPart() || token.isTemplateLiteralEnd()) { 22528 const partStart = this.inputIndex; 22529 this.advance(); 22530 elements.push(new TemplateLiteralElement(this.span(partStart), this.sourceSpan(partStart), token.strValue)); 22531 if (token.isTemplateLiteralEnd()) { 22532 break; 22533 } 22534 } else if (token.isTemplateLiteralInterpolationStart()) { 22535 this.advance(); 22536 const expression = this.parsePipe(); 22537 if (expression instanceof EmptyExpr$1) { 22538 this.error('Template literal interpolation cannot be empty'); 22539 } else { 22540 expressions.push(expression); 22541 } 22542 } else { 22543 this.advance(); 22544 } 22545 } 22546 return new TemplateLiteral(this.span(start), this.sourceSpan(start), elements, expressions); 22547 } 22548 /**
22549 * Consume the optional statement terminator: semicolon or comma. 22550 */ 22551 consumeStatementTerminator() { 22552 this.consumeOptionalCharacter($SEMICOLON) || this.consumeOptionalCharacter($COMMA); 22553 } 22554 /** 22555 * Records an error and skips over the token stream until reaching a recoverable point. See 22556 * `this.skip` for more details on token skipping. 22557 */ 22558 error(message, index = null) { 22559 this.errors.push(new ParserError(message, this.input, this.locationText(index), this.location)); 22560 this.skip(); 22561 } 22562 locationText(index = null) { 22563 if (index == null) index = this.index; 22564 return index < this.tokens.length ? `at column ${this.tokens[index].index + 1} in` : `at the end of the expression`; 22565 } 22566 /** 22567 * Records an error for an unexpected private identifier being discovered. 22568 * @param token Token representing a private identifier. 22569 * @param extraMessage Optional additional message being appended to the error. 22570 */ 22571 _reportErrorForPrivateIdentifier(token, extraMessage) { 22572 let errorMessage = `Private identifiers are not supported. Unexpected private identifier: ${token}`; 22573 if (extraMessage !== null) { 22574 errorMessage += `, ${extraMessage}`; 22575 } 22576 this.error(errorMessage); 22577 } 22578 /** 22579 * Error recovery should skip tokens until it encounters a recovery point. 22580 * 22581 * The following are treated as unconditional recovery points: 22582 * - end of input 22583 * - ';' (parseChain() is always the root production, and it expects a ';') 22584 * - '|' (since pipes may be chained and each pipe expression may be treated independently) 22585 * 22586 * The following are conditional recovery points: 22587 * - ')', '}', ']' if one of calling productions is expecting one of these symbols 22588 * - This allows skip() to recover from errors such as '(a.) + 1' allowing more of the AST to 22589 * be retained (it doesn't skip any tokens as the ')' is retained because of the '(' begins 22590 * an '(' <expr> ')' production). 22591 * The recovery points of grouping symbols must be conditional as they must be skipped if 22592 * none of the calling productions are not expecting the closing token else we will never 22593 * make progress in the case of an extraneous group closing symbol (such as a stray ')'). 22594 * That is, we skip a closing symbol if we are not in a grouping production. 22595 * - '=' in a `Writable` context 22596 * - In this context, we are able to recover after seeing the `=` operator, which 22597 * signals the presence of an independent rvalue expression following the `=` operator. 22598 * 22599 * If a production expects one of these token it increments the corresponding nesting count, 22600 * and then decrements it just prior to checking if the token is in the input. 22601 */ 22602 skip() { 22603 let n = this.next; 22604 while (this.index < this.tokens.length && !n.isCharacter($SEMICOLON) && !n.isOperator('|') && (this.rparensExpected <= 0 || !n.isCharacter($RPAREN)) && (this.rbracesExpected <= 0 || !n.isCharacter($RBRACE)) && (this.rbracketsExpected <= 0 || !n.isCharacter($RBRACKET)) && (!(this.context & ParseContextFlags.Writable) || !n.isOperator('='))) { 22605 if (this.next.isError()) { 22606 this.errors.push(new ParserError(this.next.toString(), this.input, this.locationText(), this.location)); 22607 } 22608 this.advance(); 22609 n = this.next; 22610 } 22611 } 22612} 22613class SimpleExpressionChecker extends RecursiveAstVisitor { 22614 constructor(...args) { 22615 super(...args); 22616 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "errors", []); 22617 } 22618 visitPipe() { 22619 this.errors.push('pipes'); 22620 } 22621} 22622/** 22623 * Computes the real offset in the original template for indexes in an interpolation. 22624 * 22625 * Because templates can have encoded HTML entities and the input passed to the parser at this stage 22626 * of the compiler is the _decoded_ value, we need to compute the real offset using the original 22627 * encoded values in the interpolated tokens. Note that this is only a special case handling for 22628 * `MlParserTokenType.ENCODED_ENTITY` token types. All other interpolated tokens are expected to 22629 * have parts which exactly match the input string for parsing the interpolation. 22630 * 22631 * @param interpolatedTokens The tokens for the interpolated value. 22632 * 22633 * @returns A map of index locations in the decoded template to indexes in the original template 22634 */ 22635function getIndexMapForOriginalTemplate(interpolatedTokens) { 22636 let offsetMap = new Map(); 22637 let consumedInOriginalTemplate = 0; 22638 let consumedInInput = 0; 22639 let tokenIndex = 0; 22640 while (tokenIndex < interpolatedTokens.length) { 22641 const currentToken = interpolatedTokens[tokenIndex]; 22642 if (currentToken.type === 9 /* MlParserTokenType.ENCODED_ENTITY */) { 22643 const [decoded, encoded] = currentToken.parts; 22644 consumedInOriginalTemplate += encoded.length; 22645 consumedInInput += decoded.length; 22646 } else { 22647 const lengthOfParts = currentToken.parts.reduce((sum, current) => sum + current.length, 0); 22648 consumedInInput += lengthOfParts; 22649 consumedInOriginalTemplate += lengthOfParts; 22650 } 22651 offsetMap.set(consumedInInput, consumedInOriginalTemplate); 22652 tokenIndex++; 22653 } 22654 return offsetMap; 22655} 22656
22657/** Serializes the given AST into a normalized string format. */ 22658function serialize(expression) { 22659 return expression.visit(new SerializeExpressionVisitor()); 22660} 22661class SerializeExpressionVisitor { 22662 visitUnary(ast, context) { 22663 return `${ast.operator}${ast.expr.visit(this, context)}`; 22664 } 22665 visitBinary(ast, context) { 22666 return `${ast.left.visit(this, context)} ${ast.operation} ${ast.right.visit(this, context)}`; 22667 } 22668 visitChain(ast, context) { 22669 return ast.expressions.map(e => e.visit(this, context)).join('; '); 22670 } 22671 visitConditional(ast, context) { 22672 return `${ast.condition.visit(this, context)} ? ${ast.trueExp.visit(this, context)} : ${ast.falseExp.visit(this, context)}`; 22673 } 22674 visitThisReceiver() { 22675 return 'this'; 22676 } 22677 visitImplicitReceiver() { 22678 return ''; 22679 } 22680 visitInterpolation(ast, context) { 22681 return interleave(ast.strings, ast.expressions.map(e => e.visit(this, context))).join(''); 22682 } 22683 visitKeyedRead(ast, context) { 22684 return `${ast.receiver.visit(this, context)}[${ast.key.visit(this, context)}]`; 22685 } 22686 visitKeyedWrite(ast, context) { 22687 return `${ast.receiver.visit(this, context)}[${ast.key.visit(this, context)}] = ${ast.value.visit(this, context)}`; 22688 } 22689 visitLiteralArray(ast, context) { 22690 return `[${ast.expressions.map(e => e.visit(this, context)).join(', ')}]`; 22691 } 22692 visitLiteralMap(ast, context) { 22693 return `{${zip(ast.keys.map(literal => literal.quoted ? `'${literal.key}'` : literal.key), ast.values.map(value => value.visit(this, context))).map(([key, value]) => `${key}: ${value}`).join(', ')}}`; 22694 } 22695 visitLiteralPrimitive(ast) { 22696 if (ast.value === null) return 'null'; 22697 switch (typeof ast.value) { 22698 case 'number': 22699 case 'boolean': 22700 return ast.value.toString(); 22701 case 'undefined': 22702 return 'undefined'; 22703 case 'string': 22704 return `'${ast.value.replace(/'/g, `\\'`)}'`; 22705 default: 22706 throw new Error(`Unsupported primitive type: ${ast.value}`); 22707 } 22708 } 22709 visitPipe(ast, context) { 22710 return `${ast.exp.visit(this, context)} | ${ast.name}`; 22711 } 22712 visitPrefixNot(ast, context) { 22713 return `!${ast.expression.visit(this, context)}`; 22714 } 22715 visitNonNullAssert(ast, context) { 22716 return `${ast.expression.visit(this, context)}!`; 22717 } 22718 visitPropertyRead(ast, context) { 22719 if (ast.receiver instanceof ImplicitReceiver) { 22720 return ast.name; 22721 } else { 22722 return `${ast.receiver.visit(this, context)}.${ast.name}`; 22723 } 22724 } 22725 visitPropertyWrite(ast, context) { 22726 if (ast.receiver instanceof ImplicitReceiver) { 22727 return `${ast.name} = ${ast.value.visit(this, context)}`; 22728 } else { 22729 return `${ast.receiver.visit(this, context)}.${ast.name} = ${ast.value.visit(this, context)}`; 22730 } 22731 } 22732 visitSafePropertyRead(ast, context) { 22733 return `${ast.receiver.visit(this, context)}?.${ast.name}`; 22734 } 22735 visitSafeKeyedRead(ast, context) { 22736 return `${ast.receiver.visit(this, context)}?.[${ast.key.visit(this, context)}]`; 22737 } 22738 visitCall(ast, context) { 22739 return `${ast.receiver.visit(this, context)}(${ast.args.map(e => e.visit(this, context)).join(', ')})`; 22740 } 22741 visitSafeCall(ast, context) { 22742 return `${ast.receiver.visit(this, context)}?.(${ast.args.map(e => e.visit(this, context)).join(', ')})`; 22743 } 22744 visitTypeofExpression(ast, context) { 22745 return `typeof ${ast.expression.visit(this, context)}`; 22746 } 22747 visitASTWithSource(ast, context) { 22748 return ast.ast.visit(this, context); 22749 } 22750 visitTemplateLiteral(ast, context) { 22751 let result = ''; 22752 for (let i = 0; i < ast.elements.length; i++) { 22753 result += ast.elements[i].visit(this, context); 22754 const expression = i < ast.expressions.length ? ast.expressions[i] : null; 22755 if (expression !== null) { 22756 result += '${' + expression.visit(this, context) + '}'; 22757 } 22758 } 22759 return '`' + result + '`'; 22760 } 22761 visitTemplateLiteralElement(ast, context) { 22762 return ast.text; 22763 } 22764} 22765/** Zips the two input arrays into a single array of pairs of elements at the same index. */ 22766function zip(left, right) { 22767 if (left.length !== right.length) throw new Error('Array lengths must match'); 22768 return left.map((l, i) => [l, right[i]]); 22769} 22770/** 22771 * Interleaves the two arrays, starting with the first item on the left, then the first item 22772 * on the right, second item from the left, and so on. When the first array's items are exhausted,
22773 * the remaining items from the other array are included with no interleaving. 22774 */ 22775function interleave(left, right) { 22776 const result = []; 22777 for (let index = 0; index < Math.max(left.length, right.length); index++) { 22778 if (index < left.length) result.push(left[index]); 22779 if (index < right.length) result.push(right[index]); 22780 } 22781 return result; 22782} 22783 22784// ================================================================================================= 22785// ================================================================================================= 22786// =========== S T O P - S T O P - S T O P - S T O P - S T O P - S T O P =========== 22787// ================================================================================================= 22788// ================================================================================================= 22789// 22790// DO NOT EDIT THIS LIST OF SECURITY SENSITIVE PROPERTIES WITHOUT A SECURITY REVIEW! 22791// Reach out to mprobst for details. 22792// 22793// ================================================================================================= 22794/** Map from tagName|propertyName to SecurityContext. Properties applying to all tags use '*'. */ 22795let _SECURITY_SCHEMA; 22796function SECURITY_SCHEMA() { 22797 if (!_SECURITY_SCHEMA) { 22798 _SECURITY_SCHEMA = {}; 22799 // Case is insignificant below, all element and attribute names are lower-cased for lookup. 22800 registerContext(SecurityContext.HTML, ['iframe|srcdoc', '*|innerHTML', '*|outerHTML']); 22801 registerContext(SecurityContext.STYLE, ['*|style']); 22802 // NB: no SCRIPT contexts here, they are never allowed due to the parser stripping them. 22803 registerContext(SecurityContext.URL, ['*|formAction', 'area|href', 'area|ping', 'audio|src', 'a|href', 'a|ping', 'blockquote|cite', 'body|background', 'del|cite', 'form|action', 'img|src', 'input|src', 'ins|cite', 'q|cite', 'source|src', 'track|src', 'video|poster', 'video|src']); 22804 registerContext(SecurityContext.RESOURCE_URL, ['applet|code', 'applet|codebase', 'base|href', 'embed|src', 'frame|src', 'head|profile', 'html|manifest', 'iframe|src', 'link|href', 'media|src', 'object|codebase', 'object|data', 'script|src']); 22805 } 22806 return _SECURITY_SCHEMA; 22807} 22808function registerContext(ctx, specs) { 22809 for (const spec of specs) _SECURITY_SCHEMA[spec.toLowerCase()] = ctx; 22810} 22811/** 22812 * The set of security-sensitive attributes of an `<iframe>` that *must* be 22813 * applied as a static attribute only. This ensures that all security-sensitive 22814 * attributes are taken into account while creating an instance of an `<iframe>` 22815 * at runtime. 22816 * 22817 * Note: avoid using this set directly, use the `isIframeSecuritySensitiveAttr` function 22818 * in the code instead. 22819 */ 22820const IFRAME_SECURITY_SENSITIVE_ATTRS = new Set(['sandbox', 'allow', 'allowfullscreen', 'referrerpolicy', 'csp', 'fetchpriority']); 22821/** 22822 * Checks whether a given attribute name might represent a security-sensitive 22823 * attribute of an <iframe>. 22824 */ 22825function isIframeSecuritySensitiveAttr(attrName) { 22826 // The `setAttribute` DOM API is case-insensitive, so we lowercase the value 22827 // before checking it against a known security-sensitive attributes. 22828 return IFRAME_SECURITY_SENSITIVE_ATTRS.has(attrName.toLowerCase()); 22829} 22830class ElementSchemaRegistry {} 22831const BOOLEAN = 'boolean'; 22832const NUMBER = 'number'; 22833const STRING = 'string'; 22834const OBJECT = 'object'; 22835/** 22836 * This array represents the DOM schema. It encodes inheritance, properties, and events. 22837 * 22838 * ## Overview 22839 * 22840 * Each line represents one kind of element. The `element_inheritance` and properties are joined 22841 * using `element_inheritance|properties` syntax. 22842 * 22843 * ## Element Inheritance 22844 * 22845 * The `element_inheritance` can be further subdivided as `element1,element2,...^parentElement`. 22846 * Here the individual elements are separated by `,` (commas). Every element in the list 22847 * has identical properties. 22848 * 22849 * An `element` may inherit additional properties from `parentElement` If no `^parentElement` is 22850 * specified then `""` (blank) element is assumed. 22851 * 22852 * NOTE: The blank element inherits from root `[Element]` element, the super element of all 22853 * elements. 22854 * 22855 * NOTE an element prefix such as `:svg:` has no special meaning to the schema. 22856 * 22857 * ## Properties 22858 * 22859 * Each element has a set of properties separated by `,` (commas). Each property can be prefixed 22860 * by a special character designating its type: 22861 * 22862 * - (no prefix): property is a string. 22863 * - `*`: property represents an event. 22864 * - `!`: property is a boolean. 22865 * - `#`: property is a number. 22866 * - `%`: property is an object. 22867 * 22868 * ## Query 22869 * 22870 * The class creates an internal squas representation which allows to easily answer the query of 22871 * if a given property exist on a given element. 22872 * 22873 * NOTE: We don't yet support querying for types or events. 22874 * NOTE: This schema is auto extracted from `schema_extractor.ts` located in the test folder, 22875 * see dom_element_schema_registry_spec.ts 22876 */ 22877// ================================================================================================= 22878// ================================================================================================= 22879// =========== S T O P - S T O P - S T O P - S T O P - S T O P - S T O P =========== 22880// ================================================================================================= 22881// ================================================================================================= 22882// 22883// DO NOT EDIT THIS DOM SCHEMA WITHOUT A SECURITY REVIEW! 22884// 22885// Newly added properties must be security reviewed and assigned an appropriate SecurityContext in 22886// dom_security_schema.ts. Reach out to mprobst & rjamet for details. 22887// 22888// =================================================================================================
22889const SCHEMA = ['[Element]|textContent,%ariaAtomic,%ariaAutoComplete,%ariaBusy,%ariaChecked,%ariaColCount,%ariaColIndex,%ariaColSpan,%ariaCurrent,%ariaDescription,%ariaDisabled,%ariaExpanded,%ariaHasPopup,%ariaHidden,%ariaKeyShortcuts,%ariaLabel,%ariaLevel,%ariaLive,%ariaModal,%ariaMultiLine,%ariaMultiSelectable,%ariaOrientation,%ariaPlaceholder,%ariaPosInSet,%ariaPressed,%ariaReadOnly,%ariaRelevant,%ariaRequired,%ariaRoleDescription,%ariaRowCount,%ariaRowIndex,%ariaRowSpan,%ariaSelected,%ariaSetSize,%ariaSort,%ariaValueMax,%ariaValueMin,%ariaValueNow,%ariaValueText,%classList,className,elementTiming,id,innerHTML,*beforecopy,*beforecut,*beforepaste,*fullscreenchange,*fullscreenerror,*search,*webkitfullscreenchange,*webkitfullscreenerror,outerHTML,%part,#scrollLeft,#scrollTop,slot' + /* added manually to avoid breaking changes */ 22890',*message,*mozfullscreenchange,*mozfullscreenerror,*mozpointerlockchange,*mozpointerlockerror,*webglcontextcreationerror,*webglcontextlost,*webglcontextrestored', '[HTMLElement]^[Element]|accessKey,autocapitalize,!autofocus,contentEditable,dir,!draggable,enterKeyHint,!hidden,!inert,innerText,inputMode,lang,nonce,*abort,*animationend,*animationiteration,*animationstart,*auxclick,*beforexrselect,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*formdata,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*paste,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerrawupdate,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*securitypolicyviolation,*seeked,*seeking,*select,*selectionchange,*selectstart,*slotchange,*stalled,*submit,*suspend,*timeupdate,*toggle,*transitioncancel,*transitionend,*transitionrun,*transitionstart,*volumechange,*waiting,*webkitanimationend,*webkitanimationiteration,*webkitanimationstart,*webkittransitionend,*wheel,outerText,!spellcheck,%style,#tabIndex,title,!translate,virtualKeyboardPolicy', 'abbr,address,article,aside,b,bdi,bdo,cite,content,code,dd,dfn,dt,em,figcaption,figure,footer,header,hgroup,i,kbd,main,mark,nav,noscript,rb,rp,rt,rtc,ruby,s,samp,search,section,small,strong,sub,sup,u,var,wbr^[HTMLElement]|accessKey,autocapitalize,!autofocus,contentEditable,dir,!draggable,enterKeyHint,!hidden,innerText,inputMode,lang,nonce,*abort,*animationend,*animationiteration,*animationstart,*auxclick,*beforexrselect,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*formdata,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*paste,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerrawupdate,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*securitypolicyviolation,*seeked,*seeking,*select,*selectionchange,*selectstart,*slotchange,*stalled,*submit,*suspend,*timeupdate,*toggle,*transitioncancel,*transitionend,*transitionrun,*transitionstart,*volumechange,*waiting,*webkitanimationend,*webkitanimationiteration,*webkitanimationstart,*webkittransitionend,*wheel,outerText,!spellcheck,%style,#tabIndex,title,!translate,virtualKeyboardPolicy', 'media^[HTMLElement]|!autoplay,!controls,%controlsList,%crossOrigin,#currentTime,!defaultMuted,#defaultPlaybackRate,!disableRemotePlayback,!loop,!muted,*encrypted,*waitingforkey,#playbackRate,preload,!preservesPitch,src,%srcObject,#volume', ':svg:^[HTMLElement]|!autofocus,nonce,*abort,*animationend,*animationiteration,*animationstart,*auxclick,*beforexrselect,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contextmenu,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*formdata,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*paste,*pause,*play,*playing,*pointercancel,*pointerdown,*p
22890ointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerrawupdate,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*securitypolicyviolation,*seeked,*seeking,*select,*selectionchange,*selectstart,*slotchange,*stalled,*submit,*suspend,*timeupdate,*toggle,*transitioncancel,*transitionend,*transitionrun,*transitionstart,*volumechange,*waiting,*webkitanimationend,*webkitanimationiteration,*webkitanimationstart,*webkittransitionend,*wheel,%style,#tabIndex', ':svg:graphics^:svg:|', ':svg:animation^:svg:|*begin,*end,*repeat', ':svg:geometry^:svg:|', ':svg:componentTransferFunction^:svg:|', ':svg:gradient^:svg:|', ':svg:textContent^:svg:graphics|', ':svg:textPositioning^:svg:textContent|', 'a^[HTMLElement]|charset,coords,download,hash,host,hostname,href,hreflang,name,password,pathname,ping,port,protocol,referrerPolicy,rel,%relList,rev,search,shape,target,text,type,username', 'area^[HTMLElement]|alt,coords,download,hash,host,hostname,href,!noHref,password,pathname,ping,port,protocol,referrerPolicy,rel,%relList,search,shape,target,username', 'audio^media|', 'br^[HTMLElement]|clear', 'base^[HTMLElement]|href,target', 'body^[HTMLElement]|aLink,background,bgColor,link,*afterprint,*beforeprint,*beforeunload,*blur,*error,*focus,*hashchange,*languagechange,*load,*message,*messageerror,*offline,*online,*pagehide,*pageshow,*popstate,*rejectionhandled,*resize,*scroll,*storage,*unhandledrejection,*unload,text,vLink', 'button^[HTMLElement]|!disabled,formAction,formEnctype,formMethod,!formNoValidate,formTarget,name,type,value', 'canvas^[HTMLElement]|#height,#width', 'content^[HTMLElement]|select', 'dl^[HTMLElement]|!compact', 'data^[HTMLElement]|value', 'datalist^[HTMLElement]|', 'details^[HTMLElement]|!open', 'dialog^[HTMLElement]|!open,returnValue', 'dir^[HTMLElement]|!compact', 'div^[HTMLElement]|align', 'embed^[HTMLElement]|align,height,name,src,type,width', 'fieldset^[HTMLElement]|!disabled,name', 'font^[HTMLElement]|color,face,size', 'form^[HTMLElement]|acceptCharset,action,autocomplete,encoding,enctype,method,name,!noValidate,target', 'frame^[HTMLElement]|frameBorder,longDesc,marginHeight,marginWidth,name,!noResize,scrolling,src', 'frameset^[HTMLElement]|cols,*afterprint,*beforeprint,*beforeunload,*blur,*error,*focus,*hashchange,*languagechange,*load,*message,*messageerror,*offline,*online,*pagehide,*pageshow,*popstate,*rejectionhandled,*resize,*scroll,*storage,*unhandledrejection,*unload,rows', 'hr^[HTMLElement]|align,color,!noShade,size,width', 'head^[HTMLElement]|', 'h1,h2,h3,h4,h5,h6^[HTMLElement]|align', 'html^[HTMLElement]|version', 'iframe^[HTMLElement]|align,allow,!allowFullscreen,!allowPaymentRequest,csp,frameBorder,height,loading,longDesc,marginHeight,marginWidth,name,referrerPolicy,%sandbox,scrolling,src,srcdoc,width', 'img^[HTMLElement]|align,alt,border,%crossOrigin,decoding,#height,#hspace,!isMap,loading,longDesc,lowsrc,name,referrerPolicy,sizes,src,srcset,useMap,#vspace,#width', 'input^[HTMLElement]|accept,align,alt,autocomplete,!checked,!defaultChecked,defaultValue,dirName,!disabled,%files,formAction,formEnctype,formMethod,!formNoValidate,formTarget,#height,!incremental,!indeterminate,max,#maxLength,min,#minLength,!multiple,name,pattern,placeholder,!readOnly,!required,selectionDirection,#selectionEnd,#selectionStart,#size,src,step,type,useMap,value,%valueAsDate,#valueAsNumber,#width', 'li^[HTMLElement]|type,#value', 'label^[HTMLElement]|htmlFor', 'legend^[HTMLElement]|align', 'link^[HTMLElement]|as,charset,%crossOrigin,!disabled,href,hreflang,imageSizes,imageSrcset,integrity,media,referrerPolicy,rel,%relList,rev,%sizes,target,type', 'map^[HTMLElement]|name', 'marquee^[HTMLElement]|behavior,bgColor,direction,height,#hspace,#loop,#scrollAmount,#scrollDelay,!trueSpeed,#vspace,width', 'menu^[HTMLElement]|!compact', 'meta^[HTMLElement]|content,httpEquiv,media,name,scheme', 'meter^[HTMLElement]|#high,#low,#max,#min,#optimum,#value', 'ins,del^[HTMLElement]|cite,dateTime', 'ol^[HTMLElement]|!compact,!reversed,#start,type', 'object^[HTMLElement]|align,archive,border,code,codeBase,codeType,data,!declare,height,#hspace,name,standby,type,useMap,#vspace,width', 'optgroup^[HTMLElement]|!disabled,label', 'option^[HTMLElement]|!defaultSelected,!disabled,label,!selected,text,value', 'output^[HTMLElement]|defaultValue,%htmlFor,name,value', 'p^[HTMLElement]|align', 'param^[HTMLElement]|name,type,value,valueType', 'picture^[HTMLElement]|', 'pre^[HTMLElement]|#width', 'progress^[HTMLElement]|#max,#value', 'q,blockquote,cite^[HTMLElement]|', 'script^[HTMLElement]|!async,charset,%crossOrigin,!defer,event,htmlFor,integrity,!noModule,%referrerPolicy,src,text,type', 'select^[HTMLElement]|autocomplete,!disabled,#length,!multiple,name,!required,#selectedIndex,#size,value', 'slot^[HTMLElement]|name', 'source^[HTMLElement]|#height,media,sizes,src,srcset,type,#width', 'span^[HTMLElement]|', 'style^[HTMLElement]|!disabled,media,type', 'search^[HTMLELement]|', 'caption^[HTMLElement]|align', 'th,td^[HTMLElement]|abbr,align,axis,bgColor,ch,chOff,#colSpan,headers,height,!noWrap,#rowSpan,scope,vAlign,width', 'col,colgroup^[HTMLElement]|align,ch,chOff,#span,vAlign,width', 'table^[HTMLElement]|align,bgColor,border,%caption,cellPadding,cellSpacing,frame,rules,summary,%tFoot,%tHead,width', 'tr^[HTMLElement]|align,bgColor,ch,chOff,vAlign', 'tfoot,thead,tbody^[HTMLElement]|align,ch,chOff,vAlign', 'template^[HTMLElement]|', 'textarea^[HTMLElement]|autocomplete,#cols,defaultValue,dirName,!disabled,#maxLength,#minLength,name,placeholder,!readOnly,!required,#rows,selectionDirection,#selectionEnd,#selectionStart,value,wrap', 'time^[HTMLElement]|dateTime', 'title^[HTMLElement]|text', 'track^[HTMLElement]|!default,kind,label,src,srclang', 'ul^[HTMLElement]|!compact,type', 'unknown^[HTMLElement]|', 'video^media|!disablePictureInPicture,#height,*enterpictureinpicture,*leavepictureinpicture,!playsInline,poster,#width', ':svg:a^:svg:graphics|', ':svg:animate^:svg:animation|', ':svg:animateMotion^:svg:animation|', ':svg:animateTransform^:svg:animation|', ':svg:circle^:svg:geometry|', ':svg:clipPath^:svg:graphics|', ':svg:defs^:svg:graphics|', ':svg:desc^:svg:|', ':svg:discard^:svg:|', ':svg:ellipse^:svg:geometry|', ':svg:feBlend^:svg:|', ':svg:feColorMatrix^:svg:|', ':svg:feComponentTransfer^:svg:|', ':svg:feComposite^:svg:|', ':svg:feConvolveMatrix^:svg:|', ':svg:feDiffuseLighting^:svg:|', ':svg:feDisplacementMap^:svg:|', ':svg:feDistantLight^:svg:|', ':svg:feDropShadow^:svg:|', ':svg:feFlood^:svg:|', ':svg:feFuncA^:svg:componentTransferFunction|', ':svg:feFuncB^:svg:componentTransferFunction|', ':svg:feFuncG^:svg:componentTransferFunction|', ':svg:feFuncR^:svg:componentTransferFunction|', ':svg:feGaussianBlur^:svg:|', ':svg:feImage^:svg:|', ':svg:feMerge^:svg:|', ':svg:feMergeNode^:svg:|', ':svg:feMorphology^:svg:|', ':svg:feOffset^:svg:|', ':svg:fePointLight^:svg:|', ':svg:feSpecularLighting^:svg:|', ':svg:feSpotLight^:svg:|', ':svg:feTile^:svg:|', ':svg:feTurbulence^:svg:|', ':svg:filter^:svg:|', ':svg:foreignObject^:svg:graphics|', ':svg:g^:svg:graphics|', ':svg:image^:svg:graphics|decoding', ':svg:line^:svg:geometry|', ':svg:linearGradient^:svg:gradient|', ':svg:mpath^:svg:|', ':svg:marker^:svg:|', ':svg:mask^:svg:|', ':svg:metadata^:svg:|', ':svg:path^:svg:geometry|', ':svg:pattern^:svg:|', ':svg:polygon^:svg:geometry|', ':svg:polyline^:svg:geometry|', ':svg:radialGradient^:svg:gradient|', ':svg:rect^:svg:geometry|', ':svg:svg^:svg:graphics|#currentScale,#zoomAndPan', ':svg:script^:svg:|type', ':svg:set^:svg:animation|', ':svg:stop^:svg:|', ':svg:style^:svg:|!disabled,media,title,type', ':svg:switch^:svg:graphics|', ':svg:symbol^:svg:|', ':svg:tspan^:svg:textPositioning|', ':svg:text^:svg:textPositioning|', ':svg:textPath^:svg:textContent|', ':svg:title^:svg:|', ':svg:use^:svg:graphics|', ':svg:view^:svg:|#zoomAndPan', 'data^[HTMLElement]|value', 'keygen^[HTMLElement]|!autofocus,challenge,!disabled,form,keytype,name', 'menuitem^[HTMLElement]|type,label,icon,!disabled,!checked,radiogroup,!default', 'summary^[HTMLElement]|', 'time^[HTMLElement]|dateTime', ':svg:cursor^:svg:|', ':math:^[HTMLElement]|!autofocus,nonce,*abort,*animationend,*animationiteration,*animationstart,*auxcl
22890ick,*beforeinput,*beforematch,*beforetoggle,*beforexrselect,*blur,*cancel,*canplay,*canplaythrough,*change,*click,*close,*contentvisibilityautostatechange,*contextlost,*contextmenu,*contextrestored,*copy,*cuechange,*cut,*dblclick,*drag,*dragend,*dragenter,*dragleave,*dragover,*dragstart,*drop,*durationchange,*emptied,*ended,*error,*focus,*formdata,*gotpointercapture,*input,*invalid,*keydown,*keypress,*keyup,*load,*loadeddata,*loadedmetadata,*loadstart,*lostpointercapture,*mousedown,*mouseenter,*mouseleave,*mousemove,*mouseout,*mouseover,*mouseup,*mousewheel,*paste,*pause,*play,*playing,*pointercancel,*pointerdown,*pointerenter,*pointerleave,*pointermove,*pointerout,*pointerover,*pointerrawupdate,*pointerup,*progress,*ratechange,*reset,*resize,*scroll,*scrollend,*securitypolicyviolation,*seeked,*seeking,*select,*selectionchange,*selectstart,*slotchange,*stalled,*submit,*suspend,*timeupdate,*toggle,*transitioncancel,*transitionend,*transitionrun,*transitionstart,*volumechange,*waiting,*webkitanimationend,*webkitanimationiteration,*webkitanimationstart,*webkittransitionend,*wheel,%style,#tabIndex', ':math:math^:math:|', ':math:maction^:math:|', ':math:menclose^:math:|', ':math:merror^:math:|', ':math:mfenced^:math:|', ':math:mfrac^:math:|', ':math:mi^:math:|', ':math:mmultiscripts^:math:|', ':math:mn^:math:|', ':math:mo^:math:|', ':math:mover^:math:|', ':math:mpadded^:math:|', ':math:mphantom^:math:|', ':math:mroot^:math:|', ':math:mrow^:math:|', ':math:ms^
22890:math:|', ':math:mspace^:math:|', ':math:msqrt^:math:|', ':math:mstyle^:math:|', ':math:msub^:math:|', ':math:msubsup^:math:|', ':math:msup^:math:|', ':math:mtable^:math:|', ':math:mtd^:math:|', ':math:mtext^:math:|', ':math:mtr^:math:|', ':math:munder^:math:|', ':math:munderover^:math:|', ':math:semantics^:math:|']; 22891const _ATTR_TO_PROP = new Map(Object.entries({ 22892 'class': 'className', 22893 'for': 'htmlFor', 22894 'formaction': 'formAction', 22895 'innerHtml': 'innerHTML', 22896 'readonly': 'readOnly', 22897 'tabindex': 'tabIndex' 22898})); 22899// Invert _ATTR_TO_PROP. 22900const _PROP_TO_ATTR = Array.from(_ATTR_TO_PROP).reduce((inverted, [propertyName, attributeName]) => { 22901 inverted.set(propertyName, attributeName); 22902 return inverted; 22903}, new Map()); 22904class DomElementSchemaRegistry extends ElementSchemaRegistry { 22905 constructor() { 22906 super(); 22907 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_schema", new Map()); 22908 // We don't allow binding to events for security reasons. Allowing event bindings would almost 22909 // certainly introduce bad XSS vulnerabilities. Instead, we store events in a separate schema. 22910 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_eventSchema", new Map()); 22911 SCHEMA.forEach(encodedType => { 22912 const type = new Map(); 22913 const events = new Set(); 22914 const [strType, strProperties] = encodedType.split('|'); 22915 const properties = strProperties.split(','); 22916 const [typeNames, superName] = strType.split('^'); 22917 typeNames.split(',').forEach(tag => { 22918 this._schema.set(tag.toLowerCase(), type); 22919 this._eventSchema.set(tag.toLowerCase(), events); 22920 }); 22921 const superType = superName && this._schema.get(superName.toLowerCase()); 22922 if (superType) { 22923 for (const [prop, value] of superType) { 22924 type.set(prop, value); 22925 } 22926 for (const superEvent of this._eventSchema.get(superName.toLowerCase())) { 22927 events.add(superEvent); 22928 } 22929 } 22930 properties.forEach(property => { 22931 if (property.length > 0) { 22932 switch (property[0]) { 22933 case '*': 22934 events.add(property.substring(1)); 22935 break; 22936 case '!': 22937 type.set(property.substring(1), BOOLEAN); 22938 break; 22939 case '#': 22940 type.set(property.substring(1), NUMBER); 22941 break; 22942 case '%': 22943 type.set(property.substring(1), OBJECT); 22944 break; 22945 default: 22946 type.set(property, STRING); 22947 } 22948 } 22949 }); 22950 }); 22951 } 22952 hasProperty(tagName, propName, schemaMetas) { 22953 if (schemaMetas.some(schema => schema.name === NO_ERRORS_SCHEMA.name)) { 22954 return true; 22955 } 22956 if (tagName.indexOf('-') > -1) { 22957 if (isNgContainer(tagName) || isNgContent(tagName)) { 22958 return false; 22959 } 22960 if (schemaMetas.some(schema => schema.name === CUSTOM_ELEMENTS_SCHEMA.name)) { 22961 // Can't tell now as we don't know which properties a custom element will get 22962 // once it is instantiated 22963 return true; 22964 } 22965 } 22966 const elementProperties = this._schema.get(tagName.toLowerCase()) || this._schema.get('unknown'); 22967 return elementProperties.has(propName); 22968 } 22969 hasElement(tagName, schemaMetas) { 22970 if (schemaMetas.some(schema => schema.name === NO_ERRORS_SCHEMA.name)) { 22971 return true; 22972 } 22973 if (tagName.indexOf('-') > -1) { 22974 if (isNgContainer(tagName) || isNgContent(tagName)) { 22975 return true; 22976 } 22977 if (schemaMetas.some(schema => schema.name === CUSTOM_ELEMENTS_SCHEMA.name)) { 22978 // Allow any custom elements 22979 return true; 22980 } 22981 } 22982 return this._schema.has(tagName.toLowerCase()); 22983 } 22984 /** 22985 * securityContext returns the security context for the given property on the given DOM tag. 22986 * 22987 * Tag and property name are statically known and cannot change at runtime, i.e. it is not 22988 * possible to bind a value into a changing attribute or tag name. 22989 * 22990 * The filtering is based on a list of allowed tags|attributes. All attributes in the schema 22991 * above are assumed to have the 'NONE' security context, i.e. that they are safe inert
22992 * string values. Only specific well known attack vectors are assigned their appropriate context. 22993 */ 22994 securityContext(tagName, propName, isAttribute) { 22995 if (isAttribute) { 22996 // NB: For security purposes, use the mapped property name, not the attribute name. 22997 propName = this.getMappedPropName(propName); 22998 } 22999 // Make sure comparisons are case insensitive, so that case differences between attribute and 23000 // property names do not have a security impact. 23001 tagName = tagName.toLowerCase(); 23002 propName = propName.toLowerCase(); 23003 let ctx = SECURITY_SCHEMA()[tagName + '|' + propName]; 23004 if (ctx) { 23005 return ctx; 23006 } 23007 ctx = SECURITY_SCHEMA()['*|' + propName]; 23008 return ctx ? ctx : SecurityContext.NONE; 23009 } 23010 getMappedPropName(propName) { 23011 var _ATTR_TO_PROP$get; 23012 return (_ATTR_TO_PROP$get = _ATTR_TO_PROP.get(propName)) !== null && _ATTR_TO_PROP$get !== void 0 ? _ATTR_TO_PROP$get : propName; 23013 } 23014 getDefaultComponentElementName() { 23015 return 'ng-component'; 23016 } 23017 validateProperty(name) { 23018 if (name.toLowerCase().startsWith('on')) { 23019 const msg = `Binding to event property '${name}' is disallowed for security reasons, ` + `please use (${name.slice(2)})=...` + `\nIf '${name}' is a directive input, make sure the directive is imported by the` + ` current module.`; 23020 return { 23021 error: true, 23022 msg: msg 23023 }; 23024 } else { 23025 return { 23026 error: false 23027 }; 23028 } 23029 } 23030 validateAttribute(name) { 23031 if (name.toLowerCase().startsWith('on')) { 23032 const msg = `Binding to event attribute '${name}' is disallowed for security reasons, ` + `please use (${name.slice(2)})=...`; 23033 return { 23034 error: true, 23035 msg: msg 23036 }; 23037 } else { 23038 return { 23039 error: false 23040 }; 23041 } 23042 } 23043 allKnownElementNames() { 23044 return Array.from(this._schema.keys()); 23045 } 23046 allKnownAttributesOfElement(tagName) { 23047 const elementProperties = this._schema.get(tagName.toLowerCase()) || this._schema.get('unknown'); 23048 // Convert properties to attributes. 23049 return Array.from(elementProperties.keys()).map(prop => { 23050 var _PROP_TO_ATTR$get; 23051 return (_PROP_TO_ATTR$get = _PROP_TO_ATTR.get(prop)) !== null && _PROP_TO_ATTR$get !== void 0 ? _PROP_TO_ATTR$get : prop; 23052 }); 23053 } 23054 allKnownEventsOfElement(tagName) { 23055 var _this$_eventSchema$ge; 23056 return Array.from((_this$_eventSchema$ge = this._eventSchema.get(tagName.toLowerCase())) !== null && _this$_eventSchema$ge !== void 0 ? _this$_eventSchema$ge : []); 23057 } 23058 normalizeAnimationStyleProperty(propName) { 23059 return dashCaseToCamelCase(propName); 23060 } 23061 normalizeAnimationStyleValue(camelCaseProp, userProvidedProp, val) { 23062 let unit = ''; 23063 const strVal = val.toString().trim(); 23064 let errorMsg = null; 23065 if (_isPixelDimensionStyle(camelCaseProp) && val !== 0 && val !== '0') { 23066 if (typeof val === 'number') { 23067 unit = 'px'; 23068 } else { 23069 const valAndSuffixMatch = val.match(/^[+-]?[\d\.]+([a-z]*)$/); 23070 if (valAndSuffixMatch && valAndSuffixMatch[1].length == 0) { 23071 errorMsg = `Please provide a CSS unit value for ${userProvidedProp}:${val}`; 23072 } 23073 } 23074 } 23075 return { 23076 error: errorMsg, 23077 value: strVal + unit 23078 }; 23079 } 23080} 23081function _isPixelDimensionStyle(prop) { 23082 switch (prop) { 23083 case 'width': 23084 case 'height': 23085 case 'minWidth': 23086 case 'minHeight': 23087 case 'maxWidth': 23088 case 'maxHeight': 23089 case 'left': 23090 case 'top': 23091 case 'bottom': 23092 case 'right': 23093 case 'fontSize': 23094 case 'outlineWidth': 23095 case 'outlineOffset': 23096 case 'paddingTop': 23097 case 'paddingLeft': 23098 case 'paddingBottom': 23099 case 'paddingRight': 23100 case 'marginTop': 23101 case 'marginLeft': 23102 case 'marginBottom': 23103 case 'marginRight': 23104 case 'borderRadius': 23105 case 'borderWidth': 23106 case 'borderTopWidth': 23107 case 'borderLeftWidth': 23108 case 'borderRightWidth': 23109 case 'borderBottomWidth': 23110 case 'textIndent': 23111 return true; 23112 default: 23113 return false; 23114 } 23115} 23116class HtmlTagDefinition { 23117 constructor({ 23118 closedByChildren, 23119 implicitNamespacePrefix, 23120 contentType = TagContentType.PARSABLE_DATA, 23121 closedByParent = false, 23122 isVoid = false, 23123 ignoreFirstLf = false, 23124 preventNamespaceInheritance = false, 23125 canSelfClose = false 23126 }
23126 = {}) { 23127 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "closedByChildren", {}); 23128 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "contentType", void 0); 23129 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "closedByParent", false); 23130 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "implicitNamespacePrefix", void 0); 23131 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "isVoid", void 0); 23132 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "ignoreFirstLf", void 0); 23133 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "canSelfClose", void 0); 23134 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "preventNamespaceInheritance", void 0); 23135 if (closedByChildren && closedByChildren.length > 0) { 23136 closedByChildren.forEach(tagName => this.closedByChildren[tagName] = true); 23137 } 23138 this.isVoid = isVoid; 23139 this.closedByParent = closedByParent || isVoid; 23140 this.implicitNamespacePrefix = implicitNamespacePrefix || null; 23141 this.contentType = contentType; 23142 this.ignoreFirstLf = ignoreFirstLf; 23143 this.preventNamespaceInheritance = preventNamespaceInheritance; 23144 this.canSelfClose = canSelfClose !== null && canSelfClose !== void 0 ? canSelfClose : isVoid; 23145 } 23146 isClosedByChild(name) { 23147 return this.isVoid || name.toLowerCase() in this.closedByChildren; 23148 } 23149 getContentType(prefix) { 23150 if (typeof this.contentType === 'object') { 23151 const overrideType = prefix === undefined ? undefined : this.contentType[prefix]; 23152 return overrideType !== null && overrideType !== void 0 ? overrideType : this.contentType.default; 23153 } 23154 return this.contentType; 23155 } 23156} 23157let DEFAULT_TAG_DEFINITION; 23158// see https://www.w3.org/TR/html51/syntax.html#optional-tags 23159// This implementation does not fully conform to the HTML5 spec. 23160let TAG_DEFINITIONS; 23161function getHtmlTagDefinition(tagName) { 23162 var _ref2, _TAG_DEFINITIONS$tagN; 23163 if (!TAG_DEFINITIONS) { 23164 DEFAULT_TAG_DEFINITION = new HtmlTagDefinition({ 23165 canSelfClose: true 23166 }); 23167 TAG_DEFINITIONS = Object.assign(Object.create(null), { 23168 'base': new HtmlTagDefinition({ 23169 isVoid: true 23170 }), 23171 'meta': new HtmlTagDefinition({ 23172 isVoid: true 23173 }), 23174 'area': new HtmlTagDefinition({ 23175 isVoid: true 23176 }), 23177 'embed': new HtmlTagDefinition({ 23178 isVoid: true 23179 }), 23180 'link': new HtmlTagDefinition({ 23181 isVoid: true 23182 }), 23183 'img': new HtmlTagDefinition({ 23184 isVoid: true 23185 }), 23186 'input': new HtmlTagDefinition({ 23187 isVoid: true 23188 }), 23189 'param': new HtmlTagDefinition({ 23190 isVoid: true 23191 }), 23192 'hr': new HtmlTagDefinition({ 23193 isVoid: true 23194 }), 23195 'br': new HtmlTagDefinition({ 23196 isVoid: true 23197 }), 23198 'source': new HtmlTagDefinition({ 23199 isVoid: true 23200 }), 23201 'track': new HtmlTagDefinition({ 23202 isVoid: true 23203 }), 23204 'wbr': new HtmlTagDefinition({ 23205 isVoid: true 23206 }), 23207 'p': new HtmlTagDefinition({ 23208 closedByChildren: ['address', 'article', 'aside', 'blockquote', 'div', 'dl', 'fieldset', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'hgroup', 'hr', 'main', 'nav', 'ol', 'p', 'pre', 'section', 'table', 'ul'], 23209 closedByParent: true 23210 }), 23211 'thead': new HtmlTagDefinition({ 23212 closedByChildren: ['tbody', 'tfoot'] 23213 }), 23214 'tbody': new HtmlTagDefinition({ 23215 closedByChildren: ['tbody', 'tfoot'], 23216 closedByParent: true 23217 }), 23218 'tfoot': new HtmlTagDefinition({ 23219 closedByChildren: ['tbody'], 23220 closedByParent: true 23221 }), 23222 'tr': new HtmlTagDefinition({ 23223 closedByChildren: ['tr'], 23224 closedByParent: true 23225 }), 23226 'td': new HtmlTagDefinition({ 23227 closedByChildren: ['td', 'th'], 23228 closedByParent: true 23229 }), 23230 'th': new HtmlTagDefinition({ 23231 closedByChildren: ['td', 'th'], 23232 closedByParent: true 23233 }), 23234 'col': new HtmlTagDefinition({ 23235 isVoid: true 23236 }), 23237 'svg': new HtmlTagDefinition({ 23238 implicitNamespacePrefix: 'svg' 23239 }), 23240 'foreignObject': new HtmlTagDefinition({ 23241 // Usually the implicit namespace here would be redundant since it will be inherited from 23242 // the parent `svg`, but we have to do it for `foreignObject`, because the way the parser 23243 // works is that the parent node of an end tag is its own start tag which means that 23244 // the `preventNamespaceInheritance` on `foreignObject` would have it default to the 23245 // implicit namespace which is `html`, unless specified otherwise. 23246 implicitNamespacePrefix: 'svg', 23247 // We want to prevent children of foreignObject from inheriting its namespace, because 23248 // the point of the element is to allow nodes from other namespaces to be inserted. 23249 preventNamespaceInheritance: true 23250 }), 23251 'math': new HtmlTagDefinition({ 23252 implicitNamespacePrefix: 'math' 23253 }), 23254 'li': new HtmlTagDefinition({ 23255 closedByChildren: ['li'], 23256 closedByParent: true 23257 }), 23258 'dt': new HtmlTagDefinition({ 23259 closedByChildren: ['dt', 'dd'] 23260 }), 23261 'dd': new HtmlTagDefinition({ 23262 closedByChildren: ['dt', 'dd'], 23263 closedByParent: true 23264 }), 23265 'rb': new HtmlTagDefinition({ 23266 closedByChildren: ['rb', 'rt', 'rtc', 'rp'], 23267 closedByParent: true 23268 }), 23269 'rt': new HtmlTagDefinition({ 23270 closedByChildren: ['rb', 'rt', 'rtc', 'rp'], 23271 closedByParent: true 23272 }), 23273 'rtc': new HtmlTagDefinition({ 23274 closedByChildren: ['rb', 'rtc', 'rp'], 23275 closedByParent: true 23276 }), 23277 'rp': new HtmlTagDefinition({ 23278 closedByChildren: ['rb', 'rt', 'rtc', 'rp'], 23279 closedByParent: true 23280 }), 23281 'optgroup': new HtmlTagDefinition({ 23282 closedByChildren: ['optgroup'], 23283 closedByParent: true 23284 }), 23285 'option': new HtmlTagDefinition({ 23286 closedByChildren: ['option', 'optgroup'], 23287 closedByParent: true 23288 }), 23289 'pre': new HtmlTagDefinition({ 23290 ignoreFirstLf: true 23291 }), 23292 'listing': new HtmlTagDefinition({ 23293 ignoreFirstLf: true 23294 }), 23295 'style': new HtmlTagDefinition({ 23296 contentType: TagContentType.RAW_TEXT 23297 }), 23298 'script': new HtmlTagDefinition({ 23299 contentType: TagContentType.RAW_TEXT 23300 }), 23301 'title': new HtmlTagDefinition({ 23302 // The browser supports two separate `title` tags which have to use
23303 // a different content type: `HTMLTitleElement` and `SVGTitleElement` 23304 contentType: { 23305 default: TagContentType.ESCAPABLE_RAW_TEXT, 23306 svg: TagContentType.PARSABLE_DATA 23307 } 23308 }), 23309 'textarea': new HtmlTagDefinition({ 23310 contentType: TagContentType.ESCAPABLE_RAW_TEXT, 23311 ignoreFirstLf: true 23312 }) 23313 }); 23314 new DomElementSchemaRegistry().allKnownElementNames().forEach(knownTagName => { 23315 if (!TAG_DEFINITIONS[knownTagName] && getNsPrefix(knownTagName) === null) { 23316 TAG_DEFINITIONS[knownTagName] = new HtmlTagDefinition({ 23317 canSelfClose: false 23318 }); 23319 } 23320 }); 23321 } 23322 // We have to make both a case-sensitive and a case-insensitive lookup, because 23323 // HTML tag names are case insensitive, whereas some SVG tags are case sensitive. 23324 return (_ref2 = (_TAG_DEFINITIONS$tagN = TAG_DEFINITIONS[tagName]) !== null && _TAG_DEFINITIONS$tagN !== void 0 ? _TAG_DEFINITIONS$tagN : TAG_DEFINITIONS[tagName.toLowerCase()]) !== null && _ref2 !== void 0 ? _ref2 : DEFAULT_TAG_DEFINITION; 23325} 23326const TAG_TO_PLACEHOLDER_NAMES = { 23327 'A': 'LINK', 23328 'B': 'BOLD_TEXT', 23329 'BR': 'LINE_BREAK', 23330 'EM': 'EMPHASISED_TEXT', 23331 'H1': 'HEADING_LEVEL1', 23332 'H2': 'HEADING_LEVEL2', 23333 'H3': 'HEADING_LEVEL3', 23334 'H4': 'HEADING_LEVEL4', 23335 'H5': 'HEADING_LEVEL5', 23336 'H6': 'HEADING_LEVEL6', 23337 'HR': 'HORIZONTAL_RULE', 23338 'I': 'ITALIC_TEXT', 23339 'LI': 'LIST_ITEM', 23340 'LINK': 'MEDIA_LINK', 23341 'OL': 'ORDERED_LIST', 23342 'P': 'PARAGRAPH', 23343 'Q': 'QUOTATION', 23344 'S': 'STRIKETHROUGH_TEXT', 23345 'SMALL': 'SMALL_TEXT', 23346 'SUB': 'SUBSTRIPT', 23347 'SUP': 'SUPERSCRIPT', 23348 'TBODY': 'TABLE_BODY', 23349 'TD': 'TABLE_CELL', 23350 'TFOOT': 'TABLE_FOOTER', 23351 'TH': 'TABLE_HEADER_CELL', 23352 'THEAD': 'TABLE_HEADER', 23353 'TR': 'TABLE_ROW', 23354 'TT': 'MONOSPACED_TEXT', 23355 'U': 'UNDERLINED_TEXT', 23356 'UL': 'UNORDERED_LIST' 23357}; 23358/** 23359 * Creates unique names for placeholder with different content. 23360 * 23361 * Returns the same placeholder name when the content is identical. 23362 */ 23363class PlaceholderRegistry { 23364 constructor() { 23365 // Count the occurrence of the base name top generate a unique name 23366 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_placeHolderNameCounts", {}); 23367 // Maps signature to placeholder names 23368 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_signatureToName", {}); 23369 } 23370 getStartTagPlaceholderName(tag, attrs, isVoid) { 23371 const signature = this._hashTag(tag, attrs, isVoid); 23372 if (this._signatureToName[signature]) { 23373 return this._signatureToName[signature]; 23374 } 23375 const upperTag = tag.toUpperCase(); 23376 const baseName = TAG_TO_PLACEHOLDER_NAMES[upperTag] || `TAG_${upperTag}`; 23377 const name = this._generateUniqueName(isVoid ? baseName : `START_${baseName}`); 23378 this._signatureToName[signature] = name; 23379 return name; 23380 } 23381 getCloseTagPlaceholderName(tag) { 23382 const signature = this._hashClosingTag(tag); 23383 if (this._signatureToName[signature]) { 23384 return this._signatureToName[signature]; 23385 } 23386 const upperTag = tag.toUpperCase(); 23387 const baseName = TAG_TO_PLACEHOLDER_NAMES[upperTag] || `TAG_${upperTag}`; 23388 const name = this._generateUniqueName(`CLOSE_${baseName}`); 23389 this._signatureToName[signature] = name; 23390 return name; 23391 } 23392 getPlaceholderName(name, content) { 23393 const upperName = name.toUpperCase(); 23394 const signature = `PH: ${upperName}=${content}`; 23395 if (this._signatureToName[signature]) { 23396 return this._signatureToName[signature]; 23397 } 23398 const uniqueName = this._generateUniqueName(upperName); 23399 this._signatureToName[signature] = uniqueName; 23400 return uniqueName; 23401 } 23402 getUniquePlaceholder(name) { 23403 return this._generateUniqueName(name.toUpperCase()); 23404 } 23405 getStartBlockPlaceholderName(name, parameters) { 23406 const signature = this._hashBlock(name, parameters); 23407 if (this._signatureToName[signature]) { 23408 return this._signatureToName[signature]; 23409 } 23410 const placeholder = this._generateUniqueName(`START_BLOCK_${this._toSnakeCase(name)}`); 23411 this._signatureToName[signature] = placeholder; 23412 return placeholder; 23413 } 23414 getCloseBlockPlaceholderName(name) { 23415 const signature = this._hashClosingBlock(name); 23416 if (this._signatureToName[signature]) { 23417 return this._signatureToName[signature]; 23418 } 23419 const placeholder = this._generateUniqueName(`CLOSE_BLOCK_${this._toSnakeCase(name)}`); 23420 this._signatureToName[signature] = placeholder; 23421 return placeholder; 23422 } 23423 // Generate a hash for a tag - does not take attribute order into account 23424 _hashTag(tag, attrs, isVoid) { 23425 const start = `<${tag}`; 23426 const strAttrs = Object.keys(attrs).sort().map(name => ` ${name}=${attrs[name]}`).join(''); 23427 const end = isVoid ? '/>' : `></${tag}>`; 23428 return start + strAttrs + end; 23429 } 23430 _hashClosingTag(tag) { 23431 return this._hashTag(`/${tag}`, {}, false); 23432 } 23433 _hashBlock(name, parameters) { 23434 const params = parameters.length === 0 ? '' : ` (${parameters.sort().join('; ')})`; 23435 return `@${name}${params} {}`; 23436 } 23437 _hashClosingBlock(name) { 23438 return this._hashBlock(`close_${name}`, []); 23439 } 23440 _toSnakeCase(name) { 23441 return name.toUpperCase().replace(/[^A-Z0-9]/g, '_'); 23442 } 23443 _generateUniqueName(base) { 23444 const seen = this._placeHolderNameCounts.hasOwnProperty(base); 23445 if (!seen) { 23446 this._placeHolderNameCounts[base] = 1; 23447 return base; 23448 } 23449 const id = this._placeHolderNameCounts[base]; 23450 this._placeHolderNameCounts[base] = id + 1; 23451 return `${base}_${id}`; 23452 } 23453} 23454const _expParser = new Parser(new Lexer()); 23455/**
23456 * Returns a function converting html nodes to an i18n Message given an interpolationConfig 23457 */ 23458function createI18nMessageFactory(interpolationConfig, containerBlocks, retainEmptyTokens, preserveExpressionWhitespace) { 23459 const visitor = new _I18nVisitor(_expParser, interpolationConfig, containerBlocks, retainEmptyTokens, preserveExpressionWhitespace); 23460 return (nodes, meaning, description, customId, visitNodeFn) => visitor.toI18nMessage(nodes, meaning, description, customId, visitNodeFn); 23461} 23462function noopVisitNodeFn(_html, i18n) { 23463 return i18n; 23464} 23465class _I18nVisitor { 23466 constructor(_expressionParser, _interpolationConfig, _containerBlocks, _retainEmptyTokens, _preserveExpressionWhitespace) { 23467 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_expressionParser", void 0); 23468 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_interpolationConfig", void 0); 23469 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_containerBlocks", void 0); 23470 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_retainEmptyTokens", void 0); 23471 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_preserveExpressionWhitespace", void 0); 23472 this._expressionParser = _expressionParser; 23473 this._interpolationConfig = _interpolationConfig; 23474 this._containerBlocks = _containerBlocks; 23475 this._retainEmptyTokens = _retainEmptyTokens; 23476 this._preserveExpressionWhitespace = _preserveExpressionWhitespace; 23477 } 23478 toI18nMessage(nodes, meaning = '', description = '', customId = '', visitNodeFn) { 23479 const context = { 23480 isIcu: nodes.length == 1 && nodes[0] instanceof Expansion, 23481 icuDepth: 0, 23482 placeholderRegistry: new PlaceholderRegistry(), 23483 placeholderToContent: {}, 23484 placeholderToMessage: {}, 23485 visitNodeFn: visitNodeFn || noopVisitNodeFn 23486 }; 23487 const i18nodes = visitAll(this, nodes, context); 23488 return new Message(i18nodes, context.placeholderToContent, context.placeholderToMessage, meaning, description, customId); 23489 } 23490 visitElement(el, context) { 23491 const children = visitAll(this, el.children, context); 23492 const attrs = {}; 23493 el.attrs.forEach(attr => { 23494 // Do not visit the attributes, translatable ones are top-level ASTs 23495 attrs[attr.name] = attr.value; 23496 }); 23497 const isVoid = getHtmlTagDefinition(el.name).isVoid; 23498 const startPhName = context.placeholderRegistry.getStartTagPlaceholderName(el.name, attrs, isVoid); 23499 context.placeholderToContent[startPhName] = { 23500 text: el.startSourceSpan.toString(), 23501 sourceSpan: el.startSourceSpan 23502 }; 23503 let closePhName = ''; 23504 if (!isVoid) { 23505 var _el$endSourceSpan; 23506 closePhName = context.placeholderRegistry.getCloseTagPlaceholderName(el.name); 23507 context.placeholderToContent[closePhName] = { 23508 text: `</${el.name}>`, 23509 sourceSpan: (_el$endSourceSpan = el.endSourceSpan) !== null && _el$endSourceSpan !== void 0 ? _el$endSourceSpan : el.sourceSpan 23510 }; 23511 } 23512 const node = new TagPlaceholder(el.name, attrs, startPhName, closePhName, children, isVoid, el.sourceSpan, el.startSourceSpan, el.endSourceSpan); 23513 return context.visitNodeFn(el, node); 23514 } 23515 visitAttribute(attribute, context) { 23516 const node = attribute.valueTokens === undefined || attribute.valueTokens.length === 1 ? new Text$2(attribute.value, attribute.valueSpan || attribute.sourceSpan) : this._visitTextWithInterpolation(attribute.valueTokens, attribute.valueSpan || attribute.sourceSpan, context, attribute.i18n); 23517 return context.visitNodeFn(attribute, node); 23518 } 23519 visitText(text, context) { 23520 const node = text.tokens.length === 1 ? new Text$2(text.value, text.sourceSpan) : this._visitTextWithInterpolation(text.tokens, text.sourceSpan, context, text.i18n); 23521 return context.visitNodeFn(text, node); 23522 } 23523 visitComment(comment, context) { 23524 return null; 23525 } 23526 visitExpansion(icu, context) {
23527 context.icuDepth++; 23528 const i18nIcuCases = {}; 23529 const i18nIcu = new Icu(icu.switchValue, icu.type, i18nIcuCases, icu.sourceSpan); 23530 icu.cases.forEach(caze => { 23531 i18nIcuCases[caze.value] = new Container(caze.expression.map(node => node.visit(this, context)), caze.expSourceSpan); 23532 }); 23533 context.icuDepth--; 23534 if (context.isIcu || context.icuDepth > 0) { 23535 // Returns an ICU node when: 23536 // - the message (vs a part of the message) is an ICU message, or 23537 // - the ICU message is nested. 23538 const expPh = context.placeholderRegistry.getUniquePlaceholder(`VAR_${icu.type}`); 23539 i18nIcu.expressionPlaceholder = expPh; 23540 context.placeholderToContent[expPh] = { 23541 text: icu.switchValue, 23542 sourceSpan: icu.switchValueSourceSpan 23543 }; 23544 return context.visitNodeFn(icu, i18nIcu); 23545 } 23546 // Else returns a placeholder 23547 // ICU placeholders should not be replaced with their original content but with the their 23548 // translations. 23549 // TODO(vicb): add a html.Node -> i18n.Message cache to avoid having to re-create the msg 23550 const phName = context.placeholderRegistry.getPlaceholderName('ICU', icu.sourceSpan.toString()); 23551 context.placeholderToMessage[phName] = this.toI18nMessage([icu], '', '', '', undefined); 23552 const node = new IcuPlaceholder(i18nIcu, phName, icu.sourceSpan); 23553 return context.visitNodeFn(icu, node); 23554 } 23555 visitExpansionCase(_icuCase, _context) { 23556 throw new Error('Unreachable code'); 23557 } 23558 visitBlock(block, context) { 23559 var _block$endSourceSpan; 23560 const children = visitAll(this, block.children, context); 23561 if (this._containerBlocks.has(block.name)) { 23562 return new Container(children, block.sourceSpan); 23563 } 23564 const parameters = block.parameters.map(param => param.expression); 23565 const startPhName = context.placeholderRegistry.getStartBlockPlaceholderName(block.name, parameters); 23566 const closePhName = context.placeholderRegistry.getCloseBlockPlaceholderName(block.name); 23567 context.placeholderToContent[startPhName] = { 23568 text: block.startSourceSpan.toString(), 23569 sourceSpan: block.startSourceSpan 23570 }; 23571 context.placeholderToContent[closePhName] = { 23572 text: block.endSourceSpan ? block.endSourceSpan.toString() : '}', 23573 sourceSpan: (_block$endSourceSpan = block.endSourceSpan) !== null && _block$endSourceSpan !== void 0 ? _block$endSourceSpan : block.sourceSpan 23574 }; 23575 const node = new BlockPlaceholder(block.name, parameters, startPhName, closePhName, children, block.sourceSpan, block.startSourceSpan, block.endSourceSpan); 23576 return context.visitNodeFn(block, node); 23577 } 23578 visitBlockParameter(_parameter, _context) { 23579 throw new Error('Unreachable code'); 23580 } 23581 visitLetDeclaration(decl, context) { 23582 return null; 23583 } 23584 /** 23585 * Convert, text and interpolated tokens up into text and placeholder pieces. 23586 * 23587 * @param tokens The text and interpolated tokens. 23588 * @param sourceSpan The span of the whole of the `text` string. 23589 * @param context The current context of the visitor, used to compute and store placeholders. 23590 * @param previousI18n Any i18n metadata associated with this `text` from a previous pass. 23591 */ 23592 _visitTextWithInterpolation(tokens, sourceSpan, context, previousI18n) { 23593 // Return a sequence of `Text` and `Placeholder` nodes grouped in a `Container`. 23594 const nodes = []; 23595 // We will only create a container if there are actually interpolations, 23596 // so this flag tracks that. 23597 let hasInterpolation = false; 23598 for (const token of tokens) { 23599 switch (token.type) { 23600 case 8 /* TokenType.INTERPOLATION */: 23601 case 17 /* TokenType.ATTR_VALUE_INTERPOLATION */: 23602 hasInterpolation = true; 23603 const [startMarker, expression, endMarker] = token.parts; 23604 const baseName = extractPlaceholderName(expression) || 'INTERPOLATION'; 23605 const phName = context.placeholderRegistry.getPlaceholderName(baseName, expression); 23606 if (this._preserveExpressionWhitespace) { 23607 context.placeholderToContent[phName] = { 23608 text: token.parts.join(''), 23609 sourceSpan: token.sourceSpan 23610 }; 23611 nodes.push(new Placeholder(expression, phName, token.sourceSpan)); 23612 } else { 23613 const normalized = this.normalizeExpression(token); 23614 context.placeholderToContent[phName] = { 23615 text: `${startMarker}${normalized}${endMarker}`, 23616 sourceSpan: token.sourceSpan 23617 }; 23618 nodes.push(new Placeholder(normalized, phName, token.sourceSpan)); 23619 } 23620 break; 23621 default: 23622 // Try to merge text tokens with previous tokens. We do this even for all tokens 23623 // when `retainEmptyTokens == true` because whitespace tokens may have non-zero 23624 // length, but will be trimmed by `WhitespaceVisitor` in one extraction pass and 23625 // be considered "empty" there. Therefore a whitespace token with 23626 // `retainEmptyTokens === true` should be treated like an empty token and either 23627 // retained or merged into the previous node. Since extraction does two passes with 23628 // different trimming behavior, the second pass needs to have identical node count 23629 // to reuse source spans, so we need this check to get the same answer when both 23630 // trimming and not trimming. 23631 if (token.parts[0].length > 0 || this._retainEmptyTokens) { 23632 // This token is text or an encoded entity. 23633 // If it is following on from a previous text node then merge it into that node 23634 // Otherwise, if it is following an interpolation, then add a new node. 23635 const previous = nodes[nodes.length - 1]; 23636 if (previous instanceof Text$2) { 23637 previous.value += token.parts[0]; 23638 previous.sourceSpan = new ParseSourceSpan(previous.sourceSpan.start, token.sourceSpan.end, previous.sourceSpan.fullStart, previous.sourceSpan.details); 23639 } else { 23640 nodes.push(new Text$2(token.parts[0], token.sourceSpan)); 23641 } 23642 } else { 23643 // Retain empty tokens to avoid breaking dropping entire nodes such that source 23644 // spans should not be reusable across multiple parses of a template. We *should* 23645 // do this all the time, however we need to maintain backwards compatibility 23646 // with existing message IDs so we can't do it by default and should only enable 23647 // this when removing significant whitespace. 23648 if (this._retainEmptyTokens) { 23649 nodes.push(new Text$2(token.parts[0], token.sourceSpan)); 23650 } 23651 } 23652 break; 23653 } 23654 } 23655 if (hasInterpolation) { 23656 // Whitespace removal may have invalidated the interpolation source-spans. 23657 reusePreviousSourceSpans(nodes, previousI18n); 23658 return new Container(nodes, sourceSpan); 23659 } else { 23660 return nodes[0]; 23661 } 23662 } 23663 // Normalize expression whitespace by parsing and re-serializing it. This makes 23664 // message IDs more durable to insignificant whitespace changes. 23665 normalizeExpression(token) { 23666 const expression = token.parts[1]; 23667 const expr = this._expressionParser.parseBinding(expression, /* location */token.sourceSpan.start.toString(), /* absoluteOffset */token.sourceSpan.start.offset, this._interpolationConfig); 23668 return serialize(expr); 23669 } 23670} 23671/** 23672 * Re-use the source-spans from `previousI18n` metadata for the `nodes`. 23673 *
23674 * Whitespace removal can invalidate the source-spans of interpolation nodes, so we 23675 * reuse the source-span stored from a previous pass before the whitespace was removed. 23676 * 23677 * @param nodes The `Text` and `Placeholder` nodes to be processed. 23678 * @param previousI18n Any i18n metadata for these `nodes` stored from a previous pass. 23679 */ 23680function reusePreviousSourceSpans(nodes, previousI18n) { 23681 if (previousI18n instanceof Message) { 23682 // The `previousI18n` is an i18n `Message`, so we are processing an `Attribute` with i18n 23683 // metadata. The `Message` should consist only of a single `Container` that contains the 23684 // parts (`Text` and `Placeholder`) to process. 23685 assertSingleContainerMessage(previousI18n); 23686 previousI18n = previousI18n.nodes[0]; 23687 } 23688 if (previousI18n instanceof Container) { 23689 // The `previousI18n` is a `Container`, which means that this is a second i18n extraction pass 23690 // after whitespace has been removed from the AST nodes. 23691 assertEquivalentNodes(previousI18n.children, nodes); 23692 // Reuse the source-spans from the first pass. 23693 for (let i = 0; i < nodes.length; i++) { 23694 nodes[i].sourceSpan = previousI18n.children[i].sourceSpan; 23695 } 23696 } 23697} 23698/** 23699 * Asserts that the `message` contains exactly one `Container` node. 23700 */ 23701function assertSingleContainerMessage(message) { 23702 const nodes = message.nodes; 23703 if (nodes.length !== 1 || !(nodes[0] instanceof Container)) { 23704 throw new Error('Unexpected previous i18n message - expected it to consist of only a single `Container` node.'); 23705 } 23706} 23707/** 23708 * Asserts that the `previousNodes` and `node` collections have the same number of elements and 23709 * corresponding elements have the same node type. 23710 */ 23711function assertEquivalentNodes(previousNodes, nodes) { 23712 if (previousNodes.length !== nodes.length) { 23713 throw new Error(` 23714The number of i18n message children changed between first and second pass. 23715 23716First pass (${previousNodes.length} tokens): 23717${previousNodes.map(node => `"${node.sourceSpan.toString()}"`).join('\n')} 23718 23719Second pass (${nodes.length} tokens): 23720${nodes.map(node => `"${node.sourceSpan.toString()}"`).join('\n')} 23721 `.trim()); 23722 } 23723 if (previousNodes.some((node, i) => nodes[i].constructor !== node.constructor)) { 23724 throw new Error('The types of the i18n message children changed between first and second pass.'); 23725 } 23726} 23727const _CUSTOM_PH_EXP = /\/\/[\s\S]*i18n[\s\S]*\([\s\S]*ph[\s\S]*=[\s\S]*("|')([\s\S]*?)\1[\s\S]*\)/g; 23728function extractPlaceholderName(input) { 23729 return input.split(_CUSTOM_PH_EXP)[2]; 23730} 23731 23732/** 23733 * An i18n error. 23734 */ 23735class I18nError extends ParseError { 23736 constructor(span, msg) { 23737 super(span, msg); 23738 } 23739} 23740 23741/** 23742 * Set of tagName|propertyName corresponding to Trusted Types sinks. Properties applying to all 23743 * tags use '*'. 23744 * 23745 * Extracted from, and should be kept in sync with 23746 * https://w3c.github.io/webappsec-trusted-types/dist/spec/#integrations 23747 */ 23748const TRUSTED_TYPES_SINKS = new Set([ 23749// NOTE: All strings in this set *must* be lowercase! 23750// TrustedHTML 23751'iframe|srcdoc', '*|innerhtml', '*|outerhtml', 23752// NB: no TrustedScript here, as the corresponding tags are stripped by the compiler. 23753// TrustedScriptURL 23754'embed|src', 'object|codebase', 'object|data']); 23755/** 23756 * isTrustedTypesSink returns true if the given property on the given DOM tag is a Trusted Types 23757 * sink. In that case, use `ElementSchemaRegistry.securityContext` to determine which particular 23758 * Trusted Type is required for values passed to the sink: 23759 * - SecurityContext.HTML corresponds to TrustedHTML 23760 * - SecurityContext.RESOURCE_URL corresponds to TrustedScriptURL 23761 */ 23762function isTrustedTypesSink(tagName, propName) { 23763 // Make sure comparisons are case insensitive, so that case differences between attribute and 23764 // property names do not have a security impact. 23765 tagName = tagName.toLowerCase(); 23766 propName = propName.toLowerCase(); 23767 return TRUSTED_TYPES_SINKS.has(tagName + '|' + propName) || TRUSTED_TYPES_SINKS.has('*|' + propName); 23768} 23769const setI18nRefs = originalNodeMap => { 23770 return (trimmedNode, i18nNode) => { 23771 var _originalNodeMap$get; 23772 // We need to set i18n properties on the original, untrimmed AST nodes. The i18n nodes needs to 23773 // use the trimmed content for message IDs to make messages more stable to whitespace changes. 23774 // But we don't want to actually trim the content, so we can't use the trimmed HTML AST for 23775 // general code gen. Instead we map the trimmed HTML AST back to the original AST and then 23776 // attach the i18n nodes so we get trimmed i18n nodes on the original (untrimmed) HTML AST. 23777 const originalNode = (_originalNodeMap$get = originalNodeMap.get(trimmedNode)) !== null && _originalNodeMap$get !== void 0 ? _originalNodeMap$get : trimmedNode; 23778 if (originalNode instanceof NodeWithI18n) { 23779 if (i18nNode instanceof IcuPlaceholder && originalNode.i18n instanceof Message) { 23780 // This html node represents an ICU but this is a second processing pass, and the legacy id 23781 // was computed in the previous pass and stored in the `i18n` property as a message. 23782 // We are about to wipe out that property so capture the previous message to be reused when 23783 // generating the message for this ICU later. See `_generateI18
23783nMessage()`. 23784 i18nNode.previousMessage = originalNode.i18n; 23785 } 23786 originalNode.i18n = i18nNode; 23787 } 23788 return i18nNode; 23789 }; 23790}; 23791/** 23792 * This visitor walks over HTML parse tree and converts information stored in 23793 * i18n-related attributes ("i18n" and "i18n-*") into i18n meta object that is 23794 * stored with other element's and attribute's information. 23795 */ 23796class I18nMetaVisitor { 23797 constructor(interpolationConfig = DEFAULT_INTERPOLATION_CONFIG, keepI18nAttrs = false, enableI18nLegacyMessageIdFormat = false, containerBlocks = DEFAULT_CONTAINER_BLOCKS, preserveSignificantWhitespace = true, 23798 // When dropping significant whitespace we need to retain empty tokens or 23799 // else we won't be able to reuse source spans because empty tokens would be 23800 // removed and cause a mismatch. Unfortunately this still needs to be 23801 // configurable and sometimes needs to be set independently in order to make 23802 // sure the number of nodes don't change between parses, even when 23803 // `preserveSignificantWhitespace` changes. 23804 retainEmptyTokens = !preserveSignificantWhitespace) { 23805 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "interpolationConfig", void 0); 23806 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "keepI18nAttrs", void 0); 23807 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "enableI18nLegacyMessageIdFormat", void 0); 23808 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "containerBlocks", void 0); 23809 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "preserveSignificantWhitespace", void 0); 23810 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "retainEmptyTokens", void 0); 23811 // whether visited nodes contain i18n information 23812 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "hasI18nMeta", false); 23813 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_errors", []); 23814 this.interpolationConfig = interpolationConfig; 23815 this.keepI18nAttrs = keepI18nAttrs; 23816 this.enableI18nLegacyMessageIdFormat = enableI18nLegacyMessageIdFormat; 23817 this.containerBlocks = containerBlocks; 23818 this.preserveSignificantWhitespace = preserveSignificantWhitespace; 23819 this.retainEmptyTokens = retainEmptyTokens; 23820 } 23821 _generateI18nMessage(nodes, meta = '', visitNodeFn) { 23822 const { 23823 meaning, 23824 description, 23825 customId 23826 } = this._parseMetadata(meta); 23827 const createI18nMessage = createI18nMessageFactory(this.interpolationConfig, this.containerBlocks, this.retainEmptyTokens, /* preserveExpressionWhitespace */this.preserveSignificantWhitespace); 23828 const message = createI18nMessage(nodes, meaning, description, customId, visitNodeFn); 23829 this._setMessageId(message, meta); 23830 this._setLegacyIds(message, meta); 23831 return message; 23832 } 23833 visitAllWithErrors(nodes) { 23834 const result = nodes.map(node => node.visit(this, null)); 23835 return new ParseTreeResult(result, this._errors); 23836 } 23837 visitElement(element) { 23838 let message = undefined; 23839 if (hasI18nAttrs(element)) { 23840 this.hasI18nMeta = true; 23841 const attrs = []; 23842 const attrsMeta = {}; 23843 for (const attr of element.attrs) { 23844 if (attr.name === I18N_ATTR) { 23845 // root 'i18n' node attribute 23846 const i18n = element.i18n || attr.value; 23847 // Generate a new AST with whitespace trimmed, but also generate a map 23848 // to correlate each new node to its original so we can apply i18n 23849 // information to the original node based on the trimmed content. 23850 // 23851 // `WhitespaceVisitor` removes *insignificant* whitespace as well as 23852 // significant whitespace. Enabling this visitor should be conditional 23853 // on `preserveWhitespace` rather than `preserveSignificantWhitespace`, 23854 // however this would be a breaking change for existing behavior where 23855 // `preserveWhitespace` was not respected correctly when generating 23856 // message IDs. This is really a bug but one we need to keep to maintain 23857 // backwards compatibility. 23858 const originalNodeMap = new Map(); 23859 const trimmedNodes = this.preserveSignificantWhitespace ? element.children : visitAllWithSiblings(new WhitespaceVisitor(false /* preserveSignificantWhitespace */, originalNodeMap), element.children);
23860 message = this._generateI18nMessage(trimmedNodes, i18n, setI18nRefs(originalNodeMap)); 23861 if (message.nodes.length === 0) { 23862 // Ignore the message if it is empty. 23863 message = undefined; 23864 } 23865 // Store the message on the element 23866 element.i18n = message; 23867 } else if (attr.name.startsWith(I18N_ATTR_PREFIX)) { 23868 // 'i18n-*' attributes 23869 const name = attr.name.slice(I18N_ATTR_PREFIX.length); 23870 if (isTrustedTypesSink(element.name, name)) { 23871 this._reportError(attr, `Translating attribute '${name}' is disallowed for security reasons.`); 23872 } else { 23873 attrsMeta[name] = attr.value; 23874 } 23875 } else { 23876 // non-i18n attributes 23877 attrs.push(attr); 23878 } 23879 } 23880 // set i18n meta for attributes 23881 if (Object.keys(attrsMeta).length) { 23882 for (const attr of attrs) { 23883 const meta = attrsMeta[attr.name]; 23884 // do not create translation for empty attributes 23885 if (meta !== undefined && attr.value) { 23886 attr.i18n = this._generateI18nMessage([attr], attr.i18n || meta); 23887 } 23888 } 23889 } 23890 if (!this.keepI18nAttrs) { 23891 // update element's attributes, 23892 // keeping only non-i18n related ones 23893 element.attrs = attrs; 23894 } 23895 } 23896 visitAll(this, element.children, message); 23897 return element; 23898 } 23899 visitExpansion(expansion, currentMessage) { 23900 let message; 23901 const meta = expansion.i18n; 23902 this.hasI18nMeta = true; 23903 if (meta instanceof IcuPlaceholder) { 23904 // set ICU placeholder name (e.g. "ICU_1"), 23905 // generated while processing root element contents, 23906 // so we can reference it when we output translation 23907 const name = meta.name; 23908 message = this._generateI18nMessage([expansion], meta); 23909 const icu = icuFromI18nMessage(message); 23910 icu.name = name; 23911 if (currentMessage !== null) { 23912 // Also update the placeholderToMessage map with this new message 23913 currentMessage.placeholderToMessage[name] = message; 23914 } 23915 } else { 23916 // ICU is a top level message, try to use metadata from container element if provided via 23917 // `context` argument. Note: context may not be available for standalone ICUs (without 23918 // wrapping element), so fallback to ICU metadata in this case. 23919 message = this._generateI18nMessage([expansion], currentMessage || meta); 23920 } 23921 expansion.i18n = message; 23922 return expansion; 23923 } 23924 visitText(text) { 23925 return text; 23926 } 23927 visitAttribute(attribute) { 23928 return attribute; 23929 } 23930 visitComment(comment) { 23931 return comment; 23932 } 23933 visitExpansionCase(expansionCase) { 23934 return expansionCase; 23935 } 23936 visitBlock(block, context) { 23937 visitAll(this, block.children, context); 23938 return block; 23939 } 23940 visitBlockParameter(parameter, context) { 23941 return parameter; 23942 } 23943 visitLetDeclaration(decl, context) { 23944 return decl; 23945 } 23946 /** 23947 * Parse the general form `meta` passed into extract the explicit metadata needed to create a 23948 * `Message`. 23949 * 23950 * There are three possibilities for the `meta` variable 23951 * 1) a string from an `i18n` template attribute: parse it to extract the metadata values. 23952 * 2) a `Message` from a previous processing pass: reuse the metadata values in the message. 23953 * 4) other: ignore this and just process the message metadata as normal 23954 * 23955 * @param meta the bucket that holds information about the message 23956 * @returns the parsed metadata. 23957 */ 23958 _parseMetadata(meta) { 23959 return typeof meta === 'string' ? parseI18nMeta(meta) : meta instanceof Message ? meta : {}; 23960 } 23961 /** 23962 * Generate (or restore) message id if not specified already. 23963 */ 23964 _setMessageId(message, meta) { 23965 if (!message.id) { 23966 message.id = meta instanceof Message && meta.id || decimalDigest(message); 23967 } 23968 } 23969 /** 23970 * Update the `message` with a `legacyId` if necessary. 23971 * 23972 * @param message the message whose legacy id should be set 23973 * @param meta information about the message being processed 23974 */ 23975 _setLegacyIds(message, meta) { 23976 if (this.enableI18nLegacyMessageIdFormat) { 23977 message.legacyIds = [computeDigest(message), computeDecimalDigest(message)]; 23978 } else if (typeof meta !== 'string') { 23979 // This occurs if we are doing the 2nd pass after whitespace removal (see `parseTemplate()` in 23980 // `packages/compiler/src/render3/view/template.ts`). 23981 // In that case we want to reuse the legacy message generated in the 1st pass (see 23982 // `setI18nRefs()`). 23983 const previousMessage = meta instanceof Message ? meta : meta instanceof IcuPlaceholder ? meta.previousMessage : undefined; 23984 message.legacyIds = previousMessage ? previousMessage.legacyIds : []; 23985 } 23986 } 23987 _reportError(node, msg) { 23988 this._errors.push(new I18nError(node.sourceSpan, msg)); 23989 } 23990} 23991/** I18n separators for metadata **/ 23992const I18N_MEANING_SEPARATOR = '|'; 23993const I18N_ID_SEPARATOR = '@@'; 23994/** 23995 * Parses i18n metas like:
23996 * - "@@id", 23997 * - "description[@@id]", 23998 * - "meaning|description[@@id]" 23999 * and returns an object with parsed output. 24000 * 24001 * @param meta String that represents i18n meta 24002 * @returns Object with id, meaning and description fields 24003 */ 24004function parseI18nMeta(meta = '') { 24005 let customId; 24006 let meaning; 24007 let description; 24008 meta = meta.trim(); 24009 if (meta) { 24010 const idIndex = meta.indexOf(I18N_ID_SEPARATOR); 24011 const descIndex = meta.indexOf(I18N_MEANING_SEPARATOR); 24012 let meaningAndDesc; 24013 [meaningAndDesc, customId] = idIndex > -1 ? [meta.slice(0, idIndex), meta.slice(idIndex + 2)] : [meta, '']; 24014 [meaning, description] = descIndex > -1 ? [meaningAndDesc.slice(0, descIndex), meaningAndDesc.slice(descIndex + 1)] : ['', meaningAndDesc]; 24015 } 24016 return { 24017 customId, 24018 meaning, 24019 description 24020 }; 24021} 24022// Converts i18n meta information for a message (id, description, meaning) 24023// to a JsDoc statement formatted as expected by the Closure compiler. 24024function i18nMetaToJSDoc(meta) { 24025 const tags = []; 24026 if (meta.description) { 24027 tags.push({ 24028 tagName: "desc" /* o.JSDocTagName.Desc */, 24029 text: meta.description 24030 }); 24031 } else { 24032 // Suppress the JSCompiler warning that a `@desc` was not given for this message. 24033 tags.push({ 24034 tagName: "suppress" /* o.JSDocTagName.Suppress */, 24035 text: '{msgDescriptions}' 24036 }); 24037 } 24038 if (meta.meaning) { 24039 tags.push({ 24040 tagName: "meaning" /* o.JSDocTagName.Meaning */, 24041 text: meta.meaning 24042 }); 24043 } 24044 return jsDocComment(tags); 24045} 24046 24047/** Closure uses `goog.getMsg(message)` to lookup translations */ 24048const GOOG_GET_MSG = 'goog.getMsg'; 24049/** 24050 * Generates a `goog.getMsg()` statement and reassignment. The template: 24051 * 24052 * ```html 24053 * <div i18n>Sent from {{ sender }} to <span class="receiver">{{ receiver }}</span></div> 24054 * ``` 24055 * 24056 * Generates: 24057 * 24058 * ```ts 24059 * const MSG_FOO = goog.getMsg( 24060 * // Message template. 24061 * 'Sent from {$interpolation} to {$startTagSpan}{$interpolation_1}{$closeTagSpan}.', 24062 * // Placeholder values, set to magic strings which get replaced by the Angular runtime. 24063 * { 24064 * 'interpolation': '\uFFFD0\uFFFD', 24065 * 'startTagSpan': '\uFFFD1\uFFFD', 24066 * 'interpolation_1': '\uFFFD2\uFFFD', 24067 * 'closeTagSpan': '\uFFFD3\uFFFD', 24068 * }, 24069 * // Options bag. 24070 * { 24071 * // Maps each placeholder to the original Angular source code which generates it's value. 24072 * original_code: { 24073 * 'interpolation': '{{ sender }}', 24074 * 'startTagSpan': '<span class="receiver">', 24075 * 'interpolation_1': '{{ receiver }}', 24076 * 'closeTagSpan': '</span>', 24077 * }, 24078 * }, 24079 * ); 24080 * const I18N_0 = MSG_FOO; 24081 * ``` 24082 */ 24083function createGoogleGetMsgStatements(variable$1, message, closureVar, placeholderValues) { 24084 const messageString = serializeI18nMessageForGetMsg(message); 24085 const args = [literal(messageString)]; 24086 if (Object.keys(placeholderValues).length) { 24087 // Message template parameters containing the magic strings replaced by the Angular runtime with 24088 // real data, e.g. `{'interpolation': '\uFFFD0\uFFFD'}`. 24089 args.push(mapLiteral(formatI18nPlaceholderNamesInMap(placeholderValues, true /* useCamelCase */), true /* quoted */)); 24090 // Message options object, which contains original source code for placeholders (as they are 24091 // present in a template, e.g. 24092 // `{original_code: {'interpolation': '{{ name }}', 'startTagSpan': '<span>'}}`. 24093 args.push(mapLiteral({ 24094 original_code: literalMap(Object.keys(placeholderValues).map(param => ({ 24095 key: formatI18nPlaceholderName(param), 24096 quoted: true, 24097 value: message.placeholders[param] ? 24098 // Get source span for typical placeholder if it exists. 24099 literal(message.placeholders[param].sourceSpan.toString()) : 24100 // Otherwise must be an ICU expression, get it's source span. 24101 literal(message.placeholderToMessage[param].nodes.map(node => node.sourceSpan.toString()).join('')) 24102 }))) 24103 })); 24104 } 24105 // /** 24106 // * @desc description of message 24107 // * @meaning meaning of message 24108 // */ 24109 // const MSG_... = goog.getMsg(..); 24110 // I18N_X = MSG_...; 24111 const googGetMsgStmt = closureVar.set(variable(GOOG_GET_MSG).callFn(args)).toConstDecl(); 24112 googGetMsgStmt.addLeadingComment(i18nMetaToJSDoc(message));
24113 const i18nAssignmentStmt = new ExpressionStatement(variable$1.set(closureVar)); 24114 return [googGetMsgStmt, i18nAssignmentStmt]; 24115} 24116/** 24117 * This visitor walks over i18n tree and generates its string representation, including ICUs and 24118 * placeholders in `{$placeholder}` (for plain messages) or `{PLACEHOLDER}` (inside ICUs) format. 24119 */ 24120class GetMsgSerializerVisitor { 24121 formatPh(value) { 24122 return `{$${formatI18nPlaceholderName(value)}}`; 24123 } 24124 visitText(text) { 24125 return text.value; 24126 } 24127 visitContainer(container) { 24128 return container.children.map(child => child.visit(this)).join(''); 24129 } 24130 visitIcu(icu) { 24131 return serializeIcuNode(icu); 24132 } 24133 visitTagPlaceholder(ph) { 24134 return ph.isVoid ? this.formatPh(ph.startName) : `${this.formatPh(ph.startName)}${ph.children.map(child => child.visit(this)).join('')}${this.formatPh(ph.closeName)}`; 24135 } 24136 visitPlaceholder(ph) { 24137 return this.formatPh(ph.name); 24138 } 24139 visitBlockPlaceholder(ph) { 24140 return `${this.formatPh(ph.startName)}${ph.children.map(child => child.visit(this)).join('')}${this.formatPh(ph.closeName)}`; 24141 } 24142 visitIcuPlaceholder(ph, context) { 24143 return this.formatPh(ph.name); 24144 } 24145} 24146const serializerVisitor = new GetMsgSerializerVisitor(); 24147function serializeI18nMessageForGetMsg(message) { 24148 return message.nodes.map(node => node.visit(serializerVisitor, null)).join(''); 24149} 24150function createLocalizeStatements(variable, message, params) { 24151 const { 24152 messageParts, 24153 placeHolders 24154 } = serializeI18nMessageForLocalize(message); 24155 const sourceSpan = getSourceSpan(message); 24156 const expressions = placeHolders.map(ph => params[ph.text]); 24157 const localizedString$1 = localizedString(message, messageParts, placeHolders, expressions, sourceSpan); 24158 const variableInitialization = variable.set(localizedString$1); 24159 return [new ExpressionStatement(variableInitialization)]; 24160} 24161/** 24162 * This visitor walks over an i18n tree, capturing literal strings and placeholders. 24163 * 24164 * The result can be used for generating the `$localize` tagged template literals. 24165 */ 24166class LocalizeSerializerVisitor { 24167 constructor(placeholderToMessage, pieces) { 24168 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "placeholderToMessage", void 0); 24169 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "pieces", void 0); 24170 this.placeholderToMessage = placeholderToMessage; 24171 this.pieces = pieces; 24172 } 24173 visitText(text) { 24174 if (this.pieces[this.pieces.length - 1] instanceof LiteralPiece) { 24175 // Two literal pieces in a row means that there was some comment node in-between. 24176 this.pieces[this.pieces.length - 1].text += text.value; 24177 } else { 24178 const sourceSpan = new ParseSourceSpan(text.sourceSpan.fullStart, text.sourceSpan.end, text.sourceSpan.fullStart, text.sourceSpan.details); 24179 this.pieces.push(new LiteralPiece(text.value, sourceSpan)); 24180 } 24181 } 24182 visitContainer(container) { 24183 container.children.forEach(child => child.visit(this)); 24184 } 24185 visitIcu(icu) { 24186 this.pieces.push(new LiteralPiece(serializeIcuNode(icu), icu.sourceSpan)); 24187 } 24188 visitTagPlaceholder(ph) { 24189 var _ph$startSourceSpan; 24190 this.pieces.push(this.createPlaceholderPiece(ph.startName, (_ph$startSourceSpan = ph.startSourceSpan) !== null && _ph$startSourceSpan !== void 0 ? _ph$startSourceSpan : ph.sourceSpan)); 24191 if (!ph.isVoid) { 24192 var _ph$endSourceSpan; 24193 ph.children.forEach(child => child.visit(this)); 24194 this.pieces.push(this.createPlaceholderPiece(ph.closeName, (_ph$endSourceSpan = ph.endSourceSpan) !== null && _ph$endSourceSpan !== void 0 ? _ph$endSourceSpan : ph.sourceSpan)); 24195 } 24196 } 24197 visitPlaceholder(ph) { 24198 this.pieces.push(this.createPlaceholderPiece(ph.name, ph.sourceSpan)); 24199 } 24200 visitBlockPlaceholder(ph) { 24201 var _ph$startSourceSpan2, _ph$endSourceSpan2; 24202 this.pieces.push(this.createPlaceholderPiece(ph.startName, (_ph$startSourceSpan2 = ph.startSourceSpan) !== null && _ph$startSourceSpan2 !== void 0 ? _ph$startSourceSpan2 : ph.sourceSpan));
24203 ph.children.forEach(child => child.visit(this)); 24204 this.pieces.push(this.createPlaceholderPiece(ph.closeName, (_ph$endSourceSpan2 = ph.endSourceSpan) !== null && _ph$endSourceSpan2 !== void 0 ? _ph$endSourceSpan2 : ph.sourceSpan)); 24205 } 24206 visitIcuPlaceholder(ph) { 24207 this.pieces.push(this.createPlaceholderPiece(ph.name, ph.sourceSpan, this.placeholderToMessage[ph.name])); 24208 } 24209 createPlaceholderPiece(name, sourceSpan, associatedMessage) { 24210 return new PlaceholderPiece(formatI18nPlaceholderName(name, /* useCamelCase */false), sourceSpan, associatedMessage); 24211 } 24212} 24213/** 24214 * Serialize an i18n message into two arrays: messageParts and placeholders. 24215 * 24216 * These arrays will be used to generate `$localize` tagged template literals. 24217 * 24218 * @param message The message to be serialized. 24219 * @returns an object containing the messageParts and placeholders. 24220 */ 24221function serializeI18nMessageForLocalize(message) { 24222 const pieces = []; 24223 const serializerVisitor = new LocalizeSerializerVisitor(message.placeholderToMessage, pieces); 24224 message.nodes.forEach(node => node.visit(serializerVisitor)); 24225 return processMessagePieces(pieces); 24226} 24227function getSourceSpan(message) { 24228 const startNode = message.nodes[0]; 24229 const endNode = message.nodes[message.nodes.length - 1]; 24230 return new ParseSourceSpan(startNode.sourceSpan.fullStart, endNode.sourceSpan.end, startNode.sourceSpan.fullStart, startNode.sourceSpan.details); 24231} 24232/** 24233 * Convert the list of serialized MessagePieces into two arrays. 24234 * 24235 * One contains the literal string pieces and the other the placeholders that will be replaced by 24236 * expressions when rendering `$localize` tagged template literals. 24237 * 24238 * @param pieces The pieces to process.
24239 * @returns an object containing the messageParts and placeholders. 24240 */ 24241function processMessagePieces(pieces) { 24242 const messageParts = []; 24243 const placeHolders = []; 24244 if (pieces[0] instanceof PlaceholderPiece) { 24245 // The first piece was a placeholder so we need to add an initial empty message part. 24246 messageParts.push(createEmptyMessagePart(pieces[0].sourceSpan.start)); 24247 } 24248 for (let i = 0; i < pieces.length; i++) { 24249 const part = pieces[i]; 24250 if (part instanceof LiteralPiece) { 24251 messageParts.push(part); 24252 } else { 24253 placeHolders.push(part); 24254 if (pieces[i - 1] instanceof PlaceholderPiece) { 24255 // There were two placeholders in a row, so we need to add an empty message part. 24256 messageParts.push(createEmptyMessagePart(pieces[i - 1].sourceSpan.end)); 24257 } 24258 } 24259 } 24260 if (pieces[pieces.length - 1] instanceof PlaceholderPiece) { 24261 // The last piece was a placeholder so we need to add a final empty message part. 24262 messageParts.push(createEmptyMessagePart(pieces[pieces.length - 1].sourceSpan.end)); 24263 } 24264 return { 24265 messageParts, 24266 placeHolders 24267 }; 24268} 24269function createEmptyMessagePart(location) { 24270 return new LiteralPiece('', new ParseSourceSpan(location, location)); 24271} 24272 24273/** Name of the global variable that is used to determine if we use Closure translations or not */ 24274const NG_I18N_CLOSURE_MODE = 'ngI18nClosureMode'; 24275/** 24276 * Prefix for non-`goog.getMsg` i18n-related vars. 24277 * Note: the prefix uses lowercase characters intentionally due to a Closure behavior that 24278 * considers variables like `I18N_0` as constants and throws an error when their value changes. 24279 */ 24280const TRANSLATION_VAR_PREFIX = 'i18n_'; 24281/** Prefix of ICU expressions for post processing */ 24282const I18N_ICU_MAPPING_PREFIX = 'I18N_EXP_'; 24283/** 24284 * The escape sequence used for message param values. 24285 */ 24286const ESCAPE = '\uFFFD'; 24287/* Closure variables holding messages must be named `MSG_[A-Z0-9]+` */ 24288const CLOSURE_TRANSLATION_VAR_PREFIX = 'MSG_'; 24289/** 24290 * Generates a prefix for translation const name. 24291 * 24292 * @param extra Additional local prefix that should be injected into translation var name 24293 * @returns Complete translation const prefix 24294 */ 24295function getTranslationConstPrefix(extra) { 24296 return `${CLOSURE_TRANSLATION_VAR_PREFIX}${extra}`.toUpperCase(); 24297} 24298/** 24299 * Generate AST to declare a variable. E.g. `var I18N_1;`. 24300 * @param variable the name of the variable to declare. 24301 */ 24302function declareI18nVariable(variable) { 24303 return new DeclareVarStmt(variable.name, undefined, INFERRED_TYPE, undefined, variable.sourceSpan); 24304} 24305/** 24306 * Lifts i18n properties into the consts array. 24307 * TODO: Can we use `ConstCollectedExpr`? 24308 * TODO: The way the various attributes are linked together is very complex. Perhaps we
24308could 24309 * simplify the process, maybe by combining the context and message ops? 24310 */ 24311function collectI18nConsts(job) { 24312 const fileBasedI18nSuffix = job.relativeContextFilePath.replace(/[^A-Za-z0-9]/g, '_').toUpperCase() + '_'; 24313 // Step One: Build up various lookup maps we need to collect all the consts. 24314 // Context Xref -> Extracted Attribute Ops 24315 const extractedAttributesByI18nContext = new Map(); 24316 // Element/ElementStart Xref -> I18n Attributes config op 24317 const i18nAttributesByElement = new Map(); 24318 // Element/ElementStart Xref -> All I18n Expression ops for attrs on that target 24319 const i18nExpressionsByElement = new Map(); 24320 // I18n Message Xref -> I18n Message Op (TODO: use a central op map) 24321 const messages = new Map(); 24322 for (const unit of job.units) { 24323 for (const op of unit.ops()) { 24324 if (op.kind === OpKind.ExtractedAttribute && op.i18nContext !== null) { 24325 var _extractedAttributesB; 24326 const attributes = (_extractedAttributesB = extractedAttributesByI18nContext.get(op.i18nContext)) !== null && _extractedAttributesB !== void 0 ? _extractedAttributesB : []; 24327 attributes.push(op); 24328 extractedAttributesByI18nContext.set(op.i18nContext, attributes); 24329 } else if (op.kind === OpKind.I18nAttributes) { 24330 i18nAttributesByElement.set(op.target, op); 24331 } else if (op.kind === OpKind.I18nExpression && op.usage === I18nExpressionFor.I18nAttribute) { 24332 var _i18nExpressionsByEle; 24333 const expressions = (_i18nExpressionsByEle = i18nExpressionsByElement.get(op.target)) !== null && _i18nExpressionsByEle !== void 0 ? _i18nExpressionsByEle : []; 24334 expressions.push(op); 24335 i18nExpressionsByElement.set(op.target, expressions); 24336 } else if (op.kind === OpKind.I18nMessage) { 24337 messages.set(op.xref, op); 24338 } 24339 } 24340 } 24341 // Step Two: Serialize the extracted i18n messages for root i18n blocks and i18n attributes into 24342 // the const array. 24343 // 24344 // Also, each i18n message will have a variable expression that can refer to its 24345 // value. Store these expressions in the appropriate place: 24346 // 1. For normal i18n content, it also goes in the const array. We save the const index to use 24347 // later. 24348 // 2. For extracted attributes, it becomes the value of the extracted attribute instruction. 24349 // 3. For i18n bindings, it will go in a separate const array instruction below; for now, we just 24350 // save it. 24351 const i18nValuesByContext = new Map(); 24352 const messageConstIndices = new Map(); 24353 for (const unit of job.units) { 24354 for (const op of unit.create) { 24355 if (op.kind === OpKind.I18nMessage) { 24356 if (op.messagePlaceholder === null) { 24357 const { 24358 mainVar, 24359 statements 24360 } = collectMessage(job, fileBasedI18nSuffix, messages, op); 24361 if (op.i18nBlock !== null) { 24362 // This is a regular i18n message with a corresponding i18n block. Collect it into the 24363 // const array. 24364 const i18nConst = job.addConst(mainVar, statements); 24365 messageConstIndices.set(op.i18nBlock, i18nConst); 24366 } else { 24367 // This is an i18n attribute. Extract the initializers into the const pool. 24368 job.constsInitializers.push(...statements); 24369 // Save the i18n variable value for later. 24370 i18nValuesByContext.set(op.i18nContext, mainVar); 24371 // This i18n message may correspond to an individual extracted attribute. If so, The 24372 // value of that attribute is updated to read the extracted i18n variable. 24373 const attributesForMessage = extractedAttributesByI18nContext.get(op.i18nContext); 24374 if (attributesForMessage !== undefined) { 24375 for (const attr of attributesForMessage) { 24376 attr.expression = mainVar.clone(); 24377 } 24378 } 24379 } 24380 } 24381 OpList.remove(op); 24382 } 24383 } 24384 } 24385 // Step Three: Serialize I18nAttributes configurations into the const array. Each I18nAttributes 24386 // instruction has a config array, which contains k-v pairs describing each binding name, and the 24387 // i18n variable that provides the value. 24388 for (const unit of job.units) { 24389 for (const elem of unit.create) { 24390 if (isElementOrContainerOp(elem)) { 24391 const i18nAttributes = i18nAttributesByElement.get(elem.xref); 24392 if (i18nAttributes === undefined) { 24393 // This element is not associated with an i18n attributes configuration instruction. 24394 continue; 24395 } 24396 let i18nExpressions = i18nExpressionsByElement.get(elem.xref); 24397 if (i18nExpressions === undefined) { 24398 // Unused i18nAttributes should have already been removed. 24399 // TODO: Should the removal of those dead instructions be merged with this phase? 24400 throw new Error('AssertionError: Could not find any i18n expressions associated with an I18nAttributes instruction'); 24401 } 24402 // Find expressions for all the unique property names, removing duplicates. 24403 const seenPropertyNames = new Set(); 24404 i18nExpressions = i18nExpressions.filter(i18nExpr => { 24405 const seen = seenPropertyNames.has(i18nExpr.name); 24406 seenPropertyNames.add(i18nExpr.name); 24407 return !seen; 24408 }); 24409 const i18nAttributeConfig = i18nExpressions.flatMap(i18nExpr => { 24410 const i18nExprValue = i18nValuesByContext.get(i18nExpr.context); 24411 if (i18nExprValue === undefined) { 24412 throw new Error("AssertionError: Could not find i18n expression's value"); 24413 } 24414 return [literal(i18nExpr.name), i18nExprValue]; 24415 }); 24416 i18nAttributes.i18nAttributesConfig = job.addConst(new LiteralArrayExpr(i18nAttributeConfig)); 24417 } 24418 } 24419 } 24420 // Step Four: Propagate the extracted const index into i18n ops that messages were extracted from. 24421 for (const unit of job.units) { 24422 for (const op of unit.create) { 24423 if (op.kind === OpKind.I18nStart) { 24424 const msgIndex = messageConstIndices.get(op.root); 24425 if (msgIndex === undefined) { 24426 throw new Error('AssertionError: Could not find corresponding i18n block
24426index for an i18n message op; was an i18n message incorrectly assumed to correspond to an attribute?'); 24427 } 24428 op.messageIndex = msgIndex; 24429 } 24430 } 24431 } 24432} 24433/** 24434 * Collects the given message into a set of statements that can be added to the const array. 24435 * This will recursively collect any sub-messages referenced from the parent message as well. 24436 */ 24437function collectMessage(job, fileBasedI18nSuffix, messages, messageOp) { 24438 // Recursively collect any sub-messages, record each sub-message's main variable under its 24439 // placeholder so that we can add them to the params for the parent message. It is possible 24440 // that multiple sub-messages will share the same placeholder, so we need to track an array of 24441 // variables for each placeholder. 24442 const statements = []; 24443 const subMessagePlaceholders = new Map(); 24444 for (const subMessageId of messageOp.subMessages) { 24445 var _subMessagePlaceholde; 24446 const subMessage = messages.get(subMessageId); 24447 const { 24448 mainVar: subMessageVar, 24449 statements: subMessageStatements 24450 } = collectMessage(job, fileBasedI18nSuffix, messages, subMessage); 24451 statements.push(...subMessageStatements); 24452 const subMessages = (_subMessagePlaceholde = subMessagePlaceholders.get(subMessage.messagePlaceholder)) !== null && _subMessagePlaceholde !== void 0 ? _subMessagePlaceholde : []; 24453 subMessages.push(subMessageVar); 24454 subMessagePlaceholders.set(subMessage.messagePlaceholder, subMessages); 24455 } 24456 addSubMessageParams(messageOp, subMessagePlaceholders); 24457 // Sort the params for consistency with TemaplateDefinitionBuilder output. 24458 messageOp.params = new Map([...messageOp.params.entries()].sort()); 24459 const mainVar = variable(job.pool.uniqueName(TRANSLATION_VAR_PREFIX)); 24460 // Closure Compiler requires const names to start with `MSG_` but disallows any other 24461 // const to start with `MSG_`. We define a variable starting with `MSG_` just for the 24462 // `goog.getMsg` call 24463 const closureVar = i18nGenerateClosureVar(job.pool, messageOp.message.id, fileBasedI18nSuffix, job.i18nUseExternalIds); 24464 let transformFn = undefined; 24465 // If nescessary, add a post-processing step and resolve any placeholder params that are 24466 // set in post-processing. 24467 if (messageOp.needsPostprocessing || messageOp.postprocessingParams.size > 0) { 24468 // Sort the post-processing params for consistency with TemaplateDefinitionBuilder output. 24469 const postprocessingParams = Object.fromEntries([...messageOp.postprocessingParams.entries()].sort()); 24470 const formattedPostprocessingParams = formatI18nPlaceholderNamesInMap(postprocessingParams, /* useCamelCase */false); 24471 const extraTransformFnParams = []; 24472 if (messageOp.postprocessingParams.size > 0) { 24473 extraTransformFnParams.push(mapLiteral(formattedPostprocessingParams, /* quoted */true)); 24474 } 24475 transformFn = expr => importExpr(Identifiers.i18nPostprocess).callFn([expr, ...extraTransformFnParams]); 24476 } 24477 // Add the message's statements 24478 statements.push(...getTranslationDeclStmts(messageOp.message, mainVar, closureVar, messageOp.params, transformFn)); 24479 return { 24480 mainVar, 24481 statements 24482 }; 24483} 24484/** 24485 * Adds the given subMessage placeholders to the given message op. 24486 * 24487 * If a placeholder only corresponds to a single sub-message variable, we just set that variable 24488 * as the param value. However, if the placeholder corresponds to multiple sub-message 24489 * variables, we need to add a special placeholder value that is handled by the post-processing 24490 * step. We then add the array of variables as a post-processing param. 24491 */ 24492function addSubMessageParams(messageOp, subMessagePlaceholders) { 24493 for (const [placeholder, subMessages] of subMessagePlaceholders) { 24494 if (subMessages.length === 1) { 24495 messageOp.params.set(placeholder, subMessages[0]); 24496 } else { 24497 messageOp.params.set(placeholder, literal(`${ESCAPE}${I18N_ICU_MAPPING_PREFIX}${placeholder}${ESCAPE}`)); 24498 messageOp.postprocessingParams.set(placeholder, literalArr(subMessages)); 24499 } 24500 } 24501} 24502/** 24503 * Generate statements that define a given translation message. 24504 * 24505 * ```ts 24506 * var I18N_1; 24507 * if (typeof ngI18nClosureMode !== undefined && ngI18nClosureMode) { 24508 * var MSG_EXTERNAL_XXX = goog.getMsg( 24509 * "Some message with {$interpolation}!", 24510 * { "interpolation": "\uFFFD0\uFFFD" } 24511 * ); 24512 * I18N_1 = MSG_EXTERNAL_XXX; 24513 * } 24514 * else { 24515 * I18N_1 = $localize`Some message with ${'\uFFFD0\uFFFD'}!`; 24516 * } 24517 * ``` 24518 * 24519 * @param message The original i18n AST message node 24520 * @param variable The variable that will be assigned the translation, e.g. `I18N_1`. 24521 * @param closureVar The variable for Closure `goog.getMsg` calls, e.g. `MSG_EXTERNAL_XXX`. 24522 * @param params Object mapping placeholder names to their values (e.g. 24523 * `{ "interpolation": "\uFFFD0\uFFFD" }`). 24524 * @param transformFn Optional transformation function that will be applied to the translation 24525 * (e.g. 24526 * post-processing). 24527 * @returns An array of statements that defined a given translation. 24528 */ 24529function getTranslationDeclStmts(message, variable, closureVar, params, transformFn) { 24530 const paramsObject = Object.fromEntries(params); 24531 const statements = [declareI18nVariable(variable), ifStmt(createClosureModeGuard(), createGoogleGetMsgStatements(variable, message, closureVar, paramsObject), createLocalizeStatements(variable, message, formatI18nPlaceholderNamesInMap(paramsObject, /* useCamelCase */false)))]; 24532 if (transformFn) {
24533 statements.push(new ExpressionStatement(variable.set(transformFn(variable)))); 24534 } 24535 return statements; 24536} 24537/** 24538 * Create the expression that will be used to guard the closure mode block 24539 * It is equivalent to: 24540 * 24541 * ```ts 24542 * typeof ngI18nClosureMode !== undefined && ngI18nClosureMode 24543 * ``` 24544 */ 24545function createClosureModeGuard() { 24546 return typeofExpr(variable(NG_I18N_CLOSURE_MODE)).notIdentical(literal('undefined', STRING_TYPE)).and(variable(NG_I18N_CLOSURE_MODE)); 24547} 24548/** 24549 * Generates vars with Closure-specific names for i18n blocks (i.e. `MSG_XXX`). 24550 */ 24551function i18nGenerateClosureVar(pool, messageId, fileBasedI18nSuffix, useExternalIds) { 24552 let name; 24553 const suffix = fileBasedI18nSuffix; 24554 if (useExternalIds) { 24555 const prefix = getTranslationConstPrefix(`EXTERNAL_`); 24556 const uniqueSuffix = pool.uniqueName(suffix); 24557 name = `${prefix}${sanitizeIdentifier(messageId)}$$${uniqueSuffix}`; 24558 } else { 24559 const prefix = getTranslationConstPrefix(suffix); 24560 name = pool.uniqueName(prefix); 24561 } 24562 return variable(name); 24563} 24564 24565/** 24566 * Removes text nodes within i18n blocks since they are already hardcoded into the i18n message. 24567 * Also, replaces interpolations on these text nodes with i18n expressions of the non-text portions, 24568 * which will be applied later. 24569 */ 24570function convertI18nText(job) { 24571 for (const unit of job.units) { 24572 // Remove all text nodes within i18n blocks, their content is already captured in the i18n 24573 // message. 24574 let currentI18n = null; 24575 let currentIcu = null; 24576 const textNodeI18nBlocks = new Map(); 24577 const textNodeIcus = new Map(); 24578 const icuPlaceholderByText = new Map(); 24579 for (const op of unit.create) { 24580 switch (op.kind) { 24581 case OpKind.I18nStart: 24582 if (op.context === null) { 24583 throw Error('I18n op should have its context set.'); 24584 } 24585 currentI18n = op; 24586 break; 24587 case OpKind.I18nEnd: 24588 currentI18n = null; 24589 break; 24590 case OpKind.IcuStart: 24591 if (op.context === null) { 24592 throw Error('Icu op should have its context set.'); 24593 } 24594 currentIcu = op; 24595 break; 24596 case OpKind.IcuEnd: 24597 currentIcu = null; 24598 break; 24599 case OpKind.Text: 24600 if (currentI18n !== null) { 24601 textNodeI18nBlocks.set(op.xref, currentI18n); 24602 textNodeIcus.set(op.xref, currentIcu); 24603 if (op.icuPlaceholder !== null) { 24604 // Create an op to represent the ICU placeholder. Initially set its static text to the 24605 // value of the text op, though this may be overwritten later if this text op is a 24606 // placeholder for an interpolation. 24607 const icuPlaceholderOp = createIcuPlaceholderOp(job.allocateXrefId(), op.icuPlaceholder, [op.initialValue]); 24608 OpList.replace(op, icuPlaceholderOp); 24609 icuPlaceholderByText.set(op.xref, icuPlaceholderOp); 24610 } else { 24611 // Otherwise just remove the text op, since its value is already accounted for in the 24612 // translated message. 24613 OpList.remove(op); 24614 } 24615 } 24616 break; 24617 } 24618 } 24619 // Update any interpolations to the removed text, and instead represent them as a series of i18n 24620 // expressions that we then apply. 24621 for (const op of unit.update) { 24622 switch (op.kind) { 24623 case OpKind.InterpolateText: 24624 if (!textNodeI18nBlocks.has(op.target)) { 24625 continue; 24626 } 24627 const i18nOp = textNodeI18nBlocks.get(op.target); 24628 const icuOp = textNodeIcus.get(op.target); 24629 const icuPlaceholder = icuPlaceholderByText.get(op.target); 24630 const contextId = icuOp ? icuOp.context : i18nOp.context; 24631 const resolutionTime = icuOp ? I18nParamResolutionTime.Postproccessing : I18nParamResolutionTime.Creation; 24632 const ops = []; 24633 for (let i = 0; i < op.interpolation.expressions.length; i++) { 24634 var _icuPlaceholder$xref, _op$interpolation$i, _expr$sourceSpan; 24635 const expr = op.interpolation.expressions[i]; 24636 // For now, this i18nExpression depends on the slot context of the enclosing i18n block. 24637 // Later, we will modify this, and advance to a different point. 24638 ops.push(createI18nExpressionOp(contextId, i18nOp.xref, i18nOp.xref, i18nOp.handle, expr, (_icuPlaceholder$xref = icuPlaceholder === null || icuPlaceholder === void 0 ? void 0 : icuPlaceholder.xref) !== null && _icuPlaceholder$xref !== void 0 ? _icuPlaceholder$xref : null, (_op$interpolation$i = op.interpolation.i18nPlaceholders[i]) !== null && _op$interpolation$i !== void 0 ? _op$interpolation$i : null, resolutionTime, I18nExpressionFor.I18nText, '', (_expr$sourceSpan = expr.sourceSpan) !== null && _expr$sourceSpan !== void 0 ? _expr$sourceSpan : op.sourceSpan)); 24639 } 24640 OpList.replaceWithMany(op, ops); 24641 // If this interpolation is part of an ICU placeholder, add the strings and expressions to 24642 // the placeholder. 24643 if (icuPlaceholder !== undefined) { 24644 icuPlaceholder.strings = op.interpolation.strings; 24645 } 24646 break; 24647 } 24648 } 24649 } 24650} 24651 24652/** 24653 * Lifts local reference declarations on element-like structures within each view into an entry in 24654 * the `consts` array for the whole component. 24655 */ 24656function liftLocalRefs(job) { 24657 for (const unit of job.units) { 24658 for (const op of unit.create) { 24659 switch (op.kind) { 24660 case OpKind.ElementStart: 24661 case OpKind.Template: 24662 if (!Array.isArray(op.localRefs)) { 24663 throw new Error(`AssertionError: expected localRefs to be an array still`); 24664 } 24665 op.numSlotsUsed += op.localRefs.length; 24666 if (op.localRefs.length > 0) { 24667 const localRefs = serializeLocalRefs(op.localRefs); 24668 op.localRefs = job.addConst(localRefs); 24669 } else { 24670 op.localRefs = null; 24671 } 24672 break; 24673 } 24674 } 24675 } 24676} 24677function serializeLocalRefs(refs) { 24678 const constRefs = []; 24679 for (const ref of refs) { 24680 constRefs.push(literal(ref.name), literal(ref.target)); 24681 } 24682 return literalArr(constRefs); 24683} 24684 24685/** 24686 * Change namespaces between HTML, SVG and MathML, depending on the next element. 24687 */ 24688function emitNamespaceChanges(job) { 24689 for (const unit of job.units) { 24690 let activeNamespace = Namespace.HTML; 24691 for (const op of unit.create) { 24692 if (op.kind !== OpKind.ElementStart) { 24693 continue; 24694 } 24695 if (op.namespace !== activeNamespace) { 24696 OpList.insertBefore(createNamespaceOp(op.namespace), op); 24697 activeNamespace = op.namespace; 24698 } 24699 } 24700 } 24701} 24702 24703/** 24704 * Parses string representation of a style and converts it into object literal. 24705 * 24706 * @param value string representation of style as used in the `style` attribute in HTML. 24707 * Example: `color: red; height: auto`. 24708 * @returns An array of style property name and value pairs, e.g. `['color', 'red', 'height', 24709 * 'auto']` 24710 */ 24711function parse(value) { 24712 // we use a string array here instead of a string map 24713 // because a string-map is not guaranteed to retain the 24714 // order of the entries whereas a string array can be
24715 // constructed in a [key, value, key, value] format. 24716 const styles = []; 24717 let i = 0; 24718 let parenDepth = 0; 24719 let quote = 0 /* Char.QuoteNone */; 24720 let valueStart = 0; 24721 let propStart = 0; 24722 let currentProp = null; 24723 while (i < value.length) { 24724 const token = value.charCodeAt(i++); 24725 switch (token) { 24726 case 40 /* Char.OpenParen */: 24727 parenDepth++; 24728 break; 24729 case 41 /* Char.CloseParen */: 24730 parenDepth--; 24731 break; 24732 case 39 /* Char.QuoteSingle */: 24733 // valueStart needs to be there since prop values don't 24734 // have quotes in CSS 24735 if (quote === 0 /* Char.QuoteNone */) { 24736 quote = 39 /* Char.QuoteSingle */; 24737 } else if (quote === 39 /* Char.QuoteSingle */ && value.charCodeAt(i - 1) !== 92 /* Char.BackSlash */) { 24738 quote = 0 /* Char.QuoteNone */; 24739 } 24740 break; 24741 case 34 /* Char.QuoteDouble */: 24742 // same logic as above 24743 if (quote === 0 /* Char.QuoteNone */) { 24744 quote = 34 /* Char.QuoteDouble */; 24745 } else if (quote === 34 /* Char.QuoteDouble */ && value.charCodeAt(i - 1) !== 92 /* Char.BackSlash */) { 24746 quote = 0 /* Char.QuoteNone */; 24747 } 24748 break; 24749 case 58 /* Char.Colon */: 24750 if (!currentProp && parenDepth === 0 && quote === 0 /* Char.QuoteNone */) { 24751 // TODO: Do not hyphenate CSS custom property names like: `--intentionallyCamelCase` 24752 currentProp = hyphenate(value.substring(propStart, i - 1).trim()); 24753 valueStart = i; 24754 } 24755 break; 24756 case 59 /* Char.Semicolon */: 24757 if (currentProp && valueStart > 0 && parenDepth === 0 && quote === 0 /* Char.QuoteNone */) { 24758 const styleVal = value.substring(valueStart, i - 1).trim(); 24759 styles.push(currentProp, styleVal); 24760 propStart = i; 24761 valueStart = 0; 24762 currentProp = null; 24763 } 24764 break; 24765 } 24766 } 24767 if (currentProp && valueStart) { 24768 const styleVal = value.slice(valueStart).trim(); 24769 styles.push(currentProp, styleVal); 24770 } 24771 return styles; 24772} 24773function hyphenate(value) { 24774 return value.replace(/[a-z][A-Z]/g, v => { 24775 return v.charAt(0) + '-' + v.charAt(1); 24776 }).toLowerCase(); 24777} 24778/** 24779 * Parses extracted style and class attributes into separate ExtractedAttributeOps per style or 24780 * class property. 24781 */ 24782function parseExtractedStyles(job) { 24783 const elements = new Map(); 24784 for (const unit of job.units) { 24785 for (const op of unit.create) { 24786 if (isElementOrContainerOp(op)) { 24787 elements.set(op.xref, op); 24788 } 24789 } 24790 } 24791 for (const unit of job.units) { 24792 for (const op of unit.create) { 24793 if (op.kind === OpKind.ExtractedAttribute && op.bindingKind === BindingKind.Attribute && isStringLiteral(op.expression)) { 24794 const target = elements.get(op.target); 24795 if (target !== undefined && target.kind === OpKind.Template && target.templateKind === TemplateKind.Structural) { 24796 // TemplateDefinitionBuilder will not apply class and style bindings to structural 24797 // directives; instead, it will leave them as attributes. 24798 // (It's not clear what that would mean, anyway -- classes and styles on a structural 24799 // element should probably be a parse error.) 24800 // TODO: We may be able to remove this once Template Pipeline is the default. 24801 continue; 24802 } 24803 if (op.name === 'style') { 24804 const parsedStyles = parse(op.expression.value); 24805 for (let i = 0; i < parsedStyles.length - 1; i += 2) { 24806 OpList.insertBefore(createExtractedAttributeOp(op.target, BindingKind.StyleProperty, null, parsedStyles[i], literal(parsedStyles[i + 1]), null, null, SecurityContext.STYLE), op); 24807 } 24808 OpList.remove(op); 24809 } else if (op.name === 'class') { 24810 const parsedClasses = op.expression.value.trim().split(/\s+/g); 24811 for (const parsedClass of parsedClasses) { 24812 OpList.insertBefore(createExtractedAttributeOp(op.target, BindingKind.ClassName, null, parsedClass, null, null, null, SecurityContext.NONE), op); 24813 } 24814 OpList.remove(op); 24815 } 24816 } 24817 } 24818 } 24819} 24820 24821/** 24822 * Generate names for functions and variables across all views. 24823 * 24824 * This includes propagating those names into any `ir.ReadVariableExpr`s of those variables, so that 24825 * the reads can be emitted correctly. 24826 */ 24827function nameFunctionsAndVariables(job) { 24828 addNamesToView(job.root, job.componentName, { 24829 index: 0 24830 }, job.compatibility === CompatibilityMode.TemplateDefinitionBuilder); 24831} 24832function addNamesToView(unit, baseName, state, compatibility) { 24833 if (unit.fnName === null) { 24834 // Ensure unique names for view units. This is necessary because there might be multiple 24835 // components with same names in the context of the same pool. Only add the suffix 24836 // if really needed. 24837 unit.fnName = unit.job.pool.uniqueName(sanitizeIdentifier(`${baseName}_${unit.job.fnSuffix}`), /* alwaysIncludeSuffix */false); 24838 } 24839 // Keep track of the names we assign to variables in the view. We'll need to propagate these 24840 // into reads of those variables afterwards. 24841 const varNames = new Map(); 24842 for (const op of unit.ops()) { 24843 switch (op.kind) { 24844 case OpKind.Property: 24845 case OpKind.HostProperty: 24846 if (op.isAnimationTrigger) { 24847 op.name = '@' + op.name; 24848 } 24849 break; 24850 case OpKind.Listener: 24851 if (op.handlerFnName !== null) { 24852 break; 24853 } 24854 if (!op.hostListener && op.targetSlot.slot === null) { 24855 throw new Error(`Expected a slot to be assigned`); 24856 } 24857 let animation = ''; 24858 if (op.isAnimationListener) { 24859 op.name = `@${op.name}.${op.animationPhase}`; 24860 animation = 'animation'; 24861 } 24862 if (op.hostListener) { 24863 op.handlerFnName = `${baseName}_${animation}${op.name}_HostBindingHandler`; 24864 } else { 24865 op.handlerFnName = `${unit.fnName}_${op.tag.replace('-', '_')}_${animation}${op.name}_${op.targetSlot.slot}_listener`; 24866 } 24867 op.handlerFnName = sanitizeIdentifier(op.handlerFnName); 24868 break; 24869 case OpKind.TwoWayListener: 24870 if (op.handlerFnName !== null) { 24871 break; 24872 } 24873 if (op.targetSlot.slot === null) { 24874 throw new Error(`Expected a slot to be assigned`); 24875 } 24876 op.handlerFnName = sanitizeIdentifier(`${unit.fnName}_${op.tag.replace('-', '_')}_${op.name}_${op.targetSlot.slot}_listener`); 24877 break; 24878 case OpKind.Variable: 24879 varNames.set(op.xref, getVariableName(unit, op.variable, state)); 24880 break; 24881 case OpKind.RepeaterCreate: 24882 if (!(unit instanceof ViewCompilationUnit)) { 24883 throw new Error(`AssertionError: must be compiling a component`); 24884 } 24885 if (op.handle.slot === null) { 24886 throw new Error(`Expected slot to be assigned`); 24887 } 24888 if (op.emptyView !== null) { 24889 const emptyView = unit.job.views.get(op.emptyView); 24890 // Repeater empty view function is at slot +2 (metadata is in the first slot). 24891 addNamesToView(emptyView, `${baseName}_${op.functionNameSuffix}Empty_${op.handle.slot + 2}`, state, compatibility); 24892 } 24893 // Repeater primary view function is at slot +1 (metadata is in the first slot). 24894 addNamesToView(unit.job.views.get(op.xref), `${baseName}_${op.functionNameSuffix}_${op.handle.slot + 1}`, state, compatibility); 24895 break; 24896 case OpKind.Projection: 24897 if (!(unit instanceof ViewCompilationUnit)) { 24898 throw new Error(`AssertionError: must be compiling a component`); 24899 } 24900 if (op.handle.slot === null) { 24901 throw new Error(`Expected slot to be assigned`); 24902 } 24903 if (op.fallbackView !== null) { 24904 const fallbackView = unit.job.views.get(op.fallbackView); 24905 addNamesToView(fallbackView, `${baseName}_ProjectionFallback_${op.handle.slot}`, state, compatibility); 24906 } 24907 break; 24908 case OpKind.Template: 24909 if (!(unit instanceof ViewCompilationUnit)) { 24910 throw new Error(`AssertionError: must be compiling a component`); 24911 } 24912 const childView = unit.job.views.get(op.xref); 24913 if (op.handle.slot === null) { 24914 throw new Error(`Expected slot to be assigned`); 24915 } 24916 const suffix = op.functionNameSuffix.length === 0 ? '' : `_${op.functionNameSuffix}`; 24917 addNamesToView(childView, `${baseName}${suffix}_${op.handle.slot}`, state, compatibility); 24918 break; 24919 case OpKind.StyleProp: 24920 op.name = normalizeStylePropName(op.name); 24921 if (compatibility) { 24922 op.name = stripImportant(op.name); 24923 } 24924 break; 24925 case OpKind.ClassProp: 24926 if (compatibility) { 24927 op.name = stripImportant(op.name); 24928 } 24929 break; 24930 } 24931 } 24932 // Having named all variables declared in the view, now we can push those names into the 24933 // `ir.ReadVariableExpr` expressions which represent reads of those variables. 24934 for (const op of unit.ops()) { 24935 visitExpressionsInOp(op, expr => { 24936 if (!(expr instanceof ReadVariableExpr) || expr.name !== null) { 24937 return; 24938 } 24939 if (!varNames.has(expr.xref)) { 24940 throw new Error(`Variable ${expr.xref} not yet named`); 24941 } 24942 expr.name = varNames.get(expr.xref); 24943 }); 24944 } 24945} 24946function getVariableName(unit, variable, state) { 24947 if (variable.name === null) { 24948 switch (variable.kind) { 24949 case SemanticVariableKind.Context: 24950 variable.name = `ctx_r${state.index++}`; 24951 break; 24952 case SemanticVariableKind.Identifier: 24953 if (unit.job.compatibility === CompatibilityMode.TemplateDefinitionBuilder) { 24954 // TODO: Prefix increment and `_r` are for compatibility with the old naming scheme. 24955 // This has the potential to cause collisions when `ctx` is the identifier, so we need a 24956 // special check for that as well.
24957 const compatPrefix = variable.identifier === 'ctx' ? 'i' : ''; 24958 variable.name = `${variable.identifier}_${compatPrefix}r${++state.index}`; 24959 } else { 24960 variable.name = `${variable.identifier}_i${state.index++}`; 24961 } 24962 break; 24963 default: 24964 // TODO: Prefix increment for compatibility only. 24965 variable.name = `_r${++state.index}`; 24966 break; 24967 } 24968 } 24969 return variable.name; 24970} 24971/** 24972 * Normalizes a style prop name by hyphenating it (unless its a CSS variable). 24973 */ 24974function normalizeStylePropName(name) { 24975 return name.startsWith('--') ? name : hyphenate(name); 24976} 24977/** 24978 * Strips `!important` out of the given style or class name. 24979 */ 24980function stripImportant(name) { 24981 const importantIndex = name.indexOf('!important'); 24982 if (importantIndex > -1) { 24983 return name.substring(0, importantIndex); 24984 } 24985 return name; 24986} 24987 24988/** 24989 * Merges logically sequential `NextContextExpr` operations. 24990 * 24991 * `NextContextExpr` can be referenced repeatedly, "popping" the runtime's context stack each time. 24992 * When two such expressions appear back-to-back, it's possible to merge them together into a single 24993 * `NextContextExpr` that steps multiple contexts. This merging is possible if all conditions are 24994 * met: 24995 * 24996 * * The result of the `NextContextExpr` that's folded into the subsequent one is not stored (that 24997 * is, the call is purely side-effectful). 24998 * * No operations in between them uses the implicit context. 24999 */ 25000function mergeNextContextExpressions(job) { 25001 for (const unit of job.units) { 25002 for (const op of unit.create) { 25003 if (op.kind === OpKind.Listener || op.kind === OpKind.TwoWayListener) { 25004 mergeNextContextsInOps(op.handlerOps); 25005 } 25006 } 25007 mergeNextContextsInOps(unit.update); 25008 } 25009} 25010function mergeNextContextsInOps(ops) { 25011 for (const op of ops) { 25012 // Look for a candidate operation to maybe merge. 25013 if (op.kind !== OpKind.Statement || !(op.statement instanceof ExpressionStatement) || !(op.statement.expr instanceof NextContextExpr)) { 25014 continue; 25015 } 25016 const mergeSteps = op.statement.expr.steps; 25017 // Try to merge this `ir.NextContextExpr`. 25018 let tryToMerge = true; 25019 for (let candidate = op.next; candidate.kind !== OpKind.ListEnd && tryToMerge; candidate = candidate.next) { 25020 visitExpressionsInOp(candidate, (expr, flags) => { 25021 if (!isIrExpression(expr)) { 25022 return expr; 25023 } 25024 if (!tryToMerge) { 25025 // Either we've already merged, or failed to merge. 25026 return; 25027 } 25028 if (flags & VisitorContextFlag.InChildOperation) { 25029 // We cannot merge into child operations. 25030 return; 25031 } 25032 switch (expr.kind) { 25033 case ExpressionKind.NextContext: 25034 // Merge the previous `ir.NextContextExpr` into this one. 25035 expr.steps += mergeSteps; 25036 OpList.remove(op); 25037 tryToMerge = false; 25038 break; 25039 case ExpressionKind.GetCurrentView: 25040 case ExpressionKind.Reference: 25041 case ExpressionKind.ContextLetReference: 25042 // Can't merge past a dependency on the context. 25043 tryToMerge = false; 25044 break; 25045 } 25046 return; 25047 }); 25048 } 25049 } 25050} 25051const CONTAINER_TAG = 'ng-container'; 25052/** 25053 * Replace an `Element` or `ElementStart` whose tag is `ng-container` with a specific op. 25054 */ 25055function generateNgContainerOps(job) { 25056 for (const unit of job.units) { 25057 const updatedElementXrefs = new Set(); 25058 for (const op of unit.create) { 25059 if (op.kind === OpKind.ElementStart && op.tag === CONTAINER_TAG) { 25060 // Transmute the `ElementStart` instruction to `ContainerStart`. 25061 op.kind = OpKind.ContainerStart; 25062 updatedElementXrefs.add(op.xref); 25063 } 25064 if (op.kind === OpKind.ElementEnd && updatedElementXrefs.has(op.xref)) { 25065 // This `ElementEnd` is associated with an `ElementStart` we already transmuted. 25066 op.kind = OpKind.ContainerEnd; 25067 } 25068 } 25069 } 25070} 25071 25072/** 25073 * Looks up an element in the given map by xref ID. 25074 */ 25075function lookupElement(elements, xref) { 25076 const el = elements.get(xref); 25077 if (el === undefined) { 25078 throw new Error('All attributes should have an element-like target.'); 25079 } 25080 return el; 25081} 25082/** 25083 * When a container is marked with `ngNonBindable`, the non-bindable characteristic also applies to 25084 * all descendants of that container. Therefore, we must emit `disableBindings` and `enableBindings` 25085 * instructions for every such container. 25086 */ 25087function disableBindings$1(job) { 25088 const elements = new Map(); 25089 for (const view of job.units) { 25090 for (const op of view.create) { 25091 if (!isElementOrContainerOp(op)) { 25092 continue; 25093 } 25094 elements.set(op.xref, op); 25095 } 25096 } 25097 for (const unit of job.units) { 25098 for (const op of unit.create) { 25099 if ((op.kind === OpKind.ElementStart || op.kind === OpKind.ContainerStart) && op.nonBindable) { 25100 OpList.insertAfter(createDisableBindingsOp(op.xref), op); 25101 } 25102 if ((op.kind === OpKind.ElementEnd || op.kind === OpKind.ContainerEnd) && lookupElement(elements, op.xref).nonBindable) { 25103 OpList.insertBefore(createEnableBindingsOp(op.xref), op); 25104 } 25105 } 25106 } 25107} 25108 25109/** 25110 * Nullish coalescing expressions such as `a ?? b` have different semantics in Angular templates as 25111 * compared to JavaScript. In particular, they default to `null` instead of `undefined`. Therefore, 25112 * we replace them with ternary expressions, assigning temporaries as needed to avoid re-evaluating 25113 * the same sub-expression multiple times. 25114 */ 25115function generateNullishCoalesceExpressions(job) { 25116 for (const unit of job.units) { 25117 for (const op of unit.ops()) { 25118 transformExpressionsInOp(op, expr => { 25119 if (!(expr instanceof BinaryOperatorExpr) || expr.operator !== BinaryOperator.NullishCoalesce) { 25120 return expr; 25121 } 25122 const assignment = new AssignTemporaryExpr(expr.lhs.clone(), job.allocateXrefId()); 25123 const read = new ReadTemporaryExpr(assignment.xref); 25124 // TODO: When not in compatibility mode for TemplateDefinitionBuilder, we can just emit 25125 // `t != null` instead of including an undefined check as well. 25126 return new ConditionalExpr(new BinaryOperatorExpr(BinaryOperator.And, new BinaryOperatorExpr(BinaryOperator.NotIdentical, assignment, NULL_EXPR), new BinaryOperatorExpr(BinaryOperator.NotIdentical, read, new LiteralExpr(undefined))), read.clone(), expr.rhs); 25127 }, VisitorContextFlag.None); 25128 } 25129 } 25130} 25131function kindTest(kind) { 25132 return op => op.kind === kind; 25133} 25134function kindWithInterpolationTest(kind, interpolation) { 25135 return op => { 25136 return op.kind === kind && interpolation === op.expression instanceof Interpolation; 25137 }; 25138} 25139function basicListenerKindTest(op) { 25140 return op.kind === OpKind.Listener && !(op.hostListener && op.isAnimationListener) || op.
25140kind === OpKind.TwoWayListener; 25141} 25142function nonInterpolationPropertyKindTest(op) { 25143 return (op.kind === OpKind.Property || op.kind === OpKind.TwoWayProperty) && !(op.expression instanceof Interpolation); 25144} 25145/** 25146 * Defines the groups based on `OpKind` that ops will be divided into, for the various create 25147 * op kinds. Ops will be collected into groups, then optionally transformed, before recombining 25148 * the groups in the order defined here. 25149 */ 25150const CREATE_ORDERING = [{ 25151 test: op => op.kind === OpKind.Listener && op.hostListener && op.isAnimationListener 25152}, { 25153 test: basicListenerKindTest 25154}]; 25155/** 25156 * Defines the groups based on `OpKind` that ops will be divided into, for the various update 25157 * op kinds. 25158 */ 25159const UPDATE_ORDERING = [{ 25160 test: kindTest(OpKind.StyleMap), 25161 transform: keepLast 25162}, { 25163 test: kindTest(OpKind.ClassMap), 25164 transform: keepLast 25165}, { 25166 test: kindTest(OpKind.StyleProp) 25167}, { 25168 test: kindTest(OpKind.ClassProp) 25169}, { 25170 test: kindWithInterpolationTest(OpKind.Attribute, true) 25171}, { 25172 test: kindWithInterpolationTest(OpKind.Property, true) 25173}, { 25174 test: nonInterpolationPropertyKindTest 25175}, { 25176 test: kindWithInterpolationTest(OpKind.Attribute, false) 25177}]; 25178/** 25179 * Host bindings have their own update ordering. 25180 */ 25181const UPDATE_HOST_ORDERING = [{ 25182 test: kindWithInterpolationTest(OpKind.HostProperty, true) 25183}, { 25184 test: kindWithInterpolationTest(OpKind.HostProperty, false) 25185}, { 25186 test: kindTest(OpKind.Attribute) 25187}, { 25188 test: kindTest(OpKind.StyleMap), 25189 transform: keepLast 25190}, { 25191 test: kindTest(OpKind.ClassMap), 25192 transform: keepLast 25193}, { 25194 test: kindTest(OpKind.StyleProp) 25195}, { 25196 test: kindTest(OpKind.ClassProp) 25197}]; 25198/** 25199 * The set of all op kinds we handle in the reordering phase. 25200 */ 25201const handledOpKinds = new Set([OpKind.Listener, OpKind.TwoWayListener, OpKind.StyleMap, OpKind.ClassMap, OpKind.StyleProp, OpKind.ClassProp, OpKind.Property, OpKind.TwoWayProperty, OpKind.HostProperty, OpKind.Attribute]); 25202/** 25203 * Many type of operations have ordering constraints that must be respected. For example, a 25204 * `ClassMap` instruction must be ordered after a `StyleMap` instruction, in order to have 25205 * predictable semantics that match TemplateDefinitionBuilder and don't break applications. 25206 */ 25207function orderOps(job) { 25208 for (const unit of job.units) { 25209 // First, we pull out ops that need to be ordered. Then, when we encounter an op that shouldn't 25210 // be reordered, put the ones we've pulled so far back in the correct order. Finally, if we 25211 // still have ops pulled at the end, put them back in the correct order. 25212 // Create mode: 25213 orderWithin(unit.create, CREATE_ORDERING); 25214 // Update mode: 25215 const ordering = unit.job.kind === CompilationJobKind.Host ? UPDATE_HOST_ORDERING : UPDATE_ORDERING; 25216 orderWithin(unit.update, ordering); 25217 } 25218} 25219/** 25220 * Order all the ops within the specified group. 25221 */ 25222function orderWithin(opList, ordering) { 25223 let opsToOrder = []; 25224 // Only reorder ops that target the same xref; do not mix ops that target different xrefs. 25225 let firstTargetInGroup = null; 25226 for (const op of opList) { 25227 const currentTarget = hasDependsOnSlotContextTrait(op) ? op.target : null; 25228 if (!handledOpKinds.has(op.kind) || currentTarget !== firstTargetInGroup && firstTargetInGroup !== null && currentTarget !== null) { 25229 OpList.insertBefore(reorder(opsToOrder, ordering), op); 25230 opsToOrder = []; 25231 firstTargetInGroup = null; 25232 } 25233 if (handledOpKinds.has(op.kind)) { 25234 opsToOrder.push(op); 25235 OpList.remove(op); 25236 firstTargetInGroup = currentTarget !== null && currentTarget !== void 0 ? currentTarget : firstTargetInGroup; 25237 } 25238 } 25239 opList.push(reorder(opsToOrder, ordering)); 25240} 25241/** 25242 * Reorders the given list of ops according to the ordering defined by `ORDERING`. 25243 */ 25244function reorder(ops, ordering) { 25245 // Break the ops list into groups based on OpKind. 25246 const groups = Array.from(ordering, () => new Array()); 25247 for (const op of ops) { 25248 const groupIndex = ordering.findIndex(o => o.test(op)); 25249 groups[groupIndex].push(op); 25250 } 25251 // Reassemble the groups into a single list, in the correct order. 25252 return groups.flatMap((group, i) => { 25253 const transform = ordering[i].transform; 25254 return transform ? transform(group) : group; 25255 }); 25256} 25257/** 25258 * Keeps only the last op in a list of ops. 25259 */ 25260function keepLast(ops) { 25261 return ops.slice(ops.length - 1); 25262} 25263 25264/** 25265 * Attributes of `ng-content` named 'select' are specifically removed, because they control which 25266 * content matches as a property of the `projection`, and are not a plain attribute. 25267 */ 25268function removeContentSelectors(job) { 25269 for (const unit of job.units) { 25270 const elements = createOpXrefMap(unit); 25271 for (const op of unit.ops()) { 25272 switch (op.kind) { 25273 case OpKind.Binding: 25274 const target = lookupInXrefMap(elements, op.target); 25275 if (isSelectAttribute(op.name) && target.kind === OpKind.Projection) { 25276 OpList.remove(op); 25277 } 25278 break; 25279 } 25280 } 25281 } 25282} 25283function isSelectAttribute(name) { 25284 return name.toLowerCase() === 'select'; 25285} 25286/** 25287 * Looks up an element in the given map by xref ID. 25288 */ 25289function lookupInXrefMap(map, xref) { 25290 const el = map.get(xref); 25291 if (el === undefined) { 25292 throw new Error('All attributes should have an slottable target.'); 25293 } 25294 return el; 25295} 25296 25297/** 25298 * This phase generates pipe creation instructions. We do this based on the pipe bindings found in 25299 * the update block, in the order we see them. 25300 * 25301 * When not in compatibility mode, we can simply group all these creation instructions together, to 25302 * maximize chaining opportunities. 25303 */ 25304function createPipes(job) { 25305 for (const unit of job.units) { 25306 processPipeBindingsInView(unit); 25307 } 25308} 25309function processPipeBindingsInView(unit) { 25310 for (const updateOp of unit.update) { 25311 visitExpressionsInOp(updateOp, (expr, flags) => { 25312 if (!isIrExpression(expr)) { 25313 return; 25314 } 25315 if (expr.kind !== ExpressionKind.PipeBinding) { 25316 return; 25317 } 25318 if (flags & VisitorContextFlag.InChildOperation) { 25319 throw new Error(`AssertionError: pipe bindings should not appear in child expressions`); 25320 } 25321 if (unit.job.compatibility) { 25322 // TODO: We can delete this cast and check once compatibility mode is removed. 25323 const slotHandle = updateOp.target; 25324 if (slotHandle == undefined) { 25325 throw new Error(`AssertionError: expected slot handle to be assigned for pipe creation`); 25326 } 25327 addPipeToCreationBlock(unit, updateOp.target, expr); 25328 } else { 25329 // When not in compatibility mode, we just add the pipe to the end of the create block. This 25330 // is not only simpler and faster, but allows more chaining opportunities for other 25331 // instructions. 25332 unit.create.push(createPipeOp(expr.target, expr.targetSlot, expr.name)); 25333 } 25334 }); 25335 } 25336} 25337function addPipeToCreationBlock(unit, afterTargetXref, binding) { 25338 // Find the appropriate point to insert the Pipe creation operation. 25339 // We're looking for `afterTargetXref` (and also want to insert after any other pipe operations 25340 // which might be beyond it). 25341 for (let op = unit.create.head.next; op.kind !== OpKind.ListEnd; op = op.next) { 25342 if (!hasConsumesSlotTrait(op)) { 25343 continue; 25344 } 25345 if (op.xref !== afterTargetXref) { 25346 continue; 25347 } 25348 // We've found a tentative insertion point; however, we also want to skip past any _other_ pipe 25349 // operations present. 25350 while (op.next.kind === OpKind.Pipe) { 25351 op = op.next; 25352 } 25353 const pipe = createPipeOp(binding.target, binding.targetSlot, binding.name); 25354 OpList.insertBefore(pipe, op.next); 25355 // This completes adding the pipe to the creation block. 25356 return; 25357 } 25358 // At this point, we've failed to add the pipe to the creation block. 25359 throw new Error(`AssertionError: unable to find insertion point for pipe ${binding.name}`); 25360} 25361 25362/** 25363 * Pipes that accept more than 4 arguments are variadic, and are handled with a different runtime 25364 * instruction. 25365 */ 25366function createVariadicPipes(job) { 25367 for (const unit of job.units) { 25368 for (const op of unit.update) { 25369 transformExpressionsInOp(op, expr => { 25370 if (!(expr instanceof PipeBindingExpr)) { 25371 return expr; 25372 } 25373 // Pipes are variadic if they have more than 4 arguments. 25374 if (expr.args.length <= 4) { 25375 return expr; 25376 } 25377 return new PipeBindingVariadicExpr(expr.target, expr.targetSlot, expr.name, literalArr(expr.args), expr.args.length); 25378 }, VisitorContextFlag.None); 25379 } 25380 } 25381} 25382 25383/** 25384 * Propagate i18n blocks down through child templates that act as placeholders in the root i18n 25385 * message. Specifically, perform an in-order traversal of all the views, and add i18nStart/i18nEnd 25386 * op pairs into descending views. Also, assign an increasing sub-template index to each
25387 * descending view. 25388 */ 25389function propagateI18nBlocks(job) { 25390 propagateI18nBlocksToTemplates(job.root, 0); 25391} 25392/** 25393 * Propagates i18n ops in the given view through to any child views recursively. 25394 */ 25395function propagateI18nBlocksToTemplates(unit, subTemplateIndex) { 25396 let i18nBlock = null; 25397 for (const op of unit.create) { 25398 switch (op.kind) { 25399 case OpKind.I18nStart: 25400 op.subTemplateIndex = subTemplateIndex === 0 ? null : subTemplateIndex; 25401 i18nBlock = op; 25402 break; 25403 case OpKind.I18nEnd: 25404 // When we exit a root-level i18n block, reset the sub-template index counter. 25405 if (i18nBlock.subTemplateIndex === null) { 25406 subTemplateIndex = 0; 25407 } 25408 i18nBlock = null; 25409 break; 25410 case OpKind.Template: 25411 subTemplateIndex = propagateI18nBlocksForView(unit.job.views.get(op.xref), i18nBlock, op.i18nPlaceholder, subTemplateIndex); 25412 break; 25413 case OpKind.RepeaterCreate: 25414 // Propagate i18n blocks to the @for template. 25415 const forView = unit.job.views.get(op.xref); 25416 subTemplateIndex = propagateI18nBlocksForView(forView, i18nBlock, op.i18nPlaceholder, subTemplateIndex); 25417 // Then if there's an @empty template, propagate the i18n blocks for it as well. 25418 if (op.emptyView !== null) { 25419 subTemplateIndex = propagateI18nBlocksForView(unit.job.views.get(op.emptyView), i18nBlock, op.emptyI18nPlaceholder, subTemplateIndex); 25420 } 25421 break; 25422 } 25423 } 25424 return subTemplateIndex; 25425} 25426/** 25427 * Propagate i18n blocks for a view. 25428 */ 25429function propagateI18nBlocksForView(view, i18nBlock, i18nPlaceholder, subTemplateIndex) { 25430 // We found an <ng-template> inside an i18n block; increment the sub-template counter and 25431 // wrap the template's view in a child i18n block. 25432 if (i18nPlaceholder !== undefined) { 25433 if (i18nBlock === null) { 25434 throw Error('Expected template with i18n placeholder to be in an i18n block.'); 25435 } 25436 subTemplateIndex++; 25437 wrapTemplateWithI18n(view, i18nBlock); 25438 } 25439 // Continue traversing inside the template's view. 25440 return propagateI18nBlocksToTemplates(view, subTemplateIndex); 25441} 25442/** 25443 * Wraps a template view with i18n start and end ops. 25444 */ 25445function wrapTemplateWithI18n(unit, parentI18n) { 25446 var _unit$create$head$nex; 25447 // Only add i18n ops if they have not already been propagated to this template. 25448 if (((_unit$create$head$nex = unit.create.head.next) === null || _unit$create$head$nex === void 0 ? void 0 : _unit$create$head$nex.kind) !== OpKind.I18nStart) { 25449 const id = unit.job.allocateXrefId(); 25450 OpList.insertAfter( 25451 // Nested ng-template i18n start/end ops should not receive source spans. 25452 createI18nStartOp(id, parentI18n.message, parentI18n.root, null), unit.create.head); 25453 OpList.insertBefore(createI18nEndOp(id, null), unit.create.tail); 25454 } 25455} 25456function extractPureFunctions(job) { 25457 for (const view of job.units) { 25458 for (const op of view.ops()) { 25459 visitExpressionsInOp(op, expr => { 25460 if (!(expr instanceof PureFunctionExpr) || expr.body === null) { 25461 return; 25462 } 25463 const constantDef = new PureFunctionConstant(expr.args.length); 25464 expr.fn = job.pool.getSharedConstant(constantDef, expr.body); 25465 expr.body = null; 25466 }); 25467 } 25468 } 25469} 25470class PureFunctionConstant extends GenericKeyFn { 25471 constructor(numArgs) { 25472 super(); 25473 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "numArgs", void 0); 25474 this.numArgs = numArgs; 25475 } 25476 keyOf(expr) { 25477 if (expr instanceof PureFunctionParameterExpr) { 25478 return `param(${expr.index})`; 25479 } else { 25480 return super.keyOf(expr); 25481 } 25482 } 25483 // TODO: Use the new pool method `getSharedFunctionReference` 25484 toSharedConstantDeclaration(declName, keyExpr) { 25485 const fnParams = []; 25486 for (let idx = 0; idx < this.numArgs; idx++) { 25487 fnParams.push(new FnParam('a' + idx)); 25488 } 25489 // We will never visit `ir.PureFunctionParameterExpr`s that don't belong to us, because this 25490 // transform runs inside another visitor which will visit nested pure functions before this one. 25491 const returnExpr = transformExpressionsInExpression(keyExpr, expr => { 25492 if (!(expr instanceof PureFunctionParameterExpr)) { 25493 return expr; 25494 } 25495 return variable('a' + expr.index); 25496 }, VisitorContextFlag.None); 25497 return new DeclareVarStmt(declName, new ArrowFunctionExpr(fnParams, returnExpr), undefined, StmtModifier.Final); 25498 } 25499} 25500function generatePureLiteralStructures(job) { 25501 for (const unit of job.units) { 25502 for (const op of unit.update) { 25503 transformExpressionsInOp(op, (expr, flags) => { 25504 if (flags & VisitorContextFlag.InChildOperation) { 25505 return expr; 25506 } 25507 if (expr instanceof LiteralArrayExpr) { 25508 return transformLiteralArray(expr); 25509 } else if (expr instanceof LiteralMapExpr) { 25510 return transformLiteralMap(expr); 25511 } 25512 return expr; 25513 }, VisitorContextFlag.None); 25514 } 25515 } 25516} 25517function transformLiteralArray(expr) { 25518 const derivedEntries = []; 25519 const nonConstantArgs = []; 25520 for (const entry of expr.entries) { 25521 if (entry.isConstant()) { 25522 derivedEntries.push(entry); 25523 } else { 25524 const idx = nonConstantArgs.length; 25525 nonConstantArgs.push(entry); 25526 derivedEntries.push(new PureFunctionParameterExpr(idx)); 25527 } 25528 } 25529 return new PureFunctionExpr(literalArr(derivedEntries), nonConstantArgs); 25530} 25531function transformLiteralMap(expr) { 25532 let derivedEntries = []; 25533 const nonConstantArgs = []; 25534 for (const entry of expr.entries) { 25535 if (entry.value.isConstant()) { 25536 derivedEntries.push(entry); 25537 } else { 25538 const idx = nonConstantArgs.length; 25539 nonConstantArgs.push(entry.value);
25540 derivedEntries.push(new LiteralMapEntry(entry.key, new PureFunctionParameterExpr(idx), entry.quoted)); 25541 } 25542 } 25543 return new PureFunctionExpr(literalMap(derivedEntries), nonConstantArgs); 25544} 25545 25546// This file contains helpers for generating calls to Ivy instructions. In particular, each 25547// instruction type is represented as a function, which may select a specific instruction variant 25548// depending on the exact arguments. 25549function element(slot, tag, constIndex, localRefIndex, sourceSpan) { 25550 return elementOrContainerBase(Identifiers.element, slot, tag, constIndex, localRefIndex, sourceSpan); 25551} 25552function elementStart(slot, tag, constIndex, localRefIndex, sourceSpan) { 25553 return elementOrContainerBase(Identifiers.elementStart, slot, tag, constIndex, localRefIndex, sourceSpan); 25554} 25555function elementOrContainerBase(instruction, slot, tag, constIndex, localRefIndex, sourceSpan) { 25556 const args = [literal(slot)]; 25557 if (tag !== null) { 25558 args.push(literal(tag)); 25559 } 25560 if (localRefIndex !== null) { 25561 args.push(literal(constIndex), 25562 // might be null, but that's okay. 25563 literal(localRefIndex)); 25564 } else if (constIndex !== null) { 25565 args.push(literal(constIndex)); 25566 } 25567 return call(instruction, args, sourceSpan); 25568} 25569function elementEnd(sourceSpan) { 25570 return call(Identifiers.elementEnd, [], sourceSpan); 25571} 25572function elementContainerStart(slot, constIndex, localRefIndex, sourceSpan) { 25573 return elementOrContainerBase(Identifiers.elementContainerStart, slot, /* tag */null, constIndex, localRefIndex, sourceSpan); 25574} 25575function elementContainer(slot, constIndex, localRefIndex, sourceSpan) { 25576 return elementOrContainerBase(Identifiers.elementContainer, slot, /* tag */null, constIndex, localRefIndex, sourceSpan); 25577} 25578function elementContainerEnd() { 25579 return call(Identifiers.elementContainerEnd, [], null); 25580} 25581function template(slot, templateFnRef, decls, vars, tag, constIndex, localRefs, sourceSpan) { 25582 const args = [literal(slot), templateFnRef, literal(decls), literal(vars), literal(tag), literal(constIndex)]; 25583 if (localRefs !== null) { 25584 args.push(literal(localRefs)); 25585 args.push(importExpr(Identifiers.templateRefExtractor)); 25586 } 25587 while (args[args.length - 1].isEquivalent(NULL_EXPR)) { 25588 args.pop(); 25589 } 25590 return call(Identifiers.templateCreate, args, sourceSpan); 25591} 25592function disableBindings() { 25593 return call(Identifiers.disableBindings, [], null); 25594} 25595function enableBindings() { 25596 return call(Identifiers.enableBindings, [], null); 25597} 25598function listener(name, handlerFn, eventTargetResolver, syntheticHost, sourceSpan) { 25599 const args = [literal(name), handlerFn]; 25600 if (eventTargetResolver !== null) { 25601 args.push(literal(false)); // `useCapture` flag, defaults to `false` 25602 args.push(importExpr(eventTargetResolver)); 25603 } 25604 return call(syntheticHost ? Identifiers.syntheticHostListener : Identifiers.listener, args, sourceSpan); 25605} 25606function twoWayBindingSet(target, value) { 25607 return importExpr(Identifiers.twoWayBindingSet).callFn([target, value]); 25608} 25609function twoWayListener(name, handlerFn, sourceSpan) { 25610 return call(Identifiers.twoWayListener, [literal(name), handlerFn], sourceSpan); 25611} 25612function pipe(slot, name) { 25613 return call(Identifiers.pipe, [literal(slot), literal(name)], null); 25614} 25615function namespaceHTML() { 25616 return call(Identifiers.namespaceHTML, [], null); 25617} 25618function namespaceSVG() { 25619 return call(Identifiers.namespaceSVG, [], null); 25620} 25621function namespaceMath() { 25622 return call(Identifiers.namespaceMathML, [], null); 25623} 25624function advance(delta, sourceSpan) { 25625 return call(Identifiers.advance, delta > 1 ? [literal(delta)] : [], sourceSpan); 25626} 25627function reference(slot) { 25628 return importExpr(Identifiers.reference).callFn([literal(slot)]); 25629} 25630function nextContext(steps) { 25631 return importExpr(Identifiers.nextContext).callFn(steps === 1 ? [] : [literal(steps)]); 25632} 25633function getCurrentView() { 25634 return importExpr(Identifiers.getCurrentView).callFn([]); 25635} 25636function restoreView(savedView) { 25637 return importExpr(Identifiers.restoreView).callFn([savedView]); 25638} 25639function resetView(returnValue) { 25640 return importExpr(Identifiers.resetView).callFn([returnValue]); 25641} 25642function text(slot, initialValue, sourceSpan) { 25643 const args = [literal(slot, null)]; 25644 if (initialValue !== '') { 25645 args.push(literal(initialValue)); 25646 } 25647 return call(Identifiers.text, args, sourceSpan); 25648} 25649function defer(selfSlot, primarySlot, dependencyResolverFn, loadingSlot, placeholderSlot, errorSlot, loadingConfig, placeholderConfig, enableTimerScheduling, sourceSpan, flags) { 25650 const args = [literal(selfSlot), literal(primarySlot), dependencyResolverFn !== null && dependencyResolverFn !== void 0 ? dependencyResolverFn : literal(null), literal(loadingSlot), literal(placeholderSlot), literal(errorSlot), loadingConfig !== null && loadingConfig !== void 0 ? loadingConfig : literal(null), placeholderConfig !== null && placeholderConfig !== void 0 ? placeholderConfig : literal(null), enableTimerScheduling ? importExpr(Identifiers.deferEnableTimerScheduling) : literal(null), literal(flags)]; 25651 let expr; 25652 while ((expr = args[args.length - 1]) !== null && expr instanceof LiteralExpr && expr.value === null) { 25653 args.pop(); 25654 } 25655 return call(Identifiers.defer, args, sourceSpan); 25656}
25657const deferTriggerToR3TriggerInstructionsMap = new Map([[DeferTriggerKind.Idle, { 25658 ["none" /* ir.DeferOpModifierKind.NONE */]: Identifiers.deferOnIdle, 25659 ["prefetch" /* ir.DeferOpModifierKind.PREFETCH */]: Identifiers.deferPrefetchOnIdle, 25660 ["hydrate" /* ir.DeferOpModifierKind.HYDRATE */]: Identifiers.deferHydrateOnIdle 25661}], [DeferTriggerKind.Immediate, { 25662 ["none" /* ir.DeferOpModifierKind.NONE */]: Identifiers.deferOnImmediate, 25663 ["prefetch" /* ir.DeferOpModifierKind.PREFETCH */]: Identifiers.deferPrefetchOnImmediate, 25664 ["hydrate" /* ir.DeferOpModifierKind.HYDRATE */]: Identifiers.deferHydrateOnImmediate 25665}], [DeferTriggerKind.Timer, { 25666 ["none" /* ir.DeferOpModifierKind.NONE */]: Identifiers.deferOnTimer, 25667 ["prefetch" /* ir.DeferOpModifierKind.PREFETCH */]: Identifiers.deferPrefetchOnTimer, 25668 ["hydrate" /* ir.DeferOpModifierKind.HYDRATE */]: Identifiers.deferHydrateOnTimer 25669}], [DeferTriggerKind.Hover, { 25670 ["none" /* ir.DeferOpModifierKind.NONE */]: Identifiers.deferOnHover, 25671 ["prefetch" /* ir.DeferOpModifierKind.PREFETCH */]: Identifiers.deferPrefetchOnHover, 25672 ["hydrate" /* ir.DeferOpModifierKind.HYDRATE */]: Identifiers.deferHydrateOnHover 25673}], [DeferTriggerKind.Interaction, { 25674 ["none" /* ir.DeferOpModifierKind.NONE */]: Identifiers.deferOnInteraction, 25675 ["prefetch" /* ir.DeferOpModifierKind.PREFETCH */]: Identifiers.deferPrefetchOnInteraction, 25676 ["hydrate" /* ir.DeferOpModifierKind.HYDRATE */]: Identifiers.deferHydrateOnInteraction 25677}], [DeferTriggerKind.Viewport, { 25678 ["none" /* ir.DeferOpModifierKind.NONE */]: Identifiers.deferOnViewport, 25679 ["prefetch" /* ir.DeferOpModifierKind.PREFETCH */]: Identifiers.deferPrefetchOnViewport, 25680 ["hydrate" /* ir.DeferOpModifierKind.HYDRATE */]: Identifiers.deferHydrateOnViewport 25681}], [DeferTriggerKind.Never, { 25682 ["none" /* ir.DeferOpModifierKind.NONE */]: Identifiers.deferHydrateNever, 25683 ["prefetch" /* ir.DeferOpModifierKind.PREFETCH */]: Identifiers.deferHydrateNever, 25684 ["hydrate" /* ir.DeferOpModifierKind.HYDRATE */]: Identifiers.deferHydrateNever 25685}]]); 25686function deferOn(trigger, args, modifier, sourceSpan) { 25687 var _deferTriggerToR3Trig; 25688 const instructionToCall = (_deferTriggerToR3Trig = deferTriggerToR3TriggerInstructionsMap.get(trigger)) === null || _deferTriggerToR3Trig === void 0 ? void 0 : _deferTriggerToR3Trig[modifier]; 25689 if (instructionToCall === undefined) { 25690 throw new Error(`Unable to determine instruction for trigger ${trigger}`); 25691 } 25692 return call(instructionToCall, args.map(a => literal(a)), sourceSpan); 25693} 25694function projectionDef(def) { 25695 return call(Identifiers.projectionDef, def ? [def] : [], null); 25696} 25697function projection(slot, projectionSlotIndex, attributes, fallbackFnName, fallbackDecls, fallbackVars, sourceSpan) { 25698 const args = [literal(slot)]; 25699 if (projectionSlotIndex !== 0 || attributes !== null || fallbackFnName !== null) { 25700 args.push(literal(projectionSlotIndex)); 25701 if (attributes !== null) { 25702 args.push(attributes); 25703 } 25704 if (fallbackFnName !== null) { 25705 if (attributes === null) { 25706 args.push(literal(null)); 25707 } 25708 args.push(variable(fallbackFnName), literal(fallbackDecls), literal(fallbackVars)); 25709 } 25710 } 25711 return call(Identifiers.projection, args, sourceSpan); 25712} 25713function i18nStart(slot, constIndex, subTemplateIndex, sourceSpan) { 25714 const args = [literal(slot), literal(constIndex)]; 25715 if (subTemplateIndex !== null) { 25716 args.push(literal(subTemplateIndex)); 25717 } 25718 return call(Identifiers.i18nStart, args, sourceSpan); 25719} 25720function repeaterCreate(slot, viewFnName, decls, vars, tag, constIndex, trackByFn, trackByUsesComponentInstance, emptyViewFnName, emptyDecls, emptyVars, emptyTag, emptyConstIndex, sourceSpan) { 25721 const args = [literal(slot), variable(viewFnName), literal(decls), literal(vars), literal(tag), literal(constIndex), trackByFn]; 25722 if (trackByUsesComponentInstance || emptyViewFnName !== null) { 25723 args.push(literal(trackByUsesComponentInstance)); 25724 if (emptyViewFnName !== null) { 25725 args.push(variable(emptyViewFnName), literal(emptyDecls), literal(emptyVars)); 25726 if (emptyTag !== null || emptyConstIndex !== null) { 25727 args.push(literal(emptyTag)); 25728 } 25729 if (emptyConstIndex !== null) { 25730 args.push(literal(emptyConstIndex)); 25731 } 25732 } 25733 } 25734 return call(Identifiers.repeaterCreate, args, sourceSpan); 25735} 25736function repeater(collection, sourceSpan) { 25737 return call(Identifiers.repeater, [collection], sourceSpan); 25738} 25739function deferWhen(modifier, expr, sourceSpan) { 25740 if (modifier === "prefetch" /* ir.DeferOpModifierKind.PREFETCH */) { 25741 return call(Identifiers.deferPrefetchWhen, [expr], sourceSpan); 25742 } else if (modifier === "hydrate" /* ir.DeferOpModifierKind.HYDRATE */) { 25743 return call(Identifiers.deferHydrateWhen, [expr], sourceSpan); 25744 } 25745 return call(Identifiers.deferWhen, [expr], sourceSpan); 25746} 25747function declareLet(slot, sourceSpan) { 25748 return call(Identifiers.declareLet, [literal(slot)], sourceSpan); 25749} 25750function storeLet(value, sourceSpan) { 25751 return importExpr(Identifiers.storeLet).callFn([value], sourceSpan); 25752} 25753function readContextLet(slot) { 25754 return importExpr(Identifiers.readContextLet).callFn([literal(slot)]); 25755} 25756function i18n(slot, constIndex, subTemplateIndex, sourceSpan) { 25757 const args = [literal(slot), literal(constIndex)]; 25758 if (subTemplateIndex) { 25759 args.push(literal(subTemplateIndex)); 25760 } 25761 return call(Identifiers.i18n, args, sourceSpan); 25762} 25763function i18nEnd(endSourceSpan) { 25764 return call(Identifiers.i18nEnd, [], endSourceSpan); 25765} 25766function i18nAttributes(slot, i18nAttributesConfig) { 25767 const args = [literal(slot), literal(i18nAttributesConfig)]; 25768 return call(Identifiers.i18nAttributes, args, null); 25769} 25770function property(name, expression, sanitizer, sourceSpan) { 25771 const args = [literal(name), expression]; 25772 if (sanitizer !== null) { 25773 args.push(sanitizer); 25774 } 25775 return call(Identifiers.property, args, sourceSpan); 25776} 25777function twoWayProperty(name, expression, sanitizer, sourceSpan) { 25778 const args = [literal(name), expression]; 25779 if (sanitizer !== null) { 25780 args.push(sanitizer); 25781 } 25782 return call(Identifiers.twoWayProperty, args, sourceSpan); 25783} 25784function attribute(name, expression, sanitizer, namespace) { 25785 const args = [literal(name), expression]; 25786 if (sanitizer !== null || namespace !== null) { 25787 args.push(sanitizer !== null && sanitizer !== void 0 ? sanitizer : literal(null)); 25788 } 25789 if (namespace !== null) { 25790 args.push(literal(namespace)); 25791 } 25792 return call(Identifiers.attribute, args, null); 25793} 25794function styleProp(name, expression, unit, sourceSpan) { 25795 const args = [literal(name), expression]; 25796 if (unit !== null) { 25797 args.push(literal(unit)); 25798 } 25799 return call(Identifiers.styleProp, args, sourceSpan); 25800} 25801function classProp(name, expression, sourceSpan) { 25802 return call(Identifiers.classProp, [literal(name), expression], sourceSpan); 25803} 25804function styleMap(expression, sourceSpan) { 25805 return call(Identifiers.styleMap, [expression], sourceSpan); 25806} 25807function classMap(expression, sourceSpan) { 25808 return call(Identifiers.classMap, [expression], sourceSpan); 25809} 25810const PIPE_BINDINGS = [Identifiers.pipeBind1, Identifiers.pipeBind2, Identifiers.pipeBind3, Identifiers.pipeBind4];
25811function pipeBind(slot, varOffset, args) { 25812 if (args.length < 1 || args.length > PIPE_BINDINGS.length) { 25813 throw new Error(`pipeBind() argument count out of bounds`); 25814 } 25815 const instruction = PIPE_BINDINGS[args.length - 1]; 25816 return importExpr(instruction).callFn([literal(slot), literal(varOffset), ...args]); 25817} 25818function pipeBindV(slot, varOffset, args) { 25819 return importExpr(Identifiers.pipeBindV).callFn([literal(slot), literal(varOffset), args]); 25820} 25821function textInterpolate(strings, expressions, sourceSpan) { 25822 const interpolationArgs = collateInterpolationArgs(strings, expressions); 25823 return callVariadicInstruction(TEXT_INTERPOLATE_CONFIG, [], interpolationArgs, [], sourceSpan); 25824} 25825function i18nExp(expr, sourceSpan) { 25826 return call(Identifiers.i18nExp, [expr], sourceSpan); 25827} 25828function i18nApply(slot, sourceSpan) { 25829 return call(Identifiers.i18nApply, [literal(slot)], sourceSpan); 25830} 25831function propertyInterpolate(name, strings, expressions, sanitizer, sourceSpan) { 25832 const interpolationArgs = collateInterpolationArgs(strings, expressions); 25833 const extraArgs = []; 25834 if (sanitizer !== null) { 25835 extraArgs.push(sanitizer); 25836 } 25837 return callVariadicInstruction(PROPERTY_INTERPOLATE_CONFIG, [literal(name)], interpolationArgs, extraArgs, sourceSpan); 25838} 25839function attributeInterpolate(name, strings, expressions, sanitizer, sourceSpan) { 25840 const interpolationArgs = collateInterpolationArgs(strings, expressions); 25841 const extraArgs = []; 25842 if (sanitizer !== null) { 25843 extraArgs.push(sanitizer); 25844 } 25845 return callVariadicInstruction(ATTRIBUTE_INTERPOLATE_CONFIG, [literal(name)], interpolationArgs, extraArgs, sourceSpan); 25846} 25847function stylePropInterpolate(name, strings, expressions, unit, sourceSpan) { 25848 const interpolationArgs = collateInterpolationArgs(strings, expressions); 25849 const extraArgs = []; 25850 if (unit !== null) { 25851 extraArgs.push(literal(unit)); 25852 } 25853 return callVariadicInstruction(STYLE_PROP_INTERPOLATE_CONFIG, [literal(name)], interpolationArgs, extraArgs, sourceSpan); 25854} 25855function styleMapInterpolate(strings, expressions, sourceSpan) { 25856 const interpolationArgs = collateInterpolationArgs(strings, expressions); 25857 return callVariadicInstruction(STYLE_MAP_INTERPOLATE_CONFIG, [], interpolationArgs, [], sourceSpan); 25858} 25859function classMapInterpolate(strings, expressions, sourceSpan) { 25860 const interpolationArgs = collateInterpolationArgs(strings, expressions); 25861 return callVariadicInstruction(CLASS_MAP_INTERPOLATE_CONFIG, [], interpolationArgs, [], sourceSpan); 25862} 25863function hostProperty(name, expression, sanitizer, sourceSpan) { 25864 const args = [literal(name), expression]; 25865 if (sanitizer !== null) { 25866 args.push(sanitizer); 25867 } 25868 return call(Identifiers.hostProperty, args, sourceSpan); 25869} 25870function syntheticHostProperty(name, expression, sourceSpan) { 25871 return call(Identifiers.syntheticHostProperty, [literal(name), expression], sourceSpan); 25872} 25873function pureFunction(varOffset, fn, args) { 25874 return callVariadicInstructionExpr(PURE_FUNCTION_CONFIG, [literal(varOffset), fn], args, [], null); 25875} 25876function attachSourceLocation(templatePath, locations) { 25877 return call(Identifiers.attachSourceLocations, [literal(templatePath), locations], null); 25878} 25879/** 25880 * Collates the string an expression arguments for an interpolation instruction. 25881 */ 25882function collateInterpolationArgs(strings, expressions) { 25883 if (strings.length < 1 || expressions.length !== strings.length - 1) { 25884 throw new Error(`AssertionError: expected specific shape of args for strings/expressions in interpolation`); 25885 } 25886 const interpolationArgs = []; 25887 if (expressions.length === 1 && strings[0] === '' && strings[1] === '') { 25888 interpolationArgs.push(expressions[0]); 25889 } else { 25890 let idx; 25891 for (idx = 0; idx < expressions.length; idx++) { 25892 interpolationArgs.push(literal(strings[idx]), expressions[idx]); 25893 } 25894 // idx points at the last string. 25895 interpolationArgs.push(literal(strings[idx])); 25896 } 25897 return interpolationArgs; 25898} 25899function call(instruction, args, sourceSpan) { 25900 const expr = importExpr(instruction).callFn(args, sourceSpan);
25901 return createStatementOp(new ExpressionStatement(expr, sourceSpan)); 25902} 25903function conditional(condition, contextValue, sourceSpan) { 25904 const args = [condition]; 25905 if (contextValue !== null) { 25906 args.push(contextValue); 25907 } 25908 return call(Identifiers.conditional, args, sourceSpan); 25909} 25910/** 25911 * `InterpolationConfig` for the `textInterpolate` instruction. 25912 */ 25913const TEXT_INTERPOLATE_CONFIG = { 25914 constant: [Identifiers.textInterpolate, Identifiers.textInterpolate1, Identifiers.textInterpolate2, Identifiers.textInterpolate3, Identifiers.textInterpolate4, Identifiers.textInterpolate5, Identifiers.textInterpolate6, Identifiers.textInterpolate7, Identifiers.textInterpolate8], 25915 variable: Identifiers.textInterpolateV, 25916 mapping: n => { 25917 if (n % 2 === 0) { 25918 throw new Error(`Expected odd number of arguments`); 25919 } 25920 return (n - 1) / 2; 25921 } 25922}; 25923/** 25924 * `InterpolationConfig` for the `propertyInterpolate` instruction. 25925 */ 25926const PROPERTY_INTERPOLATE_CONFIG = { 25927 constant: [Identifiers.propertyInterpolate, Identifiers.propertyInterpolate1, Identifiers.propertyInterpolate2, Identifiers.propertyInterpolate3, Identifiers.propertyInterpolate4, Identifiers.propertyInterpolate5, Identifiers.propertyInterpolate6, Identifiers.propertyInterpolate7, Identifiers.propertyInterpolate8], 25928 variable: Identifiers.propertyInterpolateV, 25929 mapping: n => { 25930 if (n % 2 === 0) { 25931 throw new Error(`Expected odd number of arguments`); 25932 } 25933 return (n - 1) / 2; 25934 } 25935}; 25936/** 25937 * `InterpolationConfig` for the `stylePropInterpolate` instruction. 25938 */ 25939const STYLE_PROP_INTERPOLATE_CONFIG = { 25940 constant: [Identifiers.styleProp, Identifiers.stylePropInterpolate1, Identifiers.stylePropInterpolate2, Identifiers.stylePropInterpolate3, Identifiers.stylePropInterpolate4, Identifiers.stylePropInterpolate5, Identifiers.stylePropInterpolate6, Identifiers.stylePropInterpolate7, Identifiers.stylePropInterpolate8], 25941 variable: Identifiers.stylePropInterpolateV, 25942 mapping: n => { 25943 if (n % 2 === 0) { 25944 throw new Error(`Expected odd number of arguments`); 25945 } 25946 return (n - 1) / 2; 25947 } 25948}; 25949/** 25950 * `InterpolationConfig` for the `attributeInterpolate` instruction. 25951 */ 25952const ATTRIBUTE_INTERPOLATE_CONFIG = { 25953 constant: [Identifiers.attribute, Identifiers.attributeInterpolate1, Identifiers.attributeInterpolate2, Identifiers.attributeInterpolate3, Identifiers.attributeInterpolate4, Identifiers.attributeInterpolate5, Identifiers.attributeInterpolate6, Identifiers.attributeInterpolate7, Identifiers.attributeInterpolate8], 25954 variable: Identifiers.attributeInterpolateV, 25955 mapping: n => { 25956 if (n % 2 === 0) { 25957 throw new Error(`Expected odd number of arguments`); 25958 } 25959 return (n - 1) / 2; 25960 } 25961}; 25962/** 25963 * `InterpolationConfig` for the `styleMapInterpolate` instruction. 25964 */ 25965const STYLE_MAP_INTERPOLATE_CONFIG = { 25966 constant: [Identifiers.styleMap, Identifiers.styleMapInterpolate1, Identifiers.styleMapInterpolate2, Identifiers.styleMapInterpolate3, Identifiers.styleMapInterpolate4, Identifiers.styleMapInterpolate5, Identifiers.styleMapInterpolate6, Identifiers.styleMapInterpolate7, Identifiers.styleMapInterpolate8], 25967 variable: Identifiers.styleMapInterpolateV, 25968 mapping: n => { 25969 if (n % 2 === 0) { 25970 throw new Error(`Expected odd number of arguments`); 25971 } 25972 return (n - 1) / 2; 25973 } 25974}; 25975/** 25976 * `InterpolationConfig` for the `classMapInterpolate` instruction. 25977 */ 25978const CLASS_MAP_INTERPOLATE_CONFIG = { 25979 constant: [Identifiers.classMap, Identifiers.classMapInterpolate1, Identifiers.classMapInterpolate2, Identifiers.classMapInterpolate3, Identifiers.classMapInterpolate4, Identifiers.classMapInterpolate5, Identifiers.classMapInterpolate6, Identifiers.classMapInterpolate7, Identifiers.classMapInterpolate8], 25980 variable: Identifiers.classMapInterpolateV, 25981 mapping: n => { 25982 if (n % 2 === 0) { 25983 throw new Error(`Expected odd number of arguments`); 25984 } 25985 return (n - 1) / 2; 25986 } 25987}; 25988const PURE_FUNCTION_CONFIG = { 25989 constant: [Identifiers.pureFunction0, Identifiers.pureFunction1, Identifiers.pureFunction2, Identifiers.pureFunction3, Identifiers.pureFunction4, Identifiers.pureFunction5, Identifiers.pureFunction6, Identifiers.pureFunction7, Identifiers.pureFunction8], 25990 variable: Identifiers.pureFunctionV, 25991 mapping: n => n 25992}; 25993function callVariadicInstructionExpr(config, baseArgs, interpolationArgs, extraArgs, sourceSpan) { 25994 const n = config.mapping(interpolationArgs.length); 25995 if (n < config.constant.length) { 25996 // Constant calling pattern. 25997 return importExpr(config.constant[n]).callFn([...baseArgs, ...interpolationArgs, ...extraArgs], sourceSpan); 25998 } else if (config.variable !== null) {
25999 // Variable calling pattern. 26000 return importExpr(config.variable).callFn([...baseArgs, literalArr(interpolationArgs), ...extraArgs], sourceSpan); 26001 } else { 26002 throw new Error(`AssertionError: unable to call variadic function`); 26003 } 26004} 26005function callVariadicInstruction(config, baseArgs, interpolationArgs, extraArgs, sourceSpan) { 26006 return createStatementOp(callVariadicInstructionExpr(config, baseArgs, interpolationArgs, extraArgs, sourceSpan).toStmt()); 26007} 26008 26009/** 26010 * Map of target resolvers for event listeners. 26011 */ 26012const GLOBAL_TARGET_RESOLVERS = new Map([['window', Identifiers.resolveWindow], ['document', Identifiers.resolveDocument], ['body', Identifiers.resolveBody]]); 26013/** 26014 * Compiles semantic operations across all views and generates output `o.Statement`s with actual 26015 * runtime calls in their place. 26016 * 26017 * Reification replaces semantic operations with selected Ivy instructions and other generated code 26018 * structures. After reification, the create/update operation lists of all views should only contain 26019 * `ir.StatementOp`s (which wrap generated `o.Statement`s). 26020 */ 26021function reify(job) { 26022 for (const unit of job.units) { 26023 reifyCreateOperations(unit, unit.create); 26024 reifyUpdateOperations(unit, unit.update); 26025 } 26026} 26027function reifyCreateOperations(unit, ops) { 26028 var _op$loadingSlot$slot, _op$loadingSlot, _op$placeholderSlot$s, _op$placeholderSlot, _op$errorSlot$slot, _op$errorSlot; 26029 for (const op of ops) { 26030 transformExpressionsInOp(op, reifyIrExpression, VisitorContextFlag.None); 26031 switch (op.kind) { 26032 case OpKind.Text: 26033 OpList.replace(op, text(op.handle.slot, op.initialValue, op.sourceSpan)); 26034 break; 26035 case OpKind.ElementStart: 26036 OpList.replace(op, elementStart(op.handle.slot, op.tag, op.attributes, op.localRefs, op.startSourceSpan)); 26037 break; 26038 case OpKind.Element: 26039 OpList.replace(op, element(op.handle.slot, op.tag, op.attributes, op.localRefs, op.wholeSourceSpan)); 26040 break; 26041 case OpKind.ElementEnd: 26042 OpList.replace(op, elementEnd(op.sourceSpan)); 26043 break; 26044 case OpKind.ContainerStart: 26045 OpList.replace(op, elementContainerStart(op.handle.slot, op.attributes, op.localRefs, op.startSourceSpan)); 26046 break; 26047 case OpKind.Container: 26048 OpList.replace(op, elementContainer(op.handle.slot, op.attributes, op.localRefs, op.wholeSourceSpan)); 26049 break; 26050 case OpKind.ContainerEnd: 26051 OpList.replace(op, elementContainerEnd()); 26052 break; 26053 case OpKind.I18nStart: 26054 OpList.replace(op, i18nStart(op.handle.slot, op.messageIndex, op.subTemplateIndex, op.sourceSpan)); 26055 break; 26056 case OpKind.I18nEnd: 26057 OpList.replace(op, i18nEnd(op.sourceSpan)); 26058 break; 26059 case OpKind.I18n: 26060 OpList.replace(op, i18n(op.handle.slot, op.messageIndex, op.subTemplateIndex, op.sourceSpan)); 26061 break; 26062 case OpKind.I18nAttributes: 26063 if (op.i18nAttributesConfig === null) { 26064 throw new Error(`AssertionError: i18nAttributesConfig was not set`); 26065 } 26066 OpList.replace(op, i18nAttributes(op.handle.slot, op.i18nAttributesConfig)); 26067 break; 26068 case OpKind.Template: 26069 if (!(unit instanceof ViewCompilationUnit)) { 26070 throw new Error(`AssertionError: must be compiling a component`); 26071 } 26072 if (Array.isArray(op.localRefs)) { 26073 throw new Error(`AssertionError: local refs array should have been extracted into a constant`); 26074 } 26075 const childView = unit.job.views.get(op.xref); 26076 OpList.replace(op, template(op.handle.slot, variable(childView.fnName), childView.decls, childView.vars, op.tag, op.attributes, op.localRefs, op.startSourceSpan)); 26077 break; 26078 case OpKind.DisableBindings: 26079 OpList.replace(op, disableBindings()); 26080 break; 26081 case OpKind.EnableBindings: 26082 OpList.replace(op, enableBindings()); 26083 break; 26084 case OpKind.Pipe: 26085 OpList.replace(op, pipe(op.handle.slot, op.name)); 26086 break; 26087 case OpKind.DeclareLet: 26088 OpList.replace(op, declareLet(op.handle.slot, op.sourceSpan)); 26089 break; 26090 case OpKind.Listener: 26091 const listenerFn = reifyListenerHandler(unit, op.handlerFnName, op.handlerOps, op.consumesDollarEvent); 26092 const eventTargetResolver = op.eventTarget ? GLOBAL_TARGET_RESOLVERS.get(op.eventTarget) : null; 26093 if (eventTargetResolver === undefined) { 26094 throw new Error(`Unexpected global target '${op.eventTarget}' defined for '${op.name}' event. Supported list of global targets: window,document,body.`); 26095 } 26096 OpList.replace(op, listener(op.name, listenerFn, eventTargetResolver, op.hostListener && op.isAnimationListener, op.sourceSpan)); 26097 break; 26098 case OpKind.TwoWayListener: 26099 OpList.replace(op, twoWayListener(op.name, reifyListenerHandler(unit, op.handlerFnName, op.handlerOps, true), op.sourceSpan)); 26100 break; 26101 case OpKind.Variable: 26102 if (op.variable.name === null) { 26103 throw new Error(`AssertionError: unnamed variable ${op.xref}`); 26104 } 26105 OpList.replace(op, createStatementOp(new DeclareVarStmt(op.variable.name, op.initializer, undefined, StmtModifier.Final))); 26106 break; 26107 case OpKind.Namespace: 26108 switch (op.active) { 26109 case Namespace.HTML: 26110 OpList.replace(op, namespaceHTML()); 26111 break; 26112 case Namespace.SVG: 26113 OpList.replace(op, namespaceSVG()); 26114 break; 26115 case Namespace.Math: 26116 OpList.replace(op, namespaceMath()); 26117 break; 26118 } 26119 break; 26120 case OpKind.Defer: 26121 const timerScheduling = !!op.loadingMinimumTime || !!op.loadingAfterTime || !!op.placeholderMinimumTime; 26122 OpList.replace(op, defer(op.handle.slot, op.mainSlot.slot, op.resolverFn, (_op$loadingSlot$slot = (_op$loadingSlot = op.loadingSlot) === null || _op$loadingSlot === void 0 ? void 0 : _op$loadingSlot.slot) !== null && _op$loadingSlot$slot !== void 0 ? _op$loadingSlot$slot : null, (_op$placeholderSlot$s = (_op$placeholderSlot = op.placeholderSlot) === null || _op$placeholderSlot === void 0 ? void 0 : _op$placeholderSlot.slot) !== null && _op$placeholderSlot$s !== void 0 ? _op$placeholderSlot$s : null, (_op$errorSlot$slot = (_op$errorSlot = op.errorSlot) === null || _op$errorSlot === void 0 ? void 0 : _op$errorSlot.slot) !== null && _op$errorSlot$slot !== void 0 ? _op$errorSlot$slot : null, op.loadingConfig, op.placeholderConfig, timerScheduling, op.sourceSpan, op.flags)); 26123 break; 26124 case OpKind.DeferOn: 26125 let args = []; 26126 switch (op.trigger.kind) { 26127 case DeferTriggerKind.Never: 26128 case DeferTriggerKind.Idle: 26129 case DeferTriggerKind.Immediate: 26130 break; 26131 case DeferTriggerKind.Timer: 26132 args = [op.trigger.delay]; 26133 break; 26134 case DeferTriggerKind.Interaction: 26135 case DeferTriggerKind.Hover: 26136 case DeferTriggerKind.Viewport: 26137 // `hydrate` triggers don't support targets. 26138 if (op.modifier === "hydrate" /* ir.DeferOpModifierKind.HYDRATE */) { 26139 args = []; 26140 } else { 26141 var _op$trigger$targetSlo; 26142 if (((_op$trigger$targetSlo = op.trigger.targetSlot) === null || _op$trigger$targetSlo === void 0 ? void 0 : _op$trigger$targetSlo.slot) == null || op.trigger.targetSlotViewSteps === null) { 26143 throw new Error(`Slot or view steps not set in trigger reification for trigger kind ${op.trigger.kind}`); 26144 } 26145 args = [op.trigger.targetSlot.slot]; 26146 if (op.trigger.targetSlotViewSteps !== 0) { 26147 args.push(op.trigger.targetSlotViewSteps); 26148 } 26149 } 26150 break; 26151 default: 26152 throw new Error(`AssertionError: Unsupported reification of defer trigger kind ${op.trigger.kind}`); 26153 } 26154 OpList.replace(op, deferOn(op.trigger.kind, args, op.modifier, op.sourceSpan)); 26155 break; 26156 case OpKind.ProjectionDef: 26157 OpList.replace(op, projectionDef(op.def)); 26158 break; 26159 case OpKind.Projection: 26160 if (op.handle.slot === null) { 26161 throw new Error('No slot was assigned for project instruction'); 26162 } 26163 let fallbackViewFnName = null; 26164 let fallbackDecls = null; 26165 let fallbackVars = null; 26166 if (op.fallbackView !== null) { 26167 if (!(unit instanceof ViewCompilationUnit)) { 26168 throw new Error(`AssertionError: must be compiling a component`); 26169 } 26170 const fallbackView = unit.job.views.get(op.fallbackView); 26171 if (fallbackView === undefined) { 26172 throw new Error('AssertionError: projection had fallback view xref, but fallback view was not found'); 26173 } 26174 if (fallbackView.fnName === null || fallbackView.decls === null || fallbackView.vars === null) { 26175 throw new Error(`AssertionError: expected projection fallback view to have been named and counted`); 26176 } 26177 fallbackViewFnName = fallbackView.fnName; 26178 fallbackDecls = fallbackView.decls; 26179 fallbackVars = fallbackView.vars; 26180 } 26181 OpList.replace(op, projection(op.handle.slot, op.projectionSlotIndex, op.attributes, fallbackViewFnName, fallbackDecls, fallbackVars, op.sourceSpan)); 26182 break; 26183 case OpKind.RepeaterCreate: 26184 if (op.handle.slot === null) { 26185 throw new Error('No slot was assigned for repeater instruction'); 26186 } 26187 if (!(unit instanceof ViewCompilationUnit)) { 26188 throw new Error(`AssertionError: must be compiling a component`); 26189 } 26190 const repeaterView = unit.job.views.get(op.xref); 26191 if (repeaterView.fnName === null) { 26192 throw new Error(`AssertionError: expected repeater primary view to have been named`); 26193 } 26194 let emptyViewFnName = null;
26195 let emptyDecls = null; 26196 let emptyVars = null; 26197 if (op.emptyView !== null) { 26198 const emptyView = unit.job.views.get(op.emptyView); 26199 if (emptyView === undefined) { 26200 throw new Error('AssertionError: repeater had empty view xref, but empty view was not found'); 26201 } 26202 if (emptyView.fnName === null || emptyView.decls === null || emptyView.vars === null) { 26203 throw new Error(`AssertionError: expected repeater empty view to have been named and counted`); 26204 } 26205 emptyViewFnName = emptyView.fnName; 26206 emptyDecls = emptyView.decls; 26207 emptyVars = emptyView.vars; 26208 } 26209 OpList.replace(op, repeaterCreate(op.handle.slot, repeaterView.fnName, op.decls, op.vars, op.tag, op.attributes, reifyTrackBy(unit, op), op.usesComponentInstance, emptyViewFnName, emptyDecls, emptyVars, op.emptyTag, op.emptyAttributes, op.wholeSourceSpan)); 26210 break; 26211 case OpKind.SourceLocation: 26212 const locationsLiteral = literalArr(op.locations.map(({ 26213 targetSlot, 26214 offset, 26215 line, 26216 column 26217 }) => { 26218 if (targetSlot.slot === null) { 26219 throw new Error('No slot was assigned for source location'); 26220 } 26221 return literalArr([literal(targetSlot.slot), literal(offset), literal(line), literal(column)]); 26222 })); 26223 OpList.replace(op, attachSourceLocation(op.templatePath, locationsLiteral)); 26224 break; 26225 case OpKind.Statement: 26226 // Pass statement operations directly through. 26227 break; 26228 default: 26229 throw new Error(`AssertionError: Unsupported reification of create op ${OpKind[op.kind]}`); 26230 } 26231 } 26232} 26233function reifyUpdateOperations(_unit, ops) { 26234 for (const op of ops) { 26235 transformExpressionsInOp(op, reifyIrExpression, VisitorContextFlag.None); 26236 switch (op.kind) { 26237 case OpKind.Advance: 26238 OpList.replace(op, advance(op.delta, op.sourceSpan)); 26239 break; 26240 case OpKind.Property: 26241 if (op.expression instanceof Interpolation) { 26242 OpList.replace(op, propertyInterpolate(op.name, op.expression.strings, op.expression.expressions, op.sanitizer, op.sourceSpan)); 26243 } else { 26244 OpList.replace(op, property(op.name, op.expression, op.sanitizer, op.sourceSpan)); 26245 } 26246 break; 26247 case OpKind.TwoWayProperty: 26248 OpList.replace(op, twoWayProperty(op.name, op.expression, op.sanitizer, op.sourceSpan)); 26249 break; 26250 case OpKind.StyleProp: 26251 if (op.expression instanceof Interpolation) { 26252 OpList.replace(op, stylePropInterpolate(op.name, op.expression.strings, op.expression.expressions, op.unit, op.sourceSpan)); 26253 } else { 26254 OpList.replace(op, styleProp(op.name, op.expression, op.unit, op.sourceSpan)); 26255 } 26256 break; 26257 case OpKind.ClassProp: 26258 OpList.replace(op, classProp(op.name, op.expression, op.sourceSpan)); 26259 break; 26260 case OpKind.StyleMap: 26261 if (op.expression instanceof Interpolation) { 26262 OpList.replace(op, styleMapInterpolate(op.expression.strings, op.expression.expressions, op.sourceSpan)); 26263 } else { 26264 OpList.replace(op, styleMap(op.expression, op.sourceSpan)); 26265 } 26266 break; 26267 case OpKind.ClassMap: 26268 if (op.expression instanceof Interpolation) { 26269 OpList.replace(op, classMapInterpolate(op.expression.strings, op.expression.expressions, op.sourceSpan)); 26270 } else { 26271 OpList.replace(op, classMap(op.expression, op.sourceSpan)); 26272 } 26273 break; 26274 case OpKind.I18nExpression: 26275 OpList.replace(op, i18nExp(op.expression, op.sourceSpan)); 26276 break; 26277 case OpKind.I18nApply: 26278 OpList.replace(op, i18nApply(op.handle.slot, op.sourceSpan)); 26279 break; 26280 case OpKind.InterpolateText: 26281 OpList.replace(op, textInterpolate(op.interpolation.strings, op.interpolation.expressions, op.sourceSpan)); 26282 break; 26283 case OpKind.Attribute: 26284 if (op.expression instanceof Interpolation) { 26285 OpList.replace(op, attributeInterpolate(op.name, op.expression.strings, op.expression.expressions, op.sanitizer, op.sourceSpan)); 26286 } else { 26287 OpList.replace(op, attribute(op.name, op.expression, op.sanitizer, op.namespace)); 26288 } 26289 break; 26290 case OpKind.HostProperty: 26291 if (op.expression instanceof Interpolation) { 26292 throw new Error('not yet handled'); 26293 } else { 26294 if (op.isAnimationTrigger) { 26295 OpList.replace(op, syntheticHostProperty(op.name, op.expression, op.sourceSpan)); 26296 } else { 26297 OpList.replace(op, hostProperty(op.name, op.expression, op.sanitizer, op.sourceSpan)); 26298 } 26299 } 26300 break; 26301 case OpKind.Variable: 26302 if (op.variable.name === null) { 26303 throw new Error(`AssertionError: unnamed variable ${op.xref}`); 26304 } 26305 OpList.replace(op, createStatementOp(new DeclareVarStmt(op.variable.name, op.initializer, undefined, StmtModifier.Final))); 26306 break; 26307 case OpKind.Conditional: 26308 if (op.processed === null) { 26309 throw new Error(`Conditional test was not set.`); 26310 } 26311 OpList.replace(op, conditional(op.processed, op.contextValue, op.sourceSpan)); 26312 break; 26313 case OpKind.Repeater: 26314 OpList.replace(op, repeater(op.collection, op.sourceSpan)); 26315 break; 26316 case OpKind.DeferWhen: 26317 OpList.replace(op, deferWhen(op.modifier, op.expr, op.sourceSpan)); 26318 break; 26319 case OpKind.StoreLet: 26320 throw new Error(`AssertionError: unexpected storeLet ${op.declaredName}`); 26321 case OpKind.Statement: 26322 // Pass statement operations directly through. 26323 break; 26324 default: 26325 throw new Error(`AssertionError: Unsupported reification of update op ${OpKind[op.kind]}`); 26326 } 26327 } 26328} 26329function reifyIrExpression(expr) { 26330 if (!isIrExpression(expr)) { 26331 return expr; 26332 } 26333 switch (expr.kind) { 26334 case ExpressionKind.NextContext: 26335 return nextContext(expr.steps); 26336 case ExpressionKind.Reference: 26337 return reference(expr.targetSlot.slot + 1 + expr.offset); 26338 case ExpressionKind.LexicalRead: 26339 throw new Error(`AssertionError: unresolved LexicalRead of ${expr.name}`); 26340 case ExpressionKind.TwoWayBindingSet: 26341 throw new Error(`AssertionError: unresolved TwoWayBindingSet`); 26342 case ExpressionKind.RestoreView: 26343 if (typeof expr.view === 'number') { 26344 throw new Error(`AssertionError: unresolved RestoreView`); 26345 } 26346 return restoreView(expr.view); 26347 case ExpressionKind.ResetView: 26348 return resetView(expr.expr); 26349 case ExpressionKind.GetCurrentView: 26350 return getCurrentView(); 26351 case ExpressionKind.ReadVariable: 26352 if (expr.name === null) { 26353 throw new Error(`Read of unnamed variable ${expr.xref}`); 26354 } 26355 return variable(expr.name); 26356 case ExpressionKind.ReadTemporaryExpr: 26357 if (expr.name === null) { 26358 throw new Error(`Read of unnamed temporary ${expr.xref}`); 26359 } 26360 return variable(expr.name); 26361 case ExpressionKind.AssignTemporaryExpr: 26362 if (expr.name === null) { 26363 throw new Error(`Assign of unnamed temporary ${expr.xref}`); 26364 } 26365 return variable(expr.name).set(expr.expr); 26366 case ExpressionKind.PureFunctionExpr: 26367 if (expr.fn === null) { 26368 throw new Error(`AssertionError: expected PureFunctions to have been extracted`); 26369 } 26370 return pureFunction(expr.varOffset, expr.fn, expr.args); 26371 case ExpressionKind.PureFunctionParameterExpr: 26372 throw new Error(`AssertionError: expected PureFunctionParameterExpr to have been extracted`); 26373 case ExpressionKind.PipeBinding: 26374 return pipeBind(expr.targetSlot.slot, expr.varOffset, expr.args); 26375 case ExpressionKind.PipeBindingVariadic: 26376 return pipeBindV(expr.targetSlot.slot, expr.varOffset, expr.args); 26377 case ExpressionKind.SlotLiteralExpr: 26378 return literal(expr.slot.slot); 26379 case ExpressionKind.ContextLetReference: 26380 return readContextLet(expr.targetSlot.slot); 26381 case ExpressionKind.StoreLet: 26382 return storeLet(expr.value, expr.sourceSpan); 26383 case ExpressionKind.TrackContext: 26384 return variable('this'); 26385 default: 26386 throw new Error(`AssertionError: Unsupported reification of ir.Expression kind: ${ExpressionKind[expr.kind]}`); 26387 } 26388} 26389/** 26390 * Listeners get turned into a function expression, which may or may not have the `$event` 26391 * parameter defined. 26392 */ 26393function reifyListenerHandler(unit, name, handlerOps, consumesDollarEvent) { 26394 // First, reify all instruction calls within `handlerOps`. 26395 reifyUpdateOperations(unit, handlerOps); 26396 // Next, extract all the `o.Statement`s from the reified operations. We can expect that at this 26397 // point, all operations have been converted to statements. 26398 const handlerStmts = []; 26399 for (const op of handlerOps) { 26400 if (op.kind !== OpKind.Statement) { 26401 throw new Error(`AssertionError: expected reified statements, but found op ${OpKind[op.kind]}`); 26402 } 26403 handlerStmts.push(op.statement); 26404 } 26405 // If `$event` is referenced, we need to generate it as a parameter. 26406 const params = []; 26407 if (consumesDollarEvent) { 26408 // We need the `$event` parameter. 26409 params.push(new FnParam('$event')); 26410 } 26411 return fn(params, handlerStmts, undefined, undefined, name); 26412} 26413/** Reifies the tracking expression of a `RepeaterCreateOp`. */ 26414function reifyTrackBy(unit, op) { 26415 // If the tracking function was created already, there's nothing left to do. 26416 if (op.trackByFn !== null) { 26417 return op.trackByFn; 26418 } 26419 const params = [new FnParam('$index'), new FnParam('$item')]; 26420 let fn$1;
26421 if (op.trackByOps === null) { 26422 // If there are no additional ops related to the tracking function, we just need 26423 // to turn it into a function that returns the result of the expression. 26424 fn$1 = op.usesComponentInstance ? fn(params, [new ReturnStatement(op.track)]) : arrowFn(params, op.track); 26425 } else { 26426 // Otherwise first we need to reify the track-related ops. 26427 reifyUpdateOperations(unit, op.trackByOps); 26428 const statements = []; 26429 for (const trackOp of op.trackByOps) { 26430 if (trackOp.kind !== OpKind.Statement) { 26431 throw new Error(`AssertionError: expected reified statements, but found op ${OpKind[trackOp.kind]}`); 26432 } 26433 statements.push(trackOp.statement); 26434 } 26435 // Afterwards we can create the function from those ops. 26436 fn$1 = op.usesComponentInstance || statements.length !== 1 || !(statements[0] instanceof ReturnStatement) ? fn(params, statements) : arrowFn(params, statements[0].value); 26437 } 26438 op.trackByFn = unit.job.pool.getSharedFunctionReference(fn$1, '_forTrack'); 26439 return op.trackByFn; 26440} 26441 26442/** 26443 * Binding with no content can be safely deleted. 26444 */ 26445function removeEmptyBindings(job) { 26446 for (const unit of job.units) { 26447 for (const op of unit.update) { 26448 switch (op.kind) { 26449 case OpKind.Attribute: 26450 case OpKind.Binding: 26451 case OpKind.ClassProp: 26452 case OpKind.ClassMap: 26453 case OpKind.Property: 26454 case OpKind.StyleProp: 26455 case OpKind.StyleMap: 26456 if (op.expression instanceof EmptyExpr) { 26457 OpList.remove(op); 26458 } 26459 break; 26460 } 26461 } 26462 } 26463} 26464 26465/** 26466 * Remove the i18n context ops after they are no longer needed, and null out references to them to 26467 * be safe. 26468 */ 26469function removeI18nContexts(job) { 26470 for (const unit of job.units) { 26471 for (const op of unit.create) { 26472 switch (op.kind) { 26473 case OpKind.I18nContext: 26474 OpList.remove(op); 26475 break; 26476 case OpKind.I18nStart: 26477 op.context = null; 26478 break; 26479 } 26480 } 26481 } 26482} 26483 26484/** 26485 * i18nAttributes ops will be generated for each i18n attribute. However, not all i18n attribues 26486 * will contain dynamic content, and so some of these i18nAttributes ops may be unnecessary. 26487 */ 26488function removeUnusedI18nAttributesOps(job) { 26489 for (const unit of job.units) { 26490 const ownersWithI18nExpressions = new Set(); 26491 for (const op of unit.update) { 26492 switch (op.kind) { 26493 case OpKind.I18nExpression: 26494 ownersWithI18nExpressions.add(op.i18nOwner); 26495 } 26496 } 26497 for (const op of unit.create) { 26498 switch (op.kind) { 26499 case OpKind.I18nAttributes: 26500 if (ownersWithI18nExpressions.has(op.xref)) { 26501 continue; 26502 } 26503 OpList.remove(op); 26504 } 26505 } 26506 } 26507} 26508 26509/** 26510 * Resolves `ir.ContextExpr` expressions (which represent embedded view or component contexts) to 26511 * either the `ctx` parameter to component functions (for the current view context) or to variables 26512 * that store those contexts (for contexts accessed via the `nextContext()` instruction). 26513 */ 26514function resolveContexts(job) { 26515 for (const unit of job.units) { 26516 processLexicalScope$1(unit, unit.create); 26517 processLexicalScope$1(unit, unit.update); 26518 } 26519} 26520function processLexicalScope$1(view, ops) { 26521 // Track the expressions used to access all available contexts within the current view, by the 26522 // view `ir.XrefId`. 26523 const scope = new Map(); 26524 // The current view's context is accessible via the `ctx` parameter. 26525 scope.set(view.xref, variable('ctx')); 26526 for (const op of ops) { 26527 switch (op.kind) { 26528 case OpKind.Variable: 26529 switch (op.variable.kind) { 26530 case SemanticVariableKind.Context: 26531 scope.set(op.variable.view, new ReadVariableExpr(op.xref)); 26532 break; 26533 } 26534 break; 26535 case OpKind.Listener: 26536 case OpKind.TwoWayListener: 26537 processLexicalScope$1(view, op.handlerOps); 26538 break; 26539 case OpKind.RepeaterCreate: 26540 if (op.trackByOps !== null) { 26541 processLexicalScope$1(view, op.trackByOps); 26542 } 26543 break; 26544 } 26545 } 26546 if (view === view.job.root) { 26547 // Prefer `ctx` of the root view to any variables which happen to contain the root context. 26548 scope.set(view.xref, variable('ctx')); 26549 } 26550 for (const op of ops) { 26551 transformExpressionsInOp(op, expr => { 26552 if (expr instanceof ContextExpr) { 26553 if (!scope.has(expr.view)) { 26554 throw new Error(`No context found for reference to view ${expr.view} from view ${view.xref}`); 26555 } 26556 return scope.get(expr.view); 26557 } else { 26558 return expr; 26559 } 26560 }, VisitorContextFlag.None); 26561 } 26562} 26563 26564/** 26565 * Any variable inside a listener with the name `$event` will be transformed into a output lexical 26566 * read immediately, and does not participate in any of the normal logic for handling variables. 26567 */ 26568function resolveDollarEvent(job) { 26569 for (const unit of job.units) { 26570 transformDollarEvent(unit.create); 26571 transformDollarEvent(unit.update); 26572 } 26573} 26574function transformDollarEvent(ops) { 26575 for (const op of ops) { 26576 if (op.kind === OpKind.Listener || op.kind === OpKind.TwoWayListener) { 26577 transformExpressionsInOp(op, expr => { 26578 if (expr instanceof LexicalReadExpr && expr.name === '$event') { 26579 // Two-way listeners always consume `$event` so they omit this field. 26580 if (op.kind === OpKind.Listener) { 26581 op.consumesDollarEvent = true; 26582 } 26583 return new ReadVarExpr(expr.name); 26584 } 26585 return expr; 26586 }, VisitorContextFlag.InChildOperation); 26587 } 26588 } 26589} 26590 26591/** 26592 * Resolve the element placeholders in i18n messages. 26593 */ 26594function resolveI18nElementPlaceholders(job) { 26595 // Record all of the element and i18n context ops for use later. 26596 const i18nContexts = new Map(); 26597 const elements = new Map(); 26598 for (const unit of job.units) { 26599 for (const op of unit.create) { 26600 switch (op.kind) { 26601 case OpKind.I18nContext: 26602 i18nContexts.set(op.xref, op); 26603 break; 26604 case OpKind.ElementStart: 26605 elements.set(op.xref, op); 26606 break; 26607 } 26608 } 26609 } 26610 resolvePlaceholdersForView(job, job.root, i18nContexts, elements); 26611} 26612/** 26613 * Recursively resolves element and template tag placeholders in the given view. 26614 */ 26615function resolvePlaceholdersForView(job, unit, i18nContexts, elements, pendingStructuralDirective) { 26616 // Track the current i18n op and corresponding i18n context op as we step through the creation 26617 // IR. 26618 let currentOps = null; 26619 let pendingStructuralDirectiveCloses = new Map(); 26620 for (const op of unit.create) { 26621 switch (op.kind) { 26622 case OpKind.I18nStart: 26623 if (!op.context) { 26624 throw Error('Could not find i18n context for i18n op'); 26625 } 26626 currentOps = { 26627 i18nBlock: op, 26628 i18nContext: i18nContexts.get(op.context) 26629 }; 26630 break; 26631 case OpKind.I18nEnd: 26632 currentOps = null; 26633 break; 26634 case OpKind.ElementStart:
26635 // For elements with i18n placeholders, record its slot value in the params map under the 26636 // corresponding tag start placeholder. 26637 if (op.i18nPlaceholder !== undefined) { 26638 if (currentOps === null) { 26639 throw Error('i18n tag placeholder should only occur inside an i18n block'); 26640 } 26641 recordElementStart(op, currentOps.i18nContext, currentOps.i18nBlock, pendingStructuralDirective); 26642 // If there is a separate close tag placeholder for this element, save the pending 26643 // structural directive so we can pass it to the closing tag as well. 26644 if (pendingStructuralDirective && op.i18nPlaceholder.closeName) { 26645 pendingStructuralDirectiveCloses.set(op.xref, pendingStructuralDirective); 26646 } 26647 // Clear out the pending structural directive now that its been accounted for. 26648 pendingStructuralDirective = undefined; 26649 } 26650 break; 26651 case OpKind.ElementEnd: 26652 // For elements with i18n placeholders, record its slot value in the params map under the 26653 // corresponding tag close placeholder. 26654 const startOp = elements.get(op.xref); 26655 if (startOp && startOp.i18nPlaceholder !== undefined) { 26656 if (currentOps === null) { 26657 throw Error('AssertionError: i18n tag placeholder should only occur inside an i18n block'); 26658 } 26659 recordElementClose(startOp, currentOps.i18nContext, currentOps.i18nBlock, pendingStructuralDirectiveCloses.get(op.xref)); 26660 // Clear out the pending structural directive close that was accounted for. 26661 pendingStructuralDirectiveCloses.delete(op.xref); 26662 } 26663 break; 26664 case OpKind.Projection: 26665 // For content projections with i18n placeholders, record its slot value in the params map 26666 // under the corresponding tag start and close placeholders. 26667 if (op.i18nPlaceholder !== undefined) { 26668 if (currentOps === null) { 26669 throw Error('i18n tag placeholder should only occur inside an i18n block'); 26670 } 26671 recordElementStart(op, currentOps.i18nContext, currentOps.i18nBlock, pendingStructuralDirective); 26672 recordElementClose(op, currentOps.i18nContext, currentOps.i18nBlock, pendingStructuralDirective); 26673 // Clear out the pending structural directive now that its been accounted for. 26674 pendingStructuralDirective = undefined; 26675 } 26676 break; 26677 case OpKind.Template: 26678 const view = job.views.get(op.xref); 26679 if (op.i18nPlaceholder === undefined) { 26680 // If there is no i18n placeholder, just recurse into the view in case it contains i18n 26681 // blocks. 26682 resolvePlaceholdersForView(job, view, i18nContexts, elements); 26683 } else { 26684 if (currentOps === null) { 26685 throw Error('i18n tag placeholder should only occur inside an i18n block'); 26686 } 26687 if (op.templateKind === TemplateKind.Structural) { 26688 // If this is a structural directive template, don't record anything yet. Instead pass 26689 // the current template as a pending structural directive to be recorded when we find 26690 // the element, content, or template it belongs to. This allows us to create combined 26691 // values that represent, e.g. the start of a template and element at the same time. 26692 resolvePlaceholdersForView(job, view, i18nContexts, elements, op); 26693 } else { 26694 // If this is some other kind of template, we can record its start, recurse into its 26695 // view, and then record its end. 26696 recordTemplateStart(job, view, op.handle.slot, op.i18nPlaceholder, currentOps.i18nContext, currentOps.i18nBlock, pendingStructuralDirective); 26697 resolvePlaceholdersForView(job, view, i18nContexts, elements); 26698 recordTemplateClose(job, view, op.handle.slot, op.i18nPlaceholder, currentOps.i18nContext, currentOps.i18nBlock, pendingStructuralDirective); 26699 pendingStructuralDirective = undefined; 26700 } 26701 } 26702 break; 26703 case OpKind.RepeaterCreate: 26704 if (pendingStructuralDirective !== undefined) { 26705 throw Error('AssertionError: Unexpected structural directive associated with @for block'); 26706 } 26707 // RepeaterCreate has 3 slots: the first is for the op itself, the second is for the @for 26708 // template and the (optional) third is for the @empty template. 26709 const forSlot = op.handle.slot + 1; 26710 const forView = job.views.get(op.xref); 26711 // First record all of the placeholders for the @for template. 26712 if (op.i18nPlaceholder === undefined) { 26713 // If there is no i18n placeholder, just recurse into the view in case it contains i18n 26714 // blocks. 26715 resolvePlaceholdersForView(job, forView, i18nContexts, elements); 26716 } else { 26717 if (currentOps === null) { 26718 throw Error('i18n tag placeholder should only occur inside an i18n block'); 26719 } 26720 recordTemplateStart(job, forView, forSlot, op.i18nPlaceholder, currentOps.i18nContext, currentOps.i18nBlock, pe
26720ndingStructuralDirective); 26721 resolvePlaceholdersForView(job, forView, i18nContexts, elements); 26722 recordTemplateClose(job, forView, forSlot, op.i18nPlaceholder, currentOps.i18nContext, currentOps.i18nBlock, pendingStructuralDirective); 26723 pendingStructuralDirective = undefined; 26724 } 26725 // Then if there's an @empty template, add its placeholders as well. 26726 if (op.emptyView !== null) { 26727 // RepeaterCreate has 3 slots: the first is for the op itself, the second is for the @for 26728 // template and the (optional) third is for the @empty template. 26729 const emptySlot = op.handle.slot + 2; 26730 const emptyView = job.views.get(op.emptyView); 26731 if (op.emptyI18nPlaceholder === undefined) { 26732 // If there is no i18n placeholder, just recurse into the view in case it contains i18n 26733 // blocks. 26734 resolvePlaceholdersForView(job, emptyView, i18nContexts, elements); 26735 } else { 26736 if (currentOps === null) { 26737 throw Error('i18n tag placeholder should only occur inside an i18n block'); 26738 } 26739 recordTemplateStart(job, emptyView, emptySlot, op.emptyI18nPlaceholder, currentOps.i18nContext, currentOps.i18nBlock, pendingStructuralDirective); 26740 resolvePlaceholdersForView(job, emptyView, i18nContexts, elements); 26741 recordTemplateClose(job, emptyView, emptySlot, op.emptyI18nPlaceholder, currentOps.i18nContext, currentOps.i18nBlock, pendingStructuralDirective); 26742 pendingStructuralDirective = undefined; 26743 } 26744 } 26745 break; 26746 } 26747 } 26748} 26749/** 26750 * Records an i18n param value for the start of an element. 26751 */ 26752function recordElementStart(op, i18nContext, i18nBlock, structuralDirective) { 26753 const { 26754 startName, 26755 closeName 26756 } = op.i18nPlaceholder;
26757 let flags = I18nParamValueFlags.ElementTag | I18nParamValueFlags.OpenTag; 26758 let value = op.handle.slot; 26759 // If the element is associated with a structural directive, start it as well. 26760 if (structuralDirective !== undefined) { 26761 flags |= I18nParamValueFlags.TemplateTag; 26762 value = { 26763 element: value, 26764 template: structuralDirective.handle.slot 26765 }; 26766 } 26767 // For self-closing tags, there is no close tag placeholder. Instead, the start tag 26768 // placeholder accounts for the start and close of the element. 26769 if (!closeName) { 26770 flags |= I18nParamValueFlags.CloseTag; 26771 } 26772 addParam(i18nContext.params, startName, value, i18nBlock.subTemplateIndex, flags); 26773} 26774/** 26775 * Records an i18n param value for the closing of an element. 26776 */ 26777function recordElementClose(op, i18nContext, i18nBlock, structuralDirective) { 26778 const { 26779 closeName 26780 } = op.i18nPlaceholder; 26781 // Self-closing tags don't have a closing tag placeholder, instead the element closing is 26782 // recorded via an additional flag on the element start value. 26783 if (closeName) {
26784 let flags = I18nParamValueFlags.ElementTag | I18nParamValueFlags.CloseTag; 26785 let value = op.handle.slot; 26786 // If the element is associated with a structural directive, close it as well. 26787 if (structuralDirective !== undefined) { 26788 flags |= I18nParamValueFlags.TemplateTag; 26789 value = { 26790 element: value, 26791 template: structuralDirective.handle.slot 26792 }; 26793 } 26794 addParam(i18nContext.params, closeName, value, i18nBlock.subTemplateIndex, flags); 26795 } 26796} 26797/** 26798 * Records an i18n param value for the start of a template. 26799 */ 26800function recordTemplateStart(job, view, slot, i18nPlaceholder, i18nContext, i18nBlock, structuralDirective) { 26801 let { 26802 startName, 26803 closeName 26804 } = i18nPlaceholder; 26805 let flags = I18nParamValueFlags.TemplateTag | I18nParamValueFlags.OpenTag; 26806 // For self-closing tags, there is no close tag placeholder. Instead, the start tag 26807 // placeholder accounts for the start and close of the element. 26808 if (!closeName) { 26809 flags |= I18nParamValueFlags.CloseTag; 26810 } 26811 // If the template is associated with a structural directive, record the structural directive's 26812 // start first. Since this template must be in the structural directive's view, we can just 26813 // directly use the current i18n block's sub-template index. 26814 if (structuralDirective !== undefined) { 26815 addParam(i18nContext.params, startName, structuralDirective.handle.slot, i18nBlock.subTemplateIndex, flags); 26816 } 26817 // Record the start of the template. For the sub-template index, pass the index for the template's 26818 // view, rather than the current i18n block's index. 26819 addParam(i18nContext.params, startName, slot, getSubTemplateIndexForTemplateTag(job, i18nBlock, view), flags); 26820} 26821/** 26822 * Records an i18n param value for the closing of a template. 26823 */ 26824function recordTemplateClose(job, view, slot, i18nPlaceholder, i18nContext, i18nBlock, structuralDirective) { 26825 const { 26826 closeName 26827 } = i18nPlaceholder; 26828 const flags = I18nParamValueFlags.TemplateTag | I18nParamValueFlags.CloseTag; 26829 // Self-closing tags don't have a closing tag placeholder, instead the template's closing is 26830 // recorded via an additional flag on the template start value. 26831 if (closeName) { 26832 // Record the closing of the template. For the sub-template index, pass the index for the 26833 // template's view, rather than the current i18n block's index. 26834 addParam(i18nContext.params, closeName, slot, getSubTemplateIndexForTemplateTag(job, i18nBlock, view), flags); 26835 // If the template is associated with a structural directive, record the structural directive's 26836 // closing after. Since this template must be in the structural directive's view, we can just 26837 // directly use the current i18n block's sub-template index. 26838 if (structuralDirective !== undefined) { 26839 addParam(i18nContext.params, closeName, structuralDirective.handle.slot, i18nBlock.subTemplateIndex, flags); 26840 } 26841 } 26842} 26843/** 26844 * Get the subTemplateIndex for the given template op. For template ops, use the subTemplateIndex of
26845 * the child i18n block inside the template. 26846 */ 26847function getSubTemplateIndexForTemplateTag(job, i18nOp, view) { 26848 for (const childOp of view.create) { 26849 if (childOp.kind === OpKind.I18nStart) { 26850 return childOp.subTemplateIndex; 26851 } 26852 } 26853 return i18nOp.subTemplateIndex; 26854} 26855/** 26856 * Add a param value to the given params map. 26857 */ 26858function addParam(params, placeholder, value, subTemplateIndex, flags) { 26859 var _params$get; 26860 const values = (_params$get = params.get(placeholder)) !== null && _params$get !== void 0 ? _params$get : []; 26861 values.push({ 26862 value, 26863 subTemplateIndex, 26864 flags 26865 }); 26866 params.set(placeholder, values); 26867} 26868 26869/** 26870 * Resolve the i18n expression placeholders in i18n messages. 26871 */ 26872function resolveI18nExpressionPlaceholders(job) { 26873 // Record all of the i18n context ops, and the sub-template index for each i18n op. 26874 const subTemplateIndices = new Map(); 26875 const i18nContexts = new Map(); 26876 const icuPlaceholders = new Map(); 26877 for (const unit of job.units) { 26878 for (const op of unit.create) { 26879 switch (op.kind) { 26880 case OpKind.I18nStart: 26881 subTemplateIndices.set(op.xref, op.subTemplateIndex); 26882 break; 26883 case OpKind.I18nContext: 26884 i18nContexts.set(op.xref, op); 26885 break; 26886 case OpKind.IcuPlaceholder: 26887 icuPlaceholders.set(op.xref, op); 26888 break; 26889 } 26890 } 26891 } 26892 // Keep track of the next available expression index for each i18n message. 26893 const expressionIndices = new Map(); 26894 // Keep track of a reference index for each expression. 26895 // We use different references for normal i18n expressio and attribute i18n expressions. This is 26896 // because child i18n blocks in templates don't get their own context, since they're rolled into 26897 // the translated message of the parent, but they may target a different slot. 26898 const referenceIndex = op => op.usage === I18nExpressionFor.I18nText ? op.i18nOwner : op.context; 26899 for (const unit of job.units) { 26900 for (const op of unit.update) { 26901 if (op.kind === OpKind.I18nExpression) { 26902 var _subTemplateIndices$g; 26903 const index = expressionIndices.get(referenceIndex(op)) || 0; 26904 const subTemplateIndex = (_subTemplateIndices$g = subTemplateIndices.get(op.i18nOwner)) !== null && _subTemplateIndices$g !== void 0 ? _subTemplateIndices$g : null; 26905 const value = { 26906 value: index, 26907 subTemplateIndex: subTemplateIndex, 26908 flags: I18nParamValueFlags.ExpressionIndex 26909 }; 26910 updatePlaceholder(op, value, i18nContexts, icuPlaceholders); 26911 expressionIndices.set(referenceIndex(op), index + 1); 26912 } 26913 } 26914 } 26915} 26916function updatePlaceholder(op, value, i18nContexts, icuPlaceholders) { 26917 if (op.i18nPlaceholder !== null) { 26918 const i18nContext = i18nContexts.get(op.context); 26919 const params = op.resolutionTime === I18nParamResolutionTime.Creation ? i18nContext.params : i18nContext.postprocessingParams; 26920 const values = params.get(op.i18nPlaceholder) || []; 26921 values.push(value); 26922 params.set(op.i18nPlaceholder, values); 26923 } 26924 if (op.icuPlaceholder !== null) { 26925 const icuPlaceholderOp = icuPlaceholders.get(op.icuPlaceholder); 26926 icuPlaceholderOp === null || icuPlaceholderOp === void 0 || icuPlaceholderOp.expressionPlaceholders.push(value); 26927 } 26928} 26929 26930/** 26931 * Resolves lexical references in views (`ir.LexicalReadExpr`) to either a target variable or to 26932 * property reads on the top-level component context. 26933 * 26934 * Also matches `ir.RestoreViewExpr` expressions with the variables of their corresponding saved 26935 * views. 26936 */ 26937function resolveNames(job) { 26938 for (const unit of job.units) { 26939 processLexicalScope(unit, unit.create, null); 26940 processLexicalScope(unit, unit.update, null); 26941 } 26942} 26943function processLexicalScope(unit, ops, savedView) { 26944 // Maps names defined in the lexical scope of this template to the `ir.XrefId`s of the variable 26945 // declarations which represent those values. 26946 // 26947 // Since variables are generated in each view for the entire lexical scope (including any 26948 // identifiers from parent templates) only local variables need be considered here. 26949 const scope = new Map(); 26950 // Symbols defined within the current scope. They take precedence over ones defined outside. 26951 const localDefinitions = new Map(); 26952 // First, step through the operations list and: 26953 // 1) build up the `scope` mapping 26954 // 2) recurse into any listener functions 26955 for (const op of ops) { 26956 switch (op.kind) { 26957 case OpKind.Variable: 26958 switch (op.variable.kind) { 26959 case SemanticVariableKind.Identifier: 26960 if (op.variable.local) {
26961 if (localDefinitions.has(op.variable.identifier)) { 26962 continue; 26963 } 26964 localDefinitions.set(op.variable.identifier, op.xref); 26965 } else if (scope.has(op.variable.identifier)) { 26966 continue; 26967 } 26968 scope.set(op.variable.identifier, op.xref); 26969 break; 26970 case SemanticVariableKind.Alias: 26971 // This variable represents some kind of identifier which can be used in the template. 26972 if (scope.has(op.variable.identifier)) { 26973 continue; 26974 } 26975 scope.set(op.variable.identifier, op.xref); 26976 break; 26977 case SemanticVariableKind.SavedView: 26978 // This variable represents a snapshot of the current view context, and can be used to 26979 // restore that context within listener functions. 26980 savedView = { 26981 view: op.variable.view, 26982 variable: op.xref 26983 }; 26984 break; 26985 } 26986 break; 26987 case OpKind.Listener: 26988 case OpKind.TwoWayListener: 26989 // Listener functions have separate variable declarations, so process them as a separate 26990 // lexical scope. 26991 processLexicalScope(unit, op.handlerOps, savedView); 26992 break; 26993 case OpKind.RepeaterCreate: 26994 if (op.trackByOps !== null) { 26995 processLexicalScope(unit, op.trackByOps, savedView); 26996 } 26997 break; 26998 } 26999 } 27000 // Next, use the `scope` mapping to match `ir.LexicalReadExpr` with defined names in the lexical 27001 // scope. Also, look for `ir.RestoreViewExpr`s and match them with the snapshotted view context 27002 // variable. 27003 for (const op of ops) { 27004 if (op.kind == OpKind.Listener || op.kind === OpKind.TwoWayListener) { 27005 // Listeners were already processed above with their own scopes. 27006 continue; 27007 } 27008 transformExpressionsInOp(op, expr => { 27009 if (expr instanceof LexicalReadExpr) { 27010 // `expr` is a read of a name within the lexical scope of this view. 27011 // Either that name is defined within the current view, or it represents a property from the 27012 // main component context. 27013 if (localDefinitions.has(expr.name)) { 27014 return new ReadVariableExpr(localDefinitions.get(expr.name)); 27015 } else if (scope.has(expr.name)) { 27016 // This was a defined variable in the current scope. 27017 return new ReadVariableExpr(scope.get(expr.name)); 27018 } else { 27019 // Reading from the component context. 27020 return new ReadPropExpr(new ContextExpr(unit.job.root.xref), expr.name); 27021 } 27022 } else if (expr instanceof RestoreViewExpr && typeof expr.view === 'number') { 27023 // `ir.RestoreViewExpr` happens in listener functions and restores a saved view from the 27024 // parent creation list. We expect to find that we captured the `savedView` previously, and 27025 // that it matches the expected view to be restored. 27026 if (savedView === null || savedView.view !== expr.view) { 27027 throw new Error(`AssertionError: no saved view ${expr.view} from view ${unit.xref}`); 27028 } 27029 expr.view = new ReadVariableExpr(savedView.variable); 27030 return expr; 27031 } else { 27032 return expr; 27033 } 27034 }, VisitorContextFlag.None); 27035 } 27036 for (const op of ops) { 27037 visitExpressionsInOp(op, expr => { 27038 if (expr instanceof LexicalReadExpr) { 27039 throw new Error(`AssertionError: no lexical reads should remain, but found read of ${expr.name}`); 27040 } 27041 }); 27042 } 27043} 27044 27045/** 27046 * Map of security contexts to their sanitizer function. 27047 */ 27048const sanitizerFns = new Map([[SecurityContext.HTML, Identifiers.sanitizeHtml], [SecurityContext.RESOURCE_URL, Identifiers.sanitizeResourceUrl], [SecurityContext.SCRIPT, Identifiers.sanitizeScript], [SecurityContext.STYLE, Identifiers.sanitizeStyle], [SecurityContext.URL, Identifiers.sanitizeUrl]]); 27049/** 27050 * Map of security contexts to their trusted value function. 27051 */ 27052const trustedValueFns = new Map([[SecurityContext.HTML, Identifiers.trustConstantHtml], [SecurityContext.RESOURCE_URL, Identifiers.trustConstantResourceUrl]]); 27053/** 27054 * Resolves sanitization functions for ops that need them. 27055 */ 27056function resolveSanitizers(job) { 27057 for (const unit of job.units) { 27058 const elements = createOpXrefMap(unit); 27059 // For normal element bindings we create trusted values for security sensitive constant
27060 // attributes. However, for host bindings we skip this step (this matches what 27061 // TemplateDefinitionBuilder does). 27062 // TODO: Is the TDB behavior correct here? 27063 if (job.kind !== CompilationJobKind.Host) { 27064 for (const op of unit.create) { 27065 if (op.kind === OpKind.ExtractedAttribute) { 27066 var _trustedValueFns$get; 27067 const trustedValueFn = (_trustedValueFns$get = trustedValueFns.get(getOnlySecurityContext(op.securityContext))) !== null && _trustedValueFns$get !== void 0 ? _trustedValueFns$get : null; 27068 op.trustedValueFn = trustedValueFn !== null ? importExpr(trustedValueFn) : null; 27069 } 27070 } 27071 } 27072 for (const op of unit.update) { 27073 switch (op.kind) { 27074 case OpKind.Property: 27075 case OpKind.Attribute: 27076 case OpKind.HostProperty: 27077 let sanitizerFn = null; 27078 if (Array.isArray(op.securityContext) && op.securityContext.length === 2 && op.securityContext.indexOf(SecurityContext.URL) > -1 && op.securityContext.indexOf(SecurityContext.RESOURCE_URL) > -1) { 27079 // When the host element isn't known, some URL attributes (such as "src" and "href") may 27080 // be part of multiple different security contexts. In this case we use special 27081 // sanitization function and select the actual sanitizer at runtime based on a tag name 27082 // that is provided while invoking sanitization function. 27083 sanitizerFn = Identifiers.sanitizeUrlOrResourceUrl; 27084 } else { 27085 var _sanitizerFns$get; 27086 sanitizerFn = (_sanitizerFns$get = sanitizerFns.get(getOnlySecurityContext(op.securityContext))) !== null && _sanitizerFns$get !== void 0 ? _sanitizerFns$get : null; 27087 } 27088 op.sanitizer = sanitizerFn !== null ? importExpr(sanitizerFn) : null; 27089 // If there was no sanitization function found based on the security context of an 27090 // attribute/property, check whether this attribute/property is one of the 27091 // security-sensitive <iframe> attributes (and that the current element is actually an 27092 // <iframe>). 27093 if (op.sanitizer === null) { 27094 let isIframe = false; 27095 if (job.kind === CompilationJobKind.Host || op.kind === OpKind.HostProperty) { 27096 // Note: for host bindings defined on a directive, we do not try to find all 27097 // possible places where it can be matched, so we can not determine whether 27098 // the host element is an <iframe>. In this case, we just assume it is and append a 27099 // validation function, which is invoked at runtime and would have access to the 27100 // underlying DOM element to check if it's an <iframe> and if so - run extra checks. 27101 isIframe = true; 27102 } else { 27103 // For a normal binding we can just check if the element its on is an iframe. 27104 const ownerOp = elements.get(op.target); 27105 if (ownerOp === undefined || !isElementOrContainerOp(ownerOp)) { 27106 throw Error('Property should have an element-like owner'); 27107 } 27108 isIframe = isIframeElement(ownerOp); 27109 } 27110 if (isIframe && isIframeSecuritySensitiveAttr(op.name)) { 27111 op.sanitizer = importExpr(Identifiers.validateIframeAttribute); 27112 } 27113 } 27114 break; 27115 } 27116 } 27117 } 27118} 27119/** 27120 * Checks whether the given op represents an iframe element. 27121 */ 27122function isIframeElement(op) { 27123 var _op$tag; 27124 return op.kind === OpKind.ElementStart && ((_op$tag = op.tag) === null || _op$tag === void 0 ? void 0 : _op$tag.toLowerCase()) === 'iframe'; 27125} 27126/** 27127 * Asserts that there is only a single security context and returns it. 27128 */ 27129function getOnlySecurityContext(securityContext) { 27130 if (Array.isArray(securityContext)) { 27131 if (securityContext.length > 1) { 27132 // TODO: What should we do here? TDB just took the first one, but this feels like something we 27133 // would want to know about and create a special case for like we did for Url/ResourceUrl. My 27134 // guess is that, outside of the Url/ResourceUrl case, this never actually happens. If there 27135 // do turn out to be other cases, throwing an error until we can address it feels safer. 27136 throw Error(`AssertionError: Ambiguous security context`); 27137 } 27138 return securityContext[0] || SecurityContext.NONE; 27139 } 27140 return securityContext; 27141} 27142 27143/** 27144 * Transforms a `TwoWayBindingSet` expression into an expression that either
27145 * sets a value through the `twoWayBindingSet` instruction or falls back to setting 27146 * the value directly. E.g. the expression `TwoWayBindingSet(target, value)` becomes: 27147 * `ng.twoWayBindingSet(target, value) || (target = value)`. 27148 */ 27149function transformTwoWayBindingSet(job) { 27150 for (const unit of job.units) { 27151 for (const op of unit.create) { 27152 if (op.kind === OpKind.TwoWayListener) { 27153 transformExpressionsInOp(op, expr => { 27154 if (!(expr instanceof TwoWayBindingSetExpr)) { 27155 return expr; 27156 } 27157 const { 27158 target, 27159 value 27160 } = expr; 27161 if (target instanceof ReadPropExpr || target instanceof ReadKeyExpr) { 27162 return twoWayBindingSet(target, value).or(target.set(value)); 27163 } 27164 // ASSUMPTION: here we're assuming that `ReadVariableExpr` will be a reference 27165 // to a local template variable. This appears to be the case at the time of writing. 27166 // If the expression is targeting a variable read, we only emit the `twoWayBindingSet` 27167 // since the fallback would be attempting to write into a constant. Invalid usages will be 27168 // flagged during template type checking. 27169 if (target instanceof ReadVariableExpr) { 27170 return twoWayBindingSet(target, value); 27171 } 27172 throw new Error(`Unsupported expression in two-way action binding.`); 27173 }, VisitorContextFlag.InChildOperation); 27174 } 27175 } 27176 } 27177} 27178 27179/** 27180 * When inside of a listener, we may need access to one or more enclosing views. Therefore, each 27181 * view should save the current view, and each listener must have the ability to restore the 27182 * appropriate view. We eagerly generate all save view variables; they will be optimized away later. 27183 */ 27184function saveAndRestoreView(job) { 27185 for (const unit of job.units) { 27186 unit.create.prepend([createVariableOp(unit.job.allocateXrefId(), { 27187 kind: SemanticVariableKind.SavedView, 27188 name: null, 27189 view: unit.xref 27190 }, new GetCurrentViewExpr(), VariableFlags.None)]); 27191 for (const op of unit.create) { 27192 if (op.kind !== OpKind.Listener && op.kind !== OpKind.TwoWayListener) { 27193 continue; 27194 } 27195 // Embedded views always need the save/restore view operation. 27196 let needsRestoreView = unit !== job.root; 27197 if (!needsRestoreView) { 27198 for (const handlerOp of op.handlerOps) { 27199 visitExpressionsInOp(handlerOp, expr => { 27200 if (expr instanceof ReferenceExpr || expr instanceof ContextLetReferenceExpr) { 27201 // Listeners that reference() a local ref need the save/restore view operation. 27202 needsRestoreView = true; 27203 } 27204 }); 27205 } 27206 } 27207 if (needsRestoreView) { 27208 addSaveRestoreViewOperationToListener(unit, op); 27209 } 27210 } 27211 } 27212} 27213function addSaveRestoreViewOperationToListener(unit, op) { 27214 op.handlerOps.prepend([createVariableOp(unit.job.allocateXrefId(), { 27215 kind: SemanticVariableKind.Context, 27216 name: null, 27217 view: unit.xref 27218 }, new RestoreViewExpr(unit.xref), VariableFlags.None)]); 27219 // The "restore view" operation in listeners requires a call to `resetView` to reset the 27220 // context prior to returning from the listener operation. Find any `return` statements in 27221 // the listener body and wrap them in a call to reset the view. 27222 for (const handlerOp of op.handlerOps) { 27223 if (handlerOp.kind === OpKind.Statement && handlerOp.statement instanceof ReturnStatement) { 27224 handlerOp.statement.value = new ResetViewExpr(handlerOp.statement.value); 27225 } 27226 } 27227} 27228 27229/** 27230 * Assign data slots for all operations which implement `ConsumesSlotOpTrait`, and propagate the 27231 * assigned data slots of those operations to any expressions which reference them via 27232 * `UsesSlotIndexTrait`. 27233 * 27234 * This phase is also responsible for counting the number of slots used for each view (its `decls`) 27235 * and propagating that number into the `Template` operations which declare embedded views. 27236 */ 27237function allocateSlots(job) { 27238 // Map of all declarations in all views within the component which require an assigned slot index. 27239 // This map needs to be global (across all views within the component) since it's possible to 27240 // reference a slot from one view from an expression within another (e.g. local references work 27241 // this way). 27242 const slotMap = new Map(); 27243 // Process all views in the component and assign slot indexes. 27244 for (const unit of job.units) { 27245 // Slot indices start at 0 for each view (and are not unique between views). 27246 let slotCount = 0; 27247 for (const op of unit.create) { 27248 // Only consider declarations which consume data slots. 27249 if (!hasConsumesSlotTrait(op)) { 27250 continue; 27251 } 27252 // Assign slots to this declaration starting at the current `slot
27252Count`. 27253 op.handle.slot = slotCount; 27254 // And track its assigned slot in the `slotMap`. 27255 slotMap.set(op.xref, op.handle.slot); 27256 // Each declaration may use more than 1 slot, so increment `slotCount` to reserve the number 27257 // of slots required. 27258 slotCount += op.numSlotsUsed; 27259 } 27260 // Record the total number of slots used on the view itself. This will later be propagated into 27261 // `ir.TemplateOp`s which declare those views (except for the root view). 27262 unit.decls = slotCount; 27263 } 27264 // After slot assignment, `slotMap` now contains slot assignments for every declaration in the 27265 // whole template, across all views. Next, look for expressions which implement 27266 // `UsesSlotIndexExprTrait` and propagate the assigned slot indexes into them. 27267 // Additionally, this second scan allows us to find `ir.TemplateOp`s which declare views and 27268 // propagate the number of slots used for each view into the operation which declares it. 27269 for (const unit of job.units) { 27270 for (const op of unit.ops()) { 27271 if (op.kind === OpKind.Template || op.kind === OpKind.RepeaterCreate) { 27272 // Record the number of slots used by the view this `ir.TemplateOp` declares in the 27273 // operation itself, so it can be emitted later. 27274 const childView = job.views.get(op.xref); 27275 op.decls = childView.decls; 27276 // TODO: currently we handle the decls for the RepeaterCreate empty template in the reify 27277 // phase. We should handle that here instead. 27278 } 27279 } 27280 } 27281} 27282 27283/** 27284 * Transforms special-case bindings with 'style' or 'class' in their names. Must run before the 27285 * main binding specialization pass. 27286 */ 27287function specializeStyleBindings(job) { 27288 for (const unit of job.units) { 27289 for (const op of unit.update) { 27290 if (op.kind !== OpKind.Binding) { 27291 continue; 27292 } 27293 switch (op.bindingKind) { 27294 case BindingKind.ClassName: 27295 if (op.expression instanceof Interpolation) { 27296 throw new Error(`Unexpected interpolation in ClassName binding`); 27297 } 27298 OpList.replace(op, createClassPropOp(op.target, op.name, op.expression, op.sourceSpan)); 27299 break; 27300 case BindingKind.StyleProperty: 27301 OpList.replace(op, createStylePropOp(op.target, op.name, op.expression, op.unit, op.sourceSpan)); 27302 break; 27303 case BindingKind.Property: 27304 case BindingKind.Template: 27305 if (op.name === 'style') { 27306 OpList.replace(op, createStyleMapOp(op.target, op.expression, op.sourceSpan)); 27307 } else if (op.name === 'class') { 27308 OpList.replace(op, createClassMapOp(op.target, op.expression, op.sourceSpan)); 27309 } 27310 break; 27311 } 27312 } 27313 } 27314} 27315 27316/** 27317 * Find all assignments and usages of temporary variables, which are linked to each other with cross 27318 * references. Generate names for each cross-reference, and add a `DeclareVarStmt` to initialize 27319 * them at the beginning of the update block. 27320 * 27321 * TODO: Sometimes, it will be possible to reuse names across different subexpressions. For example, 27322 * in the double keyed read `a?.[f()]?.[f()]`, the two function calls have non-overlapping scopes. 27323 * Implement an algorithm for reuse. 27324 */ 27325function generateTemporaryVariables(job) { 27326 for (const unit of job.units) { 27327 unit.create.prepend(generateTemporaries(unit.create)); 27328 unit.update.prepend(generateTemporaries(unit.update)); 27329 } 27330} 27331function generateTemporaries(ops) { 27332 let opCount = 0; 27333 let generatedStatements = []; 27334 // For each op, search for any variables that are assigned or read. For each variable, generate a 27335 // name and produce a `DeclareVarStmt` to the beginning of the block. 27336 for (const op of ops) { 27337 // Identify the final time each temp var is read. 27338 const finalReads = new Map(); 27339 visitExpressionsInOp(op, (expr, flag) => { 27340 if (flag & VisitorContextFlag.InChildOperation) { 27341 return; 27342 } 27343 if (expr instanceof ReadTemporaryExpr) { 27344 finalReads.set(expr.xref, expr); 27345 } 27346 }); 27347 // Name the temp vars, accounting for the fact that a name can be reused after it has been 27348 // read for the final time.
27349 let count = 0; 27350 const assigned = new Set(); 27351 const released = new Set(); 27352 const defs = new Map(); 27353 visitExpressionsInOp(op, (expr, flag) => { 27354 if (flag & VisitorContextFlag.InChildOperation) { 27355 return; 27356 } 27357 if (expr instanceof AssignTemporaryExpr) { 27358 if (!assigned.has(expr.xref)) { 27359 assigned.add(expr.xref); 27360 // TODO: Exactly replicate the naming scheme used by `TemplateDefinitionBuilder`. 27361 // It seems to rely on an expression index instead of an op index. 27362 defs.set(expr.xref, `tmp_${opCount}_${count++}`); 27363 } 27364 assignName(defs, expr); 27365 } else if (expr instanceof ReadTemporaryExpr) { 27366 if (finalReads.get(expr.xref) === expr) { 27367 released.add(expr.xref); 27368 count--; 27369 } 27370 assignName(defs, expr); 27371 } 27372 }); 27373 // Add declarations for the temp vars. 27374 generatedStatements.push(...Array.from(new Set(defs.values())).map(name => createStatementOp(new DeclareVarStmt(name)))); 27375 opCount++; 27376 if (op.kind === OpKind.Listener || op.kind === OpKind.TwoWayListener) { 27377 op.handlerOps.prepend(generateTemporaries(op.handlerOps)); 27378 } else if (op.kind === OpKind.RepeaterCreate && op.trackByOps !== null) { 27379 op.trackByOps.prepend(generateTemporaries(op.trackByOps)); 27380 } 27381 } 27382 return generatedStatements; 27383} 27384/** 27385 * Assigns a name to the temporary variable in the given temporary variable expression. 27386 */ 27387function assignName(names, expr) { 27388 const name = names.get(expr.xref); 27389 if (name === undefined) { 27390 throw new Error(`Found xref with unassigned name: ${expr.xref}`); 27391 } 27392 expr.name = name; 27393} 27394 27395/** 27396 * `track` functions in `for` repeaters can sometimes be "optimized," i.e. transformed into inline 27397 * expressions, in lieu of an external function call. For example, tracking by `$index` can be be 27398 * optimized into an inline `trackByIndex` reference. This phase checks track expressions for 27399 * optimizable cases. 27400 */ 27401function optimizeTrackFns(job) { 27402 for (const unit of job.units) { 27403 for (const op of unit.create) { 27404 if (op.kind !== OpKind.RepeaterCreate) { 27405 continue; 27406 } 27407 if (op.track instanceof ReadVarExpr && op.track.name === '$index') { 27408 // Top-level access of `$index` uses the built in `repeaterTrackByIndex`. 27409 op.trackByFn = importExpr(Identifiers.repeaterTrackByIndex); 27410 } else if (op.track instanceof ReadVarExpr && op.track.name === '$item') { 27411 // Top-level access of the item uses the built in `repeaterTrackByIdentity`. 27412 op.trackByFn = importExpr(Identifiers.repeaterTrackByIdentity); 27413 } else if (isTrackByFunctionCall(job.root.xref, op.track)) { 27414 // Mark the function as using the component instance to play it safe 27415 // since the method might be using `this` internally (see #53628). 27416 op.usesComponentInstance = true; 27417 // Top-level method calls in the form of `fn($index, item)` can be passed in directly. 27418 if (op.track.receiver.receiver.view === unit.xref) { 27419 // TODO: this may be wrong 27420 op.trackByFn = op.track.receiver; 27421 } else { 27422 // This is a plain method call, but not in the component's root view. 27423 // We need to get the component instance, and then call the method on it. 27424 op.trackByFn = importExpr(Identifiers.componentInstance).callFn([]).prop(op.track.receiver.name); 27425 // Because the context is not avaiable (without a special function), we don't want to 27426 // try to resolve it later. Let's get rid of it by overwriting the original track 27427 // expression (which won't be used anyway). 27428 op.track = op.trackByFn; 27429 } 27430 } else { 27431 // The track function could not be optimized. 27432 // Replace context reads with a special IR expression, since context reads in a track 27433 // function are emitted specially. 27434 op.track = transformExpressionsInExpression(op.track, expr => { 27435 if (expr instanceof PipeBindingExpr || expr instanceof PipeBindingVariadicExpr) { 27436 throw new Error(`Illegal State: Pipes are not allowed in this context`); 27437 } else if (expr instanceof ContextExpr) { 27438 op.usesComponentInstance = true; 27439 return new TrackContextExpr(expr.view); 27440 } 27441 return expr; 27442 }, VisitorContextFlag.None); 27443 // Also create an OpList for the tracking expression since it may need 27444 // additional ops when generating the final code (e.g. temporary variables). 27445 const trackOpList = new OpList();
27446 trackOpList.push(createStatementOp(new ReturnStatement(op.track, op.track.sourceSpan))); 27447 op.trackByOps = trackOpList; 27448 } 27449 } 27450 } 27451} 27452function isTrackByFunctionCall(rootView, expr) { 27453 if (!(expr instanceof InvokeFunctionExpr) || expr.args.length === 0 || expr.args.length > 2) { 27454 return false; 27455 } 27456 if (!(expr.receiver instanceof ReadPropExpr && expr.receiver.receiver instanceof ContextExpr) || expr.receiver.receiver.view !== rootView) { 27457 return false; 27458 } 27459 const [arg0, arg1] = expr.args; 27460 if (!(arg0 instanceof ReadVarExpr) || arg0.name !== '$index') { 27461 return false; 27462 } else if (expr.args.length === 1) { 27463 return true; 27464 } 27465 if (!(arg1 instanceof ReadVarExpr) || arg1.name !== '$item') { 27466 return false; 27467 } 27468 return true; 27469} 27470 27471/** 27472 * Inside the `track` expression on a `for` repeater, the `$index` and `$item` variables are 27473 * ambiently available. In this phase, we find those variable usages, and replace them with the 27474 * appropriate output read. 27475 */ 27476function generateTrackVariables(job) { 27477 for (const unit of job.units) { 27478 for (const op of unit.create) { 27479 if (op.kind !== OpKind.RepeaterCreate) { 27480 continue; 27481 } 27482 op.track = transformExpressionsInExpression(op.track, expr => { 27483 if (expr instanceof LexicalReadExpr) { 27484 if (op.varNames.$index.has(expr.name)) { 27485 return variable('$index'); 27486 } else if (expr.name === op.varNames.$implicit) { 27487 return variable('$item'); 27488 } 27489 // TODO: handle prohibited context variables (emit as globals?) 27490 } 27491 return expr; 27492 }, VisitorContextFlag.None); 27493 } 27494 } 27495} 27496 27497/** 27498 * Counts the number of variable slots used within each view, and stores that on the view itself, as 27499 * well as propagates it to the `ir.TemplateOp` for embedded views. 27500 */ 27501function countVariables(job) { 27502 // First, count the vars used in each view, and update the view-level counter. 27503 for (const unit of job.units) { 27504 let varCount = 0; 27505 // Count variables on top-level ops first. Don't explore nested expressions just yet. 27506 for (const op of unit.ops()) { 27507 if (hasConsumesVarsTrait(op)) { 27508 varCount += varsUsedByOp(op); 27509 } 27510 } 27511 // Count variables on expressions inside ops. We do this later because some of these expressions 27512 // might be conditional (e.g. `pipeBinding` inside of a ternary), and we don't want to interfere 27513 // with indices for top-level binding slots (e.g. `property`). 27514 for (const op of unit.ops()) { 27515 visitExpressionsInOp(op, expr => { 27516 if (!isIrExpression(expr)) { 27517 return; 27518 } 27519 // TemplateDefinitionBuilder assigns variable offsets for everything but pure functions 27520 // first, and then assigns offsets to pure functions lazily. We emulate that behavior by 27521 // assigning offsets in two passes instead of one, only in compatibility mode. 27522 if (job.compatibility === CompatibilityMode.TemplateDefinitionBuilder && expr instanceof PureFunctionExpr) { 27523 return; 27524 } 27525 // Some expressions require knowledge of the number of variable slots consumed. 27526 if (hasUsesVarOffsetTrait(expr)) { 27527 expr.varOffset = varCount; 27528 } 27529 if (hasConsumesVarsTrait(expr)) { 27530 varCount += varsUsedByIrExpression(expr); 27531 } 27532 }); 27533 } 27534 // Compatibility mode pass for pure function offsets (as explained above). 27535 if (job.compatibility === CompatibilityMode.TemplateDefinitionBuilder) { 27536 for (const op of unit.ops()) { 27537 visitExpressionsInOp(op, expr => { 27538 if (!isIrExpression(expr) || !(expr instanceof PureFunctionExpr)) { 27539 return; 27540 } 27541 // Some expressions require knowledge of the number of variable slots consumed. 27542 if (hasUsesVarOffsetTrait(expr)) { 27543 expr.varOffset = varCount; 27544 } 27545 if (hasConsumesVarsTrait(expr)) { 27546 varCount += varsUsedByIrExpression(expr); 27547 } 27548 }); 27549 } 27550 } 27551 unit.vars = varCount; 27552 } 27553 if (job instanceof ComponentCompilationJob) { 27554 // Add var counts for each view to the `ir.TemplateOp` which declares that view (if the view is 27555 // an embedded view). 27556 for (const unit of job.units) { 27557 for (const op of unit.create) { 27558 if (op.kind !== OpKind.Template && op.kind !== OpKind.RepeaterCreate) { 27559 continue; 27560 } 27561 const childView = job.views.get(op.xref); 27562 op.vars = childView.vars; 27563 // TODO: currently we handle the vars for the RepeaterCreate empty template in the reify 27564 // phase. We should handle that here instead. 27565 } 27566 } 27567 } 27568} 27569/** 27570 * Different operations that implement `ir.UsesVarsTrait` use different numbers of variables, so 27571 * count the variables used by any particular `op`. 27572 */ 27573function varsUsedByOp(op) { 27574 let slots; 27575 switch (op.kind) { 27576 case OpKind.Property: 27577 case OpKind.HostProperty: 27578 case OpKind.Attribute: 27579 // All of these bindings use 1 variable slot, plus 1 slot for every interpolated expression, 27580 // if any. 27581 slots = 1; 27582 if (op.expression instanceof Interpolation && !isSingletonInterpolation(op.expression)) {
27583 slots += op.expression.expressions.length; 27584 } 27585 return slots; 27586 case OpKind.TwoWayProperty: 27587 // Two-way properties can only have expressions so they only need one variable slot. 27588 return 1; 27589 case OpKind.StyleProp: 27590 case OpKind.ClassProp: 27591 case OpKind.StyleMap: 27592 case OpKind.ClassMap: 27593 // Style & class bindings use 2 variable slots, plus 1 slot for every interpolated expression, 27594 // if any. 27595 slots = 2; 27596 if (op.expression instanceof Interpolation) { 27597 slots += op.expression.expressions.length; 27598 } 27599 return slots; 27600 case OpKind.InterpolateText: 27601 // `ir.InterpolateTextOp`s use a variable slot for each dynamic expression. 27602 return op.interpolation.expressions.length; 27603 case OpKind.I18nExpression: 27604 case OpKind.Conditional: 27605 case OpKind.DeferWhen: 27606 case OpKind.StoreLet: 27607 return 1; 27608 case OpKind.RepeaterCreate: 27609 // Repeaters may require an extra variable binding slot, if they have an empty view, for the 27610 // empty block tracking. 27611 // TODO: It's a bit odd to have a create mode instruction consume variable slots. Maybe we can 27612 // find a way to use the Repeater update op instead. 27613 return op.emptyView ? 1 : 0; 27614 default: 27615 throw new Error(`Unhandled op: ${OpKind[op.kind]}`); 27616 } 27617} 27618function varsUsedByIrExpression(expr) { 27619 switch (expr.kind) { 27620 case ExpressionKind.PureFunctionExpr: 27621 return 1 + expr.args.length; 27622 case ExpressionKind.PipeBinding: 27623 return 1 + expr.args.length; 27624 case ExpressionKind.PipeBindingVariadic: 27625 return 1 + expr.numArgs; 27626 case ExpressionKind.StoreLet: 27627 return 1; 27628 default: 27629 throw new Error(`AssertionError: unhandled ConsumesVarsTrait expression ${expr.constructor.name}`); 27630 } 27631} 27632function isSingletonInterpolation(expr) { 27633 if (expr.expressions.length !== 1 || expr.strings.length !== 2) { 27634 return false; 27635 } 27636 if (expr.strings[0] !== '' || expr.strings[1] !== '') { 27637 return false; 27638 } 27639 return true; 27640} 27641 27642/** 27643 * Optimize variables declared and used in the IR. 27644 * 27645 * Variables are eagerly generated by pipeline stages for all possible values that could be 27646 * referenced. This stage processes the list of declared variables and all variable usages, 27647 * and optimizes where possible. It performs 3 main optimizations: 27648 * 27649 * * It transforms variable declarations to side effectful expressions when the 27650 * variable is not used, but its initializer has global effects which other 27651 * operations rely upon. 27652 * * It removes variable declarations if those variables are not referenced and 27653 * either they do not have global effects, or nothing relies on them. 27654 * * It inlines variable declarations when those variables are only used once 27655 * and the inlining is semantically safe. 27656 * 27657 * To guarantee correctness, analysis of "fences" in the instruction lists is used to determine 27658 * which optimizations are safe to perform. 27659 */ 27660function optimizeVariables(job) { 27661 for (const unit of job.units) { 27662 inlineAlwaysInlineVariables(unit.create); 27663 inlineAlwaysInlineVariables(unit.update); 27664 for (const op of unit.create) { 27665 if (op.kind === OpKind.Listener || op.kind === OpKind.TwoWayListener) { 27666 inlineAlwaysInlineVariables(op.handlerOps); 27667 } else if (op.kind === OpKind.RepeaterCreate && op.trackByOps !== null) { 27668 inlineAlwaysInlineVariables(op.trackByOps); 27669 } 27670 } 27671 optimizeVariablesInOpList(unit.create, job.compatibility); 27672 optimizeVariablesInOpList(unit.update, job.compatibility); 27673 for (const op of unit.create) { 27674 if (op.kind === OpKind.Listener || op.kind === OpKind.TwoWayListener) { 27675 optimizeVariablesInOpList(op.handlerOps, job.compatibility); 27676 } else if (op.kind === OpKind.RepeaterCreate && op.trackByOps !== null) { 27677 optimizeVariablesInOpList(op.trackByOps, job.compatibility); 27678 } 27679 } 27680 } 27681} 27682/** 27683 * A [fence](https://en.wikipedia.org/wiki/Memory_barrier) flag for an expression which indicates 27684 * how that expression can be optimized in relation to other expressions or instructions. 27685 * 27686 * `Fence`s are a bitfield, so multiple flags may be set on a single expression. 27687 */ 27688var Fence = /*#__PURE__*/function (Fence) { 27689 /** 27690 * Empty flag (no fence exists). 27691 */ 27692 Fence[Fence["None"] = 0] = "None"; 27693 /** 27694 * A context read fence, meaning that the expression in question reads from the "current view" 27695 * context of the runtime. 27696 */ 27697 Fence[Fence["ViewContextRead"] = 1] = "ViewContextRead"; 27698 /** 27699 * A context write fence, meaning that the expression in question writes to the "current view" 27700 * context of the runtime. 27701 * 27702 * Note that all `ContextWrite` fences are implicitly `ContextRead` fences as operations which 27703 * change the view context do so based on the current one. 27704 */ 27705 Fence[Fence["ViewContextWrite"] = 2] = "ViewContextWrite"; 27706 /** 27707 * Indicates that a call is required for its side-effects, even if nothing reads
27707its result. 27708 * 27709 * This is also true of `ViewContextWrite` operations **if** they are followed by a 27710 * `ViewContextRead`. 27711 */ 27712 Fence[Fence["SideEffectful"] = 4] = "SideEffectful"; 27713 return Fence; 27714}(Fence || {}); 27715function inlineAlwaysInlineVariables(ops) { 27716 const vars = new Map(); 27717 for (const op of ops) { 27718 if (op.kind === OpKind.Variable && op.flags & VariableFlags.AlwaysInline) { 27719 visitExpressionsInOp(op, expr => { 27720 if (isIrExpression(expr) && fencesForIrExpression(expr) !== Fence.None) { 27721 throw new Error(`AssertionError: A context-sensitive variable was marked AlwaysInline`); 27722 } 27723 }); 27724 vars.set(op.xref, op); 27725 } 27726 transformExpressionsInOp(op, expr => { 27727 if (expr instanceof ReadVariableExpr && vars.has(expr.xref)) { 27728 const varOp = vars.get(expr.xref); 27729 // Inline by cloning, because we might inline into multiple places. 27730 return varOp.initializer.clone(); 27731 } 27732 return expr; 27733 }, VisitorContextFlag.None); 27734 } 27735 for (const op of vars.values()) { 27736 OpList.remove(op); 27737 } 27738} 27739/** 27740 * Process a list of operations and optimize variables within that list. 27741 */ 27742function optimizeVariablesInOpList(ops, compatibility) { 27743 const varDecls = new Map(); 27744 const varUsages = new Map(); 27745 // Track variables that are used outside of the immediate operation list. For example, within 27746 // `ListenerOp` handler operations of listeners in the current operation list. 27747 const varRemoteUsages = new Set(); 27748 const opMap = new Map(); 27749 // First, extract information about variables declared or used within the whole list. 27750 for (const op of ops) { 27751 if (op.kind === OpKind.Variable) { 27752 if (varDecls.has(op.xref) || varUsages.has(op.xref)) { 27753 throw new Error(`Should not see two declarations of the same variable: ${op.xref}`); 27754 } 27755 varDecls.set(op.xref, op); 27756 varUsages.set(op.xref, 0); 27757 } 27758 opMap.set(op, collectOpInfo(op)); 27759 countVariableUsages(op, varUsages, varRemoteUsages); 27760 } 27761 // The next step is to remove any variable declarations for variables that aren't used. The 27762 // variable initializer expressions may be side-effectful, so they may need to be retained as 27763 // expression statements. 27764 // Track whether we've seen an operation which reads from the view context yet. This is used to 27765 // determine whether a write to the view context in a variable initializer can be observed. 27766 let contextIsUsed = false; 27767 // Note that iteration through the list happens in reverse, which guarantees that we'll process 27768 // all reads of a variable prior to processing its declaration. 27769 for (const op of ops.reversed()) { 27770 const opInfo = opMap.get(op); 27771 if (op.kind === OpKind.Variable && varUsages.get(op.xref) === 0) { 27772 // This variable is unused and can be removed. We might need to keep the initializer around, 27773 // though, if something depends on it running. 27774 if (contextIsUsed && opInfo.fences & Fence.ViewContextWrite || opInfo.fences & Fence.SideEffectful) { 27775 // This variable initializer has a side effect which must be retained. Either: 27776 // * it writes to the view context, and we know there is a future operation which depends 27777 // on that write, or 27778 // * it's an operation which is inherently side-effectful. 27779 // We can't remove the initializer, but we can remove the variable declaration itself and 27780 // replace it with a side-effectful statement. 27781 const stmtOp = createStatementOp(op.initializer.toStmt()); 27782 opMap.set(stmtOp, opInfo); 27783 OpList.replace(op, stmtOp); 27784 } else { 27785 // It's safe to delete this entire variable declaration as nothing depends on it, even 27786 // side-effectfully. Note that doing this might make other variables unused. Since we're 27787 // iterating in reverse order, we should always be processing usages before declarations 27788 // and therefore by the time we get to a declaration, all removable usages will have been 27789 // removed. 27790 uncountVariableUsages(op, varUsages); 27791 OpList.remove(op); 27792 } 27793 opMap.delete(op); 27794 varDecls.delete(op.xref); 27795 varUsages.delete(op.xref); 27796 continue; 27797 } 27798 // Does this operation depend on the view context? 27799 if (opInfo.fences & Fence.ViewContextRead) { 27800 contextIsUsed = true; 27801 } 27802 } 27803 // Next, inline any remaining variables with exactly one usage. 27804 const toInline = []; 27805 for (const [id, count] of varUsages) { 27806 const decl = varDecls.get(id); 27807 // We can inline variables that: 27808 // - are used exactly once, and 27809 // - are not used remotely 27810 // OR 27811 // - are marked for always inlining 27812 const isAlwaysInline = !!(decl.flags & VariableFlags.AlwaysInline); 27813 if (count !== 1 || isAlwaysInline) { 27814 // We can't inline this variable as it's used more than once. 27815 continue; 27816 } 27817 if (varRemoteUsages.has(id)) { 27818 // This variable is used once, but across an operation boundary, so it can't be inlined. 27819 continue; 27820 } 27821 toInline.push(id); 27822 } 27823 let candidate;
27824 while (candidate = toInline.pop()) { 27825 // We will attempt to inline this variable. If inlining fails (due to fences for example), 27826 // no future operation will make inlining legal. 27827 const decl = varDecls.get(candidate); 27828 const varInfo = opMap.get(decl); 27829 const isAlwaysInline = !!(decl.flags & VariableFlags.AlwaysInline); 27830 if (isAlwaysInline) { 27831 throw new Error(`AssertionError: Found an 'AlwaysInline' variable after the always inlining pass.`); 27832 } 27833 // Scan operations following the variable declaration and look for the point where that variable 27834 // is used. There should only be one usage given the precondition above. 27835 for (let targetOp = decl.next; targetOp.kind !== OpKind.ListEnd; targetOp = targetOp.next) { 27836 const opInfo = opMap.get(targetOp); 27837 // Is the variable used in this operation? 27838 if (opInfo.variablesUsed.has(candidate)) { 27839 if (compatibility === CompatibilityMode.TemplateDefinitionBuilder && !allowConservativeInlining(decl, targetOp)) { 27840 // We're in conservative mode, and this variable is not eligible for inlining into the 27841 // target operation in this mode. 27842 break; 27843 } 27844 // Yes, try to inline it. Inlining may not be successful if fences in this operation before 27845 // the variable's usage cannot be safely crossed. 27846 if (tryInlineVariableInitializer(candidate, decl.initializer, targetOp, varInfo.fences)) { 27847 // Inlining was successful! Update the tracking structures to reflect the inlined 27848 // variable. 27849 opInfo.variablesUsed.delete(candidate); 27850 // Add all variables used in the variable's initializer to its new usage site. 27851 for (const id of varInfo.variablesUsed) { 27852 opInfo.variablesUsed.add(id); 27853 } 27854 // Merge fences in the variable's initializer into its new usage site. 27855 opInfo.fences |= varInfo.fences; 27856 // Delete tracking info related to the declaration. 27857 varDecls.delete(candidate); 27858 varUsages.delete(candidate); 27859 opMap.delete(decl); 27860 // And finally, delete the original declaration from the operation list. 27861 OpList.remove(decl); 27862 } 27863 // Whether inlining succeeded or failed, we're done processing this variable. 27864 break; 27865 } 27866 // If the variable is not used in this operation, then we'd need to inline across it. Check if 27867 // that's safe to do. 27868 if (!safeToInlinePastFences(opInfo.fences, varInfo.fences)) { 27869 // We can't safely inline this variable beyond this operation, so don't proceed with 27870 // inlining this variable. 27871 break; 27872 } 27873 } 27874 } 27875} 27876/** 27877 * Given an `ir.Expression`, returns the `Fence` flags for that expression type. 27878 */ 27879function fencesForIrExpression(expr) { 27880 switch (expr.kind) { 27881 case ExpressionKind.NextContext: 27882 return Fence.ViewContextRead | Fence.ViewContextWrite; 27883 case ExpressionKind.RestoreView: 27884 return Fence.ViewContextRead | Fence.ViewContextWrite | Fence.SideEffectful; 27885 case ExpressionKind.StoreLet: 27886 return Fence.SideEffectful; 27887 case ExpressionKind.Reference: 27888 case ExpressionKind.ContextLetReference: 27889 return Fence.ViewContextRead; 27890 default: 27891 return Fence.None; 27892 } 27893} 27894/** 27895 * Build the `OpInfo` structure for the given `op`. This performs two operations: 27896 * 27897 * * It tracks which variables are used in the operation's expressions. 27898 * * It rolls up fence flags for expressions within the operation. 27899 */ 27900function collectOpInfo(op) { 27901 let fences = Fence.None; 27902 const variablesUsed = new Set(); 27903 visitExpressionsInOp(op, expr => { 27904 if (!isIrExpression(expr)) { 27905 return; 27906 } 27907 switch (expr.kind) { 27908 case ExpressionKind.ReadVariable: 27909 variablesUsed.add(expr.xref); 27910 break; 27911 default: 27912 fences |= fencesForIrExpression(expr); 27913 } 27914 }); 27915 return { 27916 fences, 27917 variablesUsed 27918 }; 27919} 27920/** 27921 * Count the number of usages of each variable, being careful to track whether those usages are 27922 * local or remote. 27923 */ 27924function countVariableUsages(op, varUsages, varRemoteUsage) { 27925 visitExpressionsInOp(op, (expr, flags) => { 27926 if (!isIrExpression(expr)) { 27927 return; 27928 } 27929 if (expr.kind !== ExpressionKind.ReadVariable) { 27930 return; 27931 } 27932 const count = varUsages.get(expr.xref); 27933 if (count === undefined) { 27934 // This variable is declared outside the current scope of optimization. 27935 return; 27936 } 27937 varUsages.set(expr.xref, count + 1); 27938 if (flags & VisitorContextFlag.InChildOperation) { 27939 varRemoteUsage.add(expr.xref); 27940 } 27941 }); 27942} 27943/** 27944 * Remove usages of a variable in `op` from the `varUsages` tracking. 27945 */ 27946function uncountVariableUsages(op, varUsages) { 27947 visitExpressionsInOp(op, expr => { 27948 if (!isIrExpression(expr)) { 27949 return; 27950 } 27951 if (expr.kind !== ExpressionKind.ReadVariable) { 27952 return; 27953 } 27954 const count = varUsages.get(expr.xref); 27955 if (count === undefined) { 27956 // This variable is declared outside the current scope of optimization. 27957 return; 27958 } else if (count === 0) { 27959 throw new Error(`Inaccurate variable count: ${expr.xref} - found another read but count is already 0`); 27960 } 27961 varUsages.set(expr.xref, count - 1); 27962 }); 27963} 27964/** 27965 * Checks whether it's safe to inline a variable across a particular operation. 27966 * 27967 * @param fences the fences of the operation which the inlining will cross 27968 * @param declFences the fences of the variable being inlined. 27969 */ 27970function safeToInlinePastFences(fences, declFences) { 27971 if (fences & Fence.ViewContextWrite) { 27972 // It's not safe to inline context reads across context writes. 27973 if (declFences & Fence.ViewContextRead) { 27974 return false;
27975 } 27976 } else if (fences & Fence.ViewContextRead) { 27977 // It's not safe to inline context writes across context reads. 27978 if (declFences & Fence.ViewContextWrite) { 27979 return false; 27980 } 27981 } 27982 return true; 27983} 27984/** 27985 * Attempt to inline the initializer of a variable into a target operation's expressions. 27986 * 27987 * This may or may not be safe to do. For example, the variable could be read following the 27988 * execution of an expression with fences that don't permit the variable to be inlined across them. 27989 */ 27990function tryInlineVariableInitializer(id, initializer, target, declFences) { 27991 // We use `ir.transformExpressionsInOp` to walk the expressions and inline the variable if 27992 // possible. Since this operation is callback-based, once inlining succeeds or fails we can't 27993 // "stop" the expression processing, and have to keep track of whether inlining has succeeded or 27994 // is no longer allowed. 27995 let inlined = false; 27996 let inliningAllowed = true; 27997 transformExpressionsInOp(target, (expr, flags) => { 27998 if (!isIrExpression(expr)) { 27999 return expr; 28000 } 28001 if (inlined || !inliningAllowed) { 28002 // Either the inlining has already succeeded, or we've passed a fence that disallows inlining 28003 // at this point, so don't try. 28004 return expr; 28005 } else if (flags & VisitorContextFlag.InChildOperation && declFences & Fence.ViewContextRead) { 28006 // We cannot inline variables that are sensitive to the current context across operation 28007 // boundaries. 28008 return expr; 28009 } 28010 switch (expr.kind) { 28011 case ExpressionKind.ReadVariable: 28012 if (expr.xref === id) { 28013 // This is the usage site of the variable. Since nothing has disallowed inlining, it's 28014 // safe to inline the initializer here. 28015 inlined = true; 28016 return initializer; 28017 } 28018 break; 28019 default: 28020 // For other types of `ir.Expression`s, whether inlining is allowed depends on their fences. 28021 const exprFences = fencesForIrExpression(expr); 28022 inliningAllowed = inliningAllowed && safeToInlinePastFences(exprFences, declFences); 28023 break; 28024 } 28025 return expr; 28026 }, VisitorContextFlag.None); 28027 return inlined; 28028} 28029/** 28030 * Determines whether inlining of `decl` should be allowed in "conservative" mode. 28031 * 28032 * In conservative mode, inlining behavior is limited to those operations which the 28033 * `TemplateDefinitionBuilder` supported, with the goal of producing equivalent output. 28034 */ 28035function allowConservativeInlining(decl, target) { 28036 // TODO(alxhub): understand exactly how TemplateDefinitionBuilder approaches inlining, and record 28037 // that behavior here. 28038 switch (decl.variable.kind) { 28039 case SemanticVariableKind.Identifier: 28040 if (decl.initializer instanceof ReadVarExpr && decl.initializer.name === 'ctx') { 28041 // Although TemplateDefinitionBuilder is cautious about inlining, we still want to do so 28042 // when the variable is the context, to imitate its behavior with aliases in control flow 28043 // blocks. This quirky behavior will become dead code once compatibility mode is no longer 28044 // supported. 28045 return true; 28046 } 28047 return false; 28048 case SemanticVariableKind.Context: 28049 // Context can only be inlined into other variables. 28050 return target.kind === OpKind.Variable; 28051 default: 28052 return true; 28053 } 28054} 28055 28056/**
28057 * Wraps ICUs that do not already belong to an i18n block in a new i18n block. 28058 */ 28059function wrapI18nIcus(job) { 28060 for (const unit of job.units) { 28061 let currentI18nOp = null; 28062 let addedI18nId = null; 28063 for (const op of unit.create) { 28064 switch (op.kind) { 28065 case OpKind.I18nStart: 28066 currentI18nOp = op; 28067 break; 28068 case OpKind.I18nEnd: 28069 currentI18nOp = null; 28070 break; 28071 case OpKind.IcuStart: 28072 if (currentI18nOp === null) { 28073 addedI18nId = job.allocateXrefId(); 28074 // ICU i18n start/end ops should not receive source spans. 28075 OpList.insertBefore(createI18nStartOp(addedI18nId, op.message, undefined, null), op); 28076 } 28077 break; 28078 case OpKind.IcuEnd: 28079 if (addedI18nId !== null) { 28080 OpList.insertAfter(createI18nEndOp(addedI18nId, null), op); 28081 addedI18nId = null; 28082 } 28083 break; 28084 } 28085 } 28086 } 28087} 28088 28089/*! 28090 * @license 28091 * Copyright Google LLC All Rights Reserved. 28092 * 28093 * Use of this source code is governed by an MIT-style license that can be 28094 * found in the LICENSE file at https://angular.dev/license 28095 */ 28096/** 28097 * Removes any `storeLet` calls that aren't referenced outside of the current view. 28098 */ 28099function optimizeStoreLet(job) { 28100 const letUsedExternally = new Set(); 28101 // Since `@let` declarations can be referenced in child views, both in 28102 // the creation block (via listeners) and in the update block, we have 28103 // to look through all the ops to find the references. 28104 for (const unit of job.units) { 28105 for (const op of unit.ops()) { 28106 visitExpressionsInOp(op, expr => { 28107 if (expr instanceof ContextLetReferenceExpr) { 28108 letUsedExternally.add(expr.target); 28109 } 28110 }); 28111 } 28112 } 28113 // TODO(crisbeto): potentially remove the unused calls completely, pending discussion. 28114 for (const unit of job.units) { 28115 for (const op of unit.update) { 28116 transformExpressionsInOp(op, expression => expression instanceof StoreLetExpr && !letUsedExternally.has(expression.target) ? expression.value : expression, VisitorContextFlag.None); 28117 } 28118 } 28119} 28120 28121/** 28122 * It's not allowed to access a `@let` declaration before it has been defined. This is enforced 28123 * already via template type checking, however it can trip some of the assertions in the pipeline. 28124 * E.g. the naming phase can fail because we resolved the variable here, but the variable doesn't 28125 * exist anymore because the optimization phase removed it since it's invalid. To avoid surfacing 28126 * confusing errors to users in the case where template type checking isn't running (e.g. in JIT 28127 * mode) this phase detects illegal forward references and replaces them with `undefined`. 28128 * Eventually users will see the proper error from the template type checker. 28129 */ 28130function removeIllegalLetReferences(job) { 28131 for (const unit of job.units) { 28132 for (const op of unit.update) { 28133 if (op.kind !== OpKind.Variable || op.variable.kind !== SemanticVariableKind.Identifier || !(op.initializer instanceof StoreLetExpr)) { 28134 continue; 28135 } 28136 const name = op.variable.identifier; 28137 let current = op; 28138 while (current && current.kind !== OpKind.ListEnd) { 28139 transformExpressionsInOp(current, expr => expr instanceof LexicalReadExpr && expr.name === name ? literal(undefined) : expr, VisitorContextFlag.None); 28140 current = current.prev; 28141 } 28142 } 28143 } 28144} 28145 28146/** 28147 * Replaces the `storeLet` ops with variables that can be 28148 * used to reference the value within the same view. 28149 */ 28150function generateLocalLetReferences(job) { 28151 for (const unit of job.units) { 28152 for (const op of unit.update) { 28153 if (op.kind !== OpKind.StoreLet) { 28154 continue; 28155 } 28156 const variable = { 28157 kind: SemanticVariableKind.Identifier, 28158 name: null, 28159 identifier: op.declaredName, 28160 local: true 28161 }; 28162 OpList.replace(op, createVariableOp(job.allocateXrefId(), variable, new StoreLetExpr(op.target, op.value, op.sourceSpan), VariableFlags.None)); 28163 } 28164 } 28165} 28166 28167/** 28168 * Locates all of the elements defined in a creation block and outputs an op 28169 * that will expose their definition location in the DOM. 28170 */ 28171function attachSourceLocations(job) { 28172 if (!job.enableDebugLocations || job.relativeTemplatePath === null) { 28173 return; 28174 } 28175 for (const unit of job.units) { 28176 const locations = []; 28177 for (const op of unit.create) { 28178 if (op.kind === OpKind.ElementStart || op.kind === OpKind.Element) { 28179 const start = op.startSourceSpan.start; 28180 locations.push({ 28181 targetSlot: op.handle, 28182 offset: start.offset, 28183 line: start.line, 28184 column: start.col 28185 }); 28186 } 28187 } 28188 if (locations.length > 0) { 28189 unit.create.push(createSourceLocationOp(job.relativeTemplatePath, locations)); 28190 } 28191 } 28192} 28193 28194/** 28195 * 28196 * @license 28197 * Copyright Google LLC All Rights Reserved. 28198 * 28199 * Use of this source code is governed by an MIT-style license that can be
28200 * found in the LICENSE file at https://angular.dev/license 28201 */ 28202const phases = [{ 28203 kind: CompilationJobKind.Tmpl, 28204 fn: removeContentSelectors 28205}, { 28206 kind: CompilationJobKind.Host, 28207 fn: parseHostStyleProperties 28208}, { 28209 kind: CompilationJobKind.Tmpl, 28210 fn: emitNamespaceChanges 28211}, { 28212 kind: CompilationJobKind.Tmpl, 28213 fn: propagateI18nBlocks 28214}, { 28215 kind: CompilationJobKind.Tmpl, 28216 fn: wrapI18nIcus 28217}, { 28218 kind: CompilationJobKind.Both, 28219 fn: deduplicateTextBindings 28220}, { 28221 kind: CompilationJobKind.Both, 28222 fn: specializeStyleBindings 28223}, { 28224 kind: CompilationJobKind.Both, 28225 fn: specializeBindings 28226}, { 28227 kind: CompilationJobKind.Both, 28228 fn: extractAttributes 28229}, { 28230 kind: CompilationJobKind.Tmpl, 28231 fn: createI18nContexts 28232}, { 28233 kind: CompilationJobKind.Both, 28234 fn: parseExtractedStyles 28235}, { 28236 kind: CompilationJobKind.Tmpl, 28237 fn: removeEmptyBindings 28238}, { 28239 kind: CompilationJobKind.Both, 28240 fn: collapseSingletonInterpolations 28241}, { 28242 kind: CompilationJobKind.Both, 28243 fn: orderOps 28244}, { 28245 kind: CompilationJobKind.Tmpl, 28246 fn: generateConditionalExpressions 28247}, { 28248 kind: CompilationJobKind.Tmpl, 28249 fn: createPipes 28250}, { 28251 kind: CompilationJobKind.Tmpl,
28252 fn: configureDeferInstructions 28253}, { 28254 kind: CompilationJobKind.Tmpl, 28255 fn: convertI18nText 28256}, { 28257 kind: CompilationJobKind.Tmpl, 28258 fn: convertI18nBindings 28259}, { 28260 kind: CompilationJobKind.Tmpl, 28261 fn: removeUnusedI18nAttributesOps 28262}, { 28263 kind: CompilationJobKind.Tmpl, 28264 fn: assignI18nSlotDependencies 28265}, { 28266 kind: CompilationJobKind.Tmpl, 28267 fn: applyI18nExpressions 28268}, { 28269 kind: CompilationJobKind.Tmpl, 28270 fn: createVariadicPipes 28271}, { 28272 kind: CompilationJobKind.Both, 28273 fn: generatePureLiteralStructures 28274}, { 28275 kind: CompilationJobKind.Tmpl, 28276 fn: generateProjectionDefs 28277}, { 28278 kind: CompilationJobKind.Tmpl, 28279 fn: generateLocalLetReferences 28280}, { 28281 kind: CompilationJobKind.Tmpl, 28282 fn: generateVariables 28283}, { 28284 kind: CompilationJobKind.Tmpl, 28285 fn: saveAndRestoreView 28286}, { 28287 kind: CompilationJobKind.Both, 28288 fn: deleteAnyCasts 28289}, { 28290 kind: CompilationJobKind.Both, 28291 fn: resolveDollarEvent 28292}, { 28293 kind: CompilationJobKind.Tmpl, 28294 fn: generateTrackVariables 28295}, { 28296 kind: CompilationJobKind.Tmpl, 28297 fn: removeIllegalLetReferences 28298}, { 28299 kind: CompilationJobKind.Both, 28300 fn: resolveNames 28301}, { 28302 kind: CompilationJobKind.Tmpl, 28303 fn: resolveDeferTargetNames 28304}, { 28305 kind: CompilationJobKind.Tmpl, 28306 fn: transformTwoWayBindingSet 28307}, { 28308 kind: CompilationJobKind.Tmpl, 28309 fn: optimizeTrackFns 28310}, { 28311 kind: CompilationJobKind.Both, 28312 fn: resolveContexts 28313}, { 28314 kind: CompilationJobKind.Both, 28315 fn: resolveSanitizers 28316}, { 28317 kind: CompilationJobKind.Tmpl, 28318 fn: liftLocalRefs 28319}, { 28320 kind: CompilationJobKind.Both, 28321 fn: generateNullishCoalesceExpressions 28322}, { 28323 kind: CompilationJobKind.Both, 28324 fn: expandSafeReads 28325}, { 28326 kind: CompilationJobKind.Both, 28327 fn: generateTemporaryVariables 28328}, { 28329 kind: CompilationJobKind.Both, 28330 fn: optimizeVariables 28331}, { 28332 kind: CompilationJobKind.Both, 28333 fn: optimizeStoreLet 28334}, { 28335 kind: CompilationJobKind.Tmpl, 28336 fn: allocateSlots 28337}, { 28338 kind: CompilationJobKind.Tmpl, 28339 fn: resolveI18nElementPlaceholders 28340}, { 28341 kind: CompilationJobKind.Tmpl, 28342 fn: resolveI18nExpressionPlaceholders 28343}, { 28344 kind: CompilationJobKind.Tmpl, 28345 fn: extractI18nMessages 28346}, { 28347 kind: CompilationJobKind.Tmpl, 28348 fn: collectI18nConsts 28349}, { 28350 kind: CompilationJobKind.Tmpl, 28351 fn: collectConstExpressions 28352}, { 28353 kind: CompilationJobKind.Both, 28354 fn: collectElementConsts 28355}, { 28356 kind: CompilationJobKind.Tmpl, 28357 fn: removeI18nContexts 28358}, { 28359 kind: CompilationJobKind.Both, 28360 fn: countVariables 28361}, { 28362 kind: CompilationJobKind.Tmpl, 28363 fn: generateAdvance 28364}, { 28365 kind: CompilationJobKind.Both, 28366 fn: nameFunctionsAndVariables 28367}, { 28368 kind: CompilationJobKind.Tmpl, 28369 fn: resolveDeferDepsFns 28370}, { 28371 kind: CompilationJobKind.Tmpl, 28372 fn: mergeNextContextExpressions 28373}, { 28374 kind: CompilationJobKind.Tmpl, 28375 fn: generateNgContainerOps 28376}, { 28377 kind: CompilationJobKind.Tmpl, 28378 fn: collapseEmptyInstructions 28379}, { 28380 kind: CompilationJobKind.Tmpl, 28381 fn: attachSourceLocations 28382}, { 28383 kind: CompilationJobKind.Tmpl, 28384 fn: disableBindings$1 28385}, { 28386 kind: CompilationJobKind.Both, 28387 fn: extractPureFunctions 28388}, { 28389 kind: CompilationJobKind.Both, 28390 fn: reify 28391}, { 28392 kind: CompilationJobKind.Both, 28393 fn: chain 28394}]; 28395/** 28396 * Run all transformation phases in the correct order against a compilation job. After this 28397 * processing, the compilation should be in a state where it can be emitted. 28398 */ 28399function transform(job, kind) { 28400 for (const phase of phases) { 28401 if (phase.kind === kind || phase.kind === CompilationJobKind.Both) { 28402 // The type of `Phase` above ensures it is impossible to call a phase that doesn't support the 28403 // job kind. 28404 phase.fn(job); 28405 } 28406 } 28407} 28408/** 28409 * Compile all views in the given `ComponentCompilation` into the final template function, which may 28410 * reference constants defined in a `ConstantPool`. 28411 */ 28412function emitTemplateFn(tpl, pool) { 28413 const rootFn = emitView(tpl.root); 28414 emitChildViews(tpl.root, pool); 28415 return rootFn; 28416} 28417function emitChildViews(parent, pool) { 28418 for (const unit of parent.job.units) { 28419 if (unit.parent !== parent.xref) { 28420 continue; 28421 } 28422 // Child views are emitted depth-first. 28423 emitChildViews(unit, pool); 28424 const viewFn = emitView(unit); 28425 pool.statements.push(viewFn.toDeclStmt(viewFn.name)); 28426 } 28427} 28428/** 28429 * Emit a template function for an individual `ViewCompilation` (which may be either the root view 28430 * or an embedded view). 28431 */ 28432function emitView(view) { 28433 if (view.fnName === null) { 28434 throw new Error(`AssertionError: view ${view.xref} is unnamed`); 28435 } 28436 const createStatements = []; 28437 for (const op of view.create) { 28438 if (op.kind !== OpKind.Statement) { 28439 throw new Error(`AssertionError: expected all create ops to have been compiled, but got ${OpKind[op.kind]}`); 28440 } 28441 createStatements.push(op.statement); 28442 } 28443 const updateStatements = []; 28444 for (const op of view.update) { 28445 if (op.kind !== OpKind.Statement) { 28446 throw new Error(`AssertionError: expected all update ops to have been compiled, but got ${OpKind[op.kind]}`); 28447 } 28448 updateStatements.push(op.statement); 28449 } 28450 const createCond = maybeGenerateRfBlock(1, createStatements); 28451 const updateCond = maybeGenerateRfBlock(2, updateStatements); 28452 return fn([new FnParam('rf'), new FnParam('ctx')], [...createCond, ...updateCond], /* type */undefined, /* sourceSpan */undefined, view.fnName); 28453} 28454function maybeGenerateRfBlock(flag, statements) { 28455 if (statements.length === 0) { 28456 return []; 28457 } 28458 return [ifStmt(new BinaryOperatorExpr(BinaryOperator.BitwiseAnd, variable('rf'), literal(flag)), statements)]; 28459} 28460function emitHostBindingFunction(job) { 28461 if (job.root.fnName === null) { 28462 throw new Error(`AssertionError: host binding function is unnamed`); 28463 } 28464 const createStatements = []; 28465 for (const op of job.root.create) { 28466 if (op.kind !== OpKind.Statement) { 28467 throw new Error(`AssertionError: expected all create ops to have been compiled, but got ${OpKind[op.kind]}`); 28468 } 28469 createStatements.push(op.statement); 28470 } 28471 const updateStatements = []; 28472 for (const op of job.root.update) { 28473 if (op.kind !== OpKind.Statement) { 28474 throw new Error(`AssertionError: expected all update ops to have been compiled, but got ${OpKind[op.kind]}`); 28475 } 28476 updateStatements.push(op.statement); 28477 } 28478 if (createStatements.length === 0 && updateStatements.length === 0) { 28479 return null; 28480 } 28481 const createCond = maybeGenerateRfBlock(1, createStatements); 28482 const updateCond = maybeGenerateRfBlock(2, updateStatements); 28483 return fn([new FnParam('rf'), new FnParam('ctx')], [...createCond, ...updateCond], /* type */undefined, /* sourceSpan */undefined, job.root.fnName); 28484} 28485const compatibilityMode = CompatibilityMode.TemplateDefinitionBuilder; 28486// Schema containing DOM elements and their properties. 28487const domSchema = new DomElementSchemaRegistry(); 28488// Tag name of the `ng-template` element. 28489const NG_TEMPLATE_TAG_NAME = 'ng-template'; 28490function isI18nRootNode(meta) { 28491 return meta instanceof Message; 28492} 28493function isSingleI18nIcu(meta) { 28494 return isI18nRootNode(meta) && meta.nodes.length === 1 && meta.nodes[0] instanceof Icu; 28495} 28496/** 28497 * Process a template AST and convert it into a `ComponentCompilation` in the intermediate 28498 * representation.
28499 * TODO: Refactor more of the ingestion code into phases. 28500 */ 28501function ingestComponent(componentName, template, constantPool, relativeContextFilePath, i18nUseExternalIds, deferMeta, allDeferrableDepsFn, relativeTemplatePath, enableDebugLocations) { 28502 const job = new ComponentCompilationJob(componentName, constantPool, compatibilityMode, relativeContextFilePath, i18nUseExternalIds, deferMeta, allDeferrableDepsFn, relativeTemplatePath, enableDebugLocations); 28503 ingestNodes(job.root, template); 28504 return job; 28505} 28506/** 28507 * Process a host binding AST and convert it into a `HostBindingCompilationJob` in the intermediate 28508 * representation. 28509 */ 28510function ingestHostBinding(input, bindingParser, constantPool) { 28511 const job = new HostBindingCompilationJob(input.componentName, constantPool, compatibilityMode); 28512 for (const property of (_input$properties = input.properties) !== null && _input$properties !== void 0 ? _input$properties : []) { 28513 var _input$properties; 28514 let bindingKind = BindingKind.Property; 28515 // TODO: this should really be handled in the parser. 28516 if (property.name.startsWith('attr.')) { 28517 property.name = property.name.substring('attr.'.length); 28518 bindingKind = BindingKind.Attribute; 28519 } 28520 if (property.isAnimation) { 28521 bindingKind = BindingKind.Animation; 28522 } 28523 const securityContexts = bindingParser.calcPossibleSecurityContexts(input.componentSelector, property.name, bindingKind === BindingKind.Attribute).filter(context => context !== SecurityContext.NONE); 28524 ingestHostProperty(job, property, bindingKind, securityContexts); 28525 } 28526 for (const [name, expr] of (_Object$entries = Object.entries(input.attributes)) !== null && _Object$entries !== void 0 ? _Object$entries : []) { 28527 var _Object$entries; 28528 const securityContexts = bindingParser.calcPossibleSecurityContexts(input.componentSelector, name, true).filter(context => context !== SecurityContext.NONE); 28529 ingestHostAttribute(job, name, expr, securityContexts); 28530 } 28531 for (const event of (_input$events = input.events) !== null && _input$events !== void 0 ? _input$events : []) { 28532 var _input$events; 28533 ingestHostEvent(job, event); 28534 } 28535 return job; 28536} 28537// TODO: We should refactor the parser to use the same types and structures for host bindings as 28538// with ordinary components. This would allow us to share a lot more ingestion code. 28539function ingestHostProperty(job, property, bindingKind, securityContexts) { 28540 let expression; 28541 const ast = property.expression.ast; 28542 if (ast instanceof Interpolation$1) { 28543 expression = new Interpolation(ast.strings, ast.expressions.map(expr => convertAst(expr, job, property.sourceSpan)), []); 28544 } else { 28545 expression = convertAst(ast, job, property.sourceSpan); 28546 } 28547 job.root.update.push(createBindingOp(job.root.xref, bindingKind, property.name, expression, null, securityContexts, false, false, null, /* TODO: How do Host bindings handle i18n attrs? */null, property.sourceSpan)); 28548} 28549function ingestHostAttribute(job, name, value, securityContexts) { 28550 const attrBinding = createBindingOp(job.root.xref, BindingKind.Attribute, name, value, null, securityContexts, 28551 /* Host attributes should always be extracted to const hostAttrs, even if they are not 28552 *strictly* text literals */ 28553 true, false, null, /* TODO */null, /** TODO: May be null? */value.sourceSpan); 28554 job.root.update.push(attrBinding); 28555} 28556function ingestHostEvent(job, event) { 28557 const [phase, target] = event.type !== ParsedEventType.Animation ? [null, event.targetOrPhase] : [event.targetOrPhase, null]; 28558 const eventBinding = createListenerOp(job.root.xref, new SlotHandle(), event.name, null, makeListenerHandlerOps(job.root, event.handler, event.handlerSpan), phase, target, true, event.sourceSpan); 28559 job.root.create.push(eventBinding); 28560} 28561/** 28562 * Ingest the nodes of a template AST into the given `ViewCompilation`. 28563 */ 28564function ingestNodes(unit, template) { 28565 for (const node of template) { 28566 if (node instanceof Element$1) { 28567 ingestElement(unit, node); 28568 } else if (node instanceof Template) { 28569 ingestTemplate(unit, node); 28570 } else if (node instanceof Content) { 28571 ingestContent(unit, node); 28572 } else if (node instanceof Text$3) { 28573 ingestText(unit, node, null); 28574 } else if (node instanceof BoundText) { 28575 ingestBoundText(unit, node, null); 28576 } else if (node instanceof IfBlock) { 28577 ingestIfBlock(unit, node); 28578 } else if (node instanceof SwitchBlock) { 28579 ingestSwitchBlock(unit, node); 28580 } else if (node instanceof DeferredBlock) { 28581 ingestDeferBlock(unit, node); 28582 } else if (node instanceof Icu$1) { 28583 ingestIcu(unit, node); 28584 } else if (node instanceof ForLoopBlock) { 28585 ingestForBlock(unit, node); 28586 } else if (node instanceof LetDeclaration$1) { 28587 ingestLetDeclaration(unit, node); 28588 } else { 28589 throw new Error(`Unsupported template node: ${node.constructor.name}`); 28590 } 28591 } 28592} 28593/** 28594 * Ingest an element AST from the template into the given `ViewCompilation`. 28595 */ 28596function ingestElement(unit, element) { 28597 var _element$endSourceSpa; 28598 if (element.i18n !== undefined && !(element.i18n instanceof Message || element.i18n instanceof TagPlaceholder)) { 28599 throw Error(`Unhandled i18n metadata type for element: ${element.i18n.constructor.name}`); 28600 } 28601 const id = unit.job.allocateXrefId(); 28602 const [namespaceKey, elementName] = splitNsName(element.name); 28603 const startOp = createElementStartOp(elementName, id, namespaceForKey(namespaceKey), element.i18n instanceof TagPlaceholder ? element.i18n : undefined, element.startSourceSpan, element.sourceSpan); 28604 unit.create.push(startOp); 28605 ingestElementBindings(unit, startOp, element); 28606 ingestReferences(startOp, element); 28607 // Start i18n, if needed, goes after the element create and bindings, but before the nodes 28608 let i18nBlockId = null; 28609 if (element.i18n instanceof Message) { 28610 i18nBlockId = unit.job.allocateXrefId(); 28611 unit.create.push(createI18nStartOp(i18nBlockId, element.i18n, undefined, element.startSourceSpan)); 28612 } 28613 ingestNodes(unit, element.children); 28614 // The source span for the end op is typically the element closing tag. However, if no closing tag 28615 // exists, such as in `<input>`, we use the start source span instead. Usually the start and end 28616 // instructions will be collapsed into one `element` instruction, negating the purpose of this 28617 // fallback, but in cases when it is not collapsed (such as an input with a binding), we still 28618 // want to map the end instruction to the main element. 28619 const endOp = createElementEndOp(id, (_element$endSourceSpa = element.endSourceSpan) !== null && _element$endSourceSpa !== void 0 ? _element$endSourceSpa : element.startSourceSpan); 28620 unit.create.push(endOp); 28621 // If there is an i18n message associated with this element, insert i18n start and end ops. 28622 if (i18nBlockId !== null) { 28623 var _element$endSourceSpa2; 28624 OpList.insertBefore(createI18nEndOp(i18nBlockId, (_element$endSourceSpa2 = element.endSourceSpan) !== null && _element$endSourceSpa2 !== void 0 ? _element$endSourceSpa2 : element.startSourceSpan), endOp); 28625 } 28626} 28627/** 28628 * Ingest an `ng-template` node from the AST into the given `ViewCompilation`. 28629 */ 28630function ingestTemplate(unit, tmpl) { 28631 if (tmpl.i18n !== undefined && !(tmpl.i18n instanceof Message || tmpl.i18n instanceof TagPlaceholder)) { 28632 throw Error(`Unhandled i18n metadata type for template: ${tmpl.i18n.constructor.name}`); 28633 } 28634 const childView = unit.job.allocateView(unit.xref); 28635 let tagNameWithoutNamespace = tmpl.tagName; 28636 let namespacePrefix = ''; 28637 if (tmpl.tagName) { 28638 [namespacePrefix, tagNameWithoutNamespace] = splitNsName(tmpl.tagName); 28639 } 28640 const i18nPlaceholder = tmpl.i18n instanceof TagPlaceholder ? tmpl.i18n : undefined; 28641 const namespace = namespaceForKey(namespacePrefix); 28642 const functionNameSuffix = tagNameWithoutNamespace === null ? '' : prefixWithNamespace(tagNameWithoutNamespace, namespace); 28643 const templateKind = isPlainTemplate(tmpl) ? TemplateKind.NgTemplate : TemplateKind.Structural; 28644 const templateOp = createTemplateOp(childView.xref, templateKind, tagNameWithoutNamespace, functionNameSuffix, namespace, i18nPlaceholder, tmpl.startSourceSpan, tmpl.sourceSpan); 28645 unit.create.push(templateOp); 28646 ingestTemplateBindings(unit, templateOp, tmpl, templateKind); 28647 ingestReferences(templateOp, tmpl); 28648 ingestNodes(childView, tmpl.children); 28649 for (const { 28650 name, 28651 value 28652 } of tmpl.variables) { 28653 childView.contextVariables.set(name, value !== '' ? value : '$implicit'); 28654 } 28655 // If this is a plain template and there is an i18n message associated with it, insert i18n start 28656 // and end ops. For structural directive templates, the i18n ops will be added when ingesting the 28657 // element/template the directive is placed on. 28658 if (templateKind === TemplateKind.NgTemplate && tmpl.i18n instanceof Message) { 28659 var _tmpl$endSourceSpan; 28660 const id = unit.job.allocateXrefId(); 28661 OpList.insertAfter(createI18nStartOp(id, tmpl.i18n, undefined, tmpl.startSourceSpan), childView.create.head); 28662 OpList.insertBefore(createI18nEndOp(id, (_tmpl$endSourceSpan = tmpl.endSourceSpan) !== null && _tmpl$endSourceSpan !== void 0 ? _tmpl$endSourceSpan : tmpl.startSourceSpan), childView.create.tail); 28663 } 28664} 28665/** 28666 * Ingest a content node from the AST into the given `ViewCompilation`. 28667 */ 28668function ingestContent(unit, content) { 28669 var _fallbackView$xref, _fallbackView; 28670 if (content.i18n !== undefined && !(content.i18n instanceof TagPlaceholder)) { 28671 throw Error(`Unhandled i18n metadata type for element: ${content.i18n.constructor.name}`); 28672 } 28673 let fallbackView = null; 28674 // Don't capture default content that's only made up of empty text nodes and comments. 28675 // Note that we process the default content before the projection in order to match the 28676 // insertion order at runtime. 28677 if (content.children.some(child => !(child instanceof Comment$1) && (!(child instanceof Text$3) || child.value.trim().length > 0))) { 28678 fallbackView = unit.job.allocateView(unit.xref); 28679 ingestNodes(fallbackView, content.children); 28680 } 28681 const id = unit.job.allocateXrefId(); 28682 const op = createProjectionOp(id, content.selector, content.i18n, (_fallbackView$xref = (_fallbackView = fallbackView) === null || _fallbackView === void 0 ? void 0 : _fallbackView.xref) !== null && _fallbackView$xref !== void 0 ? _fallbackView$xref : null, content.sourceSpan); 28683 for (const attr of content.attributes) { 28684 const securityContext = domSchema.securityContext(content.name, attr.name, true); 28685 unit.update.push(createBindingOp(op.xref, BindingKind.Attribute, attr.name, literal(attr.value), null, securityContext, true, false, null, asMessage(attr.i18n), attr.sourceSpan)); 28686 } 28687 unit.create.push(op); 28688} 28689/** 28690 * Ingest a literal text node from the AST into the given `ViewCompilation`. 28691 */ 28692function ingestText(unit, text, icuPlaceholder) { 28693 unit.create.push(createTextOp(unit.job.allocateXrefId(), text.value, icuPlaceholder, text.sourceSpan)); 28694} 28695/** 28696 * Ingest an interpolated text node from the AST into the given `ViewCompilation`. 28697 */ 28698function ingestBoundText(unit, text, icuPlaceholder) { 28699 let value = text.value; 28700 if (value instanceof ASTWithSource) { 28701 value = value.ast; 28702 } 28703 if (!(value instanceof Interpolation$1)) { 28704 throw new Error(`AssertionError: expected Interpolation for BoundText node, got ${value.constructor.name}`); 28705 } 28706 if (text.i18n !== undefined && !(text.i18n instanceof Container)) { 28707 var _text$i18n; 28708 throw Error(`Unhandled i18n metadata type for text interpolation: ${(_text$i18n = text.i18n) === null || _text$i18n === void 0 ? void 0 : _text$i18n.constructor.name}`); 28709 } 28710 const i18nPlaceholders = text.i18n instanceof Container ? text.i18n.children.filter(node =>
28710 node instanceof Placeholder).map(placeholder => placeholder.name) : []; 28711 if (i18nPlaceholders.length > 0 && i18nPlaceholders.length !== value.expressions.length) { 28712 throw Error(`Unexpected number of i18n placeholders (${value.expressions.length}) for BoundText with ${value.expressions.length} expressions`); 28713 } 28714 const textXref = unit.job.allocateXrefId(); 28715 unit.create.push(createTextOp(textXref, '', icuPlaceholder, text.sourceSpan)); 28716 // TemplateDefinitionBuilder does not generate source maps for sub-expressions inside an 28717 // interpolation. We copy that behavior in compatibility mode. 28718 // TODO: is it actually correct to generate these extra maps in modern mode? 28719 const baseSourceSpan = unit.job.compatibility ? null : text.sourceSpan; 28720 unit.update.push(createInterpolateTextOp(textXref, new Interpolation(value.strings, value.expressions.map(expr => convertAst(expr, unit.job, baseSourceSpan)), i18nPlaceholders), text.sourceSpan)); 28721} 28722/** 28723 * Ingest an `@if` block into the given `ViewCompilation`. 28724 */ 28725function ingestIfBlock(unit, ifBlock) { 28726 let firstXref = null; 28727 let conditions = []; 28728 for (let i = 0; i < ifBlock.branches.length; i++) { 28729 const ifCase = ifBlock.branches[i]; 28730 const cView = unit.job.allocateView(unit.xref); 28731 const tagName = ingestControlFlowInsertionPoint(unit, cView.xref, ifCase); 28732 if (ifCase.expressionAlias !== null) { 28733 cView.contextVariables.set(ifCase.expressionAlias.name, CTX_REF); 28734 } 28735 let ifCaseI18nMeta = undefined; 28736 if (ifCase.i18n !== undefined) { 28737 if (!(ifCase.i18n instanceof BlockPlaceholder)) { 28738 var _ifCase$i18n; 28739 throw Error(`Unhandled i18n metadata type for if block: ${(_ifCase$i18n = ifCase.i18n) === null || _ifCase$i18n === void 0 ? void 0 : _ifCase$i18n.constructor.name}`); 28740 } 28741 ifCaseI18nMeta = ifCase.i18n; 28742 } 28743 const templateOp = createTemplateOp(cView.xref, TemplateKind.Block, tagName, 'Conditional', Namespace.HTML, ifCaseI18nMeta, ifCase.startSourceSpan, ifCase.sourceSpan); 28744 unit.create.push(templateOp); 28745 if (firstXref === null) { 28746 firstXref = cView.xref; 28747 } 28748 const caseExpr = ifCase.expression ? convertAst(ifCase.expression, unit.job, null) : null; 28749 const conditionalCaseExpr = new ConditionalCaseExpr(caseExpr, templateOp.xref, templateOp.handle, ifCase.expressionAlias); 28750 conditions.push(conditionalCaseExpr); 28751 ingestNodes(cView, ifCase.children); 28752 } 28753 unit.update.push(createConditionalOp(firstXref, null, conditions, ifBlock.sourceSpan)); 28754} 28755/** 28756 * Ingest an `@switch` block into the given `ViewCompilation`. 28757 */ 28758function ingestSwitchBlock(unit, switchBlock) { 28759 // Don't ingest empty switches since they won't render anything. 28760 if (switchBlock.cases.length === 0) { 28761 return; 28762 } 28763 let firstXref = null; 28764 let conditions = []; 28765 for (const switchCase of switchBlock.cases) { 28766 const cView = unit.job.allocateView(unit.xref); 28767 const tagName = ingestControlFlowInsertionPoint(unit, cView.xref, switchCase); 28768 let switchCaseI18nMeta = undefined; 28769 if (switchCase.i18n !== undefined) { 28770 if (!(switchCase.i18n instanceof BlockPlaceholder)) { 28771 var _switchCase$i18n; 28772 throw Error(`Unhandled i18n metadata type for switch block: ${(_switchCase$i18n = switchCase.i18n) === null || _switchCase$i18n === void 0 ? void 0 : _switchCase$i18n.constructor.name}`); 28773 } 28774 switchCaseI18nMeta = switchCase.i18n; 28775 } 28776 const templateOp = createTemplateOp(cView.xref, TemplateKind.Block, tagName, 'Case', Namespace.HTML, switchCaseI18nMeta, switchCase.startSourceSpan, switchCase.sourceSpan); 28777 unit.create.push(templateOp); 28778 if (firstXref === null) { 28779 firstXref = cView.xref; 28780 } 28781 const caseExpr = switchCase.expression ? convertAst(switchCase.expression, unit.job, switchBlock.startSourceSpan) : null; 28782 const conditionalCaseExpr = new ConditionalCaseExpr(caseExpr, templateOp.xref, templateOp.handle); 28783 conditions.push(conditionalCaseExpr); 28784 ingestNodes(cView, switchCase.children); 28785 } 28786 unit.update.push(createConditionalOp(firstXref, convertAst(switchBlock.expression, unit.job, null), conditions, switchBlock.sourceSpan)); 28787} 28788function ingestDeferView(unit, suffix, i18nMeta, children, sourceSpan) { 28789 if (i18nMeta !== undefined && !(i18nMeta instanceof BlockPlaceholder)) { 28790 throw Error('Unhandled i18n metadata type for defer block'); 28791 } 28792 if (children === undefined) { 28793 return null; 28794 } 28795 const secondaryView = unit.job.allocateView(unit.xref); 28796 ingestNodes(secondaryView, children); 28797 const templateOp = createTemplateOp(secondaryView.xref, TemplateKind.Block, null, `Defer${suffix}`, Namespace.HTML, i18nMeta, sourceSpan, sourceSpan); 28798 unit.create.push(templateOp); 28799 return templateOp; 28800} 28801function ingestDeferBlock(unit, deferBlock) { 28802 var _deferBlock$loading, _deferBlock$loading2, _deferBlock$loading3, _deferBlock$placehold, _deferBlock$placehold2, _deferBlock$placehold3, _deferBlock$error, _deferBlock$error2, _deferBlock$error3, _placeholder$xref, _placeholder$handle, _loading$handle, _error$handle, _deferBlock$placehold4, _deferBlock$placehold5, _deferBlock$loading$m, _deferBlock$loading4, _deferBlock$loading$a, _deferBlock$loading5; 28803 let ownResolverFn = null; 28804 if (unit.job.deferMeta.mode === 0 /* DeferBlockDepsEmitMode.PerBlock */) { 28805 var _unit$job$deferMeta$b; 28806 if (!unit.job.deferMeta.blocks.has(deferBlock)) { 28807 throw new Error(`AssertionError: unable to find a dependency function for this deferred block`); 28808 } 28809 ownResolverFn = (_unit$job$deferMeta$b = unit.job.deferMeta.blocks.get(deferBlock)) !== null && _unit$job$deferMeta$b !== void 0 ? _unit$job$deferMeta$b : null; 28810 } 28811 // Generate the defer main view and all secondary views.
28812 const main = ingestDeferView(unit, '', deferBlock.i18n, deferBlock.children, deferBlock.sourceSpan); 28813 const loading = ingestDeferView(unit, 'Loading', (_deferBlock$loading = deferBlock.loading) === null || _deferBlock$loading === void 0 ? void 0 : _deferBlock$loading.i18n, (_deferBlock$loading2 = deferBlock.loading) === null || _deferBlock$loading2 === void 0 ? void 0 : _deferBlock$loading2.children, (_deferBlock$loading3 = deferBlock.loading) === null || _deferBlock$loading3 === void 0 ? void 0 : _deferBlock$loading3.sourceSpan); 28814 const placeholder = ingestDeferView(unit, 'Placeholder', (_deferBlock$placehold = deferBlock.placeholder) === null || _deferBlock$placehold === void 0 ? void 0 : _deferBlock$placehold.i18n, (_deferBlock$placehold2 = deferBlock.placeholder) === null || _deferBlock$placehold2 === void 0 ? void 0 : _deferBlock$placehold2.children, (_deferBlock$placehold3 = deferBlock.placeholder) === null || _deferBlock$placehold3 === void 0 ? void 0 : _deferBlock$placehold3.sourceSpan); 28815 const error = ingestDeferView(unit, 'Error', (_deferBlock$error = deferBlock.error) === null || _deferBlock$error === void 0 ? void 0 : _deferBlock$error.i18n, (_deferBlock$error2 = deferBlock.error) === null || _deferBlock$error2 === void 0 ? void 0 : _deferBlock$error2.children, (_deferBlock$error3 = deferBlock.error) === null || _deferBlock$error3 === void 0 ? void 0 : _deferBlock$error3.sourceSpan); 28816 // Create the main defer op, and ops for all secondary views. 28817 const deferXref = unit.job.allocateXrefId(); 28818 const deferOp = createDeferOp(deferXref, main.xref, main.handle, ownResolverFn, unit.job.allDeferrableDepsFn, deferBlock.sourceSpan); 28819 deferOp.placeholderView = (_placeholder$xref = placeholder === null || placeholder === void 0 ? void 0 : placeholder.xref) !== null && _placeholder$xref !== void 0 ? _placeholder$xref : null; 28820 deferOp.placeholderSlot = (_placeholder$handle = placeholder === null || placeholder === void 0 ? void 0 : placeholder.handle) !== null && _placeholder$handle !== void 0 ? _placeholder$handle : null; 28821 deferOp.loadingSlot = (_loading$handle = loading === null || loading === void 0 ? void 0 : loading.handle) !== null && _loading$handle !== void 0 ? _loading$handle : null; 28822 deferOp.errorSlot = (_error$handle = error === null || error === void 0 ? void 0 : error.handle) !== null && _error$handle !== void 0 ? _error$handle : null; 28823 deferOp.placeholderMinimumTime = (_deferBlock$placehold4 = (_deferBlock$placehold5 = deferBlock.placeholder) === null || _deferBlock$placehold5 === void 0 ? void 0 : _deferBlock$placehold5.minimumTime) !== null && _deferBlock$placehold4 !== void 0 ? _deferBlock$placehold4 : null; 28824 deferOp.loadingMinimumTime = (_deferBlock$loading$m = (_deferBlock$loading4 = deferBlock.loading) === null || _deferBlock$loading4 === void 0 ? void 0 : _deferBlock$loading4.minimumTime) !== null && _deferBlock$loading$m !== void 0 ? _deferBlock$loading$m : null; 28825 deferOp.loadingAfterTime = (_deferBlock$loading$a = (_deferBlock$loading5 = deferBlock.loading) === null || _deferBlock$loading5 === void 0 ? void 0 : _deferBlock$loading5.afterTime) !== null && _deferBlock$loading$a !== void 0 ? _deferBlock$loading$a : null; 28826 deferOp.flags = calcDeferBlockFlags(deferBlock); 28827 unit.create.push(deferOp); 28828 // Configure all defer `on` conditions. 28829 // TODO: refactor prefetch triggers to use a separate op type, with a shared superclass. This will 28830 // make it easier to refactor prefetch behavior in the future. 28831 const deferOnOps = []; 28832 const deferWhenOps = []; 28833 // Ingest the hydrate triggers first since they set up all the other triggers during SSR. 28834 ingestDeferTriggers("hydrate" /* ir.DeferOpModifierKind.HYDRATE */, deferBlock.hydrateTriggers, deferOnOps, deferWhenOps, unit, deferXref); 28835 ingestDeferTriggers("none" /* ir.DeferOpModifierKind.NONE */, deferBlock.triggers, deferOnOps, deferWhenOps, unit, deferXref); 28836 ingestDeferTriggers("prefetch" /* ir.DeferOpModifierKind.PREFETCH */, deferBlock.prefetchTriggers, deferOnOps, deferWhenOps, unit, deferXref); 28837 // If no (non-prefetching or hydrating) defer triggers were provided, default to `idle`. 28838 const hasConcreteTrigger = deferOnOps.some(op => op.modifier === "none" /* ir.DeferOpModifierKind.NONE */) || deferWhenOps.some(op => op.modifier === "none" /* ir.DeferOpModifierKind.NONE */); 28839 if (!hasConcreteTrigger) { 28840 deferOnOps.push(createDeferOnOp(deferXref, { 28841 kind: DeferTriggerKind.Idle 28842 }, "none" /* ir.DeferOpModifierKind.NONE */, null)); 28843 } 28844 unit.create.push(deferOnOps); 28845 unit.update.push(deferWhenOps); 28846}
28847function calcDeferBlockFlags(deferBlockDetails) { 28848 if (Object.keys(deferBlockDetails.hydrateTriggers).length > 0) { 28849 return 1 /* ir.TDeferDetailsFlags.HasHydrateTriggers */; 28850 } 28851 return null; 28852} 28853function ingestDeferTriggers(modifier, triggers, onOps, whenOps, unit, deferXref) { 28854 if (triggers.idle !== undefined) { 28855 const deferOnOp = createDeferOnOp(deferXref, { 28856 kind: DeferTriggerKind.Idle 28857 }, modifier, triggers.idle.sourceSpan); 28858 onOps.push(deferOnOp); 28859 } 28860 if (triggers.immediate !== undefined) { 28861 const deferOnOp = createDeferOnOp(deferXref, { 28862 kind: DeferTriggerKind.Immediate 28863 }, modifier, triggers.immediate.sourceSpan); 28864 onOps.push(deferOnOp); 28865 } 28866 if (triggers.timer !== undefined) { 28867 const deferOnOp = createDeferOnOp(deferXref, { 28868 kind: DeferTriggerKind.Timer, 28869 delay: triggers.timer.delay 28870 }, modifier, triggers.timer.sourceSpan); 28871 onOps.push(deferOnOp); 28872 } 28873 if (triggers.hover !== undefined) { 28874 const deferOnOp = createDeferOnOp(deferXref, { 28875 kind: DeferTriggerKind.Hover, 28876 targetName: triggers.hover.reference, 28877 targetXref: null, 28878 targetSlot: null, 28879 targetView: null, 28880 targetSlotViewSteps: null 28881 }, modifier, triggers.hover.sourceSpan); 28882 onOps.push(deferOnOp); 28883 } 28884 if (triggers.interaction !== undefined) { 28885 const deferOnOp = createDeferOnOp(deferXref, { 28886 kind: DeferTriggerKind.Interaction, 28887 targetName: triggers.interaction.reference, 28888 targetXref: null, 28889 targetSlot: null, 28890 targetView: null, 28891 targetSlotViewSteps: null 28892 }, modifier, triggers.interaction.sourceSpan); 28893 onOps.push(deferOnOp); 28894 } 28895 if (triggers.viewport !== undefined) { 28896 const deferOnOp = createDeferOnOp(deferXref, { 28897 kind: DeferTriggerKind.Viewport, 28898 targetName: triggers.viewport.reference, 28899 targetXref: null, 28900 targetSlot: null, 28901 targetView: null, 28902 targetSlotViewSteps: null 28903 }, modifier, triggers.viewport.sourceSpan); 28904 onOps.push(deferOnOp); 28905 } 28906 if (triggers.never !== undefined) { 28907 const deferOnOp = createDeferOnOp(deferXref, { 28908 kind: DeferTriggerKind.Never 28909 }, modifier, triggers.never.sourceSpan); 28910 onOps.push(deferOnOp); 28911 } 28912 if (triggers.when !== undefined) { 28913 if (triggers.when.value instanceof Interpolation$1) { 28914 // TemplateDefinitionBuilder supports this case, but it's very strange to me. What would it 28915 // even mean? 28916 throw new Error(`Unexpected interpolation in defer block when trigger`); 28917 } 28918 const deferOnOp = createDeferWhenOp(deferXref, convertAst(triggers.when.value, unit.job, triggers.when.sourceSpan), modifier, triggers.when.sourceSpan); 28919 whenOps.push(deferOnOp); 28920 } 28921} 28922function ingestIcu(unit, icu) { 28923 if (icu.i18n instanceof Message && isSingleI18nIcu(icu.i18n)) { 28924 const xref = unit.job.allocateXrefId(); 28925 unit.create.push(createIcuStartOp(xref, icu.i18n, icuFromI18nMessage(icu.i18n).name, null)); 28926 for (const [placeholder, text] of Object.entries((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({}, icu.vars), icu.placeholders))) { 28927 if (text instanceof BoundText) { 28928 ingestBoundText(unit, text, placeholder); 28929 } else { 28930 ingestText(unit, text, placeholder); 28931 } 28932 } 28933 unit.create.push(createIcuEndOp(xref)); 28934 } else { 28935 var _icu$i18n; 28936 throw Error(`Unhandled i18n metadata type for ICU: ${(_icu$i18n = icu.i18n) === null || _icu$i18n === void 0 ? void 0 : _icu$i18n.constructor.name}`); 28937 } 28938} 28939/** 28940 * Ingest an `@for` block into the given `ViewCompilation`. 28941 */ 28942function ingestForBlock(unit, forBlock) { 28943 var _forBlock$empty, _forBlock$empty2, _emptyView$xref, _emptyView; 28944 const repeaterView = unit.job.allocateView(unit.xref); 28945 // We copy TemplateDefinitionBuilder's scheme of creating names for `$count` and `$index` 28946 // that are suffixed with special information, to disambiguate which level of nested loop 28947 // the below aliases refer to. 28948 // TODO: We should refactor Template Pipeline's variable phases to gracefully handle 28949 // shadowing, and arbitrarily many levels of variables depending on each other. 28950 const indexName = `ɵ$index_${repeaterView.xref}`; 28951 const countName = `ɵ$count_${repeaterView.xref}`; 28952 const indexVarNames = new Set(); 28953 // Set all the context variables and aliases available in the repeater. 28954 repeaterView.contextVariables.set(forBlock.item.name, forBlock.item.value); 28955 for (const variable of forBlock.contextVariables) { 28956 if (variable.value === '$index') { 28957 indexVarNames.add(variable.name); 28958 } 28959 if (variable.name === '$index') { 28960 repeaterView.contextVariables.set('$index', variable.value).set(indexName, variable.value); 28961 } else if (variable.name === '$count') { 28962 repeaterView.contextVariables.set('$count', variable.value).set(countName, variable.value); 28963 } else { 28964 repeaterView.aliases.add({ 28965 kind: SemanticVariableKind.Alias, 28966 name: null, 28967 identifier: variable.name, 28968 expression: getComputedForLoopVariableExpression(variable, indexName, countName) 28969 }); 28970 } 28971 } 28972 const sourceSpan = convertSourceSpan(forBlock.trackBy.span, forBlock.sourceSpan); 28973 const track = convertAst(forBlock.trackBy, unit.job, sourceSpan); 28974 ingestNodes(repeaterView, forBlock.children); 28975 let emptyView = null; 28976 let emptyTagName = null; 28977 if (forBlock.empty !== null) { 28978 emptyView = unit.job.allocateView(unit.xref); 28979 ingestNodes(emptyView, forBlock.empty.children); 28980 emptyTagName = ingestControlFlowInsertionPoint(unit, emptyView.xref, forBlock.empty); 28981 } 28982 const varNames = { 28983 $index: indexVarNames, 28984 $implicit: forBlock.item.name 28985 }; 28986 if (forBlock.i18n !== undefined && !(forBlock.i18n instanceof BlockPlaceholder)) { 28987 throw Error('AssertionError: Unhandled i18n metadata type or @for'); 28988 } 28989 if (((_forBlock$empty = forBlock.empty) === null || _forBlock$empty === void 0 ? void 0 : _forBlock$empty.i18n) !== undefined && !(forBlock.empty.i18n instanceof BlockPlaceholder)) { 28990 throw Error('AssertionError: Unhandled i18n metadata type or @empty'); 28991 } 28992 const i18nPlaceholder = forBlock.i18n; 28993 const emptyI18nPlaceholder = (_forBlock$empty2 = forBlock.empty) === null || _forBlock$empty2 === void 0 ? void 0 : _forBlock$empty2.i18n; 28994 const tagName = ingestControlFlowInsertionPoint(unit, repeaterView.xref, forBlock); 28995 const repeaterCreate = createRepeaterCreateOp(repeaterView.xref, (_emptyView$xref = (_emptyView = emptyView) === null || _emptyView === void 0 ? void 0 : _emptyView.xref) !== null && _emptyView$xref !== void 0 ? _emptyView$xref : null, tagName, track, varNames, emptyTagName, i18nPlaceholder, emptyI18nPlaceholder, forBlock.startSourceSpan, forBlock.sourceSpan); 28996 unit.create.push(repeaterCreate); 28997 const expression = convertAst(forBlock.expression, unit.job, convertSourceSpan(forBlock.expression.span, forBlock.sourceSpan)); 28998 const repeater = createRepeaterOp(repeaterCreate.xref, repeaterCreate.handle, expression, forBlock.sourceSpan); 28999 unit.update.push(repeater); 29000} 29001/** 29002 * Gets an expression that represents a variable in an `@for` loop. 29003 * @param variable AST representing the variable. 29004 * @param indexName Loop-specific name for `$index`. 29005 * @param countName Loop-specific name for `$count`. 29006 */ 29007function getComputedForLoopVariableExpression(variable, indexName, countName) { 29008 switch (variable.value) { 29009 case '$index': 29010 return new LexicalReadExpr(indexName); 29011 case '$count': 29012 return new LexicalReadExpr(countName); 29013 case '$first': 29014 return new LexicalReadExpr(indexName).identical(literal(0)); 29015 case '$last': 29016 return new LexicalReadExpr(indexName).identical(new LexicalReadExpr(countName).minus(literal(1))); 29017 case '$even': 29018 return new LexicalReadExpr(indexName).modulo(literal(2)).identical(literal(0)); 29019 case '$odd': 29020 return new LexicalReadExpr(indexName).modulo(literal(2)).notIdentical(literal(0)); 29021 default: 29022 throw new Error(`AssertionError: unknown @for loop variable ${variable.value}`); 29023 } 29024} 29025function ingestLetDeclaration(unit, node) { 29026 const target = unit.job.allocateXrefId(); 29027 unit.create.push(createDeclareLetOp(target, node.name, node.sourceSpan)); 29028 unit.update.push(createStoreLetOp(target, node.name, convertAst(node.value, unit.job, node.valueSpan), node.sourceSpan)); 29029} 29030/** 29031 * Convert a template AST expression into an output AST expression. 29032 */ 29033function convertAst(ast, job, baseSourceSpan) { 29034 if (ast instanceof ASTWithSource) { 29035 return convertAst(ast.ast, job, baseSourceSpan); 29036 } else if (ast instanceof PropertyRead) { 29037 // Whether this is an implicit receiver, *excluding* explicit reads of `this`. 29038 const isImplicitReceiver = ast.receiver instanceof ImplicitReceiver && !(ast.receiver instanceof ThisReceiver); 29039 if (isImplicitReceiver) { 29040 return new LexicalReadExpr(ast.name); 29041 } else { 29042 return new ReadPropExpr(convertAst(ast.receiver, job, baseSourceSpan), ast.name, null, convertSourceSpan(ast.span, baseSourceSpan)); 29043 } 29044 } else if (ast instanceof PropertyWrite) { 29045 if (ast.receiver instanceof ImplicitReceiver) { 29046 return new WritePropExpr( 29047 // TODO: Is it correct to always use the root context in place of the implicit receiver? 29048 new ContextExpr(job.root.xref), ast.name, convertAst(ast.value, job, baseSourceSpan), null, convertSourceSpan(ast.span, baseSourceSpan)); 29049 } 29050 return new WritePropExpr(convertAst(ast.receiver, job, baseSourceSpan), ast.name, convertAst(ast.value, job, baseSourceSpan), undefined, c
29050onvertSourceSpan(ast.span, baseSourceSpan)); 29051 } else if (ast instanceof KeyedWrite) { 29052 return new WriteKeyExpr(convertAst(ast.receiver, job, baseSourceSpan), convertAst(ast.key, job, baseSourceSpan), convertAst(ast.value, job, baseSourceSpan), undefined, convertSourceSpan(ast.span, baseSourceSpan)); 29053 } else if (ast instanceof Call) { 29054 if (ast.receiver instanceof ImplicitReceiver) { 29055 throw new Error(`Unexpected ImplicitReceiver`); 29056 } else { 29057 return new InvokeFunctionExpr(convertAst(ast.receiver, job, baseSourceSpan), ast.args.map(arg => convertAst(arg, job, baseSourceSpan)), undefined, convertSourceSpan(ast.span, baseSourceSpan)); 29058 } 29059 } else if (ast instanceof LiteralPrimitive) { 29060 return literal(ast.value, undefined, convertSourceSpan(ast.span, baseSourceSpan)); 29061 } else if (ast instanceof Unary) { 29062 switch (ast.operator) { 29063 case '+': 29064 return new UnaryOperatorExpr(UnaryOperator.Plus, convertAst(ast.expr, job, baseSourceSpan), undefined, convertSourceSpan(ast.span, baseSourceSpan)); 29065 case '-': 29066 return new UnaryOperatorExpr(UnaryOperator.Minus, convertAst(ast.expr, job, baseSourceSpan), undefined, convertSourceSpan(ast.span, baseSourceSpan)); 29067 default: 29068 throw new Error(`AssertionError: unknown unary operator ${ast.operator}`); 29069 } 29070 } else if (ast instanceof Binary) { 29071 const operator = BINARY_OPERATORS.get(ast.operation); 29072 if (operator === undefined) { 29073 throw new Error(`AssertionError: unknown binary operator ${ast.operation}`); 29074 } 29075 return new BinaryOperatorExpr(operator, convertAst(ast.left, job, baseSourceSpan), convertAst(ast.right, job, baseSourceSpan), undefined, convertSourceSpan(ast.span, baseSourceSpan)); 29076 } else if (ast instanceof ThisReceiver) { 29077 // TODO: should context expressions have source maps? 29078 return new ContextExpr(job.root.xref); 29079 } else if (ast instanceof KeyedRead) { 29080 return new ReadKeyExpr(convertAst(ast.receiver, job, baseSourceSpan), convertAst(ast.key, job, baseSourceSpan), undefined, convertSourceSpan(ast.span, baseSourceSpan)); 29081 } else if (ast instanceof Chain) { 29082 throw new Error(`AssertionError: Chain in unknown context`); 29083 } else if (ast instanceof LiteralMap) { 29084 const entries = ast.keys.map((key, idx) => { 29085 const value = ast.values[idx]; 29086 // TODO: should literals have source maps, or do we just map the whole surrounding 29087 // expression? 29088 return new LiteralMapEntry(key.key, convertAst(value, job, baseSourceSpan), key.quoted); 29089 }); 29090 return new LiteralMapExpr(entries, undefined, convertSourceSpan(ast.span, baseSourceSpan)); 29091 } else if (ast instanceof LiteralArray) { 29092 // TODO: should literals have source maps, or do we just map the whole surrounding expression? 29093 return new LiteralArrayExpr(ast.expressions.map(expr => convertAst(expr, job, baseSourceSpan))); 29094 } else if (ast instanceof Conditional) { 29095 return new ConditionalExpr(convertAst(ast.condition, job, baseSourceSpan), convertAst(ast.trueExp, job, baseSourceSpan), convertAst(ast.falseExp, job, baseSourceSpan), undefined, convertSourceSpan(ast.span, baseSourceSpan)); 29096 } else if (ast instanceof NonNullAssert) { 29097 // A non-null assertion shouldn't impact generated instructions, so we can just drop it. 29098 return convertAst(ast.expression, job, baseSourceSpan); 29099 } else if (ast instanceof BindingPipe) { 29100 // TODO: pipes should probably have source maps; figure out details. 29101 return new PipeBindingExpr(job.allocateXrefId(), new SlotHandle(), ast.name, [convertAst(ast.exp, job, baseSourceSpan), ...ast.args.map(arg => convertAst(arg, job, baseSourceSpan))]); 29102 } else if (ast instanceof SafeKeyedRead) { 29103 return new SafeKeyedReadExpr(convertAst(ast.receiver, job, baseSourceSpan), convertAst(ast.key, job, baseSourceSpan), convertSourceSpan(ast.span, baseSourceSpan)); 29104 } else if (ast instanceof SafePropertyRead) { 29105 // TODO: source span 29106 return new SafePropertyReadExpr(convertAst(ast.receiver, job, baseSourceSpan), ast.name); 29107 } else if (ast instanceof SafeCall) { 29108 // TODO: source span 29109 return new SafeInvokeFunctionExpr(convertAst(ast.receiver, job, baseSourceSpan), ast.args.map(a => convertAst(a, job, baseSourceSpan))); 29110 } else if (ast instanceof EmptyExpr$1) { 29111 return new EmptyExpr(convertSourceSpan(ast.span, baseSourceSpan)); 29112 } else if (ast instanceof PrefixNot) { 29113 return not(convertAst(ast.expression, job, baseSourceSpan), convertSourceSpan(ast.span, baseSourceSpan)); 29114 } else if (ast instanceof TypeofExpression) { 29115 return typeofExpr(convertAst(ast.expression, job, baseSourceSpan)); 29116 } else if (ast instanceof TemplateLiteral) { 29117 return new TemplateLiteralExpr(ast.elements.map(el => { 29118 return new TemplateLiteralElementExpr(el.text, convertSourceSpan(el.
29118span, baseSourceSpan)); 29119 }), ast.expressions.map(expr => convertAst(expr, job, baseSourceSpan)), convertSourceSpan(ast.span, baseSourceSpan)); 29120 } else { 29121 throw new Error(`Unhandled expression type "${ast.constructor.name}" in file "${baseSourceSpan === null || baseSourceSpan === void 0 ? void 0 : baseSourceSpan.start.file.url}"`); 29122 } 29123} 29124function convertAstWithInterpolation(job, value, i18nMeta, sourceSpan) { 29125 let expression; 29126 if (value instanceof Interpolation$1) { 29127 var _asMessage$placeholde, _asMessage; 29128 expression = new Interpolation(value.strings, value.expressions.map(e => convertAst(e, job, null)), Object.keys((_asMessage$placeholde = (_asMessage = asMessage(i18nMeta)) === null || _asMessage === void 0 ? void 0 : _asMessage.placeholders) !== null && _asMessage$placeholde !== void 0 ? _asMessage$placeholde : {})); 29129 } else if (value instanceof AST) { 29130 expression = convertAst(value, job, null); 29131 } else { 29132 expression = literal(value); 29133 } 29134 return expression; 29135} 29136// TODO: Can we populate Template binding kinds in ingest? 29137const BINDING_KINDS = new Map([[BindingType.Property, BindingKind.Property], [BindingType.TwoWay, BindingKind.TwoWayProperty], [BindingType.Attribute, BindingKind.Attribute], [BindingType.Class, BindingKind.ClassName], [BindingType.Style, BindingKind.StyleProperty], [BindingType.Animation, BindingKind.Animation]]); 29138/** 29139 * Checks whether the given template is a plain ng-template (as opposed to another kind of template 29140 * such as a structural directive template or control flow template). This is checked based on the 29141 * tagName. We can expect that only plain ng-templates will come through with a tagName of 29142 * 'ng-template'. 29143 * 29144 * Here are some of the cases we expect: 29145 * 29146 * | Angular HTML | Template tagName | 29147 * | ---------------------------------- | ------------------ | 29148 * | `<ng-template>` | 'ng-template' | 29149 * | `<div *ngIf="true">` | 'div' | 29150 * | `<svg><ng-template>` | 'svg:ng-template' | 29151 * | `@if (true) {` | 'Conditional' | 29152 * | `<ng-template *ngIf>` (plain) | 'ng-template' | 29153 * | `<ng-template *ngIf>` (structural) | null | 29154 */ 29155function isPlainTemplate(tmpl) { 29156 var _tmpl$tagName; 29157 return splitNsName((_tmpl$tagName = tmpl.tagName) !== null && _tmpl$tagName !== void 0 ? _tmpl$tagName : '')[1] === NG_TEMPLATE_TAG_NAME; 29158} 29159/** 29160 * Ensures that the i18nMeta, if provided, is an i18n.Message. 29161 */ 29162function asMessage(i18nMeta) { 29163 if (i18nMeta == null) { 29164 return null; 29165 } 29166 if (!(i18nMeta instanceof Message)) { 29167 throw Error(`Expected i18n meta to be a Message, but got: ${i18nMeta.constructor.name}`); 29168 } 29169 return i18nMeta; 29170} 29171/** 29172 * Process all of the bindings on an element in the template AST and convert them to their IR 29173 * representation. 29174 */ 29175function ingestElementBindings(unit, op, element) { 29176 let bindings = new Array(); 29177 let i18nAttributeBindingNames = new Set(); 29178 for (const attr of element.attributes) { 29179 // Attribute literal bindings, such as `attr.foo="bar"`. 29180 const securityContext = domSchema.securityContext(element.name, attr.name, true); 29181 bindings.push(createBindingOp(op.xref, BindingKind.Attribute, attr.name, convertAstWithInterpolation(unit.job, attr.value, attr.i18n), null, securityContext, true, false, null, asMessage(attr.i18n), attr.sourceSpan)); 29182 if (attr.i18n) { 29183 i18nAttributeBindingNames.add(attr.name); 29184 } 29185 } 29186 for (const input of element.inputs) { 29187 var _asMessage2; 29188 if (i18nAttributeBindingNames.has(input.name)) { 29189 console.error(`On component ${unit.job.componentName}, the binding ${input.name} is both an i18n attribute and a property. You may want to remove the property binding. This will become a compilation error in future versions of Angular.`); 29190 } 29191 // All dynamic bindings (both attribute and property bindings). 29192 bindings.push(createBindingOp(op.xref, BINDING_KINDS.get(input.type), input.name, convertAstWithInterpolation(unit.job, astOf(input.value), input.i18n), input.unit, input.securityContext, false, false, null, (_asMessage2 = asMessage(input.i18n)) !== null && _asMessage2 !== void 0 ? _asMessage2 : null, input.sourceSpan)); 29193 } 29194 unit.create.push(bindings.filter(b => (b === null || b === void 0 ? void 0 : b.kind) === OpKind.ExtractedAttribute)); 29195 unit.update.push(bindings.filter(b => (b === null || b === void 0 ? void 0 : b.kind) === OpKind.Binding)); 29196 for (const output of element.outputs) { 29197 if (output.type === ParsedEventType.Animation && output.phase === null) { 29198 throw Error('Animation listener should have a phase'); 29199 } 29200 if (output.type === ParsedEventType.TwoWay) { 29201 unit.create.push(createTwoWayListenerOp(op.xref, op.handle, output.name, op.tag, makeTwoWayListenerHandlerOps(unit, output.handler, output.handlerSpan), output.sourceSpan)); 29202 } else { 29203 unit.create.push(createListenerOp(op.xref, op.handle, output.name, op.tag, makeListenerHandlerOps(unit, output.handler, output.handlerSpan), output.phase, output.target, false, output.sourceSpan)); 29204 } 29205 } 29206 // If any of the bindings on this element have an i18n message, then an i18n attrs configuration 29207 // op is also required. 29208 if (bindings.some(b => b === null || b === void 0 ? void 0 : b.i18nMessage) !== null) { 29209 unit.create.push(createI18nAttributesOp(unit.job.allocateXrefId(), new SlotHandle(), op.xref)); 29210 } 29211} 29212/** 29213 * Process all of the bindings on a template in the template AST and convert them to their IR 29214 * representation. 29215 */ 29216function ingestTemplateBindings(unit, op, template, templateKind) { 29217 let bindings = new Array(); 29218 for (const attr of template.templateAttrs) { 29219 if (attr instanceof TextAttribute) { 29220 const securityContext = domSchema.securityContext(NG_TEMPLATE_TAG_NAME, attr.name, true); 29221 bindings.push(createTemplateBinding(unit, op.xref, BindingType.Attribute, attr.name, attr.value, null, securityContext, true, templateKind, asMessage(attr.i18n), attr.sourceSpan)); 29222 } else { 29223 bindings.push(createTemplateBinding(unit, op.xref, attr.type, attr.name, astOf(attr.value), attr.unit, attr.securityContext, true, templateKind, asMessage(attr.i18n), attr.sourceSpan)); 29224 } 29225 } 29226 for (const attr of template.attributes) { 29227 // Attribute literal bindings, such as `attr.foo="bar"`. 29228 const securityContext = domSchema.securityContext(NG_TEMPLATE_TAG_NAME, attr.name, true); 29229 bindings.push(createTemplateBinding(unit, op.xref, BindingType.Attribute, attr.name, attr.value, null, securityContext, false, templateKind, asMessage(attr.i18n), attr.sourceSpan)); 29230 } 29231 for (const input of template.inputs) { 29232 // Dynamic bindings (both attribute and property bindings). 29233 bindings.push(createTemplateBinding(unit, op.xref, input.type, input.name, astOf(input.value), input.unit, input.securityContext, false, templateKind, asMessage(input.i18n), input.sourceSpan)); 29234 } 29235 unit.create.push(bindings.filter(b => (b === null || b === void 0 ? void 0 : b.kind) === OpKind.ExtractedAttribute)); 29236 unit.update.push(bindings.filter(b => (b === null || b === void 0 ? void 0 : b.kind) === OpKind.Binding)); 29237 for (const output of template.outputs) { 29238 if (output.type === ParsedEventType.Animation && output.phase === null) { 29239 throw Error('Animation listener should have a phase'); 29240 } 29241 if (templateKind === TemplateKind.NgTemplate) { 29242 if (output.type === ParsedEventType.TwoWay) { 29243 unit.create.push(createTwoWayListenerOp(op.xref, op.handle, output.name, op.tag, makeTwoWayListenerHandlerOps(unit, output.handler, output.handlerSpan), output.sourceSpan)); 29244 } else { 29245 unit.create.push(createListenerOp(op.xref, op.handle, output.name, op.tag, makeListenerHandlerOps(unit, output.handler, output.handlerSpan), output.phase, output.target, false, output.sourceSpan)); 29246 } 29247 } 29248 if (templateKind === TemplateKind.Structural && output.type !== ParsedEventType.Animation) { 29249 // Animation bindings are excluded from the structural template's const array. 29250 const securityContext = domSchema.securityContext(NG_TEMPLATE_TAG_NAME, output.name, false); 29251 unit.create.push(createExtractedAttributeOp(op.xref, BindingKind.Property, null, output.name, null, null, null, securityContext)); 29252 } 29253 }
29254 // TODO: Perhaps we could do this in a phase? (It likely wouldn't change the slot indices.) 29255 if (bindings.some(b => b === null || b === void 0 ? void 0 : b.i18nMessage) !== null) { 29256 unit.create.push(createI18nAttributesOp(unit.job.allocateXrefId(), new SlotHandle(), op.xref)); 29257 } 29258} 29259/** 29260 * Helper to ingest an individual binding on a template, either an explicit `ng-template`, or an 29261 * implicit template created via structural directive. 29262 * 29263 * Bindings on templates are *extremely* tricky. I have tried to isolate all of the confusing edge 29264 * cases into this function, and to comment it well to document the behavior. 29265 * 29266 * Some of this behavior is intuitively incorrect, and we should consider changing it in the future. 29267 * 29268 * @param view The compilation unit for the view containing the template. 29269 * @param xref The xref of the template op. 29270 * @param type The binding type, according to the parser. This is fairly reasonable, e.g. both 29271 * dynamic and static attributes have e.BindingType.Attribute. 29272 * @param name The binding's name. 29273 * @param value The bindings's value, which will either be an input AST expression, or a string 29274 * literal. Note that the input AST expression may or may not be const -- it will only be a 29275 * string literal if the parser considered it a text binding. 29276 * @param unit If the binding has a unit (e.g. `px` for style bindings), then this is the unit. 29277 * @param securityContext The security context of the binding. 29278 * @param isStructuralTemplateAttribute Whether this binding actually applies to the structural 29279 * ng-template. For example, an `ngFor` would actually apply to the structural template. (Most 29280 * bindings on structural elements target the inner element, not the template.) 29281 * @param templateKind Whether this is an explicit `ng-template` or an implicit template created by 29282 * a structural directive. This should never be a block template. 29283 * @param i18nMessage The i18n metadata for the binding, if any. 29284 * @param sourceSpan The source span of the binding. 29285 * @returns An IR binding op, or null if the binding should be skipped. 29286 */ 29287function createTemplateBinding(view, xref, type, name, value, unit, securityContext, isStructuralTemplateAttribute, templateKind, i18nMessage, sourceSpan) { 29288 const isTextBinding = typeof value === 'string'; 29289 // If this is a structural template, then several kinds of bindings should not result in an 29290 // update instruction. 29291 if (templateKind === TemplateKind.Structural) { 29292 if (!isStructuralTemplateAttribute) { 29293 switch (type) { 29294 case BindingType.Property: 29295 case BindingType.Class: 29296 case BindingType.Style: 29297 // Because this binding doesn't really target the ng-template, it must be a binding on an 29298 // inner node of a structural template. We can't skip it entirely, because we still need 29299 // it on the ng-template's consts (e.g. for the purposes of directive matching). However, 29300 // we should not generate an update instruction for it. 29301 return createExtractedAttributeOp(xref, BindingKind.Property, null, name, null, null, i18nMessage, securityContext); 29302 case BindingType.TwoWay: 29303 return createExtractedAttributeOp(xref, BindingKind.TwoWayProperty, null, name, null, null, i18nMessage, securityContext); 29304 } 29305 } 29306 if (!isTextBinding && (type === BindingType.Attribute || type === BindingType.Animation)) { 29307 // Again, this binding doesn't really target the ng-template; it actually targets the element 29308 // inside the structural template. In the case of non-text attribute or animation bindings, 29309 // the binding doesn't even show up on the ng-template const array, so we just skip it 29310 // entirely. 29311 return null; 29312 } 29313 } 29314 let bindingType = BINDING_KINDS.get(type); 29315 if (templateKind === TemplateKind.NgTemplate) { 29316 // We know we are dealing with bindings directly on an explicit ng-template. 29317 // Static attribute bindings should be collected into the const array as k/v pairs. Property 29318 // bindings should result in a `property` instruction, and `AttributeMarker.Bindings` const 29319 // entries. 29320 // 29321 // The difficulty is with dynamic attribute, style, and class bindings. These don't really make 29322 // sense on an `ng-template` and should probably be parser errors. However, 29323 // TemplateDefinitionBuilder generates `property` instructions for them, and so we do that as 29324 // well. 29325 // 29326 // Note that we do have a slight behavior difference with TemplateDefinitionBuilder: although 29327 // TDB emits `property` instructions for dynamic attributes, styles, and classes, only styles 29328 // and classes also get const collected into the `AttributeMarker.Bindings` field. Dynamic 29329 // attribute bindings are missing from the consts entirely. We choose to emit them into the 29330 // consts field anyway, to avoid creating special cases for something so arcane and nonsensical. 29331 if (type === BindingType.Class || type === BindingType.Style || type === BindingType.Attribute && !isTextBinding) { 29332 // TODO: These cases should be parse errors. 29333 bindingType = BindingKind.Property; 29334 } 29335 } 29336 return createBindingOp(xref, bindingType, name, convertAstWithInterpolation(view.job, value, i18nMessage), unit, securityContext, isTextBinding, isStru
29336cturalTemplateAttribute, templateKind, i18nMessage, sourceSpan); 29337} 29338function makeListenerHandlerOps(unit, handler, handlerSpan) { 29339 handler = astOf(handler); 29340 const handlerOps = new Array(); 29341 let handlerExprs = handler instanceof Chain ? handler.expressions : [handler]; 29342 if (handlerExprs.length === 0) { 29343 throw new Error('Expected listener to have non-empty expression list.'); 29344 } 29345 const expressions = handlerExprs.map(expr => convertAst(expr, unit.job, handlerSpan)); 29346 const returnExpr = expressions.pop(); 29347 handlerOps.push(...expressions.map(e => createStatementOp(new ExpressionStatement(e, e.sourceSpan)))); 29348 handlerOps.push(createStatementOp(new ReturnStatement(returnExpr, returnExpr.sourceSpan))); 29349 return handlerOps; 29350} 29351function makeTwoWayListenerHandlerOps(unit, handler, handlerSpan) { 29352 handler = astOf(handler); 29353 const handlerOps = new Array(); 29354 if (handler instanceof Chain) { 29355 if (handler.expressions.length === 1) { 29356 handler = handler.expressions[0]; 29357 } else { 29358 // This is validated during parsing already, but we do it here just in case. 29359 throw new Error('Expected two-way listener to have a single expression.'); 29360 } 29361 } 29362 const handlerExpr = convertAst(handler, unit.job, handlerSpan); 29363 const eventReference = new LexicalReadExpr('$event'); 29364 const twoWaySetExpr = new TwoWayBindingSetExpr(handlerExpr, eventReference); 29365 handlerOps.push(createStatementOp(new ExpressionStatement(twoWaySetExpr)));
29366 handlerOps.push(createStatementOp(new ReturnStatement(eventReference))); 29367 return handlerOps; 29368} 29369function astOf(ast) { 29370 return ast instanceof ASTWithSource ? ast.ast : ast; 29371} 29372/** 29373 * Process all of the local references on an element-like structure in the template AST and 29374 * convert them to their IR representation. 29375 */ 29376function ingestReferences(op, element) { 29377 assertIsArray(op.localRefs); 29378 for (const { 29379 name, 29380 value 29381 } of element.references) { 29382 op.localRefs.push({ 29383 name, 29384 target: value 29385 }); 29386 } 29387} 29388/** 29389 * Assert that the given value is an array. 29390 */ 29391function assertIsArray(value) { 29392 if (!Array.isArray(value)) { 29393 throw new Error(`AssertionError: expected an array`); 29394 } 29395} 29396/** 29397 * Creates an absolute `ParseSourceSpan` from the relative `ParseSpan`. 29398 * 29399 * `ParseSpan` objects are relative to the start of the expression. 29400 * This method converts these to full `ParseSourceSpan` objects that 29401 * show where the span is within the overall source file. 29402 * 29403 * @param span the relative span to convert. 29404 * @param baseSourceSpan a span corresponding to the base of the expression tree. 29405 * @returns a `ParseSourceSpan` for the given span or null if no `baseSourceSpan` was provided. 29406 */ 29407function convertSourceSpan(span, baseSourceSpan) { 29408 if (baseSourceSpan === null) { 29409 return null; 29410 } 29411 const start = baseSourceSpan.start.moveBy(span.start); 29412 const end = baseSourceSpan.start.moveBy(span.end); 29413 const fullStart = baseSourceSpan.fullStart.moveBy(span.start); 29414 return new ParseSourceSpan(start, end, fullStart); 29415} 29416/** 29417 * With the directive-based control flow users were able to conditionally project content using 29418 * the `*` syntax. E.g. `<div *ngIf="expr" projectMe></div>` will be projected into 29419 * `<ng-content select="[projectMe]"/>`, because the attributes and tag name from the `div` are 29420 * copied to the template via the template creation instruction. With `@if` and `@for` that is 29421 * not the case, because the conditional is placed *around* elements, rather than *on* them. 29422 * The result is that content projection won't work in the same way if a user converts from 29423 * `*ngIf` to `@if`. 29424 * 29425 * This function aims to cover the most common case by doing the same copying when a control flow 29426 * node has *one and only one* root element or template node. 29427 * 29428 * This approach comes with some caveats: 29429 * 1. As soon as any other node is added to the root, the copying behavior won't work anymore. 29430 * A diagnostic will be added to flag cases like this and to explain how to work around it. 29431 * 2. If `preserveWhitespaces` is enabled, it's very likely that indentation will break this 29432 * workaround, because it'll include an additional text node as the first child. We can work 29433 * around it here, but in a discussion it was decided not to, because the user explicitly opted 29434 * into preserving the whitespace and we would have to drop it from the generated code. 29435 * The diagnostic mentioned point in #1 will flag such cases to users. 29436 * 29437 * @returns Tag name to be used for the control flow template. 29438 */ 29439function ingestControlFlowInsertionPoint(unit, xref, node) { 29440 let root = null; 29441 for (const child of node.children) { 29442 // Skip over comment nodes and @let declarations since 29443 // it doesn't matter where they end up in the DOM. 29444 if (child instanceof Comment$1 || child instanceof LetDeclaration$1) { 29445 continue; 29446 } 29447 // We can only infer the tag name/attributes if there's a single root node. 29448 if (root !== null) { 29449 return null; 29450 } 29451 // Root nodes can only elements or templates with a tag name (e.g. `<div *foo></div>`). 29452 if (child instanceof Element$1 || child instanceof Template && child.tagName !== null) { 29453 root = child; 29454 } else { 29455 return null; 29456 } 29457 } 29458 // If we've found a single root node, its tag name and attributes can be 29459 // copied to the surrounding template to be used for content projection. 29460 if (root !== null) { 29461 // Collect the static attributes for content projection purposes. 29462 for (const attr of root.attributes) { 29463 const securityContext = domSchema.securityContext(NG_TEMPLATE_TAG_NAME, attr.name, true); 29464 unit.update.push(createBindingOp(xref, BindingKind.Attribute, attr.name, literal(attr.value), null, securityContext, true, false, null, asMessage(attr.i18n), attr.sourceSpan)); 29465 } 29466 // Also collect the inputs since they participate in content projection as well. 29467 // Note that TDB used to collect the outputs as well, but it wasn't passing them into 29468 // the template instruction. Here we just don't collect them. 29469 for (const attr of root.inputs) { 29470 if (attr.type !== BindingType.Animation && attr.type !== BindingType.Attribute) { 29471 const securityContext = domSchema.securityContext(NG_TEMPLATE_TAG_NAME, attr.name, true); 29472 unit.create.push(createExtractedAttributeOp(xref, BindingKind.Property, null, attr.name, null, null, null, securityContext)); 29473 } 29474 } 29475 const tagName = root instanceof Element$1 ? root.name : root.tagName; 29476 // Don't pass along `ng-template` tag name since it enables directive matching. 29477 return tagName === NG_TEMPLATE_TAG_NAME ? null : tagName; 29478 } 29479 return null; 29480} 29481 29482/*! 29483 * @license 29484 * Copyright Google LLC All Rights Reserved. 29485 * 29486 * Use of this source code is governed by an MIT-style license that can be
29487 * found in the LICENSE file at https://angular.dev/license 29488 */ 29489/** 29490 * Whether to produce instructions that will attach the source location to each DOM node. 29491 * 29492 * !!!Important!!! at the time of writing this flag isn't exposed externally, but internal debug 29493 * tools enable it via a local change. Any modifications to this flag need to update the 29494 * internal tooling as well. 29495 */ 29496let ENABLE_TEMPLATE_SOURCE_LOCATIONS = false; 29497/** 29498 * Utility function to enable source locations. Intended to be used **only** inside unit tests. 29499 */ 29500function setEnableTemplateSourceLocations(value) { 29501 ENABLE_TEMPLATE_SOURCE_LOCATIONS = value; 29502} 29503/** Gets whether template source locations are enabled. */ 29504function getTemplateSourceLocationsEnabled() { 29505 return ENABLE_TEMPLATE_SOURCE_LOCATIONS; 29506} 29507 29508// if (rf & flags) { .. } 29509function renderFlagCheckIfStmt(flags, statements) { 29510 return ifStmt(variable(RENDER_FLAGS).bitwiseAnd(literal(flags), null, false), statements); 29511} 29512/** 29513 * Translates query flags into `TQueryFlags` type in 29514 * packages/core/src/render3/interfaces/query.ts 29515 * @param query 29516 */ 29517function toQueryFlags(query) { 29518 return (query.descendants ? 1 /* QueryFlags.descendants */ : 0 /* QueryFlags.none */) | (query.static ? 2 /* QueryFlags.isStatic */ : 0 /* QueryFlags.none */) | (query.emitDistinctChangesOnly ? 4 /* QueryFlags.emitDistinctChangesOnly */ : 0 /* QueryFlags.none */); 29519} 29520function getQueryPredicate(query, constantPool) { 29521 if (Array.isArray(query.predicate)) { 29522 let predicate = []; 29523 query.predicate.forEach(selector => { 29524 // Each item in predicates array may contain strings with comma-separated refs 29525 // (for ex. 'ref, ref1, ..., refN'), thus we extract individual refs and store them 29526 // as separate array entities 29527 const selectors = selector.split(',').map(token => literal(token.trim())); 29528 predicate.push(...selectors); 29529 }); 29530 return constantPool.getConstLiteral(literalArr(predicate), true); 29531 } else { 29532 // The original predicate may have been wrapped in a `forwardRef()` call. 29533 switch (query.predicate.forwardRef) { 29534 case 0 /* ForwardRefHandling.None */: 29535 case 2 /* ForwardRefHandling.Unwrapped */: 29536 return query.predicate.expression; 29537 case 1 /* ForwardRefHandling.Wrapped */: 29538 return importExpr(Identifiers.resolveForwardRef).callFn([query.predicate.expression]); 29539 } 29540 } 29541} 29542function createQueryCreateCall(query, constantPool, queryTypeFns, prependParams) { 29543 const parameters = []; 29544 if (prependParams !== undefined) { 29545 parameters.push(...prependParams); 29546 } 29547 if (query.isSignal) { 29548 parameters.push(new ReadPropExpr(variable(CONTEXT_NAME), query.propertyName)); 29549 } 29550 parameters.push(getQueryPredicate(query, constantPool), literal(toQueryFlags(query))); 29551 if (query.read) { 29552 parameters.push(query.read); 29553 } 29554 const queryCreateFn = query.isSignal ? queryTypeFns.signalBased : queryTypeFns.nonSignal; 29555 return importExpr(queryCreateFn).callFn(parameters); 29556} 29557const queryAdvancePlaceholder = Symbol('queryAdvancePlaceholder'); 29558/** 29559 * Collapses query advance placeholders in a list of statements. 29560 * 29561 * This allows for less generated code because multiple sibling query advance 29562 * statements can be collapsed into a single call with the count as argument. 29563 * 29564 * e.g. 29565 * 29566 * ```ts 29567 * bla(); 29568 * queryAdvance(); 29569 * queryAdvance(); 29570 * bla(); 29571 * ``` 29572 * 29573 * --> will turn into 29574 * 29575 * ```ts 29576 * bla(); 29577 * queryAdvance(2); 29578 * bla(); 29579 * ``` 29580 */ 29581function collapseAdvanceStatements(statements) { 29582 const result = []; 29583 let advanceCollapseCount = 0; 29584 const flushAdvanceCount = () => { 29585 if (advanceCollapseCount > 0) { 29586 result.unshift(importExpr(Identifiers.queryAdvance).callFn(advanceCollapseCount === 1 ? [] : [literal(advanceCollapseCount)]).toStmt()); 29587 advanceCollapseCount = 0; 29588 } 29589 }; 29590 // Iterate through statements in reverse and collapse advance placeholders. 29591 for (let i = statements.length - 1; i >= 0; i--) { 29592 const st = statements[i]; 29593 if (st === queryAdvancePlaceholder) { 29594 advanceCollapseCount++; 29595 } else { 29596 flushAdvanceCount(); 29597 result.unshift(st); 29598 } 29599 } 29600 flushAdvanceCount(); 29601 return result; 29602} 29603// Define and update any view queries 29604function createViewQueriesFunction(viewQueries, constantPool, name) { 29605 const createStatements = []; 29606 const updateStatements = []; 29607 const tempAllocator = temporaryAllocator(st => updateStatements.push(st), TEMPORARY_NAME);
29608 viewQueries.forEach(query => { 29609 // creation call, e.g. r3.viewQuery(somePredicate, true) or 29610 // r3.viewQuerySignal(ctx.prop, somePredicate, true); 29611 const queryDefinitionCall = createQueryCreateCall(query, constantPool, { 29612 signalBased: Identifiers.viewQuerySignal, 29613 nonSignal: Identifiers.viewQuery 29614 }); 29615 createStatements.push(queryDefinitionCall.toStmt()); 29616 // Signal queries update lazily and we just advance the index. 29617 if (query.isSignal) { 29618 updateStatements.push(queryAdvancePlaceholder); 29619 return; 29620 } 29621 // update, e.g. (r3.queryRefresh(tmp = r3.loadQuery()) && (ctx.someDir = tmp)); 29622 const temporary = tempAllocator(); 29623 const getQueryList = importExpr(Identifiers.loadQuery).callFn([]); 29624 const refresh = importExpr(Identifiers.queryRefresh).callFn([temporary.set(getQueryList)]); 29625 const updateDirective = variable(CONTEXT_NAME).prop(query.propertyName).set(query.first ? temporary.prop('first') : temporary); 29626 updateStatements.push(refresh.and(updateDirective).toStmt()); 29627 }); 29628 const viewQueryFnName = name ? `${name}_Query` : null; 29629 return fn([new FnParam(RENDER_FLAGS, NUMBER_TYPE), new FnParam(CONTEXT_NAME, null)], [renderFlagCheckIfStmt(1 /* core.RenderFlags.Create */, createStatements), renderFlagCheckIfStmt(2 /* core.RenderFlags.Update */, collapseAdvanceStatements(updateStatements))], INFERRED_TYPE, null, viewQueryFnName); 29630} 29631// Define and update any content queries 29632function createContentQueriesFunction(queries, constantPool, name) { 29633 const createStatements = []; 29634 const updateStatements = []; 29635 const tempAllocator = temporaryAllocator(st => updateStatements.push(st), TEMPORARY_NAME); 29636 for (const query of queries) { 29637 // creation, e.g. r3.contentQuery(dirIndex, somePredicate, true, null) or 29638 // r3.contentQuerySignal(dirIndex, propName, somePredicate, <flags>, <read>). 29639 createStatements.push(createQueryCreateCall(query, constantPool, { 29640 nonSignal: Identifiers.contentQuery, 29641 signalBased: Identifiers.contentQuerySignal 29642 }, /* prependParams */[variable('dirIndex')]).toStmt()); 29643 // Signal queries update lazily and we just advance the index. 29644 if (query.isSignal) { 29645 updateStatements.push(queryAdvancePlaceholder); 29646 continue; 29647 } 29648 // update, e.g. (r3.queryRefresh(tmp = r3.loadQuery()) && (ctx.someDir = tmp)); 29649 const temporary = tempAllocator(); 29650 const getQueryList = importExpr(Identifiers.loadQuery).callFn([]); 29651 const refresh = importExpr(Identifiers.queryRefresh).callFn([temporary.set(getQueryList)]); 29652 const updateDirective = variable(CONTEXT_NAME).prop(query.propertyName).set(query.first ? temporary.prop('first') : temporary); 29653 updateStatements.push(refresh.and(updateDirective).toStmt()); 29654 } 29655 const contentQueriesFnName = name ? `${name}_ContentQueries` : null; 29656 return fn([new FnParam(RENDER_FLAGS, NUMBER_TYPE), new FnParam(CONTEXT_NAME, null), new FnParam('dirIndex', null)], [renderFlagCheckIfStmt(1 /* core.RenderFlags.Create */, createStatements), renderFlagCheckIfStmt(2 /* core.RenderFlags.Update */, collapseAdvanceStatements(updateStatements))], INFERRED_TYPE, null, contentQueriesFnName); 29657} 29658class HtmlParser extends Parser$1 { 29659 constructor() { 29660 super(getHtmlTagDefinition); 29661 } 29662 parse(source, url, options) { 29663 return super.parse(source, url, options); 29664 } 29665} 29666const PROPERTY_PARTS_SEPARATOR = '.'; 29667const ATTRIBUTE_PREFIX = 'attr'; 29668const CLASS_PREFIX = 'class'; 29669const STYLE_PREFIX = 'style'; 29670const TEMPLATE_ATTR_PREFIX$1 = '*'; 29671const ANIMATE_PROP_PREFIX = 'animate-'; 29672/** 29673 * Parses bindings in templates and in the directive host area. 29674 */ 29675class BindingParser { 29676 constructor(_exprParser, _interpolationConfig, _schemaRegistry, errors) { 29677 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_exprParser", void 0); 29678 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_interpolationConfig", void 0); 29679 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_schemaRegistry", void 0); 29680 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "errors", void 0); 29681 this._exprParser = _exprParser; 29682 this._interpolationConfig = _interpolationConfig; 29683 this._schemaRegistry = _schemaRegistry; 29684 this.errors = errors; 29685 } 29686 get interpolationConfig() { 29687 return this._interpolationConfig; 29688 } 29689 createBoundHostProperties(properties, sourceSpan) { 29690 const boundProps = [];
29691 for (const propName of Object.keys(properties)) { 29692 const expression = properties[propName]; 29693 if (typeof expression === 'string') { 29694 this.parsePropertyBinding(propName, expression, true, false, sourceSpan, sourceSpan.start.offset, undefined, [], 29695 // Use the `sourceSpan` for `keySpan`. This isn't really accurate, but neither is the 29696 // sourceSpan, as it represents the sourceSpan of the host itself rather than the 29697 // source of the host binding (which doesn't exist in the template). Regardless, 29698 // neither of these values are used in Ivy but are only here to satisfy the function 29699 // signature. This should likely be refactored in the future so that `sourceSpan` 29700 // isn't being used inaccurately. 29701 boundProps, sourceSpan); 29702 } else { 29703 this._reportError(`Value of the host property binding "${propName}" needs to be a string representing an expression but got "${expression}" (${typeof expression})`, sourceSpan); 29704 } 29705 } 29706 return boundProps; 29707 } 29708 createDirectiveHostEventAsts(hostListeners, sourceSpan) { 29709 const targetEvents = []; 29710 for (const propName of Object.keys(hostListeners)) { 29711 const expression = hostListeners[propName]; 29712 if (typeof expression === 'string') { 29713 // Use the `sourceSpan` for `keySpan` and `handlerSpan`. This isn't really accurate, but 29714 // neither is the `sourceSpan`, as it represents the `sourceSpan` of the host itself 29715 // rather than the source of the host binding (which doesn't exist in the template). 29716 // Regardless, neither of these values are used in Ivy but are only here to satisfy the 29717 // function signature. This should likely be refactored in the future so that `sourceSpan` 29718 // isn't being used inaccurately. 29719 this.parseEvent(propName, expression, /* isAssignmentEvent */false, sourceSpan, sourceSpan, [], targetEvents, sourceSpan); 29720 } else { 29721 this._reportError(`Value of the host listener "${propName}" needs to be a string representing an expression but got "${expression}" (${typeof expression})`, sourceSpan); 29722 } 29723 } 29724 return targetEvents; 29725 } 29726 parseInterpolation(value, sourceSpan, interpolatedTokens) { 29727 const sourceInfo = sourceSpan.start.toString(); 29728 const absoluteOffset = sourceSpan.fullStart.offset; 29729 try { 29730 const ast = this._exprParser.parseInterpolation(value, sourceInfo, absoluteOffset, interpolatedTokens, this._interpolationConfig); 29731 if (ast) this._reportExpressionParserErrors(ast.errors, sourceSpan); 29732 return ast; 29733 } catch (e) { 29734 this._reportError(`${e}`, sourceSpan); 29735 return this._exprParser.wrapLiteralPrimitive('ERROR', sourceInfo, absoluteOffset); 29736 } 29737 } 29738 /** 29739 * Similar to `parseInterpolation`, but treats the provided string as a single expression 29740 * element that would normally appear within the interpolation prefix and suffix (`{{` and `}}`). 29741 * This is used for parsing the switch expression in ICUs. 29742 */ 29743 parseInterpolationExpression(expression, sourceSpan) { 29744 const sourceInfo = sourceSpan.start.toString(); 29745 const absoluteOffset = sourceSpan.start.offset; 29746 try { 29747 const ast = this._exprParser.parseInterpolationExpression(expression, sourceInfo, absoluteOffset); 29748 if (ast) this._reportExpressionParserErrors(ast.errors, sourceSpan); 29749 return ast; 29750 } catch (e) { 29751 this._reportError(`${e}`, sourceSpan); 29752 return this._exprParser.wrapLiteralPrimitive('ERROR', sourceInfo, absoluteOffset); 29753 } 29754 } 29755 /** 29756 * Parses the bindings in a microsyntax expression, and converts them to 29757 * `ParsedProperty` or `ParsedVariable`. 29758 * 29759 * @param tplKey template binding name 29760 * @param tplValue template binding value 29761 * @param sourceSpan span of template binding relative to entire the template 29762 * @param absoluteValueOffset start of the tplValue relative to the entire template 29763 * @param targetMatchableAttrs potential attributes to match in the template 29764 * @param targetProps target property bindings in the template 29765 * @param targetVars target variables in the template 29766 */ 29767 parseInlineTemplateBinding(tplKey, tplValue, sourceSpan, absoluteValueOffset, targetMatchableAttrs, targetProps, targetVars, isIvyAst) { 29768 const absoluteKeyOffset = sourceSpan.start.offset + TEMPLATE_ATTR_PREFIX$1.length; 29769 const bindings = this._parseTemplateBindings(tplKey, tplValue, sourceSpan, absoluteKeyOffset, absoluteValueOffset); 29770 for (const binding of bindings) { 29771 // sourceSpan is for the entire HTML attribute. bindingSpan is for a particular 29772 // binding within the microsyntax expression so it's more narrow than sourceSpan. 29773 const bindingSpan = moveParseSourceSpan(sourceSpan, binding.sourceSpan);
29774 const key = binding.key.source; 29775 const keySpan = moveParseSourceSpan(sourceSpan, binding.key.span); 29776 if (binding instanceof VariableBinding) { 29777 const value = binding.value ? binding.value.source : '$implicit'; 29778 const valueSpan = binding.value ? moveParseSourceSpan(sourceSpan, binding.value.span) : undefined; 29779 targetVars.push(new ParsedVariable(key, value, bindingSpan, keySpan, valueSpan)); 29780 } else if (binding.value) { 29781 const srcSpan = isIvyAst ? bindingSpan : sourceSpan; 29782 const valueSpan = moveParseSourceSpan(sourceSpan, binding.value.ast.sourceSpan); 29783 this._parsePropertyAst(key, binding.value, false, srcSpan, keySpan, valueSpan, targetMatchableAttrs, targetProps); 29784 } else { 29785 targetMatchableAttrs.push([key, '' /* value */]); 29786 // Since this is a literal attribute with no RHS, source span should be 29787 // just the key span. 29788 this.parseLiteralAttr(key, null /* value */, keySpan, absoluteValueOffset, undefined /* valueSpan */, targetMatchableAttrs, targetProps, keySpan); 29789 } 29790 } 29791 } 29792 /** 29793 * Parses the bindings in a microsyntax expression, e.g. 29794 * ```html 29795 * <tag *tplKey="let value1 = prop; let value2 = localVar"> 29796 * ``` 29797 * 29798 * @param tplKey template binding name 29799 * @param tplValue template binding value 29800 * @param sourceSpan span of template binding relative to entire the template 29801 * @param absoluteKeyOffset start of the `tplKey` 29802 * @param absoluteValueOffset start of the `tplValue` 29803 */ 29804 _parseTemplateBindings(tplKey, tplValue, sourceSpan, absoluteKeyOffset, absoluteValueOffset) { 29805 const sourceInfo = sourceSpan.start.toString(); 29806 try { 29807 const bindingsResult = this._exprParser.parseTemplateBindings(tplKey, tplValue, sourceInfo, absoluteKeyOffset, absoluteValueOffset); 29808 this._reportExpressionParserErrors(bindingsResult.errors, sourceSpan);
29809 bindingsResult.warnings.forEach(warning => { 29810 this._reportError(warning, sourceSpan, ParseErrorLevel.WARNING); 29811 }); 29812 return bindingsResult.templateBindings; 29813 } catch (e) { 29814 this._reportError(`${e}`, sourceSpan); 29815 return []; 29816 } 29817 } 29818 parseLiteralAttr(name, value, sourceSpan, absoluteOffset, valueSpan, targetMatchableAttrs, targetProps, keySpan) { 29819 if (isAnimationLabel(name)) { 29820 name = name.substring(1); 29821 if (keySpan !== undefined) { 29822 keySpan = moveParseSourceSpan(keySpan, new AbsoluteSourceSpan(keySpan.start.offset + 1, keySpan.end.offset)); 29823 } 29824 if (value) { 29825 this._reportError(`Assigning animation triggers via @prop="exp" attributes with an expression is invalid.` + ` Use property bindings (e.g. [@prop]="exp") or use an attribute without a value (e.g. @prop) instead.`, sourceSpan, ParseErrorLevel.ERROR); 29826 } 29827 this._parseAnimation(name, value, sourceSpan, absoluteOffset, keySpan, valueSpan, targetMatchableAttrs, targetProps); 29828 } else { 29829 targetProps.push(new ParsedProperty(name, this._exprParser.wrapLiteralPrimitive(value, '', absoluteOffset), ParsedPropertyType.LITERAL_ATTR, sourceSpan, keySpan, valueSpan)); 29830 } 29831 } 29832 parsePropertyBinding(name, expression, isHost, isPartOfAssignmentBinding, sourceSpan, absoluteOffset, valueSpan, targetMatchableAttrs, targetProps, keySpan) { 29833 if (name.length === 0) { 29834 this._reportError(`Property name is missing in binding`, sourceSpan); 29835 } 29836 let isAnimationProp = false; 29837 if (name.startsWith(ANIMATE_PROP_PREFIX)) { 29838 isAnimationProp = true; 29839 name = name.substring(ANIMATE_PROP_PREFIX.length); 29840 if (keySpan !== undefined) { 29841 keySpan = moveParseSourceSpan(keySpan, new AbsoluteSourceSpan(keySpan.start.offset + ANIMATE_PROP_PREFIX.length, keySpan.end.offset)); 29842 } 29843 } else if (isAnimationLabel(name)) { 29844 isAnimationProp = true; 29845 name = name.substring(1); 29846 if (keySpan !== undefined) { 29847 keySpan = moveParseSourceSpan(keySpan, new AbsoluteSourceSpan(keySpan.start.offset + 1, keySpan.end.offset)); 29848 } 29849 } 29850 if (isAnimationProp) { 29851 this._parseAnimation(name, expression, sourceSpan, absoluteOffset, keySpan, valueSpan, targetMatchableAttrs, targetProps); 29852 } else { 29853 this._parsePropertyAst(name, this.parseBinding(expression, isHost, valueSpan || sourceSpan, absoluteOffset), isPartOfAssignmentBinding, sourceSpan, keySpan, valueSpan, targetMatchableAttrs, targetProps); 29854 } 29855 } 29856 parsePropertyInterpolation(name, value, sourceSpan, valueSpan, targetMatchableAttrs, targetProps, keySpan, interpolatedTokens) { 29857 const expr = this.parseInterpolation(value, valueSpan || sourceSpan, interpolatedTokens); 29858 if (expr) { 29859 this._parsePropertyAst(name, expr, false, sourceSpan, keySpan, valueSpan, targetMatchableAttrs, targetProps); 29860 return true; 29861 } 29862 return false; 29863 } 29864 _parsePropertyAst(name, ast, isPartOfAssignmentBinding, sourceSpan, keySpan, valueSpan, targetMatchableAttrs, targetProps) { 29865 targetMatchableAttrs.push([name, ast.source]); 29866 targetProps.push(new ParsedProperty(name, ast, isPartOfAssignmentBinding ? ParsedPropertyType.TWO_WAY : ParsedPropertyType.DEFAULT, sourceSpan, keySpan, valueSpan)); 29867 } 29868 _parseAnimation(name, expression, sourceSpan, absoluteOffset, keySpan, valueSpan, targetMatchableAttrs, targetProps) { 29869 if (name.length === 0) { 29870 this._reportError('Animation trigger is missing', sourceSpan); 29871 } 29872 // This will occur when a @trigger is not paired with an expression. 29873 // For animations it is valid to not have an expression since */void 29874 // states will be applied by angular when the element is attached/detached 29875 const ast = this.parseBinding(expression || 'undefined', false, valueSpan || sourceSpan, absoluteOffset); 29876 targetMatchableAttrs.push([name, ast.source]); 29877 targetProps.push(new ParsedProperty(name, ast, ParsedPropertyType.ANIMATION, sourceSpan, keySpan, valueSpan)); 29878 } 29879 parseBinding(value, isHostBinding, sourceSpan, absoluteOffset) { 29880 const sourceInfo = (sourceSpan && sourceSpan.start || '(unknown)').toString(); 29881 try { 29882 const ast = isHostBinding ? this._exprParser.parseSimpleBinding(value, sourceInfo, absoluteOffset, this._interpolationConfig) : this._exprParser.parseBinding(value, sourceInfo, absoluteOffset, this._interpolationConfig); 29883 if (ast) this._reportExpressionParserErrors(ast.errors, sourceSpan); 29884 return ast; 29885 } catch (e) { 29886 this._reportError(`${e}`, sourceSpan); 29887 return this._exprParser.wrapLiteralPrimitive('ERROR', sourceInfo, absoluteOffset); 29888 } 29889 } 29890 createBoundElementProperty(elementSelector, boundProp, skipValidation = false, mapPropertyName = true) { 29891 if (boundProp.isAnimation) { 29892 return new BoundElementProperty(boundProp.name, BindingType.Animation, SecurityContext.NONE, boundProp.expression, null, boundProp.sourceSpan, boundProp.keySpan, boundProp.valueSpan); 29893 } 29894 let unit = null; 29895 let bindingType = undefined; 29896 let boundPropertyName = null; 29897 const parts = boundProp.name.split(PROPERTY_PARTS_SEPARATOR); 29898 let securityContexts = undefined; 29899 // Check for special cases (prefix style, attr, class) 29900 if (parts.length > 1) { 29901 if (parts[0] == ATTRIBUTE_PREFIX) { 29902 boundPropertyName = parts.slice(1).join(PROPERTY_PARTS_SEPARATOR); 29903 if (!skipValidation) {
29904 this._validatePropertyOrAttributeName(boundPropertyName, boundProp.sourceSpan, true); 29905 } 29906 securityContexts = calcPossibleSecurityContexts(this._schemaRegistry, elementSelector, boundPropertyName, true); 29907 const nsSeparatorIdx = boundPropertyName.indexOf(':'); 29908 if (nsSeparatorIdx > -1) { 29909 const ns = boundPropertyName.substring(0, nsSeparatorIdx); 29910 const name = boundPropertyName.substring(nsSeparatorIdx + 1); 29911 boundPropertyName = mergeNsAndName(ns, name); 29912 } 29913 bindingType = BindingType.Attribute; 29914 } else if (parts[0] == CLASS_PREFIX) { 29915 boundPropertyName = parts[1]; 29916 bindingType = BindingType.Class; 29917 securityContexts = [SecurityContext.NONE]; 29918 } else if (parts[0] == STYLE_PREFIX) { 29919 unit = parts.length > 2 ? parts[2] : null; 29920 boundPropertyName = parts[1]; 29921 bindingType = BindingType.Style; 29922 securityContexts = [SecurityContext.STYLE]; 29923 } 29924 } 29925 // If not a special case, use the full property name 29926 if (boundPropertyName === null) { 29927 const mappedPropName = this._schemaRegistry.getMappedPropName(boundProp.name); 29928 boundPropertyName = mapPropertyName ? mappedPropName : boundProp.name; 29929 securityContexts = calcPossibleSecurityContexts(this._schemaRegistry, elementSelector, mappedPropName, false); 29930 bindingType = boundProp.type === ParsedPropertyType.TWO_WAY ? BindingType.TwoWay : BindingType.Property; 29931 if (!skipValidation) { 29932 this._validatePropertyOrAttributeName(mappedPropName, boundProp.sourceSpan, false); 29933 } 29934 } 29935 return new BoundElementProperty(boundPropertyName, bindingType, securityContexts[0], boundProp.expression, unit, boundProp.sourceSpan, boundProp.keySpan, boundProp.valueSpan); 29936 } 29937 // TODO: keySpan should be required but was made optional to avoid changing VE parser. 29938 parseEvent(name, expression, isAssignmentEvent, sourceSpan, handlerSpan, targetMatchableAttrs, targetEvents, keySpan) { 29939 if (name.length === 0) { 29940 this._reportError(`Event name is missing in binding`, sourceSpan); 29941 } 29942 if (isAnimationLabel(name)) { 29943 name = name.slice(1); 29944 if (keySpan !== undefined) { 29945 keySpan = moveParseSourceSpan(keySpan, new AbsoluteSourceSpan(keySpan.start.offset + 1, keySpan.end.offset)); 29946 } 29947 this._parseAnimationEvent(name, expression, sourceSpan, handlerSpan, targetEvents, keySpan); 29948 } else { 29949 this._parseRegularEvent(name, expression, isAssignmentEvent, sourceSpan, handlerSpan, targetMatchableAttrs, targetEvents, keySpan); 29950 } 29951 } 29952 calcPossibleSecurityContexts(selector, propName, isAttribute) { 29953 const prop = this._schemaRegistry.getMappedPropName(propName); 29954 return calcPossibleSecurityContexts(this._schemaRegistry, selector, prop, isAttribute); 29955 } 29956 _parseAnimationEvent(name, expression, sourceSpan, handlerSpan, targetEvents, keySpan) { 29957 const matches = splitAtPeriod(name, [name, '']); 29958 const eventName = matches[0]; 29959 const phase = matches[1].toLowerCase(); 29960 const ast = this._parseAction(expression, handlerSpan); 29961 targetEvents.push(new ParsedEvent(eventName, phase, ParsedEventType.Animation, ast, sourceSpan, handlerSpan, keySpan)); 29962 if (eventName.length === 0) { 29963 this._reportError(`Animation event name is missing in binding`, sourceSpan); 29964 } 29965 if (phase) { 29966 if (phase !== 'start' && phase !== 'done') { 29967 this._reportError(`The provided animation output phase value "${phase}" for "@${eventName}" is not supported (use start or done)`, sourceSpan); 29968 } 29969 } else { 29970 this._reportError(`The animation trigger output event (@${eventName}) is missing its phase value name (start or done are currently supported)`, sourceSpan); 29971 } 29972 } 29973 _parseRegularEvent(name, expression, isAssignmentEvent, sourceSpan, handlerSpan, targetMatchableAttrs, targetEvents, keySpan) { 29974 // long format: 'target: eventName' 29975 const [target, eventName] = splitAtColon(name, [null, name]); 29976 const prevErrorCount = this.errors.length; 29977 const ast = this._parseAction(expression, handlerSpan); 29978 const isValid = this.errors.length === prevErrorCount; 29979 targetMatchableAttrs.push([name, ast.source]); 29980 // Don't try to validate assignment events if there were other 29981 // parsing errors to avoid adding more noise to the error logs. 29982 if (isAssignmentEvent && isValid && !this._isAllowedAssignmentEvent(ast)) { 29983 this._reportError('Unsupported expression in a two-way binding', sourceSpan); 29984 } 29985 targetEvents.push(new ParsedEvent(eventName, target, isAssignmentEvent ? ParsedEventType.TwoWay : ParsedEventType.Regular, ast, sourceSpan, handlerSpan, keySpan)); 29986 // Don't detect directives for event names for now, 29987 // so don't add the event name to the matchableAttrs 29988 } 29989 _parseAction(value, sourceSpan) { 29990 const sourceInfo = (sourceSpan && sourceSpan.start || '(unknown').toString(); 29991 const absoluteOffset = sourceSpan && sourceSpan.start ? sourceSpan.start.offset : 0; 29992 try { 29993 const ast = this._exprParser.parseAction(value, sourceInfo, absoluteOffset, this._interpolationConfig); 29994 if (ast) { 29995 this._reportExpressionParserErrors(ast.errors, sourceSpan); 29996 } 29997 if (!ast || ast.ast instanceof EmptyExpr$1) { 29998 this._reportError(`Empty expressions are not allowed`, sourceSpan); 29999 return this._exprParser.wrapLiteralPrimitive('ERROR', sourceInfo, absoluteOffset); 30000 } 30001 return ast; 30002 } catch (e) { 30003 this._reportError(`${e}`, sourceSpan); 30004 return this._exprParser.wrapLiteralPrimitive('ERROR', sourceInfo, absoluteOffset); 30005 } 30006 } 30007 _reportError(message, sourceSpan, level = ParseErrorLevel.ERROR, relatedError) { 30008 this.errors.push(new ParseError(sourceSpan, message, level, relatedError)); 30009 } 30010 _reportExpressionParserErrors(errors, sourceSpan) { 30011 for (const error of errors) { 30012 this._reportError(error.message, sourceSpan, undefined, error); 30013 } 30014 } 30015 /** 30016 * @param propName the name of the property / attribute 30017 * @param sourceSpan 30018 * @param isAttr true when binding to an attribute 30019 */ 30020 _validatePropertyOrAttributeName(propName, sourceSpan, isAttr) { 30021 const report = isAttr ? this._schemaRegistry.validateAttribute(propName) : this._schemaRegistry.validateProperty(propName); 30022 if (report.error) { 30023 this._reportError(report.msg, sourceSpan, ParseErrorLevel.ERROR); 30024 } 30025 } 30026 /** 30027 * Returns whether a parsed AST is allowed to be used within the event side of a two-way binding. 30028 * @param ast Parsed AST to be checked. 30029 */ 30030 _isAllowedAssignmentEvent(ast) { 30031 if (ast instanceof ASTWithSource) { 30032 return this._isAllowedAssignmentEvent(ast.ast); 30033 } 30034 if (ast instanceof NonNullAssert) { 30035 return this._isAllowedAssignmentEvent(ast.expression); 30036 } 30037 if (ast instanceof Call && ast.args.length === 1 && ast.receiver instanceof PropertyRead && ast.receiver.name === '$any' && ast.receiver.receiver instanceof ImplicitReceiver && !(ast.receiver.receiver instanceof ThisReceiver)) { 30038 return this._isAllowedAssignmentEvent(ast.args[0]); 30039 } 30040 if (ast instanceof PropertyRead || ast instanceof KeyedRead) { 30041 return true; 30042 } 30043 return false;
30044 } 30045} 30046function isAnimationLabel(name) { 30047 return name[0] == '@'; 30048} 30049function calcPossibleSecurityContexts(registry, selector, propName, isAttribute) { 30050 const ctxs = []; 30051 CssSelector.parse(selector).forEach(selector => { 30052 const elementNames = selector.element ? [selector.element] : registry.allKnownElementNames(); 30053 const notElementNames = new Set(selector.notSelectors.filter(selector => selector.isElementSelector()).map(selector => selector.element)); 30054 const possibleElementNames = elementNames.filter(elementName => !notElementNames.has(elementName)); 30055 ctxs.push(...possibleElementNames.map(elementName => registry.securityContext(elementName, propName, isAttribute))); 30056 }); 30057 return ctxs.length === 0 ? [SecurityContext.NONE] : Array.from(new Set(ctxs)).sort(); 30058} 30059/** 30060 * Compute a new ParseSourceSpan based off an original `sourceSpan` by using 30061 * absolute offsets from the specified `absoluteSpan`. 30062 * 30063 * @param sourceSpan original source span 30064 * @param absoluteSpan absolute source span to move to 30065 */ 30066function moveParseSourceSpan(sourceSpan, absoluteSpan) { 30067 // The difference of two absolute offsets provide the relative offset 30068 const startDiff = absoluteSpan.start - sourceSpan.start.offset; 30069 const endDiff = absoluteSpan.end - sourceSpan.end.offset; 30070 return new ParseSourceSpan(sourceSpan.start.moveBy(startDiff), sourceSpan.end.moveBy(endDiff), sourceSpan.fullStart.moveBy(startDiff), sourceSpan.details); 30071} 30072 30073// Some of the code comes from WebComponents.JS 30074// https://github.com/webcomponents/webcomponentsjs/blob/master/src/HTMLImports/path.js 30075function isStyleUrlResolvable(url) { 30076 if (url == null || url.length === 0 || url[0] == '/') return false; 30077 const schemeMatch = url.match(URL_WITH_SCHEMA_REGEXP); 30078 return schemeMatch === null || schemeMatch[1] == 'package' || schemeMatch[1] == 'asset'; 30079} 30080const URL_WITH_SCHEMA_REGEXP = /^([^:/?#]+):/; 30081const NG_CONTENT_SELECT_ATTR = 'select'; 30082const LINK_ELEMENT = 'link'; 30083const LINK_STYLE_REL_ATTR = 'rel'; 30084const LINK_STYLE_HREF_ATTR = 'href'; 30085const LINK_STYLE_REL_VALUE = 'stylesheet'; 30086const STYLE_ELEMENT = 'style'; 30087const SCRIPT_ELEMENT = 'script'; 30088const NG_NON_BINDABLE_ATTR = 'ngNonBindable'; 30089const NG_PROJECT_AS = 'ngProjectAs'; 30090function preparseElement(ast) { 30091 let selectAttr = null; 30092 let hrefAttr = null; 30093 let relAttr = null; 30094 let nonBindable = false; 30095 let projectAs = ''; 30096 ast.attrs.forEach(attr => { 30097 const lcAttrName = attr.name.toLowerCase(); 30098 if (lcAttrName == NG_CONTENT_SELECT_ATTR) { 30099 selectAttr = attr.value; 30100 } else if (lcAttrName == LINK_STYLE_HREF_ATTR) { 30101 hrefAttr = attr.value; 30102 } else if (lcAttrName == LINK_STYLE_REL_ATTR) { 30103 relAttr = attr.value; 30104 } else if (attr.name == NG_NON_BINDABLE_ATTR) { 30105 nonBindable = true; 30106 } else if (attr.name == NG_PROJECT_AS) { 30107 if (attr.value.length > 0) { 30108 projectAs = attr.value; 30109 } 30110 } 30111 }); 30112 selectAttr = normalizeNgContentSelect(selectAttr); 30113 const nodeName = ast.name.toLowerCase(); 30114 let type = PreparsedElementType.OTHER; 30115 if (isNgContent(nodeName)) { 30116 type = PreparsedElementType.NG_CONTENT; 30117 } else if (nodeName == STYLE_ELEMENT) { 30118 type = PreparsedElementType.STYLE; 30119 } else if (nodeName == SCRIPT_ELEMENT) { 30120 type = PreparsedElementType.SCRIPT; 30121 } else if (nodeName == LINK_ELEMENT && relAttr == LINK_STYLE_REL_VALUE) { 30122 type = PreparsedElementType.STYLESHEET; 30123 } 30124 return new PreparsedElement(type, selectAttr, hrefAttr, nonBindable, projectAs); 30125} 30126var PreparsedElementType = /*#__PURE__*/function (PreparsedElementType) { 30127 PreparsedElementType[PreparsedElementType["NG_CONTENT"] = 0] = "NG_CONTENT"; 30128 PreparsedElementType[PreparsedElementType["STYLE"] = 1] = "STYLE"; 30129 PreparsedElementType[PreparsedElementType["STYLESHEET"] = 2] = "STYLESHEET"; 30130 PreparsedElementType[PreparsedElementType["SCRIPT"] = 3] = "SCRIPT"; 30131 PreparsedElementType[PreparsedElementType["OTHER"] = 4] = "OTHER"; 30132 return PreparsedElementType; 30133}(PreparsedElementType || {}); 30134class PreparsedElement { 30135 constructor(type, selectAttr, hrefAttr, nonBindable, projectAs) { 30136 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "type", void 0); 30137 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "selectAttr", void 0); 30138 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "hrefAttr", void 0); 30139 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "nonBindable", void 0); 30140 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "projectAs", void 0); 30141 this.type = type; 30142 this.selectAttr = selectAttr; 30143 this.hrefAttr = hrefAttr; 30144 this.nonBindable = nonBindable; 30145 this.projectAs = projectAs; 30146 } 30147} 30148function normalizeNgContentSelect(selectAttr) { 30149 if (selectAttr === null || selectAttr.length === 0) { 30150 return '*'; 30151 } 30152 return selectAttr; 30153} 30154 30155/** Pattern for the expression in a for loop block. */ 30156const FOR_LOOP_EXPRESSION_PATTERN = /^\s*([0-9A-Za-z_$]*)\s+of\s+([\S\s]*)/; 30157/** Pattern for the tracking expression in a for loop block. */ 30158const FOR_LOOP_TRACK_PATTERN = /^track\s+([\S\s]*)/; 30159/** Pattern for the `as` expression in a conditional block. */ 30160const CONDITIONAL_ALIAS_PATTERN = /^(as\s+)(.*)/; 30161/** Pattern used to identify an `else if` block. */ 30162const ELSE_IF_PATTERN = /^else[^\S\r\n]+if/; 30163/** Pattern used to identify a `let` parameter. */ 30164const FOR_LOOP_LET_PATTERN = /^let\s+([\S\s]*)/; 30165/** Pattern used to validate a JavaScript identifier. */ 30166const IDENTIFIER_PATTERN = /^[$A-Z_][0-9A-Z_$]*$/i; 30167/** 30168 * Pattern to group a string into leading whitespace, non whitespace, and trailing whitespace. 30169 * Useful for getting the variable name span when a span can contain leading and trailing space. 30170 */ 30171const CHARACTERS_IN_SURROUNDING_WHITESPACE_PATTERN = /(\s*)(\S+)(\s*)/; 30172/** Names of variables that are allowed to be used in the `let` expression of a `for` loop. */ 30173const ALLOWED_FOR_LOOP_LET_VARIABLES = new Set(['$index', '$first', '$last', '$even', '$odd', '$count']); 30174/** 30175 * Predicate function that determines if a block with 30176 * a specific name cam be connected to a `for` block. 30177 */ 30178function isConnectedForLoopBlock(name) { 30179 return name === 'empty'; 30180} 30181/** 30182 * Predicate function that determines if a block with 30183 * a specific name cam be connected to an `if` block. 30184 */ 30185function isConnectedIfLoopBlock(name) { 30186 return name === 'else' || ELSE_IF_PATTERN.test(name); 30187} 30188/** Creates an `if` loop block from an HTML AST node. */ 30189function createIfBlock(ast, connectedBlocks, visitor, bindingParser) { 30190 const errors = validateIfConnectedBlocks(connectedBlocks); 30191 const branches = []; 30192 const mainBlockParams = parseConditionalBlockParameters(ast, errors, bindingParser); 30193 if (mainBlockParams !== null) { 30194 branches.push(new IfBlockBranch(mainBlockParams.expression, visitAll(visitor, ast.children, ast.children), mainBlockParams.expressionAlias, ast.sourceSpan, ast.startSourceSpan, ast.endSourceSpan, ast.nameSpan, ast.i18n)); 30195 } 30196 for (const block of connectedBlocks) { 30197 if (ELSE_IF_PATTERN.test(block.name)) { 30198 const params = parseConditionalBlockParameters(block, errors, bindingParser); 30199 if (params !== null) { 30200 const children = visitAll(visitor, block.children, block.children); 30201 branches.push(new IfBlockBranch(params.expression, children, params.expressionAlias, block.sourceSpan, block.startSourceSpan, block.endSourceSpan, block.nameSpan, block.i18n)); 30202 } 30203 } else if (block.name === 'else') { 30204 const children = visitAll(visitor, block.children, block.children); 30205 branches.push(new IfBlockBranch(null, children, null, block.sourceSpan, block.startSourceSpan, block.endSourceSpan, block.nameSpan, block.i18n)); 30206 } 30207 } 30208 // The outer IfBlock should have a span that encapsulates all branches. 30209 const ifBlockStartSourceSpan = branches.length > 0 ? branches[0].startSourceSpan : ast.startSourceSpan; 30210 const ifBlockEndSourceSpan = branches.length > 0 ? branches[branches.length - 1].endSourceSpan : ast.endSourceSpan; 30211 let wholeSourceSpan = ast.sourceSpan; 30212 const lastBranch = branches[branches.length - 1]; 30213 if (lastBranch !== undefined) { 30214 wholeSourceSpan = new ParseSourceSpan(ifBlockStartSourceSpan.start, lastBranch.sourceSpan.end); 30215 } 30216 return { 30217 node: new IfBlock(branches, wholeSourceSpan, ast.startSourceSpan, ifBlockEndSourceSpan, ast.nameSpan), 30218 errors 30219 }; 30220} 30221/** Creates a `for` loop block from an HTML AST node. */ 30222function createForLoop(ast, connectedBlocks, visitor, bindingParser) { 30223 const errors = []; 30224 const params = parseForLoopParameters(ast, errors, bindingParser); 30225 let node = null; 30226 let empty = null; 30227 for (const block of connectedBlocks) { 30228 if (block.name === 'empty') { 30229 if (empty !== null) { 30230 errors.push(new ParseError(block.sourceSpan, '@for loop can only have one @empty block')); 30231 } else if (block.parameters.length > 0) { 30232 errors.push(new ParseError(block.sourceSpan, '@empty block cannot have parameters')); 30233 } else { 30234 empty = new ForLoopBlockEmpty(visitAll(visitor, block.children, block.children), block.sourceSpan, block.startSourceSpan, block.endSourceSpan, block.nameSpan, block.i18n); 30235 } 30236 } else { 30237 errors.push(new ParseError(block.sourceSpan, `Unrecognized @for loop block "${block.name}"`)); 30238 } 30239 } 30240 if (params !== null) { 30241 if (params.trackBy === null) { 30242 // TODO: We should not fail here, and instead try to produce some AST for the language 30243 // service. 30244 errors.push(new ParseError(ast.startSourceSpan, '@for loop must have a "track" expression')); 30245 } else { 30246 var _empty$endSourceSpan, _empty, _endSpan$end; 30247 // The `for` block has a main span that includes the `empty` branch. For only the span of the 30248 // main `for` body, use `mainSourceSpan`. 30249 const endSpan = (_empty$endSourceSpan = (_empty = empty) === null || _empty === void 0 ? void 0 : _empty.endSourceSpan) !== null && _empty$endSourceSpan !== void 0 ? _empty$endSourceSpan : ast.endSourceSpan; 30250 const sourceSpan = new ParseSourceSpan(ast.sourceSpan.start, (_endSpan$end = endSpan === null || endSpan === void 0 ? void 0 : endSpan.end) !== null && _endSpan$end !== void 0 ? _endSpan$end : ast.sourceSpan.end); 30251 node = new ForLoopBlock(params.itemName, params.expression, params.trackBy.expression, params.trackBy.keywordSpan, params.context, visitAll(visitor, ast.children, ast.children), empty, sourceSpan, ast.sourceSpan, ast.startSourceSpan, endSpan, ast.nameSpan, ast.i18n); 30252 } 30253 } 30254 return { 30255 node, 30256 errors 30257 }; 30258} 30259/** Creates a switch block from an HTML AST node. */ 30260function createSwitchBlock(ast, visitor, bindingParser) { 30261 const errors = validateSwitchBlock(ast); 30262 const primaryExpression = ast.parameters.length > 0 ? parseBlockParameterToBinding(ast.parameters[0], bindingParser) : bindingParser.parseBinding('', false, ast.sourceSpan, 0); 30263 const cases = []; 30264 const unknownBlocks = []; 30265 let defaultCase = null; 30266 // Here we assume that all the blocks are valid given that we validated them above. 30267 for (const node of ast.children) { 30268 if (!(node instanceof Block)) { 30269 continue; 30270 } 30271 if ((node.name !== 'case' || node.parameters.length === 0) && node.name !== 'default') { 30272 unknownBlocks.push(new UnknownBlock(node.name, node.sourceSpan, node.nameSpan)); 30273 continue; 30274 } 30275 const expression = node.name === 'case' ? parseBlockParameterToBinding(node.parameters[0], bindingParser) : null; 30276 const ast = new SwitchBlockCase(expression, visitAll(visitor, node.children, node.children), node.sourceSpan, node.startSourceSpan, node.endSourceSpan, node.nameSpan, node.i18n); 30277 if (expression === null) { 30278 defaultCase = ast; 30279 } else { 30280 cases.push(ast); 30281 } 30282 } 30283 // Ensure that the default case is last in the array. 30284 if (defaultCase !== null) { 30285 cases.push(defaultCase); 30286 } 30287 return { 30288 node: new SwitchBlock(primaryExpression, cases, unknownBlocks, ast.sourceSpan, ast.startSourceSpan, ast.endSourceSpan, ast.nameSpan), 30289 errors 30290 }; 30291} 30292/** Parses the parameters of a `for` loop block. */ 30293function parseForLoopParameters(block, errors, bindingParser) { 30294 var _stripOptionalParenth; 30295 if (block.parameters.length === 0) { 30296 errors.push(new ParseError(block.startSourceSpan, '@for loop does not have an expression')); 30297 return null; 30298 } 30299 const [expressionParam, ...secondaryParams] = block.parameters; 30300 const match = (_stripOptionalParenth = stripOptionalParentheses(expressionParam, errors)) === null || _str
30300ipOptionalParenth === void 0 ? void 0 : _stripOptionalParenth.match(FOR_LOOP_EXPRESSION_PATTERN); 30301 if (!match || match[2].trim().length === 0) { 30302 errors.push(new ParseError(expressionParam.sourceSpan, 'Cannot parse expression. @for loop expression must match the pattern "<identifier> of <expression>"')); 30303 return null; 30304 } 30305 const [, itemName, rawExpression] = match; 30306 if (ALLOWED_FOR_LOOP_LET_VARIABLES.has(itemName)) { 30307 errors.push(new ParseError(expressionParam.sourceSpan, `@for loop item name cannot be one of ${Array.from(ALLOWED_FOR_LOOP_LET_VARIABLES).join(', ')}.`)); 30308 } 30309 // `expressionParam.expression` contains the variable declaration and the expression of the 30310 // for...of statement, i.e. 'user of users' The variable of a ForOfStatement is _only_ the "const 30311 // user" part and does not include "of x". 30312 const variableName = expressionParam.expression.split(' ')[0]; 30313 const variableSpan = new ParseSourceSpan(expressionParam.sourceSpan.start, expressionParam.sourceSpan.start.moveBy(variableName.length)); 30314 const result = { 30315 itemName: new Variable(itemName, '$implicit', variableSpan, variableSpan), 30316 trackBy: null, 30317 expression: parseBlockParameterToBinding(expressionParam, bindingParser, rawExpression), 30318 context: Array.from(ALLOWED_FOR_LOOP_LET_VARIABLES, variableName => { 30319 // Give ambiently-available context variables empty spans at the end of 30320 // the start of the `for` block, since they are not explicitly defined. 30321 const emptySpanAfterForBlockStart = new ParseSourceSpan(block.startSourceSpan.end, block.startSourceSpan.end); 30322 return new Variable(variableName, variableName, emptySpanAfterForBlockStart, emptySpanAfterForBlockStart); 30323 }) 30324 }; 30325 for (const param of secondaryParams) { 30326 const letMatch = param.expression.match(FOR_LOOP_LET_PATTERN); 30327 if (letMatch !== null) { 30328 const variablesSpan = new ParseSourceSpan(param.sourceSpan.start.moveBy(letMatch[0].length - letMatch[1].length), param.sourceSpan.end); 30329 parseLetParameter(param.sourceSpan, letMatch[1], variablesSpan, itemName, result.context, errors); 30330 continue; 30331 } 30332 const trackMatch = param.expression.match(FOR_LOOP_TRACK_PATTERN); 30333 if (trackMatch !== null) { 30334 if (result.trackBy !== null) { 30335 errors.push(new ParseError(param.sourceSpan, '@for loop can only have one "track" expression')); 30336 } else { 30337 const expression = parseBlockParameterToBinding(param, bindingParser, trackMatch[1]); 30338 if (expression.ast instanceof EmptyExpr$1) { 30339 errors.push(new ParseError(block.startSourceSpan, '@for loop must have a "track" expression')); 30340 } 30341 const keywordSpan = new ParseSourceSpan(param.sourceSpan.start, param.sourceSpan.start.moveBy('track'.length)); 30342 result.trackBy = { 30343 expression, 30344 keywordSpan 30345 }; 30346 } 30347 continue; 30348 } 30349 errors.push(new ParseError(param.sourceSpan, `Unrecognized @for loop parameter "${param.expression}"`)); 30350 } 30351 return result; 30352} 30353/** Parses the `let` parameter of a `for` loop block. */ 30354function parseLetParameter(sourceSpan, expression, span, loopItemName, context, errors) { 30355 const parts = expression.split(','); 30356 let startSpan = span.start; 30357 for (const part of parts) { 30358 const expressionParts = part.split('='); 30359 const name = expressionParts.length === 2 ? expressionParts[0].trim() : ''; 30360 const variableName = expressionParts.length === 2 ? expressionParts[1].trim() : ''; 30361 if (name.length === 0 || variableName.length === 0) { 30362 errors.push(new ParseError(sourceSpan, `Invalid @for loop "let" parameter. Parameter should match the pattern "<name> = <variable name>"`)); 30363 } else if (!ALLOWED_FOR_LOOP_LET_VARIABLES.has(variableName)) { 30364 errors.push(new ParseError(sourceSpan, `Unknown "let" parameter variable "${variableName}". The allowed variables are: ${Array.from(ALLOWED_FOR_LOOP_LET_VARIABLES).join(', ')}`)); 30365 } else if (name === loopItemName) { 30366 errors.push(new ParseError(sourceSpan, `Invalid @for loop "let" parameter. Variable cannot be called "${loopItemName}"`)); 30367 } else if (context.some(v => v.name === name)) { 30368 errors.push(new ParseError(sourceSpan, `Duplicate "let" parameter variable "${variableName}"`)); 30369 } else { 30370 var _expressionParts$0$ma, _valueSpan$end, _valueSpan; 30371 const [, keyLeadingWhitespace, keyName] = (_expressionParts$0$ma = expressionParts[0].match(CHARACTERS_IN_SURROUNDING_WHITESPACE_PATTERN)) !== null && _expressionParts$0$ma !== void 0 ? _expressionParts$0$ma : [];
30372 const keySpan = keyLeadingWhitespace !== undefined && expressionParts.length === 2 ? new ParseSourceSpan(/* strip leading spaces */ 30373 startSpan.moveBy(keyLeadingWhitespace.length), /* advance to end of the variable name */ 30374 startSpan.moveBy(keyLeadingWhitespace.length + keyName.length)) : span; 30375 let valueSpan = undefined; 30376 if (expressionParts.length === 2) { 30377 var _expressionParts$1$ma; 30378 const [, valueLeadingWhitespace, implicit] = (_expressionParts$1$ma = expressionParts[1].match(CHARACTERS_IN_SURROUNDING_WHITESPACE_PATTERN)) !== null && _expressionParts$1$ma !== void 0 ? _expressionParts$1$ma : []; 30379 valueSpan = valueLeadingWhitespace !== undefined ? new ParseSourceSpan(startSpan.moveBy(expressionParts[0].length + 1 + valueLeadingWhitespace.length), startSpan.moveBy(expressionParts[0].length + 1 + valueLeadingWhitespace.length + implicit.length)) : undefined; 30380 } 30381 const sourceSpan = new ParseSourceSpan(keySpan.start, (_valueSpan$end = (_valueSpan = valueSpan) === null || _valueSpan === void 0 ? void 0 : _valueSpan.end) !== null && _valueSpan$end !== void 0 ? _valueSpan$end : keySpan.end); 30382 context.push(new Variable(name, variableName, sourceSpan, keySpan, valueSpan)); 30383 } 30384 startSpan = startSpan.moveBy(part.length + 1 /* add 1 to move past the comma */); 30385 } 30386} 30387/** 30388 * Checks that the shape of the blocks connected to an 30389 * `@if` block is correct. Returns an array of errors. 30390 */ 30391function validateIfConnectedBlocks(connectedBlocks) { 30392 const errors = []; 30393 let hasElse = false; 30394 for (let i = 0; i < connectedBlocks.length; i++) { 30395 const block = connectedBlocks[i]; 30396 if (block.name === 'else') { 30397 if (hasElse) { 30398 errors.push(new ParseError(block.startSourceSpan, 'Conditional can only have one @else block')); 30399 } else if (connectedBlocks.length > 1 && i < connectedBlocks.length - 1) { 30400 errors.push(new ParseError(block.startSourceSpan, '@else block must be last inside the conditional')); 30401 } else if (block.parameters.length > 0) { 30402 errors.push(new ParseError(block.startSourceSpan, '@else block cannot have parameters')); 30403 } 30404 hasElse = true; 30405 } else if (!ELSE_IF_PATTERN.test(block.name)) { 30406 errors.push(new ParseError(block.startSourceSpan, `Unrecognized conditional block @${block.name}`)); 30407 } 30408 } 30409 return errors; 30410} 30411/** Checks that the shape of a `switch` block is valid. Returns an array of errors. */ 30412function validateSwitchBlock(ast) { 30413 const errors = []; 30414 let hasDefault = false;
30415 if (ast.parameters.length !== 1) { 30416 errors.push(new ParseError(ast.startSourceSpan, '@switch block must have exactly one parameter')); 30417 return errors; 30418 } 30419 for (const node of ast.children) { 30420 // Skip over comments and empty text nodes inside the switch block. 30421 // Empty text nodes can be used for formatting while comments don't affect the runtime. 30422 if (node instanceof Comment || node instanceof Text && node.value.trim().length === 0) { 30423 continue; 30424 } 30425 if (!(node instanceof Block) || node.name !== 'case' && node.name !== 'default') { 30426 errors.push(new ParseError(node.sourceSpan, '@switch block can only contain @case and @default blocks')); 30427 continue; 30428 } 30429 if (node.name === 'default') { 30430 if (hasDefault) { 30431 errors.push(new ParseError(node.startSourceSpan, '@switch block can only have one @default block')); 30432 } else if (node.parameters.length > 0) { 30433 errors.push(new ParseError(node.startSourceSpan, '@default block cannot have parameters')); 30434 } 30435 hasDefault = true; 30436 } else if (node.name === 'case' && node.parameters.length !== 1) { 30437 errors.push(new ParseError(node.startSourceSpan, '@case block must have exactly one parameter')); 30438 } 30439 } 30440 return errors; 30441} 30442/** 30443 * Parses a block parameter into a binding AST. 30444 * @param ast Block parameter that should be parsed. 30445 * @param bindingParser Parser that the expression should be parsed with. 30446 * @param part Specific part of the expression that should be parsed. 30447 */ 30448function parseBlockParameterToBinding(ast, bindingParser, part) { 30449 let start; 30450 let end; 30451 if (typeof part === 'string') { 30452 // Note: `lastIndexOf` here should be enough to know the start index of the expression, 30453 // because we know that it'll be at the end of the param. Ideally we could use the `d` 30454 // flag when matching via regex and get the index from `match.indices`, but it's unclear 30455 // if we can use it yet since it's a relatively new feature. See: 30456 // https://github.com/tc39/proposal-regexp-match-indices 30457 start = Math.max(0, ast.expression.lastIndexOf(part)); 30458 end = start + part.length; 30459 } else { 30460 start = 0; 30461 end = ast.expression.length; 30462 } 30463 return bindingParser.parseBinding(ast.expression.slice(start, end), false, ast.sourceSpan, ast.sourceSpan.start.offset + start); 30464} 30465/** Parses the parameter of a conditional block (`if` or `else if`). */ 30466function parseConditionalBlockParameters(block, errors, bindingParser) { 30467 if (block.parameters.length === 0) { 30468 errors.push(new ParseError(block.startSourceSpan, 'Conditional block does not have an expression')); 30469 return null; 30470 } 30471 const expression = parseBlockParameterToBinding(block.parameters[0], bindingParser); 30472 let expressionAlias = null; 30473 // Start from 1 since we processed the first parameter already. 30474 for (let i = 1; i < block.parameters.length; i++) { 30475 const param = block.parameters[i]; 30476 const aliasMatch = param.expression.match(CONDITIONAL_ALIAS_PATTERN); 30477 // For now conditionals can only have an `as` parameter. 30478 // We may want to rework this later if we add more. 30479 if (aliasMatch === null) { 30480 errors.push(new ParseError(param.sourceSpan, `Unrecognized conditional parameter "${param.expression}"`)); 30481 } else if (block.name !== 'if') { 30482 errors.push(new ParseError(param.sourceSpan, '"as" expression is only allowed on the primary @if block')); 30483 } else if (expressionAlias !== null) { 30484 errors.push(new ParseError(param.sourceSpan, 'Conditional can only have one "as" expression')); 30485 } else { 30486 const name = aliasMatch[2].trim(); 30487 if (IDENTIFIER_PATTERN.test(name)) { 30488 const variableStart = param.sourceSpan.start.moveBy(aliasMatch[1].length); 30489 const variableSpan = new ParseSourceSpan(variableStart, variableStart.moveBy(name.length)); 30490 expressionAlias = new Variable(name, name, variableSpan, variableSpan); 30491 } else { 30492 errors.push(new ParseError(param.sourceSpan, '"as" expression must be a valid JavaScript identifier')); 30493 } 30494 } 30495 } 30496 return { 30497 expression, 30498 expressionAlias 30499 }; 30500} 30501/** Strips optional parentheses around from a control from expression parameter. */ 30502function stripOptionalParentheses(param, errors) { 30503 const expression = param.expression; 30504 const spaceRegex = /^\s$/; 30505 let openParens = 0; 30506 let start = 0; 30507 let end = expression.length - 1; 30508 for (let i = 0; i < expression.length; i++) { 30509 const char = expression[i]; 30510 if (char === '(') { 30511 start = i + 1; 30512 openParens++; 30513 }
30513 else if (spaceRegex.test(char)) { 30514 continue; 30515 } else { 30516 break; 30517 } 30518 } 30519 if (openParens === 0) { 30520 return expression; 30521 } 30522 for (let i = expression.length - 1; i > -1; i--) { 30523 const char = expression[i]; 30524 if (char === ')') { 30525 end = i; 30526 openParens--; 30527 if (openParens === 0) { 30528 break; 30529 } 30530 } else if (spaceRegex.test(char)) { 30531 continue; 30532 } else { 30533 break; 30534 } 30535 } 30536 if (openParens !== 0) { 30537 errors.push(new ParseError(param.sourceSpan, 'Unclosed parentheses in expression')); 30538 return null; 30539 } 30540 return expression.slice(start, end); 30541} 30542 30543/** Pattern for a timing value in a trigger. */ 30544const TIME_PATTERN = /^\d+\.?\d*(ms|s)?$/; 30545/** Pattern for a separator between keywords in a trigger expression. */ 30546const SEPARATOR_PATTERN = /^\s$/; 30547/** Pairs of characters that form syntax that is comma-delimited. */ 30548const COMMA_DELIMITED_SYNTAX = new Map([[$LBRACE, $RBRACE], 30549// Object literals 30550[$LBRACKET, $RBRACKET], 30551// Array literals 30552[$LPAREN, $RPAREN] // Function calls 30553]); 30554/** Possible types of `on` triggers. */ 30555var OnTriggerType = /*#__PURE__*/function (OnTriggerType) { 30556 OnTriggerType["IDLE"] = "idle"; 30557 OnTriggerType["TIMER"] = "timer"; 30558 OnTriggerType["INTERACTION"] = "interaction"; 30559 OnTriggerType["IMMEDIATE"] = "immediate"; 30560 OnTriggerType["HOVER"] = "hover"; 30561 OnTriggerType["VIEWPORT"] = "viewport"; 30562 OnTriggerType["NEVER"] = "never"; 30563 return OnTriggerType; 30564}(OnTriggerType || {}); 30565/** Parses a `when` deferred trigger. */ 30566function parseNeverTrigger({ 30567 expression, 30568 sourceSpan 30569}, triggers, errors) { 30570 const neverIndex = expression.indexOf('never'); 30571 const neverSourceSpan = new ParseSourceSpan(sourceSpan.start.moveBy(neverIndex), sourceSpan.start.moveBy(neverIndex + 'never'.length)); 30572 const prefetchSpan = getPrefetchSpan(expression, sourceSpan); 30573 const hydrateSpan = getHydrateSpan(expression, sourceSpan); 30574 // This is here just to be safe, we shouldn't enter this function 30575 // in the first place if a block doesn't have the "on" keyword. 30576 if (neverIndex === -1) { 30577 errors.push(new ParseError(sourceSpan, `Could not find "never" keyword in expression`)); 30578 } else { 30579 trackTrigger('never', triggers, errors, new NeverDeferredTrigger(neverSourceSpan, sourceSpan, prefetchSpan, null, hydrateSpan)); 30580 } 30581} 30582/** Parses a `when` deferred trigger. */ 30583function parseWhenTrigger({ 30584 expression, 30585 sourceSpan 30586}, bindingParser, triggers, errors) { 30587 const whenIndex = expression.indexOf('when'); 30588 const whenSourceSpan = new ParseSourceSpan(sourceSpan.start.moveBy(whenIndex), sourceSpan.start.moveBy(whenIndex + 'when'.length)); 30589 const prefetchSpan = getPrefetchSpan(expression, sourceSpan); 30590 const hydrateSpan = getHydrateSpan(expression, sourceSpan); 30591 // This is here just to be safe, we shouldn't enter this function 30592 // in the first place if a block doesn't have the "when" keyword. 30593 if (whenIndex === -1) { 30594 errors.push(new ParseError(sourceSpan, `Could not find "when" keyword in expression`)); 30595 } else { 30596 const start = getTriggerParametersStart(expression, whenIndex + 1); 30597 const parsed = bindingParser.parseBinding(expression.slice(start), false, sourceSpan, sourceSpan.start.offset + start); 30598 trackTrigger('when', triggers, errors, new BoundDeferredTrigger(parsed, sourceSpan, prefetchSpan, whenSourceSpan, hydrateSpan)); 30599 } 30600} 30601/** Parses an `on` trigger */ 30602function parseOnTrigger({ 30603 expression, 30604 sourceSpan 30605}, triggers, errors, placeholder) { 30606 const onIndex = expression.indexOf('on'); 30607 const onSourceSpan = new ParseSourceSpan(sourceSpan.start.moveBy(onIndex), sourceSpan.start.moveBy(onIndex + 'on'.length)); 30608 const prefetchSpan = getPrefetchSpan(expression, sourceSpan); 30609 const hydrateSpan = getHydrateSpan(expression, sourceSpan); 30610 // This is here just to be safe, we shouldn't enter this function 30611 // in the first place if a block doesn't have the "on" keyword. 30612 if (onIndex === -1) { 30613 errors.push(new ParseError(sourceSpan, `Could not find "on" keyword in expression`)); 30614 } else { 30615 const start = getTriggerParametersStart(expression, onIndex + 1); 30616 const parser = new OnTriggerParser(expression, start, sourceSpan, triggers, errors, expression.startsWith('hydrate') ? validateHydrateReferenceBasedTrigger : validatePlainReferenceBasedTrigger, placeholder, prefetchSpan, onSourceSpan, hydrateSpan); 30617 parser.parse(); 30618 } 30619} 30620function getPrefetchSpan(expression, sourceSpan) { 30621 if (!expression.startsWith('prefetch')) { 30622 return null; 30623 } 30624 return new ParseSourceSpan(sourceSpan.start, sourceSpan.start.moveBy('prefetch'.length)); 30625} 30626function getHydrateSpan(expression, sourceSpan) { 30627 if (!expression.startsWith('hydrate')) { 30628 return null; 30629 } 30630 return new ParseSourceSpan(sourceSpan.start, sourceSpan.start.moveBy('hydrate'.length)); 30631} 30632class OnTriggerParser { 30633 constructor(expression, start, span, triggers, errors, validator, placeholder, prefetchSpan, onSourceSpan, hydrateSpan) { 30634 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "expression", void 0); 30635 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "start", void 0); 30636 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "span", void 0); 30637 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "triggers", void 0); 30638 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "errors", void 0); 30639 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "validator", void 0); 30640 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "placeholder", void 0); 30641 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "prefetchSpan", void 0); 30642 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "onSourceSpan", void 0); 30643 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "hydrateSpan", void 0); 30644 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "index", 0); 30645 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "tokens", void 0); 30646 this.expression = expression; 30647 this.start = start; 30648 this.span = span; 30649 this.triggers = triggers; 30650 this.errors = errors; 30651 this.validator = validator; 30652 this.placeholder = placeholder; 30653 this.prefetchSpan = prefetchSpan; 30654 this.onSourceSpan = onSourceSpan; 30655 this.hydrateSpan = hydrateSpan; 30656 this.tokens = new Lexer().tokenize(expression.slice(start)); 30657 } 30658 parse() { 30659 while (this.tokens.length > 0 && this.index < this.tokens.length) { 30660 const token = this.token(); 30661 if (!token.isIdentifier()) { 30662 this.unexpectedToken(token); 30663 break; 30664 } 30665 // An identifier immediately followed by a comma or the end of 30666 // the expression cannot have parameters so we can exit early. 30667 if (this.isFollowedByOrLast($COMMA)) { 30668 this.consumeTrigger(token, []); 30669 this.advance(); 30670 } else if (this.isFollowedByOrLast($LPAREN)) { 30671 this.advance(); // Advance to the opening paren. 30672 const prevErrors = this.errors.length; 30673 const parameters = this.consumeParameters(); 30674 if (this.errors.length !== prevErrors) { 30675 break; 30676 } 30677 this.consumeTrigger(token, parameters); 30678 this.advance(); // Advance past the closing paren. 30679 } else if (this.index < this.tokens.length - 1) { 30680 this.unexpectedToken(this.tokens[this.index + 1]); 30681 } 30682 this.advance(); 30683 } 30684 } 30685 advance() { 30686 this.index++; 30687 } 30688 isFollowedByOrLast(char) { 30689 if (this.index === this.tokens.length - 1) { 30690 return true; 30691 } 30692 return this.tokens[this.index + 1].isCharacter(char); 30693 } 30694 token() { 30695 return this.tokens[Math.min(this.index, this.tokens.length - 1)]; 30696 } 30697 consumeTrigger(identifier, parameters) { 30698 const triggerNameStartSpan = this.span.start.moveBy(this.start + identifier.index - this.tokens[0].index); 30699 const nameSpan = new ParseSourceSpan(triggerNameStartSpan, triggerNameStartSpan.moveBy(identifier.strValue.length)); 30700 const endSpan = triggerNameStartSpan.moveBy(this.token().end - identifier.index); 30701 // Put the prefetch and on spans with the first trigger 30702 // This should maybe be refactored to have something like an outer OnGroup AST 30703 // Since triggers can be grouped with commas "on hover(x), interaction(y)" 30704 const isFirstTrigger = identifier.index === 0; 30705 const onSourceSpan = isFirstTrigger ? this.onSourceSpan : null; 30706 const prefetchSourceSpan = isFirstTrigger ? this.prefetchSpan : null; 30707 const hydrateSourceSpan = isFirstTrigger ? this.hydrateSpan : null; 30708 const sourceSpan = new ParseSourceSpan(isFirstTrigger ? this.span.start : triggerNameStartSpan, endSpan); 30709 try { 30710 switch (identifier.toString()) { 30711 case OnTriggerType.IDLE: 30712 this.trackTrigger('idle', createIdleTrigger(parameters, nameSpan, sourceSpan, prefetchSourceSpan, onSourceSpan, hydrateSourceSpan)); 30713 break; 30714 case OnTriggerType.TIMER: 30715 this.trackTrigger('timer', createTimerTrigger(parameters, nameSpan, sourceSpan, this.prefetchSpan, this.onSourceSpan, this.hydrateSpan)); 30716 break; 30717 case OnTriggerType.INTERACTION: 30718 this.trackTrigger('interaction', createInteractionTrigger(parameters, nameSpan, sourceSpan, this.prefetchSpan, this.onSourceSpan, this.hydrateSpan, this.placeholder, this.validator)); 30719 break; 30720 case OnTriggerType.IMMEDIATE: 30721 this.trackTrigger('immediate', createImmediateTrigger(parameters, nameSpan, sourceSpan, this.prefetchSpan, this.onSourceSpan, this.hydrateSpan)); 30722 break; 30723 case OnTriggerType.HOVER: 30724 this.trackTrigger('hover', createHoverTrigger(parameters, nameSpan, sourceSpan, this.prefetchSpan, this.onSourceSpan, this.hydrateSpan, this.placeholder, this.validator)); 30725 break; 30726 case OnTriggerType.VIEWPORT: 30727 this.trackTrigger('viewport', createViewportTrigger(parameters, nameSpan, sourceSpan, this.prefetchSpan, this.onSourceSpan, this.hydrateSpan, this.placeholder, this.validator)); 30728 break; 30729 default: 30730 throw new Error(`Unrecognized trigger type "${identifier}"`); 30731 } 30732 } catch (e) { 30733 this.error(identifier, e.message); 30734 } 30735 } 30736 consumeParameters() { 30737 const parameters = []; 30738 if (!this.token().isCharacter($LPAREN)) { 30739 this.unexpectedToken(this.token()); 30740 return parameters; 30741 } 30742 this.advance(); 30743 const commaDelimStack = [];
30744 let current = ''; 30745 while (this.index < this.tokens.length) { 30746 const token = this.token(); 30747 // Stop parsing if we've hit the end character and we're outside of a comma-delimited syntax. 30748 // Note that we don't need to account for strings here since the lexer already parsed them 30749 // into string tokens. 30750 if (token.isCharacter($RPAREN) && commaDelimStack.length === 0) { 30751 if (current.length) { 30752 parameters.push(current); 30753 } 30754 break; 30755 } 30756 // In the `on` microsyntax "top-level" commas (e.g. ones outside of an parameters) separate 30757 // the different triggers (e.g. `on idle,timer(500)`). This is problematic, because the 30758 // function-like syntax also implies that multiple parameters can be passed into the 30759 // individual trigger (e.g. `on foo(a, b)`). To avoid tripping up the parser with commas that 30760 // are part of other sorts of syntax (object literals, arrays), we treat anything inside 30761 // a comma-delimited syntax block as plain text. 30762 if (token.type === TokenType.Character && COMMA_DELIMITED_SYNTAX.has(token.numValue)) { 30763 commaDelimStack.push(COMMA_DELIMITED_SYNTAX.get(token.numValue)); 30764 } 30765 if (commaDelimStack.length > 0 && token.isCharacter(commaDelimStack[commaDelimStack.length - 1])) { 30766 commaDelimStack.pop(); 30767 } 30768 // If we hit a comma outside of a comma-delimited syntax, it means 30769 // that we're at the top level and we're starting a new parameter. 30770 if (commaDelimStack.length === 0 && token.isCharacter($COMMA) && current.length > 0) { 30771 parameters.push(current); 30772 current = ''; 30773 this.advance(); 30774 continue; 30775 } 30776 // Otherwise treat the token as a plain text character in the current parameter. 30777 current += this.tokenText(); 30778 this.advance(); 30779 } 30780 if (!this.token().isCharacter($RPAREN) || commaDelimStack.length > 0) { 30781 this.error(this.token(), 'Unexpected end of expression'); 30782 } 30783 if (this.index < this.tokens.length - 1 && !this.tokens[this.index + 1].isCharacter($COMMA)) { 30784 this.unexpectedToken(this.tokens[this.index + 1]); 30785 } 30786 return parameters; 30787 } 30788 tokenText() { 30789 // Tokens have a toString already which we could use, but for string tokens it omits the quotes. 30790 // Eventually we could expose this information on the token directly. 30791 return this.expression.slice(this.start + this.token().index, this.start + this.token().end); 30792 } 30793 trackTrigger(name, trigger) { 30794 trackTrigger(name, this.triggers, this.errors, trigger); 30795 } 30796 error(token, message) { 30797 const newStart = this.span.start.moveBy(this.start + token.index); 30798 const newEnd = newStart.moveBy(token.end - token.index); 30799 this.errors.push(new ParseError(new ParseSourceSpan(newStart, newEnd), message)); 30800 } 30801 unexpectedToken(token) { 30802 this.error(token, `Unexpected token "${token}"`); 30803 } 30804} 30805/** Adds a trigger to a map of triggers. */ 30806function trackTrigger(name, allTriggers, errors, trigger) { 30807 if (allTriggers[name]) { 30808 errors.push(new ParseError(trigger.sourceSpan, `Duplicate "${name}" trigger is not allowed`)); 30809 } else { 30810 allTriggers[name] = trigger; 30811 } 30812} 30813function createIdleTrigger(parameters, nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan) { 30814 if (parameters.length > 0) { 30815 throw new Error(`"${OnTriggerType.IDLE}" trigger cannot have parameters`); 30816 } 30817 return new IdleDeferredTrigger(nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan); 30818} 30819function createTimerTrigger(parameters, nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan) { 30820 if (parameters.length !== 1) { 30821 throw new Error(`"${OnTriggerType.TIMER}" trigger must have exactly one parameter`); 30822 } 30823 const delay = parseDeferredTime(parameters[0]); 30824 if (delay === null) { 30825 throw new Error(`Could not parse time value of trigger "${OnTriggerType.TIMER}"`); 30826 } 30827 return new TimerDeferredTrigger(delay, nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan); 30828} 30829function createImmediateTrigger(parameters, nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan) { 30830 if (parameters.length > 0) { 30831 throw new Error(`"${OnTriggerType.IMMEDIATE}" trigger cannot have parameters`); 30832 } 30833 return new ImmediateDeferredTrigger(nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan); 30834} 30835function createHoverTrigger(parameters, nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan, placeholder, validator) { 30836 var _parameters$; 30837 validator(OnTriggerType.HOVER, parameters, placeholder); 30838 return new HoverDeferredTrigger((_parameters$ = parameters[0]) !== null && _parameters$ !== void 0 ? _parameters$ : null, nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan); 30839} 30840function createInteractionTrigger(parameters, nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan, placeholder, validator) { 30841 var _parameters$2; 30842 validator(OnTriggerType.INTERACTION, parameters, placeholder); 30843 return new InteractionDeferredTrigger((_parameters$2 = parameters[0]) !== null && _parameters$2 !== void 0 ? _parameters$2 : null, nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan); 30844} 30845function createViewportTrigger(parameters, nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan, placeholder, validator) { 30846 var _parameters$3; 30847 validator(OnTriggerType.VIEWPORT, parameters, placeholder); 30848 return new ViewportDeferredTrigger((_parameters$3 = parameters[0]) !== null && _parameters$3 !== void 0 ? _parameters$3 : null, nameSpan, sourceSpan, prefetchSpan, onSourceSpan, hydrateSpan); 30849} 30850/** 30851 * Checks whether the structure of a non-hydrate reference-based trigger is valid. 30852 * @param type Type of the trigger being validated. 30853 * @param parameters Parameters of the trigger. 30854 * @param placeholder Placeholder of the defer block. 30855 */ 30856function validatePlainReferenceBasedTrigger(type, parameters, placeholder) { 30857 if (parameters.length > 1) { 30858 throw new Error(`"${type}" trigger can only have zero or one parameters`); 30859 } 30860 if (parameters.length === 0) { 30861 if (placeholder === null) { 30862 throw new Error(`"${type}" trigger with no parameters can only be placed on an @defer that has a @placeholder block`); 30863 } 30864 if (placeholder.children.length !== 1 || !(placeholder.children[0] instanceof Element$1)) { 30865 throw new Error(`"${type}" trigger with no parameters can only be placed on an @defer that has a ` + `@placeholder block with exactly one root element node`); 30866 } 30867 } 30868} 30869/** 30870 * Checks whether the structure of a hydrate trigger is valid. 30871 * @param type Type of the trigger being validated. 30872 * @param parameters Parameters of the trigger. 30873 */ 30874function validateHydrateReferenceBasedTrigger(type, parameters) { 30875 if (parameters.length > 0) { 30876 throw new Error(`Hydration trigger "${type}" cannot have parameters`); 30877 } 30878} 30879/** Gets the index within an expression at which the trigger parameters start. */ 30880function getTriggerParametersStart(value, startPosition = 0) { 30881 let hasFoundSeparator = false;
30882 for (let i = startPosition; i < value.length; i++) { 30883 if (SEPARATOR_PATTERN.test(value[i])) { 30884 hasFoundSeparator = true; 30885 } else if (hasFoundSeparator) { 30886 return i; 30887 } 30888 } 30889 return -1; 30890} 30891/** 30892 * Parses a time expression from a deferred trigger to 30893 * milliseconds. Returns null if it cannot be parsed. 30894 */ 30895function parseDeferredTime(value) { 30896 const match = value.match(TIME_PATTERN); 30897 if (!match) { 30898 return null; 30899 } 30900 const [time, units] = match; 30901 return parseFloat(time) * (units === 's' ? 1000 : 1); 30902} 30903 30904/** Pattern to identify a `prefetch when` trigger. */ 30905const PREFETCH_WHEN_PATTERN = /^prefetch\s+when\s/; 30906/** Pattern to identify a `prefetch on` trigger. */ 30907const PREFETCH_ON_PATTERN = /^prefetch\s+on\s/; 30908/** Pattern to identify a `hydrate when` trigger. */ 30909const HYDRATE_WHEN_PATTERN = /^hydrate\s+when\s/; 30910/** Pattern to identify a `hydrate on` trigger. */ 30911const HYDRATE_ON_PATTERN = /^hydrate\s+on\s/; 30912/** Pattern to identify a `hydrate never` trigger. */ 30913const HYDRATE_NEVER_PATTERN = /^hydrate\s+never(\s*)$/; 30914/** Pattern to identify a `minimum` parameter in a block. */ 30915const MINIMUM_PARAMETER_PATTERN = /^minimum\s/; 30916/** Pattern to identify a `after` parameter in a block. */ 30917const AFTER_PARAMETER_PATTERN = /^after\s/; 30918/** Pattern to identify a `when` parameter in a block. */ 30919const WHEN_PARAMETER_PATTERN = /^when\s/; 30920/** Pattern to identify a `on` parameter in a block. */ 30921const ON_PARAMETER_PATTERN = /^on\s/; 30922/** 30923 * Predicate function that determines if a block with 30924 * a specific name cam be connected to a `defer` block. 30925 */ 30926function isConnectedDeferLoopBlock(name) { 30927 return name === 'placeholder' || name === 'loading' || name === 'error'; 30928} 30929/** Creates a deferred block from an HTML AST node. */ 30930function createDeferredBlock(ast, connectedBlocks, visitor, bindingParser) { 30931 const errors = []; 30932 const { 30933 placeholder, 30934 loading, 30935 error 30936 } = parseConnectedBlocks(connectedBlocks, errors, visitor); 30937 const { 30938 triggers, 30939 prefetchTriggers, 30940 hydrateTriggers 30941 } = parsePrimaryTriggers(ast, bindingParser, errors, placeholder); 30942 // The `defer` block has a main span encompassing all of the connected branches as well. 30943 let lastEndSourceSpan = ast.endSourceSpan; 30944 let endOfLastSourceSpan = ast.sourceSpan.end; 30945 if (connectedBlocks.length > 0) { 30946 const lastConnectedBlock = connectedBlocks[connectedBlocks.length - 1]; 30947 lastEndSourceSpan = lastConnectedBlock.endSourceSpan; 30948 endOfLastSourceSpan = lastConnectedBlock.sourceSpan.end; 30949 } 30950 const sourceSpanWithConnectedBlocks = new ParseSourceSpan(ast.sourceSpan.start, endOfLastSourceSpan); 30951 const node = new DeferredBlock(visitAll(visitor, ast.children, ast.children), triggers, prefetchTriggers, hydrateTriggers, placeholder, loading, error, ast.nameSpan, sourceSpanWithConnectedBlocks, ast.sourceSpan, ast.startSourceSpan, lastEndSourceSpan, ast.i18n); 30952 return { 30953 node, 30954 errors 30955 }; 30956} 30957function parseConnectedBlocks(connectedBlocks, errors, visitor) { 30958 let placeholder = null; 30959 let loading = null; 30960 let error = null; 30961 for (const block of connectedBlocks) { 30962 try { 30963 if (!isConnectedDeferLoopBlock(block.name)) { 30964 errors.push(new ParseError(block.startSourceSpan, `Unrecognized block "@${block.name}"`)); 30965 break; 30966 } 30967 switch (block.name) { 30968 case 'placeholder': 30969 if (placeholder !== null) { 30970 errors.push(new ParseError(block.startSourceSpan, `@defer block can only have one @placeholder block`)); 30971 } else { 30972 placeholder = parsePlaceholderBlock(block, visitor); 30973 } 30974 break; 30975 case 'loading': 30976 if (loading !== null) { 30977 errors.push(new ParseError(block.startSourceSpan, `@defer block can only have one @loading block`)); 30978 } else { 30979 loading = parseLoadingBlock(block, visitor); 30980 } 30981 break; 30982 case 'error': 30983 if (error !== null) { 30984 errors.push(new ParseError(block.startSourceSpan, `@defer block can only have one @error block`)); 30985 } else { 30986 error = parseErrorBlock(block, visitor); 30987 } 30988 break; 30989 } 30990 } catch (e) { 30991 errors.push(new ParseError(block.startSourceSpan, e.message)); 30992 } 30993 } 30994 return { 30995 placeholder, 30996 loading, 30997 error 30998 }; 30999} 31000function parsePlaceholderBlock(ast, visitor) { 31001 let minimumTime = null; 31002 for (const param of ast.parameters) { 31003 if (MINIMUM_PARAMETER_PATTERN.test(param.expression)) { 31004 if (minimumTime != null) { 31005 throw new Error(`@placeholder block can only have one "minimum" parameter`); 31006 } 31007 const parsedTime = parseDeferredTime(param.expression.slice(getTriggerParametersStart(param.expression))); 31008 if (parsedTime === null) { 31009 throw new Error(`Could not parse time value of parameter "minimum"`); 31010 } 31011 minimumTime = parsedTime; 31012 } else { 31013 throw new Error(`Unrecognized parameter in @placeholder block: "${param.expression}"`); 31014 } 31015 } 31016 return new DeferredBlockPlaceholder(visitAll(visitor, ast.children, ast.children), minimumTime, ast.nameSpan, ast.sourceSpan, ast.startSourceSpan, ast.endSourceSpan, ast.i18n); 31017} 31018function parseLoadingBlock(ast, visitor) { 31019 let afterTime = null; 31020 let minimumTime = null; 31021 for (const param of ast.parameters) { 31022 if (AFTER_PARAMETER_PATTERN.test(param.expression)) { 31023 if (afterTime != null) { 31024 throw new Error(`@loading block can only have one "after" parameter`); 31025 } 31026 const parsedTime = parseDeferredTime(param.expression.slice(getTriggerParametersStart(param.expression))); 31027 if (parsedTime === null) { 31028 throw new Error(`Could not parse time value of parameter "after"`); 31029 } 31030 afterTime = parsedTime; 31031 } else if (MINIMUM_PARAMETER_PATTERN.test(param.expression)) { 31032 if (minimumTime != null) { 31033 throw new Error(`@loading block can only have one "minimum" parameter`); 31034 } 31035 const parsedTime = parseDeferredTime(param.expression.slice(getTriggerParametersStart(param.expression))); 31036 if (parsedTime === null) { 31037 throw new Error(`Could not parse time value of parameter "minimum"`); 31038 } 31039 minimumTime = parsedTime; 31040 } else { 31041 throw new Error(`Unrecognized parameter in @loading block: "${param.expression}"`); 31042 } 31043 } 31044 return new DeferredBlockLoading(visitAll(visitor, ast.children, ast.children), afterTime, minimumTime, ast.nameSpan, ast.sourceSpan, ast.startSourceSpan, ast.endSourceSpan, ast.i18n); 31045} 31046function parseErrorBlock(ast, visitor) { 31047 if (ast.parameters.length > 0) { 31048 throw new Error(`@error block cannot have parameters`); 31049 } 31050 return new DeferredBlockError(visitAll(visitor, ast.children, ast.children), ast.nameSpan, ast.sourceSpan, ast.startSourceSpan, ast.endSourceSpan, ast.i18n); 31051} 31052function parsePrimaryTriggers(ast, bindingParser, errors, placeholder) { 31053 const triggers = {}; 31054 const prefetchTriggers = {}; 31055 const hydrateTriggers = {}; 31056 for (const param of ast.parameters) {
31057 // The lexer ignores the leading spaces so we can assume 31058 // that the expression starts with a keyword. 31059 if (WHEN_PARAMETER_PATTERN.test(param.expression)) { 31060 parseWhenTrigger(param, bindingParser, triggers, errors); 31061 } else if (ON_PARAMETER_PATTERN.test(param.expression)) { 31062 parseOnTrigger(param, triggers, errors, placeholder); 31063 } else if (PREFETCH_WHEN_PATTERN.test(param.expression)) { 31064 parseWhenTrigger(param, bindingParser, prefetchTriggers, errors); 31065 } else if (PREFETCH_ON_PATTERN.test(param.expression)) { 31066 parseOnTrigger(param, prefetchTriggers, errors, placeholder); 31067 } else if (HYDRATE_WHEN_PATTERN.test(param.expression)) { 31068 parseWhenTrigger(param, bindingParser, hydrateTriggers, errors); 31069 } else if (HYDRATE_ON_PATTERN.test(param.expression)) { 31070 parseOnTrigger(param, hydrateTriggers, errors, placeholder); 31071 } else if (HYDRATE_NEVER_PATTERN.test(param.expression)) { 31072 parseNeverTrigger(param, hydrateTriggers, errors); 31073 } else { 31074 errors.push(new ParseError(param.sourceSpan, 'Unrecognized trigger')); 31075 } 31076 } 31077 if (hydrateTriggers.never && Object.keys(hydrateTriggers).length > 1) { 31078 errors.push(new ParseError(ast.startSourceSpan, 'Cannot specify additional `hydrate` triggers if `hydrate never` is present')); 31079 } 31080 return { 31081 triggers, 31082 prefetchTriggers, 31083 hydrateTriggers 31084 }; 31085} 31086const BIND_NAME_REGEXP = /^(?:(bind-)|(let-)|(ref-|#)|(on-)|(bindon-)|(@))(.*)$/; 31087// Group 1 = "bind-" 31088const KW_BIND_IDX = 1; 31089// Group 2 = "let-" 31090const KW_LET_IDX = 2; 31091// Group 3 = "ref-/#" 31092const KW_REF_IDX = 3; 31093// Group 4 = "on-" 31094const KW_ON_IDX = 4; 31095// Group 5 = "bindon-" 31096const KW_BINDON_IDX = 5; 31097// Group 6 = "@" 31098const KW_AT_IDX = 6; 31099// Group 7 = the identifier after "bind-", "let-", "ref-/#", "on-", "bindon-" or "@" 31100const IDENT_KW_IDX = 7; 31101const BINDING_DELIMS = { 31102 BANANA_BOX: { 31103 start: '[(', 31104 end: ')]' 31105 }, 31106 PROPERTY: { 31107 start: '[', 31108 end: ']' 31109 }, 31110 EVENT: { 31111 start: '(', 31112 end: ')' 31113 } 31114}; 31115const TEMPLATE_ATTR_PREFIX = '*'; 31116function htmlAstToRender3Ast(htmlNodes, bindingParser, options) { 31117 const transformer = new HtmlAstToIvyAst(bindingParser, options); 31118 const ivyNodes = visitAll(transformer, htmlNodes, htmlNodes); 31119 // Errors might originate in either the binding parser or the html to ivy transformer 31120 const allErrors = bindingParser.errors.concat(transformer.errors); 31121 const result = { 31122 nodes: ivyNodes, 31123 errors: allErrors, 31124 styleUrls: transformer.styleUrls, 31125 styles: transformer.styles, 31126 ngContentSelectors: transformer.ngContentSelectors 31127 }; 31128 if (options.collectCommentNodes) { 31129 result.commentNodes = transformer.commentNodes; 31130 } 31131 return result; 31132} 31133class HtmlAstToIvyAst { 31134 constructor(bindingParser, options) { 31135 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "bindingParser", void 0); 31136 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "options", void 0); 31137 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "errors", []); 31138 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "styles", []); 31139 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "styleUrls", []); 31140 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "ngContentSelectors", []); 31141 // This array will be populated if `Render3ParseOptions['collectCommentNodes']` is true 31142 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "commentNodes", []); 31143 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "inI18nBlock", false); 31144 /** 31145 * Keeps track of the nodes that have been processed already when previous nodes were visited. 31146 * These are typically blocks connected to other blocks or text nodes between connected blocks. 31147 */ 31148 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "processedNodes", new Set()); 31149 this.bindingParser = bindingParser; 31150 this.options = options; 31151 } 31152 // HTML visitor
31153 visitElement(element) { 31154 const isI18nRootElement = isI18nRootNode(element.i18n); 31155 if (isI18nRootElement) { 31156 if (this.inI18nBlock) { 31157 this.reportError('Cannot mark an element as translatable inside of a translatable section. Please remove the nested i18n marker.', element.sourceSpan); 31158 } 31159 this.inI18nBlock = true; 31160 } 31161 const preparsedElement = preparseElement(element); 31162 if (preparsedElement.type === PreparsedElementType.SCRIPT) { 31163 return null; 31164 } else if (preparsedElement.type === PreparsedElementType.STYLE) { 31165 const contents = textContents(element); 31166 if (contents !== null) { 31167 this.styles.push(contents); 31168 } 31169 return null; 31170 } else if (preparsedElement.type === PreparsedElementType.STYLESHEET && isStyleUrlResolvable(preparsedElement.hrefAttr)) { 31171 this.styleUrls.push(preparsedElement.hrefAttr); 31172 return null; 31173 } 31174 // Whether the element is a `<ng-template>` 31175 const isTemplateElement = isNgTemplate(element.name); 31176 const parsedProperties = []; 31177 const boundEvents = []; 31178 const variables = []; 31179 const references = []; 31180 const attributes = []; 31181 const i18nAttrsMeta = {}; 31182 const templateParsedProperties = []; 31183 const templateVariables = []; 31184 // Whether the element has any *-attribute 31185 let elementHasInlineTemplate = false; 31186 for (const attribute of element.attrs) { 31187 let hasBinding = false; 31188 const normalizedName = normalizeAttributeName(attribute.name); 31189 // `*attr` defines template bindings 31190 let isTemplateBinding = false; 31191 if (attribute.i18n) { 31192 i18nAttrsMeta[attribute.name] = attribute.i18n; 31193 } 31194 if (normalizedName.startsWith(TEMPLATE_ATTR_PREFIX)) { 31195 // *-attributes 31196 if (elementHasInlineTemplate) { 31197 this.reportError(`Can't have multiple template bindings on one element. Use only one attribute prefixed with *`, attribute.sourceSpan); 31198 } 31199 isTemplateBinding = true; 31200 elementHasInlineTemplate = true; 31201 const templateValue = attribute.value; 31202 const templateKey = normalizedName.substring(TEMPLATE_ATTR_PREFIX.length); 31203 const parsedVariables = []; 31204 const absoluteValueOffset = attribute.valueSpan ? attribute.valueSpan.start.offset : 31205 // If there is no value span the attribute does not have a value, like `attr` in 31206 //`<div attr></div>`. In this case, point to one character beyond the last character of 31207 // the attribute name. 31208 attribute.sourceSpan.start.offset + attribute.name.length; 31209 this.bindingParser.parseInlineTemplateBinding(templateKey, templateValue, attribute.sourceSpan, absoluteValueOffset, [], templateParsedProperties, parsedVariables, true /* isIv
31209yAst */); 31210 templateVariables.push(...parsedVariables.map(v => new Variable(v.name, v.value, v.sourceSpan, v.keySpan, v.valueSpan))); 31211 } else { 31212 // Check for variables, events, property bindings, interpolation 31213 hasBinding = this.parseAttribute(isTemplateElement, attribute, [], parsedProperties, boundEvents, variables, references); 31214 } 31215 if (!hasBinding && !isTemplateBinding) { 31216 // don't include the bindings as attributes as well in the AST 31217 attributes.push(this.visitAttribute(attribute)); 31218 } 31219 } 31220 let children; 31221 if (preparsedElement.nonBindable) { 31222 // The `NonBindableVisitor` may need to return an array of nodes for blocks so we need 31223 // to flatten the array here. Avoid doing this for the `HtmlAstToIvyAst` since `flat` creates 31224 // a new array. 31225 children = visitAll(NON_BINDABLE_VISITOR, element.children).flat(Infinity); 31226 } else { 31227 children = visitAll(this, element.children, element.children); 31228 } 31229 let parsedElement; 31230 if (preparsedElement.type === PreparsedElementType.NG_CONTENT) { 31231 const selector = preparsedElement.selectAttr; 31232 const attrs = element.attrs.map(attr => this.visitAttribute(attr)); 31233 parsedElement = new Content(selector, attrs, children, element.sourceSpan, element.i18n); 31234 this.ngContentSelectors.push(selector); 31235 } else if (isTemplateElement) { 31236 // `<ng-template>` 31237 const attrs = this.extractAttributes(element.name, parsedProperties, i18nAttrsMeta); 31238 parsedElement = new Template(element.name, attributes, attrs.bound, boundEvents, [ 31239 /* no template attributes */ 31240 ], children, references, variables, element.sourceSpan, element.startSourceSpan, element.endSourceSpan, element.i18n); 31241 } else { 31242 const attrs = this.extractAttributes(element.name, parsedProperties, i18nAttrsMeta); 31243 parsedElement = new Element$1(element.name, attributes, attrs.bound, boundEvents, children, references, element.sourceSpan, element.startSourceSpan, element.endSourceSpan, element.i18n); 31244 } 31245 if (elementHasInlineTemplate) { 31246 // If this node is an inline-template (e.g. has *ngFor) then we need to create a template
31247 // node that contains this node. 31248 // Moreover, if the node is an element, then we need to hoist its attributes to the template 31249 // node for matching against content projection selectors. 31250 const attrs = this.extractAttributes('ng-template', templateParsedProperties, i18nAttrsMeta); 31251 const templateAttrs = []; 31252 attrs.literal.forEach(attr => templateAttrs.push(attr)); 31253 attrs.bound.forEach(attr => templateAttrs.push(attr)); 31254 const hoistedAttrs = parsedElement instanceof Element$1 ? { 31255 attributes: parsedElement.attributes, 31256 inputs: parsedElement.inputs, 31257 outputs: parsedElement.outputs 31258 } : { 31259 attributes: [], 31260 inputs: [], 31261 outputs: [] 31262 }; 31263 // For <ng-template>s with structural directives on them, avoid passing i18n information to 31264 // the wrapping template to prevent unnecessary i18n instructions from being generated. The 31265 // necessary i18n meta information will be extracted from child elements. 31266 const i18n = isTemplateElement && isI18nRootElement ? undefined : element.i18n; 31267 const name = parsedElement instanceof Template ? null : parsedElement.name; 31268 parsedElement = new Template(name, hoistedAttrs.attributes, hoistedAttrs.inputs, hoistedAttrs.outputs, templateAttrs, [parsedElement], [ 31269 /* no references */ 31270 ], templateVariables, element.sourceSpan, element.startSourceSpan, element.endSourceSpan, i18n); 31271 } 31272 if (isI18nRootElement) { 31273 this.inI18nBlock = false; 31274 } 31275 return parsedElement; 31276 } 31277 visitAttribute(attribute) { 31278 return new TextAttribute(attribute.name, attribute.value, attribute.sourceSpan, attribute.keySpan, attribute.valueSpan, attribute.i18n); 31279 } 31280 visitText(text) { 31281 return this.processedNodes.has(text) ? null : this._visitTextWithInterpolation(text.value, text.sourceSpan, text.tokens, text.i18n); 31282 } 31283 visitExpansion(expansion) { 31284 if (!expansion.i18n) { 31285 // do not generate Icu in case it was created 31286 // outside of i18n block in a template 31287 return null; 31288 } 31289 if (!isI18nRootNode(expansion.i18n)) { 31290 throw new Error(`Invalid type "${expansion.i18n.constructor}" for "i18n" property of ${expansion.sourceSpan.toString()}. Expected a "Message"`); 31291 } 31292 const message = expansion.i18n; 31293 const vars = {}; 31294 const placeholders = {}; 31295 // extract VARs from ICUs - we process them separately while 31296 // assembling resulting message via goog.getMsg function, since 31297 // we need to pass them to top-level goog.getMsg call 31298 Object.keys(message.placeholders).forEach(key => { 31299 const value = message.placeholders[key]; 31300 if (key.startsWith(I18N_ICU_VAR_PREFIX)) { 31301 // Currently when the `plural` or `select` keywords in an ICU contain trailing spaces (e.g. 31302 // `{count, select , ...}`), these spaces are also included into the key names in ICU vars 31303 // (e.g. "VAR_SELECT "). These trailing spaces are not desirable, since they will later be 31304 // converted into `_` symbols while normalizing placeholder names, which might lead to 31305 // mismatches at runtime (i.e. placeholder will not be replaced with the correct value). 31306 const formattedKey = key.trim(); 31307 const ast = this.bindingParser.parseInterpolationExpression(value.text, value.sourceSpan); 31308 vars[formattedKey] = new BoundText(ast, value.sourceSpan); 31309 } else { 31310 placeholders[key] = this._visitTextWithInterpolation(value.text, value.sourceSpan, null); 31311 } 31312 }); 31313 return new Icu$1(vars, placeholders, expansion.sourceSpan, message); 31314 } 31315 visitExpansionCase(expansionCase) { 31316 return null; 31317 } 31318 visitComment(comment) { 31319 if (this.options.collectCommentNodes) { 31320 this.commentNodes.push(new Comment$1(comment.value || '', comment.sourceSpan)); 31321 } 31322 return null; 31323 } 31324 visitLetDeclaration(decl, context) { 31325 const value = this.bindingParser.parseBinding(decl.value, false, decl.valueSpan, decl.valueSpan.start.offset); 31326 if (value.errors.length === 0 && value.ast instanceof EmptyExpr$1) { 31327 this.reportError('@let declaration value cannot be empty', decl.valueSpan); 31328 } 31329 return new LetDeclaration$1(decl.name, value, decl.sourceSpan, decl.nameSpan, decl.valueSpan); 31330 } 31331 visitBlockParameter() { 31332 return null; 31333 } 31334 visitBlock(block, context) {
31335 const index = Array.isArray(context) ? context.indexOf(block) : -1; 31336 if (index === -1) { 31337 throw new Error('Visitor invoked incorrectly. Expecting visitBlock to be invoked siblings array as its context'); 31338 } 31339 // Connected blocks may have been processed as a part of the previous block. 31340 if (this.processedNodes.has(block)) { 31341 return null; 31342 } 31343 let result = null; 31344 switch (block.name) { 31345 case 'defer': 31346 result = createDeferredBlock(block, this.findConnectedBlocks(index, context, isConnectedDeferLoopBlock), this, this.bindingParser); 31347 break; 31348 case 'switch': 31349 result = createSwitchBlock(block, this, this.bindingParser); 31350 break; 31351 case 'for': 31352 result = createForLoop(block, this.findConnectedBlocks(index, context, isConnectedForLoopBlock), this, this.bindingParser); 31353 break; 31354 case 'if': 31355 result = createIfBlock(block, this.findConnectedBlocks(index, context, isConnectedIfLoopBlock), this, this.bindingParser); 31356 break; 31357 default: 31358 let errorMessage; 31359 if (isConnectedDeferLoopBlock(block.name)) { 31360 errorMessage = `@${block.name} block can only be used after an @defer block.`; 31361 this.processedNodes.add(block); 31362 } else if (isConnectedForLoopBlock(block.name)) { 31363 errorMessage = `@${block.name} block can only be used after an @for block.`; 31364 this.processedNodes.add(block); 31365 } else if (isConnectedIfLoopBlock(block.name)) { 31366 errorMessage = `@${block.name} block can only be used after an @if or @else if block.`; 31367 this.processedNodes.add(block); 31368 } else { 31369 errorMessage = `Unrecognized block @${block.name}.`; 31370 } 31371 result = { 31372 node: new UnknownBlock(block.name, block.sourceSpan, block.nameSpan), 31373 errors: [new ParseError(block.sourceSpan, errorMessage)] 31374 }; 31375 break; 31376 } 31377 this.errors.push(...result.errors); 31378 return result.node; 31379 } 31380 findConnectedBlocks(primaryBlockIndex, siblings, predicate) { 31381 const relatedBlocks = []; 31382 for (let i = primaryBlockIndex + 1; i < siblings.length; i++) { 31383 const node = siblings[i]; 31384 // Skip over comments. 31385 if (node instanceof Comment) { 31386 continue; 31387 } 31388 // Ignore empty text nodes between blocks. 31389 if (node instanceof Text && node.value.trim().length === 0) { 31390 // Add the text node to the processed nodes since we don't want 31391 // it to be generated between the connected nodes. 31392 this.processedNodes.add(node); 31393 continue; 31394 } 31395 // Stop searching as soon as we hit a non-block node or a block that is unrelated. 31396 if (!(node instanceof Block) || !predicate(node.name)) { 31397 break; 31398 } 31399 relatedBlocks.push(node); 31400 this.processedNodes.add(node); 31401 } 31402 return relatedBlocks; 31403 } 31404 // convert view engine `ParsedProperty` to a format suitable for IVY 31405 extractAttributes(elementName, properties, i18nPropsMeta) { 31406 const bound = []; 31407 const literal = []; 31408 properties.forEach(prop => { 31409 const i18n = i18nPropsMeta[prop.name]; 31410 if (prop.isLiteral) { 31411 literal.push(new TextAttribute(prop.name, prop.expression.source || '', prop.sourceSpan, prop.keySpan, prop.valueSpan, i18n)); 31412 } else { 31413 // Note that validation is skipped and property mapping is disabled 31414 // due to the fact that we need to make sure a given prop is not an 31415 // input of a directive and directive matching happens at runtime. 31416 const bep = this.bindingParser.createBoundElementProperty(elementName, prop, /* skipValidation */true, /* mapPropertyName */false); 31417 bound.push(BoundAttribute.fromBoundElementProperty(bep, i18n)); 31418 } 31419 }); 31420 return { 31421 bound, 31422 literal 31423 }; 31424 } 31425 parseAttribute(isTemplateElement, attribute, matchableAttributes, parsedProperties, boundEvents, variables, references) { 31426 var _attribute$valueToken; 31427 const name = normalizeAttributeName(attribute.name); 31428 const value = attribute.value; 31429 const srcSpan = attribute.sourceSpan; 31430 const absoluteOffset = attribute.valueSpan ? attribute.valueSpan.start.offset : srcSpan.start.offset; 31431 function createKeySpan(srcSpan, prefix, identifier) { 31432 // We need to adjust the start location for the keySpan to account for the removed 'data-' 31433 // prefix from `normalizeAttributeName`. 31434 const normalizationAdjustment = attribute.name.length - name.length;
31435 const keySpanStart = srcSpan.start.moveBy(prefix.length + normalizationAdjustment); 31436 const keySpanEnd = keySpanStart.moveBy(identifier.length); 31437 return new ParseSourceSpan(keySpanStart, keySpanEnd, keySpanStart, identifier); 31438 } 31439 const bindParts = name.match(BIND_NAME_REGEXP); 31440 if (bindParts) { 31441 if (bindParts[KW_BIND_IDX] != null) { 31442 const identifier = bindParts[IDENT_KW_IDX]; 31443 const keySpan = createKeySpan(srcSpan, bindParts[KW_BIND_IDX], identifier); 31444 this.bindingParser.parsePropertyBinding(identifier, value, false, false, srcSpan, absoluteOffset, attribute.valueSpan, matchableAttributes, parsedProperties, keySpan); 31445 } else if (bindParts[KW_LET_IDX]) { 31446 if (isTemplateElement) { 31447 const identifier = bindParts[IDENT_KW_IDX]; 31448 const keySpan = createKeySpan(srcSpan, bindParts[KW_LET_IDX], identifier); 31449 this.parseVariable(identifier, value, srcSpan, keySpan, attribute.valueSpan, variables); 31450 } else { 31451 this.reportError(`"let-" is only supported on ng-template elements.`, srcSpan); 31452 } 31453 } else if (bindParts[KW_REF_IDX]) { 31454 const identifier = bindParts[IDENT_KW_IDX]; 31455 const keySpan = createKeySpan(srcSpan, bindParts[KW_REF_IDX], identifier); 31456 this.parseReference(identifier, value, srcSpan, keySpan, attribute.valueSpan, references); 31457 } else if (bindParts[KW_ON_IDX]) { 31458 const events = []; 31459 const identifier = bindParts[IDENT_KW_IDX]; 31460 const keySpan = createKeySpan(srcSpan, bindParts[KW_ON_IDX], identifier); 31461 this.bindingParser.parseEvent(identifier, value, /* isAssignmentEvent */false, srcSpan, attribute.valueSpan || srcSpan, matchableAttributes, events, keySpan); 31462 addEvents(events, boundEvents); 31463 } else if (bindParts[KW_BINDON_IDX]) { 31464 const identifier = bindParts[IDENT_KW_IDX]; 31465 const keySpan = createKeySpan(srcSpan, bindParts[KW_BINDON_IDX], identifier); 31466 this.bindingParser.parsePropertyBinding(identifier, value, false, true, srcSpan, absoluteOffset, attribute.valueSpan, matchableAttributes, parsedProperties, keySpan); 31467 this.parseAssignmentEvent(identifier, value, srcSpan, attribute.valueSpan, matchableAttributes, boundEvents, keySpan); 31468 } else if (bindParts[KW_AT_IDX]) { 31469 const keySpan = createKeySpan(srcSpan, '', name); 31470 this.bindingParser.parseLiteralAttr(name, value, srcSpan, absoluteOffset, attribute.valueSpan, matchableAttributes, parsedProperties, keySpan); 31471 } 31472 return true; 31473 } 31474 // We didn't see a kw-prefixed property binding, but we have not yet checked 31475 // for the []/()/[()] syntax. 31476 let delims = null; 31477 if (name.startsWith(BINDING_DELIMS.BANANA_BOX.start)) { 31478 delims = BINDING_DELIMS.BANANA_BOX; 31479 } else if (name.startsWith(BINDING_DELIMS.PROPERTY.start)) { 31480 delims = BINDING_DELIMS.PROPERTY; 31481 } else if (name.startsWith(BINDING_DELIMS.EVENT.start)) { 31482 delims = BINDING_DELIMS.EVENT; 31483 } 31484 if (delims !== null && 31485 // NOTE: older versions of the parser would match a start/end delimited 31486 // binding iff the property name was terminated by the ending delimiter 31487 // and the identifier in the binding was non-empty. 31488 // TODO(ayazhafiz): update this to handle malformed bindings. 31489 name.endsWith(delims.end) && name.length > delims.start.length + delims.end.length) { 31490 const identifier = name.substring(delims.start.length, name.length - delims.end.length); 31491 const keySpan = createKeySpan(srcSpan, delims.start, identifier); 31492 if (delims.start === BINDING_DELIMS.BANANA_BOX.start) { 31493 this.bindingParser.parsePropertyBinding(identifier, value, false, true, srcSpan, absoluteOffset, attribute.valueSpan, matchableAttributes, parsedProperties, keySpan); 31494 this.parseAssignmentEvent(identifier, value, srcSpan, attribute.valueSpan, matchableAttributes, boundEvents, keySpan); 31495 } else if (delims.start === BINDING_DELIMS.PROPERTY.start) { 31496 this.bindingParser.parsePropertyBinding(identifier, value, false, false, srcSpan, absoluteOffset, attribute.valueSpan, matchableAttributes, parsedProperties, keySpan); 31497 } else { 31498 const events = []; 31499 this.bindingParser.parseEvent(identifier, value, /* isAssignmentEvent */false, srcSpan, attribute.valueSpan || srcSpan, matchableAttributes, events, keySpan); 31500 addEvents(events, boundEvents); 31501 } 31502 return true; 31503 } 31504 // No explicit binding found.
31505 const keySpan = createKeySpan(srcSpan, '' /* prefix */, name); 31506 const hasBinding = this.bindingParser.parsePropertyInterpolation(name, value, srcSpan, attribute.valueSpan, matchableAttributes, parsedProperties, keySpan, (_attribute$valueToken = attribute.valueTokens) !== null && _attribute$valueToken !== void 0 ? _attribute$valueToken : null); 31507 return hasBinding; 31508 } 31509 _visitTextWithInterpolation(value, sourceSpan, interpolatedTokens, i18n) { 31510 const valueNoNgsp = replaceNgsp(value); 31511 const expr = this.bindingParser.parseInterpolation(valueNoNgsp, sourceSpan, interpolatedTokens); 31512 return expr ? new BoundText(expr, sourceSpan, i18n) : new Text$3(valueNoNgsp, sourceSpan); 31513 } 31514 parseVariable(identifier, value, sourceSpan, keySpan, valueSpan, variables) { 31515 if (identifier.indexOf('-') > -1) { 31516 this.reportError(`"-" is not allowed in variable names`, sourceSpan); 31517 } else if (identifier.length === 0) { 31518 this.reportError(`Variable does not have a name`, sourceSpan); 31519 } 31520 variables.push(new Variable(identifier, value, sourceSpan, keySpan, valueSpan)); 31521 } 31522 parseReference(identifier, value, sourceSpan, keySpan, valueSpan, references) { 31523 if (identifier.indexOf('-') > -1) { 31524 this.reportError(`"-" is not allowed in reference names`, sourceSpan); 31525 } else if (identifier.length === 0) { 31526 this.reportError(`Reference does not have a name`, sourceSpan); 31527 } else if (references.some(reference => reference.name === identifier)) { 31528 this.reportError(`Reference "#${identifier}" is defined more than once`, sourceSpan); 31529 } 31530 references.push(new Reference(identifier, value, sourceSpan, keySpan, valueSpan)); 31531 } 31532 parseAssignmentEvent(name, expression, sourceSpan, valueSpan, targetMatchableAttrs, boundEvents, keySpan) { 31533 const events = []; 31534 this.bindingParser.parseEvent(`${name}Change`, expression, /* isAssignmentEvent */true, sourceSpan, valueSpan || sourceSpan, targetMatchableAttrs, events, keySpan); 31535 addEvents(events, boundEvents); 31536 } 31537 reportError(message, sourceSpan, level = ParseErrorLevel.ERROR) { 31538 this.errors.push(new ParseError(sourceSpan, message, level)); 31539 } 31540} 31541class NonBindableVisitor { 31542 visitElement(ast) { 31543 const preparsedElement = preparseElement(ast); 31544 if (preparsedElement.type === PreparsedElementType.SCRIPT || preparsedElement.type === PreparsedElementType.STYLE || preparsedElement.type === PreparsedElementType.STYLESHEET) { 31545 // Skipping <script> for security reasons 31546 // Skipping <style> and stylesheets as we already processed them 31547 // in the StyleCompiler 31548 return null; 31549 } 31550 const children = visitAll(this, ast.children, null); 31551 return new Element$1(ast.name, visitAll(this, ast.attrs), /* inputs */[], /* outputs */[], children, /* references */[], ast.sourceSpan, ast.startSourceSpan, ast.endSourceSpan); 31552 } 31553 visitComment(comment) { 31554 return null; 31555 } 31556 visitAttribute(attribute) { 31557 return new TextAttribute(attribute.name, attribute.value, attribute.sourceSpan, attribute.keySpan, attribute.valueSpan, attribute.i18n); 31558 } 31559 visitText(text) { 31560 return new Text$3(text.value, text.sourceSpan); 31561 } 31562 visitExpansion(expansion) { 31563 return null; 31564 } 31565 visitExpansionCase(expansionCase) { 31566 return null; 31567 } 31568 visitBlock(block, context) { 31569 const nodes = [ 31570 // In an ngNonBindable context we treat the opening/closing tags of block as plain text. 31571 // This is the as if the `tokenizeBlocks` option was disabled. 31572 new Text$3(block.startSourceSpan.toString(), block.startSourceSpan), ...visitAll(this, block.children)]; 31573 if (block.endSourceSpan !== null) { 31574 nodes.push(new Text$3(block.endSourceSpan.toString(), block.endSourceSpan)); 31575 } 31576 return nodes; 31577 } 31578 visitBlockParameter(parameter, context) { 31579 return null; 31580 } 31581 visitLetDeclaration(decl, context) { 31582 return new Text$3(`@let ${decl.name} = ${decl.value};`, decl.sourceSpan); 31583 } 31584} 31585const NON_BINDABLE_VISITOR = new NonBindableVisitor(); 31586function normalizeAttributeName(attrName) { 31587 return /^data-/i.test(attrName) ? attrName.substring(5) : attrName; 31588} 31589function addEvents(events, boundEvents) { 31590 boundEvents.push(...events.map(e => BoundEvent.fromParsedEvent(e))); 31591} 31592function textContents(node) { 31593 if (node.children.length !== 1 || !(node.children[0] instanceof Text)) { 31594 return null; 31595 } else { 31596 return node.children[0].value; 31597 } 31598} 31599const LEADING_TRIVIA_CHARS = [' ', '\n', '\r', '\t']; 31600/** 31601 * Parse a template into render3 `Node`s and additional metadata, with no other dependencies. 31602 * 31603 * @param template text of the template to parse 31604 * @param templateUrl URL to use for source mapping of the parsed template 31605 * @param options options to modify how the template is parsed 31606 */ 31607function parseTemplate(template, templateUrl, options = {}) { 31608 var _options$enableBlockS, _options$enableLetSyn, _options$preserveSign; 31609 const { 31610 interpolationConfig,
31611 preserveWhitespaces, 31612 enableI18nLegacyMessageIdFormat 31613 } = options; 31614 const bindingParser = makeBindingParser(interpolationConfig); 31615 const htmlParser = new HtmlParser(); 31616 const parseResult = htmlParser.parse(template, templateUrl, (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({ 31617 leadingTriviaChars: LEADING_TRIVIA_CHARS 31618 }, options), {}, { 31619 tokenizeExpansionForms: true, 31620 tokenizeBlocks: (_options$enableBlockS = options.enableBlockSyntax) !== null && _options$enableBlockS !== void 0 ? _options$enableBlockS : true, 31621 tokenizeLet: (_options$enableLetSyn = options.enableLetSyntax) !== null && _options$enableLetSyn !== void 0 ? _options$enableLetSyn : true 31622 })); 31623 if (!options.alwaysAttemptHtmlToR3AstConversion && parseResult.errors && parseResult.errors.length > 0) { 31624 const parsedTemplate = { 31625 interpolationConfig, 31626 preserveWhitespaces, 31627 errors: parseResult.errors, 31628 nodes: [], 31629 styleUrls: [], 31630 styles: [], 31631 ngContentSelectors: [] 31632 }; 31633 if (options.collectCommentNodes) { 31634 parsedTemplate.commentNodes = []; 31635 } 31636 return parsedTemplate; 31637 } 31638 let rootNodes = parseResult.rootNodes; 31639 // We need to use the same `retainEmptyTokens` value for both parses to avoid 31640 // causing a mismatch when reusing source spans, even if the 31641 // `preserveSignificantWhitespace` behavior is different between the two 31642 // parses. 31643 const retainEmptyTokens = !((_options$preserveSign = options.preserveSignificantWhitespace) !== null && _options$preserveSign !== void 0 ? _options$preserveSign : true); 31644 // process i18n meta information (scan attributes, generate ids) 31645 // before we run whitespace removal process, because existing i18n 31646 // extraction process (ng extract-i18n) relies on a raw content to generate 31647 // message ids 31648 const i18nMetaVisitor = new I18nMetaVisitor(interpolationConfig, /* keepI18nAttrs */!preserveWhitespaces, enableI18nLegacyMessageIdFormat, /* containerBlocks */undefined, options.preserveSignificantWhitespace, retainEmptyTokens); 31649 const i18nMetaResult = i18nMetaVisitor.visitAllWithErrors(rootNodes); 31650 if (!options.alwaysAttemptHtmlToR3AstConversion && i18nMetaResult.errors && i18nMetaResult.errors.length > 0) { 31651 const parsedTemplate = { 31652 interpolationConfig, 31653 preserveWhitespaces, 31654 errors: i18nMetaResult.errors, 31655 nodes: [], 31656 styleUrls: [], 31657 styles: [], 31658 ngContentSelectors: [] 31659 }; 31660 if (options.collectCommentNodes) { 31661 parsedTemplate.commentNodes = []; 31662 } 31663 return parsedTemplate; 31664 } 31665 rootNodes = i18nMetaResult.rootNodes; 31666 if (!preserveWhitespaces) { 31667 // Always preserve significant whitespace here because this is used to generate the `goog.getMsg` 31668 // and `$localize` calls which should retain significant whitespace in order to render the 31669 // correct output. We let this diverge from the message IDs generated earlier which might not 31670 // have preserved significant whitespace. 31671 // 31672 // This should use `visitAllWithSiblings` to set `WhitespaceVisitor` context correctly, however 31673 // there is an existing bug where significant whitespace is not properly retained in the JS 31674 // output of leading/trailing whitespace for ICU messages due to the existing lack of context\ 31675 // in `WhitespaceVisitor`. Using `visitAllWithSiblings` here would fix that bug and retain the 31676 // whitespace, however it would also change the runtime representation which we don't want to do 31677 // right now. 31678 rootNodes = visitAll(new WhitespaceVisitor(/* preserveSignificantWhitespace */true, /* originalNodeMap */undefined, /* requireContext */false), rootNodes); 31679 // run i18n meta visitor again in case whitespaces are removed (because that might affect 31680 // generated i18n message content) and first pass indicated that i18n content is present in a 31681 // template. During this pass i18n IDs generated at the first pass will be preserved, so we can 31682 // mimic existing extraction process (ng extract-i18n) 31683 if (i18nMetaVisitor.hasI18nMeta) { 31684 rootNodes = visitAll(new I18nMetaVisitor(interpolationConfig, /* keepI18nAttrs */false, /* enableI18nLegacyMessageIdFormat */undefined, /* containerBlocks */undefined, /* preserveSignificantWhitespace */true, retainEmptyTokens), rootNodes); 31685 } 31686 } 31687 const { 31688 nodes, 31689 errors, 31690 styleUrls, 31691 styles, 31692 ngContentSelectors, 31693 commentNodes 31694 } = htmlAstToRender3Ast(rootNodes, bindingParser, { 31695 collectCommentNodes: !!options.collectCommentNodes 31696 }); 31697 errors.push(...parseResult.errors, ...i18nMetaResult.errors); 31698 const parsedTemplate = { 31699 interpolationConfig,
31700 preserveWhitespaces, 31701 errors: errors.length > 0 ? errors : null, 31702 nodes, 31703 styleUrls, 31704 styles, 31705 ngContentSelectors 31706 }; 31707 if (options.collectCommentNodes) { 31708 parsedTemplate.commentNodes = commentNodes; 31709 } 31710 return parsedTemplate; 31711} 31712const elementRegistry = new DomElementSchemaRegistry(); 31713/** 31714 * Construct a `BindingParser` with a default configuration. 31715 */ 31716function makeBindingParser(interpolationConfig = DEFAULT_INTERPOLATION_CONFIG) { 31717 return new BindingParser(new Parser(new Lexer()), interpolationConfig, elementRegistry, []); 31718} 31719const COMPONENT_VARIABLE = '%COMP%'; 31720const HOST_ATTR = `_nghost-${COMPONENT_VARIABLE}`; 31721const CONTENT_ATTR = `_ngcontent-${COMPONENT_VARIABLE}`; 31722function baseDirectiveFields(meta, constantPool, bindingParser) { 31723 const definitionMap = new DefinitionMap(); 31724 const selectors = parseSelectorToR3Selector(meta.selector); 31725 // e.g. `type: MyDirective` 31726 definitionMap.set('type', meta.type.value); 31727 // e.g. `selectors: [['', 'someDir', '']]` 31728 if (selectors.length > 0) { 31729 definitionMap.set('selectors', asLiteral(selectors)); 31730 } 31731 if (meta.queries.length > 0) { 31732 // e.g. `contentQueries: (rf, ctx, dirIndex) => { ... } 31733 definitionMap.set('contentQueries', createContentQueriesFunction(meta.queries, constantPool, meta.name)); 31734 } 31735 if (meta.viewQueries.length) { 31736 definitionMap.set('viewQuery', createViewQueriesFunction(meta.viewQueries, constantPool, meta.name)); 31737 } 31738 // e.g. `hostBindings: (rf, ctx) => { ... } 31739 definitionMap.set('hostBindings', createHostBindingsFunction(meta.host, meta.typeSourceSpan, bindingParser, constantPool, meta.selector || '', meta.name, definitionMap)); 31740 // e.g 'inputs: {a: 'a'}` 31741 definitionMap.set('inputs', conditionallyCreateDirectiveBindingLiteral(meta.inputs, true)); 31742 // e.g 'outputs: {a: 'a'}` 31743 definitionMap.set('outputs', conditionallyCreateDirectiveBindingLiteral(meta.outputs)); 31744 if (meta.exportAs !== null) { 31745 definitionMap.set('exportAs', literalArr(meta.exportAs.map(e => literal(e)))); 31746 } 31747 if (meta.isStandalone === false) { 31748 definitionMap.set('standalone', literal(false)); 31749 } 31750 if (meta.isSignal) { 31751 definitionMap.set('signals', literal(true)); 31752 } 31753 return definitionMap; 31754} 31755/** 31756 * Add features to the definition map. 31757 */ 31758function addFeatures(definitionMap, meta) { 31759 var _meta$hostDirectives, _meta$externalStyles; 31760 // e.g. `features: [NgOnChangesFeature]` 31761 const features = []; 31762 const providers = meta.providers; 31763 const viewProviders = meta.viewProviders; 31764 if (providers || viewProviders) { 31765 const args = [providers || new LiteralArrayExpr([])]; 31766 if (viewProviders) { 31767 args.push(viewProviders); 31768 } 31769 features.push(importExpr(Identifiers.ProvidersFeature).callFn(args)); 31770 } 31771 // Note: host directives feature needs to be inserted before the 31772 // inheritance feature to ensure the correct execution order. 31773 if ((_meta$hostDirectives = meta.hostDirectives) !== null && _meta$hostDirectives !== void 0 && _meta$hostDirectives.length) { 31774 features.push(importExpr(Identifiers.HostDirectivesFeature).callFn([createHostDirectivesFeatureArg(meta.hostDirectives)])); 31775 } 31776 if (meta.usesInheritance) { 31777 features.push(importExpr(Identifiers.InheritDefinitionFeature)); 31778 } 31779 if (meta.fullInheritance) { 31780 features.push(importExpr(Identifiers.CopyDefinitionFeature)); 31781 } 31782 if (meta.lifecycle.usesOnChanges) { 31783 features.push(importExpr(Identifiers.NgOnChangesFeature)); 31784 } 31785 if ('externalStyles' in meta && (_meta$externalStyles = meta.externalStyles) !== null && _meta$externalStyles !== void 0 && _meta$externalStyles.length) { 31786 const externalStyleNodes = meta.externalStyles.map(externalStyle => literal(externalStyle)); 31787 features.push(importExpr(Identifiers.ExternalStylesFeature).callFn([literalArr(externalStyleNodes)])); 31788 } 31789 if (features.length) { 31790 definitionMap.set('features', literalArr(features)); 31791 } 31792} 31793/** 31794 * Compile a directive for the render3 runtime as defined by the `R3DirectiveMetadata`. 31795 */ 31796function compileDirectiveFromMetadata(meta, constantPool, bindingParser) { 31797 const definitionMap = baseDirectiveFields(meta, constantPool, bindingParser); 31798 addFeatures(definitionMap, meta); 31799 const expression = importExpr(Identifiers.defineDirective).callFn([definitionMap.toLiteralMap()], undefined, true); 31800 const type = createDirectiveType(meta); 31801 return { 31802 expression, 31803 type, 31804 statements: [] 31805 }; 31806} 31807/** 31808 * Compile a component for the render3 runtime as defined by the `R3ComponentMetadata`. 31809 */ 31810function compileComponentFromMetadata(meta, constantPool, bindingParser) { 31811 var _meta$externalStyles2; 31812 const definitionMap = baseDirectiveFields(meta, constantPool, bindingParser); 31813 addFeatures(definitionMap, meta); 31814 const selector = meta.selector && CssSelector.parse(meta.selector); 31815 const firstSelector = selector && selector[0]; 31816 // e.g. `attr: ["class", ".my.app"]` 31817 // This is optional an only included if the first selector of a component specifies attributes. 31818 if (firstSelector) { 31819 const selectorAttributes = firstSelector.getAttrs(); 31820 if (selectorAttributes.length) { 31821 definitionMap.set('attrs', constantPool.getConstLiteral(literalArr(selectorAttributes.map(value => value != null ? literal(value) : literal(undefined))), /* forceShared */true)); 31822 } 31823 } 31824 // e.g. `template: function MyComponent_Template(_ctx, _cm) {...}` 31825 const templateTypeName = meta.name; 31826 let allDeferrableDepsFn = null; 31827 if (meta.defer.mode === 1 /* DeferBlockDepsEmitMode.PerComponent */ && meta.defer.dependenciesFn !== null) { 31828 const fnName = `${templateTypeName}_DeferFn`; 31829 constantPool.statements.push(new DeclareVarStmt(fnName, meta.defer.dependenciesFn, undefined, StmtModifier.Final)); 31830 allDeferrableDepsFn = variable(fnName); 31831 } 31832 // First the template is ingested into IR: 31833 const tpl = ingestComponent(meta.name, meta.template.nodes, constantPool, meta.relativeContextFilePath, meta.i18nUseExternalIds, meta.defer, allDeferrableDepsFn, meta.relativeTemplatePath, getTemplateSourceLocationsEnabled()); 31834 // Then the IR is transformed to prepare it for cod egeneration. 31835 transform(tpl, CompilationJobKind.Tmpl); 31836 // Finally we emit the template function: 31837 const templateFn = emitTemplateFn(tpl, constantPool); 31838 if (tpl.contentSelectors !== null) { 31839 definitionMap.set('ngContentSelectors', tpl.contentSelectors); 31840 } 31841 definitionMap.set('decls', literal(tpl.root.decls)); 31842 definitionMap.set('vars', literal(tpl.root.vars)); 31843 if (tpl.consts.length > 0) {
31844 if (tpl.constsInitializers.length > 0) { 31845 definitionMap.set('consts', arrowFn([], [...tpl.constsInitializers, new ReturnStatement(literalArr(tpl.consts))])); 31846 } else { 31847 definitionMap.set('consts', literalArr(tpl.consts)); 31848 } 31849 } 31850 definitionMap.set('template', templateFn); 31851 if (meta.declarationListEmitMode !== 3 /* DeclarationListEmitMode.RuntimeResolved */ && meta.declarations.length > 0) { 31852 definitionMap.set('dependencies', compileDeclarationList(literalArr(meta.declarations.map(decl => decl.type)), meta.declarationListEmitMode)); 31853 } else if (meta.declarationListEmitMode === 3 /* DeclarationListEmitMode.RuntimeResolved */) { 31854 const args = [meta.type.value]; 31855 if (meta.rawImports) { 31856 args.push(meta.rawImports); 31857 } 31858 definitionMap.set('dependencies', importExpr(Identifiers.getComponentDepsFactory).callFn(args)); 31859 } 31860 if (meta.encapsulation === null) { 31861 meta.encapsulation = ViewEncapsulation$1.Emulated; 31862 } 31863 let hasStyles = !!((_meta$externalStyles2 = meta.externalStyles) !== null && _meta$externalStyles2 !== void 0 && _meta$externalStyles2.length); 31864 // e.g. `styles: [str1, str2]` 31865 if (meta.styles && meta.styles.length) { 31866 const styleValues = meta.encapsulation == ViewEncapsulation$1.Emulated ? compileStyles(meta.styles, CONTENT_ATTR, HOST_ATTR) : meta.styles; 31867 const styleNodes = styleValues.reduce((result, style) => { 31868 if (style.trim().length > 0) { 31869 result.push(constantPool.getConstLiteral(literal(style))); 31870 } 31871 return result; 31872 }, []); 31873 if (styleNodes.length > 0) { 31874 hasStyles = true; 31875 definitionMap.set('styles', literalArr(styleNodes)); 31876 } 31877 } 31878 if (!hasStyles && meta.encapsulation === ViewEncapsulation$1.Emulated) { 31879 // If there is no style, don't generate css selectors on elements 31880 meta.encapsulation = ViewEncapsulation$1.None; 31881 } 31882 // Only set view encapsulation if it's not the default value 31883 if (meta.encapsulation !== ViewEncapsulation$1.Emulated) { 31884 definitionMap.set('encapsulation', literal(meta.encapsulation)); 31885 } 31886 // e.g. `animation: [trigger('123', [])]` 31887 if (meta.animations !== null) { 31888 definitionMap.set('data', literalMap([{ 31889 key: 'animation', 31890 value: meta.animations, 31891 quoted: false 31892 }])); 31893 } 31894 // Setting change detection flag 31895 if (meta.changeDetection !== null) { 31896 if (typeof meta.changeDetection === 'number' && meta.changeDetection !== ChangeDetectionStrategy.Default) { 31897 // changeDetection is resolved during analysis. Only set it if not the default. 31898 definitionMap.set('changeDetection', literal(meta.changeDetection)); 31899 } else if (typeof meta.changeDetection === 'object') { 31900 // changeDetection is not resolved during analysis (e.g., we are in local compilation mode). 31901 // So place it as is. 31902 definitionMap.set('changeDetection', meta.changeDetection); 31903 } 31904 } 31905 const expression = importExpr(Identifiers.defineComponent).callFn([definitionMap.toLiteralMap()], undefined, true); 31906 const type = createComponentType(meta); 31907 return { 31908 expression, 31909 type, 31910 statements: [] 31911 }; 31912} 31913/** 31914 * Creates the type specification from the component meta. This type is inserted into .d.ts files 31915 * to be consumed by upstream compilations. 31916 */ 31917function createComponentType(meta) { 31918 const typeParams = createBaseDirectiveTypeParams(meta); 31919 typeParams.push(stringArrayAsType(meta.template.ngContentSelectors)); 31920 typeParams.push(expressionType(literal(meta.isStandalone))); 31921 typeParams.push(createHostDirectivesType(meta)); 31922 // TODO(signals): Always include this metadata starting with v17. Right 31923 // now Angular v16.0.x does not support this field and library distributions 31924 // would then be incompatible with v16.0.x framework users. 31925 if (meta.isSignal) { 31926 typeParams.push(expressionType(literal(meta.isSignal))); 31927 } 31928 return expressionType(importExpr(Identifiers.ComponentDeclaration, typeParams)); 31929} 31930/** 31931 * Compiles the array literal of declarations into an expression according to the provided emit 31932 * mode. 31933 */ 31934function compileDeclarationList(list, mode) { 31935 switch (mode) { 31936 case 0 /* DeclarationListEmitMode.Direct */: 31937 // directives: [MyDir], 31938 return list; 31939 case 1 /* DeclarationListEmitMode.Closure */: 31940 // directives: function () { return [MyDir]; } 31941 return arrowFn([], list); 31942 case 2 /* DeclarationListEmitMode.ClosureResolved */: 31943 // directives: function () { return [MyDir].map(ng.resolveForwardRef); } 31944 const resolvedList = list.prop('map').callFn([importExpr(Identifiers.resolveForwardRef)]); 31945 return arrowFn([], resolvedList); 31946 case 3 /* DeclarationListEmitMode.RuntimeResolved */: 31947 throw new Error(`Unsupported with an array of pre-resolved dependencies`); 31948 } 31949} 31950function stringAsType(str) { 31951 return expressionType(literal(str)); 31952} 31953function stringMapAsLiteralExpression(map) { 31954 const mapValues = Object.keys(map).map(key => { 31955 const value = Array.isArray(map[key]) ? map[key][0] : map[key]; 31956 return { 31957 key, 31958 value: literal(value), 31959 quoted: true 31960 }; 31961 });
31962 return literalMap(mapValues); 31963} 31964function stringArrayAsType(arr) { 31965 return arr.length > 0 ? expressionType(literalArr(arr.map(value => literal(value)))) : NONE_TYPE; 31966} 31967function createBaseDirectiveTypeParams(meta) { 31968 // On the type side, remove newlines from the selector as it will need to fit into a TypeScript 31969 // string literal, which must be on one line. 31970 const selectorForType = meta.selector !== null ? meta.selector.replace(/\n/g, '') : null; 31971 return [typeWithParameters(meta.type.type, meta.typeArgumentCount), selectorForType !== null ? stringAsType(selectorForType) : NONE_TYPE, meta.exportAs !== null ? stringArrayAsType(meta.exportAs) : NONE_TYPE, expressionType(getInputsTypeExpression(meta)), expressionType(stringMapAsLiteralExpression(meta.outputs)), stringArrayAsType(meta.queries.map(q => q.propertyName))]; 31972} 31973function getInputsTypeExpression(meta) { 31974 return literalMap(Object.keys(meta.inputs).map(key => { 31975 const value = meta.inputs[key]; 31976 const values = [{ 31977 key: 'alias', 31978 value: literal(value.bindingPropertyName), 31979 quoted: true 31980 }, { 31981 key: 'required', 31982 value: literal(value.required), 31983 quoted: true 31984 }]; 31985 // TODO(legacy-partial-output-inputs): Consider always emitting this information, 31986 // or leaving it as is. 31987 if (value.isSignal) { 31988 values.push({ 31989 key: 'isSignal', 31990 value: literal(value.isSignal), 31991 quoted: true 31992 }); 31993 } 31994 return { 31995 key, 31996 value: literalMap(values), 31997 quoted: true 31998 }; 31999 })); 32000} 32001/** 32002 * Creates the type specification from the directive meta. This type is inserted into .d.ts files 32003 * to be consumed by upstream compilations. 32004 */ 32005function createDirectiveType(meta) { 32006 const typeParams = createBaseDirectiveTypeParams(meta); 32007 // Directives have no NgContentSelectors slot, but instead express a `never` type 32008 // so that future fields align. 32009 typeParams.push(NONE_TYPE); 32010 typeParams.push(expressionType(literal(meta.isStandalone))); 32011 typeParams.push(createHostDirectivesType(meta)); 32012 // TODO(signals): Always include this metadata starting with v17. Right 32013 // now Angular v16.0.x does not support this field and library distributions 32014 // would then be incompatible with v16.0.x framework users. 32015 if (meta.isSignal) { 32016 typeParams.push(expressionType(literal(meta.isSignal))); 32017 } 32018 return expressionType(importExpr(Identifiers.DirectiveDeclaration, typeParams)); 32019} 32020// Return a host binding function or null if one is not necessary. 32021function createHostBindingsFunction(hostBindingsMetadata, typeSourceSpan, bindingParser, constantPool, selector, name, definitionMap) { 32022 const bindings = bindingParser.createBoundHostProperties(hostBindingsMetadata.properties, typeSourceSpan); 32023 // Calculate host event bindings 32024 const eventBindings = bindingParser.createDirectiveHostEventAsts(hostBindingsMetadata.listeners, typeSourceSpan); 32025 // The parser for host bindings treats class and style attributes specially -- they are 32026 // extracted into these separate fields. This is not the case for templates, so the compiler can 32027 // actually already handle these special attributes internally. Therefore, we just drop them 32028 // into the attributes map. 32029 if (hostBindingsMetadata.specialAttributes.styleAttr) { 32030 hostBindingsMetadata.attributes['style'] = literal(hostBindingsMetadata.specialAttributes.styleAttr); 32031 } 32032 if (hostBindingsMetadata.specialAttributes.classAttr) { 32033 hostBindingsMetadata.attributes['class'] = literal(hostBindingsMetadata.specialAttributes.classAttr); 32034 } 32035 const hostJob = ingestHostBinding({ 32036 componentName: name, 32037 componentSelector: selector, 32038 properties: bindings, 32039 events: eventBindings, 32040 attributes: hostBindingsMetadata.attributes 32041 }, bindingParser, constantPool); 32042 transform(hostJob, CompilationJobKind.Host); 32043 definitionMap.set('hostAttrs', hostJob.root.attributes); 32044 const varCount = hostJob.root.vars; 32045 if (varCount !== null && varCount > 0) { 32046 definitionMap.set('hostVars', literal(varCount)); 32047 } 32048 return emitHostBindingFunction(hostJob); 32049} 32050const HOST_REG_EXP = /^(?:\[([^\]]+)\])|(?:\(([^\)]+)\))$/; 32051function parseHostBindings(host) { 32052 const attributes = {}; 32053 const listeners = {}; 32054 const properties = {}; 32055 const specialAttributes = {}; 32056 for (const key of Object.keys(host)) { 32057 const value = host[key]; 32058 const matches = key.match(HOST_REG_EXP); 32059 if (matches === null) { 32060 switch (key) { 32061 case 'class': 32062 if (typeof value !== 'string') { 32063 // TODO(alxhub): make this a diagnostic. 32064 throw new Error(`Class binding must be string`); 32065 } 32066 specialAttributes.classAttr = value; 32067 break; 32068 case 'style': 32069 if (typeof value !== 'string') { 32070 // TODO(alxhub): make this a diagnostic. 32071 throw new Error(`Style binding must be string`); 32072 } 32073 specialAttributes.styleAttr = value; 32074 break; 32075 default: 32076 if (typeof value === 'string') { 32077 attributes[key] = literal(value); 32078 } else { 32079 attributes[key] = value; 32080 } 32081 } 32082 } else if (matches[1 /* HostBindingGroup.Binding */] != null) { 32083 if (typeof value !== 'string') { 32084 // TODO(alxhub): make this a diagnostic. 32085 throw new Error(`Property binding must be string`); 32086 } 32087 // synthetic properties (the ones that have a `@` as a prefix) 32088 // are still treated the same as regular properties. Therefore 32089 // there is no point in storing them in a separate map. 32090 properties[matches[1 /* HostBindingGroup.Binding */]] = value; 32091 } else if (matches[2 /* HostBindingGroup.Event */] != null) { 32092 if (typeof value !== 'string') { 32093 // TODO(alxhub): make this a diagnostic. 32094 throw new Error(`Event binding must be string`); 32095 } 32096 listeners[matches[2 /* HostBindingGroup.Event */]] = value; 32097 } 32098 } 32099 return { 32100 attributes, 32101 listeners, 32102 properties, 32103 specialAttributes 32104 }; 32105} 32106/** 32107 * Verifies host bindings and returns the list of errors (if any). Empty array indicates that a 32108 * given set of host bindings has no errors. 32109 * 32110 * @param bindings set of host bindings to verify. 32111 * @param sourceSpan source span where host bindings were defined. 32112 * @returns array of errors associated with a given set of host bindings. 32113 */ 32114function verifyHostBindings(bindings, sourceSpan) { 32115 // TODO: abstract out host bindings verification logic and use it instead of 32116 // creating events and properties ASTs to detect errors (FW-996) 32117 const bindingParser = makeBindingParser(); 32118 bindingParser.createDirectiveHostEventAsts(bindings.listeners, sourceSpan); 32119 bindingParser.createBoundHostProperties(bindings.properties, sourceSpan); 32120 return bindingParser.errors; 32121} 32122function compileStyles(styles, selector, hostSelector) { 32123 const shadowCss = new ShadowCss(); 32124 return styles.map(style => { 32125 return shadowCss.shimCssText(style, selector, hostSelector); 32126 }); 32127} 32128/**
32129 * Encapsulates a CSS stylesheet with emulated view encapsulation. 32130 * This allows a stylesheet to be used with an Angular component that 32131 * is using the `ViewEncapsulation.Emulated` mode. 32132 * 32133 * @param style The content of a CSS stylesheet. 32134 * @param componentIdentifier The identifier to use within the CSS rules. 32135 * @returns The encapsulated content for the style. 32136 */ 32137function encapsulateStyle(style, componentIdentifier) { 32138 const shadowCss = new ShadowCss(); 32139 const selector = componentIdentifier ? CONTENT_ATTR.replace(COMPONENT_VARIABLE, componentIdentifier) : CONTENT_ATTR; 32140 const hostSelector = componentIdentifier ? HOST_ATTR.replace(COMPONENT_VARIABLE, componentIdentifier) : HOST_ATTR; 32141 return shadowCss.shimCssText(style, selector, hostSelector); 32142} 32143function createHostDirectivesType(meta) { 32144 var _meta$hostDirectives2; 32145 if (!((_meta$hostDirectives2 = meta.hostDirectives) !== null && _meta$hostDirectives2 !== void 0 && _meta$hostDirectives2.length)) { 32146 return NONE_TYPE; 32147 } 32148 return expressionType(literalArr(meta.hostDirectives.map(hostMeta => literalMap([{ 32149 key: 'directive', 32150 value: typeofExpr(hostMeta.directive.type), 32151 quoted: false 32152 }, { 32153 key: 'inputs', 32154 value: stringMapAsLiteralExpression(hostMeta.inputs || {}), 32155 quoted: false 32156 }, { 32157 key: 'outputs', 32158 value: stringMapAsLiteralExpression(hostMeta.outputs || {}), 32159 quoted: false 32160 }])))); 32161} 32162function createHostDirectivesFeatureArg(hostDirectives) { 32163 const expressions = []; 32164 let hasForwardRef = false; 32165 for (const current of hostDirectives) { 32166 // Use a shorthand if there are no inputs or outputs. 32167 if (!current.inputs && !current.outputs) { 32168 expressions.push(current.directive.type); 32169 } else { 32170 const keys = [{ 32171 key: 'directive', 32172 value: current.directive.type, 32173 quoted: false 32174 }]; 32175 if (current.inputs) { 32176 const inputsLiteral = createHostDirectivesMappingArray(current.inputs); 32177 if (inputsLiteral) { 32178 keys.push({ 32179 key: 'inputs', 32180 value: inputsLiteral, 32181 quoted: false 32182 }); 32183 } 32184 } 32185 if (current.outputs) { 32186 const outputsLiteral = createHostDirectivesMappingArray(current.outputs); 32187 if (outputsLiteral) { 32188 keys.push({ 32189 key: 'outputs', 32190 value: outputsLiteral, 32191 quoted: false 32192 }); 32193 } 32194 } 32195 expressions.push(literalMap(keys)); 32196 } 32197 if (current.isForwardReference) { 32198 hasForwardRef = true; 32199 } 32200 } 32201 // If there's a forward reference, we generate a `function() { return [HostDir] }`, 32202 // otherwise we can save some bytes by using a plain array, e.g. `[HostDir]`. 32203 return hasForwardRef ? new FunctionExpr([], [new ReturnStatement
32203(literalArr(expressions))]) : literalArr(expressions); 32204} 32205/** 32206 * Converts an input/output mapping object literal into an array where the even keys are the 32207 * public name of the binding and the odd ones are the name it was aliased to. E.g. 32208 * `{inputOne: 'aliasOne', inputTwo: 'aliasTwo'}` will become 32209 * `['inputOne', 'aliasOne', 'inputTwo', 'aliasTwo']`. 32210 * 32211 * This conversion is necessary, because hosts bind to the public name of the host directive and 32212 * keeping the mapping in an object literal will break for apps using property renaming. 32213 */ 32214function createHostDirectivesMappingArray(mapping) { 32215 const elements = []; 32216 for (const publicName in mapping) { 32217 if (mapping.hasOwnProperty(publicName)) { 32218 elements.push(literal(publicName), literal(mapping[publicName])); 32219 } 32220 } 32221 return elements.length > 0 ? literalArr(elements) : null; 32222} 32223/** 32224 * Compiles the dependency resolver function for a defer block. 32225 */ 32226function compileDeferResolverFunction(meta) { 32227 const depExpressions = []; 32228 if (meta.mode === 0 /* DeferBlockDepsEmitMode.PerBlock */) { 32229 for (const dep of meta.dependencies) { 32230 if (dep.isDeferrable) { 32231 // Callback function, e.g. `m () => m.MyCmp;`. 32232 const innerFn = arrowFn( 32233 // Default imports are always accessed through the `default` property. 32234 [new FnParam('m', DYNAMIC_TYPE)], variable('m').prop(dep.isDefaultImport ? 'default' : dep.symbolName)); 32235 // Dynamic import, e.g. `import('./a').then(...)`. 32236 const importExpr = new DynamicImportExpr(dep.importPath).prop('then').callFn([innerFn]); 32237 depExpressions.push(importExpr); 32238 } else { 32239 // Non-deferrable symbol, just use a reference to the type. Note that it's important to 32240 // go through `typeReference`, rather than `symbolName` in order to preserve the 32241 // original reference within the source file. 32242 depExpressions.push(dep.typeReference); 32243 } 32244 } 32245 } else { 32246 for (const { 32247 symbolName, 32248 importPath, 32249 isDefaultImport 32250 } of meta.dependencies) { 32251 // Callback function, e.g. `m () => m.MyCmp;`. 32252 const innerFn = arrowFn([new FnParam('m', DYNAMIC_TYPE)], variable('m').prop(isDefaultImport ? 'default' : symbolName)); 32253 // Dynamic import, e.g. `import('./a').then(...)`. 32254 const importExpr = new DynamicImportExpr(importPath).prop('then').callFn([innerFn]); 32255 depExpressions.push(importExpr); 32256 } 32257 } 32258 return arrowFn([], literalArr(depExpressions)); 32259} 32260 32261/** 32262 * Computes a difference between full list (first argument) and 32263 * list of items that should be excluded from the full list (second 32264 * argument). 32265 */ 32266function diff(fullList, itemsToExclude) { 32267 const exclude = new Set(itemsToExclude); 32268 return fullList.filter(item => !exclude.has(item)); 32269} 32270/** 32271 * Given a template string and a set of available directive selectors, 32272 * computes a list of matching selectors and splits them into 2 buckets: 32273 * (1) eagerly used in a template and (2) directives used only in defer 32274 * blocks. Similarly, returns 2 lists of pipes (eager and deferrable). 32275 * 32276 * Note: deferrable directives selectors and pipes names used in `@defer` 32277 * blocks are **candidates** and API caller should make sure that: 32278 * 32279 * * A Component where a given template is defined is standalone 32280 * * Underlying dependency classes are also standalone 32281 * * Dependency class symbols are not eagerly used in a TS file 32282 * where a host component (that owns the template) is located 32283 */ 32284function findMatchingDirectivesAndPipes(template, directiveSelectors) { 32285 const matcher = new SelectorMatcher(); 32286 for (const selector of directiveSelectors) { 32287 // Create a fake directive instance to account for the logic inside 32288 // of the `R3TargetBinder` class (which invokes the `hasBindingPropertyName` 32289 // function internally). 32290 const fakeDirective = { 32291 selector, 32292 exportAs: null, 32293 inputs: { 32294 hasBindingPropertyName() { 32295 return false; 32296 } 32297 }, 32298 outputs: { 32299 hasBindingPropertyName() { 32300 return false; 32301 } 32302 } 32303 }; 32304 matcher.addSelectables(CssSelector.parse(selector), [fakeDirective]); 32305 } 32306 const parsedTemplate = parseTemplate(template, '' /* templateUrl */); 32307 const binder = new R3TargetBinder(matcher); 32308 const bound = binder.bind({ 32309 template: parsedTemplate.nodes 32310 }); 32311 const eagerDirectiveSelectors = bound.getEagerlyUsedDirectives().map(dir => dir.selector); 32312 const allMatchedDirectiveSelectors = bound.getUsedDirectives().map(dir => dir.selector); 32313 const eagerPipes = bound.getEagerlyUsedPipes(); 32314 return { 32315 directives: { 32316 regular: eagerDirectiveSelectors, 32317 deferCandidates: diff(allMatchedDirectiveSelectors, eagerDirectiveSelectors) 32318 }, 32319 pipes: {
32320 regular: eagerPipes, 32321 deferCandidates: diff(bound.getUsedPipes(), eagerPipes) 32322 } 32323 }; 32324} 32325/** 32326 * Processes `Target`s with a given set of directives and performs a binding operation, which 32327 * returns an object similar to TypeScript's `ts.TypeChecker` that contains knowledge about the 32328 * target. 32329 */ 32330class R3TargetBinder { 32331 constructor(directiveMatcher) { 32332 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "directiveMatcher", void 0); 32333 this.directiveMatcher = directiveMatcher; 32334 } 32335 /** 32336 * Perform a binding operation on the given `Target` and return a `BoundTarget` which contains 32337 * metadata about the types referenced in the template. 32338 */ 32339 bind(target) { 32340 if (!target.template) { 32341 throw new Error('Empty bound targets are not supported'); 32342 } 32343 const directives = new Map(); 32344 const eagerDirectives = []; 32345 const bindings = new Map(); 32346 const references = new Map(); 32347 const scopedNodeEntities = new Map(); 32348 const expressions = new Map(); 32349 const symbols = new Map(); 32350 const nestingLevel = new Map(); 32351 const usedPipes = new Set(); 32352 const eagerPipes = new Set(); 32353 const deferBlocks = []; 32354 if (target.template) { 32355 // First, parse the template into a `Scope` structure. This operation captures the syntactic 32356 // scopes in the template and makes them available for later use. 32357 const scope = Scope.apply(target.template); 32358 // Use the `Scope` to extract the entities present at every level of the template. 32359 extractScopedNodeEntities(scope, scopedNodeEntities); 32360 // Next, perform directive matching on the template using the `DirectiveBinder`. This returns: 32361 // - directives: Map of nodes (elements & ng-templates) to the directives on them. 32362 // - bindings: Map of inputs, outputs, and attributes to the directive/element that claims 32363 // them. TODO(alxhub): handle multiple directives claiming an input/output/etc. 32364 // - references: Map of #references to their targets. 32365 DirectiveBinder.apply(target.template, this.directiveMatcher, directives, eagerDirectives, bindings, references); 32366 // Finally, run the TemplateBinder to bind references, variables, and other entities within the 32367 // template. This extracts all the metadata that doesn't depend on directive matching. 32368 TemplateBinder.applyWithScope(target.template, scope, expressions, symbols, nestingLevel, usedPipes, eagerPipes, deferBlocks); 32369 } 32370 return new R3BoundTarget(target, directives, eagerDirectives, bindings, references, expressions, symbols, nestingLevel, scopedNodeEntities, usedPipes, eagerPipes, deferBlocks); 32371 } 32372} 32373/** 32374 * Represents a binding scope within a template. 32375 * 32376 * Any variables, references, or other named entities declared within the template will 32377 * be captured and available by name in `namedEntities`. Additionally, child templates will 32378 * be analyzed and have their child `Scope`s available in `childScopes`. 32379 */ 32380class Scope { 32381 constructor(parentScope, rootNode) { 32382 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "parentScope", void 0); 32383 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "rootNode", void 0); 32384 /** 32385 * Named members of the `Scope`, such as `Reference`s or `Variable`s. 32386 */ 32387 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "namedEntities", new Map()); 32388 /** 32389 * Set of elements that belong to this scope. 32390 */ 32391 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "elementsInScope", new Set()); 32392 /** 32393 * Child `Scope`s for immediately nested `ScopedNode`s. 32394 */ 32395 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "childScopes", new Map()); 32396 /** Whether this scope is deferred or if any of its ancestors are deferred. */ 32397 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "isDeferred", void 0); 32398 this.parentScope = parentScope; 32399 this.rootNode = rootNode; 32400 this.isDeferred = parentScope !== null && parentScope.isDeferred ? true : rootNode instanceof DeferredBlock; 32401 } 32402 static newRootScope() { 32403 return new Scope(null, null); 32404 } 32405 /** 32406 * Process a template (either as a `Template` sub-template with variables, or a plain array of 32407 * template `Node`s) and construct its `Scope`. 32408 */ 32409 static apply(template) { 32410 const scope = Scope.newRootScope();
32411 scope.ingest(template); 32412 return scope; 32413 } 32414 /** 32415 * Internal method to process the scoped node and populate the `Scope`. 32416 */ 32417 ingest(nodeOrNodes) { 32418 if (nodeOrNodes instanceof Template) { 32419 // Variables on an <ng-template> are defined in the inner scope. 32420 nodeOrNodes.variables.forEach(node => this.visitVariable(node)); 32421 // Process the nodes of the template. 32422 nodeOrNodes.children.forEach(node => node.visit(this)); 32423 } else if (nodeOrNodes instanceof IfBlockBranch) { 32424 if (nodeOrNodes.expressionAlias !== null) { 32425 this.visitVariable(nodeOrNodes.expressionAlias); 32426 } 32427 nodeOrNodes.children.forEach(node => node.visit(this)); 32428 } else if (nodeOrNodes instanceof ForLoopBlock) { 32429 this.visitVariable(nodeOrNodes.item); 32430 nodeOrNodes.contextVariables.forEach(v => this.visitVariable(v)); 32431 nodeOrNodes.children.forEach(node => node.visit(this)); 32432 } else if (nodeOrNodes instanceof SwitchBlockCase || nodeOrNodes instanceof ForLoopBlockEmpty || nodeOrNodes instanceof DeferredBlock || nodeOrNodes instanceof DeferredBlockError || nodeOrNodes instanceof DeferredBlockPlaceholder || nodeOrNodes instanceof DeferredBlockLoading || nodeOrNodes instanceof Content) { 32433 nodeOrNodes.children.forEach(node => node.visit(this)); 32434 } else { 32435 // No overarching `Template` instance, so process the nodes directly. 32436 nodeOrNodes.forEach(node => node.visit(this)); 32437 } 32438 } 32439 visitElement(element) { 32440 // `Element`s in the template may have `Reference`s which are captured in the scope. 32441 element.references.forEach(node => this.visitReference(node)); 32442 // Recurse into the `Element`'s children. 32443 element.children.forEach(node => node.visit(this)); 32444 this.elementsInScope.add(element); 32445 } 32446 visitTemplate(template) { 32447 // References on a <ng-template> are defined in the outer scope, so capture them before 32448 // processing the template's child scope. 32449 template.references.forEach(node => this.visitReference(node)); 32450 // Next, create an inner scope and process the template within it. 32451 this.ingestScopedNode(template); 32452 } 32453 visitVariable(variable) { 32454 // Declare the variable if it's not already. 32455 this.maybeDeclare(variable); 32456 } 32457 visitReference(reference) { 32458 // Declare the variable if it's not already. 32459 this.maybeDeclare(reference); 32460 } 32461 visitDeferredBlock(deferred) { 32462 var _deferred$placeholder, _deferred$loading, _deferred$error; 32463 this.ingestScopedNode(deferred); 32464 (_deferred$placeholder = deferred.placeholder) === null || _deferred$placeholder === void 0 || _deferred$placeholder.visit(this); 32465 (_deferred$loading = deferred.loading) === null || _deferred$loading === void 0 || _deferred$loading.visit(this); 32466 (_deferred$error = deferred.error) === null || _deferred$error === void 0 || _deferred$error.visit(this); 32467 } 32468 visitDeferredBlockPlaceholder(block) { 32469 this.ingestScopedNode(block); 32470 } 32471 visitDeferredBlockError(block) { 32472 this.ingestScopedNode(block); 32473 } 32474 visitDeferredBlockLoading(block) { 32475 this.ingestScopedNode(block); 32476 } 32477 visitSwitchBlock(block) { 32478 block.cases.forEach(node => node.visit(this)); 32479 } 32480 visitSwitchBlockCase(block) { 32481 this.ingestScopedNode(block); 32482 } 32483 visitForLoopBlock(block) { 32484 var _block$empty; 32485 this.ingestScopedNode(block); 32486 (_block$empty = block.empty) === null || _block$empty === void 0 || _block$empty.visit(this); 32487 } 32488 visitForLoopBlockEmpty(block) { 32489 this.ingestScopedNode(block); 32490 } 32491 visitIfBlock(block) { 32492 block.branches.forEach(node => node.visit(this)); 32493 } 32494 visitIfBlockBranch(block) { 32495 this.ingestScopedNode(block); 32496 } 32497 visitContent(content) { 32498 this.ingestScopedNode(content); 32499 } 32500 visitLetDeclaration(decl) { 32501 this.maybeDeclare(decl); 32502 } 32503 // Unused visitors. 32504 visitBoundAttribute(attr) {} 32505 visitBoundEvent(event) {} 32506 visitBoundText(text) {} 32507 visitText(text) {} 32508 visitTextAttribute(attr) {} 32509 visitIcu(icu) {} 32510 visitDeferredTrigger(trigger) {} 32511 visitUnknownBlock(block) {} 32512 maybeDeclare(thing) { 32513 // Declare something with a name, as long as that name isn't taken. 32514 if (!this.namedEntities.has(thing.name)) { 32515 this.namedEntities.set(thing.name, thing); 32516 } 32517 } 32518 /** 32519 * Look up a variable within this `Scope`. 32520 * 32521 * This can recurse into a parent `Scope` if it's available. 32522 */ 32523 lookup(name) { 32524 if (this.namedEntities.has(name)) { 32525 // Found in the local scope. 32526 return this.namedEntities.get(name); 32527 } else if (this.parentScope !== null) { 32528 // Not in the local scope, but there's a parent scope so check there. 32529 return this.parentScope.lookup(name); 32530 } else { 32531 // At the top level and it wasn't found. 32532 return null; 32533 } 32534 } 32535 /** 32536 * Get the child scope for a `ScopedNode`. 32537 * 32538 * This should always be defined. 32539 */ 32540 getChildScope(node) { 32541 const res = this.childScopes.get(node); 32542 if (res === undefined) { 32543 throw new Error(`Assertion error: child scope for ${node} not found`); 32544 } 32545 return res; 32546 } 32547 ingestScopedNode(node) { 32548 const scope = new Scope(this, node);
32549 scope.ingest(node); 32550 this.childScopes.set(node, scope); 32551 } 32552} 32553/** 32554 * Processes a template and matches directives on nodes (elements and templates). 32555 * 32556 * Usually used via the static `apply()` method. 32557 */ 32558class DirectiveBinder { 32559 constructor(matcher, directives, eagerDirectives, bindings, references) { 32560 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "matcher", void 0); 32561 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "directives", void 0); 32562 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "eagerDirectives", void 0); 32563 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "bindings", void 0); 32564 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "references", void 0); 32565 // Indicates whether we are visiting elements within a `defer` block 32566 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "isInDeferBlock", false); 32567 this.matcher = matcher; 32568 this.directives = directives; 32569 this.eagerDirectives = eagerDirectives; 32570 this.bindings = bindings; 32571 this.references = references; 32572 } 32573 /** 32574 * Process a template (list of `Node`s) and perform directive matching against each node. 32575 * 32576 * @param template the list of template `Node`s to match (recursively). 32577 * @param selectorMatcher a `SelectorMatcher` containing the directives that are in scope for 32578 * this template. 32579 * @returns three maps which contain information about directives in the template: the 32580 * `directives` map which lists directives matched on each node, the `bindings` map which 32581 * indicates which directives claimed which bindings (inputs, outputs, etc), and the `references` 32582 * map which resolves #references (`Reference`s) within the template to the named directive or 32583 * template node. 32584 */ 32585 static apply(template, selectorMatcher, directives, eagerDirectives, bindings, references) { 32586 const matcher = new DirectiveBinder(selectorMatcher, directives, eagerDirectives, bindings, references); 32587 matcher.ingest(template); 32588 } 32589 ingest(template) { 32590 template.forEach(node => node.visit(this)); 32591 } 32592 visitElement(element) { 32593 this.visitElementOrTemplate(element); 32594 } 32595 visitTemplate(template) { 32596 this.visitElementOrTemplate(template); 32597 } 32598 visitElementOrTemplate(node) { 32599 // First, determine the HTML shape of the node for the purpose of directive matching. 32600 // Do this by building up a `CssSelector` for the node. 32601 const cssSelector = createCssSelectorFromNode(node); 32602 // Next, use the `SelectorMatcher` to get the list of directives on the node. 32603 const directives = []; 32604 this.matcher.match(cssSelector, (_selector, results) => directives.push(...results)); 32605 if (directives.length > 0) { 32606 this.directives.set(node, directives); 32607 if (!this.isInDeferBlock) { 32608 this.eagerDirectives.push(...directives); 32609 } 32610 } 32611 // Resolve any references that are created on this node. 32612 node.references.forEach(ref => { 32613 let dirTarget = null; 32614 // If the reference expression is empty, then it matches the "primary" directive on the node 32615 // (if there is one). Otherwise it matches the host node itself (either an element or 32616 // <ng-template> node). 32617 if (ref.value.trim() === '') { 32618 // This could be a reference to a component if there is one. 32619 dirTarget = directives.find(dir => dir.isComponent) || null; 32620 } else { 32621 // This should be a reference to a directive exported via exportAs. 32622 dirTarget = directives.find(dir => dir.exportAs !== null && dir.exportAs.some(value => value === ref.value)) || null; 32623 // Check if a matching directive was found. 32624 if (dirTarget === null) { 32625 // No matching directive was found - this reference points to an unknown target. Leave it 32626 // unmapped. 32627 return; 32628 } 32629 } 32630 if (dirTarget !== null) { 32631 // This reference points to a directive. 32632 this.references.set(ref, { 32633 directive: dirTarget, 32634 node 32635 }); 32636 } else { 32637 // This reference points to the node itself. 32638 this.references.set(ref, node); 32639 } 32640 }); 32641 const setAttributeBinding = (attribute, ioType) => { 32642 const dir = directives.find(dir => dir[ioType].hasBindingPropertyName(attribute.name)); 32643 const binding = dir !== undefined ? dir : node; 32644 this.bindings.set(attribute, binding); 32645 }; 32646 // Node inputs (bound attributes) and text attributes can be bound to an 32647 // input on a directive.
32648 node.inputs.forEach(input => setAttributeBinding(input, 'inputs')); 32649 node.attributes.forEach(attr => setAttributeBinding(attr, 'inputs')); 32650 if (node instanceof Template) { 32651 node.templateAttrs.forEach(attr => setAttributeBinding(attr, 'inputs')); 32652 } 32653 // Node outputs (bound events) can be bound to an output on a directive. 32654 node.outputs.forEach(output => setAttributeBinding(output, 'outputs')); 32655 // Recurse into the node's children. 32656 node.children.forEach(child => child.visit(this)); 32657 } 32658 visitDeferredBlock(deferred) { 32659 var _deferred$placeholder2, _deferred$loading2, _deferred$error2; 32660 const wasInDeferBlock = this.isInDeferBlock; 32661 this.isInDeferBlock = true; 32662 deferred.children.forEach(child => child.visit(this)); 32663 this.isInDeferBlock = wasInDeferBlock; 32664 (_deferred$placeholder2 = deferred.placeholder) === null || _deferred$placeholder2 === void 0 || _deferred$placeholder2.visit(this); 32665 (_deferred$loading2 = deferred.loading) === null || _deferred$loading2 === void 0 || _deferred$loading2.visit(this); 32666 (_deferred$error2 = deferred.error) === null || _deferred$error2 === void 0 || _deferred$error2.visit(this); 32667 } 32668 visitDeferredBlockPlaceholder(block) { 32669 block.children.forEach(child => child.visit(this)); 32670 } 32671 visitDeferredBlockError(block) { 32672 block.children.forEach(child => child.visit(this)); 32673 } 32674 visitDeferredBlockLoading(block) { 32675 block.children.forEach(child => child.visit(this)); 32676 } 32677 visitSwitchBlock(block) { 32678 block.cases.forEach(node => node.visit(this)); 32679 } 32680 visitSwitchBlockCase(block) { 32681 block.children.forEach(node => node.visit(this)); 32682 } 32683 visitForLoopBlock(block) { 32684 var _block$empty2; 32685 block.item.visit(this);
32686 block.contextVariables.forEach(v => v.visit(this)); 32687 block.children.forEach(node => node.visit(this)); 32688 (_block$empty2 = block.empty) === null || _block$empty2 === void 0 || _block$empty2.visit(this); 32689 } 32690 visitForLoopBlockEmpty(block) { 32691 block.children.forEach(node => node.visit(this)); 32692 } 32693 visitIfBlock(block) { 32694 block.branches.forEach(node => node.visit(this)); 32695 } 32696 visitIfBlockBranch(block) { 32697 var _block$expressionAlia; 32698 (_block$expressionAlia = block.expressionAlias) === null || _block$expressionAlia === void 0 || _block$expressionAlia.visit(this); 32699 block.children.forEach(node => node.visit(this)); 32700 } 32701 visitContent(content) { 32702 content.children.forEach(child => child.visit(this)); 32703 } 32704 // Unused visitors. 32705 visitVariable(variable) {} 32706 visitReference(reference) {} 32707 visitTextAttribute(attribute) {} 32708 visitBoundAttribute(attribute) {} 32709 visitBoundEvent(attribute) {} 32710 visitBoundAttributeOrEvent(node) {} 32711 visitText(text) {} 32712 visitBoundText(text) {} 32713 visitIcu(icu) {} 32714 visitDeferredTrigger(trigger) {} 32715 visitUnknownBlock(block) {} 32716 visitLetDeclaration(decl) {} 32717} 32718/** 32719 * Processes a template and extract metadata about expressions and symbols within. 32720 * 32721 * This is a companion to the `DirectiveBinder` that doesn't require knowledge of directives matched 32722 * within the template in order to operate. 32723 * 32724 * Expressions are visited by the superclass `RecursiveAstVisitor`, with custom logic provided 32725 * by overridden methods from that visitor. 32726 */ 32727class TemplateBinder extends RecursiveAstVisitor { 32728 constructor(bindings, symbols, usedPipes, eagerPipes, deferBlocks, nestingLevel, scope, rootNode, level) { 32729 super(); 32730 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "bindings", void 0); 32731 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "symbols", void 0); 32732 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "usedPipes", void 0); 32733 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "eagerPipes", void 0); 32734 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "deferBlocks", void 0); 32735 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "nestingLevel", void 0); 32736 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "scope", void 0); 32737 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "rootNode", void 0); 32738 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "level", void 0); 32739 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "visitNode", void 0); 32740 this.bindings = bindings; 32741 this.symbols = symbols; 32742 this.usedPipes = usedPipes; 32743 this.eagerPipes = eagerPipes; 32744 this.deferBlocks = deferBlocks; 32745 this.nestingLevel = nestingLevel; 32746 this.scope = scope; 32747 this.rootNode = rootNode; 32748 this.level = level; 32749 // Save a bit of processing time by constructing this closure in advance. 32750 this.visitNode = node => node.visit(this); 32751 } 32752 // This method is defined to reconcile the type of TemplateBinder since both 32753 // RecursiveAstVisitor and Visitor define the visit() method in their 32754 // interfaces. 32755 visit(node, context) { 32756 if (node instanceof AST) { 32757 node.visit(this, context); 32758 } else { 32759 node.visit(this); 32760 } 32761 } 32762 /** 32763 * Process a template and extract metadata about expressions and symbols within. 32764 * 32765 * @param nodes the nodes of the template to process 32766 * @param scope the `Scope` of the template being processed. 32767 * @returns three maps which contain metadata about the template: `expressions` which interprets 32768 * special `AST` nodes in expressions as pointing to references or variables declared within the 32769 * template, `symbols` which maps those variables and references to the nested `Template` which 32770 * declares them, if any, and `nestingLevel` which associates each `Template` with a integer 32771 * nesting level (how many levels deep within the template structure the `Template` is), starting 32772 * at 1. 32773 */ 32774 static applyWithScope(nodes, scope, expressions, symbols, nestingLevel, usedPipes, eagerPipes, deferBlocks) { 32775 const template = nodes instanceof Template ? nodes : null; 32776 // The top-level template has nesting level 0. 32777 const binder = new TemplateBinder(expressions, symbols, usedPipes, eagerPipes, deferBlocks, nestingLevel, scope, template, 0);
32778 binder.ingest(nodes); 32779 } 32780 ingest(nodeOrNodes) { 32781 if (nodeOrNodes instanceof Template) { 32782 // For <ng-template>s, process only variables and child nodes. Inputs, outputs, templateAttrs, 32783 // and references were all processed in the scope of the containing template. 32784 nodeOrNodes.variables.forEach(this.visitNode); 32785 nodeOrNodes.children.forEach(this.visitNode); 32786 // Set the nesting level. 32787 this.nestingLevel.set(nodeOrNodes, this.level); 32788 } else if (nodeOrNodes instanceof IfBlockBranch) { 32789 if (nodeOrNodes.expressionAlias !== null) { 32790 this.visitNode(nodeOrNodes.expressionAlias); 32791 } 32792 nodeOrNodes.children.forEach(this.visitNode); 32793 this.nestingLevel.set(nodeOrNodes, this.level); 32794 } else if (nodeOrNodes instanceof ForLoopBlock) { 32795 this.visitNode(nodeOrNodes.item); 32796 nodeOrNodes.contextVariables.forEach(v => this.visitNode(v)); 32797 nodeOrNodes.trackBy.visit(this); 32798 nodeOrNodes.children.forEach(this.visitNode); 32799 this.nestingLevel.set(nodeOrNodes, this.level); 32800 } else if (nodeOrNodes instanceof DeferredBlock) { 32801 if (this.scope.rootNode !== nodeOrNodes) { 32802 throw new Error(`Assertion error: resolved incorrect scope for deferred block ${nodeOrNodes}`); 32803 } 32804 this.deferBlocks.push([nodeOrNodes, this.scope]); 32805 nodeOrNodes.children.forEach(node => node.visit(this)); 32806 this.nestingLevel.set(nodeOrNodes, this.level); 32807 } else if (nodeOrNodes instanceof SwitchBlockCase || nodeOrNodes instanceof ForLoopBlockEmpty || nodeOrNodes instanceof DeferredBlockError || nodeOrNodes instanceof DeferredBlockPlaceholder || nodeOrNodes instanceof DeferredBlockLoading || nodeOrNodes instanceof Content) { 32808 nodeOrNodes.children.forEach(node => node.visit(this)); 32809 this.nestingLevel.set(nodeOrNodes, this.level); 32810 } else { 32811 // Visit each node from the top-level template. 32812 nodeOrNodes.forEach(this.visitNode); 32813 } 32814 } 32815 visitElement(element) { 32816 // Visit the inputs, outputs, and children of the element. 32817 element.inputs.forEach(this.visitNode); 32818 element.outputs.forEach(this.visitNode); 32819 element.children.forEach(this.visitNode); 32820 element.references.forEach(this.visitNode); 32821 } 32822 visitTemplate(template) { 32823 // First, visit inputs, outputs and template attributes of the template node. 32824 template.inputs.forEach(this.visitNode); 32825 template.outputs.forEach(this.visitNode); 32826 template.templateAttrs.forEach(this.visitNode); 32827 template.references.forEach(this.visitNode); 32828 // Next, recurse into the template. 32829 this.ingestScopedNode(template); 32830 } 32831 visitVariable(variable) { 32832 // Register the `Variable` as a symbol in the current `Template`. 32833 if (this.rootNode !== null) { 32834 this.symbols.set(variable, this.rootNode); 32835 } 32836 } 32837 visitReference(reference) { 32838 // Register the `Reference` as a symbol in the current `Template`. 32839 if (this.rootNode !== null) { 32840 this.symbols.set(reference, this.rootNode); 32841 } 32842 } 32843 // Unused template visitors 32844 visitText(text) {} 32845 visitTextAttribute(attribute) {} 32846 visitUnknownBlock(block) {} 32847 visitDeferredTrigger() {} 32848 visitIcu(icu) { 32849 Object.keys(icu.vars).forEach(key => icu.vars[key].visit(this)); 32850 Object.keys(icu.placeholders).forEach(key => icu.placeholders[key].visit(this)); 32851 } 32852 // The remaining visitors are concerned with processing AST expressions within template bindings 32853 visitBoundAttribute(attribute) { 32854 attribute.value.visit(this); 32855 } 32856 visitBoundEvent(event) { 32857 event.handler.visit(this); 32858 } 32859 visitDeferredBlock(deferred) { 32860 var _deferred$triggers$wh, _deferred$prefetchTri, _deferred$hydrateTrig, _deferred$hydrateTrig2; 32861 this.ingestScopedNode(deferred); 32862 (_deferred$triggers$wh = deferred.triggers.when) === null || _deferred$triggers$wh === void 0 || _deferred$triggers$wh.value.visit(this); 32863 (_deferred$prefetchTri = deferred.prefetchTriggers.when) === null || _deferred$prefetchTri === void 0 || _deferred$prefetchTri.value.visit(this); 32864 (_deferred$hydrateTrig = deferred.hydrateTriggers.when) === null || _deferred$hydrateTrig === void 0 || _deferred$hydrateTrig.value.visit(this); 32865 (_deferred$hydrateTrig2 = deferred.hydrateTriggers.never) === null || _deferred$hydrateTrig2 === void 0 || _deferred$hydrateTrig2.visit(this); 32866 deferred.placeholder && this.visitNode(deferred.placeholder); 32867 deferred.loading && this.visitNode(deferred.loading); 32868 deferred.error && this.visitNode(deferred.error); 32869 } 32870 visitDeferredBlockPlaceholder(block) { 32871 this.ingestScopedNode(block); 32872 } 32873 visitDeferredBlockError(block) { 32874 this.ingestScopedNode(block); 32875 } 32876 visitDeferredBlockLoading(block) { 32877 this.ingestScopedNode(block); 32878 } 32879 visitSwitchBlock(block) { 32880 block.expression.visit(this);
32881 block.cases.forEach(this.visitNode); 32882 } 32883 visitSwitchBlockCase(block) { 32884 var _block$expression; 32885 (_block$expression = block.expression) === null || _block$expression === void 0 || _block$expression.visit(this); 32886 this.ingestScopedNode(block); 32887 } 32888 visitForLoopBlock(block) { 32889 var _block$empty3; 32890 block.expression.visit(this); 32891 this.ingestScopedNode(block); 32892 (_block$empty3 = block.empty) === null || _block$empty3 === void 0 || _block$empty3.visit(this); 32893 } 32894 visitForLoopBlockEmpty(block) { 32895 this.ingestScopedNode(block); 32896 } 32897 visitIfBlock(block) { 32898 block.branches.forEach(node => node.visit(this)); 32899 } 32900 visitIfBlockBranch(block) { 32901 var _block$expression2; 32902 (_block$expression2 = block.expression) === null || _block$expression2 === void 0 || _block$expression2.visit(this); 32903 this.ingestScopedNode(block); 32904 } 32905 visitContent(content) { 32906 this.ingestScopedNode(content); 32907 } 32908 visitBoundText(text) { 32909 text.value.visit(this); 32910 } 32911 visitLetDeclaration(decl) { 32912 decl.value.visit(this); 32913 if (this.rootNode !== null) { 32914 this.symbols.set(decl, this.rootNode); 32915 } 32916 } 32917 visitPipe(ast, context) { 32918 this.usedPipes.add(ast.name); 32919 if (!this.scope.isDeferred) { 32920 this.eagerPipes.add(ast.name); 32921 } 32922 return super.visitPipe(ast, context); 32923 } 32924 // These five types of AST expressions can refer to expression roots, which could be variables 32925 // or references in the current scope. 32926 visitPropertyRead(ast, context) { 32927 this.maybeMap(ast, ast.name); 32928 return super.visitPropertyRead(ast, context); 32929 } 32930 visitSafePropertyRead(ast, context) { 32931 this.maybeMap(ast, ast.name); 32932 return super.visitSafePropertyRead(ast, context); 32933 } 32934 visitPropertyWrite(ast, context) { 32935 this.maybeMap(ast, ast.name); 32936 return super.visitPropertyWrite(ast, context); 32937 } 32938 ingestScopedNode(node) { 32939 const childScope = this.scope.getChildScope(node); 32940 const binder = new TemplateBinder(this.bindings, this.symbols, this.usedPipes, this.eagerPipes, this.deferBlocks, this.nestingLevel, childScope, node, this.level + 1); 32941 binder.ingest(node); 32942 } 32943 maybeMap(ast, name) { 32944 // If the receiver of the expression isn't the `ImplicitReceiver`, this isn't the root of an 32945 // `AST` expression that maps to a `Variable` or `Reference`. 32946 if (!(ast.receiver instanceof ImplicitReceiver) || ast.receiver instanceof ThisReceiver) { 32947 return; 32948 } 32949 // Check whether the name exists in the current scope. If so, map it. Otherwise, the name is 32950 // probably a property on the top-level component context. 32951 const target = this.scope.lookup(name); 32952 if (target !== null) { 32953 this.bindings.set(ast, target); 32954 } 32955 } 32956} 32957/** 32958 * Metadata container for a `Target` that allows queries for specific bits of metadata. 32959 * 32960 * See `BoundTarget` for documentation on the individual methods. 32961 */ 32962class R3BoundTarget { 32963 constructor(target, directives, eagerDirectives, bindings, references, exprTargets, symbols, nestingLevel, scopedNodeEntities, usedPipes, eagerPipes, rawDeferred) { 32964 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "target", void 0); 32965 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "directives", void 0); 32966 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "eagerDirectives", void 0); 32967 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "bindings", void 0); 32968 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "references", void 0); 32969 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "exprTargets", void 0); 32970 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "symbols", void 0); 32971 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "nestingLevel", void 0); 32972 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "scopedNodeEntities", void 0); 32973 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "usedPipes", void 0); 32974 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "eagerP
32974ipes", void 0); 32975 /** Deferred blocks, ordered as they appear in the template. */ 32976 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "deferredBlocks", void 0); 32977 /** Map of deferred blocks to their scope. */ 32978 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "deferredScopes", void 0); 32979 this.target = target; 32980 this.directives = directives; 32981 this.eagerDirectives = eagerDirectives; 32982 this.bindings = bindings; 32983 this.references = references; 32984 this.exprTargets = exprTargets; 32985 this.symbols = symbols; 32986 this.nestingLevel = nestingLevel; 32987 this.scopedNodeEntities = scopedNodeEntities; 32988 this.usedPipes = usedPipes; 32989 this.eagerPipes = eagerPipes; 32990 this.deferredBlocks = rawDeferred.map(current => current[0]); 32991 this.deferredScopes = new Map(rawDeferred); 32992 } 32993 getEntitiesInScope(node) { 32994 var _this$scopedNodeEntit; 32995 return (_this$scopedNodeEntit = this.scopedNodeEntities.get(node)) !== null && _this$scopedNodeEntit !== void 0 ? _this$scopedNodeEntit : new Set(); 32996 } 32997 getDirectivesOfNode(node) { 32998 return this.directives.get(node) || null; 32999 } 33000 getReferenceTarget(ref) { 33001 return this.references.get(ref) || null; 33002 } 33003 getConsumerOfBinding(binding) { 33004 return this.bindings.get(binding) || null; 33005 } 33006 getExpressionTarget(expr) { 33007 return this.exprTargets.get(expr) || null; 33008 } 33009 getDefinitionNodeOfSymbol(symbol) { 33010 return this.symbols.get(symbol) || null; 33011 } 33012 getNestingLevel(node) { 33013 return this.nestingLevel.get(node) || 0; 33014 } 33015 getUsedDirectives() { 33016 const set = new Set(); 33017 this.directives.forEach(dirs => dirs.forEach(dir => set.add(dir))); 33018 return Array.from(set.values()); 33019 } 33020 getEagerlyUsedDirectives() { 33021 const set = new Set(this.eagerDirectives); 33022 return Array.from(set.values()); 33023 } 33024 getUsedPipes() { 33025 return Array.from(this.usedPipes); 33026 } 33027 getEagerlyUsedPipes() { 33028 return Array.from(this.eagerPipes); 33029 } 33030 getDeferBlocks() { 33031 return this.deferredBlocks; 33032 } 33033 getDeferredTriggerTarget(block, trigger) { 33034 // Only triggers that refer to DOM nodes can be resolved. 33035 if (!(trigger instanceof InteractionDeferredTrigger) && !(trigger instanceof ViewportDeferredTrigger) && !(trigger instanceof HoverDeferredTrigger)) { 33036 return null; 33037 } 33038 const name = trigger.reference; 33039 if (name === null) { 33040 let trigger = null; 33041 if (block.placeholder !== null) { 33042 for (const child of block.placeholder.children) { 33043 // Skip over comment nodes. Currently by default the template parser doesn't capture 33044 // comments, but we have a safeguard here just in case since it can be enabled. 33045 if (child instanceof Comment$1) { 33046 continue; 33047 } 33048 // We can only infer the trigger if there's one root element node. Any other 33049 // nodes at the root make it so that we can't infer the trigger anymore. 33050 if (trigger !== null) { 33051 return null; 33052 } 33053 if (child instanceof Element$1) { 33054 trigger = child; 33055 } 33056 } 33057 } 33058 return trigger; 33059 } 33060 const outsideRef = this.findEntityInScope(block, name); 33061 // First try to resolve the target in the scope of the main deferred block. Note that we 33062 // skip triggers defined inside the main block itself, because they might not exist yet. 33063 if (outsideRef instanceof Reference && this.getDefinitionNodeOfSymbol(outsideRef) !== block) { 33064 const target = this.getReferenceTarget(outsideRef); 33065 if (target !== null) { 33066 return this.referenceTargetToElement(target); 33067 } 33068 } 33069 // If the trigger couldn't be found in the main block, check the 33070 // placeholder block which is shown before the main block has loaded. 33071 if (block.placeholder !== null) { 33072 const refInPlaceholder = this.findEntityInScope(block.placeholder, name); 33073 const targetInPlaceholder = refInPlaceholder instanceof Reference ? this.getReferenceTarget(refInPlaceholder) : null; 33074 if (targetInPlaceholder !== null) { 33075 return this.referenceTargetToElement(targetInPlaceholder); 33076 } 33077 } 33078 return null; 33079 } 33080 isDeferred(element) { 33081 for (const block of this.deferredBlocks) { 33082 if (!this.deferredScopes.has(block)) { 33083 continue; 33084 } 33085 const stack = [this.deferredScopes.get(block)]; 33086 while (stack.length > 0) { 33087 const current = stack.pop(); 33088 if (current.elementsInScope.has(element)) { 33089 return true; 33090 } 33091 stack.push(...current.childScopes.values()); 33092 } 33093 } 33094 return false;
33095 } 33096 /** 33097 * Finds an entity with a specific name in a scope. 33098 * @param rootNode Root node of the scope. 33099 * @param name Name of the entity. 33100 */ 33101 findEntityInScope(rootNode, name) { 33102 const entities = this.getEntitiesInScope(rootNode); 33103 for (const entity of entities) { 33104 if (entity.name === name) { 33105 return entity; 33106 } 33107 } 33108 return null; 33109 } 33110 /** Coerces a `ReferenceTarget` to an `Element`, if possible. */ 33111 referenceTargetToElement(target) { 33112 if (target instanceof Element$1) { 33113 return target; 33114 } 33115 if (target instanceof Template) { 33116 return null; 33117 } 33118 return this.referenceTargetToElement(target.node); 33119 } 33120} 33121function extractScopedNodeEntities(rootScope, templateEntities) { 33122 const entityMap = new Map(); 33123 function extractScopeEntities(scope) { 33124 if (entityMap.has(scope.rootNode)) { 33125 return entityMap.get(scope.rootNode); 33126 } 33127 const currentEntities = scope.namedEntities; 33128 let entities; 33129 if (scope.parentScope !== null) { 33130 entities = new Map([...extractScopeEntities(scope.parentScope), ...currentEntities]); 33131 } else { 33132 entities = new Map(currentEntities); 33133 } 33134 entityMap.set(scope.rootNode, entities); 33135 return entities; 33136 } 33137 const scopesToProcess = [rootScope]; 33138 while (scopesToProcess.length > 0) { 33139 const scope = scopesToProcess.pop(); 33140 for (const childScope of scope.childScopes.values()) { 33141 scopesToProcess.push(childScope); 33142 } 33143 extractScopeEntities(scope); 33144 } 33145 for (const [template, entities] of entityMap) { 33146 templateEntities.set(template, new Set(entities.values())); 33147 } 33148} 33149 33150/** 33151 * An interface for retrieving documents by URL that the compiler uses to 33152 * load templates. 33153 * 33154 * This is an abstract class, rather than an interface, so that it can be used 33155 * as injection token. 33156 */ 33157class ResourceLoader {} 33158class CompilerFacadeImpl { 33159 constructor(jitEvaluator = new JitEvaluator()) { 33160 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "jitEvaluator", void 0); 33161 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "FactoryTarget", FactoryTarget); 33162 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "ResourceLoader", ResourceLoader); 33163 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "elementSchemaRegistry", new DomElementSchemaRegistry()); 33164 this.jitEvaluator = jitEvaluator; 33165 } 33166 compilePipe(angularCoreEnv, sourceMapUrl, facade) { 33167 const metadata = { 33168 type: wrapReference(facade.type), 33169 typeArgumentCount: 0, 33170 pipeName: facade.pipeName, 33171 pure: facade.pure, 33172 isStandalone: facade.isStandalone 33173 }; 33174 const res = compilePipeFromMetadata(metadata); 33175 return this.jitExpression(res.expression, angularCoreEnv, sourceMapUrl, []); 33176 } 33177 compilePipeDeclaration(angularCoreEnv, sourceMapUrl, declaration) { 33178 const meta = convertDeclarePipeFacadeToMetadata(declaration); 33179 const res = compilePipeFromMetadata(meta); 33180 return this.jitExpression(res.expression, angularCoreEnv, sourceMapUrl, []); 33181 } 33182 compileInjectable(angularCoreEnv, sourceMapUrl, facade) { 33183 var _facade$deps; 33184 const { 33185 expression, 33186 statements 33187 } = compileInjectable({ 33188 name: facade.name, 33189 type: wrapReference(facade.type), 33190 typeArgumentCount: facade.typeArgumentCount, 33191 providedIn: computeProvidedIn(facade.providedIn), 33192 useClass: convertToProviderExpression(facade, 'useClass'), 33193 useFactory: wrapExpression(facade, 'useFactory'), 33194 useValue: convertToProviderExpression(facade, 'useValue'), 33195 useExisting: convertToProviderExpression(facade, 'useExisting'), 33196 deps: (_facade$deps = facade.deps) === null || _facade$deps === void 0 ? void 0 : _facade$deps.map(convertR3DependencyMetadata) 33197 }, /* resolveForwardRefs */true); 33198 return this.jitExpression(expression, angularCoreEnv, sourceMapUrl, statements); 33199 } 33200 compileInjectableDeclaration(angularCoreEnv, sourceMapUrl, facade) { 33201 var _facade$deps2; 33202 const { 33203 expression, 33204 statements 33205 } = compileInjectable({
33206 name: facade.type.name, 33207 type: wrapReference(facade.type), 33208 typeArgumentCount: 0, 33209 providedIn: computeProvidedIn(facade.providedIn), 33210 useClass: convertToProviderExpression(facade, 'useClass'), 33211 useFactory: wrapExpression(facade, 'useFactory'), 33212 useValue: convertToProviderExpression(facade, 'useValue'), 33213 useExisting: convertToProviderExpression(facade, 'useExisting'), 33214 deps: (_facade$deps2 = facade.deps) === null || _facade$deps2 === void 0 ? void 0 : _facade$deps2.map(convertR3DeclareDependencyMetadata) 33215 }, /* resolveForwardRefs */true); 33216 return this.jitExpression(expression, angularCoreEnv, sourceMapUrl, statements); 33217 } 33218 compileInjector(angularCoreEnv, sourceMapUrl, facade) { 33219 const meta = { 33220 type: wrapReference(facade.type), 33221 providers: facade.providers && facade.providers.length > 0 ? new WrappedNodeExpr(facade.providers) : null, 33222 imports: facade.imports.map(i => new WrappedNodeExpr(i)) 33223 }; 33224 const res = compileInjector(meta); 33225 return this.jitExpression(res.expression, angularCoreEnv, sourceMapUrl, []); 33226 } 33227 compileInjectorDeclaration(angularCoreEnv, sourceMapUrl, declaration) { 33228 const meta = convertDeclareInjectorFacadeToMetadata(declaration); 33229 const res = compileInjector(meta); 33230 return this.jitExpression(res.expression, angularCoreEnv, sourceMapUrl, []); 33231 } 33232 compileNgModule(angularCoreEnv, sourceMapUrl, facade) { 33233 const meta = { 33234 kind: R3NgModuleMetadataKind.Global, 33235 type: wrapReference(facade.type), 33236 bootstrap: facade.bootstrap.map(wrapReference), 33237 declarations: facade.declarations.map(wrapReference), 33238 publicDeclarationTypes: null, 33239 // only needed for types in AOT 33240 imports: facade.imports.map(wrapReference), 33241 includeImportTypes: true, 33242 exports: facade.exports.map(wrapReference), 33243 selectorScopeMode: R3SelectorScopeMode.Inline, 33244 containsForwardDecls: false, 33245 schemas: facade.schemas ? facade.schemas.map(wrapReference) : null, 33246 id: facade.id ? new WrappedNodeExpr(facade.id) : null 33247 }; 33248 const res = compileNgModule(meta); 33249 return this.jitExpression(res.expression, angularCoreEnv, sourceMapUrl, []); 33250 } 33251 compileNgModuleDeclaration(angularCoreEnv, sourceMapUrl, declaration) { 33252 const expression = compileNgModuleDeclarationExpression(declaration); 33253 return this.jitExpression(expression, angularCoreEnv, sourceMapUrl, []); 33254 } 33255 compileDirective(angularCoreEnv, sourceMapUrl, facade) { 33256 const meta = convertDirectiveFacadeToMetadata(facade); 33257 return this.compileDirectiveFromMeta(angularCoreEnv, sourceMapUrl, meta); 33258 } 33259 compileDirectiveDeclaration(angularCoreEnv, sourceMapUrl, declaration) { 33260 const typeSourceSpan = this.createParseSourceSpan('Directive', declaration.type.name, sourceMapUrl); 33261 const meta = convertDeclareDirectiveFacadeToMetadata(declaration, typeSourceSpan); 33262 return this.compileDirectiveFromMeta(angularCoreEnv, sourceMapUrl, meta); 33263 } 33264 compileDirectiveFromMeta(angularCoreEnv, sourceMapUrl, meta) { 33265 const constantPool = new ConstantPool(); 33266 const bindingParser = makeBindingParser(); 33267 const res = compileDirectiveFromMetadata(meta, constantPool, bindingParser); 33268 return this.jitExpression(res.expression, angularCoreEnv, sourceMapUrl, constantPool.statements); 33269 } 33270 compileComponent(angularCoreEnv, sourceMapUrl, facade) { 33271 var _facade$changeDetecti; 33272 // Parse the template and check for errors. 33273 const { 33274 template, 33275 interpolation, 33276 defer 33277 } = parseJitTemplate(facade.template, facade.name, sourceMapUrl, facade.preserveWhitespaces, facade.interpolation, undefined); 33278 // Compile the component metadata, including template, into an expression. 33279 const meta = (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({}, facade), convertDirectiveFacadeToMetadata(facade)), {}, { 33280 selector: facade.selector || this.elementSchemaRegistry.getDefaultComponentElementName(), 33281 template, 33282 declarations: facade.declarations.map(convertDeclarationFacadeToMetadata), 33283 declarationListEmitMode: 0 /* DeclarationListEmitMode.Direct */, 33284 defer, 33285 styles: [...facade.styles, ...template.styles], 33286 encapsulation: facade.encapsulation, 33287 interpolation, 33288 changeDetection: (_facade$changeDetecti = facade.changeDetection) !== null && _facade$changeDetecti !== void 0 ? _facade$changeDetecti : null, 33289 animations: facade.animations != null ? new WrappedNodeExpr(facade.animations) : null, 33290 viewProviders: facade.viewProviders != null ? new WrappedNodeExpr(facade.viewProviders) : null, 33291 relativeContextFilePath: '', 33292 i18nUseExternalIds: true, 33293 relativeTemplatePath: null 33294 }); 33295 const jitExpressionSourceMap = `ng:///${facade.name}.js`; 33296 return this.compileComponentFromMeta(angularCoreEnv, jitExpressionSourceMap, meta); 33297 } 33298 compileComponentDeclaration(angularCoreEnv, sourceMapUrl, declaration) { 33299 const typeSourceSpan = this.createParseSourceSpan('Component', declaration.type.name, sourceMapUrl); 33300 const meta = convertDeclareComponentFacadeToMetadata(declaration, typeSourceSpan, sourceMapUrl); 33301 return this.compileComponentFromMeta(angularCoreEnv, sourceMapUrl, meta); 33302 } 33303 compileComponentFromMeta(angularCoreEnv, sourceMapUrl, meta) { 33304 const constantPool = new ConstantPool(); 33305 const bindingParser = makeBindingParser(meta.interpolation); 33306 const res = compileComponentFromMetadata(meta, constantPool, bindingParser); 33307 return this.jitExpression(res.expression, angularCoreEnv, sourceMapUrl, constantPool.statements); 33308 } 33309 compileFactory(angularCoreEnv, sourceMapUrl, meta) { 33310 const factoryRes = compileFactoryFunction({ 33311 name: meta.name, 33312 type: wrapReference(meta.type), 33313 typeArgumentCount: meta.typeArgumentCount, 33314 deps: convertR3DependencyMetadataArray(meta.deps), 33315 target: meta.target 33316 }); 33317 return this.jitExpression(factoryRes.expression, angularCoreEnv, sourceMapUrl, factoryRes.statements); 33318 } 33319 compileFactoryDeclaration(angularCoreEnv, sourceMapUrl, meta) { 33320 const factoryRes = compileFactoryFunction({ 33321 name: meta.type.name, 33322 type: wrapReference(meta.type), 33323 typeArgumentCount: 0, 33324 deps: Array.isArray(meta.deps) ? meta.deps.map(convertR3DeclareDependencyMetadata) : meta.deps, 33325 target: meta.target 33326 }); 33327 return this.jitExpression(factoryRes.expression, angularCoreEnv, sourceMapUrl, factoryRes.statements); 33328 } 33329 createParseSourceSpan(kind, typeName, sourceUrl) { 33330 return r3JitTypeSourceSpan(kind, typeName, sourceUrl); 33331 } 33332 /** 33333 * JIT compiles an expression and returns the result of executing that expression. 33334 * 33335 * @param def the definition which will be compiled and executed to get the value to patch 33336 * @param context an object map of @angular/core symbol names to symbols which will be available 33337 * in the context of the compiled expression 33338 * @param sourceUrl a URL to use for the source map of the compiled expression 33339 * @param preStatements a collection of statements that should be evaluated before the expression. 33340 */ 33341 jitExpression(def, context, sourceUrl, preStatements) { 33342 // The ConstantPool may contain Statements which declare variables used in the final expression. 33343 // Therefore, its statements need to precede the actual JIT operation. The final statement is a 33344 // declaration of $def which is set to the expression being compiled. 33345 const statements = [...preStatements, new DeclareVarStmt('$def', def, undefined, StmtModifier.Exported)]; 33346 const res = this.jitEvaluator.evaluateStatements(sourceUrl, statements, new R3JitReflector(context), /* enableSourceMaps */true); 33347 return res['$def']; 33348 } 33349} 33350function convertToR3QueryMetadata(facade) { 33351 return (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({}, facade), {}, { 33352 isSignal: facade.isSignal, 33353 predicate: convertQueryPredicate(facade.predicate), 33354 read: facade.read ? new WrappedNodeExpr(facade.read) : null, 33355 static: facade.static, 33356 emitDistinctChangesOnly: facade.emitDistinctChangesOnly 33357 }); 33358} 33359function convertQueryDeclarationToMetadata(declaration) { 33360 var _declaration$first, _declaration$descenda, _declaration$static, _declaration$emitDist; 33361 return { 33362 propertyName: declaration.propertyName, 33363 first: (_declaration$first = declaration.first) !== null && _declaration$first !== void 0 ? _declaration$first : false, 33364 predicate: convertQueryPredicate(declaration.predicate), 33365 descendants: (_declaration$descenda = declaration.descendants) !== null && _declaration$descenda !== void 0 ? _declaration$descenda : false, 33366 read: declaration.read ? new WrappedNodeExpr(declaration.read) : null, 33367 static: (_declaration$static = declaration.static) !== null && _declaration$static !== void 0 ? _declaration$static : false, 33368 emitDistinctChangesOnly: (_declaration$emitDist = declaration.emitDistinctChangesOnly) !== null && _declaration$emitDist !== void 0 ? _declaration$emitDist : true, 33369 isSignal: !!declaration.isSignal 33370 }; 33371} 33372function convertQueryPredicate(predicate) { 33373 return Array.isArray(predicate) ?
33374 // The predicate is an array of strings so pass it through. 33375 predicate : 33376 // The predicate is a type - assume that we will need to unwrap any `forwardRef()` calls. 33377 createMayBeForwardRefExpression(new WrappedNodeExpr(predicate), 1 /* ForwardRefHandling.Wrapped */); 33378} 33379function convertDirectiveFacadeToMetadata(facade) { 33380 var _facade$hostDirective; 33381 const inputsFromMetadata = parseInputsArray(facade.inputs || []); 33382 const outputsFromMetadata = parseMappingStringArray(facade.outputs || []); 33383 const propMetadata = facade.propMetadata; 33384 const inputsFromType = {}; 33385 const outputsFromType = {}; 33386 for (const field in propMetadata) { 33387 if (propMetadata.hasOwnProperty(field)) { 33388 propMetadata[field].forEach(ann => { 33389 if (isInput(ann)) { 33390 inputsFromType[field] = { 33391 bindingPropertyName: ann.alias || field, 33392 classPropertyName: field, 33393 required: ann.required || false, 33394 // For JIT, decorators are used to declare signal inputs. That is because of 33395 // a technical limitation where it's not possible to statically reflect class 33396 // members of a directive/component at runtime before instantiating the class. 33397 isSignal: !!ann.isSignal, 33398 transformFunction: ann.transform != null ? new WrappedNodeExpr(ann.transform) : null 33399 }; 33400 } else if (isOutput(ann)) { 33401 outputsFromType[field] = ann.alias || field; 33402 } 33403 }); 33404 } 33405 } 33406 const hostDirectives = (_facade$hostDirective = facade.hostDirectives) !== null && _facade$hostDirective !== void 0 && _facade$hostDirective.length ? facade.hostDirectives.map(hostDirective => { 33407 return typeof hostDirective === 'function' ? { 33408 directive: wrapReference(hostDirective), 33409 inputs: null, 33410 outputs: null, 33411 isForwardReference: false 33412 } : { 33413 directive: wrapReference(hostDirective.directive), 33414 isForwardReference: false, 33415 inputs: hostDirective.inputs ? parseMappingStringArray(hostDirective.inputs) : null, 33416 outputs: hostDirective.outputs ? parseMappingStringArray(hostDirective.outputs) : null 33417 }; 33418 }) : null; 33419 return (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({}, facade), {}, { 33420 typeArgumentCount: 0, 33421 typeSourceSpan: facade.typeSourceSpan, 33422 type: wrapReference(facade.type), 33423 deps: null, 33424 host: (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({}, extractHostBindings(facade.propMetadata, facade.typeSourceSpan, facade.host)), 33425 inputs: (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({}, inputsFromMetadata), inputsFromType), 33426 outputs: (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({}, outputsFromMetadata), outputsFromType), 33427 queries: facade.queries.map(convertToR3QueryMetadata), 33428 providers: facade.providers != null ? new WrappedNodeExpr(facade.providers) : null, 33429 viewQueries: facade.viewQueries.map(convertToR3QueryMetadata), 33430 fullInheritance: false, 33431 hostDirectives 33432 }); 33433} 33434function convertDeclareDirectiveFacadeToMetadata(declaration, typeSourceSpan) { 33435 var _declaration$hostDire, _declaration$selector, _declaration$outputs, _declaration$queries, _declaration$viewQuer, _declaration$exportAs, _declaration$usesInhe, _declaration$usesOnCh, _declaration$isStanda, _declaration$isSignal; 33436 const hostDirectives = (_declaration$hostDire = declaration.hostDirectives) !== null && _declaration$hostDire !== void 0 && _declaration$hostDire.length ? declaration.hostDirectives.map(dir => ({ 33437 directive: wrapReference(dir.directive), 33438 isForwardReference: false, 33439 inputs: dir.inputs ? getHostDirectiveBindingMapping(dir.inputs) : null, 33440 outputs: dir.outputs ? getHostDirectiveBindingMapping(dir.outputs) : null 33441 })) : null; 33442 return { 33443 name: declaration.type.name, 33444 type: wrapReference(declaration.type), 33445 typeSourceSpan, 33446 selector: (_declaration$selector = declaration.selector) !== null && _declaration$selector !== void 0 ? _declaration$selector : null, 33447 inputs: declaration.inputs ? inputsPartialMetadataToInputMetadata(declaration.inputs) : {}, 33448 outputs: (_declaration$outputs = declaration.outputs) !== null && _declaration$outputs !== void 0 ? _declaration$outputs : {}, 33449 host: convertHostDeclarationToMetadata(declaration.host), 33450 queries: ((_declaration$queries = declaration.queries) !== null && _declaration$queries !== void 0 ? _declaration$queries : []).map(convertQueryDeclarationToMetadata), 33451 viewQueries: ((_declaration$viewQuer = declaration.viewQueries) !== null && _declaration$viewQuer !== void 0 ? _declaration$viewQuer : []).map(convertQueryDeclarationToMetadata), 33452 providers: declaration.providers !== undefined ? new WrappedNodeExpr(declaration.providers) : null, 33453 exportAs: (_declaration$exportAs = declaration.exportAs) !== null && _declaration$exportAs !== void 0 ? _declaration$exportAs : null, 33454 usesInheritance: (_declaration$usesInhe = declaration.usesInheritance) !== null && _declaration$usesInhe !== void 0 ? _declaration$usesInhe : false, 33455 lifecycle: { 33456 usesOnChanges: (_declaration$usesOnCh = declaration.usesOnChanges) !== null && _declaration$usesOnCh !== void 0 ? _declaration$usesOnCh : false 33457 }, 33458 deps: null, 33459 typeArgumentCount: 0, 33460 fullInheritance: false, 33461 isStandalone: (_declaration$isStanda = declaration.isStandalone) !== null && _declaration$isStanda !== void 0 ? _declaration$isStanda : getJitStandaloneDefaultForVersion(declaration.version), 33462 isSignal: (_declaration$isSignal = declaration.isSignal) !== null && _declaration$isSignal !== void 0 ? _declaration$isSignal : false, 33463 hostDirectives 33464 }; 33465} 33466function convertHostDeclarationToMetadata(host = {}) { 33467 var _host$attributes, _host$listeners, _host$properties; 33468 return { 33469 attributes: convertOpaqueValuesToExpressions((_host$attributes = host.attributes) !== null && _host$attributes !== void 0 ? _host$attributes : {}), 33470 listeners: (_host$listeners = host.listeners) !== null && _host$listeners !== void 0 ? _host$listeners : {}, 33471 properties: (_host$properties = host.properties) !== null && _host$properties !== void 0 ? _host$properties : {}, 33472 specialAttributes: { 33473 classAttr: host.classAttribute, 33474 styleAttr: host.styleAttribute 33475 } 33476 }; 33477} 33478/** 33479 * Parses a host directive mapping where each odd array key is the name of an input/output 33480 * and each even key is its public name, e.g. `['one', 'oneAlias', 'two', 'two']`. 33481 */ 33482function getHostDirectiveBindingMapping(array) { 33483 let result = null; 33484 for (let i = 1; i < array.length; i += 2) { 33485 result = result || {}; 33486 result[array[i - 1]] = array[i]; 33487 } 33488 return result; 33489} 33490function convertOpaqueValuesToExpressions(obj) { 33491 const result = {}; 33492 for (const key of Object.keys(obj)) { 33493 result[key] = new WrappedNodeExpr(obj[key]); 33494 } 33495 return result; 33496} 33497function convertDeclareComponentFacadeToMetadata(decl, typeSourceSpan, sourceMapUrl) { 33498 var _decl$preserveWhitesp, _decl$styles, _decl$changeDetection, _decl$encapsulation; 33499 const { 33500 template, 33501 interpolation, 33502 defer 33503 }
33503 = parseJitTemplate(decl.template, decl.type.name, sourceMapUrl, (_decl$preserveWhitesp = decl.preserveWhitespaces) !== null && _decl$preserveWhitesp !== void 0 ? _decl$preserveWhitesp : false, decl.interpolation, decl.deferBlockDependencies); 33504 const declarations = []; 33505 if (decl.dependencies) { 33506 for (const innerDep of decl.dependencies) { 33507 switch (innerDep.kind) { 33508 case 'directive': 33509 case 'component': 33510 declarations.push(convertDirectiveDeclarationToMetadata(innerDep)); 33511 break; 33512 case 'pipe': 33513 declarations.push(convertPipeDeclarationToMetadata(innerDep)); 33514 break; 33515 } 33516 } 33517 } else if (decl.components || decl.directives || decl.pipes) { 33518 // Existing declarations on NPM may not be using the new `dependencies` merged field, and may 33519 // have separate fields for dependencies instead. Unify them for JIT compilation. 33520 decl.components && declarations.push(...decl.components.map(dir => convertDirectiveDeclarationToMetadata(dir, /* isComponent */true))); 33521 decl.directives && declarations.push(...decl.directives.map(dir => convertDirectiveDeclarationToMetadata(dir))); 33522 decl.pipes && declarations.push(...convertPipeMapToMetadata(decl.pipes)); 33523 } 33524 return (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({}, convertDeclareDirectiveFacadeToMetadata(decl, typeSourceSpan)), {}, { 33525 template, 33526 styles: (_decl$styles = decl.styles) !== null && _decl$styles !== void 0 ? _decl$styles : [], 33527 declarations, 33528 viewProviders: decl.viewProviders !== undefined ? new WrappedNodeExpr(decl.viewProviders) : null, 33529 animations: decl.animations !== undefined ? new WrappedNodeExpr(decl.animations) : null, 33530 defer, 33531 changeDetection: (_decl$changeDetection = decl.changeDetection) !== null && _decl$changeDetection !== void 0 ? _decl$changeDetection : ChangeDetectionStrategy.Default, 33532 encapsulation: (_decl$encapsulation = decl.encapsulation) !== null && _decl$encapsulation !== void 0 ? _decl$encapsulation : ViewEncapsulation$1.Emulated, 33533 interpolation, 33534 declarationListEmitMode: 2 /* DeclarationListEmitMode.ClosureResolved */, 33535 relativeContextFilePath: '', 33536 i18nUseExternalIds: true, 33537 relativeTemplatePath: null 33538 }); 33539} 33540function convertDeclarationFacadeToMetadata(declaration) { 33541 return (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({}, declaration), {}, { 33542 type: new WrappedNodeExpr(declaration.type) 33543 }); 33544} 33545function convertDirectiveDeclarationToMetadata(declaration, isComponent = null) { 33546 var _declaration$inputs, _declaration$outputs2, _declaration$exportAs2; 33547 return { 33548 kind: R3TemplateDependencyKind.Directive, 33549 isComponent: isComponent || declaration.kind === 'component', 33550 selector: declaration.selector, 33551 type: new WrappedNodeExpr(declaration.type), 33552 inputs: (_declaration$inputs = declaration.inputs) !== null && _declaration$inputs !== void 0 ? _declaration$inputs : [], 33553 outputs: (_declaration$outputs2 = declaration.outputs) !== null && _declaration$outputs2 !== void 0 ? _declaration$outputs2 : [], 33554 exportAs: (_declaration$exportAs2 = declaration.exportAs) !== null && _declaration$exportAs2 !== void 0 ? _declaration$exportAs2 : null 33555 }; 33556} 33557function convertPipeMapToMetadata(pipes) { 33558 if (!pipes) { 33559 return []; 33560 } 33561 return Object.keys(pipes).map(name => { 33562 return { 33563 kind: R3TemplateDependencyKind.Pipe, 33564 name, 33565 type: new WrappedNodeExpr(pipes[name]) 33566 }; 33567 }); 33568} 33569function convertPipeDeclarationToMetadata(pipe) { 33570 return { 33571 kind: R3TemplateDependencyKind.Pipe, 33572 name: pipe.name, 33573 type: new WrappedNodeExpr(pipe.type) 33574 }; 33575} 33576function parseJitTemplate(template, typeName, sourceMapUrl, preserveWhitespace
33576s, interpolation, deferBlockDependencies) { 33577 const interpolationConfig = interpolation ? InterpolationConfig.fromArray(interpolation) : DEFAULT_INTERPOLATION_CONFIG; 33578 // Parse the template and check for errors. 33579 const parsed = parseTemplate(template, sourceMapUrl, { 33580 preserveWhitespaces, 33581 interpolationConfig 33582 }); 33583 if (parsed.errors !== null) { 33584 const errors = parsed.errors.map(err => err.toString()).join(', '); 33585 throw new Error(`Errors during JIT compilation of template for ${typeName}: ${errors}`); 33586 } 33587 const binder = new R3TargetBinder(new SelectorMatcher()); 33588 const boundTarget = binder.bind({ 33589 template: parsed.nodes 33590 }); 33591 return { 33592 template: parsed, 33593 interpolation: interpolationConfig, 33594 defer: createR3ComponentDeferMetadata(boundTarget, deferBlockDependencies) 33595 }; 33596} 33597/** 33598 * Convert the expression, if present to an `R3ProviderExpression`. 33599 * 33600 * In JIT mode we do not want the compiler to wrap the expression in a `forwardRef()` call because, 33601 * if it is referencing a type that has not yet been defined, it will have already been wrapped in 33602 * a `forwardRef()` - either by the application developer or during partial-compilation. Thus we can 33603 * use `ForwardRefHandling.None`. 33604 */ 33605function convertToProviderExpression(obj, property) { 33606 if (obj.hasOwnProperty(property)) { 33607 return createMayBeForwardRefExpression(new WrappedNodeExpr(obj[property]), 0 /* ForwardRefHandling.None */); 33608 } else { 33609 return undefined; 33610 } 33611} 33612function wrapExpression(obj, property) { 33613 if (obj.hasOwnProperty(property)) { 33614 return new WrappedNodeExpr(obj[property]); 33615 } else { 33616 return undefined; 33617 } 33618} 33619function computeProvidedIn(providedIn) { 33620 const expression = typeof providedIn === 'function' ? new WrappedNodeExpr(providedIn) : new LiteralExpr(providedIn !== null && providedIn !== void 0 ? providedIn : null); 33621 // See `convertToProviderExpression()` for why this uses `ForwardRefHandling.None`. 33622 return createMayBeForwardRefExpression(expression, 0 /* ForwardRefHandling.None */); 33623} 33624function convertR3DependencyMetadataArray(facades) { 33625 return facades == null ? null : facades.map(convertR3DependencyMetadata); 33626} 33627function convertR3DependencyMetadata(facade) { 33628 const isAttributeDep = facade.attribute != null; // both `null` and `undefined` 33629 const rawToken = facade.token === null ? null : new WrappedNodeExpr(facade.token); 33630 // In JIT mode, if the dep is an `@Attribute()` then we use the attribute name given in 33631 // `attribute` rather than the `token`. 33632 const token = isAttributeDep ? new WrappedNodeExpr(facade.attribute) : rawToken; 33633 return createR3DependencyMetadata(token, isAttributeDep, facade.host, facade.optional, facade.self, facade.skipSelf); 33634} 33635function convertR3DeclareDependencyMetadata(facade) { 33636 var _facade$attribute, _facade$host, _facade$optional, _facade$self, _facade$skipSelf; 33637 const isAttributeDep = (_facade$attribute = facade.attribute) !== null && _facade$attribute !== void 0 ? _facade$attribute : false; 33638 const token = facade.token === null ? null : new WrappedNodeExpr(facade.token); 33639 return createR3DependencyMetadata(token, isAttributeDep, (_facade$host = facade.host) !== null && _facade$host !== void 0 ? _facade$host : false, (_facade$optional = facade.optional) !== null && _facade$optional !== void 0 ? _facade$optional : false, (_facade$self = facade.self) !== null && _facade$self !== void 0 ? _facade$self : false, (_facade$skipSelf = facade.skipSelf) !== null && _facade$skipSelf !== void 0 ? _facade$skipSelf : false); 33640} 33641function createR3DependencyMetadata(token, isAttributeDep, host, optional, self, skipSelf) { 33642 // If the dep is an `@Attribute()` the `attributeNameType` ought to be the `unknown` type. 33643 // But types are not available at runtime so we just use a literal `"<unknown>"` string as a dummy 33644 // marker. 33645 const attributeNameType = isAttributeDep ? literal('unknown') : null; 33646 return { 33647 token, 33648 attributeNameType, 33649 host, 33650 optional, 33651 self, 33652 skipSelf 33653 }; 33654} 33655function createR3ComponentDeferMetadata(boundTarget, deferBlockDependencies) { 33656 const deferredBlocks = boundTarget.getDeferBlocks(); 33657 const blocks = new Map(); 33658 for (let i = 0; i < deferredBlocks.length; i++) { 33659 const dependencyFn = deferBlockDependencies === null || deferBlockDependencies === void 0 ? void 0 : deferBlockDependencies[i]; 33660 blocks.set(deferredBlocks[i], dependencyFn ? new WrappedNodeExpr(dependencyFn) : null); 33661 } 33662 return { 33663 mode: 0 /* DeferBlockDepsEmitMode.PerBlock */, 33664 blocks 33665 }; 33666} 33667function extractHostBindings(propMetadata, sourceSpan, host) { 33668 // First parse the declarations from the metadata. 33669 const bindings = parseHostBindings(host || {}); 33670 // After that check host bindings for errors 33671 const errors = verifyHostBindings(bindings, sourceSpan); 33672 if (errors.length) { 33673 throw new Error(errors.map(error => error.msg).join('\n')); 33674 } 33675 // Next, loop over the properties of the object, looking for @HostBinding and @HostListener. 33676 for (const field in propMetadata) { 33677 if (propMetadata.hasOwnProperty(field)) {
33678 propMetadata[field].forEach(ann => { 33679 if (isHostBinding(ann)) { 33680 // Since this is a decorator, we know that the value is a class member. Always access it 33681 // through `this` so that further down the line it can't be confused for a literal value 33682 // (e.g. if there's a property called `true`). 33683 bindings.properties[ann.hostPropertyName || field] = getSafePropertyAccessString('this', field); 33684 } else if (isHostListener(ann)) { 33685 bindings.listeners[ann.eventName || field] = `${field}(${(ann.args || []).join(',')})`; 33686 } 33687 }); 33688 } 33689 } 33690 return bindings; 33691} 33692function isHostBinding(value) { 33693 return value.ngMetadataName === 'HostBinding'; 33694} 33695function isHostListener(value) { 33696 return value.ngMetadataName === 'HostListener'; 33697} 33698function isInput(value) { 33699 return value.ngMetadataName === 'Input'; 33700} 33701function isOutput(value) { 33702 return value.ngMetadataName === 'Output'; 33703} 33704function inputsPartialMetadataToInputMetadata(inputs) { 33705 return Object.keys(inputs).reduce((result, minifiedClassName) => { 33706 const value = inputs[minifiedClassName]; 33707 // Handle legacy partial input output. 33708 if (typeof value === 'string' || Array.isArray(value)) { 33709 result[minifiedClassName] = parseLegacyInputPartialOutput(value); 33710 } else { 33711 result[minifiedClassName] = { 33712 bindingPropertyName: value.publicName, 33713 classPropertyName: minifiedClassName, 33714 transformFunction: value.transformFunction !== null ? new WrappedNodeExpr(value.transformFunction) : null, 33715 required: value.isRequired, 33716 isSignal: value.isSignal 33717 }; 33718 } 33719 return result; 33720 }, {}); 33721} 33722/** 33723 * Parses the legacy input partial output. For more details see `partial/directive.ts`. 33724 * TODO(legacy-partial-output-inputs): Remove in v18. 33725 */ 33726function parseLegacyInputPartialOutput(value) { 33727 if (typeof value === 'string') { 33728 return { 33729 bindingPropertyName: value, 33730 classPropertyName: value, 33731 transformFunction: null, 33732 required: false, 33733 // legacy partial output does not capture signal inputs. 33734 isSignal: false 33735 }; 33736 } 33737 return { 33738 bindingPropertyName: value[0], 33739 classPropertyName: value[1], 33740 transformFunction: value[2] ? new WrappedNodeExpr(value[2]) : null, 33741 required: false, 33742 // legacy partial output does not capture signal inputs. 33743 isSignal: false 33744 }; 33745} 33746function parseInputsArray(values) { 33747 return values.reduce((results, value) => { 33748 if (typeof value === 'string') { 33749 const [bindingPropertyName, classPropertyName] = parseMappingString(value); 33750 results[classPropertyName] = { 33751 bindingPropertyName, 33752 classPropertyName, 33753 required: false, 33754 // Signal inputs not supported for the inputs array. 33755 isSignal: false, 33756 transformFunction: null 33757 }; 33758 } else { 33759 results[value.name] = { 33760 bindingPropertyName: value.alias || value.name, 33761 classPropertyName: value.name, 33762 required: value.required || false, 33763 // Signal inputs not supported for the inputs array. 33764 isSignal: false, 33765 transformFunction: value.transform != null ? new WrappedNodeExpr(value.transform) : null 33766 }; 33767 } 33768 return results; 33769 }, {}); 33770} 33771function parseMappingStringArray(values) { 33772 return values.reduce((results, value) => { 33773 const [alias, fieldName] = parseMappingString(value); 33774 results[fieldName] = alias; 33775 return results; 33776 }, {}); 33777} 33778function parseMappingString(value) { 33779 // Either the value is 'field' or 'field: property'. In the first case, `property` will 33780 // be undefined, in which case the field name should also be used as the property name. 33781 const [fieldName, bindingPropertyName] = value.split(':', 2).map(str => str.trim()); 33782 return [bindingPropertyName !== null && bindingPropertyName !== void 0 ? bindingPropertyName : fieldName, fieldName]; 33783} 33784function convertDeclarePipeFacadeToMetadata(declaration) { 33785 var _declaration$pure, _declaration$isStanda2; 33786 return { 33787 name: declaration.type.name, 33788 type: wrapReference(declaration.type), 33789 typeArgumentCount: 0, 33790 pipeName: declaration.name, 33791 deps: null, 33792 pure: (_declaration$pure = declaration.pure) !== null && _declaration$pure !== void 0 ? _declaration$pure : true, 33793 isStandalone: (_declaration$isStanda2 = declaration.isStandalone) !== null && _declaration$isStanda2 !== void 0 ? _declaration$isStanda2 : getJitStandaloneDefaultForVersion(declaration.version) 33794 }; 33795} 33796function convertDeclareInjectorFacadeToMetadata(declaration) { 33797 return { 33798 name: declaration.type.name, 33799 type: wrapReference(declaration.type), 33800 providers: declaration.providers !== undefined && declaration.providers.length > 0 ? new WrappedNodeExpr(declaration.providers) : null, 33801 imports: declaration.imports !== undefined ? declaration.imports.map(i => new WrappedNodeExpr(i)) : [] 33802 }; 33803} 33804function publishFacade(global) { 33805 const ng = global.ng || (global.ng = {}); 33806 ng.ɵcompilerFacade = new CompilerFacadeImpl(); 33807} 33808 33809/** 33810 * @module 33811 * @description 33812 * Entry point for all public APIs of the compiler package. 33813 */ 33814const VERSION = new Version('19.2.14'); 33815class CompilerConfig { 33816 constructor({ 33817 defaultEncapsulation = ViewEncapsulation$1.Emulated,
33818 preserveWhitespaces, 33819 strictInjectionParameters 33820 } = {}) { 33821 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "defaultEncapsulation", void 0); 33822 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "preserveWhitespaces", void 0); 33823 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "strictInjectionParameters", void 0); 33824 this.defaultEncapsulation = defaultEncapsulation; 33825 this.preserveWhitespaces = preserveWhitespacesDefault(noUndefined(preserveWhitespaces)); 33826 this.strictInjectionParameters = strictInjectionParameters === true; 33827 } 33828} 33829function preserveWhitespacesDefault(preserveWhitespacesOption, defaultSetting = false) { 33830 return preserveWhitespacesOption === null ? defaultSetting : preserveWhitespacesOption; 33831} 33832const _I18N_ATTR = 'i18n'; 33833const _I18N_ATTR_PREFIX = 'i18n-'; 33834const _I18N_COMMENT_PREFIX_REGEXP = /^i18n:?/; 33835const MEANING_SEPARATOR = '|'; 33836const ID_SEPARATOR = '@@'; 33837let i18nCommentsWarned = false; 33838/** 33839 * Extract translatable messages from an html AST 33840 */ 33841function extractMessages(nodes, interpolationConfig, implicitTags, implicitAttrs, preserveSignificantWhitespace) { 33842 const visitor = new _Visitor(implicitTags, implicitAttrs, preserveSignificantWhitespace); 33843 return visitor.extract(nodes, interpolationConfig); 33844} 33845function mergeTranslations(nodes, translations, interpolationConfig, implicitTags, implicitAttrs) { 33846 const visitor = new _Visitor(implicitTags, implicitAttrs); 33847 return visitor.merge(nodes, translations, interpolationConfig); 33848} 33849class ExtractionResult { 33850 constructor(messages, errors) { 33851 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "messages", void 0); 33852 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "errors", void 0); 33853 this.messages = messages; 33854 this.errors = errors; 33855 } 33856} 33857var _VisitorMode = /*#__PURE__*/function (_VisitorMode) { 33858 _VisitorMode[_VisitorMode["Extract"] = 0] = "Extract"; 33859 _VisitorMode[_VisitorMode["Merge"] = 1] = "Merge"; 33860 return _VisitorMode; 33861}(_VisitorMode || {}); 33862/** 33863 * This Visitor is used: 33864 * 1. to extract all the translatable strings from an html AST (see `extract()`), 33865 * 2. to replace the translatable strings with the actual translations (see `merge()`) 33866 * 33867 * @internal 33868 */ 33869class _Visitor { 33870 constructor(_implicitTags, _implicitAttrs, _preserveSignificantWhitespace = true) { 33871 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_implicitTags", void 0); 33872 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_implicitAttrs", void 0); 33873 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_preserveSignificantWhitespace", void 0); 33874 // Using non-null assertions because all variables are (re)set in init() 33875 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_depth", void 0); 33876 // <el i18n>...</el> 33877 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_inI18nNode", void 0); 33878 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_inImplicitNode", void 0); 33879 // <!--i18n-->...<!--/i18n--> 33880 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_inI18nBlock", void 0); 33881 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_blockMeaningAndDesc", void 0); 33882 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_blockChildren", void 0); 33883 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_blockStartDepth", void 0); 33884 // {<icu message>} 33885 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_inIcu", void 0); 33886 // set to void 0 when not in a section 33887 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_msgCountAtSectionStart", void 0); 33888 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_errors", void 0); 33889 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_mode", void 0); 33890 // _VisitorMode.Extract only 33891 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_messages", void 0); 33892 // _VisitorMode.Merge only 33893 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_translations", void 0); 33894 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_createI18nMessage", void 0); 33895 this._implicitTags = _implicitTags; 33896 this._implicitAttrs = _implicitAttrs; 33897 this._preserveSignificantWhitespace = _preserveSignificantWhitespace; 33898 } 33899 /** 33900 * Extracts the messages from the tree 33901 */ 33902 extract(nodes, interpolationConfig) { 33903 this._init(_VisitorMode.Extract, interpolationConfig);
33904 nodes.forEach(node => node.visit(this, null)); 33905 if (this._inI18nBlock) { 33906 this._reportError(nodes[nodes.length - 1], 'Unclosed block'); 33907 } 33908 return new ExtractionResult(this._messages, this._errors); 33909 } 33910 /** 33911 * Returns a tree where all translatable nodes are translated 33912 */ 33913 merge(nodes, translations, interpolationConfig) { 33914 this._init(_VisitorMode.Merge, interpolationConfig); 33915 this._translations = translations; 33916 // Construct a single fake root element 33917 const wrapper = new Element('wrapper', [], nodes, undefined, undefined, undefined); 33918 const translatedNode = wrapper.visit(this, null); 33919 if (this._inI18nBlock) { 33920 this._reportError(nodes[nodes.length - 1], 'Unclosed block'); 33921 } 33922 return new ParseTreeResult(translatedNode.children, this._errors); 33923 } 33924 visitExpansionCase(icuCase, context) { 33925 // Parse cases for translatable html attributes 33926 const expression = visitAll(this, icuCase.expression, context); 33927 if (this._mode === _VisitorMode.Merge) { 33928 return new ExpansionCase(icuCase.value, expression, icuCase.sourceSpan, icuCase.valueSourceSpan, icuCase.expSourceSpan); 33929 } 33930 } 33931 visitExpansion(icu, context) { 33932 this._mayBeAddBlockChildren(icu); 33933 const wasInIcu = this._inIcu; 33934 if (!this._inIcu) { 33935 // nested ICU messages should not be extracted but top-level translated as a whole 33936 if (this._isInTranslatableSection) { 33937 this._addMessage([icu]); 33938 } 33939 this._inIcu = true; 33940 } 33941 const cases = visitAll(this, icu.cases, context); 33942 if (this._mode === _VisitorMode.Merge) { 33943 icu = new Expansion(icu.switchValue, icu.type, cases, icu.sourceSpan, icu.switchValueSourceSpan); 33944 } 33945 this._inIcu = wasInIcu; 33946 return icu; 33947 } 33948 visitComment(comment, context) { 33949 const isOpening = _isOpeningComment(comment); 33950 if (isOpening && this._isInTranslatableSection) { 33951 this._reportError(comment, 'Could not start a block inside a translatable section'); 33952 return; 33953 } 33954 const isClosing = _isClosingComment(comment); 33955 if (isClosing && !this._inI18nBlock) { 33956 this._reportError(comment, 'Trying to close an unopened block'); 33957 return; 33958 } 33959 if (!this._inI18nNode && !this._inIcu) { 33960 if (!this._inI18nBlock) { 33961 if (isOpening) { 33962 // deprecated from v5 you should use <ng-container i18n> instead of i18n comments 33963 if (!i18nCommentsWarned && console && console.warn) { 33964 i18nCommentsWarned = true; 33965 const details = comment.sourceSpan.details ? `, ${comment.sourceSpan.details}` : ''; 33966 // TODO(ocombe): use a log service once there is a public one available 33967 console.warn(`I18n comments are deprecated, use an <ng-container> element instead (${comment.sourceSpan.start}${details})`); 33968 } 33969 this._inI18nBlock = true; 33970 this._blockStartDepth = this._depth; 33971 this._blockChildren = []; 33972 this._blockMeaningAndDesc = comment.value.replace(_I18N_COMMENT_PREFIX_REGEXP, '').trim(); 33973 this._openTranslatableSection(comment); 33974 } 33975 } else { 33976 if (isClosing) { 33977 if (this._depth == this._blockStartDepth) { 33978 this._closeTranslatableSection(comment, this._blockChildren); 33979 this._inI18nBlock = false; 33980 const message = this._addMessage(this._blockChildren, this._blockMeaningAndDesc); 33981 // merge attributes in sections 33982 const nodes = this._translateMessage(comment, message); 33983 return visitAll(this, nodes); 33984 } else { 33985 this._reportError(comment, 'I18N blocks should not cross element boundaries'); 33986 return; 33987 } 33988 } 33989 } 33990 } 33991 } 33992 visitText(text, context) { 33993 if (this._isInTranslatableSection) { 33994 this._mayBeAddBlockChildren(text); 33995 } 33996 return text; 33997 } 33998 visitElement(el, context) { 33999 this._mayBeAddBlockChildren(el); 34000 this._depth++; 34001 const wasInI18nNode = this._inI18nNode; 34002 const wasInImplicitNode = this._inImplicitNode; 34003 let childNodes = []; 34004 let translatedChildNodes = undefined; 34005 // Extract: 34006 // - top level nodes with the (implicit) "i18n" attribute if not already in a section 34007 // - ICU messages 34008 const i18nAttr = _getI18nAttr(el); 34009 const i18nMeta = i18nAttr ? i18nAttr.value : ''; 34010 const isImplicit = this._implicitTags.some(tag => el.name === tag) && !this._inIcu && !this._isInTranslatableSection; 34011 const isTopLevelImplicit = !wasInImplicitNode && isImplicit; 34012 this._inImplicitNode = wasInImplicitNode || isImplicit; 34013 if (!this._isInTranslatableSection && !this._inIcu) { 34014 if (i18nAttr || isTopLevelImplicit) { 34015 this._inI18nNode = true; 34016 const message = this._addMessage(el.children, i18nMeta); 34017 translatedChildNodes = this._translateMessage(el, message); 34018 } 34019 if (this._mode == _VisitorMode.Extract) { 34020 const isTranslatable = i18nAttr || isTopLevelImplicit; 34021 if (isTranslatable) this._openTranslatableSection(el); 34022 visitAll(this, el.children); 34023 if (isTranslatable) this._closeTranslatableSection(el, el.children); 34024 } 34025 } else { 34026 if (i18nAttr || isTopLevelImplicit) { 34027 this._reportError(el, 'Could not mark an element as translatable inside a translatable section'); 34028 } 34029 if (this._mode == _VisitorMode.Extract) { 34030 // Descend into child nodes for extraction 34031 visitAll(this, el.children); 34032 } 34033 } 34034 if (this._mode === _VisitorMode.Merge) { 34035 const visitNodes = translatedChildNodes || el.children;
34036 visitNodes.forEach(child => { 34037 const visited = child.visit(this, context); 34038 if (visited && !this._isInTranslatableSection) { 34039 // Do not add the children from translatable sections (= i18n blocks here) 34040 // They will be added later in this loop when the block closes (i.e. on `<!-- /i18n -->`) 34041 childNodes = childNodes.concat(visited); 34042 } 34043 }); 34044 } 34045 this._visitAttributesOf(el); 34046 this._depth--; 34047 this._inI18nNode = wasInI18nNode; 34048 this._inImplicitNode = wasInImplicitNode; 34049 if (this._mode === _VisitorMode.Merge) { 34050 const translatedAttrs = this._translateAttributes(el); 34051 return new Element(el.name, translatedAttrs, childNodes, el.sourceSpan, el.startSourceSpan, el.endSourceSpan); 34052 } 34053 return null; 34054 } 34055 visitAttribute(attribute, context) { 34056 throw new Error('unreachable code'); 34057 } 34058 visitBlock(block, context) { 34059 visitAll(this, block.children, context); 34060 } 34061 visitBlockParameter(parameter, context) {} 34062 visitLetDeclaration(decl, context) {} 34063 _init(mode, interpolationConfig) { 34064 this._mode = mode; 34065 this._inI18nBlock = false; 34066 this._inI18nNode = false; 34067 this._depth = 0; 34068 this._inIcu = false; 34069 this._msgCountAtSectionStart = undefined; 34070 this._errors = []; 34071 this._messages = []; 34072 this._inImplicitNode = false; 34073 this._createI18nMessage = createI18nMessageFactory(interpolationConfig, DEFAULT_CONTAINER_BLOCKS, 34074 // When dropping significant whitespace we need to retain whitespace tokens or 34075 // else we won't be able to reuse source spans because empty tokens would be 34076 // removed and cause a mismatch. 34077 /* retainEmptyTokens */ 34078 !this._preserveSignificantWhitespace, /* preserveExpressionWhitespace */this._preserveSignificantWhitespace); 34079 } 34080 // looks for translatable attributes 34081 _visitAttributesOf(el) { 34082 const explicitAttrNameToValue = {}; 34083 const implicitAttrNames = this._implicitAttrs[el.name] || []; 34084 el.attrs.filter(attr => attr.name.startsWith(_I18N_ATTR_PREFIX)).forEach(attr => explicitAttrNameToValue[attr.name.slice(_I18N_ATTR_PREFIX.length)] = attr.value); 34085 el.attrs.forEach(attr => { 34086 if (attr.name in explicitAttrNameToValue) { 34087 this._addMessage([attr], explicitAttrNameToValue[attr.name]); 34088 } else if (implicitAttrNames.some(name => attr.name === name)) { 34089 this._addMessage([attr]); 34090 } 34091 }); 34092 } 34093 // add a translatable message 34094 _addMessage(ast, msgMeta) { 34095 if (ast.length == 0 || this._isEmptyAttributeValue(ast) || this._isPlaceholderOnlyAttributeValue(ast) || this._isPlaceholderOnlyMessage(ast)) { 34096 // Do not create empty messages 34097 return null; 34098 } 34099 const { 34100 meaning, 34101 description, 34102 id 34103 } = _parseMessageMeta(msgMeta); 34104 const message = this._createI18nMessage(ast, meaning, description, id); 34105 this._messages.push(message); 34106 return message; 34107 } 34108 // Check for cases like `<div i18n-title title="">`. 34109 _isEmptyAttributeValue(ast) { 34110 if (!isAttrNode(ast)) return false; 34111 const node = ast[0]; 34112 return node.value.trim() === ''; 34113 } 34114 // Check for cases like `<div i18n-title title="{{ name }}">`. 34115 _isPlaceholderOnlyAttributeValue(ast) { 34116 var _ast$0$valueTokens; 34117 if (!isAttrNode(ast)) return false; 34118 const tokens = (_ast$0$valueTokens = ast[0].valueTokens) !== null && _ast$0$valueTokens !== void 0 ? _ast$0$valueTokens : []; 34119 const interpolations = tokens.filter(token => token.type === 17 /* TokenType.ATTR_VALUE_INTERPOLATION */); 34120 const plainText = tokens.filter(token => token.type === 16 /* TokenType.ATTR_VALUE_TEXT */) 34121 // `AttributeValueTextToken` always has exactly one part per its type. 34122 .map(token => token.parts[0].trim()).join(''); 34123 // Check if there is a single interpolation and all text around it is empty. 34124 return interpolations.length === 1 && plainText === ''; 34125 } 34126 // Check for cases like `<div i18n>{{ name }}</div>`. 34127 _isPlaceholderOnlyMessage(ast) { 34128 if (!isTextNode(ast)) return false; 34129 const tokens = ast[0].tokens; 34130 const interpolations = tokens.filter(token => token.type === 8 /* TokenType.INTERPOLATION */); 34131 const plainText = tokens.filter(token => token.type === 5 /* TokenType.TEXT */) 34132 // `TextToken` always has exactly one part per its type. 34133 .map(token => token.parts[0].trim()).join(''); 34134 // Check if there is a single interpolation and all text around it is empty. 34135 return interpolations.length === 1 && plainText === ''; 34136 } 34137 // Translates the given message given the `TranslationBundle` 34138 // This is used for translating elements / blocks - see `_translateAttributes` for attributes
34139 // no-op when called in extraction mode (returns []) 34140 _translateMessage(el, message) { 34141 if (message && this._mode === _VisitorMode.Merge) { 34142 const nodes = this._translations.get(message); 34143 if (nodes) { 34144 return nodes; 34145 } 34146 this._reportError(el, `Translation unavailable for message id="${this._translations.digest(message)}"`); 34147 } 34148 return []; 34149 } 34150 // translate the attributes of an element and remove i18n specific attributes 34151 _translateAttributes(el) { 34152 const attributes = el.attrs; 34153 const i18nParsedMessageMeta = {}; 34154 attributes.forEach(attr => { 34155 if (attr.name.startsWith(_I18N_ATTR_PREFIX)) { 34156 i18nParsedMessageMeta[attr.name.slice(_I18N_ATTR_PREFIX.length)] = _parseMessageMeta(attr.value); 34157 } 34158 }); 34159 const translatedAttributes = []; 34160 attributes.forEach(attr => { 34161 if (attr.name === _I18N_ATTR || attr.name.startsWith(_I18N_ATTR_PREFIX)) { 34162 // strip i18n specific attributes 34163 return; 34164 } 34165 if (attr.value && attr.value != '' && i18nParsedMessageMeta.hasOwnProperty(attr.name)) { 34166 const { 34167 meaning, 34168 description, 34169 id 34170 } = i18nParsedMessageMeta[attr.name]; 34171 const message = this._createI18nMessage([attr], meaning, description, id); 34172 const nodes = this._translations.get(message); 34173 if (nodes) { 34174 if (nodes.length == 0) { 34175 translatedAttributes.push(new Attribute(attr.name, '', attr.sourceSpan, undefined /* keySpan */, undefined /* valueSpan */, undefined /* valueTokens */, undefined /* i18n */)); 34176 } else if (nodes[0] instanceof Text) { 34177 const value = nodes[0].value; 34178 translatedAttributes.push(new Attribute(attr.name, value, attr.sourceSpan, undefined /* keySpan */, undefined /* valueSpan */, undefined /* valueTokens */, undefined /* i18n */)); 34179 } else { 34180 this._reportError(el, `Unexpected translation for attribute "${attr.name}" (id="${id || this._translations.digest(message)}")`); 34181 } 34182 } else { 34183 this._reportError(el, `Translation unavailable for attribute "${attr.name}" (id="${id || this._translations.digest(message)}")`); 34184 } 34185 } else { 34186 translatedAttributes.push(attr); 34187 } 34188 }); 34189 return translatedAttributes; 34190 } 34191 /** 34192 * Add the node as a child of the block when: 34193 * - we are in a block, 34194 * - we are not inside a ICU message (those are handled separately), 34195 * - the node is a "direct child" of the block 34196 */ 34197 _mayBeAddBlockChildren(node) { 34198 if (this._inI18nBlock && !this._inIcu && this._depth == this._blockStartDepth) { 34199 this._blockChildren.push(node); 34200 } 34201 } 34202 /** 34203 * Marks the start of a section, see `_closeTranslatableSection` 34204 */ 34205 _openTranslatableSection(node) { 34206 if (this._isInTranslatableSection) { 34207 this._reportError(node, 'Unexpected section start'); 34208 } else { 34209 this._msgCountAtSectionStart = this._messages.length; 34210 } 34211 } 34212 /** 34213 * A translatable section could be: 34214 * - the content of translatable element, 34215 * - nodes between `<!-- i18n -->` and `<!-- /i18n -->` comments 34216 */ 34217 get _isInTranslatableSection() { 34218 return this._msgCountAtSectionStart !== void 0; 34219 } 34220 /** 34221 * Terminates a section. 34222 * 34223 * If a section has only one significant children (comments not significant) then we should not 34224 * keep the message from this children: 34225 * 34226 * `<p i18n="meaning|description">{ICU message}</p>` would produce two messages: 34227 * - one for the <p> content with meaning and description, 34228 * - another one for the ICU message. 34229 * 34230 * In this case the last message is discarded as it contains less information (the AST is 34231 * otherwise identical). 34232 * 34233 * Note that we should still keep messages extracted from attributes inside the section (ie in the 34234 * ICU message here) 34235 */ 34236 _closeTranslatableSection(node, directChildren) { 34237 if (!this._isInTranslatableSection) { 34238 this._reportError(node, 'Unexpected section end'); 34239 return; 34240 } 34241 const startIndex = this._msgCountAtSectionStart; 34242 const significantChildren = directChildren.reduce((count, node) => count + (node instanceof Comment ? 0 : 1), 0); 34243 if (significantChildren == 1) { 34244 for (let i = this._messages.length - 1; i >= startIndex; i--) { 34245 const ast = this._messages[i].nodes; 34246 if (!(ast.length == 1 && ast[0] instanceof Text$2)) { 34247 this._messages.splice(i, 1); 34248 break; 34249 } 34250 } 34251 } 34252 this._msgCountAtSectionStart = undefined; 34253 } 34254 _reportError(node, msg) { 34255 this._errors.push(new I18nError(node.sourceSpan, msg)); 34256 } 34257} 34258function _isOpeningComment(n) { 34259 return !!(n instanceof Comment && n.value && n.value.startsWith('i18n')); 34260} 34261function _isClosingComment(n) { 34262 return !!(n instanceof Comment && n.value && n.value === '/i18n'); 34263} 34264function _getI18nAttr(p) { 34265 return p.attrs.find(attr => attr.name === _I18N_ATTR) || null; 34266} 34267function _parseMessageMeta(i18n) { 34268 if (!i18n) return { 34269 meaning: '', 34270 description: '', 34271 id: '' 34272 }; 34273 const idIndex = i18n.indexOf(ID_SEPARATOR); 34274 const descIndex = i18n.indexOf(MEANING_SEPARATOR); 34275 const [meaningAndDesc, id] = idIndex > -1 ? [i18n.slice(0, idIndex), i18n.slice(idIndex + 2)] : [i18n, '']; 34276 const [meaning, description] = descIndex > -1 ? [meaningAndDesc.slice(0, descIndex), meaningAndDesc.slice(descIndex + 1)] : ['', meaningAndDesc]; 34277 return { 34278 meaning, 34279 description, 34280 id: id.trim() 34281 }; 34282} 34283function isTextNode(ast) { 34284 return ast.length === 1 && ast[0] instanceof Text; 34285}
34286function isAttrNode(ast) { 34287 return ast.length === 1 && ast[0] instanceof Attribute; 34288} 34289class XmlTagDefinition { 34290 constructor() { 34291 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "closedByParent", false); 34292 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "implicitNamespacePrefix", null); 34293 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "isVoid", false); 34294 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "ignoreFirstLf", false); 34295 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "canSelfClose", true); 34296 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "preventNamespaceInheritance", false); 34297 } 34298 requireExtraParent(currentParent) { 34299 return false; 34300 } 34301 isClosedByChild(name) { 34302 return false; 34303 } 34304 getContentType() { 34305 return TagContentType.PARSABLE_DATA; 34306 } 34307} 34308const _TAG_DEFINITION = new XmlTagDefinition(); 34309function getXmlTagDefinition(tagName) { 34310 return _TAG_DEFINITION; 34311} 34312class XmlParser extends Parser$1 { 34313 constructor() { 34314 super(getXmlTagDefinition); 34315 } 34316 parse(source, url, options = {}) { 34317 // Blocks and let declarations aren't supported in an XML context. 34318 return super.parse(source, url, (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({}, options), {}, { 34319 tokenizeBlocks: false, 34320 tokenizeLet: false 34321 })); 34322 } 34323} 34324const _VERSION$1 = '1.2'; 34325const _XMLNS$1 = 'urn:oasis:names:tc:xliff:document:1.2'; 34326// TODO(vicb): make this a param (s/_/-/) 34327const _DEFAULT_SOURCE_LANG$1 = 'en'; 34328const _PLACEHOLDER_TAG$2 = 'x'; 34329const _MARKER_TAG$1 = 'mrk'; 34330const _FILE_TAG = 'file'; 34331const _SOURCE_TAG$1 = 'source'; 34332const _SEGMENT_SOURCE_TAG = 'seg-source'; 34333const _ALT_TRANS_TAG = 'alt-trans'; 34334const _TARGET_TAG$1 = 'target'; 34335const _UNIT_TAG$1 = 'trans-unit'; 34336const _CONTEXT_GROUP_TAG = 'context-group'; 34337const _CONTEXT_TAG = 'context'; 34338// https://docs.oasis-open.org/xliff/v1.2/os/xliff-core.html 34339// https://docs.oasis-open.org/xliff/v1.2/xliff-profile-html/xliff-profile-html-1.2.html 34340class Xliff extends Serializer { 34341 write(messages, locale) { 34342 const visitor = new _WriteVisitor$1(); 34343 const transUnits = []; 34344 messages.forEach(message => { 34345 let contextTags = []; 34346 message.sources.forEach(source => { 34347 let contextGroupTag = new Tag(_CONTEXT_GROUP_TAG, { 34348 purpose: 'location' 34349 }); 34350 contextGroupTag.children.push(new CR(10), new Tag(_CONTEXT_TAG, { 34351 'context-type': 'sourcefile' 34352 }, [new Text$1(source.filePath)]), new CR(10), new Tag(_CONTEXT_TAG, { 34353 'context-type': 'linenumber' 34354 }, [new Text$1(`${source.startLine}`)]), new CR(8)); 34355 contextTags.push(new CR(8), contextGroupTag); 34356 }); 34357 const transUnit = new Tag(_UNIT_TAG$1, { 34358 id: message.id, 34359 datatype: 'html' 34360 }); 34361 transUnit.children.push(new CR(8), new Tag(_SOURCE_TAG$1, {}, visitor.serialize(message.nodes)), ...contextTags); 34362 if (message.description) { 34363 transUnit.children.push(new CR(8), new Tag('note', { 34364 priority: '1', 34365 from: 'description' 34366 }, [new Text$1(message.description)])); 34367 } 34368 if (message.meaning) { 34369 transUnit.children.push(new CR(8), new Tag('note', { 34370 priority: '1', 34371 from: 'meaning' 34372 }
34372, [new Text$1(message.meaning)])); 34373 } 34374 transUnit.children.push(new CR(6)); 34375 transUnits.push(new CR(6), transUnit); 34376 }); 34377 const body = new Tag('body', {}, [...transUnits, new CR(4)]); 34378 const file = new Tag('file', { 34379 'source-language': locale || _DEFAULT_SOURCE_LANG$1, 34380 datatype: 'plaintext', 34381 original: 'ng2.template' 34382 }, [new CR(4), body, new CR(2)]); 34383 const xliff = new Tag('xliff', { 34384 version: _VERSION$1, 34385 xmlns: _XMLNS$1 34386 }, [new CR(2), file, new CR()]); 34387 return serialize$1([new Declaration({ 34388 version: '1.0', 34389 encoding: 'UTF-8' 34390 }), new CR(), xliff, new CR()]); 34391 } 34392 load(content, url) { 34393 // xliff to xml nodes 34394 const xliffParser = new XliffParser(); 34395 const { 34396 locale, 34397 msgIdToHtml, 34398 errors 34399 } = xliffParser.parse(content, url); 34400 // xml nodes to i18n nodes 34401 const i18nNodesByMsgId = {}; 34402 const converter = new XmlToI18n$2(); 34403 Object.keys(msgIdToHtml).forEach(msgId => { 34404 const { 34405 i18nNodes, 34406 errors: e 34407 } = converter.convert(msgIdToHtml[msgId], url); 34408 errors.push(...e); 34409 i18nNodesByMsgId[msgId] = i18nNodes; 34410 }); 34411 if (errors.length) { 34412 throw new Error(`xliff parse errors:\n${errors.join('\n')}`); 34413 } 34414 return { 34415 locale: locale, 34416 i18nNodesByMsgId 34417 }; 34418 } 34419 digest(message) { 34420 return digest$1(message); 34421 } 34422} 34423let _WriteVisitor$1 = class _WriteVisitor { 34424 visitText(text, context) { 34425 return [new Text$1(text.value)]; 34426 } 34427 visitContainer(container, context) { 34428 const nodes = []; 34429 container.children.forEach(node => nodes.push(...node.visit(this))); 34430 return nodes; 34431 } 34432 visitIcu(icu, context) { 34433 const nodes = [new Text$1(`{${icu.expressionPlaceholder}, ${icu.type}, `)]; 34434 Object.keys(icu.cases).forEach(c => { 34435 nodes.push(new Text$1(`${c} {`), ...icu.cases[c].visit(this), new Text$1(`} `)); 34436 }); 34437 nodes.push(new Text$1(`}`)); 34438 return nodes; 34439 } 34440 visitTagPlaceholder(ph, context) { 34441 const ctype = getCtypeForTag(ph.tag); 34442 if (ph.isVoid) { 34443 // void tags have no children nor closing tags 34444 return [new Tag(_PLACEHOLDER_TAG$2, { 34445 id: ph.startName, 34446 ctype, 34447 'equiv-text': `<${ph.tag}/>` 34448 })]; 34449 } 34450 const startTagPh = new Tag(_PLACEHOLDER_TAG$2, { 34451 id: ph.startName, 34452 ctype, 34453 'equiv-text': `<${ph.tag}>` 34454 }); 34455 const closeTagPh = new Tag(_PLACEHOLDER_TAG$2, { 34456 id: ph.closeName, 34457 ctype, 34458 'equiv-text': `</${ph.tag}>` 34459 }); 34460 return [startTagPh, ...this.serialize(ph.children), closeTagPh]; 34461 } 34462 visitPlaceholder(ph, context) { 34463 return [new Tag(_PLACEHOLDER_TAG$2, { 34464 id: ph.name, 34465 'equiv-text': `{{${ph.value}}}` 34466 })]; 34467 } 34468 visitBlockPlaceholder(ph, context) { 34469 const ctype = `x-${ph.name.toLowerCase().replace(/[^a-z0-9]/g, '-')}`; 34470 const startTagPh = new Tag(_PLACEHOLDER_TAG$2, { 34471 id: ph.startName, 34472 ctype, 34473 'equiv-text': `@${ph.name}` 34474 }); 34475 const closeTagPh = new Tag(_PLACEHOLDER_TAG$2, { 34476 id: ph.closeName, 34477 ctype, 34478 'equiv-text': `}` 34479 }); 34480 return [startTagPh, ...this.serialize(ph.children), closeTagPh]; 34481 } 34482 visitIcuPlaceholder(ph, context) { 34483 const equivText = `{${ph.value.expression}, ${ph.value.type}, ${Object.keys(ph.value.cases).map(value => value + ' {...}').join(' ')}}`; 34484 return [new Tag(_PLACEHOLDER_TAG$2, { 34485 id: ph.name, 34486 'equiv-text': equivText 34487 })]; 34488 } 34489 serialize(nodes) { 34490 return [].concat(...nodes.map(node => node.visit(this))); 34491 } 34492}; 34493// TODO(vicb): add error management (structure) 34494// Extract messages as xml nodes from the xliff file 34495class XliffParser { 34496 constructor() { 34497 // using non-null assertions because they're re(set) by parse() 34498 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_unitMlString", void 0); 34499 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_errors", void 0); 34500 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_msgIdToHtml", void 0); 34501 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_locale", null); 34502 } 34503 parse(xliff, url) { 34504 this._unitMlString = null; 34505 this._msgIdToHtml = {}; 34506 const xml = new XmlParser().parse(xliff, url); 34507 this._errors = xml.errors; 34508 visitAll(this, xml.rootNodes, null); 34509 return { 34510 msgIdToHtml: this._msgIdToHtml, 34511 errors: this._errors, 34512 locale: this._locale 34513 }; 34514 } 34515 visitElement(element, context) { 34516 switch (element.name) { 34517 case _UNIT_TAG$1: 34518 this._unitMlString = null; 34519 const idAttr = element.attrs.find(attr => attr.name === 'id'); 34520 if (!idAttr) { 34521 this._addError(element, `<${_UNIT_TAG$1}> misses the "id" attribute`); 34522 } else { 34523 const id = idAttr.value; 34524 if (this._msgIdToHtml.hasOwnProperty(id)) { 34525 this._addError(element, `Duplicated translations for msg ${id}`); 34526 } else { 34527 visitAll(this, element.children, null); 34528 if (typeof this._unitMlString === 'string') { 34529 this._msgIdToHtml[id] = this._unitMlString; 34530 } else { 34531 this._addError(element, `Message ${id} misses a translation`); 34532 } 34533 } 34534 } 34535 break; 34536 // ignore those tags 34537 case _SOURCE_TAG$1: 34538 case _SEGMENT_SOURCE_TAG: 34539 case _ALT_TRANS_TAG: 34540 break; 34541 case _TARGET_TAG$1: 34542 const innerTextStart = element.startSourceSpan.end.offset; 34543 const innerTextEnd = element.endSourceSpan.start.offset; 34544 const content = element.startSourceSpan.start.file.content; 34545 const innerText = content.slice(innerTextStart, innerTextEnd); 34546 this._unitMlString = innerText; 34547 break; 34548 case _FILE_TAG: 34549 const localeAttr = element.attrs.find(attr => attr.name === 'target-language'); 34550 if (localeAttr) { 34551 this._locale = localeAttr.value; 34552 } 34553 visitAll(this, element.children, null); 34554 break; 34555 default: 34556 // TODO(vicb): assert file structure, xliff version 34557 // For now only recurse on unhandled nodes 34558 visitAll(this, element.children, null); 34559 } 34560 } 34561 visitAttribute(attribute, context) {} 34562 visitText(text, context) {} 34563 visitComment(comment, context) {} 34564 visitExpansion(expansion, context) {} 34565 visitExpansionCase(expansionCase, context) {} 34566 visitBlock(block, context) {} 34567 visitBlockParameter(parameter, context) {} 34568 visitLetDeclaration(decl, context) {} 34569 _addError(node, message) { 34570 this._errors.push(new I18nError(node.sourceSpan, message)); 34571 } 34572} 34573// Convert ml nodes (xliff syntax) to i18n nodes 34574let XmlToI18n$2 = class XmlToI18n { 34575 constructor() { 34576 // using non-null assertion because it's re(set) by convert() 34577 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_errors", void 0); 34578 } 34579 convert(message, url) { 34580 const xmlIcu = new XmlParser().parse(message, url, { 34581 tokenizeExpansionForms: true 34582 }); 34583 this._errors = xmlIcu.errors; 34584 const i18nNodes = this._errors.length > 0 || xmlIcu.rootNodes.length == 0 ? [] : [].concat(...visitAll(this, xmlIcu.rootNodes)); 34585 return { 34586 i18nNodes: i18nNodes, 34587 errors: this._errors 34588 }; 34589 } 34590 visitText(text, context) { 34591 return new Text$2(text.value, text.sourceSpan); 34592 } 34593 visitElement(el, context) { 34594 if (el.name === _PLACEHOLDER_TAG$2) { 34595 const nameAttr = el.attrs.find(attr => attr.name === 'id'); 34596 if (nameAttr) { 34597 return new Placeholder('', nameAttr.value, el.sourceSpan); 34598 } 34599 this._addError(el, `<${_PLACEHOLDER_TAG$2}> misses the "id" attribute`); 34600 return null; 34601 } 34602 if (el.name === _MARKER_TAG$1) { 34603 return [].concat(...visitAll(this, el.children)); 34604 } 34605 this._addError(el, `Unexpected tag`); 34606 return null; 34607 } 34608 visitExpansion(icu, context) { 34609 const caseMap = {};
34610 visitAll(this, icu.cases).forEach(c => { 34611 caseMap[c.value] = new Container(c.nodes, icu.sourceSpan); 34612 }); 34613 return new Icu(icu.switchValue, icu.type, caseMap, icu.sourceSpan); 34614 } 34615 visitExpansionCase(icuCase, context) { 34616 return { 34617 value: icuCase.value, 34618 nodes: visitAll(this, icuCase.expression) 34619 }; 34620 } 34621 visitComment(comment, context) {} 34622 visitAttribute(attribute, context) {} 34623 visitBlock(block, context) {} 34624 visitBlockParameter(parameter, context) {} 34625 visitLetDeclaration(decl, context) {} 34626 _addError(node, message) { 34627 this._errors.push(new I18nError(node.sourceSpan, message)); 34628 } 34629}; 34630function getCtypeForTag(tag) { 34631 switch (tag.toLowerCase()) { 34632 case 'br': 34633 return 'lb'; 34634 case 'img': 34635 return 'image'; 34636 default: 34637 return `x-${tag}`; 34638 } 34639} 34640const _VERSION = '2.0'; 34641const _XMLNS = 'urn:oasis:names:tc:xliff:document:2.0'; 34642// TODO(vicb): make this a param (s/_/-/) 34643const _DEFAULT_SOURCE_LANG = 'en'; 34644const _PLACEHOLDER_TAG$1 = 'ph'; 34645const _PLACEHOLDER_SPANNING_TAG = 'pc'; 34646const _MARKER_TAG = 'mrk'; 34647const _XLIFF_TAG = 'xliff'; 34648const _SOURCE_TAG = 'source'; 34649const _TARGET_TAG = 'target'; 34650const _UNIT_TAG = 'unit'; 34651// https://docs.oasis-open.org/xliff/xliff-core/v2.0/os/xliff-core-v2.0-os.html 34652class Xliff2 extends Serializer { 34653 write(messages, locale) { 34654 const visitor = new _WriteVisitor(); 34655 const units = []; 34656 messages.forEach(message => { 34657 const unit = new Tag(_UNIT_TAG, { 34658 id: message.id 34659 }); 34660 const notes = new Tag('notes'); 34661 if (message.description || message.meaning) { 34662 if (message.description) { 34663 notes.children.push(new CR(8), new Tag('note', { 34664 category: 'description' 34665 }, [new Text$1(message.description)])); 34666 } 34667 if (message.meaning) { 34668 notes.children.push(new CR(8), new Tag('note', { 34669 category: 'meaning' 34670 }, [new Text$1(message.meaning)])); 34671 } 34672 } 34673 message.sources.forEach(source => { 34674 notes.children.push(new CR(8), new Tag('note', { 34675 category: 'location' 34676 }, [new Text$1(`${source.filePath}:${source.startLine}${source.endLine !== source.startLine ? ',' + source.endLine : ''}`)])); 34677 }); 34678 notes.children.push(new CR(6)); 34679 unit.children.push(new CR(6), notes); 34680 const segment = new Tag('segment'); 34681 segment.children.push(new CR(8), new Tag(_SOURCE_TAG, {}, visitor.serialize(message.nodes)), new CR(6)); 34682 unit.children.push(new CR(6), segment, new CR(4)); 34683 units.push(new CR(4), unit); 34684 }); 34685 const file = new Tag('file', { 34686 'original': 'ng.template', 34687 id: 'ngi18n' 34688 }, [...units, new CR(2)]); 34689 const xliff = new Tag(_XLIFF_TAG, { 34690 version: _VERSION, 34691 xmlns: _XMLNS, 34692 srcLang: locale || _DEFAULT_SOURCE_LANG 34693 }, [new CR(2), file, new CR()]); 34694 return serialize$1([new Declaration({ 34695 version: '1.0', 34696 encoding: 'UTF-8' 34697 }), new CR(), xliff, new CR()]); 34698 } 34699 load(content, url) { 34700 // xliff to xml nodes 34701 const xliff2Parser = new Xliff2Parser(); 34702 const { 34703 locale, 34704 msgIdToHtml, 34705 errors 34706 } = xliff2Parser.parse(content, url); 34707 // xml nodes to i18n nodes 34708 const i18nNodesByMsgId = {}; 34709 const converter = new XmlToI18n$1(); 34710 Object.keys(msgIdToHtml).forEach(msgId => { 34711 const { 34712 i18nNodes, 34713 errors: e 34714 } = converter.convert(msgIdToHtml[msgId], url); 34715 errors.push(...e); 34716 i18nNodesByMsgId[msgId] = i18nNodes; 34717 }); 34718 if (errors.length) { 34719 throw new Error(`xliff2 parse errors:\n${errors.join('\n')}`); 34720 } 34721 return { 34722 locale: locale, 34723 i18nNodesByMsgId 34724 }; 34725 } 34726 digest(message) { 34727 return decimalDigest(message); 34728 } 34729} 34730class _WriteVisitor { 34731 constructor() { 34732 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_nextPlaceholderId", 0); 34733 } 34734 visitText(text, context) { 34735 return [new Text$1(text.value)]; 34736 } 34737 visitContainer(container, context) { 34738 const nodes = [];
34739 container.children.forEach(node => nodes.push(...node.visit(this))); 34740 return nodes; 34741 } 34742 visitIcu(icu, context) { 34743 const nodes = [new Text$1(`{${icu.expressionPlaceholder}, ${icu.type}, `)]; 34744 Object.keys(icu.cases).forEach(c => { 34745 nodes.push(new Text$1(`${c} {`), ...icu.cases[c].visit(this), new Text$1(`} `)); 34746 }); 34747 nodes.push(new Text$1(`}`)); 34748 return nodes; 34749 } 34750 visitTagPlaceholder(ph, context) { 34751 const type = getTypeForTag(ph.tag); 34752 if (ph.isVoid) { 34753 const tagPh = new Tag(_PLACEHOLDER_TAG$1, { 34754 id: (this._nextPlaceholderId++).toString(), 34755 equiv: ph.startName, 34756 type: type, 34757 disp: `<${ph.tag}/>` 34758 }); 34759 return [tagPh]; 34760 } 34761 const tagPc = new Tag(_PLACEHOLDER_SPANNING_TAG, { 34762 id: (this._nextPlaceholderId++).toString(), 34763 equivStart: ph.startName, 34764 equivEnd: ph.closeName, 34765 type: type, 34766 dispStart: `<${ph.tag}>`, 34767 dispEnd: `</${ph.tag}>` 34768 }); 34769 const nodes = [].concat(...ph.children.map(node => node.visit(this))); 34770 if (nodes.length) { 34771 nodes.forEach(node => tagPc.children.push(node)); 34772 } else { 34773 tagPc.children.push(new Text$1('')); 34774 } 34775 return [tagPc]; 34776 } 34777 visitPlaceholder(ph, context) { 34778 const idStr = (this._nextPlaceholderId++).toString(); 34779 return [new Tag(_PLACEHOLDER_TAG$1, { 34780 id: idStr, 34781 equiv: ph.name, 34782 disp: `{{${ph.value}}}` 34783 })]; 34784 } 34785 visitBlockPlaceholder(ph, context) { 34786 const tagPc = new Tag(_PLACEHOLDER_SPANNING_TAG, { 34787 id: (this._nextPlaceholderId++).toString(), 34788 equivStart: ph.startName, 34789 equivEnd: ph.closeName, 34790 type: 'other', 34791 dispStart: `@${ph.name}`, 34792 dispEnd: `}` 34793 }); 34794 const nodes = [].concat(...ph.children.map(node => node.visit(this))); 34795 if (nodes.length) { 34796 nodes.forEach(node => tagPc.children.push(node)); 34797 } else { 34798 tagPc.children.push(new Text$1('')); 34799 } 34800 return [tagPc]; 34801 } 34802 visitIcuPlaceholder(ph, context) { 34803 const cases = Object.keys(ph.value.cases).map(value => value + ' {...}').join(' '); 34804 const idStr = (this._nextPlaceholderId++).toString(); 34805 return [new Tag(_PLACEHOLDER_TAG$1, { 34806 id: idStr, 34807 equiv: ph.name, 34808 disp: `{${ph.value.expression}, ${ph.value.type}, ${cases}}` 34809 })]; 34810 } 34811 serialize(nodes) { 34812 this._nextPlaceholderId = 0; 34813 return [].concat(...nodes.map(node => node.visit(this))); 34814 } 34815} 34816// Extract messages as xml nodes from the xliff file 34817class Xliff2Parser { 34818 constructor() { 34819 // using non-null assertions because they're all (re)set by parse() 34820 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_unitMlString", void 0); 34821 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_errors", void 0); 34822 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_msgIdToHtml", void 0); 34823 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_locale", null); 34824 } 34825 parse(xliff, url) { 34826 this._unitMlString = null; 34827 this._msgIdToHtml = {}; 34828 const xml = new XmlParser().parse(xliff, url); 34829 this._errors = xml.errors; 34830 visitAll(this, xml.rootNodes, null); 34831 return { 34832 msgIdToHtml: this._msgIdToHtml, 34833 errors: this._errors, 34834 locale: this._locale 34835 }; 34836 } 34837 visitElement(element, context) { 34838 switch (element.name) { 34839 case _UNIT_TAG: 34840 this._unitMlString = null; 34841 const idAttr = element.attrs.find(attr => attr.name === 'id'); 34842 if (!idAttr) { 34843 this._addError(element, `<${_UNIT_TAG}> misses the "id" attribute`); 34844 } else { 34845 const id = idAttr.value; 34846 if (this._msgIdToHtml.hasOwnProperty(id)) { 34847 this._addError(element, `Duplicated translations for msg ${id}`); 34848 } else { 34849 visitAll(this, element.children, null); 34850 if (typeof this._unitMlString === 'string') { 34851 this._msgIdToHtml[id] = this._unitMlString; 34852 } else { 34853 this._addError(element, `Message ${id} misses a translation`); 34854 } 34855 } 34856 } 34857 break; 34858 case _SOURCE_TAG: 34859 // ignore source message 34860 break; 34861 case _TARGET_TAG: 34862 const innerTextStart = element.startSourceSpan.end.offset; 34863 const innerTextEnd = element.endSourceSpan.start.offset; 34864 const content = element.startSourceSpan.start.file.content; 34865 const innerText = content.slice(innerTextStart, innerTextEnd); 34866 this._unitMlString = innerText; 34867 break; 34868 case _XLIFF_TAG: 34869 const localeAttr = element.attrs.find(attr => attr.name === 'trgLang'); 34870 if (localeAttr) { 34871 this._locale = localeAttr.value; 34872 } 34873 const versionAttr = element.attrs.find(attr => attr.name === 'version'); 34874 if (versionAttr) { 34875 const version = versionAttr.value; 34876 if (version !== '2.0') { 34877 this._addError(element, `The XLIFF file version ${version} is not compatible with XLIFF 2.0 serializer`); 34878 } else { 34879 visitAll(this, element.children, null); 34880 } 34881 } 34882 break; 34883 default: 34884 visitAll(this, element.children, null); 34885 } 34886 } 34887 visitAttribute(attribute, context) {} 34888 visitText(text, context) {} 34889 visitComment(comment, context) {} 34890 visitExpansion(expansion, context) {} 34891 visitExpansionCase(expansionCase, context) {} 34892 visitBlock(block, context) {} 34893 visitBlockParameter(parameter, context) {} 34894 visitLetDeclaration(decl, context) {} 34895 _addError(node, message) { 34896 this._errors.push(new I18nError(node.sourceSpan, message)); 34897 } 34898} 34899// Convert ml nodes (xliff syntax) to i18n nodes 34900let XmlToI18n$1 = class XmlToI18n { 34901 constructor() { 34902 // using non-null assertion because re(set) by convert() 34903 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_errors", void 0); 34904 } 34905 convert(message, url) { 34906 const xmlIcu = new XmlParser().parse(message, url, { 34907 tokenizeExpansionForms: true 34908 }); 34909 this._errors = xmlIcu.errors; 34910 const i18nNodes = this._errors.length > 0 || xmlIcu.rootNodes.length == 0 ? [] : [].concat(...visitAll(this, xmlIcu.rootNodes)); 34911 return { 34912 i18nNodes, 34913 errors: this._errors 34914 }; 34915 } 34916 visitText(text, context) { 34917 return new Text$2(text.value, text.sourceSpan); 34918 } 34919 visitElement(el, context) { 34920 switch (el.name) { 34921 case _PLACEHOLDER_TAG$1: 34922 const nameAttr = el.attrs.find(attr => attr.name === 'equiv'); 34923 if (nameAttr) { 34924 return [new Placeholder('', nameAttr.value, el.sourceSpan)]; 34925 } 34926 this._addError(el, `<${_PLACEHOLDER_TAG$1}> misses the "equiv" attribute`); 34927 break; 34928 case _PLACEHOLDER_SPANNING_TAG: 34929 const startAttr = el.attrs.find(attr => attr.name === 'equivStart'); 34930 const endAttr = el.attrs.find(attr => attr.name === 'equivEnd'); 34931 if (!startAttr) { 34932 this._addError(el, `<${_PLACEHOLDER_TAG$1}> misses the "equivStart" attribute`); 34933 } else if (!endAttr) { 34934 this._addError(el, `<${_PLACEHOLDER_TAG$1}> misses the "equivEnd" attribute`); 34935 } else { 34936 const startId = startAttr.value; 34937 const endId = endAttr.value; 34938 const nodes = []; 34939 return nodes.concat(new Placeholder('', startId, el.sourceSpan), ...el.children.map(node =>
34939 node.visit(this, null)), new Placeholder('', endId, el.sourceSpan)); 34940 } 34941 break; 34942 case _MARKER_TAG: 34943 return [].concat(...visitAll(this, el.children)); 34944 default: 34945 this._addError(el, `Unexpected tag`); 34946 } 34947 return null; 34948 } 34949 visitExpansion(icu, context) { 34950 const caseMap = {}; 34951 visitAll(this, icu.cases).forEach(c => { 34952 caseMap[c.value] = new Container(c.nodes, icu.sourceSpan); 34953 }); 34954 return new Icu(icu.switchValue, icu.type, caseMap, icu.sourceSpan); 34955 } 34956 visitExpansionCase(icuCase, context) { 34957 return { 34958 value: icuCase.value, 34959 nodes: [].concat(...visitAll(this, icuCase.expression)) 34960 }; 34961 } 34962 visitComment(comment, context) {} 34963 visitAttribute(attribute, context) {} 34964 visitBlock(block, context) {} 34965 visitBlockParameter(parameter, context) {} 34966 visitLetDeclaration(decl, context) {} 34967 _addError(node, message) { 34968 this._errors.push(new I18nError(node.sourceSpan, message)); 34969 } 34970}; 34971function getTypeForTag(tag) { 34972 switch (tag.toLowerCase()) { 34973 case 'br': 34974 case 'b': 34975 case 'i': 34976 case 'u': 34977 return 'fmt'; 34978 case 'img': 34979 return 'image'; 34980 case 'a': 34981 return 'link'; 34982 default: 34983 return 'other'; 34984 } 34985} 34986const _TRANSLATIONS_TAG = 'translationbundle'; 34987const _TRANSLATION_TAG = 'translation'; 34988const _PLACEHOLDER_TAG = 'ph'; 34989class Xtb extends Serializer { 34990 write(messages, locale) { 34991 throw new Error('Unsupported'); 34992 } 34993 load(content, url) { 34994 // xtb to xml nodes 34995 const xtbParser = new XtbParser(); 34996 const { 34997 locale, 34998 msgIdToHtml, 34999 errors 35000 } = xtbParser.parse(content, url); 35001 // xml nodes to i18n nodes 35002 const i18nNodesByMsgId = {}; 35003 const converter = new XmlToI18n(); 35004 // Because we should be able to load xtb files that rely on features not supported by angular, 35005 // we need to delay the conversion of html to i18n nodes so that non angular messages are not 35006 // converted 35007 Object.keys(msgIdToHtml).forEach(msgId => { 35008 const valueFn = function () { 35009 const { 35010 i18nNodes, 35011 errors 35012 } = converter.convert(msgIdToHtml[msgId], url); 35013 if (errors.length) { 35014 throw new Error(`xtb parse errors:\n${errors.join('\n')}`); 35015 } 35016 return i18nNodes; 35017 }; 35018 createLazyProperty(i18nNodesByMsgId, msgId, valueFn); 35019 }); 35020 if (errors.length) { 35021 throw new Error(`xtb parse errors:\n${errors.join('\n')}`); 35022 } 35023 return { 35024 locale: locale, 35025 i18nNodesByMsgId 35026 }; 35027 } 35028 digest(message) { 35029 return digest(message); 35030 } 35031 createNameMapper(message) { 35032 return new SimplePlaceholderMapper(message, toPublicName); 35033 } 35034} 35035function createLazyProperty(messages, id, valueFn) { 35036 Object.defineProperty(messages, id, { 35037 configurable: true, 35038 enumerable: true, 35039 get: function () { 35040 const value = valueFn(); 35041 Object.defineProperty(messages, id, { 35042 enumerable: true, 35043 value 35044 }); 35045 return value; 35046 }, 35047 set: _ => { 35048 throw new Error('Could not overwrite an XTB translation'); 35049 } 35050 }); 35051} 35052// Extract messages as xml nodes from the xtb file 35053class XtbParser { 35054 constructor() { 35055 // using non-null assertions because they're (re)set by parse() 35056 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_bundleDepth", void 0); 35057 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_errors", void 0); 35058 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_msgIdToHtml", void 0); 35059 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_locale", null); 35060 } 35061 parse(xtb, url) { 35062 this._bundleDepth = 0; 35063 this._msgIdToHtml = {}; 35064 // We can not parse the ICU messages at this point as some messages might not originate 35065 // from Angular that could not be lex'd. 35066 const xml = new XmlParser().parse(xtb, url); 35067 this._errors = xml.errors; 35068 visitAll(this, xml.rootNodes); 35069 return { 35070 msgIdToHtml: this._msgIdToHtml, 35071 errors: this._errors, 35072 locale: this._locale 35073 }; 35074 } 35075 visitElement(element, context) { 35076 switch (element.name) { 35077 case _TRANSLATIONS_TAG: 35078 this._bundleDepth++; 35079 if (this._bundleDepth > 1) { 35080 this._addError(element, `<${_TRANSLATIONS_TAG}> elements can not be nested`); 35081 } 35082 const langAttr = element.attrs.find(attr => attr.name === 'lang'); 35083 if (langAttr) { 35084 this._locale = langAttr.value; 35085 } 35086 visitAll(this, element.children, null); 35087 this._bundleDepth--; 35088 break; 35089 case _TRANSLATION_TAG: 35090 const idAttr = element.attrs.find(attr => attr.name === 'id'); 35091 if (!idAttr) { 35092 this._addError(element, `<${_TRANSLATION_TAG}> misses the "id" attribute`); 35093 } else { 35094 const id = idAttr.value; 35095 if (this._msgIdToHtml.hasOwnProperty(id)) { 35096 this._addError(element, `Duplicated translations for msg ${id}`); 35097 } else { 35098 const innerTextStart = element.startSourceSpan.end.offset; 35099 const innerTextEnd = element.endSourceSpan.start.offset; 35100 const content = element.startSourceSpan.start.file.content; 35101 const innerText = content.slice(innerTextStart, innerTextEnd); 35102 this._msgIdToHtml[id] = innerText; 35103 } 35104 } 35105 break; 35106 default: 35107 this._addError(element, 'Unexpected tag'); 35108 } 35109 } 35110 visitAttribute(attribute, context) {} 35111 visitText(text, context) {} 35112 visitComment(comment, context) {} 35113 visitExpansion(expansion, context) {} 35114 visitExpansionCase(expansionCase, context) {} 35115 visitBlock(block, context) {} 35116 visitBlockParameter(block, context) {} 35117 visitLetDeclaration(decl, context) {} 35118 _addError(node, message) { 35119 this._errors.push(new I18nError(node.sourceSpan, message)); 35120 } 35121} 35122// Convert ml nodes (xtb syntax) to i18n nodes 35123class XmlToI18n { 35124 constructor() { 35125 // using non-null assertion because it's (re)set by convert() 35126 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_errors", void 0); 35127 } 35128 convert(message, url) { 35129 const xmlIcu = new XmlParser().parse(message, url, { 35130 tokenizeExpansionForms: true 35131 }); 35132 this._errors = xmlIcu.errors; 35133 const i18nNodes = this._errors.length > 0 || xmlIcu.rootNodes.length == 0 ? [] : visitAll(this, xmlIcu.rootNodes); 35134 return { 35135 i18nNodes, 35136 errors: this._errors 35137 }; 35138 } 35139 visitText(text, context) { 35140 return new Text$2(text.value, text.sourceSpan); 35141 } 35142 visitExpansion(icu, context) { 35143 const caseMap = {};
35144 visitAll(this, icu.cases).forEach(c => { 35145 caseMap[c.value] = new Container(c.nodes, icu.sourceSpan); 35146 }); 35147 return new Icu(icu.switchValue, icu.type, caseMap, icu.sourceSpan); 35148 } 35149 visitExpansionCase(icuCase, context) { 35150 return { 35151 value: icuCase.value, 35152 nodes: visitAll(this, icuCase.expression) 35153 }; 35154 } 35155 visitElement(el, context) { 35156 if (el.name === _PLACEHOLDER_TAG) { 35157 const nameAttr = el.attrs.find(attr => attr.name === 'name'); 35158 if (nameAttr) { 35159 return new Placeholder('', nameAttr.value, el.sourceSpan); 35160 } 35161 this._addError(el, `<${_PLACEHOLDER_TAG}> misses the "name" attribute`); 35162 } else { 35163 this._addError(el, `Unexpected tag`); 35164 } 35165 return null; 35166 } 35167 visitComment(comment, context) {} 35168 visitAttribute(attribute, context) {} 35169 visitBlock(block, context) {} 35170 visitBlockParameter(block, context) {} 35171 visitLetDeclaration(decl, context) {} 35172 _addError(node, message) { 35173 this._errors.push(new I18nError(node.sourceSpan, message)); 35174 } 35175} 35176 35177/** 35178 * A container for translated messages 35179 */ 35180class TranslationBundle { 35181 constructor(_i18nNodesByMsgId = {}, locale, digest, mapperFactory, missingTranslationStrategy = MissingTranslationStrategy.Warning, console) { 35182 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_i18nNodesByMsgId", void 0); 35183 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "digest", void 0); 35184 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "mapperFactory", void 0); 35185 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_i18nToHtml", void 0); 35186 this._i18nNodesByMsgId = _i18nNodesByMsgId; 35187 this.digest = digest; 35188 this.mapperFactory = mapperFactory; 35189 this._i18nToHtml = new I18nToHtmlVisitor(_i18nNodesByMsgId, locale, digest, mapperFactory, missingTranslationStrategy, console); 35190 } 35191 // Creates a `TranslationBundle` by parsing the given `content` with the `serializer`. 35192 static load(content, url, serializer, missingTranslationStrategy, console) { 35193 const { 35194 locale, 35195 i18nNodesByMsgId 35196 } = serializer.load(content, url); 35197 const digestFn = m => serializer.digest(m); 35198 const mapperFactory = m => serializer.createNameMapper(m); 35199 return new TranslationBundle(i18nNodesByMsgId, locale, digestFn, mapperFactory, missingTranslationStrategy, console); 35200 } 35201 // Returns the translation as HTML nodes from the given source message. 35202 get(srcMsg) { 35203 const html = this._i18nToHtml.convert(srcMsg); 35204 if (html.errors.length) { 35205 throw new Error(html.errors.join('\n')); 35206 } 35207 return html.nodes; 35208 } 35209 has(srcMsg) { 35210 return this.digest(srcMsg) in this._i18nNodesByMsgId; 35211 } 35212} 35213class I18nToHtmlVisitor { 35214 constructor(_i18nNodesByMsgId = {}, _locale, _digest, _mapperFactory, _missingTranslationStrategy, _console) { 35215 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_i18nNodesByMsgId", void 0); 35216 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_locale", void 0); 35217 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_digest", void 0); 35218 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_mapperFactory", void 0); 35219 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_missingTranslationStrategy", void 0); 35220 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_console", void 0); 35221 // using non-null assertions because they're (re)set by convert() 35222 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_srcMsg", void 0); 35223 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_errors", []); 35224 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_contextStack", []); 35225 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_mapper", void 0); 35226 this._i18nNodesByMsgId = _i18nNodesByMsgId; 35227 this._locale = _locale; 35228 this._digest = _digest; 35229 this._mapperFactory = _mapperFactory; 35230 this._missingTranslationStrategy = _missingTranslationStrategy; 35231 this._console = _console; 35232 } 35233 convert(srcMsg) { 35234 this._contextStack.length = 0; 35235 this._errors.length = 0; 35236 // i18n to text 35237 const text = this._convertToText(srcMsg); 35238 // text to html 35239 const url = srcMsg.nodes[0].sourceSpan.start.file.url; 35240 const html = new HtmlParser().parse(text, url, { 35241 tokenizeExpansionForms: true 35242 }); 35243 return { 35244 nodes: html.rootNodes, 35245 errors: [...this._errors, ...html.errors] 35246 }; 35247 } 35248 visitText(text, context) { 35249 // `convert()` uses an `HtmlParser` to return `html.Node`s 35250 // we should then make sure that any special characters are escaped 35251 return escapeXml(text.value); 35252 } 35253 visitContainer(container, context) { 35254 return container.children.map(n => n.visit(this)).join(''); 35255 } 35256 visitIcu(icu, context) { 35257 const cases = Object.keys(icu.cases).map(k => `${k} {${icu.cases[k].visit(this)}}`); 35258 // TODO(vicb): Once all format switch to using expression placeholders 35259 // we should throw when the placeholder is not in the source message 35260 const exp = this._srcMsg.placeholders.hasOwnProperty(icu.expression) ? this._srcMsg.placeholders[icu.expression].text : icu.expression; 35261 return `{${exp}, ${icu.type}, ${cases.join(' ')}}`; 35262 } 35263 visitPlaceholder(ph, context) { 35264 const phName = this._mapper(ph.name); 35265 if (this._srcMsg.placeholders.hasOwnProperty(phName)) { 35266 return this._srcMsg.placeholders[phName].text; 35267 } 35268 if (this._srcMsg.placeholderToMessage.hasOwnProperty(phName)) { 35269 return this._convertToText(this._srcMsg.placeholderToMessage[phName]); 35270 } 35271 this._addError(ph, `Unknown placeholder "${ph.name}"`); 35272 return ''; 35273 } 35274 // Loaded message contains only placeholders (vs tag and icu placeholders). 35275 // However when a translation can not be found, we need to serialize the source message 35276 // which can contain tag placeholders 35277 visitTagPlaceholder(ph, context) { 35278 const tag = `${ph.tag}`; 35279 const attrs = Object.keys(ph.attrs).map(name => `${name}="${ph.attrs[name]}"`).join(' '); 35280 if (ph.isVoid) { 35281 return `<${tag} ${attrs}/>`; 35282 } 35283 const children = ph.children.map(c => c.visit(this)).join(''); 35284 return `<${tag} ${attrs}>${children}</${tag}>`; 35285 } 35286 // Loaded message contains only placeholders (vs tag and icu placeholders). 35287 // However when a translation can not be found, we need to serialize the source message 35288 // which can contain tag placeholders 35289 visitIcuPlaceholder(ph, context) { 35290 // An ICU placeholder references the source message to be serialized 35291 return this._convertToText(this._srcMsg.placeholderToMessage[ph.name]); 35292 } 35293 visitBlockPlaceholder(ph, context) { 35294 const params = ph.parameters.length === 0 ? '' : ` (${ph.parameters.join('; ')})`; 35295 const children = ph.children.map(c => c.visit(this)).join(''); 35296 return `@${ph.name}${params} {${children}}`; 35297 } 35298 /**
35299 * Convert a source message to a translated text string: 35300 * - text nodes are replaced with their translation, 35301 * - placeholders are replaced with their content, 35302 * - ICU nodes are converted to ICU expressions. 35303 */ 35304 _convertToText(srcMsg) { 35305 const id = this._digest(srcMsg); 35306 const mapper = this._mapperFactory ? this._mapperFactory(srcMsg) : null; 35307 let nodes; 35308 this._contextStack.push({ 35309 msg: this._srcMsg, 35310 mapper: this._mapper 35311 }); 35312 this._srcMsg = srcMsg; 35313 if (this._i18nNodesByMsgId.hasOwnProperty(id)) { 35314 // When there is a translation use its nodes as the source 35315 // And create a mapper to convert serialized placeholder names to internal names 35316 nodes = this._i18nNodesByMsgId[id]; 35317 this._mapper = name => mapper ? mapper.toInternalName(name) : name; 35318 } else { 35319 // When no translation has been found 35320 // - report an error / a warning / nothing, 35321 // - use the nodes from the original message 35322 // - placeholders are already internal and need no mapper 35323 if (this._missingTranslationStrategy === MissingTranslationStrategy.Error) { 35324 const ctx = this._locale ? ` for locale "${this._locale}"` : ''; 35325 this._addError(srcMsg.nodes[0], `Missing translation for message "${id}"${ctx}`); 35326 } else if (this._console && this._missingTranslationStrategy === MissingTranslationStrategy.Warning) { 35327 const ctx = this._locale ? ` for locale "${this._locale}"` : ''; 35328 this._console.warn(`Missing translation for message "${id}"${ctx}`); 35329 } 35330 nodes = srcMsg.nodes; 35331 this._mapper = name => name; 35332 } 35333 const text = nodes.map(node => node.visit(this)).join(''); 35334 const context = this._contextStack.pop(); 35335 this._srcMsg = context.msg; 35336 this._mapper = context.mapper; 35337 return text; 35338 } 35339 _addError(el, msg) { 35340 this._errors.push(new I18nError(el.sourceSpan, msg)); 35341 } 35342} 35343class I18NHtmlParser { 35344 constructor(_htmlParser, translations, translationsFormat, missingTranslation = MissingTranslationStrategy.Warning, console) { 35345 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_htmlParser", void 0); 35346 // @override 35347 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "getTagDefinition", void 0); 35348 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_translationBundle", void 0); 35349 this._htmlParser = _htmlParser; 35350 if (translations) { 35351 const serializer = createSerializer(translationsFormat); 35352 this._translationBundle = TranslationBundle.load(translations, 'i18n', serializer, missingTranslation, console); 35353 } else { 35354 this._translationBundle = new TranslationBundle({}, null, digest$1, undefined, missingTranslation, console); 35355 } 35356 } 35357 parse(source, url, options = {}) { 35358 const interpolationConfig = options.interpolationConfig || DEFAULT_INTERPOLATION_CONFIG; 35359 const parseResult = this._htmlParser.parse(source, url, (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({ 35360 interpolationConfig 35361 }, options)); 35362 if (parseResult.errors.length) { 35363 return new ParseTreeResult(parseResult.rootNodes, parseResult.errors); 35364 } 35365 return mergeTranslations(parseResult.rootNodes, this._translationBundle, interpolationConfig, [], {}); 35366 } 35367} 35368function createSerializer(format) { 35369 format = (format || 'xlf').toLowerCase(); 35370 switch (format) { 35371 case 'xmb': 35372 return new Xmb(); 35373 case 'xtb': 35374 return new Xtb(); 35375 case 'xliff2': 35376 case 'xlf2': 35377 return new Xliff2(); 35378 case 'xliff': 35379 case 'xlf': 35380 default: 35381 return new Xliff(); 35382 } 35383} 35384 35385/** 35386 * A container for message extracted from the templates. 35387 */ 35388class MessageBundle { 35389 constructor(_htmlParser, _implicitTags, _implicitAttrs, _locale = null, _preserveWhitespace = true) { 35390 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_htmlParser", void 0); 35391 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_impl
35391icitTags", void 0); 35392 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_implicitAttrs", void 0); 35393 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_locale", void 0); 35394 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_preserveWhitespace", void 0); 35395 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_messages", []); 35396 this._htmlParser = _htmlParser; 35397 this._implicitTags = _implicitTags; 35398 this._implicitAttrs = _implicitAttrs; 35399 this._locale = _locale; 35400 this._preserveWhitespace = _preserveWhitespace; 35401 } 35402 updateFromTemplate(source, url, interpolationConfig) { 35403 const htmlParserResult = this._htmlParser.parse(source, url, { 35404 tokenizeExpansionForms: true, 35405 interpolationConfig 35406 }); 35407 if (htmlParserResult.errors.length) { 35408 return htmlParserResult.errors; 35409 } 35410 // Trim unnecessary whitespace from extracted messages if requested. This 35411 // makes the messages more durable to trivial whitespace changes without 35412 // affected message IDs. 35413 const rootNodes = this._preserveWhitespace ? htmlParserResult.rootNodes : visitAllWithSiblings(new WhitespaceVisitor(/* preserveSignificantWhitespace */false), htmlParserResult.rootNodes); 35414 const i18nParserResult = extractMessages(rootNodes, interpolationConfig, this._implicitTags, this._implicitAttrs, /* preserveSignificantWhitespace */this._preserveWhitespace); 35415 if (i18nParserResult.errors.length) { 35416 return i18nParserResult.errors; 35417 } 35418 this._messages.push(...i18nParserResult.messages); 35419 return []; 35420 } 35421 // Return the message in the internal format 35422 // The public (serialized) format might be different, see the `write` method. 35423 getMessages() { 35424 return this._messages; 35425 }
35426 write(serializer, filterSources) { 35427 const messages = {}; 35428 const mapperVisitor = new MapPlaceholderNames(); 35429 // Deduplicate messages based on their ID 35430 this._messages.forEach(message => { 35431 const id = serializer.digest(message); 35432 if (!messages.hasOwnProperty(id)) { 35433 messages[id] = message; 35434 } else { 35435 messages[id].sources.push(...message.sources); 35436 } 35437 }); 35438 // Transform placeholder names using the serializer mapping 35439 const msgList = Object.keys(messages).map(id => { 35440 const mapper = serializer.createNameMapper(messages[id]); 35441 const src = messages[id]; 35442 const nodes = mapper ? mapperVisitor.convert(src.nodes, mapper) : src.nodes; 35443 let transformedMessage = new Message(nodes, {}, {}, src.meaning, src.description, id); 35444 transformedMessage.sources = src.sources; 35445 if (filterSources) { 35446 transformedMessage.sources.forEach(source => source.filePath = filterSources(source.filePath)); 35447 } 35448 return transformedMessage; 35449 }); 35450 return serializer.write(msgList, this._locale); 35451 } 35452} 35453// Transform an i18n AST by renaming the placeholder nodes with the given mapper 35454class MapPlaceholderNames extends CloneVisitor { 35455 convert(nodes, mapper) { 35456 return mapper ? nodes.map(n => n.visit(this, mapper)) : nodes; 35457 } 35458 visitTagPlaceholder(ph, mapper) { 35459 const startName = mapper.toPublicName(ph.startName); 35460 const closeName = ph.closeName ? mapper.toPublicName(ph.closeName) : ph.closeName; 35461 const children = ph.children.map(n => n.visit(this, mapper)); 35462 return new TagPlaceholder(ph.tag, ph.attrs, startName, closeName, children, ph.isVoid, ph.sourceSpan, ph.startSourceSpan, ph.endSourceSpan); 35463 } 35464 visitBlockPlaceholder(ph, mapper) { 35465 const startName = mapper.toPublicName(ph.startName); 35466 const closeName = ph.closeName ? mapper.toPublicName(ph.closeName) : ph.closeName; 35467 const children = ph.children.map(n => n.visit(this, mapper)); 35468 return new BlockPlaceholder(ph.name, ph.parameters, startName, closeName, children, ph.sourceSpan, ph.startSourceSpan, ph.endSourceSpan); 35469 } 35470 visitPlaceholder(ph, mapper) { 35471 return new Placeholder(ph.value, mapper.toPublicName(ph.name), ph.sourceSpan); 35472 } 35473 visitIcuPlaceholder(ph, mapper) { 35474 return new IcuPlaceholder(ph.value, mapper.toPublicName(ph.name), ph.sourceSpan); 35475 } 35476} 35477function compileClassMetadata(metadata) { 35478 const fnCall = internalCompileClassMetadata(metadata); 35479 return arrowFn([], [devOnlyGuardedExpression(fnCall).toStmt()]).callFn([]); 35480} 35481/** Compiles only the `setClassMetadata` call without any additional wrappers. */ 35482function internalCompileClassMetadata(metadata) { 35483 var _metadata$ctorParamet, _metadata$propDecorat; 35484 return importExpr(Identifiers.setClassMetadata).callFn([metadata.type, metadata.decorators, (_metadata$ctorParamet = metadata.ctorParameters) !== null && _metadata$ctorParamet !== void 0 ? _metadata$ctorParamet : literal(null), (_metadata$propDecorat = metadata.propDecorators) !== null && _metadata$propDecorat !== void 0 ? _metadata$propDecorat : literal(null)]); 35485} 35486/** 35487 * Wraps the `setClassMetadata` function with extra logic that dynamically 35488 * loads dependencies from `@defer` blocks. 35489 * 35490 * Generates a call like this: 35491 * ```ts 35492 * setClassMetadataAsync(type, () => [ 35493 * import('./cmp-a').then(m => m.CmpA); 35494 * import('./cmp-b').then(m => m.CmpB); 35495 * ], (CmpA, CmpB) => { 35496 * setClassMetadata(type, decorators, ctorParameters, propParameters); 35497 * }); 35498 * ``` 35499 * 35500 * Similar to the `setClassMetadata` call, it's wrapped into the `ngDevMode` 35501 * check to tree-shake away this code in production mode. 35502 */ 35503function compileComponentClassMetadata(metadata, dependencies) { 35504 if (dependencies === null || dependencies.length === 0) { 35505 // If there are no deferrable symbols - just generate a regular `setClassMetadata` call. 35506 return compileClassMetadata(metadata); 35507 } 35508 return internalCompileSetClassMetadataAsync(metadata, dependencies.map(dep => new FnParam(dep.symbolName, DYNAMIC_TYPE)), compileComponentMetadataAsyncResolver(dependencies)); 35509} 35510/** 35511 * Identical to `compileComponentClassMetadata`. Used for the cases where we're unable to 35512 * analyze the deferred block dependencies, but we have a reference to the compiled 35513 * dependency resolver function that we can use as is. 35514 * @param metadata Class metadata for the internal `setClassMetadata` call. 35515 * @param deferResolver Expression representing the deferred dependency loading function. 35516 * @param deferredDependencyNames Names of the dependencies that are being loaded asynchronously. 35517 */ 35518function compileOpaqueAsyncClassMetadata(metadata, deferResolver, deferredDependencyNames) { 35519 return internalCompileSetClassMetadataAsync(metadata, deferredDependencyNames.map(name => new FnParam(name, DYNAMIC_TYPE)), deferResolver); 35520} 35521/** 35522 * Internal logic used to compile a `setClassMetadataAsync` call. 35523 * @param metadata Class metadata for the internal `setClassMetadata` call. 35524 * @param wrapperParams Parameters to be set on the callback that wraps `setClassMetata`. 35525 * @param dependencyResolverFn Function to resolve the deferred dependencies. 35526 */ 35527function internalCompileSetClassMetadataAsync(metadata, wrapperParams, dependencyResolverFn) { 35528 // Omit the wrapper since it'll be added around `setClassMetadataAsync` instead. 35529 const setClassMetadataCall = internalCompileClassMetadata(metadata); 35530 const setClassMetaWrapper = arrowFn(wrapperParams, [setClassMetadataCall.toStmt()]); 35531 const setClassMetaAsync = importExpr(Identifiers.setClassMetadataAsync).callFn([metadata.type, dependencyResolverFn, setClassMetaWrapper]); 35532 return arrowFn([], [devOnlyGuardedExpression(setClassMetaAsync).toStmt()]).callFn([]); 35533} 35534/** 35535 * Compiles the function that loads the dependencies for the 35536 * entire component in `setClassMetadataAsync`. 35537 */ 35538function compileComponentMetadataAsyncResolver(dependencies) {
35539 const dynamicImports = dependencies.map(({ 35540 symbolName, 35541 importPath, 35542 isDefaultImport 35543 }) => { 35544 // e.g. `(m) => m.CmpA` 35545 const innerFn = 35546 // Default imports are always accessed through the `default` property. 35547 arrowFn([new FnParam('m', DYNAMIC_TYPE)], variable('m').prop(isDefaultImport ? 'default' : symbolName)); 35548 // e.g. `import('./cmp-a').then(...)` 35549 return new DynamicImportExpr(importPath).prop('then').callFn([innerFn]); 35550 }); 35551 // e.g. `() => [ ... ];` 35552 return arrowFn([], literalArr(dynamicImports)); 35553} 35554 35555/** 35556 * Generate an ngDevMode guarded call to setClassDebugInfo with the debug info about the class 35557 * (e.g., the file name in which the class is defined) 35558 */ 35559function compileClassDebugInfo(debugInfo) { 35560 const debugInfoObject = { 35561 className: debugInfo.className 35562 }; 35563 // Include file path and line number only if the file relative path is calculated successfully. 35564 if (debugInfo.filePath) { 35565 debugInfoObject.filePath = debugInfo.filePath; 35566 debugInfoObject.lineNumber = debugInfo.lineNumber; 35567 } 35568 // Include forbidOrphanRendering only if it's set to true (to reduce generated code) 35569 if (debugInfo.forbidOrphanRendering) { 35570 debugInfoObject.forbidOrphanRendering = literal(true); 35571 } 35572 const fnCall = importExpr(Identifiers.setClassDebugInfo).callFn([debugInfo.type, mapLiteral(debugInfoObject)]); 35573 const iife = arrowFn([], [devOnlyGuardedExpression(fnCall).toStmt()]); 35574 return iife.callFn([]); 35575} 35576 35577/*! 35578 * @license 35579 * Copyright Google LLC All Rights Reserved. 35580 * 35581 * Use of this source code is governed by an MIT-style license that can be 35582 * found in the LICENSE file at https://angular.dev/license 35583 */ 35584/** 35585 * Compiles the expression that initializes HMR for a class. 35586 * @param meta HMR metadata extracted from the class. 35587 */ 35588function compileHmrInitializer(meta) { 35589 const moduleName = 'm'; 35590 const dataName = 'd'; 35591 const timestampName = 't'; 35592 const idName = 'id'; 35593 const importCallbackName = `${meta.className}_HmrLoad`; 35594 const namespaces = meta.namespaceDependencies.map(dep => { 35595 return new ExternalExpr({ 35596 moduleName: dep.moduleName, 35597 name: null 35598 }); 35599 }); 35600 // m.default 35601 const defaultRead = variable(moduleName).prop('default'); 35602 // ɵɵreplaceMetadata(Comp, m.default, [...namespaces], [...locals], import.meta, id); 35603 const replaceCall = importExpr(Identifiers.replaceMetadata).callFn([meta.type, defaultRead, literalArr(namespaces), literalArr(meta.localDependencies.map(l => l.runtimeRepresentation)), variable('import').prop('meta'), variable(idName)]); 35604 // (m) => m.default && ɵɵreplaceMetadata(...) 35605 const replaceCallback = arrowFn([new FnParam(moduleName)], defaultRead.and(replaceCall)); 35606 // getReplaceMetadataURL(id, timestamp, import.meta.url) 35607 const url = importExpr(Identifiers.getReplaceMetadataURL).callFn([variable(idName), variable(timestampName), variable('import').prop('meta').prop('url')]); 35608 // function Cmp_HmrLoad(t) { 35609 // import(/* @vite-ignore */ url).then((m) => m.default && replaceMetadata(...)); 35610 // } 35611 const importCallback = new DeclareFunctionStmt(importCallbackName, [new FnParam(timestampName)], [ 35612 // The vite-ignore special comment is required to prevent Vite from generating a superfluous 35613 // warning for each usage within the development code. If Vite provides a method to 35614 // programmatically avoid this warning in the future, this added comment can be removed here. 35615 new DynamicImportExpr(url, null, '@vite-ignore').prop('then').callFn([replaceCallback]).toStmt()], null, StmtModifier.Final); 35616 // (d) => d.id === id && Cmp_HmrLoad(d.timestamp) 35617 const updateCallback = arrowFn([new FnParam(dataName)], variable(dataName).prop('id').identical(variable(idName)).and(variable(importCallbackName).callFn([variable(dataName).prop('timestamp')]))); 35618 // Cmp_HmrLoad(Date.now()); 35619 // Initial call to kick off the loading in order to avoid edge cases with components 35620 // coming from lazy chunks that change before the chunk has loaded. 35621 const initialCall = variable(importCallbackName).callFn([variable('Date').prop('now').callFn([])]); 35622 // import.meta.hot
35623 const hotRead = variable('import').prop('meta').prop('hot'); 35624 // import.meta.hot.on('angular:component-update', () => ...); 35625 const hotListener = hotRead.clone().prop('on').callFn([literal('angular:component-update'), updateCallback]); 35626 return arrowFn([], [ 35627 // const id = <id>; 35628 new DeclareVarStmt(idName, literal(encodeURIComponent(`${meta.filePath}@${meta.className}`)), null, StmtModifier.Final), 35629 // function Cmp_HmrLoad() {...}. 35630 importCallback, 35631 // ngDevMode && Cmp_HmrLoad(Date.now()); 35632 devOnlyGuardedExpression(initialCall).toStmt(), 35633 // ngDevMode && import.meta.hot && import.meta.hot.on(...) 35634 devOnlyGuardedExpression(hotRead.and(hotListener)).toStmt()]).callFn([]); 35635} 35636/** 35637 * Compiles the HMR update callback for a class. 35638 * @param definitions Compiled definitions for the class (e.g. `defineComponent` calls). 35639 * @param constantStatements Supporting constants statements that were generated alongside 35640 * the definition. 35641 * @param meta HMR metadata extracted from the class. 35642 */ 35643function compileHmrUpdateCallback(definitions, constantStatements, meta) { 35644 const namespaces = 'ɵɵnamespaces'; 35645 const params = [meta.className, namespaces].map(name => new FnParam(name, DYNAMIC_TYPE)); 35646 const body = []; 35647 for (const local of meta.localDependencies) { 35648 params.push(new FnParam(local.name)); 35649 } 35650 // Declare variables that read out the individual namespaces. 35651 for (let i = 0; i < meta.namespaceDependencies.length; i++) { 35652 body.push(new DeclareVarStmt(meta.namespaceDependencies[i].assignedName, variable(namespaces).key(literal(i)), DYNAMIC_TYPE, StmtModifier.Final)); 35653 } 35654 body.push(...constantStatements); 35655 for (const field of definitions) { 35656 if (field.initializer !== null) { 35657 body.push(variable(meta.className).prop(field.name).set(field.initializer).toStmt()); 35658 for (const stmt of field.statements) { 35659 body.push(stmt); 35660 } 35661 } 35662 } 35663 return new DeclareFunctionStmt(`${meta.className}_UpdateMetadata`, params, body, null, StmtModifier.Final); 35664} 35665 35666/** 35667 * Every time we make a breaking change to the declaration interface or partial-linker behavior, we 35668 * must update this constant to prevent old partial-linkers from incorrectly processing the 35669 * declaration. 35670 * 35671 * Do not include any prerelease in these versions as they are ignored. 35672 */ 35673const MINIMUM_PARTIAL_LINKER_VERSION$5 = '12.0.0'; 35674/** 35675 * Minimum version at which deferred blocks are supported in the linker. 35676 */ 35677const MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION = '18.0.0'; 35678function compileDeclareClassMetadata(metadata) { 35679 const definitionMap = new DefinitionMap(); 35680 definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$5)); 35681 definitionMap.set('version', literal('19.2.14')); 35682 definitionMap.set('ngImport', importExpr(Identifiers.core)); 35683 definitionMap.set('type', metadata.type); 35684 definitionMap.set('decorators', metadata.decorators); 35685 definitionMap.set('ctorParameters', metadata.ctorParameters); 35686 definitionMap.set('propDecorators', metadata.propDecorators); 35687 return importExpr(Identifiers.declareClassMetadata).callFn([definitionMap.toLiteralMap()]); 35688} 35689function compileComponentDeclareClassMetadata(metadata, dependencies) { 35690 var _metadata$ctorParamet2, _metadata$propDecorat2; 35691 if (dependencies === null || dependencies.length === 0) { 35692 return compileDeclareClassMetadata(metadata); 35693 } 35694 const definitionMap = new DefinitionMap(); 35695 const callbackReturnDefinitionMap = new DefinitionMap(); 35696 callbackReturnDefinitionMap.set('decorators', metadata.decorators); 35697 callbackReturnDefinitionMap.set('ctorParameters', (_metadata$ctorParamet2 = metadata.ctorParameters) !== null && _metadata$ctorParamet2 !== void 0 ? _metadata$ctorParamet2 : literal(null)); 35698 callbackReturnDefinitionMap.set('propDecorators', (_metadata$propDecorat2 = metadata.propDecorators) !== null && _metadata$propDecorat2 !== void 0 ? _metadata$propDecorat2 : literal(null)); 35699 definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_DEFER_SUPPORT_VERSION)); 35700 definitionMap.set('version', literal('19.2.14')); 35701 definitionMap.set('ngImport', importExpr(Identifiers.core)); 35702 definitionMap.set('type', metadata.type); 35703 definitionMap.set('resolveDeferredDeps', compileComponentMetadataAsyncResolver(dependencies)); 35704 definitionMap.set('resolveMetadata', arrowFn(dependencies.map(dep => new FnParam(dep.symbolName, DYNAMIC_TYPE)), callbackReturnDefinitionMap.toLiteralMap())); 35705 return importExpr(Identifiers.declareClassMetadataAsync).callFn([definitionMap.toLiteralMap()]); 35706} 35707 35708/** 35709 * Creates an array literal expression from the given array, mapping all values to an expression 35710 * using the provided mapping function. If the array is empty or null, then null is returned. 35711 * 35712 * @param values The array to transfer into literal array expression. 35713 * @param mapper The logic to use for creating an expression for the array's values. 35714 * @returns An array literal expression representing `values`, or null if `values` is empty or 35715 * is itself null. 35716 */ 35717function toOptionalLiteralArray(values, mapper) { 35718 if (values === null || values.length === 0) { 35719 return null; 35720 } 35721 return literalArr(values.map(value => mapper(value))); 35722} 35723/** 35724 * Creates an object literal expression from the given object, mapping all values to an expression 35725 * using the provided mapping function. If the object has no keys, then null is returned. 35726 * 35727 * @param object The object to transfer into an object literal expression. 35728 * @param mapper The logic to use for creating an expression for the object's values. 35729 * @returns An object literal expression representing `object`, or null if `object` does not have 35730 * any keys. 35731 */ 35732function toOptionalLiteralMap(object, mapper) { 35733 const entries = Object.keys(object).map(key => { 35734 const value = object[key]; 35735 return { 35736 key, 35737 value: mapper(value), 35738 quoted: true 35739 }; 35740 }); 35741 if (entries.length > 0) { 35742 return literalMap(entries); 35743 } else { 35744 return null; 35745 } 35746} 35747function compileDependencies(deps) {
35748 if (deps === 'invalid') { 35749 // The `deps` can be set to the string "invalid" by the `unwrapConstructorDependencies()` 35750 // function, which tries to convert `ConstructorDeps` into `R3DependencyMetadata[]`. 35751 return literal('invalid'); 35752 } else if (deps === null) { 35753 return literal(null); 35754 } else { 35755 return literalArr(deps.map(compileDependency)); 35756 } 35757} 35758function compileDependency(dep) { 35759 const depMeta = new DefinitionMap(); 35760 depMeta.set('token', dep.token); 35761 if (dep.attributeNameType !== null) { 35762 depMeta.set('attribute', literal(true)); 35763 } 35764 if (dep.host) { 35765 depMeta.set('host', literal(true)); 35766 } 35767 if (dep.optional) { 35768 depMeta.set('optional', literal(true)); 35769 } 35770 if (dep.self) { 35771 depMeta.set('self', literal(true)); 35772 } 35773 if (dep.skipSelf) { 35774 depMeta.set('skipSelf', literal(true)); 35775 } 35776 return depMeta.toLiteralMap(); 35777} 35778 35779/** 35780 * Compile a directive declaration defined by the `R3DirectiveMetadata`. 35781 */ 35782function compileDeclareDirectiveFromMetadata(meta) { 35783 const definitionMap = createDirectiveDefinitionMap(meta); 35784 const expression = importExpr(Identifiers.declareDirective).callFn([definitionMap.toLiteralMap()]); 35785 const type = createDirectiveType(meta); 35786 return { 35787 expression, 35788 type, 35789 statements: [] 35790 }; 35791} 35792/** 35793 * Gathers the declaration fields for a directive into a `DefinitionMap`. This allows for reusing 35794 * this logic for components, as they extend the directive metadata. 35795 */ 35796function createDirectiveDefinitionMap(meta) { 35797 var _meta$hostDirectives3; 35798 const definitionMap = new DefinitionMap(); 35799 const minVersion = getMinimumVersionForPartialOutput(meta); 35800 definitionMap.set('minVersion', literal(minVersion)); 35801 definitionMap.set('version', literal('19.2.14')); 35802 // e.g. `type: MyDirective` 35803 definitionMap.set('type', meta.type.value); 35804 if (meta.isStandalone !== undefined) { 35805 definitionMap.set('isStandalone', literal(meta.isStandalone)); 35806 } 35807 if (meta.isSignal) { 35808 definitionMap.set('isSignal', literal(meta.isSignal)); 35809 } 35810 // e.g. `selector: 'some-dir'` 35811 if (meta.selector !== null) { 35812 definitionMap.set('selector', literal(meta.selector)); 35813 } 35814 definitionMap.set('inputs', needsNewInputPartialOutput(meta) ? createInputsPartialMetadata(meta.inputs) : legacyInputsPartialMetadata(meta.inputs)); 35815 definitionMap.set('outputs', conditionallyCreateDirectiveBindingLiteral(meta.outputs)); 35816 definitionMap.set('host', compileHostMetadata(meta.host)); 35817 definitionMap.set('providers', meta.providers); 35818 if (meta.queries.length > 0) { 35819 definitionMap.set('queries', literalArr(meta.queries.map(compileQuery))); 35820 } 35821 if (meta.viewQueries.length > 0) { 35822 definitionMap.set('viewQueries', literalArr(meta.viewQueries.map(compileQuery))); 35823 } 35824 if (meta.exportAs !== null) { 35825 definitionMap.set('exportAs', asLiteral(meta.exportAs)); 35826 } 35827 if (meta.usesInheritance) { 35828 definitionMap.set('usesInheritance', literal(true)); 35829 } 35830 if (meta.lifecycle.usesOnChanges) { 35831 definitionMap.set('usesOnChanges', literal(true)); 35832 } 35833 if ((_meta$hostDirectives3 = meta.hostDirectives) !== null && _meta$hostDirectives3 !== void 0 && _meta$hostDirectives3.length) { 35834 definitionMap.set('hostDirectives', createHostDirectives(meta.hostDirectives)); 35835 } 35836 definitionMap.set('ngImport', importExpr(Identifiers.core)); 35837 return definitionMap; 35838} 35839/** 35840 * Determines the minimum linker version for the partial output 35841 * generated for this directive. 35842 * 35843 * Every time we make a breaking change to the declaration interface or partial-linker 35844 * behavior, we must update the minimum versions to prevent old partial-linkers from 35845 * incorrectly processing the declaration. 35846 * 35847 * NOTE: Do not include any prerelease in these versions as they are ignored. 35848 */ 35849function getMinimumVersionForPartialOutput(meta) { 35850 // We are starting with the oldest minimum version that can work for common 35851 // directive partial compilation output. As we discover usages of new features 35852 // that require a newer partial output emit, we bump the `minVersion`. Our goal 35853 // is to keep libraries as much compatible with older linker versions as possible. 35854 let minVersion = '14.0.0'; 35855 // Note: in order to allow consuming Angular libraries that have been compiled with 16.1+ in 35856 // Angular 16.0, we only force a minimum version of 16.1 if input transform feature as introduced 35857 // in 16.1 is actually used. 35858 const hasDecoratorTransformFunctions = Object.values(meta.inputs).some(input => input.transformFunction !== null); 35859 if (hasDecoratorTransformFunctions) { 35860 minVersion = '16.1.0'; 35861 } 35862 // If there are input flags and we need the new emit, use the actual minimum version, 35863 // where this was introduced. i.e. in 17.1.0 35864 // TODO(legacy-partial-output-inputs): Remove in v18. 35865 if (needsNewInputPartialOutput(meta)) { 35866 minVersion = '17.1.0'; 35867 } 35868 // If there are signal-based queries, partial output generates an extra field 35869 // that should be parsed by linkers. Ensure a proper minimum linker version. 35870 if (meta.queries.some(q => q.isSignal) || meta.viewQueries.some(q => q.isSignal)) { 35871 minVersion = '17.2.0'; 35872 } 35873 return minVersion; 35874} 35875/** 35876 * Gets whether the given directive needs the new input partial output structure 35877 * that can hold additional metadata like `isRequired`, `isSignal` etc. 35878 */ 35879function needsNewInputPartialOutput(meta) { 35880 return Object.values(meta.inputs).some(input => input.isSignal); 35881} 35882/** 35883 * Compiles the metadata of a single query into its partial declaration form as declared 35884 * by `R3DeclareQueryMetadata`. 35885 */ 35886function compileQuery(query) { 35887 const meta = new DefinitionMap(); 35888 meta.set('propertyName', literal(query.propertyName)); 35889 if (query.first) { 35890 meta.set('first', literal(true)); 35891 } 35892 meta.set('predicate', Array.isArray(query.predicate) ? asLiteral(query.predicate) : convertFromMaybeForwardRefExpression(query.predicate)); 35893 if (!query.emitDistinctChangesOnly) { 35894 // `emitDistinctChangesOnly` is special because we expect it to be `true`. 35895 // Therefore we explicitly emit the field, and explicitly place it only when it's `false`. 35896 meta.set('emitDistinctChangesOnly', literal(false)); 35897 } 35898 if (query.descendants) { 35899 meta.set('descendants', literal(true)); 35900 } 35901 meta.set('read', query.read); 35902 if (query.static) { 35903 meta.set('static', literal(true)); 35904 } 35905 if (query.isSignal) { 35906 meta.set('isSignal', literal(true)); 35907 } 35908 return meta.toLiteralMap(); 35909} 35910/** 35911 * Compiles the host metadata into its partial declaration form as declared 35912 * in `R3DeclareDirectiveMetadata['host']` 35913 */ 35914function compileHostMetadata(meta) { 35915 const hostMetadata = new DefinitionMap(); 35916 hostMetadata.set('attributes', toOptionalLiteralMap(meta.attributes, expression => expression)); 35917 hostMetadata.set('listeners', toOptionalLiteralMap(meta.listeners, literal)); 35918 hostMetadata.set('properties', toOptionalLiteralMap(meta.properties, literal)); 35919 if (meta.specialAttributes.styleAttr) { 35920 hostMetadata.set('styleAttribute', literal(meta.specialAttributes.styleAttr)); 35921 } 35922 if (meta.specialAttributes.classAttr) { 35923 hostMetadata.set('classAttribute', literal(meta.specialAttributes.classAttr)); 35924 } 35925 if (hostMetadata.values.length > 0) { 35926 return hostMetadata.toLiteralMap(); 35927 } else { 35928 return null; 35929 } 35930} 35931function createHostDirectives(hostDirectives) { 35932 const expressions = hostDirectives.map(current => {
35933 const keys = [{ 35934 key: 'directive', 35935 value: current.isForwardReference ? generateForwardRef(current.directive.type) : current.directive.type, 35936 quoted: false 35937 }]; 35938 const inputsLiteral = current.inputs ? createHostDirectivesMappingArray(current.inputs) : null; 35939 const outputsLiteral = current.outputs ? createHostDirectivesMappingArray(current.outputs) : null; 35940 if (inputsLiteral) { 35941 keys.push({ 35942 key: 'inputs', 35943 value: inputsLiteral, 35944 quoted: false 35945 }); 35946 } 35947 if (outputsLiteral) { 35948 keys.push({ 35949 key: 'outputs', 35950 value: outputsLiteral, 35951 quoted: false 35952 }); 35953 } 35954 return literalMap(keys); 35955 }); 35956 // If there's a forward reference, we generate a `function() { return [{directive: HostDir}] }`, 35957 // otherwise we can save some bytes by using a plain array, e.g. `[{directive: HostDir}]`. 35958 return literalArr(expressions); 35959} 35960/** 35961 * Generates partial output metadata for inputs of a directive. 35962 * 35963 * The generated structure is expected to match `R3DeclareDirectiveFacade['inputs']`. 35964 */ 35965function createInputsPartialMetadata(inputs) { 35966 const keys = Object.getOwnPropertyNames(inputs); 35967 if (keys.length === 0) { 35968 return null; 35969 } 35970 return literalMap(keys.map(declaredName => { 35971 var _value$transformFunct; 35972 const value = inputs[declaredName]; 35973 return { 35974 key: declaredName, 35975 // put quotes around keys that contain potentially unsafe characters 35976 quoted: UNSAFE_OBJECT_KEY_NAME_REGEXP.test(declaredName), 35977 value: literalMap([{ 35978 key: 'classPropertyName', 35979 quoted: false, 35980 value: asLiteral(value.classPropertyName) 35981 }, { 35982 key: 'publicName', 35983 quoted: false, 35984 value: asLiteral(value.bindingPropertyName) 35985 }, { 35986 key: 'isSignal', 35987 quoted: false, 35988 value: asLiteral(value.isSignal) 35989 }, { 35990 key: 'isRequired', 35991 quoted: false, 35992 value: asLiteral(value.required) 35993 }, { 35994 key: 'transformFunction', 35995 quoted: false, 35996 value: (_value$transformFunct = value.transformFunction) !== null && _value$transformFunct !== void 0 ? _value$transformFunct : NULL_EXPR 35997 }]) 35998 }; 35999 })); 36000} 36001/** 36002 * Pre v18 legacy partial output for inputs. 36003 * 36004 * Previously, inputs did not capture metadata like `isSignal` in the partial compilation output. 36005 * To enable capturing such metadata, we restructured how input metadata is communicated in the 36006 * partial output. This would make libraries incompatible with older Angular FW versions where the 36007 * linker would not know how to handle this new "format". For this reason, if we know this metadata 36008 * does not need to be captured- we fall back to the old format. This is what this function 36009 * generates. 36010 * 36011 * See: 36012 * https://github.com/angular/angular/blob/d4b423690210872b5c32a322a6090beda30b05a3/packages/core/src/compiler/compiler_facade_interface.ts#L197-L199 36013 */ 36014function legacyInputsPartialMetadata(inputs) { 36015 // TODO(legacy-partial-output-inputs): Remove function in v18. 36016 const keys = Object.getOwnPropertyNames(inputs); 36017 if (keys.length === 0) { 36018 return null; 36019 } 36020 return literalMap(keys.map(declaredName => { 36021 const value = inputs[declaredName]; 36022 const publicName = value.bindingPropertyName; 36023 const differentDeclaringName = publicName !== declaredName; 36024 let result; 36025 if (differentDeclaringName || value.transformFunction !== null) { 36026 const values = [asLiteral(publicName), asLiteral(declaredName)]; 36027 if (value.transformFunction !== null) { 36028 values.push(value.transformFunction); 36029 } 36030 result = literalArr(values); 36031 } else { 36032 result = asLiteral(publicName); 36033 } 36034 return { 36035 key: declaredName, 36036 // put quotes around keys that contain potentially unsafe characters 36037 quoted: UNSAFE_OBJECT_KEY_NAME_REGEXP.test(declaredName), 36038 value: result 36039 }; 36040 })); 36041} 36042 36043/** 36044 * Compile a component declaration defined by the `R3ComponentMetadata`. 36045 */ 36046function compileDeclareComponentFromMetadata(meta, template, additionalTemplateInfo) { 36047 const definitionMap = createComponentDefinitionMap(meta, template, additionalTemplateInfo); 36048 const expression = importExpr(Identifiers.declareComponent).callFn([definitionMap.toLiteralMap()]); 36049 const type = createComponentType(meta); 36050 return { 36051 expression, 36052 type, 36053 statements: [] 36054 }; 36055} 36056/** 36057 * Gathers the declaration fields for a component into a `DefinitionMap`. 36058 */ 36059function createComponentDefinitionMap(meta, template, templateInfo) { 36060 const definitionMap = createDirectiveDefinitionMap(meta); 36061 const blockVisitor = new BlockPresenceVisitor(); 36062 visitAll$1(blockVisitor, template.nodes); 36063 definitionMap.set('template', getTemplateExpression(template, templateInfo)); 36064 if (templateInfo.isInline) { 36065 definitionMap.set('isInline', literal(true)); 36066 } 36067 // Set the minVersion to 17.0.0 if the component is using at least one block in its template. 36068 // We don't do this for templates without blocks, in order to preserve backwards compatibility. 36069 if (blockVisitor.hasBlocks) { 36070 definitionMap.set('minVersion', literal('17.0.0')); 36071 } 36072 definitionMap.set('styles', toOptionalLiteralArray(meta.styles, literal)); 36073 definitionMap.set('dependencies', compileUsedDependenciesMetadata(meta)); 36074 definitionMap.set('viewProviders', meta.viewProviders); 36075 definitionMap.set('animations', meta.animations); 36076 if (meta.changeDetection !== null) { 36077 if (typeof meta.changeDetection === 'object') { 36078 throw new Error('Impossible state! Change detection flag is not resolved!'); 36079 } 36080 definitionMap.set('changeDetection', importExpr(Identifiers.ChangeDetectionStrategy).prop(ChangeDetectionStrategy[meta.changeDetection])); 36081 } 36082 if (meta.encapsulation !== ViewEncapsulation$1.Emulated) { 36083 definitionMap.set('encapsulation', importExpr(Identifiers.ViewEncapsulation).prop(ViewEncapsulation$1[meta.encapsulation])); 36084 } 36085 if (meta.interpolation !== DEFAULT_INTERPOLATION_CONFIG) { 36086 definitionMap.set('interpolation', literalArr([literal(meta.interpolation.start), literal(meta.interpolation.end)])); 36087 }
36088 if (template.preserveWhitespaces === true) { 36089 definitionMap.set('preserveWhitespaces', literal(true)); 36090 } 36091 if (meta.defer.mode === 0 /* DeferBlockDepsEmitMode.PerBlock */) { 36092 const resolvers = []; 36093 let hasResolvers = false; 36094 for (const deps of meta.defer.blocks.values()) { 36095 // Note: we need to push a `null` even if there are no dependencies, because matching of 36096 // defer resolver functions to defer blocks happens by index and not adding an array 36097 // entry for a block can throw off the blocks coming after it. 36098 if (deps === null) { 36099 resolvers.push(literal(null)); 36100 } else { 36101 resolvers.push(deps); 36102 hasResolvers = true; 36103 } 36104 } 36105 // If *all* the resolvers are null, we can skip the field. 36106 if (hasResolvers) { 36107 definitionMap.set('deferBlockDependencies', literalArr(resolvers)); 36108 } 36109 } else { 36110 throw new Error('Unsupported defer function emit mode in partial compilation'); 36111 } 36112 return definitionMap; 36113} 36114function getTemplateExpression(template, templateInfo) { 36115 // If the template has been defined using a direct literal, we use that expression directly 36116 // without any modifications. This is ensures proper source mapping from the partially 36117 // compiled code to the source file declaring the template. Note that this does not capture 36118 // template literals referenced indirectly through an identifier. 36119 if (templateInfo.inlineTemplateLiteralExpression !== null) { 36120 return templateInfo.inlineTemplateLiteralExpression; 36121 } 36122 // If the template is defined inline but not through a literal, the template has been resolved 36123 // through static interpretation. We create a literal but cannot provide any source span. Note 36124 // that we cannot use the expression defining the template because the linker expects the template 36125 // to be defined as a literal in the declaration. 36126 if (templateInfo.isInline) { 36127 return literal(templateInfo.content, null, null); 36128 } 36129 // The template is external so we must synthesize an expression node with 36130 // the appropriate source-span. 36131 const contents = templateInfo.content; 36132 const file = new ParseSourceFile(contents, templateInfo.sourceUrl); 36133 const start = new ParseLocation(file, 0, 0, 0); 36134 const end = computeEndLocation(file, contents); 36135 const span = new ParseSourceSpan(start, end); 36136 return literal(contents, null, span); 36137} 36138function computeEndLocation(file, contents) { 36139 const length = contents.length; 36140 let lineStart = 0; 36141 let lastLineStart = 0; 36142 let line = 0; 36143 do { 36144 lineStart = contents.indexOf('\n', lastLineStart); 36145 if (lineStart !== -1) { 36146 lastLineStart = lineStart + 1; 36147 line++; 36148 } 36149 } while (lineStart !== -1); 36150 return new ParseLocation(file, length, line, length - lastLineStart); 36151} 36152function compileUsedDependenciesMetadata(meta) { 36153 const wrapType = meta.declarationListEmitMode !== 0 /* DeclarationListEmitMode.Direct */ ? generateForwardRef : expr => expr; 36154 if (meta.declarationListEmitMode === 3 /* DeclarationListEmitMode.RuntimeResolved */) { 36155 throw new Error(`Unsupported emit mode`); 36156 } 36157 return toOptionalLiteralArray(meta.declarations, decl => { 36158 switch (decl.kind) { 36159 case R3TemplateDependencyKind.Directive: 36160 const dirMeta = new DefinitionMap(); 36161 dirMeta.set('kind', literal(decl.isComponent ? 'component' : 'directive')); 36162 dirMeta.set('type', wrapType(decl.type)); 36163 dirMeta.set('selector', literal(decl.selector)); 36164 dirMeta.set('inputs', toOptionalLiteralArray(decl.inputs, literal)); 36165 dirMeta.set('outputs', toOptionalLiteralArray(decl.outputs, literal)); 36166 dirMeta.set('exportAs', toOptionalLiteralArray(decl.exportAs, literal)); 36167 return dirMeta.toLiteralMap(); 36168 case R3TemplateDependencyKind.Pipe: 36169 const pipeMeta = new DefinitionMap(); 36170 pipeMeta.set('kind', literal('pipe')); 36171 pipeMeta.set('type', wrapType(decl.type)); 36172 pipeMeta.set('name', literal(decl.name)); 36173 return pipeMeta.toLiteralMap(); 36174 case R3TemplateDependencyKind.NgModule: 36175 const ngModuleMeta = new DefinitionMap(); 36176 ngModuleMeta.set('kind', literal('ngmodule')); 36177 ngModuleMeta.set('type', wrapType(decl.type)); 36178 return ngModuleMeta.toLiteralMap(); 36179 } 36180 }); 36181} 36182class BlockPresenceVisitor extends RecursiveVisitor$1 { 36183 constructor(...args) { 36184 super(...args); 36185 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "hasBlocks", false); 36186 } 36187 visitDeferredBlock() { 36188 this.hasBlocks = true; 36189 } 36190 visitDeferredBlockPlaceholder() { 36191 this.hasBlocks = true; 36192 } 36193 visitDeferredBlockLoading() { 36194 this.hasBlocks = true; 36195 } 36196 visitDeferredBlockError() { 36197 this.hasBlocks = true; 36198 } 36199 visitIfBlock() { 36200 this.hasBlocks = true; 36201 } 36202 visitIfBlockBranch() { 36203 this.hasBlocks = true; 36204 } 36205 visitForLoopBlock() { 36206 this.hasBlocks = true; 36207 } 36208 visitForLoopBlockEmpty() { 36209 this.hasBlocks = true; 36210 } 36211 visitSwitchBlock() { 36212 this.hasBlocks = true; 36213 } 36214 visitSwitchBlockCase() { 36215 this.hasBlocks = true; 36216 } 36217} 36218 36219/** 36220 * Every time we make a breaking change to the declaration interface or partial-linker behavior, we 36221 * must update this constant to prevent old partial-linkers from incorrectly processing the 36222 * declaration. 36223 * 36224 * Do not include any prerelease in these versions as they are ignored. 36225 */ 36226const MINIMUM_PARTIAL_LINKER_VERSION$4 = '12.0.0'; 36227function compileDeclareFactoryFunction(meta) { 36228 const definitionMap = new DefinitionMap(); 36229 definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$4)); 36230 definitionMap.set('version', literal('19.2.14')); 36231 definitionMap.set('ngImport', importExpr(Identifiers.core)); 36232 definitionMap.set('type', meta.type.value); 36233 definitionMap.set('deps', compileDependencies(meta.deps)); 36234 definitionMap.set('target', importExpr(Identifiers.FactoryTarget).prop(FactoryTarget[meta.target])); 36235 return { 36236 expression: importExpr(Identifiers.declareFactory).callFn([definitionMap.toLiteralMap()]), 36237 statements: [], 36238 type: createFactoryType(meta) 36239 }; 36240} 36241 36242/** 36243 * Every time we make a breaking change to the declaration interface or partial-linker behavior, we 36244 * must update this constant to prevent old partial-linkers from incorrectly processing the 36245 * declaration. 36246 * 36247 * Do not include any prerelease in these versions as they are ignored. 36248 */ 36249const MINIMUM_PARTIAL_LINKER_VERSION$3 = '12.0.0'; 36250/** 36251 * Compile a Injectable declaration defined by the `R3InjectableMetadata`. 36252 */ 36253function compileDeclareInjectableFromMetadata(meta) { 36254 const definitionMap = createInjectableDefinitionMap(meta); 36255 const expression = importExpr(Identifiers.declareInjectable).callFn([definitionMap.toLiteralMap()]); 36256 const type = createInjectableType(meta); 36257 return { 36258 expression, 36259 type, 36260 statements: [] 36261 }; 36262} 36263/** 36264 * Gathers the declaration fields for a Injectable into a `DefinitionMap`. 36265 */ 36266function createInjectableDefinitionMap(meta) { 36267 const definitionMap = new DefinitionMap(); 36268 definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$3)); 36269 definitionMap.set('version', literal('19.2.14')); 36270 definitionMap.set('ngImport', importExpr(Identifiers.core)); 36271 definitionMap.set('type', meta.type.value); 36272 // Only generate providedIn property if it has a non-null value 36273 if (meta.providedIn !== undefined) { 36274 const providedIn = convertFromMaybeForwardRefExpression(meta.providedIn); 36275 if (providedIn.value !== null) { 36276 definitionMap.set('providedIn', providedIn); 36277 } 36278 } 36279 if (meta.useClass !== undefined) { 36280 definitionMap.set('useClass', convertFromMaybeForwardRefExpression(meta.useClass)); 36281 } 36282 if (meta.useExisting !== undefined) { 36283 definitionMap.set('useExisting', convertFromMaybeForwardRefExpression(meta.useExisting)); 36284 } 36285 if (meta.useValue !== undefined) { 36286 definitionMap.set('useValue', convertFromMaybeForwardRefExpression(meta.useValue)); 36287 } 36288 // Factories do not contain `ForwardRef`s since any types are already wrapped in a function call 36289 // so the types will not be eagerly evaluated. Therefore we do not need to process this expression 36290 // with `convertFromProviderExpression()`. 36291 if (meta.useFactory !== undefined) { 36292 definitionMap.set('useFactory', meta.useFactory); 36293 } 36294 if (meta.deps !== undefined) { 36295 definitionMap.set('deps', literalArr(meta.deps.map(compileDependency))); 36296 } 36297 return definitionMap; 36298} 36299 36300/** 36301 * Every time we make a breaking change to the declaration interface or partial-linker behavior, we 36302 * must update this constant to prevent old partial-linkers from incorrectly processing the 36303 * declaration. 36304 * 36305 * Do not include any prerelease in these versions as they are ignored. 36306 */ 36307const MINIMUM_PARTIAL_LINKER_VERSION$2 = '12.0.0'; 36308function compileDeclareInjectorFromMetadata(meta) { 36309 const definitionMap = createInjectorDefinitionMap(meta); 36310 const expression = importExpr(Identifiers.declareInjector).callFn([definitionMap.toLiteralMap()]); 36311 const type = createInjectorType(meta); 36312 return { 36313 expression, 36314 type, 36315 statements: [] 36316 }; 36317} 36318/** 36319 * Gathers the declaration fields for an Injector into a `DefinitionMap`. 36320 */ 36321function createInjectorDefinitionMap(meta) { 36322 const definitionMap = new DefinitionMap(); 36323 definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$2)); 36324 definitionMap.set('version', literal('19.2.14')); 36325 definitionMap.set('ngImport', importExpr(Identifiers.core)); 36326 definitionMap.set('type', meta.type.value); 36327 definitionMap.set('providers', meta.providers); 36328 if (meta.imports.length > 0) { 36329 definitionMap.set('imports', literalArr(meta.imports)); 36330 } 36331 return definitionMap; 36332} 36333 36334/** 36335 * Every time we make a breaking change to the declaration interface or partial-linker behavior, we 36336 * must update this constant to prevent old partial-linkers from incorrectly processing the 36337 * declaration. 36338 * 36339 * Do not include any prerelease in these versions as they are ignored. 36340 */ 36341const MINIMUM_PARTIAL_LINKER_VERSION$1 = '14.0.0'; 36342function compileDeclareNgModuleFromMetadata(meta) { 36343 const definitionMap = createNgModuleDefinitionMap(meta); 36344 const expression = importExpr(Identifiers.declareNgModule).callFn([definitionMap.toLiteralMap()]); 36345 const type = createNgModuleType(meta); 36346 return { 36347 expression, 36348 type, 36349 statements: [] 36350 }; 36351} 36352/** 36353 * Gathers the declaration fields for an NgModule into a `DefinitionMap`. 36354 */ 36355function createNgModuleDefinitionMap(meta) { 36356 const definitionMap = new DefinitionMap(); 36357 if (meta.kind === R3NgModuleMetadataKind.Local) { 36358 throw new Error('Invalid path! Local compilation mode should not get into the partial compilation path'); 36359 } 36360 definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$1)); 36361 definitionMap.set('version', literal('19.2.14')); 36362 definitionMap.set('ngImport', importExpr(Identifiers.core)); 36363 definitionMap.set('type', meta.type.value); 36364 // We only generate the keys in the metadata if the arrays contain values. 36365 // We must wrap the arrays inside a function if any of the values are a forward reference to a 36366 // not-yet-declared class. This is to support JIT execution of the `ɵɵngDeclareNgModule(
36366)` call. 36367 // In the linker these wrappers are stripped and then reapplied for the `ɵɵdefineNgModule()` call. 36368 if (meta.bootstrap.length > 0) { 36369 definitionMap.set('bootstrap', refsToArray(meta.bootstrap, meta.containsForwardDecls)); 36370 } 36371 if (meta.declarations.length > 0) { 36372 definitionMap.set('declarations', refsToArray(meta.declarations, meta.containsForwardDecls)); 36373 } 36374 if (meta.imports.length > 0) { 36375 definitionMap.set('imports', refsToArray(meta.imports, meta.containsForwardDecls)); 36376 } 36377 if (meta.exports.length > 0) { 36378 definitionMap.set('exports', refsToArray(meta.exports, meta.containsForwardDecls)); 36379 } 36380 if (meta.schemas !== null && meta.schemas.length > 0) { 36381 definitionMap.set('schemas', literalArr(meta.schemas.map(ref => ref.value))); 36382 } 36383 if (meta.id !== null) { 36384 definitionMap.set('id', meta.id); 36385 } 36386 return definitionMap; 36387} 36388 36389/** 36390 * Every time we make a breaking change to the declaration interface or partial-linker behavior, we 36391 * must update this constant to prevent old partial-linkers from incorrectly processing the 36392 * declaration. 36393 * 36394 * Do not include any prerelease in these versions as they are ignored. 36395 */ 36396const MINIMUM_PARTIAL_LINKER_VERSION = '14.0.0'; 36397/** 36398 * Compile a Pipe declaration defined by the `R3PipeMetadata`. 36399 */ 36400function compileDeclarePipeFromMetadata(meta) { 36401 const definitionMap = createPipeDefinitionMap(meta); 36402 const expression = importExpr(Identifiers.declarePipe).callFn([definitionMap.toLiteralMap()]); 36403 const type = createPipeType(meta); 36404 return { 36405 expression, 36406 type, 36407 statements: [] 36408 }; 36409} 36410/** 36411 * Gathers the declaration fields for a Pipe into a `DefinitionMap`. 36412 */ 36413function createPipeDefinitionMap(meta) { 36414 const definitionMap = new DefinitionMap(); 36415 definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION)); 36416 definitionMap.set('version', literal('19.2.14')); 36417 definitionMap.set('ngImport', importExpr(Identifiers.core)); 36418 // e.g. `type: MyPipe` 36419 definitionMap.set('type', meta.type.value); 36420 if (meta.isStandalone !== undefined) { 36421 definitionMap.set('isStandalone', literal(meta.isStandalone)); 36422 } 36423 // e.g. `name: "myPipe"` 36424 definitionMap.set('name', literal(meta.pipeName)); 36425 if (meta.pure === false) { 36426 // e.g. `pure: false` 36427 definitionMap.set('pure', literal(meta.pure)); 36428 } 36429 return definitionMap; 36430} 36431 36432////////////////////////////////////// 36433// THIS FILE HAS GLOBAL SIDE EFFECT // 36434// (see bottom of file) // 36435////////////////////////////////////// 36436/** 36437 * @module 36438 * @description 36439 * Entry point for all APIs of the compiler package. 36440 * 36441 * <div class="callout is-critical"> 36442 * <header>Unstable APIs</header> 36443 * <p> 36444 * All compiler apis are currently considered experimental and private! 36445 * </p> 36446 * <p> 36447 * We expect the APIs in this package to keep on changing. Do not rely on them. 36448 * </p> 36449 * </div> 36450 */ 36451// This file only reexports content of the `src` folder. Keep it that way. 36452// This function call has a global side effects and publishes the compiler into global namespace for 36453// the late binding of the Compiler to the @angular/core for jit compilation. 36454publishFacade(_global); 36455 36456//# sourceMappingURL=compiler.mjs.map 36457 36458/***/ }), 36459 36460/***/ 41959: 36461/*!***************************************************************!*\ 36462 !*** ./node_modules/@angular/cdk/fesm2022/array-I1yfCXUO.mjs ***! 36463 \***************************************************************/ 36464/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { 36465 36466__webpack_require__.r(__webpack_exports__); 36467/* harmony export */ __webpack_require__.d(__webpack_exports__, { 36468/* harmony export */ c: () => (/* binding */ coerceArray) 36469/* harmony export */ }); 36470function coerceArray(value) { 36471 return Array.isArray(value) ? value : [value]; 36472} 36473 36474//# sourceMappingURL=array-I1yfCXUO.mjs.map 36475 36476/***/ }), 36477 36478/***/ 45932: 36479/*!******************************************************************************!*\ 36480 !*** ./node_modules/@angular/platform-browser/fesm2022/browser-D-u-fknz.mjs ***! 36481 \******************************************************************************/ 36482/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { 36483 36484__webpack_require__.r(__webpack_exports__); 36485/* harmony export */ __webpack_require__.d(__webpack_exports__, {
36486/* harmony export */ BrowserDomAdapter: () => (/* binding */ BrowserDomAdapter), 36487/* harmony export */ BrowserGetTestability: () => (/* binding */ BrowserGetTestability), 36488/* harmony export */ BrowserModule: () => (/* binding */ BrowserModule), 36489/* harmony export */ DomEventsPlugin: () => (/* binding */ DomEventsPlugin), 36490/* harmony export */ KeyEventsPlugin: () => (/* binding */ KeyEventsPlugin), 36491/* harmony export */ bootstrapApplication: () => (/* binding */ bootstrapApplication), 36492/* harmony export */ createApplication: () => (/* binding */ createApplication), 36493/* harmony export */ platformBrowser: () => (/* binding */ platformBrowser), 36494/* harmony export */ provideProtractorTestingSupport: () => (/* binding */ provideProtractorTestingSupport) 36495/* harmony export */ }); 36496/* harmony import */ var C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js */ 89379); 36497/* harmony import */ var C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/defineProperty.js */ 64467); 36498/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/common */ 96048); 36499/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/common */ 69377); 36500/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @angular/common */ 59361); 36501/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @angular/common */ 32881); 36502/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/core */ 17705); 36503/* harmony import */ var _dom_renderer_DGKzginR_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./dom_renderer-DGKzginR.mjs */ 63142); 36504 36505 36506/** 36507 * @license Angular v19.2.14 36508 * (c) 2010-2025 Google LLC. https://angular.io/ 36509 * License: MIT 36510 */ 36511 36512 36513 36514 36515 36516 36517/** 36518 * A `DomAdapter` powered by full browser DOM APIs. 36519 * 36520 * @security Tread carefully! Interacting with the DOM directly is dangerous and 36521 * can introduce XSS risks. 36522 */ 36523class BrowserDomAdapter extends _angular_common__WEBPACK_IMPORTED_MODULE_2__.DomAdapter { 36524 constructor(...args) { 36525 super(...args); 36526 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "supportsDOMEvents", true); 36527 } 36528 static makeCurrent() { 36529 (0,_angular_common__WEBPACK_IMPORTED_MODULE_2__.setRootDomAdapter)(new BrowserDomAdapter()); 36530 } 36531 onAndCancel(el, evt, listener, options) { 36532 el.addEventListener(evt, listener, options); 36533 return () => { 36534 el.removeEventListener(evt, listener, options); 36535 }; 36536 } 36537 dispatchEvent(el, evt) { 36538 el.dispatchEvent(evt); 36539 } 36540 remove(node) { 36541 node.remove(); 36542 } 36543 createElement(tagName, doc) { 36544 doc = doc || this.getDefaultDocument(); 36545 return doc.createElement(tagName); 36546 } 36547 createHtmlDocument() { 36548 return document.implementation.createHTMLDocument('fakeTitle'); 36549 } 36550 getDefaultDocument() { 36551 return document; 36552 } 36553 isElementNode(node) { 36554 return node.nodeType === Node.ELEMENT_NODE; 36555 } 36556 isShadowRoot(node) { 36557 return node instanceof DocumentFragment; 36558 } 36559 /** @deprecated No longer being used in Ivy code. To be removed in version 14. */ 36560 getGlobalEventTarget(doc, target) { 36561 if (target === 'window') { 36562 return window; 36563 } 36564 if (target === 'document') { 36565 return doc; 36566 } 36567 if (target === 'body') { 36568 return doc.body; 36569 } 36570 return null; 36571 } 36572 getBaseHref(doc) { 36573 const href = getBaseElementHref(); 36574 return href == null ? null : relativePath(href); 36575 } 36576 resetBaseElement() { 36577 baseElement = null; 36578 } 36579 getUserAgent() { 36580 return window.navigator.userAgent; 36581 } 36582 getCookie(name) { 36583 return (0,_angular_common__WEBPACK_IMPORTED_MODULE_3__.parseCookieValue)(document.cookie, name); 36584 } 36585} 36586let baseElement = null; 36587function getBaseElementHref() { 36588 baseElement = baseElement || document.head.querySelector('base'); 36589 return baseElement ? baseElement.getAttribute('href') : null; 36590} 36591function relativePath(url) { 36592 // The base URL doesn't really matter, we just need it so relative paths have something 36593 // to resolve against. In the browser `HTMLBaseElement.href` is always absolute. 36594 return new URL(url, document.baseURI).pathname; 36595} 36596class BrowserGetTestability { 36597 addToWindow(registry) { 36598 _angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵglobal"]['getAngularTestability'] = (elem, findInAncestors = true) => { 36599 const testability = registry.findTestabilityInTree(elem, findInAncestors); 36600 if (testability == null) { 36601 throw new _angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵRuntimeError"](5103 /* RuntimeErrorCode.TESTABILITY_NOT_FOUND */, (typeof ngDevMode === 'undefined' || ngDevMode) && 'Could not find testability for element.'); 36602 } 36603 return testability; 36604 }; 36605 _angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵglobal"]['getAllAngularTestabilities'] = () => registry.getAllTestabilities(); 36606 _angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵglobal"]['getAllAngularRootElements'] = () => registry.getAllRootElements(); 36607 const whenAllStable = callback => { 36608 const testabilities = _angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵglobal"]['getAllAngularTestabilities'](); 36609 let count = testabilities.length; 36610 const decrement = function () { 36611 count--; 36612 if (count == 0) { 36613 callback(); 36614 } 36615 };
36616 testabilities.forEach(testability => { 36617 testability.whenStable(decrement); 36618 }); 36619 }; 36620 if (!_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵglobal"]['frameworkStabilizers']) { 36621 _angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵglobal"]['frameworkStabilizers'] = []; 36622 } 36623 _angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵglobal"]['frameworkStabilizers'].push(whenAllStable); 36624 } 36625 findTestabilityInTree(registry, elem, findInAncestors) { 36626 if (elem == null) { 36627 return null; 36628 } 36629 const t = registry.getTestability(elem); 36630 if (t != null) { 36631 return t; 36632 } else if (!findInAncestors) { 36633 return null; 36634 } 36635 if ((0,_angular_common__WEBPACK_IMPORTED_MODULE_2__.getDOM)().isShadowRoot(elem)) { 36636 return this.findTestabilityInTree(registry, elem.host, true); 36637 } 36638 return this.findTestabilityInTree(registry, elem.parentElement, true); 36639 } 36640} 36641 36642/** 36643 * A factory for `HttpXhrBackend` that uses the `XMLHttpRequest` browser API. 36644 */ 36645let BrowserXhr = /*#__PURE__*/(() => { 36646 var _BrowserXhr; 36647 class BrowserXhr { 36648 build() { 36649 return new XMLHttpRequest(); 36650 } 36651 } 36652 _BrowserXhr = BrowserXhr; 36653 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(BrowserXhr, "\u0275fac", function _BrowserXhr_Factory(__ngFactoryType__) { 36654 return new (__ngFactoryType__ || _BrowserXhr)(); 36655 }); 36656 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(BrowserXhr, "\u0275prov", /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵɵdefineInjectable"]({ 36657 token: _BrowserXhr, 36658 factory: _BrowserXhr.ɵfac 36659 })); 36660 return BrowserXhr; 36661})(); 36662/*#__PURE__*/(() => { 36663 (typeof ngDevMode === "undefined" || ngDevMode) && void 0; 36664})(); 36665let DomEventsPlugin = /*#__PURE__*/(() => { 36666 var _DomEventsPlugin; 36667 class DomEventsPlugin extends _dom_renderer_DGKzginR_mjs__WEBPACK_IMPORTED_MODULE_5__.EventManagerPlugin { 36668 constructor(doc) { 36669 super(doc); 36670 } 36671 // This plugin should come last in the list of plugins, because it accepts all 36672 // events. 36673 supports(eventName) { 36674 return true; 36675 } 36676 addEventListener(element, eventName, handler, options) { 36677 element.addEventListener(eventName, handler, options); 36678 return () => this.removeEventListener(element, eventName, handler, options); 36679 } 36680 removeEventListener(target, eventName, callback, options) { 36681 return target.removeEventListener(eventName, callback, options); 36682 } 36683 } 36684 _DomEventsPlugin = DomEventsPlugin; 36685 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(DomEventsPlugin, "\u0275fac", function _DomEventsPlugin_Factory(__ngFactoryType__) { 36686 return new (__ngFactoryType__ || _DomEventsPlugin)(_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵɵinject"](_angular_common__WEBPACK_IMPORTED_MODULE_6__.DOCUMENT)); 36687 }); 36688 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(DomEventsPlugin, "\u0275prov", /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵɵdefineInjectable"]({ 36689 token: _DomEventsPlugin, 36690 factory: _DomEventsPlugin.ɵfac 36691 })); 36692 return DomEventsPlugin; 36693})(); 36694/*#__PURE__*/(() => { 36695 (typeof ngDevMode === "undefined" || ngDevMode) && void 0; 36696})(); 36697 36698/** 36699 * Defines supported modifiers for key events. 36700 */ 36701const MODIFIER_KEYS = ['alt', 'control', 'meta', 'shift']; 36702// The following values are here for cross-browser compatibility and to match the W3C standard 36703// cf https://www.w3.org/TR/DOM-Level-3-Events-key/ 36704const _keyMap = { 36705 '\b': 'Backspace', 36706 '\t': 'Tab', 36707 '\x7F': 'Delete', 36708 '\x1B': 'Escape', 36709 'Del': 'Delete', 36710 'Esc': 'Escape', 36711 'Left': 'ArrowLeft', 36712 'Right': 'ArrowRight', 36713 'Up': 'ArrowUp', 36714 'Down': 'ArrowDown', 36715 'Menu': 'ContextMenu', 36716 'Scroll': 'ScrollLock', 36717 'Win': 'OS' 36718}; 36719/** 36720 * Retrieves modifiers from key-event objects. 36721 */ 36722const MODIFIER_KEY_GETTERS = { 36723 'alt': event => event.altKey, 36724 'control': event => event.ctrlKey, 36725 'meta': event => event.metaKey, 36726 'shift': event => event.shiftKey 36727}; 36728/** 36729 * A browser plug-in that provides support for handling of key events in Angular. 36730 */ 36731let KeyEventsPlugin = /*#__PURE__*/(() => { 36732 var _KeyEventsPlugin; 36733 class KeyEventsPlugin extends _dom_renderer_DGKzginR_mjs__WEBPACK_IMPORTED_MODULE_5__.EventManagerPlugin { 36734 /** 36735 * Initializes an instance of the browser plug-in. 36736 * @param doc The document in which key events will be detected. 36737 */ 36738 constructor(doc) { 36739 super(doc); 36740 } 36741 /** 36742 * Reports whether a named key event is supported. 36743 * @param eventName The event name to query. 36744 * @return True if the named key event is supported. 36745 */ 36746 supports(eventName) { 36747 return KeyEventsPlugin.parseEventName(eventName) != null; 36748 } 36749 /** 36750 * Registers a handler for a specific element and key event. 36751 * @param element The HTML element to receive event notifications. 36752 * @param eventName The name of the key event to listen for. 36753 * @param handler A function to call when the notification occurs. Receives the 36754 * event object as an argument. 36755 * @returns The key event that was registered. 36756 */ 36757 addEventListener(element, eventName, handler, options) { 36758 const parsedEvent = KeyEventsPlugin.parseEventName(eventName); 36759 const outsideHandler = KeyEventsPlugin.eventCallback(parsedEvent['fullKey'], handler, this.manager.getZone()); 36760 return this.manager.getZone().runOutsideAngular(() => { 36761 return (0,_angular_common__WEBPACK_IMPORTED_MODULE_2__.getDOM)().onAndCancel(element, parsedEvent['domEventName'], outsideHandler, options); 36762 }); 36763 } 36764 /** 36765 * Parses the user provided full keyboard event definition and normalizes it for 36766 * later internal use. It ensures the string is all lowercase, converts special
36767 * characters to a standard spelling, and orders all the values consistently. 36768 * 36769 * @param eventName The name of the key event to listen for. 36770 * @returns an object with the full, normalized string, and the dom event name 36771 * or null in the case when the event doesn't match a keyboard event. 36772 */ 36773 static parseEventName(eventName) { 36774 const parts = eventName.toLowerCase().split('.'); 36775 const domEventName = parts.shift(); 36776 if (parts.length === 0 || !(domEventName === 'keydown' || domEventName === 'keyup')) { 36777 return null; 36778 } 36779 const key = KeyEventsPlugin._normalizeKey(parts.pop()); 36780 let fullKey = ''; 36781 let codeIX = parts.indexOf('code'); 36782 if (codeIX > -1) { 36783 parts.splice(codeIX, 1); 36784 fullKey = 'code.'; 36785 } 36786 MODIFIER_KEYS.forEach(modifierName => { 36787 const index = parts.indexOf(modifierName); 36788 if (index > -1) { 36789 parts.splice(index, 1); 36790 fullKey += modifierName + '.'; 36791 } 36792 }); 36793 fullKey += key; 36794 if (parts.length != 0 || key.length === 0) { 36795 // returning null instead of throwing to let another plugin process the event 36796 return null; 36797 } 36798 // NOTE: Please don't rewrite this as so, as it will break JSCompiler property renaming. 36799 // The code must remain in the `result['domEventName']` form. 36800 // return {domEventName, fullKey}; 36801 const result = {}; 36802 result['domEventName'] = domEventName; 36803 result['fullKey'] = fullKey; 36804 return result; 36805 } 36806 /** 36807 * Determines whether the actual keys pressed match the configured key code string. 36808 * The `fullKeyCode` event is normalized in the `parseEventName` method when the 36809 * event is attached to the DOM during the `addEventListener` call. This is unseen 36810 * by the end user and is normalized for internal consistency and parsing. 36811 * 36812 * @param event The keyboard event. 36813 * @param fullKeyCode The normalized user defined expected key event string 36814 * @returns boolean. 36815 */ 36816 static matchEventFullKeyCode(event, fullKeyCode) { 36817 let keycode = _keyMap[event.key] || event.key; 36818 let key = ''; 36819 if (fullKeyCode.indexOf('code.') > -1) { 36820 keycode = event.code; 36821 key = 'code.'; 36822 } 36823 // the keycode could be unidentified so we have to check here 36824 if (keycode == null || !keycode) return false; 36825 keycode = keycode.toLowerCase(); 36826 if (keycode === ' ') { 36827 keycode = 'space'; // for readability 36828 } else if (keycode === '.') { 36829 keycode = 'dot'; // because '.' is used as a separator in event names 36830 } 36831 MODIFIER_KEYS.forEach(modifierName => { 36832 if (modifierName !== keycode) { 36833 const modifierGetter = MODIFIER_KEY_GETTERS[modifierName]; 36834 if (modifierGetter(event)) { 36835 key += modifierName + '.'; 36836 } 36837 } 36838 }); 36839 key += keycode; 36840 return key === fullKeyCode; 36841 } 36842 /** 36843 * Configures a handler callback for a key event. 36844 * @param fullKey The event name that combines all simultaneous keystrokes. 36845 * @param handler The function that responds to the key event. 36846 * @param zone The zone in which the event occurred. 36847 * @returns A callback function. 36848 */ 36849 static eventCallback(fullKey, handler, zone) { 36850 return event => { 36851 if (KeyEventsPlugin.matchEventFullKeyCode(event, fullKey)) { 36852 zone.runGuarded(() => handler(event)); 36853 } 36854 }; 36855 } 36856 /** @internal */ 36857 static _normalizeKey(keyName) { 36858 return keyName === 'esc' ? 'escape' : keyName; 36859 } 36860 } 36861 _KeyEventsPlugin = KeyEventsPlugin; 36862 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(KeyEventsPlugin, "\u0275fac", function _KeyEventsPlugin_Factory(__ngFactoryType__) { 36863 return new (__ngFactoryType__ || _KeyEventsPlugin)(_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵɵinject"](_angular_common__WEBPACK_IMPORTED_MODULE_6__.DOCUMENT)); 36864 }); 36865 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(KeyEventsPlugin, "\u0275prov", /* @__P
36865URE__ */_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵɵdefineInjectable"]({ 36866 token: _KeyEventsPlugin, 36867 factory: _KeyEventsPlugin.ɵfac 36868 })); 36869 return KeyEventsPlugin; 36870})(); 36871/*#__PURE__*/(() => { 36872 (typeof ngDevMode === "undefined" || ngDevMode) && void 0; 36873})(); 36874 36875/** 36876 * Bootstraps an instance of an Angular application and renders a standalone component as the 36877 * application's root component. More information about standalone components can be found in [this 36878 * guide](guide/components/importing). 36879 * 36880 * @usageNotes 36881 * The root component passed into this function *must* be a standalone one (should have the 36882 * `standalone: true` flag in the `@Component` decorator config). 36883 * 36884 * ```angular-ts 36885 * @Component({ 36886 * standalone: true, 36887 * template: 'Hello world!' 36888 * }) 36889 * class RootComponent {} 36890 * 36891 * const appRef: ApplicationRef = await bootstrapApplication(RootComponent); 36892 * ``` 36893 * 36894 * You can add the list of providers that should be available in the application injector by 36895 * specifying the `providers` field in an object passed as the second argument: 36896 * 36897 * ```ts 36898 * await bootstrapApplication(RootComponent, { 36899 * providers: [ 36900 * {provide: BACKEND_URL, useValue: 'https://yourdomain.com/api'} 36901 * ] 36902 * }); 36903 * ``` 36904 * 36905 * The `importProvidersFrom` helper method can be used to collect all providers from any 36906 * existing NgModule (and transitively from all NgModules that it imports): 36907 * 36908 * ```ts 36909 * await bootstrapApplication(RootComponent, { 36910 * providers: [ 36911 * importProvidersFrom(SomeNgModule) 36912 * ] 36913 * }); 36914 * ``` 36915 * 36916 * Note: the `bootstrapApplication` method doesn't include [Testability](api/core/Testability) by 36917 * default. You can add [Testability](api/core/Testability) by getting the list of necessary 36918 * providers using `provideProtractorTestingSupport()` function and adding them into the `providers` 36919 * array, for example: 36920 * 36921 * ```ts 36922 * import {provideProtractorTestingSupport} from '@angular/platform-browser'; 36923 * 36924 * await bootstrapApplication(RootComponent, {providers: [provideProtractorTestingSupport()]}); 36925 * ``` 36926 * 36927 * @param rootComponent A reference to a standalone component that should be rendered. 36928 * @param options Extra configuration for the bootstrap operation, see `ApplicationConfig` for 36929 * additional info. 36930 * @returns A promise that returns an `ApplicationRef` instance once resolved. 36931 * 36932 * @publicApi 36933 */ 36934function bootstrapApplication(rootComponent, options) { 36935 return (0,_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵinternalCreateApplication"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({ 36936 rootComponent 36937 }, createProvidersConfig(options))); 36938} 36939/** 36940 * Create an instance of an Angular application without bootstrapping any components. This is useful 36941 * for the situation where one wants to decouple application environment creation (a platform and 36942 * associated injectors) from rendering components on a screen. Components can be subsequently 36943 * bootstrapped on the returned `ApplicationRef`. 36944 * 36945 * @param options Extra configuration for the application environment, see `ApplicationConfig` for 36946 * additional info. 36947 * @returns A promise that returns an `ApplicationRef` instance once resolved. 36948 * 36949 * @publicApi 36950 */ 36951function createApplication(options) { 36952 return (0,_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵinternalCreateApplication"])(createProvidersConfig(options)); 36953} 36954function createProvidersConfig(options) { 36955 var _options$providers; 36956 return { 36957 appProviders: [...BROWSER_MODULE_PROVIDERS, ...((_options$providers = options === null || options === void 0 ? void 0 : options.providers) !== null && _options$providers !== void 0 ? _options$providers : [])], 36958 platformProviders: INTERNAL_BROWSER_PLATFORM_PROVIDERS 36959 }; 36960} 36961/** 36962 * Returns a set of providers required to setup [Testability](api/core/Testability) for an 36963 * application bootstrapped using the `bootstrapApplication` function. The set of providers is 36964 * needed to support testing an application with Protractor (which relies on the Testability APIs 36965 * to be present). 36966 * 36967 * @returns An array of providers required to setup Testability for an application and make it 36968 * available for testing using Protractor. 36969 * 36970 * @publicApi 36971 */ 36972function provideProtractorTestingSupport() { 36973 // Return a copy to prevent changes to the original array in case any in-place 36974 // alterations are performed to the `provideProtractorTestingSupport` call results in app 36975 // code. 36976 return [...TESTABILITY_PROVIDERS]; 36977} 36978function initDomAdapter() { 36979 BrowserDomAdapter.makeCurrent(); 36980} 36981function errorHandler() { 36982 return new _angular_core__WEBPACK_IMPORTED_MODULE_4__.ErrorHandler(); 36983} 36984function _document() { 36985 // Tell ivy about the global document 36986 (0,_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵsetDocument"])(document); 36987 return document; 36988} 36989const INTERNAL_BROWSER_PLATFORM_PROVIDERS = [{ 36990 provide: _angular_core__WEBPACK_IMPORTED_MODULE_4__.PLATFORM_ID, 36991 useValue: _angular_common__WEBPACK_IMPORTED_MODULE_3__.PLATFORM_BROWSER_ID 36992}, { 36993 provide: _angular_core__WEBPACK_IMPORTED_MODULE_4__.PLATFORM_INITIALIZER, 36994 useValue: initDomAdapter, 36995 multi: true 36996}, { 36997 provide: _angular_common__WEBPACK_IMPORTED_MODULE_6__.DOCUMENT, 36998 useFactory: _document 36999}]; 37000/** 37001 * A factory function that returns a `PlatformRef` instance associated with browser service 37002 * providers. 37003 * 37004 * @publicApi 37005 */ 37006const platformBrowser = /*#__PURE__*/(0,_angular_core__WEBPACK_IMPORTED_MODULE_4__.createPlatformFactory)(_angular_core__WEBPACK_IMPORTED_MODULE_4__.platformCore, 'browser', INTERNAL_BROWSER_PLATFORM_PROVIDERS); 37007/** 37008 * Internal marker to signal whether providers from the `BrowserModule` are already present in DI. 37009 * This is needed to avoid loading `BrowserModule` providers twice. We can't rely on the 37010 * `BrowserModule` presence itself, since the standalone-based bootstrap just imports 37011 * `BrowserModule` providers without referencing the module itself. 37012 */ 37013const BROWSER_MODULE_PROVIDERS_MARKER = /*#__PURE__*/new _angular_core__WEBPACK_IMPORTED_MODULE_4__.InjectionToken(typeof ngDevMode === 'undefined' || ngDevMode ? 'BrowserModule Providers Marker' : ''); 37014const TESTABILITY_PROVIDERS = [{ 37015 provide: _angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵTESTABILITY_GETTER"], 37016 useClass: BrowserGetTestability 37017}, { 37018 provide: _angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵTESTABILITY"], 37019 useClass: _angular_core__WEBPACK_IMPORTED_MODULE_4__.Testability, 37020 deps: [_angular_core__WEBPACK_IMPORTED_MODULE_4__.NgZone, _angular_core__WEBPACK_IMPORTED_MODULE_4__.TestabilityRegistry, _angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵTESTABILITY_GETTER"]
37020] 37021}, { 37022 provide: _angular_core__WEBPACK_IMPORTED_MODULE_4__.Testability, 37023 // Also provide as `Testability` for backwards-compatibility. 37024 useClass: _angular_core__WEBPACK_IMPORTED_MODULE_4__.Testability, 37025 deps: [_angular_core__WEBPACK_IMPORTED_MODULE_4__.NgZone, _angular_core__WEBPACK_IMPORTED_MODULE_4__.TestabilityRegistry, _angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵTESTABILITY_GETTER"]] 37026}]; 37027const BROWSER_MODULE_PROVIDERS = [{ 37028 provide: _angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵINJECTOR_SCOPE"], 37029 useValue: 'root' 37030}, { 37031 provide: _angular_core__WEBPACK_IMPORTED_MODULE_4__.ErrorHandler, 37032 useFactory: errorHandler 37033}, { 37034 provide: _dom_renderer_DGKzginR_mjs__WEBPACK_IMPORTED_MODULE_5__.EVENT_MANAGER_PLUGINS, 37035 useClass: DomEventsPlugin, 37036 multi: true, 37037 deps: [_angular_common__WEBPACK_IMPORTED_MODULE_6__.DOCUMENT] 37038}, { 37039 provide: _dom_renderer_DGKzginR_mjs__WEBPACK_IMPORTED_MODULE_5__.EVENT_MANAGER_PLUGINS, 37040 useClass: KeyEventsPlugin, 37041 multi: true, 37042 deps: [_angular_common__WEBPACK_IMPORTED_MODULE_6__.DOCUMENT] 37043}, _dom_renderer_DGKzginR_mjs__WEBPACK_IMPORTED_MODULE_5__.DomRendererFactory2, _dom_renderer_DGKzginR_mjs__WEBPACK_IMPORTED_MODULE_5__.SharedStylesHost, _dom_renderer_DGKzginR_mjs__WEBPACK_IMPORTED_MODULE_5__.EventManager, { 37044 provide: _angular_core__WEBPACK_IMPORTED_MODULE_4__.RendererFactory2, 37045 useExisting: _dom_renderer_DGKzginR_mjs__WEBPACK_IMPORTED_MODULE_5__.DomRendererFactory2 37046}, { 37047 provide: _angular_common__WEBPACK_IMPORTED_MODULE_3__.XhrFactory, 37048 useClass: BrowserXhr 37049}, typeof ngDevMode === 'undefined' || ngDevMode ? { 37050 provide: BROWSER_MODULE_PROVIDERS_MARKER, 37051 useValue: true 37052} : []]; 37053/** 37054 * Exports required infrastructure for all Angular apps. 37055 * Included by default in all Angular apps created with the CLI 37056 * `new` command. 37057 * Re-exports `CommonModule` and `ApplicationModule`, making their 37058 * exports and providers available to all apps. 37059 * 37060 * @publicApi 37061 */ 37062let BrowserModule = /*#__PURE__*/(() => { 37063 var _BrowserModule; 37064 class BrowserModule { 37065 constructor() { 37066 if (typeof ngDevMode === 'undefined' || ngDevMode) { 37067 const providersAlreadyPresent = (0,_angular_core__WEBPACK_IMPORTED_MODULE_4__.inject)(BROWSER_MODULE_PROVIDERS_MARKER, { 37068 optional: true, 37069 skipSelf: true 37070 }); 37071 if (providersAlreadyPresent) { 37072 throw new _angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵRuntimeError"](5100 /* RuntimeErrorCode.BROWSER_MODULE_ALREADY_LOADED */, `Providers from the \`BrowserModule\` have already been loaded. If you need access ` + `to common directives such as NgIf and NgFor, import the \`CommonModule\` instead.`); 37073 } 37074 } 37075 } 37076 } 37077 _BrowserModule = BrowserModule; 37078 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(BrowserModule, "\u0275fac", function _BrowserModule_Factory(__ngFactoryType__) { 37079 return new (__ngFactoryType__ || _BrowserModule)(); 37080 }); 37081 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(BrowserModule, "\u0275mod", /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵɵdefineNgModule"]({ 37082 type: _BrowserModule 37083 })); 37084 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(BrowserModule, "\u0275inj", /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵɵdefineInjector"]({ 37085 providers: [...BROWSER_MODULE_PROVIDERS, ...TESTABILITY_PROVIDERS], 37086 imports: [_angular_common__WEBPACK_IMPORTED_MODULE_7__.CommonModule, _angular_core__WEBPACK_IMPORTED_MODULE_4__.ApplicationModule] 37087 })); 37088 return BrowserModule; 37089})(); 37090/*#__PURE__*/(() => { 37091 (typeof ngDevMode === "undefined" || ngDevMode) && void 0; 37092})(); 37093 37094//# sourceMappingURL=browser-D-u-fknz.mjs.map 37095 37096/***/ }), 37097 37098/***/ 49969: 37099/*!******************************************************************!*\ 37100 !*** ./node_modules/@angular/animations/fesm2022/animations.mjs ***! 37101 \******************************************************************/ 37102/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { 37103 37104__webpack_require__.r(__webpack_exports__); 37105/* harmony export */ __webpack_require__.d(__webpack_exports__, { 37106/* harmony export */ AUTO_STYLE: () => (/* reexport safe */ _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_1__.AUTO_STYLE), 37107/* harmony export */ AnimationBuilder: () => (/* binding */ AnimationBuilder), 37108/* harmony export */ AnimationFactory: () => (/* binding */ AnimationFactory), 37109/* harmony export */ AnimationMetadataType: () => (/* reexport safe */ _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_1__.AnimationMetadataType), 37110/* harmony export */ NoopAnimationPlayer: () => (/* reexport safe */ _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_1__.NoopAnimationPlayer), 37111/* harmony export */ animate: () => (/* reexport safe */ _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_1__.animate), 37112/* harmony export */ animateChild: () => (/* reexport safe */ _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_1__.animateChild), 37113/* harmony export */ animation: () => (/* reexport safe */ _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_1__.animation), 37114/* harmony export */ group: () => (/* reexport safe */ _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_1__.group), 37115/* harmony export */ keyframes: () => (/* reexport safe */ _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_1__.keyframes), 37116/* harmony export */ query: () => (/* reexport safe */ _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_1__.query), 37117/* harmony export */ sequence: () => (/* reexport safe */ _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_1__.sequence), 37118/* harmony export */ stagger: () => (/* reexport safe */ _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_1__.stagger), 37119/* harmony export */ state: () => (/* reexport safe */ _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_1__.state), 37120/* harmony export */ style: () => (/* reexport safe */ _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_1__.style), 37121/* harmony export */ transition: () => (/* reexport safe */ _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_1__.transition), 37122/* harmony export */ trigger: () => (/* reexport safe */ _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_1__.trigger), 37123/* harmony export */ useAnimation: () => (/* reexport safe */ _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_1__.useAnimation), 37124/* harmony export */ "ɵAnimationGroupPlayer": () => (/* reexport safe */ _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_1__.AnimationGroupPlayer), 37125/* harmony export */ "ɵBrowserAnimationBuilder": () => (/* binding */ BrowserAnimationBuilder), 37126/* harmony export */ "ɵPRE_STYLE": () => (/* reexport safe */ _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_1__["ɵPRE_STYLE"]) 37127/* harmony export */ }); 37128/* harmony import */ var C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/defineProperty.js */ 64467); 37129/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/common */ 59361); 37130/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/core */ 17705); 37131/* harmony import */ var _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./private_export-faY_wCkZ.mjs */ 60969); 37132 37133/** 37134 * @license Angular v19.2.14 37135 * (c) 2010-2025 Google LLC. https://angular.io/ 37136 * License: MIT 37137 */ 37138 37139 37140 37141 37142 37143 37144 37145/** 37146 * An injectable service that produces an animation sequence programmatically within an 37147 * Angular component or directive. 37148 * Provided by the `BrowserAnimationsModule` or `NoopAnimationsModule`. 37149 * 37150 * @usageNotes 37151 * 37152 * To use this service, add it to your component or directive as a dependency. 37153 * The service is instantiated along with your component. 37154 *
37155 * Apps do not typically need to create their own animation players, but if you 37156 * do need to, follow these steps: 37157 * 37158 * 1. Use the <code>[AnimationBuilder.build](api/animations/AnimationBuilder#build)()</code> method 37159 * to create a programmatic animation. The method returns an `AnimationFactory` instance. 37160 * 37161 * 2. Use the factory object to create an `AnimationPlayer` and attach it to a DOM element. 37162 * 37163 * 3. Use the player object to control the animation programmatically. 37164 * 37165 * For example: 37166 * 37167 * ```ts 37168 * // import the service from BrowserAnimationsModule 37169 * import {AnimationBuilder} from '@angular/animations'; 37170 * // require the service as a dependency 37171 * class MyCmp { 37172 * constructor(private _builder: AnimationBuilder) {} 37173 * 37174 * makeAnimation(element: any) { 37175 * // first define a reusable animation 37176 * const myAnimation = this._builder.build([ 37177 * style({ width: 0 }), 37178 * animate(1000, style({ width: '100px' })) 37179 * ]); 37180 * 37181 * // use the returned factory object to create a player 37182 * const player = myAnimation.create(element); 37183 * 37184 * player.play(); 37185 * } 37186 * } 37187 * ``` 37188 * 37189 * @publicApi 37190 */ 37191let AnimationBuilder = /*#__PURE__*/(() => { 37192 var _AnimationBuilder; 37193 class AnimationBuilder {} 37194 _AnimationBuilder = AnimationBuilder; 37195 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(AnimationBuilder, "\u0275fac", function _AnimationBuilder_Factory(__ngFactoryType__) { 37196 return new (__ngFactoryType__ || _AnimationBuilder)(); 37197 }); 37198 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(AnimationBuilder, "\u0275prov", /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineInjectable"]({ 37199 token: _AnimationBuilder, 37200 factory: () => (() => (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(BrowserAnimationBuilder))(), 37201 providedIn: 'root' 37202 })); 37203 return AnimationBuilder; 37204})(); 37205/*#__PURE__*/(() => { 37206 (typeof ngDevMode === "undefined" || ngDevMode) && void 0; 37207})(); 37208/** 37209 * A factory object returned from the 37210 * <code>[AnimationBuilder.build](api/animations/AnimationBuilder#build)()</code> 37211 * method. 37212 * 37213 * @publicApi 37214 */ 37215class AnimationFactory {} 37216let BrowserAnimationBuilder = /*#__PURE__*/(() => { 37217 var _BrowserAnimationBuilder; 37218 class BrowserAnimationBuilder extends AnimationBuilder { 37219 constructor(rootRenderer, doc) { 37220 super(); 37221 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "animationModuleType", (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_2__.ANIMATION_MODULE_TYPE, { 37222 optional: true 37223 })); 37224 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_nextAnimationId", 0); 37225 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_renderer", void 0); 37226 const typeData = { 37227 id: '0', 37228 encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_2__.ViewEncapsulation.None, 37229 styles: [], 37230 data: { 37231 animation: [] 37232 } 37233 }; 37234 this._renderer = rootRenderer.createRenderer(doc.body, typeData); 37235 if (this.animationModuleType === null && !isAnimationRenderer(this._renderer)) { 37236 // We only support AnimationRenderer & DynamicDelegationRenderer for this AnimationBuilder 37237 throw new _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵRuntimeError"](3600 /* RuntimeErrorCode.BROWSER_ANIMATION_BUILDER_INJECTED_WITHOUT_ANIMATIONS */, (typeof ngDevMode === 'undefined' || ngDevMode) && 'Angular detected that the `AnimationBuilder` was injected, but animation support was not enabled. ' + 'Please make sure that you enable animations in your application by calling `provideAnimations()` or `provideAnimationsAsync()` function.'); 37238 } 37239 } 37240 build(animation) { 37241 const id = this._nextAnimationId; 37242 this._nextAnimationId++; 37243 const entry = Array.isArray(animation) ? (0,_private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_1__.sequence)(animation) : animation; 37244 issueAnimationCommand(this._renderer, null, id, 'register', [entry]); 37245 return new BrowserAnimationFactory(id, this._renderer); 37246 } 37247 } 37248 _BrowserAnimationBuilder = BrowserAnimationBuilder; 37249 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(BrowserAnimationBuilder, "\u0275fac", function _BrowserAnimationBuilder_Factory(__ngFactoryType__) { 37250 return new (__ngFactoryType__ || _BrowserAnimationBuilder)(_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_2__.RendererFactory2), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵinject"](_angular_common__WEBPACK_IMPORTED_MODULE_3__.DOCUMENT)); 37251 }); 37252 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(BrowserAnimationBuilder, "\u0275prov", /* @__P
37252URE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineInjectable"]({ 37253 token: _BrowserAnimationBuilder, 37254 factory: _BrowserAnimationBuilder.ɵfac, 37255 providedIn: 'root' 37256 })); 37257 return BrowserAnimationBuilder; 37258})(); 37259/*#__PURE__*/(() => { 37260 (typeof ngDevMode === "undefined" || ngDevMode) && void 0; 37261})(); 37262class BrowserAnimationFactory extends AnimationFactory { 37263 constructor(_id, _renderer) { 37264 super(); 37265 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_id", void 0); 37266 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_renderer", void 0); 37267 this._id = _id; 37268 this._renderer = _renderer; 37269 } 37270 create(element, options) { 37271 return new RendererAnimationPlayer(this._id, element, options || {}, this._renderer); 37272 } 37273} 37274class RendererAnimationPlayer { 37275 constructor(id, element, options, _renderer) { 37276 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "id", void 0); 37277 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "element", void 0); 37278 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_renderer", void 0); 37279 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "parentPlayer", null); 37280 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_started", false); 37281 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "totalTime", 0); 37282 this.id = id; 37283 this.element = element; 37284 this._renderer = _renderer; 37285 this._command('create', options); 37286 } 37287 _listen(eventName, callback) { 37288 return this._renderer.listen(this.element, `@@${this.id}:${eventName}`, callback); 37289 } 37290 _command(command, ...args) { 37291 issueAnimationCommand(this._renderer, this.element, this.id, command, args); 37292 } 37293 onDone(fn) { 37294 this._listen('done', fn); 37295 } 37296 onStart(fn) { 37297 this._listen('start', fn); 37298 } 37299 onDestroy(fn) { 37300 this._listen('destroy', fn); 37301 } 37302 init() { 37303 this._command('init'); 37304 } 37305 hasStarted() { 37306 return this._started; 37307 } 37308 play() { 37309 this._command('play'); 37310 this._started = true; 37311 } 37312 pause() { 37313 this._command('pause'); 37314 } 37315 restart() { 37316 this._command('restart'); 37317 } 37318 finish() { 37319 this._command('finish'); 37320 } 37321 destroy() { 37322 this._command('destroy'); 37323 } 37324 reset() { 37325 this._command('reset'); 37326 this._started = false; 37327 } 37328 setPosition(p) { 37329 this._command('setPosition', p); 37330 } 37331 getPosition() { 37332 var _unwrapAnimationRende, _unwrapAnimationRende2; 37333 return (_unwrapAnimationRende = (_unwrapAnimationRende2 = unwrapAnimationRenderer(this._renderer)) === null || _unwrapAnimationRende2 === void 0 || (_unwrapAnimationRende2 = _unwrapAnimationRende2.engine) === null || _unwrapAnimationRende2 === void 0 || (_unwrapAnimationRende2 = _unwrapAnimationRende2.players[this.id]) === null || _unwrapAnimationRende2 === void 0 ? void 0 : _unwrapAnimationRende2.getPosition()) !== null && _unwrapAnimationRende !== void 0 ? _unwrapAnimationRende : 0; 37334 } 37335} 37336function issueAnimationCommand(renderer, element, id, command, args) { 37337 renderer.setProperty(element, `@@${id}:${command}`, args); 37338} 37339/** 37340 * The following 2 methods cannot reference their correct types (AnimationRenderer & 37341 * DynamicDelegationRenderer) since this would introduce a import cycle. 37342 */ 37343function unwrapAnimationRenderer(renderer) { 37344 const type = renderer.ɵtype; 37345 if (type === 0 /* AnimationRendererType.Regular */) { 37346 return renderer; 37347 } else if (type === 1 /* AnimationRendererType.Delegated */) { 37348 return renderer.animationRenderer; 37349 } 37350 return null; 37351} 37352function isAnimationRenderer(renderer) { 37353 const type = renderer.ɵtype; 37354 return type === 0 /* AnimationRendererType.Regular */ || type === 1 /* AnimationRendererType.Delegated */; 37355} 37356 37357//# sourceMappingURL=animations.mjs.map 37358 37359/***/ }), 37360 37361/***/ 50763: 37362/*!*************************************************************************!*\ 37363 !*** ./node_modules/@angular/cdk/fesm2022/css-pixel-value-C_HEqLhI.mjs ***! 37364 \*************************************************************************/ 37365/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { 37366 37367__webpack_require__.r(__webpack_exports__); 37368/* harmony export */ __webpack_require__.d(__webpack_exports__, { 37369/* harmony export */ c: () => (/* binding */ coerceCssPixelValue) 37370/* harmony export */ }); 37371/** Coerces a value to a CSS pixel value. */ 37372function coerceCssPixelValue(value) { 37373 if (value == null) { 37374 return ''; 37375 } 37376 return typeof value === 'string' ? value : `${value}px`; 37377} 37378 37379//# sourceMappingURL=css-pixel-value-C_HEqLhI.mjs.map 37380 37381/***/ }), 37382 37383/***/ 52476:
37384/*!******************************************************************************!*\ 37385 !*** ./node_modules/@angular/cdk/fesm2022/breakpoints-observer-CljOfYGy.mjs ***! 37386 \******************************************************************************/ 37387/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { 37388 37389__webpack_require__.r(__webpack_exports__); 37390/* harmony export */ __webpack_require__.d(__webpack_exports__, { 37391/* harmony export */ B: () => (/* binding */ BreakpointObserver), 37392/* harmony export */ M: () => (/* binding */ MediaMatcher) 37393/* harmony export */ }); 37394/* harmony import */ var C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/defineProperty.js */ 64467); 37395/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ 17705); 37396/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rxjs */ 45286); 37397/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! rxjs */ 49776); 37398/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! rxjs */ 20708); 37399/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! rxjs */ 27389); 37400/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! rxjs/operators */ 19493); 37401/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! rxjs/operators */ 17753); 37402/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! rxjs/operators */ 63020); 37403/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! rxjs/operators */ 95006); 37404/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! rxjs/operators */ 23176); 37405/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! rxjs/operators */ 7605); 37406/* harmony import */ var _platform_DmdVEw_C_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./platform-DmdVEw_C.mjs */ 99536); 37407/* harmony import */ var _array_I1yfCXUO_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./array-I1yfCXUO.mjs */ 41959); 37408 37409 37410 37411 37412 37413 37414 37415 37416/** Global registry for all dynamically-created, injected media queries. */ 37417const mediaQueriesForWebkitCompatibility = /*#__PURE__*/new Set(); 37418/** Style tag that holds all of the dynamically-created media queries. */ 37419let mediaQueryStyleNode; 37420/** A utility for calling matchMedia queries. */ 37421let MediaMatcher = /*#__PURE__*/(() => { 37422 var _MediaMatcher; 37423 class MediaMatcher { 37424 constructor() { 37425 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_platform", (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.inject)(_platform_DmdVEw_C_mjs__WEBPACK_IMPORTED_MODULE_2__.P)); 37426 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_nonce", (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_1__.CSP_NONCE, { 37427 optional: true 37428 })); 37429 /** The internal matchMedia method to return back a MediaQueryList like object. */ 37430 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_matchMedia", void 0); 37431 this._matchMedia = this._platform.isBrowser && window.matchMedia ? 37432 // matchMedia is bound to the window scope intentionally as it is an illegal invocation to 37433 // call it from a different scope. 37434 window.matchMedia.bind(window) : noopMatchMedia; 37435 } 37436 /** 37437 * Evaluates the given media query and returns the native MediaQueryList from which results 37438 * can be retrieved. 37439 * Confirms the layout engine will trigger for the selector query provided and returns the 37440 * MediaQueryList for the query provided. 37441 */ 37442 matchMedia(query) { 37443 if (this._platform.WEBKIT || this._platform.BLINK) { 37444 createEmptyStyleRule(query, this._nonce); 37445 } 37446 return this._matchMedia(query); 37447 } 37448 } 37449 _MediaMatcher = MediaMatcher; 37450 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(MediaMatcher, "\u0275fac", function _MediaMatcher_Factory(__ngFactoryType__) { 37451 return new (__ngFactoryType__ || _MediaMatcher)(); 37452 }); 37453 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(MediaMatcher, "\u0275prov", /* @__P
37453URE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ 37454 token: _MediaMatcher, 37455 factory: _MediaMatcher.ɵfac, 37456 providedIn: 'root' 37457 })); 37458 return MediaMatcher; 37459})(); 37460/*#__PURE__*/(() => { 37461 (typeof ngDevMode === "undefined" || ngDevMode) && void 0; 37462})(); 37463/** 37464 * Creates an empty stylesheet that is used to work around browser inconsistencies related to 37465 * `matchMedia`. At the time of writing, it handles the following cases: 37466 * 1. On WebKit browsers, a media query has to have at least one rule in order for `matchMedia` 37467 * to fire. We work around it by declaring a dummy stylesheet with a `@media` declaration. 37468 * 2. In some cases Blink browsers will stop firing the `matchMedia` listener if none of the rules 37469 * inside the `@media` match existing elements on the page. We work around it by having one rule 37470 * targeting the `body`. See https://github.com/angular/components/issues/23546. 37471 */ 37472function createEmptyStyleRule(query, nonce) { 37473 if (mediaQueriesForWebkitCompatibility.has(query)) { 37474 return; 37475 } 37476 try { 37477 if (!mediaQueryStyleNode) { 37478 mediaQueryStyleNode = document.createElement('style'); 37479 if (nonce) { 37480 mediaQueryStyleNode.setAttribute('nonce', nonce); 37481 } 37482 mediaQueryStyleNode.setAttribute('type', 'text/css'); 37483 document.head.appendChild(mediaQueryStyleNode); 37484 } 37485 if (mediaQueryStyleNode.sheet) { 37486 mediaQueryStyleNode.sheet.insertRule(`@media ${query} {body{ }}`, 0); 37487 mediaQueriesForWebkitCompatibility.add(query); 37488 } 37489 } catch (e) { 37490 console.error(e); 37491 } 37492} 37493/** No-op matchMedia replacement for non-browser platforms. */ 37494function noopMatchMedia(query) { 37495 // Use `as any` here to avoid adding additional necessary properties for 37496 // the noop matcher. 37497 return { 37498 matches: query === 'all' || query === '', 37499 media: query, 37500 addListener: () => {}, 37501 removeListener: () => {} 37502 }; 37503} 37504 37505/** Utility for checking the matching state of `@media` queries. */ 37506let BreakpointObserver = /*#__PURE__*/(() => { 37507 var _BreakpointObserver; 37508 class BreakpointObserver { 37509 constructor() { 37510 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_mediaMatcher", (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.inject)(MediaMatcher)); 37511 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_zone", (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_1__.NgZone)); 37512 /** A map of all media queries currently being listened for. */ 37513 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_queries", new Map()); 37514 /** A subject for all other observables to takeUntil based on. */ 37515 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_destroySubject", new rxjs__WEBPACK_IMPORTED_MODULE_3__.Subject()); 37516 } 37517 /** Completes the active subject, signalling to all other observables to complete. */ 37518 ngOnDestroy() { 37519 this._destroySubject.next(); 37520 this._destroySubject.complete(); 37521 } 37522 /** 37523 * Whether one or more media queries match the current viewport size. 37524 * @param value One or more media queries to check. 37525 * @returns Whether any of the media queries match. 37526 */ 37527 isMatched(value) { 37528 const queries = splitQueries((0,_array_I1yfCXUO_mjs__WEBPACK_IMPORTED_MODULE_4__.c)(value)); 37529 return queries.some(mediaQuery => this._registerQuery(mediaQuery).mql.matches); 37530 } 37531 /** 37532 * Gets an observable of results for the given queries that will emit new results for any changes 37533 * in matching of the given queries. 37534 * @param value One or more media queries to check. 37535 * @returns A stream of matches for the given queries. 37536 */ 37537 observe(value) { 37538 const queries = splitQueries((0,_array_I1yfCXUO_mjs__WEBPACK_IMPORTED_MODULE_4__.c)(value)); 37539 const observables = queries.map(query => this._registerQuery(query).observable); 37540 let stateObservable = (0,rxjs__WEBPACK_IMPORTED_MODULE_5__.combineLatest)(observables); 37541 // Emit the first state immediately, and then debounce the subsequent emissions. 37542 stateObservable = (0,rxjs__WEBPACK_IMPORTED_MODULE_6__.concat)(stateObservable.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_7__.take)(1)), stateObservable.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_8__.skip)(1), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_9__.debounceTime)(0))); 37543 return stateObservable.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_10__.map)(breakpointStates => { 37544 const response = { 37545 matches: false, 37546 breakpoints: {} 37547 };
37548 breakpointStates.forEach(({ 37549 matches, 37550 query 37551 }) => { 37552 response.matches = response.matches || matches; 37553 response.breakpoints[query] = matches; 37554 }); 37555 return response; 37556 })); 37557 } 37558 /** Registers a specific query to be listened for. */ 37559 _registerQuery(query) { 37560 // Only set up a new MediaQueryList if it is not already being listened for. 37561 if (this._queries.has(query)) { 37562 return this._queries.get(query); 37563 } 37564 const mql = this._mediaMatcher.matchMedia(query); 37565 // Create callback for match changes and add it is as a listener. 37566 const queryObservable = new rxjs__WEBPACK_IMPORTED_MODULE_11__.Observable(observer => { 37567 // Listener callback methods are wrapped to be placed back in ngZone. Callbacks must be placed 37568 // back into the zone because matchMedia is only included in Zone.js by loading the 37569 // webapis-media-query.js file alongside the zone.js file. Additionally, some browsers do not 37570 // have MediaQueryList inherit from EventTarget, which causes inconsistencies in how Zone.js 37571 // patches it. 37572 const handler = e => this._zone.run(() => observer.next(e)); 37573 mql.addListener(handler); 37574 return () => { 37575 mql.removeListener(handler); 37576 }; 37577 }).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_12__.startWith)(mql), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_10__.map)(({ 37578 matches 37579 }) => ({ 37580 query, 37581 matches 37582 })), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_13__.takeUntil)(this._destroySubject)); 37583 // Add the MediaQueryList to the set of queries. 37584 const output = { 37585 observable: queryObservable, 37586 mql 37587 }; 37588 this._queries.set(query, output); 37589 return output; 37590 } 37591 } 37592 _BreakpointObserver = BreakpointObserver; 37593 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(BreakpointObserver, "\u0275fac", function _BreakpointObserver_Factory(__ngFactoryType__) { 37594 return new (__ngFactoryType__ || _BreakpointObserver)(); 37595 }); 37596 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(BreakpointObserver, "\u0275prov", /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ 37597 token: _BreakpointObserver, 37598 factory: _BreakpointObserver.ɵfac, 37599 providedIn: 'root' 37600 })); 37601 return BreakpointObserver; 37602})(); 37603/*#__PURE__*/(() => { 37604 (typeof ngDevMode === "undefined" || ngDevMode) && void 0; 37605})(); 37606/** 37607 * Split each query string into separate query strings if two queries are provided as comma 37608 * separated. 37609 */ 37610function splitQueries(queries) { 37611 return queries.map(query => query.split(',')).reduce((a1, a2) => a1.concat(a2)).map(query => query.trim()); 37612} 37613 37614//# sourceMappingURL=breakpoints-observer-CljOfYGy.mjs.map 37615 37616/***/ }), 37617 37618/***/ 60969: 37619/*!*******************************************************************************!*\ 37620 !*** ./node_modules/@angular/animations/fesm2022/private_export-faY_wCkZ.mjs ***! 37621 \*******************************************************************************/ 37622/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { 37623 37624__webpack_require__.r(__webpack_exports__); 37625/* harmony export */ __webpack_require__.d(__webpack_exports__, { 37626/* harmony export */ AUTO_STYLE: () => (/* binding */ AUTO_STYLE), 37627/* harmony export */ AnimationGroupPlayer: () => (/* binding */ AnimationGroupPlayer), 37628/* harmony export */ AnimationMetadataType: () => (/* binding */ AnimationMetadataType), 37629/* harmony export */ NoopAnimationPlayer: () => (/* binding */ NoopAnimationPlayer), 37630/* harmony export */ animate: () => (/* binding */ animate), 37631/* harmony export */ animateChild: () => (/* binding */ animateChild), 37632/* harmony export */ animation: () => (/* binding */ animation), 37633/* harmony export */ group: () => (/* binding */ group), 37634/* harmony export */ keyframes: () => (/* binding */ keyframes), 37635/* harmony export */ query: () => (/* binding */ query), 37636/* harmony export */ sequence: () => (/* binding */ sequence), 37637/* harmony export */ stagger: () => (/* binding */ stagger), 37638/* harmony export */ state: () => (/* binding */ state), 37639/* harmony export */ style: () => (/* binding */ style), 37640/* harmony export */ transition: () => (/* binding */ transition), 37641/* harmony export */ trigger: () => (/* binding */ trigger), 37642/* harmony export */ useAnimation: () => (/* binding */ useAnimation), 37643/* harmony export */ "ɵPRE_STYLE": () => (/* binding */ ɵPRE_STYLE) 37644/* harmony export */ }); 37645/* harmony import */ var C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/defineProperty.js */ 64467); 37646 37647/** 37648 * @license Angular v19.2.14 37649 * (c) 2010-2025 Google LLC. https://angular.io/ 37650 * License: MIT 37651 */ 37652 37653/** 37654 * @description Constants for the categories of parameters that can be defined for animations. 37655 * 37656 * A corresponding function defines a set of parameters for each category, and 37657 * collects them into a corresponding `AnimationMetadata` object. 37658 * 37659 * @publicApi 37660 */ 37661var AnimationMetadataType = /*#__PURE__*/function (AnimationMetadataType) { 37662 /** 37663 * Associates a named animation state with a set of CSS styles. 37664 * See [`state()`](api/animations/state) 37665 */ 37666 AnimationMetadataType[AnimationMetadataType["State"] = 0] = "State"; 37667 /** 37668 * Data for a transition from one animation state to another. 37669 * See `transition()` 37670 */ 37671 AnimationMetadataType[AnimationMetadataType["Transition"] = 1] = "Transition"; 37672 /** 37673 * Contains a set of animation steps. 37674 * See `sequence()` 37675 */ 37676 AnimationMetadataType[AnimationMetadataType["Sequence"] = 2] = "Sequence"; 37677 /** 37678 * Contains a set of animation steps. 37679 * See `group()` 37680 */ 37681 AnimationMetadataType[AnimationMetadataType["Group"] = 3] = "Group"; 37682 /** 37683 * Contains an animation step. 37684 * See `animate()` 37685 */ 37686 AnimationMetadataType[AnimationMetadataType["Animate"] = 4] = "Animate"; 37687 /** 37688 * Contains a set of animation steps. 37689 * See `keyframes()` 37690 */ 37691 AnimationMetadataType[AnimationMetadataType["Keyframes"] = 5] = "Keyframes"; 37692 /** 37693 * Contains a set of CSS property-value pairs into a named style. 37694 * See `style()` 37695 */ 37696 AnimationMetadataType[AnimationMetadataType["Style"] = 6] = "Style"; 37697 /** 37698 * Associates an animation with an entry trigger that can be attached to an element. 37699 * See `trigger()` 37700 */ 37701 AnimationMetadataType[AnimationMetadataType["Trigger"] = 7] = "Trigger"; 37702 /** 37703 * Contains a re-usable animation. 37704 * See `animation()` 37705 */ 37706 AnimationMetadataType[AnimationMetadataType["Reference"] = 8] = "Reference"; 37707 /** 37708 * Contains data to use in executing child animations returned by a query. 37709 * See `animateChild()` 37710 */ 37711 AnimationMetadataType[AnimationMetadataType["AnimateChild"] = 9] = "AnimateChild"; 37712 /** 37713 * Contains animation parameters for a re-usable animation. 37714 * See `useAnimation()` 37715 */ 37716 AnimationMetadataType[AnimationMetadataType["AnimateRef"] = 10] = "AnimateRef"; 37717 /** 37718 * Contains child-animation query data. 37719 * See `query()` 37720 */ 37721 AnimationMetadataType[AnimationMetadataType["Query"] = 11] = "Query"; 37722 /** 37723 * Contains data for staggering an animation sequence. 37724 * See `stagger()` 37725 */ 37726 AnimationMetadataType[AnimationMetadataType["Stagger"] = 12] = "Stagger"; 37727 return AnimationMetadataType; 37728}(AnimationMetadataType || {}); 37729/** 37730 * Specifies automatic styling. 37731 * 37732 * @publicApi 37733 */ 37734const AUTO_STYLE = '*'; 37735/**
37736 * Creates a named animation trigger, containing a list of [`state()`](api/animations/state) 37737 * and `transition()` entries to be evaluated when the expression 37738 * bound to the trigger changes. 37739 * 37740 * @param name An identifying string. 37741 * @param definitions An animation definition object, containing an array of 37742 * [`state()`](api/animations/state) and `transition()` declarations. 37743 * 37744 * @return An object that encapsulates the trigger data. 37745 * 37746 * @usageNotes 37747 * Define an animation trigger in the `animations` section of `@Component` metadata. 37748 * In the template, reference the trigger by name and bind it to a trigger expression that 37749 * evaluates to a defined animation state, using the following format: 37750 * 37751 * `[@triggerName]="expression"` 37752 * 37753 * Animation trigger bindings convert all values to strings, and then match the 37754 * previous and current values against any linked transitions. 37755 * Booleans can be specified as `1` or `true` and `0` or `false`. 37756 * 37757 * ### Usage Example 37758 * 37759 * The following example creates an animation trigger reference based on the provided 37760 * name value. 37761 * The provided animation value is expected to be an array consisting of state and 37762 * transition declarations. 37763 * 37764 * ```ts 37765 * @Component({ 37766 * selector: "my-component", 37767 * templateUrl: "my-component-tpl.html", 37768 * animations: [ 37769 * trigger("myAnimationTrigger", [ 37770 * state(...), 37771 * state(...), 37772 * transition(...), 37773 * transition(...) 37774 * ]) 37775 * ] 37776 * }) 37777 * class MyComponent { 37778 * myStatusExp = "something"; 37779 * } 37780 * ``` 37781 * 37782 * The template associated with this component makes use of the defined trigger 37783 * by binding to an element within its template code. 37784 * 37785 * ```html 37786 * <!-- somewhere inside of my-component-tpl.html --> 37787 * <div [@myAnimationTrigger]="myStatusExp">...</div> 37788 * ``` 37789 * 37790 * ### Using an inline function 37791 * The `transition` animation method also supports reading an inline function which can decide 37792 * if its associated animation should be run. 37793 * 37794 * ```ts 37795 * // this method is run each time the `myAnimationTrigger` trigger value changes. 37796 * function myInlineMatcherFn(fromState: string, toState: string, element: any, params: {[key: 37797 string]: any}): boolean { 37798 * // notice that `element` and `params` are also available here 37799 * return toState == 'yes-please-animate'; 37800 * } 37801 * 37802 * @Component({ 37803 * selector: 'my-component', 37804 * templateUrl: 'my-component-tpl.html', 37805 * animations: [ 37806 * trigger('myAnimationTrigger', [ 37807 * transition(myInlineMatcherFn, [ 37808 * // the animation sequence code 37809 * ]), 37810 * ]) 37811 * ] 37812 * }) 37813 * class MyComponent { 37814 * myStatusExp = "yes-please-animate"; 37815 * } 37816 * ``` 37817 * 37818 * ### Disabling Animations 37819 * When true, the special animation control binding `@.disabled` binding prevents 37820 * all animations from rendering. 37821 * Place the `@.disabled` binding on an element to disable 37822 * animations on the element itself, as well as any inner animation triggers 37823 * within the element. 37824 * 37825 * The following example shows how to use this feature: 37826 * 37827 * ```angular-ts 37828 * @Component({ 37829 * selector: 'my-component', 37830 * template: ` 37831 * <div [@.disabled]="isDisabled"> 37832 * <div [@childAnimation]="exp"></div> 37833 * </div> 37834 * `, 37835 * animations: [ 37836 * trigger("childAnimation", [ 37837 * // ... 37838 * ]) 37839 * ] 37840 * }) 37841 * class MyComponent { 37842 * isDisabled = true; 37843 * exp = '...'; 37844 * } 37845 * ``` 37846 * 37847 * When `@.disabled` is true, it prevents the `@childAnimation` trigger from animating, 37848 * along with any inner animations. 37849 * 37850 * ### Disable animations application-wide 37851 * When an area of the template is set to have animations disabled, 37852 * **all** inner components have their animations disabled as well. 37853 * This means that you can disable all animations for an app 37854 * by placing a host binding set on `@.disabled` on the topmost Angular component. 37855 * 37856 * ```ts 37857 * import {Component, HostBinding} from '@angular/core'; 37858 * 37859 * @Component({ 37860 * selector: 'app-component', 37861 * templateUrl: 'app.component.html', 37862 * }) 37863 * class AppComponent { 37864 * @HostBinding('@.disabled') 37865 * public animationsDisabled = true; 37866 * } 37867 * ``` 37868 * 37869 * ### Overriding disablement of inner animations 37870 * Despite inner animations being disabled, a parent animation can `query()` 37871 * for inner elements located in disabled areas of the template and still animate 37872 * them if needed. This is also the case for when a sub animation is 37873 * queried by a parent and then later animated using `animateChild()`. 37874 * 37875 * ### Detecting when an animation is disabled
37876 * If a region of the DOM (or the entire application) has its animations disabled, the animation 37877 * trigger callbacks still fire, but for zero seconds. When the callback fires, it provides 37878 * an instance of an `AnimationEvent`. If animations are disabled, 37879 * the `.disabled` flag on the event is true. 37880 * 37881 * @publicApi 37882 */ 37883function trigger(name, definitions) { 37884 return { 37885 type: AnimationMetadataType.Trigger, 37886 name, 37887 definitions, 37888 options: {} 37889 }; 37890} 37891/** 37892 * Defines an animation step that combines styling information with timing information. 37893 * 37894 * @param timings Sets `AnimateTimings` for the parent animation. 37895 * A string in the format "duration [delay] [easing]". 37896 * - Duration and delay are expressed as a number and optional time unit, 37897 * such as "1s" or "10ms" for one second and 10 milliseconds, respectively. 37898 * The default unit is milliseconds. 37899 * - The easing value controls how the animation accelerates and decelerates 37900 * during its runtime. Value is one of `ease`, `ease-in`, `ease-out`, 37901 * `ease-in-out`, or a `cubic-bezier()` function call. 37902 * If not supplied, no easing is applied. 37903 * 37904 * For example, the string "1s 100ms ease-out" specifies a duration of 37905 * 1000 milliseconds, and delay of 100 ms, and the "ease-out" easing style, 37906 * which decelerates near the end of the duration. 37907 * @param styles Sets AnimationStyles for the parent animation. 37908 * A function call to either `style()` or `keyframes()` 37909 * that returns a collection of CSS style entries to be applied to the parent animation. 37910 * When null, uses the styles from the destination state. 37911 * This is useful when describing an animation step that will complete an animation; 37912 * see "Animating to the final state" in `transitions()`. 37913 * @returns An object that encapsulates the animation step. 37914 * 37915 * @usageNotes 37916 * Call within an animation `sequence()`, {@link /api/animations/group group()}, or 37917 * `transition()` call to specify an animation step 37918 * that applies given style data to the parent animation for a given amount of time. 37919 * 37920 * ### Syntax Examples 37921 * **Timing examples** 37922 * 37923 * The following examples show various `timings` specifications. 37924 * - `animate(500)` : Duration is 500 milliseconds. 37925 * - `animate("1s")` : Duration is 1000 milliseconds. 37926 * - `animate("100ms 0.5s")` : Duration is 100 milliseconds, delay is 500 milliseconds. 37927 * - `animate("5s ease-in")` : Duration is 5000 milliseconds, easing in. 37928 * - `animate("5s 10ms cubic-bezier(.17,.67,.88,.1)")` : Duration is 5000 milliseconds, delay is 10 37929 * milliseconds, easing according to a bezier curve. 37930 * 37931 * **Style examples** 37932 * 37933 * The following example calls `style()` to set a single CSS style. 37934 * ```ts 37935 * animate(500, style({ background: "red" })) 37936 * ``` 37937 * The following example calls `keyframes()` to set a CSS style 37938 * to different values for successive keyframes. 37939 * ```ts 37940 * animate(500, keyframes( 37941 * [ 37942 * style({ background: "blue" }), 37943 * style({ background: "red" }) 37944 * ]) 37945 * ``` 37946 * 37947 * @publicApi 37948 */ 37949function animate(timings, styles = null) { 37950 return { 37951 type: AnimationMetadataType.Animate, 37952 styles, 37953 timings 37954 }; 37955} 37956/** 37957 * @description Defines a list of animation steps to be run in parallel. 37958 * 37959 * @param steps An array of animation step objects. 37960 * - When steps are defined by `style()` or `animate()` 37961 * function calls, each call within the group is executed instantly. 37962 * - To specify offset styles to be applied at a later time, define steps with 37963 * `keyframes()`, or use `animate()` calls with a delay value. 37964 * For example: 37965 * 37966 * ```ts 37967 * group([ 37968 * animate("1s", style({ background: "black" })), 37969 * animate("2s", style({ color: "white" })) 37970 * ]) 37971 * ``` 37972 * 37973 * @param options An options object containing a delay and 37974 * developer-defined parameters that provide styling defaults and 37975 * can be overridden on invocation. 37976 * 37977 * @return An object that encapsulates the group data. 37978 * 37979 * @usageNotes 37980 * Grouped animations are useful when a series of styles must be 37981 * animated at different starting times and closed off at different ending times. 37982 * 37983 * When called within a `sequence()` or a 37984 * `transition()` call, does not continue to the next 37985 * instruction until all of the inner animation steps have completed. 37986 * 37987 * @publicApi 37988 */ 37989function group(steps, options = null) { 37990 return { 37991 type: AnimationMetadataType.Group, 37992 steps, 37993 options 37994 }; 37995} 37996/** 37997 * Defines a list of animation steps to be run sequentially, one by one. 37998 * 37999 * @param steps An array of animation step objects. 38000 * - Steps defined by `style()` calls apply the styling data immediately. 38001 * - Steps defined by `animate()` calls apply the styling data over time 38002 * as specified by the timing data. 38003 * 38004 * ```ts 38005 * sequence([
38006 * style({ opacity: 0 }), 38007 * animate("1s", style({ opacity: 1 })) 38008 * ]) 38009 * ``` 38010 * 38011 * @param options An options object containing a delay and 38012 * developer-defined parameters that provide styling defaults and 38013 * can be overridden on invocation. 38014 * 38015 * @return An object that encapsulates the sequence data. 38016 * 38017 * @usageNotes 38018 * When you pass an array of steps to a 38019 * `transition()` call, the steps run sequentially by default. 38020 * Compare this to the {@link /api/animations/group group()} call, which runs animation steps in 38021 *parallel. 38022 * 38023 * When a sequence is used within a {@link /api/animations/group group()} or a `transition()` call, 38024 * execution continues to the next instruction only after each of the inner animation 38025 * steps have completed. 38026 * 38027 * @publicApi 38028 **/ 38029function sequence(steps, options = null) { 38030 return { 38031 type: AnimationMetadataType.Sequence, 38032 steps, 38033 options 38034 }; 38035} 38036/** 38037 * Declares a key/value object containing CSS properties/styles that 38038 * can then be used for an animation [`state`](api/animations/state), within an animation 38039 *`sequence`, or as styling data for calls to `animate()` and `keyframes()`. 38040 * 38041 * @param tokens A set of CSS styles or HTML styles associated with an animation state. 38042 * The value can be any of the following: 38043 * - A key-value style pair associating a CSS property with a value. 38044 * - An array of key-value style pairs. 38045 * - An asterisk (*), to use auto-styling, where styles are derived from the element 38046 * being animated and applied to the animation when it starts. 38047 * 38048 * Auto-styling can be used to define a state that depends on layout or other 38049 * environmental factors. 38050 * 38051 * @return An object that encapsulates the style data. 38052 * 38053 * @usageNotes 38054 * The following examples create animation styles that collect a set of 38055 * CSS property values: 38056 * 38057 * ```ts 38058 * // string values for CSS properties 38059 * style({ background: "red", color: "blue" }) 38060 * 38061 * // numerical pixel values 38062 * style({ width: 100, height: 0 }) 38063 * ``` 38064 * 38065 * The following example uses auto-styling to allow an element to animate from 38066 * a height of 0 up to its full height: 38067 * 38068 * ```ts 38069 * style({ height: 0 }), 38070 * animate("1s", style({ height: "*" })) 38071 * ``` 38072 * 38073 * @publicApi 38074 **/ 38075function style(tokens) { 38076 return { 38077 type: AnimationMetadataType.Style, 38078 styles: tokens, 38079 offset: null 38080 }; 38081} 38082/** 38083 * Declares an animation state within a trigger attached to an element. 38084 * 38085 * @param name One or more names for the defined state in a comma-separated string. 38086 * The following reserved state names can be supplied to define a style for specific use 38087 * cases: 38088 * 38089 * - `void` You can associate styles with this name to be used when 38090 * the element is detached from the application. For example, when an `ngIf` evaluates 38091 * to false, the state of the associated element is void. 38092 * - `*` (asterisk) Indicates the default state. You can associate styles with this name 38093 * to be used as the fallback when the state that is being animated is not declared 38094 * within the trigger. 38095 * 38096 * @param styles A set of CSS styles associated with this state, created using the 38097 * `style()` function. 38098 * This set of styles persists on the element once the state has been reached. 38099 * @param options Parameters that can be passed to the state when it is invoked. 38100 * 0 or more key-value pairs. 38101 * @return An object that encapsulates the new state data. 38102 * 38103 * @usageNotes 38104 * Use the `trigger()` function to register states to an animation trigger. 38105 * Use the `transition()` function to animate between states. 38106 * When a state is active within a component, its associated styles persist on the element, 38107 * even when the animation ends. 38108 * 38109 * @publicApi 38110 **/ 38111function state(name, styles, options) { 38112 return { 38113 type: AnimationMetadataType.State, 38114 name, 38115 styles, 38116 options 38117 }; 38118} 38119/** 38120 * Defines a set of animation styles, associating each style with an optional `offset` value. 38121 * 38122 * @param steps A set of animation styles with optional offset data. 38123 * The optional `offset` value for a style specifies a percentage of the total animation 38124 * time at which that style is applied. 38125 * @returns An object that encapsulates the keyframes data. 38126 * 38127 * @usageNotes 38128 * Use with the `animate()` call. Instead of applying animations 38129 * from the current state 38130 * to the destination state, keyframes describe how each style entry is a
38130pplied and at what point 38131 * within the animation arc. 38132 * Compare [CSS Keyframe Animations](https://www.w3schools.com/css/css3_animations.asp). 38133 * 38134 * ### Usage 38135 * 38136 * In the following example, the offset values describe 38137 * when each `backgroundColor` value is applied. The color is red at the start, and changes to 38138 * blue when 20% of the total time has elapsed. 38139 * 38140 * ```ts 38141 * // the provided offset values 38142 * animate("5s", keyframes([ 38143 * style({ backgroundColor: "red", offset: 0 }), 38144 * style({ backgroundColor: "blue", offset: 0.2 }), 38145 * style({ backgroundColor: "orange", offset: 0.3 }), 38146 * style({ backgroundColor: "black", offset: 1 }) 38147 * ])) 38148 * ``` 38149 * 38150 * If there are no `offset` values specified in the style entries, the offsets 38151 * are calculated automatically. 38152 * 38153 * ```ts 38154 * animate("5s", keyframes([ 38155 * style({ backgroundColor: "red" }) // offset = 0 38156 * style({ backgroundColor: "blue" }) // offset = 0.33 38157 * style({ backgroundColor: "orange" }) // offset = 0.66 38158 * style({ backgroundColor: "black" }) // offset = 1 38159 * ])) 38160 *``` 38161 38162 * @publicApi 38163 */ 38164function keyframes(steps) { 38165 return { 38166 type: AnimationMetadataType.Keyframes, 38167 steps 38168 }; 38169} 38170/** 38171 * Declares an animation transition which is played when a certain specified condition is met. 38172 * 38173 * @param stateChangeExpr A string with a specific format or a function that specifies when the 38174 * animation transition should occur (see [State Change Expression](#state-change-expression)). 38175 * 38176 * @param steps One or more animation objects that represent the animation's instructions. 38177 * 38178 * @param options An options object that can be used to specify a delay for the animation or provide 38179 * custom parameters for it. 38180 * 38181 * @returns An object that encapsulates the transition data. 38182 * 38183 * @usageNotes 38184 * 38185 * ### State Change Expression 38186 * 38187 * The State Change Expression instructs Angular when to run the transition's animations, it can 38188 *either be 38189 * - a string with a specific syntax 38190 * - or a function that compares the previous and current state (value of the expression bound to 38191 * the element's trigger) and returns `true` if the transition should occur or `false` otherwise 38192 * 38193 * The string format can be: 38194 * - `fromState => toState`, which indicates that the transition's animations should occur then the 38195 * expression bound to the trigger's element goes from `fromState` to `toState` 38196 * 38197 * _Example:_ 38198 * ```ts 38199 * transition('open => closed', animate('.5s ease-out', style({ height: 0 }) )) 38200 * ``` 38201 * 38202 * - `fromState <=> toState`, which indicates that the transition's animations should occur then 38203 * the expression bound to the trigger's element goes from `fromState` to `toState` or vice versa 38204 * 38205 * _Example:_ 38206 * ```ts 38207 * transition('enabled <=> disabled', animate('1s cubic-bezier(0.8,0.3,0,1)')) 38208 * ``` 38209 * 38210 * - `:enter`/`:leave`, which indicates that the transition's animations should occur when the 38211 * element enters or exists the DOM 38212 * 38213 * _Example:_ 38214 * ```ts 38215 * transition(':enter', [ 38216 * style({ opacity: 0 }), 38217 * animate('500ms', style({ opacity: 1 })) 38218 * ]) 38219 * ``` 38220 * 38221 * - `:increment`/`:decrement`, which indicates that the transition's animations should occur when 38222 * the numerical expression bound to the trigger's element has increased in value or decreased 38223 * 38224 * _Example:_ 38225 * ```ts 38226 * transition(':increment', query('@counter', animateChild())) 38227 * ``` 38228 * 38229 * - a sequence of any of the above divided by commas, which indicates that transition's animations 38230 * should occur whenever one of the state change expressions matches 38231 * 38232 * _Example:_ 38233 * ```ts 38234 * transition(':increment, * => enabled, :enter', animate('1s ease', keyframes([ 38235 * style({ transform: 'scale(1)', offset: 0}), 38236 * style({ transform: 'scale(1.1)', offset: 0.7}), 38237 * style({ transform: 'scale(1)', offset: 1}) 38238 * ]))), 38239 * ``` 38240 * 38241 * Also note that in such context: 38242 * - `void` can be used to indicate the absence of the element 38243 * - asterisks can be used as wildcards that match any state 38244 * - (as a consequence of the above, `void => *` is equivalent to `:enter` and `* => void` is 38245 * equivalent to `:leave`) 38246 * - `true` and `false` also match expression values of `1` and `0` respectively (but do not match 38247 * _truthy_ and _falsy_ values) 38248 * 38249 * <div class="docs-alert docs-alert-helpful"> 38250 * 38251 * Be careful about entering end leaving elements as their transitions present a common 38252 * pitfall for developers. 38253 * 38254 * Note that when an element with a trigger enters the DOM its `:enter` transition always 38255 * gets executed, but its `:leave` transition will not be executed if the element is removed 38256 * alongside its parent (as it will be removed "without warning" before its transition has 38257 * a chance to be executed, the only way that such transition can occur is if the element 38258 * is exiting the DOM on its own). 38259 * 38260 * 38261 * </div> 38262 * 38263 * ### Animating to a Final State 38264 * 38265 * If the final step in a transition is a call to `animate()` that uses a timing value
38266 * with no `style` data, that step is automatically considered the final animation arc, 38267 * for the element to reach the final state, in such case Angular automatically adds or removes 38268 * CSS styles to ensure that the element is in the correct final state. 38269 * 38270 * 38271 * ### Usage Examples 38272 * 38273 * - Transition animations applied based on 38274 * the trigger's expression value 38275 * 38276 * ```html 38277 * <div [@myAnimationTrigger]="myStatusExp"> 38278 * ... 38279 * </div> 38280 * ``` 38281 * 38282 * ```ts 38283 * trigger("myAnimationTrigger", [ 38284 * ..., // states 38285 * transition("on => off, open => closed", animate(500)), 38286 * transition("* <=> error", query('.indicator', animateChild())) 38287 * ]) 38288 * ``` 38289 * 38290 * - Transition animations applied based on custom logic dependent 38291 * on the trigger's expression value and provided parameters 38292 * 38293 * ```html 38294 * <div [@myAnimationTrigger]="{ 38295 * value: stepName, 38296 * params: { target: currentTarget } 38297 * }"> 38298 * ... 38299 * </div> 38300 * ``` 38301 * 38302 * ```ts 38303 * trigger("myAnimationTrigger", [ 38304 * ..., // states 38305 * transition( 38306 * (fromState, toState, _element, params) => 38307 * ['firststep', 'laststep'].includes(fromState.toLowerCase()) 38308 * && toState === params?.['target'], 38309 * animate('1s') 38310 * ) 38311 * ]) 38312 * ``` 38313 * 38314 * @publicApi 38315 **/ 38316function transition(stateChangeExpr, steps, options = null) { 38317 return { 38318 type: AnimationMetadataType.Transition, 38319 expr: stateChangeExpr, 38320 animation: steps, 38321 options 38322 }; 38323} 38324/** 38325 * Produces a reusable animation that can be invoked in another animation or sequence, 38326 * by calling the `useAnimation()` function. 38327 * 38328 * @param steps One or more animation objects, as returned by the `animate()` 38329 * or `sequence()` function, that form a transformation from one state to another. 38330 * A sequence is used by default when you pass an array. 38331 * @param options An options object that can contain a delay value for the start of the 38332 * animation, and additional developer-defined parameters. 38333 * Provided values for additional parameters are used as defaults, 38334 * and override values can be passed to the caller on invocation. 38335 * @returns An object that encapsulates the animation data. 38336 * 38337 * @usageNotes 38338 * The following example defines a reusable animation, providing some default parameter 38339 * values. 38340 * 38341 * ```ts 38342 * var fadeAnimation = animation([ 38343 * style({ opacity: '{{ start }}' }), 38344 * animate('{{ time }}', 38345 * style({ opacity: '{{ end }}'})) 38346 * ], 38347 * { params: { time: '1000ms', start: 0, end: 1 }}); 38348 * ``` 38349 * 38350 * The following invokes the defined animation with a call to `useAnimation()`, 38351 * passing in override parameter values. 38352 * 38353 * ```js 38354 * useAnimation(fadeAnimation, { 38355 * params: { 38356 * time: '2s', 38357 * start: 1, 38358 * end: 0 38359 * } 38360 * }) 38361 * ``` 38362 * 38363 * If any of the passed-in parameter values are missing from this call, 38364 * the default values are used. If one or more parameter values are missing before a step is 38365 * animated, `useAnimation()` throws an error. 38366 * 38367 * @publicApi 38368 */ 38369function animation(steps, options = null) { 38370 return { 38371 type: AnimationMetadataType.Reference, 38372 animation: steps, 38373 options 38374 }; 38375} 38376/** 38377 * Executes a queried inner animation element within an animation sequence. 38378 * 38379 * @param options An options object that can contain a delay value for the start of the 38380 * animation, and additional override values for developer-defined parameters. 38381 * @return An object that encapsulates the child animation data. 38382 * 38383 * @usageNotes 38384 * Each time an animation is triggered in Angular, the parent animation 38385 * has priority and any child animations are blocked. In order 38386 * for a child animation to run, the parent animation must query each of the elements 38387 * containing child animations, and run them using this function. 38388 * 38389 * Note that this feature is designed to be used with `query()` and it will only work 38390 * with animations that are assigned using the Angular animation library. CSS keyframes 38391 * and transitions are not handled by this API. 38392 * 38393 * @publicApi 38394 */ 38395function animateChild(options = null) { 38396 return { 38397 type: AnimationMetadataType.AnimateChild, 38398 options 38399 }; 38400} 38401/** 38402 * Starts a reusable animation that is created using the `animation()` function. 38403 * 38404 * @param animation The reusable animation to start. 38405 * @param options An options object that can contain a delay value for the start of 38406 * the animation, and additional override values for developer-defined parameters. 38407 * @return An object that contains the animation parameters. 38408 * 38409 * @publicApi 38410 */ 38411function useAnimation(animation, options = null) { 38412 return { 38413 type: AnimationMetadataType.AnimateRef, 38414 animation, 38415 options 38416 }; 38417} 38418/** 38419 * Finds one or more inner elements within the current element that is 38420 * being animated within a sequence. Use with `animate()`. 38421 * 38422 * @param selector The element to query, or a set of elements that contain Angular-specific 38423 * characteristics, specified with one or more of the following tokens. 38424 * - `query(":enter")` or `query(":leave")` : Query for newly inserted/removed elements (not 38425 * all elements can be queried via these tokens, see 38426 * [Entering and Leaving Elements](#entering-and-leaving-elements)) 38427 * - `query(":animating")` : Query all currently animating elements. 38428 * - `query("@triggerName")` : Query elements that contain an animation trigger. 38429 * - `query("@*")` : Query all elements that contain an animation triggers. 38430 * - `query(":self")` : Include the current element into the animation sequence. 38431 * 38432 * @param animation One or more animation steps to apply to the queried element or elements. 38433 * An array is treated as an animation sequence. 38434 * @param options An options object. Use the 'limit' field to limit the total number of 38435 * items to collect. 38436 * @return An object that encapsulates the query data. 38437 * 38438 * @usageNotes 38439 * 38440 * ### Multiple Tokens 38441 * 38442 * Tokens can be merged into a combined query selector string. For example: 38443 * 38444 * ```ts
38445 * query(':self, .record:enter, .record:leave, @subTrigger', [...]) 38446 * ``` 38447 * 38448 * The `query()` function collects multiple elements and works internally by using 38449 * `element.querySelectorAll`. Use the `limit` field of an options object to limit 38450 * the total number of items to be collected. For example: 38451 * 38452 * ```js 38453 * query('div', [ 38454 * animate(...), 38455 * animate(...) 38456 * ], { limit: 1 }) 38457 * ``` 38458 * 38459 * By default, throws an error when zero items are found. Set the 38460 * `optional` flag to ignore this error. For example: 38461 * 38462 * ```js 38463 * query('.some-element-that-may-not-be-there', [ 38464 * animate(...), 38465 * animate(...) 38466 * ], { optional: true }) 38467 * ``` 38468 * 38469 * ### Entering and Leaving Elements 38470 * 38471 * Not all elements can be queried via the `:enter` and `:leave` tokens, the only ones 38472 * that can are those that Angular assumes can enter/leave based on their own logic 38473 * (if their insertion/removal is simply a consequence of that of their parent they 38474 * should be queried via a different token in their parent's `:enter`/`:leave` transitions). 38475 * 38476 * The only elements Angular assumes can enter/leave based on their own logic (thus the only 38477 * ones that can be queried via the `:enter` and `:leave` tokens) are: 38478 * - Those inserted dynamically (via `ViewContainerRef`) 38479 * - Those that have a structural directive (which, under the hood, are a subset of the above ones) 38480 * 38481 * <div class="docs-alert docs-alert-helpful"> 38482 * 38483 * Note that elements will be successfully queried via `:enter`/`:leave` even if their 38484 * insertion/removal is not done manually via `ViewContainerRef`or caused by their structural 38485 * directive (e.g. they enter/exit alongside their parent). 38486 * 38487 * </div> 38488 * 38489 * <div class="docs-alert docs-alert-important"> 38490 * 38491 * There is an exception to what previously mentioned, besides elements entering/leaving based on 38492 * their own logic, elements with an animation trigger can always be queried via `:leave` when 38493 * their parent is also leaving. 38494 * 38495 * </div> 38496 * 38497 * ### Usage Example 38498 * 38499 * The following example queries for inner elements and animates them 38500 * individually using `animate()`. 38501 * 38502 * ```angular-ts 38503 * @Component({ 38504 * selector: 'inner', 38505 * template: ` 38506 * <div [@queryAnimation]="exp"> 38507 * <h1>Title</h1> 38508 * <div class="content"> 38509 * Blah blah blah 38510 * </div> 38511 * </div> 38512 * `, 38513 * animations: [ 38514 * trigger('queryAnimation', [ 38515 * transition('* => goAnimate', [ 38516 * // hide the inner elements 38517 * query('h1', style({ opacity: 0 })), 38518 * query('.content', style({ opacity: 0 })), 38519 * 38520 * // animate the inner elements in, one by one 38521 * query('h1', animate(1000, style({ opacity: 1 }))), 38522 * query('.content', animate(1000, style({ opacity: 1 }))), 38523 * ]) 38524 * ]) 38525 * ] 38526 * }) 38527 * class Cmp { 38528 * exp = ''; 38529 * 38530 * goAnimate() { 38531 * this.exp = 'goAnimate'; 38532 * } 38533 * } 38534 * ``` 38535 * 38536 * @publicApi 38537 */ 38538function query(selector, animation, options = null) { 38539 return { 38540 type: AnimationMetadataType.Query, 38541 selector, 38542 animation, 38543 options 38544 }; 38545} 38546/** 38547 * Use within an animation `query()` call to issue a timing gap after 38548 * each queried item is animated. 38549 * 38550 * @param timings A delay value. 38551 * @param animation One ore more animation steps. 38552 * @returns An object that encapsulates the stagger data. 38553 * 38554 * @usageNotes 38555 * In the following example, a container element wraps a list of items stamped out 38556 * by an `ngFor`. The container element contains an animation trigger that will later be set 38557 * to query for each of the inner items. 38558 * 38559 * Each time items are added, the opacity fade-in animation runs, 38560 * and each removed item is faded out. 38561 * When either of these animations occur, the stagger effect is 38562 * applied after each item's animation is started. 38563 * 38564 * ```html 38565 * <!-- list.component.html --> 38566 * <button (click)="toggle()">Show / Hide Items</button> 38567 * <hr /> 38568 * <div [@listAnimation]="items.length"> 38569 * <div *ngFor="let item of items"> 38570 * {{ item }} 38571 * </div> 38572 * </div> 38573 * ``` 38574 * 38575 * Here is the component code: 38576 * 38577 * ```ts 38578 * import {trigger, transition, style, animate, query, stagger} from '@angular/animations'; 38579 * @Component({ 38580 * templateUrl: 'list.component.html', 38581 * animations: [ 38582 * trigger('listAnimation', [ 38583 * ... 38584 * ]) 38585 * ] 38586 * }) 38587 * class ListComponent { 38588 * items = []; 38589 * 38590 * showItems() { 38591 * this.items = [0,1,2,3,4]; 38592 * } 38593 * 38594 * hideItems() { 38595 * this.items = []; 38596 * } 38597 * 38598 * toggle() { 38599 * this.items.length ? this.hideItems() : this.showItems(); 38600 * } 38601 * } 38602 * ``` 38603 * 38604 * Here is the animation trigger code: 38605 * 38606 * ```ts 38607 * trigger('listAnimation', [ 38608 * transition('* => *', [ // each time the binding value changes 38609 * query(':leave', [ 38610 * stagger(100, [
38611 * animate('0.5s', style({ opacity: 0 })) 38612 * ]) 38613 * ]), 38614 * query(':enter', [ 38615 * style({ opacity: 0 }), 38616 * stagger(100, [ 38617 * animate('0.5s', style({ opacity: 1 })) 38618 * ]) 38619 * ]) 38620 * ]) 38621 * ]) 38622 * ``` 38623 * 38624 * @publicApi 38625 */ 38626function stagger(timings, animation) { 38627 return { 38628 type: AnimationMetadataType.Stagger, 38629 timings, 38630 animation 38631 }; 38632} 38633 38634/** 38635 * An empty programmatic controller for reusable animations. 38636 * Used internally when animations are disabled, to avoid 38637 * checking for the null case when an animation player is expected. 38638 * 38639 * @see {@link animate} 38640 * @see {@link AnimationPlayer} 38641 * 38642 * @publicApi 38643 */ 38644class NoopAnimationPlayer { 38645 constructor(duration = 0, delay = 0) { 38646 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_onDoneFns", []); 38647 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_onStartFns", []); 38648 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_onDestroyFns", []); 38649 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_originalOnDoneFns", []); 38650 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_originalOnStartFns", []); 38651 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_started", false); 38652 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_destroyed", false); 38653 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_finished", false); 38654 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_position", 0); 38655 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "parentPlayer", null); 38656 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "totalTime", void 0); 38657 this.totalTime = duration + delay; 38658 } 38659 _onFinish() { 38660 if (!this._finished) { 38661 this._finished = true; 38662 this._onDoneFns.forEach(fn => fn()); 38663 this._onDoneFns = []; 38664 } 38665 } 38666 onStart(fn) { 38667 this._originalOnStartFns.push(fn); 38668 this._onStartFns.push(fn); 38669 } 38670 onDone(fn) { 38671 this._originalOnDoneFns.push(fn); 38672 this._onDoneFns.push(fn); 38673 } 38674 onDestroy(fn) { 38675 this._onDestroyFns.push(fn); 38676 } 38677 hasStarted() { 38678 return this._started; 38679 } 38680 init() {} 38681 play() { 38682 if (!this.hasStarted()) { 38683 this._onStart(); 38684 this.triggerMicrotask(); 38685 } 38686 this._started = true; 38687 } 38688 /** @internal */ 38689 triggerMicrotask() { 38690 queueMicrotask(() => this._onFinish()); 38691 } 38692 _onStart() { 38693 this._onStartFns.forEach(fn => fn()); 38694 this._onStartFns = []; 38695 } 38696 pause() {} 38697 restart() {} 38698 finish() { 38699 this._onFinish(); 38700 } 38701 destroy() { 38702 if (!this._destroyed) { 38703 this._destroyed = true; 38704 if (!this.hasStarted()) { 38705 this._onStart(); 38706 } 38707 this.finish(); 38708 this._onDestroyFns.forEach(fn => fn()); 38709 this._onDestroyFns = []; 38710 } 38711 } 38712 reset() { 38713 this._started = false; 38714 this._finished = false; 38715 this._onStartFns = this._originalOnStartFns; 38716 this._onDoneFns = this._originalOnDoneFns; 38717 } 38718 setPosition(position) { 38719 this._position = this.totalTime ? position * this.totalTime : 1; 38720 } 38721 getPosition() { 38722 return this.totalTime ? this._position / this.totalTime : 1; 38723 } 38724 /** @internal */ 38725 triggerCallback(phaseName) { 38726 const methods = phaseName == 'start' ? this._onStartFns : this._onDoneFns; 38727 methods.forEach(fn => fn()); 38728 methods.length = 0; 38729 } 38730} 38731 38732/** 38733 * A programmatic controller for a group of reusable animations. 38734 * Used internally to control animations. 38735 * 38736 * @see {@link AnimationPlayer} 38737 * @see {@link animations/group group} 38738 * 38739 */ 38740class AnimationGroupPlayer { 38741 constructor(_players) { 38742 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_onDoneFns", []); 38743 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_onStartFns", []); 38744 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_finished", false); 38745 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_started", false); 38746 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_destroyed", false); 38747 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_onDestroyFns", []); 38748 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "parentPlayer", null); 38749 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "totalTime", 0); 38750 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "players", void 0); 38751 this.players = _players; 38752 let doneCount = 0; 38753 let destroyCount = 0; 38754 let startCount = 0; 38755 const total = this.players.length; 38756 if (total == 0) { 38757 queueMicrotask(() => this._onFinish()); 38758 } else {
38759 this.players.forEach(player => { 38760 player.onDone(() => { 38761 if (++doneCount == total) { 38762 this._onFinish(); 38763 } 38764 }); 38765 player.onDestroy(() => { 38766 if (++destroyCount == total) { 38767 this._onDestroy(); 38768 } 38769 }); 38770 player.onStart(() => { 38771 if (++startCount == total) { 38772 this._onStart(); 38773 } 38774 }); 38775 }); 38776 } 38777 this.totalTime = this.players.reduce((time, player) => Math.max(time, player.totalTime), 0); 38778 } 38779 _onFinish() { 38780 if (!this._finished) { 38781 this._finished = true; 38782 this._onDoneFns.forEach(fn => fn()); 38783 this._onDoneFns = []; 38784 } 38785 } 38786 init() { 38787 this.players.forEach(player => player.init()); 38788 } 38789 onStart(fn) { 38790 this._onStartFns.push(fn); 38791 } 38792 _onStart() { 38793 if (!this.hasStarted()) { 38794 this._started = true; 38795 this._onStartFns.forEach(fn => fn()); 38796 this._onStartFns = []; 38797 } 38798 } 38799 onDone(fn) { 38800 this._onDoneFns.push(fn); 38801 } 38802 onDestroy(fn) { 38803 this._onDestroyFns.push(fn); 38804 } 38805 hasStarted() { 38806 return this._started; 38807 } 38808 play() { 38809 if (!this.parentPlayer) { 38810 this.init(); 38811 } 38812 this._onStart(); 38813 this.players.forEach(player => player.play()); 38814 } 38815 pause() { 38816 this.players.forEach(player => player.pause()); 38817 } 38818 restart() { 38819 this.players.forEach(player => player.restart()); 38820 } 38821 finish() { 38822 this._onFinish(); 38823 this.players.forEach(player => player.finish()); 38824 } 38825 destroy() { 38826 this._onDestroy(); 38827 } 38828 _onDestroy() { 38829 if (!this._destroyed) { 38830 this._destroyed = true; 38831 this._onFinish(); 38832 this.players.forEach(player => player.destroy()); 38833 this._onDestroyFns.forEach(fn => fn()); 38834 this._onDestroyFns = []; 38835 } 38836 } 38837 reset() { 38838 this.players.forEach(player => player.reset()); 38839 this._destroyed = false; 38840 this._finished = false; 38841 this._started = false; 38842 } 38843 setPosition(p) { 38844 const timeAtPosition = p * this.totalTime; 38845 this.players.forEach(player => { 38846 const position = player.totalTime ? Math.min(1, timeAtPosition / player.totalTime) : 1; 38847 player.setPosition(position); 38848 }); 38849 } 38850 getPosition() { 38851 const longestPlayer = this.players.reduce((longestSoFar, player) => { 38852 const newPlayerIsLongest = longestSoFar === null || player.totalTime > longestSoFar.totalTime; 38853 return newPlayerIsLongest ? player : longestSoFar; 38854 }, null); 38855 return longestPlayer != null ? longestPlayer.getPosition() : 0; 38856 } 38857 beforeDestroy() { 38858 this.players.forEach(player => { 38859 if (player.beforeDestroy) { 38860 player.beforeDestroy(); 38861 } 38862 }); 38863 } 38864 /** @internal */ 38865 triggerCallback(phaseName) { 38866 const methods = phaseName == 'start' ? this._onStartFns : this._onDoneFns; 38867 methods.forEach(fn => fn()); 38868 methods.length = 0; 38869 } 38870} 38871const ɵPRE_STYLE = '!'; 38872 38873//# sourceMappingURL=private_export-faY_wCkZ.mjs.map 38874 38875/***/ }), 38876 38877/***/ 61982: 38878/*!************************************************************************!*\ 38879 !*** ./node_modules/@angular/cdk/fesm2022/overlay-module-BUj0D19H.mjs ***! 38880 \************************************************************************/ 38881/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { 38882 38883__webpack_require__.r(__webpack_exports__); 38884/* harmony export */ __webpack_require__.d(__webpack_exports__, { 38885/* harmony export */ B: () => (/* binding */ BlockScrollStrategy), 38886/* harmony export */ C: () => (/* binding */ CdkOverlayOrigin), 38887/* harmony export */ F: () => (/* binding */ FlexibleConnectedPositionStrategy), 38888/* harmony export */ G: () => (/* binding */ GlobalPositionStrategy), 38889/* harmony export */ N: () => (/* binding */ NoopScrollStrategy), 38890/* harmony export */ O: () => (/* binding */ OverlayContainer), 38891/* harmony export */ R: () => (/* binding */ RepositionScrollStrategy), 38892/* harmony export */ S: () => (/* binding */ STANDARD_DROPDOWN_ADJACENT_POSITIONS), 38893/* harmony export */ a: () => (/* binding */ Overlay), 38894/* harmony export */ b: () => (/* binding */ CdkConnectedOverlay), 38895/* harmony export */ c: () => (/* binding */ OverlayRef), 38896/* harmony export */ d: () => (/* binding */ OverlayPositionBuilder), 38897/* harmony export */ e: () => (/* binding */ STANDARD_DROPDOWN_BELOW_POSITIONS), 38898/* harmony export */ f: () => (/* binding */ OverlayConfig), 38899/* harmony export */ g: () => (/* binding */ ConnectionPositionPair), 38900/* harmony export */ h: () => (/* binding */ ScrollingVisibility), 38901/* harmony export */ i: () => (/* binding */ ConnectedOverlayPositionChange), 38902/* harmony export */ j: () => (/* binding */ validateHorizontalPosition), 38903/* harmony export */ k: () => (/* binding */ ScrollStrategyOptions), 38904/* harmony export */ l: () => (/* binding */ CloseScrollStrategy), 38905/* harmony export */ m: () => (/* binding */ OverlayModule), 38906/* harmony export */ n: () => (/* binding */ OverlayOutsideClickDispatcher), 38907/* harmony export */ o: () => (/* binding */ OverlayKeyboardDispatcher), 38908/* harmony export */ v: () => (/* binding */ validateVerticalPosition) 38909/* harmony export */ }); 38910/* harmony import */ var C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js */ 89379); 38911/* harmony import */ var C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/defineProperty.js */ 64467); 38912/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/core */ 17705); 38913/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @angular/common */ 59361); 38914/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @angular/common */ 96048); 38915/* harmony import */ var _platform_DmdVEw_C_mjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./platform-DmdVEw_C.mjs */ 99536); 38916/* harmony import */ var _backwards_compatibility_DHR38MsD_mjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./backwards-compatibility-DHR38MsD.mjs */ 67418); 38917/* harmony import */ var _shadow_dom_B0oHn41l_mjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./shadow-dom-B0oHn41l.mjs */ 79629); 38918/* harmony import */ var _test_environment_CT0XxPyp_mjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./test-environment-CT0XxPyp.mjs */ 30884); 38919/* harmony import */ var _style_loader_Cu9AvjH9_mjs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./style-loader-Cu9AvjH9.mjs */ 84790); 38920/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! rxjs */ 45286); 38921/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! rxjs */ 31805); 38922/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! rxjs */ 44670); 38923/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! rxjs/operators */ 58728); 38924/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! rxjs/operators */ 7605); 38925/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! rxjs/operators */ 31604); 38926/* harmony import */ var _css_pixel_value_C_HEqLhI_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./css-pixel-value-C_HEqLhI.mjs */ 50763); 38927/* harmony import */ var _array_I1yfCXUO_mjs__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./array-I1yfCXUO.mjs */ 41959); 38928/* harmony import */ var _scrolling_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./scrolling.mjs */ 65478); 38929/* harmony import */ var _scrolling_BkvA05C8_mjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./scrolling-BkvA05C8.mjs */ 89273); 38930/* harmony import */ var _portal_directives_Bw5woq8I_mjs__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./portal-directives-Bw5woq8I.mjs */ 23291
38930); 38931/* harmony import */ var _directionality_CBXD4hga_mjs__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./directionality-CBXD4hga.mjs */ 11845); 38932/* harmony import */ var _id_generator_Dw_9dSDu_mjs__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./id-generator-Dw_9dSDu.mjs */ 39022); 38933/* harmony import */ var _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./keycodes-CpHkExLC.mjs */ 17035); 38934/* harmony import */ var _keycodes_mjs__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./keycodes.mjs */ 67336); 38935/* harmony import */ var _bidi_mjs__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./bidi.mjs */ 28203); 38936 38937 38938 38939 38940 38941 38942 38943 38944 38945 38946 38947 38948 38949 38950 38951 38952 38953 38954 38955 38956 38957 38958const scrollBehaviorSupported = /*#__PURE__*/(0,_scrolling_BkvA05C8_mjs__WEBPACK_IMPORTED_MODULE_2__.s)(); 38959/** 38960 * Strategy that will prevent the user from scrolling while the overlay is visible. 38961 */ 38962class BlockScrollStrategy { 38963 constructor(_viewportRuler, document) { 38964 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_viewportRuler", void 0); 38965 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_previousHTMLStyles", { 38966 top: '', 38967 left: '' 38968 }); 38969 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_previousScrollPosition", void 0); 38970 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_isEnabled", false); 38971 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_document", void 0); 38972 this._viewportRuler = _viewportRuler; 38973 this._document = document; 38974 } 38975 /** Attaches this scroll strategy to an overlay. */ 38976 attach() {} 38977 /** Blocks page-level scroll while the attached overlay is open. */ 38978 enable() { 38979 if (this._canBeEnabled()) { 38980 const root = this._document.documentElement; 38981 this._previousScrollPosition = this._viewportRuler.getViewportScrollPosition(); 38982 // Cache the previous inline styles in case the user had set them. 38983 this._previousHTMLStyles.left = root.style.left || ''; 38984 this._previousHTMLStyles.top = root.style.top || ''; 38985 // Note: we're using the `html` node, instead of the `body`, because the `body` may 38986 // have the user agent margin, whereas the `html` is guaranteed not to have one. 38987 root.style.left = (0,_css_pixel_value_C_HEqLhI_mjs__WEBPACK_IMPORTED_MODULE_3__.c)(-this._previousScrollPosition.left); 38988 root.style.top = (0,_css_pixel_value_C_HEqLhI_mjs__WEBPACK_IMPORTED_MODULE_3__.c)(-this._previousScrollPosition.top); 38989 root.classList.add('cdk-global-scrollblock'); 38990 this._isEnabled = true; 38991 } 38992 } 38993 /** Unblocks page-level scroll while the attached overlay is open. */ 38994 disable() { 38995 if (this._isEnabled) { 38996 const html = this._document.documentElement; 38997 const body = this._document.body; 38998 const htmlStyle = html.style; 38999 const bodyStyle = body.style; 39000 const previousHtmlScrollBehavior = htmlStyle.scrollBehavior || ''; 39001 const previousBodyScrollBehavior = bodyStyle.scrollBehavior || ''; 39002 this._isEnabled = false; 39003 htmlStyle.left = this._previousHTMLStyles.left; 39004 htmlStyle.top = this._previousHTMLStyles.top; 39005 html.classList.remove('cdk-global-scrollblock'); 39006 // Disable user-defined smooth scrolling temporarily while we restore the scroll position. 39007 // See https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-behavior 39008 // Note that we don't mutate the property if the browser doesn't support `scroll-behavior`, 39009 // because it can throw off feature detections in `supportsScrollBehavior` which 39010 // checks for `'scrollBehavior' in documentElement.style`. 39011 if (scrollBehaviorSupported) { 39012 htmlStyle.scrollBehavior = bodyStyle.scrollBehavior = 'auto'; 39013 } 39014 window.scroll(this._previousScrollPosition.left, this._previousScrollPosition.top); 39015 if (scrollBehaviorSupported) { 39016 htmlStyle.scrollBehavior = previousHtmlScrollBehavior; 39017 bodyStyle.scrollBehavior = previousBodyScrollBehavior; 39018 } 39019 } 39020 } 39021 _canBeEnabled() { 39022 // Since the scroll strategies can't be singletons, we have to use a global CSS class 39023 // (`cdk-global-scrollblock`) to make sure that we don't try to disable global 39024 // scrolling multiple times. 39025 const html = this._document.documentElement; 39026 if (html.classList.contains('cdk-global-scrollblock') || this._isEnabled) { 39027 return false;
39028 } 39029 const rootElement = this._document.documentElement; 39030 const viewport = this._viewportRuler.getViewportSize(); 39031 return rootElement.scrollHeight > viewport.height || rootElement.scrollWidth > viewport.width; 39032 } 39033} 39034 39035/** 39036 * Returns an error to be thrown when attempting to attach an already-attached scroll strategy. 39037 */ 39038function getMatScrollStrategyAlreadyAttachedError() { 39039 return Error(`Scroll strategy has already been attached.`); 39040} 39041 39042/** 39043 * Strategy that will close the overlay as soon as the user starts scrolling. 39044 */ 39045class CloseScrollStrategy { 39046 constructor(_scrollDispatcher, _ngZone, _viewportRuler, _config) { 39047 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_scrollDispatcher", void 0); 39048 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_ngZone", void 0); 39049 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_viewportRuler", void 0); 39050 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_config", void 0); 39051 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_scrollSubscription", null); 39052 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_overlayRef", void 0); 39053 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_initialScrollPosition", void 0); 39054 /** Detaches the overlay ref and disables the scroll strategy. */ 39055 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_detach", () => { 39056 this.disable(); 39057 if (this._overlayRef.hasAttached()) { 39058 this._ngZone.run(() => this._overlayRef.detach()); 39059 } 39060 }); 39061 this._scrollDispatcher = _scrollDispatcher; 39062 this._ngZone = _ngZone; 39063 this._viewportRuler = _viewportRuler; 39064 this._config = _config; 39065 } 39066 /** Attaches this scroll strategy to an overlay. */ 39067 attach(overlayRef) { 39068 if (this._overlayRef && (typeof ngDevMode === 'undefined' || ngDevMode)) { 39069 throw getMatScrollStrategyAlreadyAttachedError(); 39070 } 39071 this._overlayRef = overlayRef; 39072 } 39073 /** Enables the closing of the attached overlay on scroll. */ 39074 enable() { 39075 if (this._scrollSubscription) { 39076 return; 39077 } 39078 const stream = this._scrollDispatcher.scrolled(0).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_4__.filter)(scrollable => { 39079 return !scrollable || !this._overlayRef.overlayElement.contains(scrollable.getElementRef().nativeElement); 39080 })); 39081 if (this._config && this._config.threshold && this._config.threshold > 1) { 39082 this._initialScrollPosition = this._viewportRuler.getViewportScrollPosition().top; 39083 this._scrollSubscription = stream.subscribe(() => { 39084 const scrollPosition = this._viewportRuler.getViewportScrollPosition().top; 39085 if (Math.abs(scrollPosition - this._initialScrollPosition) > this._config.threshold) { 39086 this._detach(); 39087 } else { 39088 this._overlayRef.updatePosition(); 39089 } 39090 }); 39091 } else { 39092 this._scrollSubscription = stream.subscribe(this._detach); 39093 } 39094 } 39095 /** Disables the closing the attached overlay on scroll. */ 39096 disable() { 39097 if (this._scrollSubscription) { 39098 this._scrollSubscription.unsubscribe(); 39099 this._scrollSubscription = null; 39100 } 39101 } 39102 detach() { 39103 this.disable(); 39104 this._overlayRef = null; 39105 } 39106} 39107 39108/** Scroll strategy that doesn't do anything. */ 39109class NoopScrollStrategy { 39110 /** Does nothing, as this scroll strategy is a no-op. */ 39111 enable() {} 39112 /** Does nothing, as this scroll strategy is a no-op. */ 39113 disable() {} 39114 /** Does nothing, as this scroll strategy is a no-op. */ 39115 attach() {} 39116} 39117 39118/** 39119 * Gets whether an element is scrolled outside of view by any of its parent scrolling containers. 39120 * @param element Dimensions of the element (from getBoundingClientRect) 39121 * @param scrollContainers Dimensions of element's scrolling containers (from getBoundingClientRect) 39122 * @returns Whether the element is scrolled out of view 39123 * @docs-private 39124 */
39125function isElementScrolledOutsideView(element, scrollContainers) { 39126 return scrollContainers.some(containerBounds => { 39127 const outsideAbove = element.bottom < containerBounds.top; 39128 const outsideBelow = element.top > containerBounds.bottom; 39129 const outsideLeft = element.right < containerBounds.left; 39130 const outsideRight = element.left > containerBounds.right; 39131 return outsideAbove || outsideBelow || outsideLeft || outsideRight; 39132 }); 39133} 39134/** 39135 * Gets whether an element is clipped by any of its scrolling containers. 39136 * @param element Dimensions of the element (from getBoundingClientRect) 39137 * @param scrollContainers Dimensions of element's scrolling containers (from getBoundingClientRect) 39138 * @returns Whether the element is clipped 39139 * @docs-private 39140 */ 39141function isElementClippedByScrolling(element, scrollContainers) { 39142 return scrollContainers.some(scrollContainerRect => { 39143 const clippedAbove = element.top < scrollContainerRect.top; 39144 const clippedBelow = element.bottom > scrollContainerRect.bottom; 39145 const clippedLeft = element.left < scrollContainerRect.left; 39146 const clippedRight = element.right > scrollContainerRect.right; 39147 return clippedAbove || clippedBelow || clippedLeft || clippedRight; 39148 }); 39149} 39150 39151/** 39152 * Strategy that will update the element position as the user is scrolling. 39153 */ 39154class RepositionScrollStrategy { 39155 constructor(_scrollDispatcher, _viewportRuler, _ngZone, _config) { 39156 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_scrollDispatcher", void 0); 39157 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_viewportRuler", void 0); 39158 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_ngZone", void 0); 39159 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_config", void 0); 39160 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_scrollSubscription", null); 39161 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_overlayRef", void 0); 39162 this._scrollDispatcher = _scrollDispatcher; 39163 this._viewportRuler = _viewportRuler; 39164 this._ngZone = _ngZone; 39165 this._config = _config; 39166 } 39167 /** Attaches this scroll strategy to an overlay. */ 39168 attach(overlayRef) { 39169 if (this._overlayRef && (typeof ngDevMode === 'undefined' || ngDevMode)) { 39170 throw getMatScrollStrategyAlreadyAttachedError(); 39171 } 39172 this._overlayRef = overlayRef; 39173 } 39174 /** Enables repositioning of the attached overlay on scroll. */ 39175 enable() { 39176 if (!this._scrollSubscription) { 39177 const throttle = this._config ? this._config.scrollThrottle : 0; 39178 this._scrollSubscription = this._scrollDispatcher.scrolled(throttle).subscribe(() => { 39179 this._overlayRef.updatePosition(); 39180 // TODO(crisbeto): make `close` on by default once all components can handle it. 39181 if (this._config && this._config.autoClose) { 39182 const overlayRect = this._overlayRef.overlayElement.getBoundingClientRect(); 39183 const { 39184 width, 39185 height 39186 } = this._viewportRuler.getViewportSize(); 39187 // TODO(crisbeto): include all ancestor scroll containers here once 39188 // we have a way of exposing the trigger element to the scroll strategy. 39189 const parentRects = [{ 39190 width, 39191 height, 39192 bottom: height, 39193 right: width, 39194 top: 0, 39195 left: 0 39196 }]; 39197 if (isElementScrolledOutsideView(overlayRect, parentRects)) { 39198 this.disable(); 39199 this._ngZone.run(() => this._overlayRef.detach()); 39200 } 39201 } 39202 }); 39203 } 39204 } 39205 /** Disables repositioning of the attached overlay on scroll. */ 39206 disable() { 39207 if (this._scrollSubscription) { 39208 this._scrollSubscription.unsubscribe(); 39209 this._scrollSubscription = null; 39210 } 39211 } 39212 detach() { 39213 this.disable(); 39214 this._overlayRef = null; 39215 } 39216} 39217 39218/** 39219 * Options for how an overlay will handle scrolling. 39220 * 39221 * Users can provide a custom value for `ScrollStrategyOptions` to replace the default 39222 * behaviors. This class primarily acts as a factory for ScrollStrategy instances. 39223 */ 39224let ScrollStrategyOptions = /*#__PURE__*/(() => { 39225 var _ScrollStrategyOptions; 39226 class ScrollStrategyOptions { 39227 constructor() { 39228 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_scrollDispatcher", (0,_angular_core__WEBPACK_IMPORTED_MODULE_5__.inject)(_scrolling_mjs__WEBPACK_IMPORTED_MODULE_6__.ScrollDispatcher)); 39229 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_viewportRuler", (0,_angular_core__WEBPACK_IMPORTED_MODULE_5__.inject)(_scrolling_mjs__WEBPACK_IMPORTED_MODULE_6__.ViewportRuler)); 39230 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_ngZone", (0,_angular_core__WEBPACK_IMPORTED_MODULE_5__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_5__.NgZone)); 39231 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_document", (0,_angular_core__WEBPACK_IMPORTED_MODULE_5__.inject)(_angular_common__WEBPACK_IMPORTED_MODULE_7__.DOCUMENT)); 39232 /** Do nothing on scroll. */ 39233 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "noop", () => new NoopScrollStrategy()); 39234 /** 39235 * Close the overlay as soon as the user scrolls.
39236 * @param config Configuration to be used inside the scroll strategy. 39237 */ 39238 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "close", config => new CloseScrollStrategy(this._scrollDispatcher, this._ngZone, this._viewportRuler, config)); 39239 /** Block scrolling. */ 39240 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "block", () => new BlockScrollStrategy(this._viewportRuler, this._document)); 39241 /** 39242 * Update the overlay's position on scroll. 39243 * @param config Configuration to be used inside the scroll strategy. 39244 * Allows debouncing the reposition calls. 39245 */ 39246 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "reposition", config => new RepositionScrollStrategy(this._scrollDispatcher, this._viewportRuler, this._ngZone, config)); 39247 } 39248 } 39249 _ScrollStrategyOptions = ScrollStrategyOptions; 39250 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(ScrollStrategyOptions, "\u0275fac", function _ScrollStrategyOptions_Factory(__ngFactoryType__) { 39251 return new (__ngFactoryType__ || _ScrollStrategyOptions)(); 39252 }); 39253 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(ScrollStrategyOptions, "\u0275prov", /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵdefineInjectable"]({ 39254 token: _ScrollStrategyOptions, 39255 factory: _ScrollStrategyOptions.ɵfac, 39256 providedIn: 'root' 39257 })); 39258 return ScrollStrategyOptions; 39259})(); 39260/*#__PURE__*/(() => { 39261 (typeof ngDevMode === "undefined" || ngDevMode) && void 0; 39262})(); 39263 39264/** Initial configuration used when creating an overlay. */ 39265class OverlayConfig { 39266 constructor(config) { 39267 /** Strategy with which to position the overlay. */ 39268 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "positionStrategy", void 0); 39269 /** Strategy to be used when handling scroll events while the overlay is open. */ 39270 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "scrollStrategy", new NoopScrollStrategy()); 39271 /** Custom class to add to the overlay pane. */ 39272 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "panelClass", ''); 39273 /** Whether the overlay has a backdrop. */ 39274 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "hasBackdrop", false); 39275 /** Custom class to add to the backdrop */ 39276 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "backdropClass", 'cdk-overlay-dark-backdrop'); 39277 /** The width of the overlay panel. If a number is provided, pixel units are assumed. */ 39278 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "width", void 0); 39279 /** The height of the overlay panel. If a number is provided, pixel units are assumed. */ 39280 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "height", void 0); 39281 /** The min-width of the overlay panel. If a number is provided, pixel units are assumed. */ 39282 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "minWidth", void 0); 39283 /** The min-height of the overlay panel. If a number is provided, pixel units are assumed. */ 39284 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "minHeight", void 0); 39285 /** The max-width of the overlay panel. If a number is provided, pixel units are assumed. */ 39286 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "maxWidth", void 0); 39287 /** The max-height of the overlay panel. If a number is provided, pixel units are assumed. */ 39288 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "maxHeight", void 0); 39289 /** 39290 * Direction of the text in the overlay panel. If a `Directionality` instance 39291 * is passed in, the overlay will handle changes to its value automatically. 39292 */ 39293 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "direction", void 0); 39294 /** 39295 * Whether the overlay should be disposed of when the user goes backwards/forwards in history. 39296 * Note that this usually doesn't include clicking on links (unless the user is using 39297 * the `HashLocationStrategy`). 39298 */ 39299 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "disposeOnNavigation", false); 39300 if (config) { 39301 // Use `Iterable` instead of `Array` because TypeScript, as of 3.6.3, 39302 // loses the array generic type in the `for of`. But we *also* have to use `Array` because 39303 // typescript won't iterate over an `Iterable` unless you compile with `--downlevelIteration` 39304 const configKeys = Object.keys(config); 39305 for (const key of configKeys) { 39306 if (config[key] !== undefined) { 39307 // TypeScript, as of version 3.5, sees the left-hand-side of this expression 39308 // as "I don't know *which* key this is, so the only valid value is the intersection 39309 // of all the possible values." In this case, that happens to be `undefined`. TypeScript 39310 // is not smart enough to see that the right-hand-side is actually an access of the same 39311 // exact type with the same exact key, meaning that the value type must be identical. 39312 // So we use `any` to work around this. 39313 this[key] = config[key]; 39314 } 39315 } 39316 } 39317 } 39318} 39319 39320/** The points of the origin element and the overlay element to connect. */ 39321class ConnectionPositionPair { 39322 constructor(origin, overlay, /** Offset along the X axis. */ 39323 offsetX, /** Offset along the Y axis. */ 39324 offsetY, /** Class(es) to be applied to the panel while this position is active. */ 39325 panelClass) { 39326 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "offsetX", void 0); 39327 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "offsetY", void 0); 39328 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "panelClass", void 0); 39329 /** X-axis attachment point for connected overlay origin. Can be 'start', 'end', or 'center'. */ 39330 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "originX", void 0); 39331 /** Y-axis attachment point for connected overlay origin. Can be 'top', 'bottom', or 'center'. */ 39332 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "originY", void 0); 39333 /** X-axis attachment point for connected overlay. Can be 'start', 'end', or 'center'. */ 39334 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "overlayX", void 0); 39335 /** Y-axis attachment point for connected overlay. Can be 'top', 'bottom', or 'center'. */ 39336 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "overlayY", void 0); 39337 this.offsetX = offsetX; 39338 this.offsetY = offsetY; 39339 this.panelClass = panelClass; 39340 this.originX = origin.originX; 39341 this.originY = origin.originY; 39342 this.overlayX = overlay.overlayX; 39343 this.overlayY = overlay.overlayY; 39344 } 39345} 39346/** 39347 * Set of properties regarding the position of the origin and overlay relative to the viewport 39348 * with respect to the containing Scrollable elements. 39349 * 39350 * The overlay and origin are clipped if any part of their bounding client rectangle exceeds the 39351 * bounds of any one of the strategy's Scrollable's bounding client rectangle. 39352 * 39353 * The overlay and origin are outside view if there is no overlap between their bounding client 39354 * rectangle and any one of the strategy's Scrollable's bounding client rectangle. 39355 * 39356 * ----------- ----------- 39357 * | outside | | clipped | 39358 * | view | -------------------------- 39359 * | | | | | | 39360 * ---------- | ----------- | 39361 * -------------------------- | | 39362 * | | | Scrollable | 39363 * | | | | 39364 * | | -------------------------- 39365 * | Scrollable | 39366 * | | 39367 * -------------------------- 39368 * 39369 * @docs-private 39370 */ 39371class ScrollingVisibility { 39372 constructor() { 39373 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "isOriginClipped", void 0); 39374 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "isOriginOutsideView", void 0); 39375 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "isOverlayClipped", void 0); 39376 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "isOverlayOutsideView", void 0); 39377 } 39378} 39379/** The change event emitted by the strategy when a fallback position is used. */ 39380class ConnectedOverlayPositionChange { 39381 constructor(/** The position used as a result of this change. */ 39382 connectionPair, /** @docs-private */ 39383 scrollableViewProperties) { 39384 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "connectionPair", void 0); 39385 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "scrollableViewProperties", void 0); 39386 this.connectionPair = connectionPair; 39387 this.scrollableViewProperties = scrollableViewProperties; 39388 } 39389} 39390/** 39391 * Validates whether a vertical position property matches the expected values. 39392 * @param property Name of the property being validated. 39393 * @param value Value of the property being validated. 39394 * @docs-private 39395 */ 39396function validateVerticalPosition(property, value) { 39397 if (value !== 'top' && value !== 'bottom' && value !== 'center') { 39398 throw Error(`ConnectedPosition: Invalid ${property} "${value}". ` + `Expected "top", "bottom" or "center".`); 39399 } 39400} 39401/** 39402 * Validates whether a horizontal position property matches the expected values. 39403 * @param property Name of the property being validated. 39404 * @param value Value of the property being validated. 39405 * @docs-private 39406 */ 39407function validateHorizontalPosition(property, value) { 39408 if (value !== 'start' && value !== 'end' && value !== 'center') { 39409 throw Error(`ConnectedPosition: Invalid ${property} "${value}". ` + `Expected "start", "end" or "center".`); 39410 } 39411} 39412 39413/** 39414 * Service for dispatching events that land on the body to appropriate overlay ref, 39415 * if any. It maintains a list of attached overlays to determine best suited overlay based 39416 * on event target and order of overlay opens. 39417 */ 39418let BaseOverlayDispatcher = /*#__PURE__*/(() => { 39419 var _BaseOverlayDispatcher; 39420 class BaseOverlayDispatcher { 39421 constructor() { 39422 /** Currently attached overlays in the order they were attached. */ 39423 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_attachedOverlays", []); 39424 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_document", (0,_angular_core__WEBPACK_IMPORTED_MODULE_5__.inject)(_angular_common__WEBPACK_IMPORTED_MODULE_7__.DOCUMENT)); 39425 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_isAttached", void 0); 39426 } 39427 ngOnDestroy() { 39428 this.detach(); 39429 } 39430 /** Add a new overlay to the list of attached overlay refs. */ 39431 add(overlayRef) { 39432 // Ensure that we don't get the same overlay multiple times. 39433 this.remove(overlayRef); 39434 this._attachedOverlays.push(overlayRef); 39435 } 39436 /** Remove an overlay from the list of attached overlay refs. */ 39437 remove(overlayRef) { 39438 const index = this._attachedOverlays.indexOf(overlayRef); 39439 if (index > -1) { 39440 this._attachedOverlays.splice(index, 1); 39441 } 39442 // Remove the global listener once there are no more overlays. 39443 if (this._attachedOverlays.length === 0) { 39444 this.detach(); 39445 } 39446 } 39447 } 39448 _BaseOverlayDispatcher = BaseOverlayDispatcher; 39449 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(BaseOverlayDispatcher, "\u0275fac", function _BaseOverlayDispatcher_Factory(__ngFactoryType__) { 39450 return new (__ngFactoryType__ || _BaseOverlayDispatcher)(); 39451 }); 39452 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(BaseOverlayDispatcher, "\u0275prov", /* @__P
39452URE__ */_angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵdefineInjectable"]({ 39453 token: _BaseOverlayDispatcher, 39454 factory: _BaseOverlayDispatcher.ɵfac, 39455 providedIn: 'root' 39456 })); 39457 return BaseOverlayDispatcher; 39458})(); 39459/*#__PURE__*/(() => { 39460 (typeof ngDevMode === "undefined" || ngDevMode) && void 0; 39461})(); 39462 39463/** 39464 * Service for dispatching keyboard events that land on the body to appropriate overlay ref, 39465 * if any. It maintains a list of attached overlays to determine best suited overlay based 39466 * on event target and order of overlay opens. 39467 */ 39468let OverlayKeyboardDispatcher = /*#__PURE__*/(() => { 39469 var _OverlayKeyboardDispatcher; 39470 class OverlayKeyboardDispatcher extends BaseOverlayDispatcher { 39471 constructor(...args) { 39472 super(...args); 39473 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_ngZone", (0,_angular_core__WEBPACK_IMPORTED_MODULE_5__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_5__.NgZone)); 39474 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_renderer", (0,_angular_core__WEBPACK_IMPORTED_MODULE_5__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_5__.RendererFactory2).createRenderer(null, null)); 39475 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_cleanupKeydown", void 0); 39476 /** Keyboard event listener that will be attached to the body. */ 39477 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_keydownListener", event => { 39478 const overlays = this._attachedOverlays; 39479 for (let i = overlays.length - 1; i > -1; i--) { 39480 // Dispatch the keydown event to the top overlay which has subscribers to its keydown events. 39481 // We want to target the most recent overlay, rather than trying to match where the event came 39482 // from, because some components might open an overlay, but keep focus on a trigger element 39483 // (e.g. for select and autocomplete). We skip overlays without keydown event subscriptions, 39484 // because we don't want overlays that don't handle keyboard events to block the ones below 39485 // them that do. 39486 if (overlays[i]._keydownEvents.observers.length > 0) { 39487 this._ngZone.run(() => overlays[i]._keydownEvents.next(event)); 39488 break; 39489 } 39490 } 39491 }); 39492 } 39493 /** Add a new overlay to the list of attached overlay refs. */ 39494 add(overlayRef) { 39495 super.add(overlayRef); 39496 // Lazily start dispatcher once first overlay is added 39497 if (!this._isAttached) { 39498 this._ngZone.runOutsideAngular(() => { 39499 this._cleanupKeydown = this._renderer.listen('body', 'keydown', this._keydownListener); 39500 }); 39501 this._isAttached = true; 39502 } 39503 } 39504 /** Detaches the global keyboard event listener. */ 39505 detach() { 39506 if (this._isAttached) { 39507 var _this$_cleanupKeydown; 39508 (_this$_cleanupKeydown = this._cleanupKeydown) === null || _this$_cleanupKeydown === void 0 || _this$_cleanupKeydown.call(this); 39509 this._isAttached = false; 39510 } 39511 } 39512 } 39513 _OverlayKeyboardDispatcher = OverlayKeyboardDispatcher; 39514 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(OverlayKeyboardDispatcher, "\u0275fac", /* @__PURE__ */(() => { 39515 let ɵ_OverlayKeyboardDispatcher_BaseFactory; 39516 return function _OverlayKeyboardDispatcher_Factory(__ngFactoryType__) { 39517 return (ɵ_OverlayKeyboardDispatcher_BaseFactory || (ɵ_OverlayKeyboardDispatcher_BaseFactory = _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵgetInheritedFactory"](_OverlayKeyboardDispatcher)))(__ngFactoryType__ || _OverlayKeyboardDispatcher); 39518 }; 39519 })()); 39520 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(OverlayKeyboardDispatcher, "\u0275prov", /* @__P
39520URE__ */_angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵdefineInjectable"]({ 39521 token: _OverlayKeyboardDispatcher, 39522 factory: _OverlayKeyboardDispatcher.ɵfac, 39523 providedIn: 'root' 39524 })); 39525 return OverlayKeyboardDispatcher; 39526})(); 39527/*#__PURE__*/(() => { 39528 (typeof ngDevMode === "undefined" || ngDevMode) && void 0; 39529})(); 39530 39531/** 39532 * Service for dispatching mouse click events that land on the body to appropriate overlay ref, 39533 * if any. It maintains a list of attached overlays to determine best suited overlay based 39534 * on event target and order of overlay opens. 39535 */ 39536let OverlayOutsideClickDispatcher = /*#__PURE__*/(() => { 39537 var _OverlayOutsideClickDispatcher; 39538 class OverlayOutsideClickDispatcher extends BaseOverlayDispatcher { 39539 constructor(...args) { 39540 super(...args); 39541 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_platform", (0,_angular_core__WEBPACK_IMPORTED_MODULE_5__.inject)(_platform_DmdVEw_C_mjs__WEBPACK_IMPORTED_MODULE_8__.P)); 39542 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_ngZone", (0,_angular_core__WEBPACK_IMPORTED_MODULE_5__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_5__.NgZone)); 39543 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_renderer", (0,_angular_core__WEBPACK_IMPORTED_MODULE_5__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_5__.RendererFactory2).createRenderer(null, null)); 39544 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_cursorOriginalValue", void 0); 39545 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_cursorStyleIsSet", false); 39546 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_pointerDownEventTarget", void 0); 39547 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_cleanups", void 0); 39548 /** Store pointerdown event target to track origin of click. */ 39549 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_pointerDownListener", event => { 39550 this._pointerDownEventTarget = (0,_shadow_dom_B0oHn41l_mjs__WEBPACK_IMPORTED_MODULE_9__._)(event); 39551 }); 39552 /** Click event listener that will be attached to the body propagate phase. */ 39553 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_clickListener", event => { 39554 const target = (0,_shadow_dom_B0oHn41l_mjs__WEBPACK_IMPORTED_MODULE_9__._)(event); 39555 // In case of a click event, we want to check the origin of the click 39556 // (e.g. in case where a user starts a click inside the overlay and 39557 // releases the click outside of it). 39558 // This is done by using the event target of the preceding pointerdown event. 39559 // Every click event caused by a pointer device has a preceding pointerdown 39560 // event, unless the click was programmatically triggered (e.g. in a unit test). 39561 const origin = event.type === 'click' && this._pointerDownEventTarget ? this._pointerDownEventTarget : target; 39562 // Reset the stored pointerdown event target, to avoid having it interfere 39563 // in subsequent events. 39564 this._pointerDownEventTarget = null; 39565 // We copy the array because the original may be modified asynchronously if the 39566 // outsidePointerEvents listener decides to detach overlays resulting in index errors inside 39567 // the for loop. 39568 const overlays = this._attachedOverlays.slice(); 39569 // Dispatch the mouse event to the top overlay which has subscribers to its mouse events. 39570 // We want to target all overlays for which the click could be considered as outside click. 39571 // As soon as we reach an overlay for which the click is not outside click we break off 39572 // the loop. 39573 for (let i = overlays.length - 1; i > -1; i--) { 39574 const overlayRef = overlays[i]; 39575 if (overlayRef._outsidePointerEvents.observers.length < 1 || !overlayRef.hasAttached()) { 39576 continue; 39577 } 39578 // If it's a click inside the overlay, just break - we should do n
39578othing 39579 // If it's an outside click (both origin and target of the click) dispatch the mouse event, 39580 // and proceed with the next overlay 39581 if (containsPierceShadowDom(overlayRef.overlayElement, target) || containsPierceShadowDom(overlayRef.overlayElement, origin)) { 39582 break; 39583 } 39584 const outsidePointerEvents = overlayRef._outsidePointerEvents; 39585 /** @breaking-change 14.0.0 _ngZone will be required. */ 39586 if (this._ngZone) { 39587 this._ngZone.run(() => outsidePointerEvents.next(event)); 39588 } else { 39589 outsidePointerEvents.next(event); 39590 } 39591 } 39592 }); 39593 } 39594 /** Add a new overlay to the list of attached overlay refs. */ 39595 add(overlayRef) { 39596 super.add(overlayRef); 39597 // Safari on iOS does not generate click events for non-interactive 39598 // elements. However, we want to receive a click for any element outside 39599 // the overlay. We can force a "clickable" state by setting 39600 // `cursor: pointer` on the document body. See: 39601 // https://developer.mozilla.org/en-US/docs/Web/API/Element/click_event#Safari_Mobile 39602 // https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html 39603 if (!this._isAttached) { 39604 const body = this._document.body; 39605 const eventOptions = { 39606 capture: true 39607 }; 39608 this._cleanups = this._ngZone.runOutsideAngular(() => [(0,_backwards_compatibility_DHR38MsD_mjs__WEBPACK_IMPORTED_MODULE_10__._)(this._renderer, body, 'pointerdown', this._pointerDownListener, eventOptions), (0,_backwards_compatibility_DHR38MsD_mjs__WEBPACK_IMPORTED_MODULE_10__._)(this._renderer, body, 'click', this._clickListener, eventOptions), (0,_backwards_compatibility_DHR38MsD_mjs__WEBPACK_IMPORTED_MODULE_10__._)(this._renderer, body, 'auxclick', this._clickListener, eventOptions), (0,_backwards_compatibility_DHR38MsD_mjs__WEBPACK_IMPORTED_MODULE_10__._)(this._renderer, body, 'contextmenu', this._clickListener, eventOptions)]); 39609 // click event is not fired on iOS. To make element "clickable" we are 39610 // setting the cursor to pointer 39611 if (this._platform.IOS && !this._cursorStyleIsSet) { 39612 this._cursorOriginalValue = body.style.cursor; 39613 body.style.cursor = 'pointer'; 39614 this._cursorStyleIsSet = true; 39615 } 39616 this._isAttached = true; 39617 } 39618 } 39619 /** Detaches the global keyboard event listener. */ 39620 detach() { 39621 if (this._isAttached) { 39622 var _this$_cleanups; 39623 (_this$_cleanups = this._cleanups) === null || _this$_cleanups === void 0 || _this$_cleanups.forEach(cleanup => cleanup()); 39624 this._cleanups = undefined; 39625 if (this._platform.IOS && this._cursorStyleIsSet) { 39626 this._document.body.style.cursor = this._cursorOriginalValue; 39627 this._cursorStyleIsSet = false; 39628 } 39629 this._isAttached = false; 39630 } 39631 } 39632 } 39633 _OverlayOutsideClickDispatcher = OverlayOutsideClickDispatcher; 39634 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(OverlayOutsideClickDispatcher, "\u0275fac", /* @__PURE__ */(() => { 39635 let ɵ_OverlayOutsideClickDispatcher_BaseFactory; 39636 return function _OverlayOutsideClickDispatcher_Factory(__ngFactoryType__) { 39637 return (ɵ_OverlayOutsideClickDispatcher_BaseFactory || (ɵ_OverlayOutsideClickDispatcher_BaseFactory = _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵgetInheritedFactory"](_OverlayOutsideClickDispatcher)))(__ngFactoryType__ || _OverlayOutsideClickDispatcher); 39638 }; 39639 })()); 39640 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(OverlayOutsideClickDispatcher, "\u0275prov", /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵdefineInjectable"]({ 39641 token: _OverlayOutsideClickDispatcher, 39642 factory: _OverlayOutsideClickDispatcher.ɵfac, 39643 providedIn: 'root' 39644 })); 39645 return OverlayOutsideClickDispatcher; 39646})(); 39647/*#__PURE__*/(() => { 39648 (typeof ngDevMode === "undefined" || ngDevMode) && void 0; 39649})(); 39650/** Version of `Element.contains` that transcends shadow DOM boundaries. */ 39651function containsPierceShadowDom(parent, child) { 39652 const supportsShadowRoot = typeof ShadowRoot !== 'undefined' && ShadowRoot; 39653 let current = child; 39654 while (current) { 39655 if (current === parent) { 39656 return true; 39657 } 39658 current = supportsShadowRoot && current instanceof ShadowRoot ? current.host : current.parentNode; 39659 } 39660 return false;
39661} 39662let _CdkOverlayStyleLoader = /*#__PURE__*/(() => { 39663 var _CdkOverlayStyleLoader2; 39664 class _CdkOverlayStyleLoader {} 39665 _CdkOverlayStyleLoader2 = _CdkOverlayStyleLoader; 39666 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(_CdkOverlayStyleLoader, "\u0275fac", function _CdkOverlayStyleLoader2_Factory(__ngFactoryType__) { 39667 return new (__ngFactoryType__ || _CdkOverlayStyleLoader2)(); 39668 }); 39669 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(_CdkOverlayStyleLoader, "\u0275cmp", /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵdefineComponent"]({ 39670 type: _CdkOverlayStyleLoader2, 39671 selectors: [["ng-component"]], 39672 hostAttrs: ["cdk-overlay-style-loader", ""], 39673 decls: 0, 39674 vars: 0, 39675 template: function _CdkOverlayStyleLoader2_Template(rf, ctx) {}, 39676 styles: [".cdk-overlay-container,.cdk-global-overlay-wrapper{pointer-events:none;top:0;left:0;height:100%;width:100%}.cdk-overlay-container{position:fixed}@layer cdk-overlay{.cdk-overlay-container{z-index:1000}}.cdk-overlay-container:empty{display:none}.cdk-global-overlay-wrapper{display:flex;position:absolute}@layer cdk-overlay{.cdk-global-overlay-wrapper{z-index:1000}}.cdk-overlay-pane{position:absolute;pointer-events:auto;box-sizing:border-box;display:flex;max-width:100%;max-height:100%}@layer cdk-overlay{.cdk-overlay-pane{z-index:1000}}.cdk-overlay-backdrop{position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:auto;-webkit-tap-highlight-color:rgba(0,0,0,0);opacity:0;touch-action:manipulation}@layer cdk-overlay{.cdk-overlay-backdrop{z-index:1000;transition:opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}}@media(prefers-reduced-motion){.cdk-overlay-backdrop{transition-duration:1ms}}.cdk-overlay-backdrop-showing{opacity:1}@media(forced-colors: active){.cdk-overlay-backdrop-showing{opacity:.6}}@layer cdk-overlay{.cdk-overlay-dark-backdrop{background:rgba(0,0,0,.32)}}.cdk-overlay-transparent-backdrop{transition:visibility 1ms linear,opacity 1ms linear;visibility:hidden;opacity:1}.cdk-overlay-transparent-backdrop.cdk-overlay-backdrop-showing,.cdk-high-contrast-active .cdk-overlay-transparent-backdrop{opacity:0;visibility:visible}.cdk-overlay-backdrop-noop-animation{transition:none}.cdk-overlay-connected-position-bounding-box{position:absolute;display:flex;flex-direction:column;min-width:1px;min-height:1px}@layer cdk-overlay{.cdk-overlay-connected-position-bounding-box{z-index:1000}}.cdk-global-scrollblock{position:fixed;width:100%;overflow-y:scroll}\n"], 39677 encapsulation: 2, 39678 changeDetection: 0 39679 })); 39680 return _CdkOverlayStyleLoader; 39681})(); 39682/*#__PURE__*/(() => { 39683 (typeof ngDevMode === "undefined" || ngDevMode) && void 0; 39684})(); 39685/** Container inside which all overlays will render. */ 39686let OverlayContainer = /*#__PURE__*/(() => { 39687 var _OverlayContainer; 39688 class OverlayContainer { 39689 constructor() { 39690 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_platform", (0,_angular_core__WEBPACK_IMPORTED_MODULE_5__.inject)(_platform_DmdVEw_C_mjs__WEBPACK_IMPORTED_MODULE_8__.P)); 39691 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_containerElement", void 0); 39692 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_document", (0,_angular_core__WEBPACK_IMPORTED_MODULE_5__.inject)(_angular_common__WEBPACK_IMPORTED_MODULE_7__.DOCUMENT)); 39693 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_styleLoader", (0,_angular_core__WEBPACK_IMPORTED_MODULE_5__.inject)(_style_loader_Cu9AvjH9_mjs__WEBPACK_IMPORTED_MODULE_11__._)); 39694 } 39695 ngOnDestroy() { 39696 var _this$_containerEleme; 39697 (_this$_containerEleme = this._containerElement) === null || _this$_containerEleme === void 0 || _this$_containerEleme.remove(); 39698 } 39699 /** 39700 * This method returns the overlay container element. It will lazily 39701 * create the element the first time it is called to facilitate using 39702 * the container in non-browser environments. 39703 * @returns the container element 39704 */ 39705 getContainerElement() { 39706 this._loadStyles(); 39707 if (!this._containerElement) { 39708 this._createContainer(); 39709 } 39710 return this._containerElement; 39711 } 39712 /** 39713 * Create the overlay container element, which is simply a div 39714 * with the 'cdk-overlay-container' class on the document body. 39715 */ 39716 _createContainer() { 39717 const containerClass = 'cdk-overlay-container'; 39718 // TODO(crisbeto): remove the testing check once we have an overlay testing 39719 // module or Angular starts tearing down the testing `NgModule`. See: 39720 // https://github.com/angular/angular/issues/18831 39721 if (this._platform.isBrowser || (0,_test_environment_CT0XxPyp_mjs__WEBPACK_IMPORTED_MODULE_12__._)()) { 39722 const oppositePlatformContainers = this._document.querySelectorAll(`.${containerClass}
39722[platform="server"], ` + `.${containerClass}[platform="test"]`); 39723 // Remove any old containers from the opposite platform. 39724 // This can happen when transitioning from the server to the client. 39725 for (let i = 0; i < oppositePlatformContainers.length; i++) { 39726 oppositePlatformContainers[i].remove(); 39727 } 39728 } 39729 const container = this._document.createElement('div'); 39730 container.classList.add(containerClass); 39731 // A long time ago we kept adding new overlay containers whenever a new app was instantiated, 39732 // but at some point we added logic which clears the duplicate ones in order to avoid leaks. 39733 // The new logic was a little too aggressive since it was breaking some legitimate use cases. 39734 // To mitigate the problem we made it so that only containers from a different platform are 39735 // cleared, but the side-effect was that people started depending on the overly-aggressive 39736 // logic to clean up their tests for them. Until we can introduce an overlay-specific testing 39737 // module which does the cleanup, we try to detect that we're in a test environment and we 39738 // always clear the container. See #17006. 39739 // TODO(crisbeto): remove the test environment check once we have an overlay testing module. 39740 if ((0,_test_environment_CT0XxPyp_mjs__WEBPACK_IMPORTED_MODULE_12__._)()) { 39741 container.setAttribute('platform', 'test'); 39742 } else if (!this._platform.isBrowser) { 39743 container.setAttribute('platform', 'server'); 39744 } 39745 this._document.body.appendChild(container); 39746 this._containerElement = container; 39747 } 39748 /** Loads the structural styles necessary for the overlay to work. */ 39749 _loadStyles() { 39750 this._styleLoader.load(_CdkOverlayStyleLoader); 39751 } 39752 } 39753 _OverlayContainer = OverlayContainer; 39754 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(OverlayContainer, "\u0275fac", function _OverlayContainer_Factory(__ngFactoryType__) { 39755 return new (__ngFactoryType__ || _OverlayContainer)(); 39756 }); 39757 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(OverlayContainer, "\u0275prov", /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵdefineInjectable"]({ 39758 token: _OverlayContainer, 39759 factory: _OverlayContainer.ɵfac, 39760 providedIn: 'root' 39761 })); 39762 return OverlayContainer; 39763})(); 39764/*#__PURE__*/(() => { 39765 (typeof ngDevMode === "undefined" || ngDevMode) && void 0; 39766})(); 39767 39768/** Encapsulates the logic for attaching and detaching a backdrop. */ 39769class BackdropRef { 39770 constructor(document, _renderer, _ngZone, onClick) { 39771 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_renderer", void 0); 39772 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_ngZone", void 0); 39773 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "element", void 0); 39774 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_cleanupClick", void 0); 39775 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_cleanupTransitionEnd", void 0); 39776 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_fallbackTimeout", void 0); 39777 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "dispose", () => { 39778 var _this$_cleanupClick, _this$_cleanupTransit; 39779 clearTimeout(this._fallbackTimeout); 39780 (_this$_cleanupClick = this._cleanupClick) === null || _this$_cleanupClick === void 0 || _this$_cleanupClick.call(this); 39781 (_this$_cleanupTransit = this._cleanupTransitionEnd) === null || _this$_cleanupTransit === void 0 || _this$_cleanupTransit.call(this); 39782 this._cleanupClick = this._cleanupTransitionEnd = this._fallbackTimeout = undefined; 39783 this.element.remove(); 39784 }); 39785 this._renderer = _renderer; 39786 this._ngZone = _ngZone; 39787 this.element = document.createElement('div'); 39788 this.element.classList.add('cdk-overlay-backdrop'); 39789 this._cleanupClick = _renderer.listen(this.element, 'click', onClick); 39790 } 39791 detach() { 39792 this._ngZone.runOutsideAngular(() => { 39793 var _this$_cleanupTransit2; 39794 const element = this.element; 39795 clearTimeout(this._fallbackTimeout); 39796 (_this$_cleanupTransit2 = this._cleanupTransitionEnd) === null || _this$_cleanupTransit2 === void 0 || _this$_cleanupTransit2.call(this); 39797 this._cleanupTransitionEnd = this._renderer.listen(element, 'transitionend', this.dispose); 39798 this._fallbackTimeout = setTimeout(this.dispose, 500); 39799 // If the backdrop doesn't have a transition, the `transitionend` event won't fire. 39800 // In this case we make it unclickable and we try to remove it after a delay. 39801 element.style.pointerEvents = 'none'; 39802 element.classList.remove('cdk-overlay-backdrop-showing'); 39803 }); 39804 } 39805} 39806 39807/** 39808 * Reference to an overlay that has been created with the Overlay service. 39809 * Used to manipulate or dispose of said overlay. 39810 */ 39811class OverlayRef {
39812 constructor(_portalOutlet, _host, _pane, _config, _ngZone, _keyboardDispatcher, _document, _location, _outsideClickDispatcher, _animationsDisabled = false, _injector, _renderer) { 39813 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_portalOutlet", void 0); 39814 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_host", void 0); 39815 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_pane", void 0); 39816 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_config", void 0); 39817 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_ngZone", void 0); 39818 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_keyboardDispatcher", void 0); 39819 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_document", void 0); 39820 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_location", void 0); 39821 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_outsideClickDispatcher", void 0); 39822 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_animationsDisabled", void 0); 39823 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_injector", void 0); 39824 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_renderer", void 0); 39825 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_backdropClick", new rxjs__WEBPACK_IMPORTED_MODULE_13__.Subject()); 39826 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_attachments", new rxjs__WEBPACK_IMPORTED_MODULE_13__.Subject()); 39827 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_detachments", new rxjs__WEBPACK_IMPORTED_MODULE_13__.Subject()); 39828 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_positionStrategy", void 0); 39829 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_scrollStrategy", void 0); 39830 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_locationChanges", rxjs__WEBPACK_IMPORTED_MODULE_14__.Subscription.EMPTY); 39831 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_backdropRef", null); 39832 /** 39833 * Reference to the parent of the `_host` at the time it was detached. Used to restore 39834 * the `_host` to its original position in the DOM when it gets re-attached. 39835 */ 39836 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_previousHostParent", void 0); 39837 /** Stream of keydown events dispatched to this overlay. */ 39838 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_keydownEvents", new rxjs__WEBPACK_IMPORTED_MODULE_13__.Subject()); 39839 /** Stream of mouse outside events dispatched to this overlay. */ 39840 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_outsidePointerEvents", new rxjs__WEBPACK_IMPORTED_MODULE_13__.Subject()); 39841 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_renders", new rxjs__WEBPACK_IMPORTED_MODULE_13__.Subject()); 39842 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_afterRenderRef", void 0); 39843 /** Reference to the currently-running `afterNextRender` call. */ 39844 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_afterNextRenderRef", void 0); 39845 this._portalOutlet = _portalOutlet; 39846 this._host = _host; 39847 this._pane = _pane; 39848 this._config = _config; 39849 this._ngZone = _ngZone; 39850 this._keyboardDispatcher = _keyboardDispatcher; 39851 this._document = _document; 39852 this._location = _location; 39853 this._outsideClickDispatcher = _outsideClickDispatcher; 39854 this._animationsDisabled = _animationsDisabled; 39855 this._injector = _injector; 39856 this._renderer = _renderer; 39857 if (_config.scrollStrategy) { 39858 this._scrollStrategy = _config.scrollStrategy; 39859 this._scrollStrategy.attach(this); 39860 } 39861 this._positionStrategy = _config.positionStrategy; 39862 // Users could open the overlay from an `effect`, in which case we need to 39863 // run the `afterRender` as `untracked`. We don't recommend that users do 39864 // this, but we also don't want to break users who are doing it. 39865 this._afterRenderRef = (0,_angular_core__WEBPACK_IMPORTED_MODULE_5__.untracked)(() =>
39865 (0,_angular_core__WEBPACK_IMPORTED_MODULE_5__.afterRender)(() => { 39866 this._renders.next(); 39867 }, { 39868 injector: this._injector 39869 })); 39870 } 39871 /** The overlay's HTML element */ 39872 get overlayElement() { 39873 return this._pane; 39874 } 39875 /** The overlay's backdrop HTML element. */ 39876 get backdropElement() { 39877 var _this$_backdropRef; 39878 return ((_this$_backdropRef = this._backdropRef) === null || _this$_backdropRef === void 0 ? void 0 : _this$_backdropRef.element) || null; 39879 } 39880 /** 39881 * Wrapper around the panel element. Can be used for advanced 39882 * positioning where a wrapper with specific styling is 39883 * required around the overlay pane. 39884 */ 39885 get hostElement() { 39886 return this._host; 39887 } 39888 /** 39889 * Attaches content, given via a Portal, to the overlay. 39890 * If the overlay is configured to have a backdrop, it will be created. 39891 * 39892 * @param portal Portal instance to which to attach the overlay. 39893 * @returns The portal attachment result. 39894 */ 39895 attach(portal) { 39896 var _this$_afterNextRende; 39897 // Insert the host into the DOM before attaching the portal, otherwise 39898 // the animations module will skip animations on repeat attachments. 39899 if (!this._host.parentElement && this._previousHostParent) { 39900 this._previousHostParent.appendChild(this._host); 39901 } 39902 const attachResult = this._portalOutlet.attach(portal); 39903 if (this._positionStrategy) { 39904 this._positionStrategy.attach(this); 39905 } 39906 this._updateStackingOrder(); 39907 this._updateElementSize(); 39908 this._updateElementDirection(); 39909 if (this._scrollStrategy) { 39910 this._scrollStrategy.enable(); 39911 } 39912 // We need to clean this up ourselves, because we're passing in an 39913 // `EnvironmentInjector` below which won't ever be destroyed. 39914 // Otherwise it causes some callbacks to be retained (see #29696). 39915 (_this$_afterNextRende = this._afterNextRenderRef) === null || _this$_afterNextRende === void 0 || _this$_afterNextRende.destroy(); 39916 // Update the position once the overlay is fully rendered before attempting to position it, 39917 // as the position may depend on the size of the rendered content. 39918 this._afterNextRenderRef = (0,_angular_core__WEBPACK_IMPORTED_MODULE_5__.afterNextRender)(() => { 39919 // The overlay could've been detached before the callback executed. 39920 if (this.hasAttached()) { 39921 this.updatePosition(); 39922 } 39923 }, { 39924 injector: this._injector 39925 }); 39926 // Enable pointer events for the overlay pane element. 39927 this._togglePointerEvents(true); 39928 if (this._config.hasBackdrop) { 39929 this._attachBackdrop(); 39930 } 39931 if (this._config.panelClass) { 39932 this._toggleClasses(this._pane, this._config.panelClass, true); 39933 } 39934 // Only emit the `attachments` event once all other setup is done. 39935 this._attachments.next(); 39936 // Track this overlay by the keyboard dispatcher 39937 this._keyboardDispatcher.add(this); 39938 if (this._config.disposeOnNavigation) { 39939 this._locationChanges = this._location.subscribe(() => this.dispose()); 39940 } 39941 this._outsideClickDispatcher.add(this); 39942 // TODO(crisbeto): the null check is here, because the portal outlet returns `any`. 39943 // We should be guaranteed for the result to be `ComponentRef | EmbeddedViewRef`, but 39944 // `instanceof EmbeddedViewRef` doesn't appear to work at the moment. 39945 if (typeof (attachResult === null || attachResult === void 0 ? void 0 : attachResult.onDestroy) === 'function') { 39946 // In most cases we control the portal and we know when it is being detached so that 39947 // we can finish the disposal process. The exception is if the user passes in a custom 39948 // `ViewContainerRef` that isn't destroyed through the overlay API. Note that we use 39949 // `detach` here instead of `dispose`, because we don't know if the user intends to 39950 // reattach the overlay at a later point. It also has the advantage of waiting for animations. 39951 attachResult.onDestroy(() => { 39952 if (this.hasAttached()) { 39953 // We have to delay the `detach` call, because detaching immediately prevents 39954 // other destroy hooks from running. This is likely a framework bug similar to 39955 // https://github.com/angular/angular/issues/46119 39956 this._ngZone.runOutsideAngular(() => Promise.resolve().then(() => this.detach())); 39957 } 39958 }); 39959 } 39960 return attachResult; 39961 } 39962 /** 39963 * Detaches an overlay from a portal. 39964 * @returns The portal detachment result. 39965 */ 39966 detach() { 39967 if (!this.hasAttached()) { 39968 return; 39969 } 39970 this.detachBackdrop(); 39971 // When the overlay is detached, the pane element should disable pointer events. 39972 // This is necessary because otherwise the pane element will cover the page and disable 39973 // pointer events therefore. Depends on the position strategy and the applied pane boundaries. 39974 this._togglePointerEvents(false); 39975 if (this._positionStrategy && this._positionStrategy.detach) { 39976 this._positionStrategy.detach(); 39977 } 39978 if (this._scrollStrategy) { 39979 this._scrollStrategy.disable(); 39980 } 39981 const detachmentResult = this._portalOutlet.detach(); 39982 // Only emit after everything is detached. 39983 this._detachments.next(); 39984 // Remove this overlay from keyboard dispatcher tracking. 39985 this._keyboardDispatcher.remove(this); 39986 // Keeping the host element in the DOM can cause scroll jank, because it still gets 39987 // rendered, even though it's transparent and unclickable which is why we remove it. 39988 this._detachContentWhenEmpty(); 39989 this._locationChanges.unsubscribe(); 39990 this._outsideClickDispatcher.remove(this); 39991 return detachmentResult; 39992 } 39993 /** Cleans up the overlay from the DOM. */ 39994 dispose() { 39995 var _this$_backdropRef2, _this$_host, _this$_afterNextRende2; 39996 const isAttached = this.hasAttached(); 39997 if (this._positionStrategy) { 39998 this._positionStrategy.dispose(); 39999 } 40000 this._disposeScrollStrategy(); 40001 (_this$_backdropRef2 = this._backdropRef) === null || _this$_backdropRef2 === void 0 || _this$_backdropRef2.dispose(); 40002 this._locationChanges.unsubscribe(); 40003 this._keyboardDispatcher.remove(this);
40004 this._portalOutlet.dispose(); 40005 this._attachments.complete(); 40006 this._backdropClick.complete(); 40007 this._keydownEvents.complete(); 40008 this._outsidePointerEvents.complete(); 40009 this._outsideClickDispatcher.remove(this); 40010 (_this$_host = this._host) === null || _this$_host === void 0 || _this$_host.remove(); 40011 (_this$_afterNextRende2 = this._afterNextRenderRef) === null || _this$_afterNextRende2 === void 0 || _this$_afterNextRende2.destroy(); 40012 this._previousHostParent = this._pane = this._host = this._backdropRef = null; 40013 if (isAttached) { 40014 this._detachments.next(); 40015 } 40016 this._detachments.complete(); 40017 this._afterRenderRef.destroy(); 40018 this._renders.complete(); 40019 } 40020 /** Whether the overlay has attached content. */ 40021 hasAttached() { 40022 return this._portalOutlet.hasAttached(); 40023 } 40024 /** Gets an observable that emits when the backdrop has been clicked. */ 40025 backdropClick() { 40026 return this._backdropClick; 40027 } 40028 /** Gets an observable that emits when the overlay has been attached. */ 40029 attachments() { 40030 return this._attachments; 40031 } 40032 /** Gets an observable that emits when the overlay has been detached. */ 40033 detachments() { 40034 return this._detachments; 40035 } 40036 /** Gets an observable of keydown events targeted to this overlay. */ 40037 keydownEvents() { 40038 return this._keydownEvents; 40039 } 40040 /** Gets an observable of pointer events targeted outside this overlay. */ 40041 outsidePointerEvents() { 40042 return this._outsidePointerEvents; 40043 } 40044 /** Gets the current overlay configuration, which is immutable. */ 40045 getConfig() { 40046 return this._config; 40047 } 40048 /** Updates the position of the overlay based on the position strategy. */ 40049 updatePosition() { 40050 if (this._positionStrategy) { 40051 this._positionStrategy.apply(); 40052 } 40053 } 40054 /** Switches to a new position strategy and updates the overlay position. */ 40055 updatePositionStrategy(strategy) { 40056 if (strategy === this._positionStrategy) { 40057 return; 40058 } 40059 if (this._positionStrategy) { 40060 this._positionStrategy.dispose(); 40061 } 40062 this._positionStrategy = strategy; 40063 if (this.hasAttached()) { 40064 strategy.attach(this); 40065 this.updatePosition(); 40066 } 40067 } 40068 /** Update the size properties of the overlay. */ 40069 updateSize(sizeConfig) { 40070 this._config = (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({}, this._config), sizeConfig); 40071 this._updateElementSize(); 40072 } 40073 /** Sets the LTR/RTL direction for the overlay. */ 40074 setDirection(dir) { 40075 this._config = (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({}, this._config), {}, { 40076 direction: dir 40077 }); 40078 this._updateElementDirection(); 40079 } 40080 /** Add a CSS class or an array of classes to the overlay pane. */ 40081 addPanelClass(classes) { 40082 if (this._pane) { 40083 this._toggleClasses(this._pane, classes, true); 40084 } 40085 } 40086 /** Remove a CSS class or an array of classes from the overlay pane. */ 40087 removePanelClass(classes) { 40088 if (this._pane) { 40089 this._toggleClasses(this._pane, classes, false); 40090 } 40091 } 40092 /** 40093 * Returns the layout direction of the overlay panel. 40094 */ 40095 getDirection() { 40096 const direction = this._config.direction; 40097 if (!direction) { 40098 return 'ltr'; 40099 } 40100 return typeof direction === 'string' ? direction : direction.value; 40101 } 40102 /** Switches to a new scroll strategy. */ 40103 updateScrollStrategy(strategy) { 40104 if (strategy === this._scrollStrategy) { 40105 return; 40106 } 40107 this._disposeScrollStrategy(); 40108 this._scrollStrategy = strategy; 40109 if (this.hasAttached()) { 40110 strategy.attach(this); 40111 strategy.enable(); 40112 } 40113 } 40114 /** Updates the text direction of the overlay panel. */ 40115 _updateElementDirection() { 40116 this._host.setAttribute('dir', this.getDirection()); 40117 } 40118 /** Updates the size of the overlay element based on the overlay config. */ 40119 _updateElementSize() { 40120 if (!this._pane) { 40121 return; 40122 } 40123 const style = this._pane.style; 40124 style.width = (0,_css_pixel_value_C_HEqLhI_mjs__WEBPACK_IMPORTED_MODULE_3__.c)(this._config.width); 40125 style.height = (0,_css_pixel_value_C_HEqLhI_mjs__WEBPACK_IMPORTED_MODULE_3__.c)(this._config.height); 40126 style.minWidth = (0,_css_pixel_value_C_HEqLhI_mjs__WEBPACK_IMPORTED_MODULE_3__.c)(this._config.minWidth); 40127 style.minHeight = (0,_css_pixel_value_C_HEqLhI_mjs__WEBPACK_IMPORTED_MODULE_3__.c)(this._config.minHeight); 40128 style.maxWidth = (0,_css_pixel_value_C_HEqLhI_mjs__WEBPACK_IMPORTED_MODULE_3__.c)(this._config.maxWidth); 40129 style.maxHeight = (0,_css_pixel_value_C_HEqLhI_mjs__WEBPACK_IMPORTED_MODULE_3__.c)(this._config.maxHeight); 40130 } 40131 /** Toggles the pointer events for the overlay pane element. */ 40132 _togglePointerEvents(enablePointer) { 40133 this._pane.style.pointerEvents = enablePointer ? '' : 'none'; 40134 } 40135 /** Attaches a backdrop for this overlay. */ 40136 _attachBackdrop() { 40137 var _this$_backdropRef3; 40138 const showingClass = 'cdk-overlay-backdrop-showing'; 40139 (_this$_backdropRef3 = this._backdropRef) === null || _this$_backdropRef3 === void 0 || _this$_backdropRef3.dispose(); 40140 this._backdropRef = new BackdropRef(this._document, this._renderer, this._ngZone, event => { 40141 this._backdropClick.next(event); 40142 }); 40143 if (this._animationsDisabled) { 40144 this._backdropRef.element.classList.add('cdk-overlay-backdrop-noop-animation'); 40145 } 40146 if (this._config.backdropClass) { 40147 this._toggleClasses(this._backdropRef.element, this._config.backdropClass, true); 40148 } 40149 // Insert the backdrop before the pane in the DOM order, 40150 // in order to handle stacked overlays properly. 40151 this._host.parentElement.insertBefore(this._backdropRef.element, this._host); 40152 // Add class to fade-in the backdrop after one frame. 40153 if (!this._animationsDisabled && typeof requestAnimationFrame !== 'undefined') { 40154 this._ngZone.runOutsideAngular(() => { 40155 requestAnimationFrame(() => { 40156 var _this$_backdropRef4; 40157 return (_this$_backdropRef4 = this._backdropRef) === null || _this$_backdropRef4 === void 0 ? void 0 : _this$_backdropRef4.element.classList.add(showingClass); 40158 }); 40159 }); 40160 } else { 40161 this._backdropRef.element.classList.add(showingClass); 40162 } 40163 } 40164 /** 40165 * Updates the stacking order of the element, moving it to the top if necessary. 40166 * This is required in cases where one overlay was detached, while another one, 40167 * that should be behind it, was destroyed. The next time both of them are opened, 40168 * the stacking will be wrong, because the detached element's pane will still be 40169 * in its original DOM position. 40170 */ 40171 _updateStackingOrder() { 40172 if (this._host.nextSibling) { 40173 this._host.parentNode.appendChild(this._host); 40174 } 40175 } 40176 /** Detaches the backdrop (if any) associated with the overlay. */ 40177 detachBackdrop() { 40178 if (this._animationsDisabled) { 40179 var _this$_backdropRef5; 40180 (_this$_backdropRef5 = this._backdropRef) === null || _this$_backdropRef5 === void 0 || _this$_backdropRef5.dispose(); 40181 this._backdropRef = null; 40182 } else { 40183 var _this$_backdropRef6; 40184 (_this$_backdropRef6 = this._backdropRef) === null || _this$_backdropRef6 === void 0 || _this$_backdropRef6.detach(); 40185 } 40186 } 40187 /** Toggles a single CSS class or an array of classes on an element. */
40188 _toggleClasses(element, cssClasses, isAdd) { 40189 const classes = (0,_array_I1yfCXUO_mjs__WEBPACK_IMPORTED_MODULE_15__.c)(cssClasses || []).filter(c => !!c); 40190 if (classes.length) { 40191 isAdd ? element.classList.add(...classes) : element.classList.remove(...classes); 40192 } 40193 } 40194 /** Detaches the overlay content next time the zone stabilizes. */ 40195 _detachContentWhenEmpty() { 40196 // Normally we wouldn't have to explicitly run this outside the `NgZone`, however 40197 // if the consumer is using `zone-patch-rxjs`, the `Subscription.unsubscribe` call will 40198 // be patched to run inside the zone, which will throw us into an infinite loop. 40199 this._ngZone.runOutsideAngular(() => { 40200 // We can't remove the host here immediately, because the overlay pane's content 40201 // might still be animating. This stream helps us avoid interrupting the animation 40202 // by waiting for the pane to become empty. 40203 const subscription = this._renders.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_16__.takeUntil)((0,rxjs__WEBPACK_IMPORTED_MODULE_17__.merge)(this._attachments, this._detachments))).subscribe(() => { 40204 // Needs a couple of checks for the pane and host, because 40205 // they may have been removed by the time the zone stabilizes. 40206 if (!this._pane || !this._host || this._pane.children.length === 0) { 40207 if (this._pane && this._config.panelClass) { 40208 this._toggleClasses(this._pane, this._config.panelClass, false); 40209 } 40210 if (this._host && this._host.parentElement) { 40211 this._previousHostParent = this._host.parentElement; 40212 this._host.remove(); 40213 } 40214 subscription.unsubscribe(); 40215 } 40216 }); 40217 }); 40218 } 40219 /** Disposes of a scroll strategy. */ 40220 _disposeScrollStrategy() { 40221 var _scrollStrategy$detac; 40222 const scrollStrategy = this._scrollStrategy; 40223 scrollStrategy === null || scrollStrategy === void 0 || scrollStrategy.disable(); 40224 scrollStrategy === null || scrollStrategy === void 0 || (_scrollStrategy$detac = scrollStrategy.detach) === null || _scrollStrategy$detac === void 0 || _scrollStrategy$detac.call(scrollStrategy); 40225 } 40226} 40227 40228// TODO: refactor clipping detection into a separate thing (part of scrolling module) 40229// TODO: doesn't handle both flexible width and height when it has to scroll along both axis. 40230/** Class to be added to the overlay bounding box. */ 40231const boundingBoxClass = 'cdk-overlay-connected-position-bounding-box'; 40232/** Regex used to split a string on its CSS units. */ 40233const cssUnitPattern = /([A-Za-z%]+)$/; 40234/** 40235 * A strategy for positioning overlays. Using this strategy, an overlay is given an 40236 * implicit position relative some origin element. The relative position is defined in terms of 40237 * a point on the origin element that is connected to a point on the overlay element. For example, 40238 * a basic dropdown is connecting the bottom-left corner of the origin to the top-left corner 40239 * of the overlay. 40240 */ 40241class FlexibleConnectedPositionStrategy { 40242 /** Ordered list of preferred positions, from most to least desirable. */ 40243 get positions() { 40244 return this._preferredPositions; 40245 } 40246 constructor(connectedTo, _viewportRuler, _document, _platform, _overlayContainer) { 40247 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_viewportRuler", void 0); 40248 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_document", void 0); 40249 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_platform", void 0); 40250 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_overlayContainer", void 0); 40251 /** The overlay to which this strategy is attached. */ 40252 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_overlayRef", void 0); 40253 /** Whether we're performing the very first positioning of the overlay. */ 40254 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_isInitialRender", void 0); 40255 /** Last size used for the bounding box. Used to avoid resizing the overlay after open. */ 40256 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_lastBoundingBoxSize", { 40257 width: 0, 40258 height: 0 40259 }); 40260 /** Whether the overlay was pushed in a previous positioning. */ 40261 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_isPushed", false); 40262 /** Whether the overlay can be pushed on-screen on the initial open. */ 40263 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_canPush", true); 40264 /** Whether the overlay can grow via flexible width/height after the initial open. */ 40265 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_growAfterOpen", false); 40266 /** Whether the overlay's width and height can be constrained to fit within the viewport. */ 40267 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_hasFlexibleDimensions", true); 40268 /** Whether the overlay position is locked. */ 40269 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_positionLocked", false); 40270 /** Cached origin dimensions */ 40271 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_originRect", void 0); 40272 /** Cached overlay dimensions */ 40273 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_overlayRect", void 0); 40274 /** Cached viewport dimensions */ 40275 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_viewportRect", void 0); 40276 /** Cached container dimensions */ 40277 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_containerRect", void 0); 40278 /** Amount of space that must be maintained between the overlay and the edge of the viewport. */ 40279 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_viewportMargin", 0);
40280 /** The Scrollable containers used to check scrollable view properties on position change. */ 40281 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_scrollables", []); 40282 /** Ordered list of preferred positions, from most to least desirable. */ 40283 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_preferredPositions", []); 40284 /** The origin element against which the overlay will be positioned. */ 40285 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_origin", void 0); 40286 /** The overlay pane element. */ 40287 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_pane", void 0); 40288 /** Whether the strategy has been disposed of already. */ 40289 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_isDisposed", void 0); 40290 /** 40291 * Parent element for the overlay panel used to constrain the overlay panel's size to fit 40292 * within the viewport. 40293 */ 40294 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_boundingBox", void 0); 40295 /** The last position to have been calculated as the best fit position. */ 40296 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_lastPosition", void 0); 40297 /** The last calculated scroll visibility. Only tracked */ 40298 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_lastScrollVisibility", void 0); 40299 /** Subject that emits whenever the position changes. */ 40300 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_positionChanges", new rxjs__WEBPACK_IMPORTED_MODULE_13__.Subject()); 40301 /** Subscription to viewport size changes. */ 40302 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_resizeSubscription", rxjs__WEBPACK_IMPORTED_MODULE_14__.Subscription.EMPTY); 40303 /** Default offset for the overlay along the x axis. */ 40304 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_offsetX", 0); 40305 /** Default offset for the overlay along the y axis. */ 40306 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_offsetY", 0); 40307 /** Selector to be used when finding the elements on which to set the transform origin. */ 40308 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_transformOriginSelector", void 0); 40309 /** Keeps track of the CSS classes that the position strategy has applied on the overlay panel. */ 40310 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_appliedPanelClasses", []); 40311 /** Amount by which the overlay was pushed in each axis during the last time it was positioned. */ 40312 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_previousPushAmount", void 0); 40313 /** Observable sequence of position changes. */ 40314 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "positionChanges", this._positionChanges); 40315 this._viewportRuler = _viewportRuler; 40316 this._document = _document; 40317 this._platform = _platform; 40318 this._overlayContainer = _overlayContainer; 40319 this.setOrigin(connectedTo); 40320 } 40321 /** Attaches this position strategy to an overlay. */ 40322 attach(overlayRef) {
40323 if (this._overlayRef && overlayRef !== this._overlayRef && (typeof ngDevMode === 'undefined' || ngDevMode)) { 40324 throw Error('This position strategy is already attached to an overlay'); 40325 } 40326 this._validatePositions(); 40327 overlayRef.hostElement.classList.add(boundingBoxClass); 40328 this._overlayRef = overlayRef; 40329 this._boundingBox = overlayRef.hostElement; 40330 this._pane = overlayRef.overlayElement; 40331 this._isDisposed = false; 40332 this._isInitialRender = true; 40333 this._lastPosition = null; 40334 this._resizeSubscription.unsubscribe(); 40335 this._resizeSubscription = this._viewportRuler.change().subscribe(() => { 40336 // When the window is resized, we want to trigger the next reposition as if it 40337 // was an initial render, in order for the strategy to pick a new optimal position, 40338 // otherwise position locking will cause it to stay at the old one. 40339 this._isInitialRender = true; 40340 this.apply(); 40341 }); 40342 } 40343 /** 40344 * Updates the position of the overlay element, using whichever preferred position relative 40345 * to the origin best fits on-screen. 40346 * 40347 * The selection of a position goes as follows: 40348 * - If any positions fit completely within the viewport as-is, 40349 * choose the first position that does so. 40350 * - If flexible dimensions are enabled and at least one satisfies the given minimum width/height, 40351 * choose the position with the greatest available size modified by the positions' weight. 40352 * - If pushing is enabled, take the position that went off-screen the least and push it 40353 * on-screen. 40354 * - If none of the previous criteria were met, use the position that goes off-screen the least. 40355 * @docs-private 40356 */ 40357 apply() { 40358 // We shouldn't do anything if the strategy was disposed or we're on the server. 40359 if (this._isDisposed || !this._platform.isBrowser) { 40360 return; 40361 } 40362 // If the position has been applied already (e.g. when the overlay was opened) and the 40363 // consumer opted into locking in the position, re-use the old position, in order to 40364 // prevent the overlay from jumping around. 40365 if (!this._isInitialRender && this._positionLocked && this._lastPosition) { 40366 this.reapplyLastPosition(); 40367 return; 40368 } 40369 this._clearPanelClasses(); 40370 this._resetOverlayElementStyles(); 40371 this._resetBoundingBoxStyles(); 40372 // We need the bounding rects for the origin, the overlay and the container to determine how to position 40373 // the overlay relative to the origin. 40374 // We use the viewport rect to determine whether a position would go off-screen. 40375 this._viewportRect = this._getNarrowedViewportRect(); 40376 this._originRect = this._getOriginRect(); 40377 this._overlayRect = this._pane.getBoundingClientRect(); 40378 this._containerRect = this._overlayContainer.getContainerElement().getBoundingClientRect(); 40379 const originRect = this._originRect; 40380 const overlayRect = this._overlayRect; 40381 const viewportRect = this._viewportRect; 40382 const containerRect = this._containerRect; 40383 // Positions where the overlay will fit with flexible dimensions. 40384 const flexibleFits = []; 40385 // Fallback if none of the preferred positions fit within the viewport. 40386 let fallback; 40387 // Go through each of the preferred positions looking for a good fit. 40388 // If a good fit is found, it will be applied immediately. 40389 for (let pos of this._preferredPositions) { 40390 // Get the exact (x, y) coordinate for the point-of-origin on the origin element. 40391 let originPoint = this._getOriginPoint(originRect, containerRect, pos); 40392 // From that point-of-origin, get the exact (x, y) coordinate for the top-left corner of the 40393 // overlay in this position. We use the top-left corner for calculations and later translate 40394 // this into an appropriate (top, left, bottom, right) style. 40395 let overlayPoint = this._getOverlayPoint(originPoint, overlayRect, pos); 40396 // Calculate how well the overlay would fit into the viewport with this point. 40397 let overlayFit = this._getOverlayFit(overlayPoint, overlayRect, viewportRect, pos); 40398 // If the overlay, without any further work, fits into the viewport, use this position.
40399 if (overlayFit.isCompletelyWithinViewport) { 40400 this._isPushed = false; 40401 this._applyPosition(pos, originPoint); 40402 return; 40403 } 40404 // If the overlay has flexible dimensions, we can use this position 40405 // so long as there's enough space for the minimum dimensions. 40406 if (this._canFitWithFlexibleDimensions(overlayFit, overlayPoint, viewportRect)) { 40407 // Save positions where the overlay will fit with flexible dimensions. We will use these 40408 // if none of the positions fit *without* flexible dimensions. 40409 flexibleFits.push({ 40410 position: pos, 40411 origin: originPoint, 40412 overlayRect, 40413 boundingBoxRect: this._calculateBoundingBoxRect(originPoint, pos) 40414 }); 40415 continue; 40416 } 40417 // If the current preferred position does not fit on the screen, remember the position 40418 // if it has more visible area on-screen than we've seen and move onto the next preferred 40419 // position. 40420 if (!fallback || fallback.overlayFit.visibleArea < overlayFit.visibleArea) { 40421 fallback = { 40422 overlayFit, 40423 overlayPoint, 40424 originPoint, 40425 position: pos, 40426 overlayRect 40427 }; 40428 } 40429 } 40430 // If there are any positions where the overlay would fit with flexible dimensions, choose the 40431 // one that has the greatest area available modified by the position's weight 40432 if (flexibleFits.length) { 40433 let bestFit = null; 40434 let bestScore = -1; 40435 for (const fit of flexibleFits) { 40436 const score = fit.boundingBoxRect.width * fit.boundingBoxRect.height * (fit.position.weight || 1); 40437 if (score > bestScore) { 40438 bestScore = score; 40439 bestFit = fit; 40440 } 40441 } 40442 this._isPushed = false; 40443 this._applyPosition(bestFit.position, bestFit.origin); 40444 return; 40445 } 40446 // When none of the preferred positions fit within the viewport, take the position 40447 // that went off-screen the least and attempt to push it on-screen. 40448 if (this._canPush) { 40449 // TODO(jelbourn): after pushing, the opening "direction" of the overlay might not make sense. 40450 this._isPushed = true; 40451 this._applyPosition(fallback.position, fallback.originPoint); 40452 return; 40453 } 40454 // All options for getting the overlay within the viewport have been exhausted, so go with the 40455 // position that went off-screen the least. 40456 this._applyPosition(fallback.position, fallback.originPoint); 40457 } 40458 detach() { 40459 this._clearPanelClasses(); 40460 this._lastPosition = null; 40461 this._previousPushAmount = null; 40462 this._resizeSubscription.unsubscribe(); 40463 } 40464 /** Cleanup after the element gets destroyed. */ 40465 dispose() { 40466 if (this._isDisposed) { 40467 return; 40468 } 40469 // We can't use `_resetBoundingBoxStyles` here, because it resets 40470 // some properties to zero, rather than removing them. 40471 if (this._boundingBox) { 40472 extendStyles(this._boundingBox.style, { 40473 top: '', 40474 left: '', 40475 right: '', 40476 bottom: '', 40477 height: '', 40478 width: '', 40479 alignItems: '', 40480 justifyContent: '' 40481 }); 40482 } 40483 if (this._pane) { 40484 this._resetOverlayElementStyles(); 40485 } 40486 if (this._overlayRef) { 40487 this._overlayRef.hostElement.classList.remove(boundingBoxClass); 40488 } 40489 this.detach(); 40490 this._positionChanges.complete(); 40491 this._overlayRef = this._boundingBox = null; 40492 this._isDisposed = true; 40493 } 40494 /** 40495 * This re-aligns the overlay element with the trigger in its last calculated position, 40496 * even if a position higher in the "preferred positions" list would now fit. This 40497 * allows one to re-align the panel without changing the orientation of the panel. 40498 */ 40499 reapplyLastPosition() { 40500 if (this._isDisposed || !this._platform.isBrowser) { 40501 return; 40502 } 40503 const lastPosition = this._lastPosition; 40504 if (lastPosition) { 40505 this._originRect = this._getOriginRect(); 40506 this._overlayRect = this._pane.getBoundingClientRect(); 40507 this._viewportRect = this._getNarrowedViewportRect(); 40508 this._containerRect = this._overlayContainer.getContainerElement().getBoundingClientRect(); 40509 const originPoint = this._getOriginPoint(this._originRect, this._containerRect, lastPosition); 40510 this._applyPosition(lastPosition, originPoint); 40511 } else { 40512 this.apply(); 40513 } 40514 } 40515 /** 40516 * Sets the list of Scrollable containers that host the origin element so that 40517 * on reposition we can evaluate if it or the overlay has been clipped or outside view. Every 40518 * Scrollable must be an ancestor element of the strategy's origin element. 40519 */ 40520 withScrollableContainers(scrollables) { 40521 this._scrollables = scrollables; 40522 return this; 40523 } 40524 /** 40525 * Adds new preferred positions. 40526 * @param positions List of positions options for this overlay. 40527 */ 40528 withPositions(positions) { 40529 this._preferredPositions = positions; 40530 // If the last calculated position object isn't part of the positions anymore, clear 40531 // it in order to avoid it being picked up if the consumer tries to re-apply. 40532 if (positions.indexOf(this._lastPosition) === -1) { 40533 this._lastPosition = null; 40534 }
40535 this._validatePositions(); 40536 return this; 40537 } 40538 /** 40539 * Sets a minimum distance the overlay may be positioned to the edge of the viewport. 40540 * @param margin Required margin between the overlay and the viewport edge in pixels. 40541 */ 40542 withViewportMargin(margin) { 40543 this._viewportMargin = margin; 40544 return this; 40545 } 40546 /** Sets whether the overlay's width and height can be constrained to fit within the viewport. */ 40547 withFlexibleDimensions(flexibleDimensions = true) { 40548 this._hasFlexibleDimensions = flexibleDimensions; 40549 return this; 40550 } 40551 /** Sets whether the overlay can grow after the initial open via flexible width/height. */ 40552 withGrowAfterOpen(growAfterOpen = true) { 40553 this._growAfterOpen = growAfterOpen; 40554 return this; 40555 } 40556 /** Sets whether the overlay can be pushed on-screen if none of the provided positions fit. */ 40557 withPush(canPush = true) { 40558 this._canPush = canPush; 40559 return this; 40560 } 40561 /** 40562 * Sets whether the overlay's position should be locked in after it is positioned 40563 * initially. When an overlay is locked in, it won't attempt to reposition itself 40564 * when the position is re-applied (e.g. when the user scrolls away). 40565 * @param isLocked Whether the overlay should locked in. 40566 */ 40567 withLockedPosition(isLocked = true) { 40568 this._positionLocked = isLocked; 40569 return this; 40570 } 40571 /** 40572 * Sets the origin, relative to which to position the overlay.
40573 * Using an element origin is useful for building components that need to be positioned 40574 * relatively to a trigger (e.g. dropdown menus or tooltips), whereas using a point can be 40575 * used for cases like contextual menus which open relative to the user's pointer. 40576 * @param origin Reference to the new origin. 40577 */ 40578 setOrigin(origin) { 40579 this._origin = origin; 40580 return this; 40581 } 40582 /** 40583 * Sets the default offset for the overlay's connection point on the x-axis. 40584 * @param offset New offset in the X axis. 40585 */ 40586 withDefaultOffsetX(offset) { 40587 this._offsetX = offset; 40588 return this; 40589 } 40590 /** 40591 * Sets the default offset for the overlay's connection point on the y-axis. 40592 * @param offset New offset in the Y axis. 40593 */ 40594 withDefaultOffsetY(offset) { 40595 this._offsetY = offset; 40596 return this; 40597 } 40598 /** 40599 * Configures that the position strategy should set a `transform-origin` on some elements 40600 * inside the overlay, depending on the current position that is being applied. This is 40601 * useful for the cases where the origin of an animation can change depending on the 40602 * alignment of the overlay. 40603 * @param selector CSS selector that will be used to find the target 40604 * elements onto which to set the transform origin. 40605 */ 40606 withTransformOriginOn(selector) { 40607 this._transformOriginSelector = selector; 40608 return this; 40609 } 40610 /** 40611 * Gets the (x, y) coordinate of a connection point on the origin based on a relative position. 40612 */ 40613 _getOriginPoint(originRect, containerRect, pos) { 40614 let x; 40615 if (pos.originX == 'center') { 40616 // Note: when centering we should always use the `left` 40617 // offset, otherwise the position will be wrong in RTL. 40618 x = originRect.left + originRect.width / 2; 40619 } else { 40620 const startX = this._isRtl() ? originRect.right : originRect.left; 40621 const endX = this._isRtl() ? originRect.left : originRect.right; 40622 x = pos.originX == 'start' ? startX : endX; 40623 } 40624 // When zooming in Safari the container rectangle contains negative values for the position 40625 // and we need to re-add them to the calculated coordinates. 40626 if (containerRect.left < 0) { 40627 x -= containerRect.left; 40628 } 40629 let y; 40630 if (pos.originY == 'center') { 40631 y = originRect.top + originRect.height / 2; 40632 } else { 40633 y = pos.originY == 'top' ? originRect.top : originRect.bottom; 40634 } 40635 // Normally the containerRect's top value would be zero, however when the overlay is attached to an input 40636 // (e.g. in an autocomplete), mobile browsers will shift everything in order to put the input in the middle 40637 // of the screen and to make space for the virtual keyboard. We need to account for this offset, 40638 // otherwise our positioning will be thrown off. 40639 // Additionally, when zooming in Safari this fixes the vertical position. 40640 if (containerRect.top < 0) { 40641 y -= containerRect.top; 40642 } 40643 return { 40644 x, 40645 y 40646 }; 40647 } 40648 /** 40649 * Gets the (x, y) coordinate of the top-left corner of the overlay given a given position and 40650 * origin point to which the overlay should be connected. 40651 */ 40652 _getOverlayPoint(originPoint, overlayRect, pos) { 40653 // Calculate the (overlayStartX, overlayStartY), the start of the 40654 // potential overlay position relative to the origin point. 40655 let overlayStartX; 40656 if (pos.overlayX == 'center') { 40657 overlayStartX = -overlayRect.width / 2; 40658 } else if (pos.overlayX === 'start') { 40659 overlayStartX = this._isRtl() ? -overlayRect.width : 0; 40660 } else { 40661 overlayStartX = this._isRtl() ? 0 : -overlayRect.width; 40662 } 40663 let overlayStartY; 40664 if (pos.overlayY == 'center') { 40665 overlayStartY = -overlayRect.height / 2; 40666 } else { 40667 overlayStartY = pos.overlayY == 'top' ? 0 : -overlayRect.height; 40668 } 40669 // The (x, y) coordinates of the overlay. 40670 return { 40671 x: originPoint.x + overlayStartX, 40672 y: originPoint.y + overlayStartY 40673 }; 40674 } 40675 /** Gets how well an overlay at the given point will fit within the viewport. */ 40676 _getOverlayFit(point, rawOverlayRect, viewport, position) { 40677 // Round the overlay rect when comparing against the 40678 // viewport, because the viewport is always rounded.
40679 const overlay = getRoundedBoundingClientRect(rawOverlayRect); 40680 let { 40681 x, 40682 y 40683 } = point; 40684 let offsetX = this._getOffset(position, 'x'); 40685 let offsetY = this._getOffset(position, 'y'); 40686 // Account for the offsets since they could push the overlay out of the viewport. 40687 if (offsetX) { 40688 x += offsetX; 40689 } 40690 if (offsetY) { 40691 y += offsetY; 40692 } 40693 // How much the overlay would overflow at this position, on each side. 40694 let leftOverflow = 0 - x; 40695 let rightOverflow = x + overlay.width - viewport.width; 40696 let topOverflow = 0 - y; 40697 let bottomOverflow = y + overlay.height - viewport.height; 40698 // Visible parts of the element on each axis. 40699 let visibleWidth = this._subtractOverflows(overlay.width, leftOverflow, rightOverflow); 40700 let visibleHeight = this._subtractOverflows(overlay.height, topOverflow, bottomOverflow); 40701 let visibleArea = visibleWidth * visibleHeight; 40702 return { 40703 visibleArea, 40704 isCompletelyWithinViewport: overlay.width * overlay.height === visibleArea, 40705 fitsInViewportVertically: visibleHeight === overlay.height, 40706 fitsInViewportHorizontally: visibleWidth == overlay.width 40707 }; 40708 } 40709 /** 40710 * Whether the overlay can fit within the viewport when it may resize either its width or height. 40711 * @param fit How well the overlay fits in the viewport at some position. 40712 * @param point The (x, y) coordinates of the overlay at some position. 40713 * @param viewport The geometry of the viewport. 40714 */ 40715 _canFitWithFlexibleDimensions(fit, point, viewport) { 40716 if (this._hasFlexibleDimensions) { 40717 const availableHeight = viewport.bottom - point.y; 40718 const availableWidth = viewport.right - point.x; 40719 const minHeight = getPixelValue(this._overlayRef.getConfig().minHeight); 40720 const minWidth = getPixelValue(this._overlayRef.getConfig().minWidth); 40721 const verticalFit = fit.fitsInViewportVertically || minHeight != null && minHeight <= availableHeight; 40722 const horizontalFit = fit.fitsInViewportHorizontally || minWidth != null && minWidth <= availableWidth; 40723 return verticalFit && horizontalFit; 40724 } 40725 return false; 40726 } 40727 /** 40728 * Gets the point at which the overlay can be "pushed" on-screen. If the overlay is larger than 40729 * the viewport, the top-left corner will be pushed on-screen (with overflow occurring on the 40730 * right and bottom). 40731 * 40732 * @param start Starting point from which the overlay is pushed. 40733 * @param rawOverlayRect Dimensions of the overlay. 40734 * @param scrollPosition Current viewport scroll position. 40735 * @returns The point at which to position the overlay after pushing. This is effectively a new 40736 * originPoint. 40737 */ 40738 _pushOverlayOnScreen(start, rawOverlayRect, scrollPosition) { 40739 // If the position is locked and we've pushed the overlay already, reuse the previous push 40740 // amount, rather than pushing it again. If we were to continue pushing, the element would 40741 // remain in the viewport, which goes against the expectations when position locking is enabled. 40742 if (this._previousPushAmount && this._positionLocked) { 40743 return { 40744 x: start.x + this._previousPushAmount.x, 40745 y: start.y + this._previousPushAmount.y 40746 }; 40747 } 40748 // Round the overlay rect when comparing against the 40749 // viewport, because the viewport is always rounded. 40750 const overlay = getRoundedBoundingClientRect(rawOverlayRect); 40751 const viewport = this._viewportRect; 40752 // Determine how much the overlay goes outside the viewport on each 40753 // side, which we'll use to decide which direction to push it. 40754 const overflowRight = Math.max(start.x + overlay.width - viewport.width, 0); 40755 const overflowBottom = Math.max(start.y + overlay.height - viewport.height, 0); 40756 const overflowTop = Math.max(viewport.top - scrollPosition.top - start.y, 0); 40757 const overflowLeft = Math.max(viewport.left - scrollPosition.left - start.x, 0); 40758 // Amount by which to push the overlay in each axis such that it remains on-screen. 40759 let pushX = 0; 40760 let pushY = 0; 40761 // If the overlay fits completely within the bounds of the viewport, push it from whichever 40762 // direction is goes off-screen. Otherwise, push the top-left corner such that its in the 40763 // viewport and allow for the trailing end of the overlay to go out of bounds. 40764 if (overlay.width <= viewport.width) { 40765 pushX = overflowLeft || -overflowRight; 40766 } else { 40767 pushX = start.x < this._viewportMargin ? viewport.left - scrollPosition.left - start.x : 0; 40768 } 40769 if (overlay.height <= viewport.height) {
40770 pushY = overflowTop || -overflowBottom; 40771 } else { 40772 pushY = start.y < this._viewportMargin ? viewport.top - scrollPosition.top - start.y : 0; 40773 } 40774 this._previousPushAmount = { 40775 x: pushX, 40776 y: pushY 40777 }; 40778 return { 40779 x: start.x + pushX, 40780 y: start.y + pushY 40781 }; 40782 } 40783 /** 40784 * Applies a computed position to the overlay and emits a position change. 40785 * @param position The position preference 40786 * @param originPoint The point on the origin element where the overlay is connected. 40787 */ 40788 _applyPosition(position, originPoint) { 40789 this._setTransformOrigin(position); 40790 this._setOverlayElementStyles(originPoint, position); 40791 this._setBoundingBoxStyles(originPoint, position); 40792 if (position.panelClass) { 40793 this._addPanelClasses(position.panelClass); 40794 } 40795 // Notify that the position has been changed along with its change properties. 40796 // We only emit if we've got any subscriptions, because the scroll visibility 40797 // calculations can be somewhat expensive. 40798 if (this._positionChanges.observers.length) { 40799 const scrollVisibility = this._getScrollVisibility(); 40800 // We're recalculating on scroll, but we only want to emit if anything 40801 // changed since downstream code might be hitting the `NgZone`. 40802 if (position !== this._lastPosition || !this._lastScrollVisibility || !compareScrollVisibility(this._lastScrollVisibility, scrollVisibility)) { 40803 const changeEvent = new ConnectedOverlayPositionChange(position, scrollVisibility); 40804 this._positionChanges.next(changeEvent); 40805 } 40806 this._lastScrollVisibility = scrollVisibility; 40807 } 40808 // Save the last connected position in case the position needs to be re-calculated. 40809 this._lastPosition = position; 40810 this._isInitialRender = false;
40811 } 40812 /** Sets the transform origin based on the configured selector and the passed-in position. */ 40813 _setTransformOrigin(position) { 40814 if (!this._transformOriginSelector) { 40815 return; 40816 } 40817 const elements = this._boundingBox.querySelectorAll(this._transformOriginSelector); 40818 let xOrigin; 40819 let yOrigin = position.overlayY; 40820 if (position.overlayX === 'center') { 40821 xOrigin = 'center'; 40822 } else if (this._isRtl()) { 40823 xOrigin = position.overlayX === 'start' ? 'right' : 'left'; 40824 } else { 40825 xOrigin = position.overlayX === 'start' ? 'left' : 'right'; 40826 } 40827 for (let i = 0; i < elements.length; i++) { 40828 elements[i].style.transformOrigin = `${xOrigin} ${yOrigin}`; 40829 } 40830 } 40831 /** 40832 * Gets the position and size of the overlay's sizing container. 40833 * 40834 * This method does no measuring and applies no styles so that we can cheaply compute the 40835 * bounds for all positions and choose the best fit based on these results. 40836 */ 40837 _calculateBoundingBoxRect(origin, position) { 40838 const viewport = this._viewportRect; 40839 const isRtl = this._isRtl(); 40840 let height, top, bottom; 40841 if (position.overlayY === 'top') { 40842 // Overlay is opening "downward" and thus is bound by the bottom viewport edge. 40843 top = origin.y; 40844 height = viewport.height - top + this._viewportMargin; 40845 } else if (position.overlayY === 'bottom') { 40846 // Overlay is opening "upward" and thus is bound by the top viewport edge. We need to add 40847 // the viewport margin back in, because the viewport rect is narrowed down to remove the 40848 // margin, whereas the `origin` position is calculated based on its `DOMRect`. 40849 bottom = viewport.height - origin.y + this._viewportMargin * 2; 40850 height = viewport.height - bottom + this._viewportMargin; 40851 } else { 40852 // If neither top nor bottom, it means that the overlay is vertically centered on the 40853 // origin point. Note that we want the position relative to the viewport, rather than 40854 // the page, which is why we don't use something like `viewport.bottom - origin.y` and 40855 // `origin.y - viewport.top`. 40856 const smallestDistanceToViewportEdge = Math.min(viewport.bottom - origin.y + viewport.top, origin.y); 40857 const previousHeight = this._lastBoundingBoxSize.height; 40858 height = smallestDistanceToViewportEdge * 2; 40859 top = origin.y - smallestDistanceToViewportEdge; 40860 if (height > previousHeight && !this._isInitialRender && !this._growAfterOpen) { 40861 top = origin.y - previousHeight / 2; 40862 } 40863 } 40864 // The overlay is opening 'right-ward' (the content flows to the right). 40865 const isBoundedByRightViewportEdge = position.overlayX === 'start' && !isRtl || position.overlayX === 'end' && isRtl; 40866 // The overlay is opening 'left-ward' (the content flows to the left). 40867 const isBoundedByLeftViewportEdge = position.overlayX === 'end' && !isRtl || position.overlayX === 'start' && isRtl; 40868 let width, left, right; 40869 if (isBoundedByLeftViewportEdge) { 40870 right = viewport.width - origin.x + this._viewportMargin * 2; 40871 width = origin.x - this._viewportMargin; 40872 } else if (isBoundedByRightViewportEdge) { 40873 left = origin.x; 40874 width = viewport.right - origin.x; 40875 } else { 40876 // If neither start nor end, it means that the overlay is horizontally centered on the 40877 // origin point. Note that we want the position relative to the viewport, rather than 40878 // the page, which is why we don't use something like `viewport.right - origin.x` and 40879 // `origin.x - viewport.left`. 40880 const smallestDistanceToViewportEdge = Math.min(viewport.right - origin.x + viewport.left, origin.x); 40881 const previousWidth = this._lastBoundingBoxSize.width; 40882 width = smallestDistanceToViewportEdge * 2; 40883 left = origin.x - smallestDistanceToViewportEdge; 40884 if (width > previousWidth && !this._isInitialRender && !this._growAfterOpen) { 40885 left = origin.x - previousWidth / 2; 40886 } 40887 } 40888 return { 40889 top: top, 40890 left: left, 40891 bottom: bottom, 40892 right: right, 40893 width, 40894 height 40895 }; 40896 } 40897 /** 40898 * Sets the position and size of the overlay's sizing wrapper. The wrapper is positioned on the 40899 * origin's connection point and stretches to the bounds of the viewport. 40900 * 40901 * @param origin The point on the origin element where the overlay is connected. 40902 * @param position The position preference 40903 */ 40904 _setBoundingBoxStyles(origin, position) { 40905 const boundingBoxRect = this._calculateBoundingBoxRect(origin, position); 40906 // It's weird if the overlay *grows* while scrolling, so we take the last size into account 40907 // when applying a new size. 40908 if (!this._isInitialRender && !this._growAfterOpen) { 40909 boundingBoxRect.height = Math.min(boundingBoxRect.height, this._lastBoundingBoxSize.height); 40910 boundingBoxRect.width = Math.min(boundingBoxRect.width, this._lastBoundingBoxSize.width); 40911 } 40912 const styles = {}; 40913 if (this._hasExactPosition()) { 40914 styles.top = styles.left = '0'; 40915 styles.bottom = styles.right = styles.maxHeight = styles.maxWidth = ''; 40916 styles.width = styles.height = '100%'; 40917 } else { 40918 const maxHeight = this._overlayRef.getConfig().maxHeight; 40919 const maxWidth = this._overlayRef.getConfig().maxWidth; 40920 styles.height = (0,_css_pixel_value_C_HEqLhI_mjs__WEBPACK_IMPORTED_MODULE_3__.c)(boundingBoxRect.height); 40921 styles.top = (0,_css_pixel_value_C_HEqLhI_mjs__WEBPACK_IMPORTED_MODULE_3__.c)(boundingBoxRect.top); 40922 styles.bottom = (0,_css_pixel_value_C_HEqLhI_mjs__WEBPACK_IMPORTED_MODULE_3__.c)(boundingBoxRect.bottom); 40923 styles.width = (0,_css_pixel_value_C_HEqLhI_mjs__WEBPACK_IMPORTED_MODULE_3__.c)(boundingBoxRect.width); 40924 styles.left = (0,_css_pixel_value_C_HEqLhI_mjs__WEBPACK_IMPORTED_MODULE_3__.c)(boundingBoxRect.left); 40925 styles.right = (0,_css_pixel_value_C_HEqLhI_mjs__WEBPACK_IMPORTED_MODULE_3__.c)(boundingBoxRect.right); 40926 // Push the pane content towards the proper direction. 40927 if (position.overlayX === 'center') { 40928 styles.alignItems = 'center'; 40929 } else { 40930 styles.alignItems = position.overlayX === 'end' ? 'flex-end' : 'flex-start'; 40931 } 40932 if (position.overlayY === 'center') { 40933 styles.justifyContent = 'center'; 40934 } else { 40935 styles.justifyContent = position.overlayY === 'bottom' ? 'flex-end' : 'flex-start'; 40936 } 40937 if (maxHeight) { 40938 styles.maxHeight = (0,_css_pixel_value_C_HEqLhI_mjs__WEBPACK_IMPORTED_MODULE_3__.c)(maxHeight); 40939 } 40940 if (maxWidth) { 40941 styles.maxWidth = (0,_css_pixel_value_C_HEqLhI_mjs__WEBPACK_IMPORTED_MODULE_3__.c)(maxWidth); 40942 } 40943 } 40944 this._lastBoundingBoxSize = boundingBoxRect; 40945 extendStyles(this._boundingBox.style, styles); 40946 } 40947 /** Resets the styles for the bounding box so that a new positioning can be computed. */ 40948 _resetBoundingBoxStyles() { 40949 extendStyles(this._boundingBox.style, { 40950 top: '0', 40951 left: '0', 40952 right: '0', 40953 bottom: '0', 40954 height: '', 40955 width: '', 40956 alignItems: '', 40957 justifyContent: '' 40958 }); 40959 } 40960 /** Resets the styles for the overlay pane so that a new positioning can be computed. */ 40961 _resetOverlayElementStyles() { 40962 extendStyles(this._pane.style, { 40963 top: '', 40964 left: '', 40965 bottom: '', 40966 right: '', 40967 position: '', 40968 transform: '' 40969 }); 40970 } 40971 /** Sets positioning styles to the overlay element. */ 40972 _setOverlayElementStyles(originPoint, position) { 40973 const styles = {}; 40974 const hasExactPosition = this._hasExactPosition(); 40975 const hasFlexibleDimensions = this._hasFlexibleDimensions; 40976 const config = this._overlayRef.getConfig(); 40977 if (hasExactPosition) { 40978 const scrollPosition = this._viewportRuler.getViewportScrollPosition(); 40979 extendStyles(styles, this._getExactOverlayY(position, originPoint, scrollPosition)); 40980 extendStyles(styles, this._getExactOverlayX(position, originPoint, scrollPosition)); 40981 } else { 40982 styles.position = 'static'; 40983 } 40984 // Use a transform to apply the offsets. We do this because the `center` positions rely on 40985 // being in the normal flex flow and setting a `top` / `left` at all will completely throw 40986 // off the position. We also can't use margins, because they won't have an effect in some 40987 // cases where the element doesn't have anything to "push off of". Finally, this works 40988 // better both with flexible and non-flexible positioning. 40989 let transformString = ''; 40990 let offsetX = this._getOffset(position, 'x'); 40991 let offsetY = this._getOffset(position, 'y'); 40992 if (offsetX) { 40993 transformString += `translateX(${offsetX}px) `; 40994 } 40995 if (offsetY) { 40996 transformString += `translateY(${offsetY}px)`; 40997 } 40998 styles.transform = transformString.trim(); 40999 // If a maxWidth or maxHeight is specified on the overlay, we remove them. We do this because 41000 // we need these values to both be set to "100%" for the automatic flexible sizing to work. 41001 // The maxHeight and maxWidth are set on the boundingBox in order to enforce the constraint. 41002 // Note that this doesn't apply when we have an exact position, in
41002which case we do want to 41003 // apply them because they'll be cleared from the bounding box. 41004 if (config.maxHeight) { 41005 if (hasExactPosition) { 41006 styles.maxHeight = (0,_css_pixel_value_C_HEqLhI_mjs__WEBPACK_IMPORTED_MODULE_3__.c)(config.maxHeight); 41007 } else if (hasFlexibleDimensions) { 41008 styles.maxHeight = ''; 41009 } 41010 } 41011 if (config.maxWidth) { 41012 if (hasExactPosition) { 41013 styles.maxWidth = (0,_css_pixel_value_C_HEqLhI_mjs__WEBPACK_IMPORTED_MODULE_3__.c)(config.maxWidth); 41014 } else if (hasFlexibleDimensions) { 41015 styles.maxWidth = ''; 41016 } 41017 } 41018 extendStyles(this._pane.style, styles); 41019 } 41020 /** Gets the exact top/bottom for the overlay when not using flexible sizing or when pushing. */ 41021 _getExactOverlayY(position, originPoint, scrollPosition) { 41022 // Reset any existing styles. This is necessary in case the 41023 // preferred position has changed since the last `apply`. 41024 let styles = { 41025 top: '', 41026 bottom: '' 41027 }; 41028 let overlayPoint = this._getOverlayPoint(originPoint, this._overlayRect, position); 41029 if (this._isPushed) { 41030 overlayPoint = this._pushOverlayOnScreen(overlayPoint, this._overlayRect, scrollPosition); 41031 } 41032 // We want to set either `top` or `bottom` based on whether the overlay wants to appear 41033 // above or below the origin and the direction in which the element will expand. 41034 if (position.overlayY === 'bottom') { 41035 // When using `bottom`, we adjust the y position such that it is the distance 41036 // from the bottom of the viewport rather than the top. 41037 const documentHeight = this._document.documentElement.clientHeight; 41038 styles.bottom = `${documentHeight - (overlayPoint.y + this._overlayRect.height)}px`; 41039 } else { 41040 styles.top = (0,_css_pixel_value_C_HEqLhI_mjs__WEBPACK_IMPORTED_MODULE_3__.c)(overlayPoint.y); 41041 } 41042 return styles; 41043 } 41044 /** Gets the exact left/right for the overlay when not using flexible sizing or when pushing. */ 41045 _getExactOverlayX(position, originPoint, scrollPosition) { 41046 // Reset any existing styles. This is necessary in case the preferred position has 41047 // changed since the last `apply`. 41048 let styles = { 41049 left: '', 41050 right: '' 41051 }; 41052 let overlayPoint = this._getOverlayPoint(originPoint, this._overlayRect, position); 41053 if (this._isPushed) { 41054 overlayPoint = this._pushOverlayOnScreen(overlayPoint, this._overlayRect, scrollPosition); 41055 } 41056 // We want to set either `left` or `right` based on whether the overlay wants to appear "before" 41057 // or "after" the origin, which determines the direction in which the element will expand. 41058 // For the horizontal axis, the meaning of "before" and "after" change based on whether the 41059 // page is in RTL or LTR. 41060 let horizontalStyleProperty; 41061 if (this._isRtl()) { 41062 horizontalStyleProperty = position.overlayX === 'end' ? 'left' : 'right'; 41063 } else { 41064 horizontalStyleProperty = position.overlayX === 'end' ? 'right' : 'left'; 41065 } 41066 // When we're setting `right`, we adjust the x position such that it is the distance 41067 // from the right edge of the viewport rather than the left edge. 41068 if (horizontalStyleProperty === 'right') { 41069 const documentWidth = this._document.documentElement.clientWidth; 41070 styles.right = `${documentWidth - (overlayPoint.x + this._overlayRect.width)}px`; 41071 } else { 41072 styles.left = (0,_css_pixel_value_C_HEqLhI_mjs__WEBPACK_IMPORTED_MODULE_3__.c)(overlayPoint.x); 41073 } 41074 return styles; 41075 } 41076 /** 41077 * Gets the view properties of the trigger and overlay, including whether they are clipped 41078 * or completely outside the view of any of the strategy's scrollables. 41079 */ 41080 _getScrollVisibility() { 41081 // Note: needs fresh rects since the position could've changed. 41082 const originBounds = this._getOriginRect(); 41083 const overlayBounds = this._pane.getBoundingClientRect(); 41084 // TODO(jelbourn): instead of needing all of the client rects for these scrolling containers 41085 // every time, we should be able to use the scrollTop of the containers if the size of those 41086 // containers hasn't changed. 41087 const scrollContainerBounds = this._scrollables.map(scrollable => { 41088 return scrollable.getElementRef().nativeElement.getBoundingClientRect(); 41089 }); 41090 return { 41091 isOriginClipped: isElementClippedByScrolling(originBounds, scrollContainerBounds), 41092 isOriginOutsideView: isElementScrolledOutsideView(originBounds, scrollContainerBounds), 41093 isOverlayClipped: isElementClippedByScrolling(overlayBounds, scrollContainerBounds), 41094 isOverlayOutsideView: isElementScrolledOutsideView(overlayBounds, scrollContainerBounds) 41095 }; 41096 } 41097 /** Subtracts the amount that an element is overflowing on an axis from its length. */ 41098 _subtractOverflows(length, ...overflows) { 41099 return overflows.reduce((currentValue, currentOverflow) => { 41100 return currentValue - Math.max(currentOverflow, 0); 41101 }, length); 41102 } 41103 /** Narrows the given viewport rect by the current _viewportMargin. */ 41104 _getNarrowedViewportRect() { 41105 // We recalculate the viewport rect here ourselves, rather than using the ViewportRuler, 41106 // because we want to use the `clientWidth` and `clientHeight` as the base. The difference 41107 // being that the client properties don't include the scrollbar, as opposed to `innerWidth` 41108 // and `innerHeight` that do. This is necessary, because the overlay container uses 41109 // 100% `width` and `height` which don't include the scrollbar either. 41110 const width = this._document.documentElement.clientWidth; 41111 const height = this._document.documentElement.clientHeight; 41112 const scrollPosition = this._viewportRuler.getViewportScrollPosition(); 41113 return { 41114 top: scrollPosition.top + this._viewportMargin, 41115 left: scrollPosition.left + this._viewportMargin, 41116 right: scrollPosition.left + width - this._viewportMargin, 41117 bottom: scrollPosition.top + height - this._viewportMargin, 41118 width: width - 2 * this._viewportMargin, 41119 height: height - 2 * this._viewportMargin 41120 }; 41121 } 41122 /** Whether the we're dealing with an RTL context */ 41123 _isRtl() { 41124 return this._overlayRef.getDirection() === 'rtl'; 41125 } 41126 /** Determines whether the overlay uses exact or flexible positioning. */ 41127 _hasExactPosition() { 41128 return !this._hasFlexibleDimensions || this._isPushed; 41129 } 41130 /** Retrieves the offset of a position along the x or y axis. */ 41131 _getOffset(position, axis) { 41132 if (axis === 'x') { 41133 // We don't do something like `position['offset' + axis]` in 41134 // order to avoid breaking minifiers that rename properties. 41135 return position.offsetX == null ? this._offsetX : position.offsetX; 41136 } 41137 return position.offsetY == null ? this._offsetY : position.offsetY; 41138 } 41139 /** Validates that the current position match the expected values. */ 41140 _validatePositions() { 41141 if (typeof ngDevMode === 'undefined' || ngDevMode) { 41142 if (!this._preferredPositions.length) { 41143 throw Error('FlexibleConnectedPositionStrategy: At least one position is required.'); 41144 } 41145 // TODO(crisbeto): remove these once Angular's template type 41146 // checking is advanced enough to catch these cases. 41147 this._preferredPositions.forEach(pair => { 41148 validateHorizontalPosition('originX', pair.originX); 41149 validateVerticalPosition('originY', pair.originY); 41150 validateHorizontalPosition('overlayX', pair.overlayX); 41151 validateVerticalPosition('overlayY', pair.overlayY); 41152 }); 41153 } 41154 } 41155 /** Adds a single CSS class or an array of classes on the overlay panel. */
41156 _addPanelClasses(cssClasses) { 41157 if (this._pane) { 41158 (0,_array_I1yfCXUO_mjs__WEBPACK_IMPORTED_MODULE_15__.c)(cssClasses).forEach(cssClass => { 41159 if (cssClass !== '' && this._appliedPanelClasses.indexOf(cssClass) === -1) { 41160 this._appliedPanelClasses.push(cssClass); 41161 this._pane.classList.add(cssClass); 41162 } 41163 }); 41164 } 41165 } 41166 /** Clears the classes that the position strategy has applied from the overlay panel. */ 41167 _clearPanelClasses() { 41168 if (this._pane) { 41169 this._appliedPanelClasses.forEach(cssClass => { 41170 this._pane.classList.remove(cssClass); 41171 }); 41172 this._appliedPanelClasses = []; 41173 } 41174 } 41175 /** Returns the DOMRect of the current origin. */ 41176 _getOriginRect() { 41177 const origin = this._origin; 41178 if (origin instanceof _angular_core__WEBPACK_IMPORTED_MODULE_5__.ElementRef) { 41179 return origin.nativeElement.getBoundingClientRect(); 41180 } 41181 // Check for Element so SVG elements are also supported. 41182 if (origin instanceof Element) { 41183 return origin.getBoundingClientRect(); 41184 } 41185 const width = origin.width || 0; 41186 const height = origin.height || 0; 41187 // If the origin is a point, return a client rect as if it was a 0x0 element at the point. 41188 return { 41189 top: origin.y, 41190 bottom: origin.y + height, 41191 left: origin.x, 41192 right: origin.x + width, 41193 height, 41194 width 41195 }; 41196 } 41197} 41198/** Shallow-extends a stylesheet object with another stylesheet object. */ 41199function extendStyles(destination, source) { 41200 for (let key in source) { 41201 if (source.hasOwnProperty(key)) { 41202 destination[key] = source[key]; 41203 } 41204 } 41205 return destination; 41206} 41207/** 41208 * Extracts the pixel value as a number from a value, if it's a number 41209 * or a CSS pixel string (e.g. `1337px`). Otherwise returns null. 41210 */ 41211function getPixelValue(input) { 41212 if (typeof input !== 'number' && input != null) { 41213 const [value, units] = input.split(cssUnitPattern); 41214 return !units || units === 'px' ? parseFloat(value) : null; 41215 } 41216 return input || null; 41217} 41218/** 41219 * Gets a version of an element's bounding `DOMRect` where all the values are rounded down to 41220 * the nearest pixel. This allows us to account for the cases where there may be sub-pixel 41221 * deviations in the `DOMRect` returned by the browser (e.g. when zoomed in with a percentage 41222 * size, see #21350). 41223 */ 41224function getRoundedBoundingClientRect(clientRect) { 41225 return { 41226 top: Math.floor(clientRect.top), 41227 right: Math.floor(clientRect.right), 41228 bottom: Math.floor(clientRect.bottom), 41229 left: Math.floor(clientRect.left), 41230 width: Math.floor(clientRect.width), 41231 height: Math.floor(clientRect.height) 41232 }; 41233} 41234/** Returns whether two `ScrollingVisibility` objects are identical. */ 41235function compareScrollVisibility(a, b) { 41236 if (a === b) { 41237 return true; 41238 } 41239 return a.isOriginClipped === b.isOriginClipped && a.isOriginOutsideView === b.isOriginOutsideView && a.isOverlayClipped === b.isOverlayClipped && a.isOverlayOutsideView === b.isOverlayOutsideView; 41240} 41241const STANDARD_DROPDOWN_BELOW_POSITIONS = [{ 41242 originX: 'start', 41243 originY: 'bottom', 41244 overlayX: 'start', 41245 overlayY: 'top' 41246}, { 41247 originX: 'start', 41248 originY: 'top', 41249 overlayX: 'start', 41250 overlayY: 'bottom' 41251}, { 41252 originX: 'end', 41253 originY: 'bottom', 41254 overlayX: 'end', 41255 overlayY: 'top' 41256}, { 41257 originX: 'end', 41258 originY: 'top', 41259 overlayX: 'end', 41260 overlayY: 'bottom' 41261}]; 41262const STANDARD_DROPDOWN_ADJACENT_POSITIONS = [{ 41263 originX: 'end', 41264 originY: 'top', 41265 overlayX: 'start', 41266 overlayY: 'top' 41267}, { 41268 originX: 'end', 41269 originY: 'bottom', 41270 overlayX: 'start', 41271 overlayY: 'bottom' 41272}, { 41273 originX: 'start', 41274 originY: 'top', 41275 overlayX: 'end', 41276 overlayY: 'top' 41277}, { 41278 originX: 'start', 41279 originY: 'bottom', 41280 overlayX: 'end', 41281 overlayY: 'bottom' 41282}]; 41283 41284/** Class to be added to the overlay pane wrapper. */ 41285const wrapperClass = 'cdk-global-overlay-wrapper'; 41286/** 41287 * A strategy for positioning overlays. Using this strategy, an overlay is given an 41288 * explicit position relative to the browser's viewport. We use flexbox, instead of 41289 * transforms, in order to avoid issues with subpixel rendering which can cause the 41290 * element to become blurry. 41291 */ 41292class GlobalPositionStrategy { 41293 constructor() {
41294 /** The overlay to which this strategy is attached. */ 41295 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_overlayRef", void 0); 41296 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_cssPosition", 'static'); 41297 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_topOffset", ''); 41298 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_bottomOffset", ''); 41299 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_alignItems", ''); 41300 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_xPosition", ''); 41301 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_xOffset", ''); 41302 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_width", ''); 41303 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_height", ''); 41304 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_isDisposed", false); 41305 } 41306 attach(overlayRef) { 41307 const config = overlayRef.getConfig(); 41308 this._overlayRef = overlayRef; 41309 if (this._width && !config.width) { 41310 overlayRef.updateSize({ 41311 width: this._width 41312 }); 41313 } 41314 if (this._height && !config.height) { 41315 overlayRef.updateSize({ 41316 height: this._height 41317 }); 41318 } 41319 overlayRef.hostElement.classList.add(wrapperClass); 41320 this._isDisposed = false; 41321 } 41322 /** 41323 * Sets the top position of the overlay. Clears any previously set vertical position. 41324 * @param value New top offset. 41325 */ 41326 top(value = '') { 41327 this._bottomOffset = ''; 41328 this._topOffset = value; 41329 this._alignItems = 'flex-start'; 41330 return this; 41331 } 41332 /** 41333 * Sets the left position of the overlay. Clears any previously set horizontal position. 41334 * @param value New left offset. 41335 */ 41336 left(value = '') { 41337 this._xOffset = value; 41338 this._xPosition = 'left'; 41339 return this; 41340 } 41341 /** 41342 * Sets the bottom position of the overlay. Clears any previously set vertical position. 41343 * @param value New bottom offset. 41344 */ 41345 bottom(value = '') { 41346 this._topOffset = ''; 41347 this._bottomOffset = value; 41348 this._alignItems = 'flex-end'; 41349 return this; 41350 } 41351 /** 41352 * Sets the right position of the overlay. Clears any previously set horizontal position. 41353 * @param value New right offset. 41354 */ 41355 right(value = '') { 41356 this._xOffset = value; 41357 this._xPosition = 'right'; 41358 return this; 41359 } 41360 /** 41361 * Sets the overlay to the start of the viewport, depending on the overlay direction. 41362 * This will be to the left in LTR layouts and to the right in RTL. 41363 * @param offset Offset from the edge of the screen. 41364 */ 41365 start(value = '') { 41366 this._xOffset = value; 41367 this._xPosition = 'start'; 41368 return this; 41369 } 41370 /** 41371 * Sets the overlay to the end of the viewport, depending on the overlay direction. 41372 * This will be to the right in LTR layouts and to the left in RTL. 41373 * @param offset Offset from the edge of the screen. 41374 */ 41375 end(value = '') { 41376 this._xOffset = value; 41377 this._xPosition = 'end'; 41378 return this; 41379 } 41380 /** 41381 * Sets the overlay width and clears any previously set width. 41382 * @param value New width for the overlay 41383 * @deprecated Pass the `width` through the `OverlayConfig`. 41384 * @breaking-change 8.0.0 41385 */ 41386 width(value = '') { 41387 if (this._overlayRef) { 41388 this._overlayRef.updateSize({ 41389 width: value 41390 }); 41391 } else { 41392 this._width = value; 41393 } 41394 return this; 41395 } 41396 /** 41397 * Sets the overlay height and clears any previously set height. 41398 * @param value New height for the overlay 41399 * @deprecated Pass the `height` through the `OverlayConfig`. 41400 * @breaking-change 8.0.0 41401 */ 41402 height(value = '') { 41403 if (this._overlayRef) { 41404 this._overlayRef.updateSize({ 41405 height: value 41406 }); 41407 } else { 41408 this._height = value; 41409 } 41410 return this; 41411 } 41412 /** 41413 * Centers the overlay horizontally with an optional offset. 41414 * Clears any previously set horizontal position. 41415 * 41416 * @param offset Overlay offset from the horizontal center. 41417 */ 41418 centerHorizontally(offset = '') { 41419 this.left(offset); 41420 this._xPosition = 'center'; 41421 return this; 41422 } 41423 /** 41424 * Centers the overlay vertically with an optional offset. 41425 * Clears any previously set vertical position. 41426 * 41427 * @param offset Overlay offset from the vertical center. 41428 */ 41429 centerVertically(offset = '') { 41430 this.top(offset); 41431 this._alignItems = 'center'; 41432 return this; 41433 } 41434 /** 41435 * Apply the position to the element. 41436 * @docs-private 41437 */ 41438 apply() { 41439 // Since the overlay ref applies the strategy asynchronously, it could 41440 // have been disposed before it ends up being applied. If that is the 41441 // case, we shouldn't do anything. 41442 if (!this._overlayRef || !this._overlayRef.hasAttached()) { 41443 return; 41444 } 41445 const styles = this._overlayRef.overlayElement.style; 41446 const parentStyles = this._overlayRef.hostElement.style; 41447 const config = this._overlayRef.getConfig(); 41448 const { 41449 width, 41450 height, 41451 maxWidth, 41452 maxHeight 41453 } = config; 41454 const shouldBeFlushHorizontally = (width === '100%' || width === '100vw') && (!maxWidth || maxWidth === '100%' || maxWidth === '100vw'); 41455 const shouldBeFlushVertically = (height === '100%' || height === '100vh') && (!maxHeight || maxHeight === '100%' || maxHeight === '100vh'); 41456 const xPosition = this._xPosition; 41457 const xOffset = this._xOffset; 41458 const isRtl = this._overlayRef.getConfig().direction === 'rtl'; 41459 let marginLeft = ''; 41460 let marginRight = ''; 41461 let justifyContent = ''; 41462 if (shouldBeFlushHorizontally) { 41463 justifyContent = 'flex-start'; 41464 } else if (xPosition === 'center') { 41465 justifyContent = 'center'; 41466 if (isRtl) { 41467 marginRight = xOffset; 41468 } else { 41469 marginLeft = xOffset; 41470 } 41471 } else if (isRtl) { 41472 if (xPosition === 'left' || xPosition === 'end') { 41473 justifyContent = 'flex-end'; 41474 marginLeft = xOffset; 41475 } else if (xPosition === 'right' || xPosition === 'start') { 41476 justifyContent = 'flex-start'; 41477 marginRight = xOffset; 41478 } 41479 } else if (xPosition === 'left' || xPosition === 'start') { 41480 justifyContent = 'flex-start'; 41481 marginLeft = xOffset; 41482 } else if (xPosition === 'right' || xPosition === 'end') { 41483 justifyContent = 'flex-end'; 41484 marginRight = xOffset; 41485 } 41486 styles.position = this._cssPosition; 41487 styles.marginLeft = shouldBeFlushHorizontally ? '0' : marginLeft; 41488 styles.marginTop = shouldBeFlushVertically ? '0' : this._topOffset; 41489 styles.marginBottom = this._bottomOffset; 41490 styles.marginRight = shouldBeFlushHorizontally ? '0' : marginRight; 41491 parentStyles.justifyContent = justifyContent; 41492 parentStyles.alignItems = shouldBeFlushVertically ? 'flex-start' : this._alignItems; 41493 } 41494 /** 41495 * Cleans up the DOM changes from the position strategy. 41496 * @docs-private 41497 */ 41498 dispose() { 41499 if (this._isDisposed || !this._overlayRef) { 41500 return; 41501 } 41502 const styles = this._overlayRef.overlayElement.style; 41503 const parent = this._overlayRef.hostElement; 41504 const parentStyles = parent.style; 41505 parent.classList.remove(wrapperClass); 41506 parentStyles.justifyContent = parentStyles.alignItems = styles.marginTop = styles.marginBottom = styles.marginLeft = styles.marginRight = styles.position = ''; 41507 this._overlayRef = null; 41508 this._isDisposed = true; 41509 } 41510} 41511 41512/** Builder for overlay position strategy. */ 41513let OverlayPositionBuilder = /*#__PURE__*/(() => { 41514 var _OverlayPositionBuilder; 41515 class OverlayPositionBuilder { 41516 constructor() { 41517 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_viewportRuler", (0,_angular_core__WEBPACK_IMPORTED_MODULE_5__.inject)(_scrolling_mjs__WEBPACK_IMPORTED_MODULE_6__.ViewportRuler)); 41518 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_document", (0,_angular_core__WEBPACK_IMPORTED_MODULE_5__.inject)(_angular_common__WEBPACK_IMPORTED_MODULE_7__.DOCUMENT)); 41519 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_platform", (0,_angular_core__WEBPACK_IMPORTED_MODULE_5__.inject)(_platform_DmdVEw_C_mjs__WEBPACK_IMPORTED_MODULE_8__.P)); 41520 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_overlayContainer", (0,_angular_core__WEBPACK_IMPORTED_MODULE_5__.inject)(OverlayContainer)); 41521 } 41522 /** 41523 * Creates a global position strategy. 41524 */ 41525 global() { 41526 return new GlobalPositionStrategy(); 41527 } 41528 /** 41529 * Creates a flexible position strategy. 41530 * @param origin Origin relative to which to position the overlay. 41531 */ 41532 flexibleConnectedTo(origin) { 41533 return new FlexibleConnectedPositionStrategy(origin, this._viewportRuler, this._document, this._platform, this._overlayContainer); 41534 } 41535 } 41536 _OverlayPositionBuilder = OverlayPositionBuilder; 41537 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(OverlayPositionBuilder, "\u0275fac", function _OverlayPositionBuilder_Factory(__ngFactoryType__) { 41538 return new (__ngFactoryType__ || _OverlayPositionBuilder)(); 41539 }); 41540 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(OverlayPositionBuilder, "\u0275prov", /* @__P
41540URE__ */_angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵdefineInjectable"]({ 41541 token: _OverlayPositionBuilder, 41542 factory: _OverlayPositionBuilder.ɵfac, 41543 providedIn: 'root' 41544 })); 41545 return OverlayPositionBuilder; 41546})(); 41547/*#__PURE__*/(() => { 41548 (typeof ngDevMode === "undefined" || ngDevMode) && void 0; 41549})(); 41550 41551/** 41552 * Service to create Overlays. Overlays are dynamically added pieces of floating UI, meant to be 41553 * used as a low-level building block for other components. Dialogs, tooltips, menus, 41554 * selects, etc. can all be built using overlays. The service should primarily be used by authors 41555 * of re-usable components rather than developers building end-user applications. 41556 * 41557 * An overlay *is* a PortalOutlet, so any kind of Portal can be loaded into one. 41558 */ 41559let Overlay = /*#__PURE__*/(() => { 41560 var _Overlay; 41561 class Overlay { 41562 constructor() { 41563 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "scrollStrategies", (0,_angular_core__WEBPACK_IMPORTED_MODULE_5__.inject)(ScrollStrategyOptions)); 41564 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_overlayContainer", (0,_angular_core__WEBPACK_IMPORTED_MODULE_5__.inject)(OverlayContainer)); 41565 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_positionBuilder", (0,_angular_core__WEBPACK_IMPORTED_MODULE_5__.inject)(OverlayPositionBuilder)); 41566 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_keyboardDispatcher", (0,_angular_core__WEBPACK_IMPORTED_MODULE_5__.inject)(OverlayKeyboardDispatcher)); 41567 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_injector", (0,_angular_core__WEBPACK_IMPORTED_MODULE_5__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_5__.Injector)); 41568 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_ngZone", (0,_angular_core__WEBPACK_IMPORTED_MODULE_5__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_5__.NgZone)); 41569 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_document", (0,_angular_core__WEBPACK_IMPORTED_MODULE_5__.inject)(_angular_common__WEBPACK_IMPORTED_MODULE_7__.DOCUMENT)); 41570 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_directionality", (0,_angular_core__WEBPACK_IMPORTED_MODULE_5__.inject)(_directionality_CBXD4hga_mjs__WEBPACK_IMPORTED_MODULE_18__.D)); 41571 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_location", (0,_angular_core__WEBPACK_IMPORTED_MODULE_5__.inject)(_angular_common__WEBPACK_IMPORTED_MODULE_19__.Location)); 41572 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_outsideClickDispatcher", (0,_angular_core__WEBPACK_IMPORTED_MODULE_5__.inject)(OverlayOutsideClickDispatcher)); 41573 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_animationsModuleType", (0,_angular_core__WEBPACK_IMPORTED_MODULE_5__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_5__.ANIMATION_MODULE_TYPE, { 41574 optional: true 41575 })); 41576 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_idGenerator", (0,_angular_core__WEBPACK_IMPORTED_MODULE_5__.inject)(_id_generator_Dw_9dSDu_mjs__WEBPACK_IMPORTED_MODULE_20__._)); 41577 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_renderer", (0,_angular_core__WEBPACK_IMPORTED_MODULE_5__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_5__.RendererFactory2).createRenderer(null, null)); 41578 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_appRef", void 0); 41579 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_styleLoader", (0,_angular_core__WEBPACK_IMPORTED_MODULE_5__.inject)(_style_loader_Cu9AvjH9_mjs__WEBPACK_IMPORTED_MODULE_11__._)); 41580 } 41581 /** 41582 * Creates an overlay.
41583 * @param config Configuration applied to the overlay. 41584 * @returns Reference to the created overlay. 41585 */ 41586 create(config) { 41587 // This is done in the overlay container as well, but we have it here 41588 // since it's common to mock out the overlay container in tests. 41589 this._styleLoader.load(_CdkOverlayStyleLoader); 41590 const host = this._createHostElement(); 41591 const pane = this._createPaneElement(host); 41592 const portalOutlet = this._createPortalOutlet(pane); 41593 const overlayConfig = new OverlayConfig(config); 41594 overlayConfig.direction = overlayConfig.direction || this._directionality.value; 41595 return new OverlayRef(portalOutlet, host, pane, overlayConfig, this._ngZone, this._keyboardDispatcher, this._document, this._location, this._outsideClickDispatcher, this._animationsModuleType === 'NoopAnimations', this._injector.get(_angular_core__WEBPACK_IMPORTED_MODULE_5__.EnvironmentInjector), this._renderer); 41596 } 41597 /** 41598 * Gets a position builder that can be used, via fluent API, 41599 * to construct and configure a position strategy. 41600 * @returns An overlay position builder. 41601 */ 41602 position() { 41603 return this._positionBuilder; 41604 } 41605 /** 41606 * Creates the DOM element for an overlay and appends it to the overlay container. 41607 * @returns Newly-created pane element 41608 */ 41609 _createPaneElement(host) { 41610 const pane = this._document.createElement('div'); 41611 pane.id = this._idGenerator.getId('cdk-overlay-'); 41612 pane.classList.add('cdk-overlay-pane'); 41613 host.appendChild(pane); 41614 return pane; 41615 } 41616 /** 41617 * Creates the host element that wraps around an overlay 41618 * and can be used for advanced positioning. 41619 * @returns Newly-create host element. 41620 */ 41621 _createHostElement() { 41622 const host = this._document.createElement('div'); 41623 this._overlayContainer.getContainerElement().appendChild(host); 41624 return host; 41625 } 41626 /** 41627 * Create a DomPortalOutlet into which the overlay content can be loaded. 41628 * @param pane The DOM element to turn into a portal outlet. 41629 * @returns A portal outlet for the given DOM element. 41630 */ 41631 _createPortalOutlet(pane) { 41632 // We have to resolve the ApplicationRef later in order to allow people 41633 // to use overlay-based providers during app initialization. 41634 if (!this._appRef) { 41635 this._appRef = this._injector.get(_angular_core__WEBPACK_IMPORTED_MODULE_5__.ApplicationRef); 41636 } 41637 return new _portal_directives_Bw5woq8I_mjs__WEBPACK_IMPORTED_MODULE_21__.b(pane, null, this._appRef, this._injector, this._document); 41638 } 41639 } 41640 _Overlay = Overlay; 41641 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Overlay, "\u0275fac", function _Overlay_Factory(__ngFactoryType__) { 41642 return new (__ngFactoryType__ || _Overlay)(); 41643 }); 41644 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(Overlay, "\u0275prov", /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵdefineInjectable"]({ 41645 token: _Overlay, 41646 factory: _Overlay.ɵfac, 41647 providedIn: 'root' 41648 })); 41649 return Overlay; 41650})(); 41651/*#__PURE__*/(() => { 41652 (typeof ngDevMode === "undefined" || ngDevMode) && void 0; 41653})(); 41654 41655/** Default set of positions for the overlay. Follows the behavior of a dropdown. */ 41656const defaultPositionList = [{ 41657 originX: 'start', 41658 originY: 'bottom', 41659 overlayX: 'start', 41660 overlayY: 'top' 41661}, { 41662 originX: 'start', 41663 originY: 'top', 41664 overlayX: 'start', 41665 overlayY: 'bottom' 41666}, { 41667 originX: 'end', 41668 originY: 'top', 41669 overlayX: 'end', 41670 overlayY: 'bottom' 41671}, { 41672 originX: 'end', 41673 originY: 'bottom', 41674 overlayX: 'end', 41675 overlayY: 'top' 41676}]; 41677/** Injection token that determines the scroll handling while the connected overlay is open. */ 41678const CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY = /*#__PURE__*/new _angular_core__WEBPACK_IMPORTED_MODULE_5__.InjectionToken('cdk-connected-overlay-scroll-strategy', { 41679 providedIn: 'root', 41680 factory: () => {
41681 const overlay = (0,_angular_core__WEBPACK_IMPORTED_MODULE_5__.inject)(Overlay); 41682 return () => overlay.scrollStrategies.reposition(); 41683 } 41684}); 41685/** 41686 * Directive applied to an element to make it usable as an origin for an Overlay using a 41687 * ConnectedPositionStrategy. 41688 */ 41689let CdkOverlayOrigin = /*#__PURE__*/(() => { 41690 var _CdkOverlayOrigin; 41691 class CdkOverlayOrigin { 41692 constructor() { 41693 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "elementRef", (0,_angular_core__WEBPACK_IMPORTED_MODULE_5__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_5__.ElementRef)); 41694 } 41695 } 41696 _CdkOverlayOrigin = CdkOverlayOrigin; 41697 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(CdkOverlayOrigin, "\u0275fac", function _CdkOverlayOrigin_Factory(__ngFactoryType__) { 41698 return new (__ngFactoryType__ || _CdkOverlayOrigin)(); 41699 }); 41700 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(CdkOverlayOrigin, "\u0275dir", /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵdefineDirective"]({ 41701 type: _CdkOverlayOrigin, 41702 selectors: [["", "cdk-overlay-origin", ""], ["", "overlay-origin", ""], ["", "cdkOverlayOrigin", ""]], 41703 exportAs: ["cdkOverlayOrigin"] 41704 })); 41705 return CdkOverlayOrigin; 41706})(); 41707/*#__PURE__*/(() => { 41708 (typeof ngDevMode === "undefined" || ngDevMode) && void 0; 41709})(); 41710/** 41711 * Directive to facilitate declarative creation of an 41712 * Overlay using a FlexibleConnectedPositionStrategy. 41713 */ 41714let CdkConnectedOverlay = /*#__PURE__*/(() => { 41715 var _CdkConnectedOverlay; 41716 class CdkConnectedOverlay { 41717 /** The offset in pixels for the overlay connection point on the x-axis */ 41718 get offsetX() { 41719 return this._offsetX; 41720 } 41721 set offsetX(offsetX) { 41722 this._offsetX = offsetX; 41723 if (this._position) { 41724 this._updatePositionStrategy(this._position); 41725 } 41726 } 41727 /** The offset in pixels for the overlay connection point on the y-axis */ 41728 get offsetY() { 41729 return this._offsetY; 41730 } 41731 set offsetY(offsetY) { 41732 this._offsetY = offsetY; 41733 if (this._position) { 41734 this._updatePositionStrategy(this._position); 41735 } 41736 } 41737 /** The width of the overlay panel. */ 41738 41739 /** Whether the overlay should be disposed of when the user goes backwards/forwards in history. */ 41740 get disposeOnNavigation() { 41741 return this._disposeOnNavigation; 41742 } 41743 set disposeOnNavigation(value) { 41744 this._disposeOnNavigation = value; 41745 } 41746 /** Event emitted when the backdrop is clicked. */ 41747 41748 // TODO(jelbourn): inputs for size, scroll behavior, animation, etc. 41749 constructor() { 41750 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_overlay", (0,_angular_core__WEBPACK_IMPORTED_MODULE_5__.inject)(Overlay)); 41751 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_dir", (0,_angular_core__WEBPACK_IMPORTED_MODULE_5__.inject)(_directionality_CBXD4hga_mjs__WEBPACK_IMPORTED_MODULE_18__.D, { 41752 optional: true 41753 })); 41754 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_overlayRef", void 0); 41755 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_templatePortal", void 0); 41756 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_backdropSubscription", rxjs__WEBPACK_IMPORTED_MODULE_14__.Subscription.EMPTY); 41757 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_attachSubscription", rxjs__WEBPACK_IMPORTED_MODULE_14__.Subscription.EMPTY); 41758 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_detachSubscription", rxjs__WEBPACK_IMPORTED_MODULE_14__.Subscription.EMPTY); 41759 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_positionSubscription", rxjs__WEBPACK_IMPORTED_MODULE_14__.Subscription.EMPTY); 41760 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_offsetX", void 0); 41761 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_offsetY", void 0); 41762 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_position", void 0); 41763 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_scrollStrategyFactory", (0,_angular_core__WEBPACK_IMPORTED_MODULE_5__.inject)(CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY)); 41764 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_disposeOnNavigation", false); 41765 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_ngZone", (0,_angular_core__WEBPACK_IMPORTED_MODULE_5__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_5__.NgZone)); 41766 /** Origin for the connected overlay. */ 41767 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "origin", void 0); 41768 /** Registered connected position pairs. */ 41769 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "positions", void 0); 41770 /** 41771 * This input overrides the positions input if specified. It lets users pass 41772 * in arbitrary positioning strategies. 41773 */ 41774 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "positionStrategy", void 0); 41775 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "width", void 0); 41776 /** The height of the overlay panel. */ 41777 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "height", void 0); 41778 /** The min width of the overlay panel. */ 41779 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "minWidth", void 0); 41780 /** The min height of the overlay panel. */ 41781 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "minHeight", void 0); 41782 /** The custom class to be set on the backdrop element. */ 41783 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "backdropClass", void 0); 41784 /** The custom class to add to the overlay pane element. */ 41785 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "panelClass", void 0); 41786 /** Margin between the overlay and the viewport edges. */ 41787 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "viewportMargin", 0); 41788 /** Strategy to be used when handling scroll events while the overlay is open. */ 41789 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "scrollStrategy", void 0); 41790 /** Whether the overlay is open. */ 41791 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "open", false); 41792 /** Whether the overlay can be closed by user interaction. */ 41793 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "disableClose", false); 41794 /** CSS selector which to set the transform origin. */ 41795 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "transformOriginSelector", void 0); 41796 /** Whether or not the overlay should attach a backdrop. */ 41797 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "hasBackdrop", false); 41798 /** Whether or not the overlay should be locked when scrolling. */ 41799 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "lockPosition", false); 41800 /** Whether the overlay's width and height can be constrained to fit within the viewport. */ 41801 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "flexibleDimensions", false); 41802 /** Whether the overlay can grow after the initial open when flexible positioning is turned on. */ 41803 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "growAfterOpen", false); 41804 /** Whether the overlay can be pushed on-screen if none of the provided positions fit. */ 41805 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "push", false); 41806 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "backdropClick", new _angular_core__WEBPACK_IMPORTED_MODULE_5__.EventEmitter()); 41807 /** Event emitted when the position has changed. */ 41808 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "positionChange", new _angular_core__WEBPACK_IMPORTED_MODULE_5__.EventEmitter()); 41809 /** Event emitted when the overlay has been attached. */ 41810 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "attach", new _angular_core__WEBPACK_IMPORTED_MODULE_5__.EventEmitter()); 41811 /** Event emitted when the overlay has been detached. */ 41812 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "detach", new _angular_core__WEBPACK_IMPORTED_MODULE_5__.EventEmitter()); 41813 /** Emits when there are keyboard events that are targeted at the overlay. */ 41814 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "overlayKeydown", new _angular_core__WEBPACK_IMPORTED_MODULE_5__.EventEmitter()); 41815 /** Emits when there are mouse outside click events that are targeted at the overlay. */ 41816 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "overlayOutsideClick", new _angular_core__WEBPACK_IMPORTED_MODULE_5__.EventEmitter()); 41817 const templateRef = (0,_angular_core__WEBPACK_IMPORTED_MODULE_5__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_5__.TemplateRef); 41818 const viewContainerRef = (0,_angular_core__WEBPACK_IMPORTED_MODULE_5__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_5__.Vie
41818wContainerRef); 41819 this._templatePortal = new _portal_directives_Bw5woq8I_mjs__WEBPACK_IMPORTED_MODULE_21__.T(templateRef, viewContainerRef); 41820 this.scrollStrategy = this._scrollStrategyFactory(); 41821 } 41822 /** The associated overlay reference. */ 41823 get overlayRef() { 41824 return this._overlayRef; 41825 } 41826 /** The element's layout direction. */ 41827 get dir() { 41828 return this._dir ? this._dir.value : 'ltr'; 41829 } 41830 ngOnDestroy() { 41831 var _this$_overlayRef; 41832 this._attachSubscription.unsubscribe(); 41833 this._detachSubscription.unsubscribe(); 41834 this._backdropSubscription.unsubscribe(); 41835 this._positionSubscription.unsubscribe(); 41836 (_this$_overlayRef = this._overlayRef) === null || _this$_overlayRef === void 0 || _this$_overlayRef.dispose(); 41837 } 41838 ngOnChanges(changes) { 41839 if (this._position) { 41840 var _this$_overlayRef2; 41841 this._updatePositionStrategy(this._position); 41842 (_this$_overlayRef2 = this._overlayRef) === null || _this$_overlayRef2 === void 0 || _this$_overlayRef2.updateSize({ 41843 width: this.width, 41844 minWidth: this.minWidth, 41845 height: this.height, 41846 minHeight: this.minHeight 41847 }); 41848 if (changes['origin'] && this.open) { 41849 this._position.apply(); 41850 } 41851 } 41852 if (changes['open']) { 41853 this.open ? this.attachOverlay() : this.detachOverlay(); 41854 } 41855 } 41856 /** Creates an overlay */ 41857 _createOverlay() { 41858 if (!this.positions || !this.positions.length) { 41859 this.positions = defaultPositionList; 41860 } 41861 const overlayRef = this._overlayRef = this._overlay.create(this._buildConfig()); 41862 this._attachSubscription = overlayRef.attachments().subscribe(() => this.attach.emit()); 41863 this._detachSubscription = overlayRef.detachments().subscribe(() => this.detach.emit()); 41864 overlayRef.keydownEvents().subscribe(event => { 41865 this.overlayKeydown.next(event); 41866 if (event.keyCode === _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_22__.g && !this.disableClose && !(0,_keycodes_mjs__WEBPACK_IMPORTED_MODULE_23__.hasModifierKey)(event)) { 41867 event.preventDefault(); 41868 this.detachOverlay(); 41869 } 41870 }); 41871 this._overlayRef.outsidePointerEvents().subscribe(event => { 41872 const origin = this._getOriginElement(); 41873 const target = (0,_shadow_dom_B0oHn41l_mjs__WEBPACK_IMPORTED_MODULE_9__._)(event); 41874 if (!origin || origin !== target && !origin.contains(target)) { 41875 this.overlayOutsideClick.next(event); 41876 } 41877 }); 41878 } 41879 /** Builds the overlay config based on the directive's inputs */ 41880 _buildConfig() { 41881 const positionStrategy = this._position = this.positionStrategy || this._createPositionStrategy(); 41882 const overlayConfig = new OverlayConfig({ 41883 direction: this._dir || 'ltr', 41884 positionStrategy, 41885 scrollStrategy: this.scrollStrategy, 41886 hasBackdrop: this.hasBackdrop, 41887 disposeOnNavigation: this.disposeOnNavigation 41888 }); 41889 if (this.width || this.width === 0) { 41890 overlayConfig.width = this.width; 41891 } 41892 if (this.height || this.height === 0) { 41893 overlayConfig.height = this.height; 41894 } 41895 if (this.minWidth || this.minWidth === 0) { 41896 overlayConfig.minWidth = this.minWidth; 41897 } 41898 if (this.minHeight || this.minHeight === 0) { 41899 overlayConfig.minHeight = this.minHeight; 41900 } 41901 if (this.backdropClass) { 41902 overlayConfig.backdropClass = this.backdropClass; 41903 } 41904 if (this.panelClass) { 41905 overlayConfig.panelClass = this.panelClass; 41906 } 41907 return overlayConfig; 41908 } 41909 /** Updates the state of a position strategy, based on the values of the directive inputs. */ 41910 _updatePositionStrategy(positionStrategy) { 41911 const positions = this.positions.map(currentPosition => ({ 41912 originX: currentPosition.originX, 41913 originY: currentPosition.originY, 41914 overlayX: currentPosition.overlayX, 41915 overlayY: currentPosition.overlayY, 41916 offsetX: currentPosition.offsetX || this.offsetX, 41917 offsetY: currentPosition.offsetY || this.offsetY, 41918 panelClass: currentPosition.panelClass || undefined 41919 })); 41920 return positionStrategy.setOrigin(this._getOrigin()).withPositions(positions).withFlexibleDimensions(this.flexibleDimensions).withPush(this.push).withGrowAfterOpen(this.growAfterOpen).withViewportMargin(this.viewportMargin).withLockedPosition(this.lockPosition).withTransformOriginOn(this.transformOriginSelector); 41921 } 41922 /** Returns the position strategy of the overlay to be set on the overlay config */ 41923 _createPositionStrategy() { 41924 const strategy = this._overlay.position().flexibleConnectedTo(this._getOrigin()); 41925 this._updatePositionStrategy(strategy); 41926 return strategy; 41927 } 41928 _getOrigin() {
41929 if (this.origin instanceof CdkOverlayOrigin) { 41930 return this.origin.elementRef; 41931 } else { 41932 return this.origin; 41933 } 41934 } 41935 _getOriginElement() { 41936 if (this.origin instanceof CdkOverlayOrigin) { 41937 return this.origin.elementRef.nativeElement; 41938 } 41939 if (this.origin instanceof _angular_core__WEBPACK_IMPORTED_MODULE_5__.ElementRef) { 41940 return this.origin.nativeElement; 41941 } 41942 if (typeof Element !== 'undefined' && this.origin instanceof Element) { 41943 return this.origin; 41944 } 41945 return null; 41946 } 41947 /** Attaches the overlay. */ 41948 attachOverlay() { 41949 if (!this._overlayRef) { 41950 this._createOverlay(); 41951 } else { 41952 // Update the overlay size, in case the directive's inputs have changed 41953 this._overlayRef.getConfig().hasBackdrop = this.hasBackdrop; 41954 } 41955 if (!this._overlayRef.hasAttached()) { 41956 this._overlayRef.attach(this._templatePortal); 41957 } 41958 if (this.hasBackdrop) { 41959 this._backdropSubscription = this._overlayRef.backdropClick().subscribe(event => { 41960 this.backdropClick.emit(event); 41961 }); 41962 } else { 41963 this._backdropSubscription.unsubscribe(); 41964 } 41965 this._positionSubscription.unsubscribe(); 41966 // Only subscribe to `positionChanges` if requested, because putting 41967 // together all the information for it can be expensive. 41968 if (this.positionChange.observers.length > 0) { 41969 this._positionSubscription = this._position.positionChanges.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_24__.takeWhile)(() => this.positionChange.observers.length > 0)).subscribe(position => { 41970 this._ngZone.run(() => this.positionChange.emit(position)); 41971 if (this.positionChange.observers.length === 0) { 41972 this._positionSubscription.unsubscribe(); 41973 } 41974 }); 41975 } 41976 this.open = true; 41977 } 41978 /** Detaches the overlay. */ 41979 detachOverlay() { 41980 var _this$_overlayRef3; 41981 (_this$_overlayRef3 = this._overlayRef) === null || _this$_overlayRef3 === void 0 || _this$_overlayRef3.detach(); 41982 this._backdropSubscription.unsubscribe(); 41983 this._positionSubscription.unsubscribe(); 41984 this.open = false; 41985 } 41986 } 41987 _CdkConnectedOverlay = CdkConnectedOverlay; 41988 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(CdkConnectedOverlay, "\u0275fac", function _CdkConnectedOverlay_Factory(__ngFactoryType__) { 41989 return new (__ngFactoryType__ || _CdkConnectedOverlay)(); 41990 }); 41991 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(CdkConnectedOverlay, "\u0275dir", /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵdefineDirective"]({ 41992 type: _CdkConnectedOverlay, 41993 selectors: [["", "cdk-connected-overlay", ""], ["", "connected-overlay", ""], ["", "cdkConnectedOverlay", ""]], 41994 inputs: { 41995 origin: [0, "cdkConnectedOverlayOrigin", "origin"], 41996 positions: [0, "cdkConnectedOverlayPositions", "positions"], 41997 positionStrategy: [0, "cdkConnectedOverlayPositionStrategy", "positionStrategy"], 41998 offsetX: [0, "cdkConnectedOverlayOffsetX", "offsetX"], 41999 offsetY: [0, "cdkConnectedOverlayOffsetY", "offsetY"], 42000 width: [0, "cdkConnectedOverlayWidth", "width"], 42001 height: [0, "cdkConnectedOverlayHeight", "height"], 42002 minWidth: [0, "cdkConnectedOverlayMinWidth", "minWidth"], 42003 minHeight: [0, "cdkConnectedOverlayMinHeight", "minHeight"], 42004 backdropClass: [0, "cdkConnectedOverlayBackdropClass", "backdropClass"], 42005 panelClass: [0, "cdkConnectedOverlayPanelClass", "panelClass"], 42006 viewportMargin: [0, "cdkConnectedOverlayViewportMargin", "viewportMargin"], 42007 scrollStrategy: [0, "cdkConnectedOverlayScrollStrategy", "scrollStrategy"], 42008 open: [0, "cdkConnectedOverlayOpen", "open"], 42009 disableClose: [0, "cdkConnectedOverlayDisableClose", "disableClose"], 42010 transformOriginSelector: [0, "cdkConnectedOverlayTransformOriginOn", "transformOriginSelector"], 42011 hasBackdrop: [2, "cdkConnectedOverlayHasBackdrop", "hasBackdrop", _angular_core__WEBPACK_IMPORTED_MODULE_5__.booleanAttribute], 42012 lockPosition: [2, "cdkConnectedOverlayLockPosition", "lockPosition", _angular_core__WEBPACK_IMPORTED_MODULE_5__.booleanAttribute], 42013 flexibleDimensions: [2, "cdkConnectedOverlayFlexibleDimensions", "flexibleDimensions", _angular_core__WEBPACK_IMPORTED_MODULE_5__.booleanAttribute], 42014 growAfterOpen: [2, "cdkConnectedOverlayGrowAfterOpen", "growAfterOpen", _angular_core__WEBPACK_IMPORTED_MODULE_5__.booleanAttribute], 42015 push: [2, "cdkConnectedOverlayPush", "push", _angular_core__WEBPACK_IMPORTED_MODULE_5__.booleanAttribute], 42016 disposeOnNavigation: [2, "cdkConnectedOverlayDisposeOnNavigation", "dis
42016poseOnNavigation", _angular_core__WEBPACK_IMPORTED_MODULE_5__.booleanAttribute] 42017 }, 42018 outputs: { 42019 backdropClick: "backdropClick", 42020 positionChange: "positionChange", 42021 attach: "attach", 42022 detach: "detach", 42023 overlayKeydown: "overlayKeydown", 42024 overlayOutsideClick: "overlayOutsideClick" 42025 }, 42026 exportAs: ["cdkConnectedOverlay"], 42027 features: [_angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵNgOnChangesFeature"]] 42028 })); 42029 return CdkConnectedOverlay; 42030})(); 42031/*#__PURE__*/(() => { 42032 (typeof ngDevMode === "undefined" || ngDevMode) && void 0; 42033})(); 42034/** 42035 * @docs-private 42036 * @deprecated No longer used, will be removed. 42037 * @breaking-change 21.0.0 42038 */ 42039function CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER_FACTORY(overlay) { 42040 return () => overlay.scrollStrategies.reposition(); 42041} 42042/** 42043 * @docs-private 42044 * @deprecated No longer used, will be removed. 42045 * @breaking-change 21.0.0 42046 */ 42047const CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER = { 42048 provide: CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY, 42049 deps: [Overlay], 42050 useFactory: CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER_FACTORY 42051}; 42052let OverlayModule = /*#__PURE__*/(() => { 42053 var _OverlayModule; 42054 class OverlayModule {} 42055 _OverlayModule = OverlayModule; 42056 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(OverlayModule, "\u0275fac", function _OverlayModule_Factory(__ngFactoryType__) { 42057 return new (__ngFactoryType__ || _OverlayModule)(); 42058 }); 42059 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(OverlayModule, "\u0275mod", /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵdefineNgModule"]({ 42060 type: _OverlayModule 42061 })); 42062 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(OverlayModule, "\u0275inj", /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵdefineInjector"]({ 42063 providers: [Overlay, CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER], 42064 imports: [_bidi_mjs__WEBPACK_IMPORTED_MODULE_25__.BidiModule, _portal_directives_Bw5woq8I_mjs__WEBPACK_IMPORTED_MODULE_21__.h, _scrolling_mjs__WEBPACK_IMPORTED_MODULE_6__.ScrollingModule, _scrolling_mjs__WEBPACK_IMPORTED_MODULE_6__.ScrollingModule] 42065 })); 42066 return OverlayModule; 42067})(); 42068/*#__PURE__*/(() => { 42069 (typeof ngDevMode === "undefined" || ngDevMode) && void 0; 42070})(); 42071 42072//# sourceMappingURL=overlay-module-BUj0D19H.mjs.map 42073 42074/***/ }), 42075 42076/***/ 63142: 42077/*!***********************************************************************************!*\ 42078 !*** ./node_modules/@angular/platform-browser/fesm2022/dom_renderer-DGKzginR.mjs ***! 42079 \***********************************************************************************/ 42080/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { 42081 42082__webpack_require__.r(__webpack_exports__); 42083/* harmony export */ __webpack_require__.d(__webpack_exports__, { 42084/* harmony export */ DomRendererFactory2: () => (/* binding */ DomRendererFactory2), 42085/* harmony export */ EVENT_MANAGER_PLUGINS: () => (/* binding */ EVENT_MANAGER_PLUGINS), 42086/* harmony export */ EventManager: () => (/* binding */ EventManager), 42087/* harmony export */ EventManagerPlugin: () => (/* binding */ EventManagerPlugin), 42088/* harmony export */ REMOVE_STYLES_ON_COMPONENT_DESTROY: () => (/* binding */ REMOVE_STYLES_ON_COMPONENT_DESTROY), 42089/* harmony export */ SharedStylesHost: () => (/* binding */ SharedStylesHost) 42090/* harmony export */ }); 42091/* harmony import */ var C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js */ 89379); 42092/* harmony import */ var C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/defineProperty.js */ 64467); 42093/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/common */ 69377); 42094/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/common */ 59361); 42095/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/common */ 96048); 42096/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/core */ 17705); 42097 42098 42099/** 42100 * @license Angular v19.2.14 42101 * (c) 2010-2025 Google LLC. https://angular.io/ 42102 * License: MIT 42103 */ 42104 42105 42106 42107 42108 42109/** 42110 * The injection token for plugins of the `EventManager` service. 42111 * 42112 * @publicApi 42113 */ 42114const EVENT_MANAGER_PLUGINS = /*#__PURE__*/new _angular_core__WEBPACK_IMPORTED_MODULE_2__.InjectionToken(ngDevMode ? 'EventManagerPlugins' : ''); 42115/** 42116 * An injectable service that provides event management for Angular 42117 * through a browser plug-in. 42118 * 42119 * @publicApi 42120 */ 42121let EventManager = /*#__PURE__*/(() => { 42122 var _EventManager; 42123 class EventManager { 42124 /** 42125 * Initializes an instance of the event-manager service. 42126 */ 42127 constructor(plugins, _zone) { 42128 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_zone", void 0); 42129 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_plugins", void 0); 42130 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_eventNameToPlugin", new Map()); 42131 this._zone = _zone; 42132 plugins.forEach(plugin => { 42133 plugin.manager = this; 42134 }); 42135 this._plugins = plugins.slice().reverse(); 42136 } 42137 /** 42138 * Registers a handler for a specific element and event. 42139 * 42140 * @param element The HTML element to receive event notifications. 42141 * @param eventName The name of the event to listen for. 42142 * @param handler A function to call when the notification occurs. Receives the 42143 * event object as an argument. 42144 * @param options Options that configure how the event listener is bound.
42145 * @returns A callback function that can be used to remove the handler. 42146 */ 42147 addEventListener(element, eventName, handler, options) { 42148 const plugin = this._findPluginFor(eventName); 42149 return plugin.addEventListener(element, eventName, handler, options); 42150 } 42151 /** 42152 * Retrieves the compilation zone in which event listeners are registered. 42153 */ 42154 getZone() { 42155 return this._zone; 42156 } 42157 /** @internal */ 42158 _findPluginFor(eventName) { 42159 let plugin = this._eventNameToPlugin.get(eventName); 42160 if (plugin) { 42161 return plugin; 42162 } 42163 const plugins = this._plugins; 42164 plugin = plugins.find(plugin => plugin.supports(eventName)); 42165 if (!plugin) { 42166 throw new _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵRuntimeError"](5101 /* RuntimeErrorCode.NO_PLUGIN_FOR_EVENT */, (typeof ngDevMode === 'undefined' || ngDevMode) && `No event manager plugin found for event ${eventName}`); 42167 } 42168 this._eventNameToPlugin.set(eventName, plugin); 42169 return plugin; 42170 } 42171 } 42172 _EventManager = EventManager; 42173 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(EventManager, "\u0275fac", function _EventManager_Factory(__ngFactoryType__) { 42174 return new (__ngFactoryType__ || _EventManager)(_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵinject"](EVENT_MANAGER_PLUGINS), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_2__.NgZone)); 42175 }); 42176 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(EventManager, "\u0275prov", /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineInjectable"]({ 42177 token: _EventManager, 42178 factory: _EventManager.ɵfac 42179 })); 42180 return EventManager; 42181})(); 42182/*#__PURE__*/(() => { 42183 (typeof ngDevMode === "undefined" || ngDevMode) && void 0; 42184})(); 42185/** 42186 * The plugin definition for the `EventManager` class 42187 * 42188 * It can be used as a base class to create custom manager plugins, i.e. you can create your own 42189 * class that extends the `EventManagerPlugin` one. 42190 * 42191 * @publicApi 42192 */ 42193class EventManagerPlugin { 42194 // TODO: remove (has some usage in G3) 42195 constructor(_doc) { 42196 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "_doc", void 0); 42197 // Using non-null assertion because it's set by EventManager's constructor 42198 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "manager", void 0); 42199 this._doc = _doc; 42200 } 42201} 42202 42203/** The style elements attribute name used to set value of `APP_ID` token. */ 42204const APP_ID_ATTRIBUTE_NAME = 'ng-app-id'; 42205/** 42206 * Removes all provided elements from the document. 42207 * @param elements An array of HTML Elements. 42208 */ 42209function removeElements(elements) { 42210 for (const element of elements) { 42211 element.remove(); 42212 } 42213} 42214/** 42215 * Creates a `style` element with the provided inline style content. 42216 * @param style A string of the inline style content. 42217 * @param doc A DOM Document to use to create the element. 42218 * @returns An HTMLStyleElement instance. 42219 */ 42220function createStyleElement(style, doc) { 42221 const styleElement = doc.createElement('style'); 42222 styleElement.textContent = style; 42223 return styleElement; 42224} 42225/** 42226 * Searches a DOM document's head element for style elements with a matching application 42227 * identifier attribute (`ng-app-id`) to the provide identifier and adds usage records for each. 42228 * @param doc An HTML DOM document instance. 42229 * @param appId A string containing an Angular application identifer. 42230 * @param inline A Map object for tracking inline (defined via `styles` in component decorator) style usage. 42231 * @param external A Map object for tracking external (defined via `styleUrls` in component decorator) style usage. 42232 */ 42233function addServerStyles(doc, appId, inline, external) { 42234 var _doc$head; 42235 const elements = (_doc$head = doc.head) === null || _doc$head === void 0 ? void 0 : _doc$head.querySelectorAll(`style[${APP_ID_ATTRIBUTE_NAME}="${appId}"],link[${APP_ID_ATTRIBUTE_NAME}="${appId}"]`); 42236 if (elements) { 42237 for (const styleElement of elements) { 42238 styleElement.removeAttribute(APP_ID_ATTRIBUTE_NAME); 42239 if (styleElement instanceof HTMLLinkElement) { 42240 // Only use filename from href
42241 // The href is build time generated with a unique value to prevent duplicates. 42242 external.set(styleElement.href.slice(styleElement.href.lastIndexOf('/') + 1), { 42243 usage: 0, 42244 elements: [styleElement] 42245 }); 42246 } else if (styleElement.textContent) { 42247 inline.set(styleElement.textContent, { 42248 usage: 0, 42249 elements: [styleElement] 42250 }); 42251 } 42252 } 42253 } 42254} 42255/** 42256 * Creates a `link` element for the provided external style URL. 42257 * @param url A string of the URL for the stylesheet. 42258 * @param doc A DOM Document to use to create the element. 42259 * @returns An HTMLLinkElement instance. 42260 */ 42261function createLinkElement(url, doc) { 42262 const linkElement = doc.createElement('link'); 42263 linkElement.setAttribute('rel', 'stylesheet'); 42264 linkElement.setAttribute('href', url); 42265 return linkElement; 42266} 42267let SharedStylesHost = /*#__PURE__*/(() => { 42268 var _SharedStylesHost; 42269 class SharedStylesHost { 42270 constructor(doc, appId, nonce, platformId = {}) { 42271 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "doc", void 0); 42272 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "appId", void 0); 42273 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "nonce", void 0); 42274 /** 42275 * Provides usage information for active inline style content and associated HTML <style> elements. 42276 * Embedded styles typically originate from the `styles` metadata of a rendered component. 42277 */ 42278 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "inline", new Map()); 42279 /** 42280 * Provides usage information for active external style URLs and the associated HTML <link> elements. 42281 * External styles typically originate from the `ɵɵExternalStylesFeature` of a rendered component. 42282 */ 42283 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "external", new Map()); 42284 /** 42285 * Set of host DOM nodes that will have styles attached. 42286 */ 42287 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "hosts", new Set()); 42288 /** 42289 * Whether the application code is currently executing on a server. 42290 */ 42291 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "isServer", void 0); 42292 this.doc = doc; 42293 this.appId = appId; 42294 this.nonce = nonce; 42295 this.isServer = (0,_angular_common__WEBPACK_IMPORTED_MODULE_3__.isPlatformServer)(platformId); 42296 addServerStyles(doc, appId, this.inline, this.external); 42297 this.hosts.add(doc.head); 42298 } 42299 /** 42300 * Adds embedded styles to the DOM via HTML `style` elements. 42301 * @param styles An array of style content strings. 42302 */ 42303 addStyles(styles, urls) { 42304 for (const value of styles) { 42305 this.addUsage(value, this.inline, createStyleElement); 42306 } 42307 urls === null || urls === void 0 || urls.forEach(value => this.addUsage(value, this.external, createLinkElement)); 42308 } 42309 /** 42310 * Removes embedded styles from the DOM that were added as HTML `style` elements. 42311 * @param styles An array of style content strings. 42312 */ 42313 removeStyles(styles, urls) { 42314 for (const value of styles) { 42315 this.removeUsage(value, this.inline); 42316 } 42317 urls === null || urls === void 0 || urls.forEach(value => this.removeUsage(value, this.external)); 42318 } 42319 addUsage(value, usages, creator) { 42320 // Attempt to get any current usage of the value 42321 const record = usages.get(value); 42322 // If existing, just increment the usage count 42323 if (record) { 42324 if ((typeof ngDevMode === 'undefined' || ngDevMode) && record.usage === 0) { 42325 // A usage count of zero indicates a preexisting server generated style. 42326 // This attribute is solely used for debugging purposes of SSR style reuse.
42327 record.elements.forEach(element => element.setAttribute('ng-style-reused', '')); 42328 } 42329 record.usage++; 42330 } else { 42331 // Otherwise, create an entry to track the elements and add element for each host 42332 usages.set(value, { 42333 usage: 1, 42334 elements: [...this.hosts].map(host => this.addElement(host, creator(value, this.doc))) 42335 }); 42336 } 42337 } 42338 removeUsage(value, usages) { 42339 // Attempt to get any current usage of the value 42340 const record = usages.get(value); 42341 // If there is a record, reduce the usage count and if no longer used, 42342 // remove from DOM and delete usage record. 42343 if (record) { 42344 record.usage--; 42345 if (record.usage <= 0) { 42346 removeElements(record.elements); 42347 usages.delete(value); 42348 } 42349 } 42350 } 42351 ngOnDestroy() { 42352 for (const [, { 42353 elements 42354 }] of [...this.inline, ...this.external]) { 42355 removeElements(elements); 42356 } 42357 this.hosts.clear(); 42358 } 42359 /** 42360 * Adds a host node to the set of style hosts and adds all existing style usage to 42361 * the newly added host node. 42362 * 42363 * This is currently only used for Shadow DOM encapsulation mode. 42364 */ 42365 addHost(hostNode) { 42366 this.hosts.add(hostNode); 42367 // Add existing styles to new host 42368 for (const [style, { 42369 elements 42370 }] of this.inline) { 42371 elements.push(this.addElement(hostNode, createStyleElement(style, this.doc))); 42372 } 42373 for (const [url, { 42374 elements 42375 }] of this.external) { 42376 elements.push(this.addElement(hostNode, createLinkElement(url, this.doc))); 42377 } 42378 } 42379 removeHost(hostNode) { 42380 this.hosts.delete(hostNode); 42381 } 42382 addElement(host, element) { 42383 // Add a nonce if present 42384 if (this.nonce) { 42385 element.setAttribute('nonce', this.nonce); 42386 } 42387 // Add application identifier when on the server to support client-side reuse 42388 if (this.isServer) { 42389 element.setAttribute(APP_ID_ATTRIBUTE_NAME, this.appId); 42390 } 42391 // Insert the element into the DOM with the host node as parent 42392 return host.appendChild(element); 42393 } 42394 } 42395 _SharedStylesHost = SharedStylesHost; 42396 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(SharedStylesHost, "\u0275fac", function _SharedStylesHost_Factory(__ngFactoryType__) { 42397 return new (__ngFactoryType__ || _SharedStylesHost)(_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵinject"](_angular_common__WEBPACK_IMPORTED_MODULE_4__.DOCUMENT), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_2__.APP_ID), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_2__.CSP_NONCE, 8), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_2__.PLATFORM_ID)); 42398 }); 42399 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(SharedStylesHost, "\u0275prov", /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineInjectable"]({ 42400 token: _SharedStylesHost, 42401 factory: _SharedStylesHost.ɵfac 42402 })); 42403 return SharedStylesHost; 42404})(); 42405/*#__PURE__*/(() => { 42406 (typeof ngDevMode === "undefined" || ngDevMode) && void 0; 42407})(); 42408const NAMESPACE_URIS = { 42409 'svg': 'http://www.w3.org/2000/svg', 42410 'xhtml': 'http://www.w3.org/1999/xhtml', 42411 'xlink': 'http://www.w3.org/1999/xlink', 42412 'xml': 'http://www.w3.org/XML/1998/namespace', 42413 'xmlns': 'http://www.w3.org/2000/xmlns/', 42414 'math': 'http://www.w3.org/1998/Math/MathML' 42415}; 42416const COMPONENT_REGEX = /%COMP%/g; 42417const SOURCEMAP_URL_REGEXP = /\/\*#\s*sourceMappingURL=(.+?)\s*\*\//; 42418const PROTOCOL_REGEXP = /^https?:/;
42419const COMPONENT_VARIABLE = '%COMP%'; 42420const HOST_ATTR = `_nghost-${COMPONENT_VARIABLE}`; 42421const CONTENT_ATTR = `_ngcontent-${COMPONENT_VARIABLE}`; 42422/** 42423 * The default value for the `REMOVE_STYLES_ON_COMPONENT_DESTROY` DI token. 42424 */ 42425const REMOVE_STYLES_ON_COMPONENT_DESTROY_DEFAULT = true; 42426/** 42427 * A DI token that indicates whether styles 42428 * of destroyed components should be removed from DOM. 42429 * 42430 * By default, the value is set to `true`. 42431 * @publicApi 42432 */ 42433const REMOVE_STYLES_ON_COMPONENT_DESTROY = /*#__PURE__*/new _angular_core__WEBPACK_IMPORTED_MODULE_2__.InjectionToken(ngDevMode ? 'RemoveStylesOnCompDestroy' : '', { 42434 providedIn: 'root', 42435 factory: () => REMOVE_STYLES_ON_COMPONENT_DESTROY_DEFAULT 42436}); 42437function shimContentAttribute(componentShortId) { 42438 return CONTENT_ATTR.replace(COMPONENT_REGEX, componentShortId); 42439} 42440function shimHostAttribute(componentShortId) { 42441 return HOST_ATTR.replace(COMPONENT_REGEX, componentShortId); 42442} 42443function shimStylesContent(compId, styles) { 42444 return styles.map(s => s.replace(COMPONENT_REGEX, compId)); 42445} 42446/** 42447 * Prepends a baseHref to the `sourceMappingURL` within the provided CSS content. 42448 * If the `sourceMappingURL` contains an inline (encoded) map, the function skips processing. 42449 * 42450 * @note For inline stylesheets, the `sourceMappingURL` is relative to the page's origin 42451 * and not the provided baseHref. This function is needed as when accessing the page with a URL 42452 * containing two or more segments. 42453 * For example, if the baseHref is set to `/`, and you visit a URL like `http://localhost/foo/bar`, 42454 * the map would be requested from `http://localhost/foo/bar/comp.css.map` instead of what you'd expect, 42455 * which is `http://localhost/comp.css.map`. This behavior is corrected by modifying the `sourceMappingURL` 42456 * to ensure external source maps are loaded relative to the baseHref. 42457 * 42458 42459 * @param baseHref - The base URL to prepend to the `sourceMappingURL`. 42460 * @param styles - An array of CSS content strings, each potentially containing a `sourceMappingURL`. 42461 * @returns The updated array of CSS content strings with modified `sourceMappingURL` values, 42462 * or the original content if no modification is needed. 42463 */ 42464function addBaseHrefToCssSourceMap(baseHref, styles) { 42465 if (!baseHref) { 42466 return styles; 42467 } 42468 const absoluteBaseHrefUrl = new URL(baseHref, 'http://localhost'); 42469 return styles.map(cssContent => { 42470 if (!cssContent.includes('sourceMappingURL=')) { 42471 return cssContent; 42472 } 42473 return cssContent.replace(SOURCEMAP_URL_REGEXP, (_, sourceMapUrl) => { 42474 if (sourceMapUrl[0] === '/' || sourceMapUrl.startsWith('data:') || PROTOCOL_REGEXP.test(sourceMapUrl)) { 42475 return `/*# sourceMappingURL=${sourceMapUrl} */`; 42476 } 42477 const { 42478 pathname: resolvedSourceMapUrl 42479 } = new URL(sourceMapUrl, absoluteBaseHrefUrl); 42480 return `/*# sourceMappingURL=${resolvedSourceMapUrl} */`; 42481 }); 42482 }); 42483} 42484let DomRendererFactory2 = /*#__PURE__*/(() => { 42485 var _DomRendererFactory; 42486 class DomRendererFactory2 { 42487 constructor(eventManager, sharedStylesHost, appId, removeStylesOnCompDestroy, doc, platformId, ngZone, nonce = null, tracingService = null) { 42488 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "eventManager", void 0); 42489 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "sharedStylesHost", void 0); 42490 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "appId", void 0); 42491 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "removeStylesOnCompDestroy", void 0); 42492 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "doc", void 0); 42493 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "platformId", void 0); 42494 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "ngZone", void 0); 42495 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "nonce", void 0); 42496 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "tracingService", void 0); 42497 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "rendererByCompId", new Map()); 42498 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "defaultRenderer", void 0); 42499 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "platformIsServer", void 0); 42500 this.eventManager = eventManager; 42501 this.sharedStylesHost = sharedStylesHost; 42502 this.appId = appId; 42503 this.removeStylesOnCompDestroy = removeStylesOnCompDestroy; 42504 this.doc = doc; 42505 this.platformId = platformId; 42506 this.ngZone = ngZone; 42507 this.nonce = nonce; 42508 this.tracingService = tracingService; 42509 this.platformIsServer = (0,_angular_common__WEBPACK_IMPORTED_MODULE_3__.isPlatformServer)(platformId); 42510 this.defaultRenderer = new DefaultDomRenderer2(eventManager, doc, ngZone, this.platformIsServer, this.tracingService); 42511 } 42512 createRenderer(element, type) { 42513 if (!element || !type) { 42514 return this.defaultRenderer; 42515 } 42516 if (this.platformIsServer && type.encapsulation === _angular_core__WEBPACK_IMPORTED_MODULE_2__.ViewEncapsulation.ShadowDom) { 42517 // Domino does not support shadow DOM. 42518 type = (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])((0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_0__["default"])({}, type), {}, { 42519 encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_2__.ViewEncapsulation.Emulated 42520 }); 42521 } 42522 const renderer = this.getOrCreateRenderer(element, type); 42523 // Renderers have different logic due to different encapsulation behaviours. 42524 // Ex: for emulated, an attribute is added to the element. 42525 if (renderer instanceof EmulatedEncapsulationDomRenderer2) { 42526 renderer.applyToHost(element); 42527 } else if (renderer instanceof NoneEncapsulationDomRenderer) { 42528 renderer.applyStyles(); 42529 } 42530 return renderer; 42531 } 42532 getOrCreateRenderer(element, type) { 42533 const rendererByCompId = this.rendererByCompId; 42534 let renderer = rendererByCompId.get(type.id); 42535 if (!renderer) { 42536 const doc = this.doc; 42537 const ngZone = this.ngZone; 42538 const eventManager = this.eventManager; 42539 const sharedStylesHost = this.sharedStylesHost; 42540 const removeStylesOnCompDestroy = this.removeStylesOnCompDestroy; 42541 const platformIsServer = this.platformIsServer; 42542 const tracingService = this.tracingService; 42543 switch (type.encapsulation) { 42544 case _angular_core__WEBPACK_IMPORTED_MODULE_2__.ViewEncapsulation.Emulated: 42545 renderer = new EmulatedEncapsulationDomRenderer2(eventManager, sharedStylesHost, type, this.appId, removeStylesOnCompDestroy, doc, ngZone, platformIsServer, tracingService); 42546 break; 42547 case _angular_core__WEBPACK_IMPORTED_MODULE_2__.ViewEncapsulation.ShadowDom: 42548 return new ShadowDomRenderer(eventManager, sharedStylesHost, element, type, doc, ngZone, this.nonce, platformIsServer, tracingService); 42549 default: 42550 renderer = new NoneEncapsulationDomRenderer(eventManager, sharedStylesHost, type, removeStylesOnCompDestroy, doc, ngZone, platformIsServer, tracingService); 42551 break; 42552 } 42553 rendererByCompId.set(type.id, renderer); 42554 } 42555 return renderer; 42556 } 42557 ngOnDestroy() { 42558 this.rendererByCompId.clear(); 42559 } 42560 /** 42561 * Used during HMR to clear any cached data about a component. 42562 * @param componentId ID of the component that is being replaced. 42563 */ 42564 componentReplaced(componentId) { 42565 this.rendererByCompId.delete(componentId); 42566 } 42567 } 42568 _DomRendererFactory = DomRendererFactory2; 42569 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(DomRendererFactory2, "\u0275fac", function _DomRendererFactory_Factory(__ngFactoryType__) { 42570 return new (__ngFactoryType__ || _DomRendererFactory)(_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵinject"](EventManager), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵinject"](SharedStylesHost), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_2__.APP_ID), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵinject"](REMOVE_STYLES_ON_COMPONENT_DESTROY), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵinject"](_angular_common__WEBPACK_IMPORTED_MODULE_4__.DOCUMENT), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_2__.PLATFORM_ID), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_2__.NgZone), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_2__.CSP_NONCE), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵTracingService"], 8)); 42571 }); 42572 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(DomRendererFactory2, "\u0275prov", /* @__P
42572URE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineInjectable"]({ 42573 token: _DomRendererFactory, 42574 factory: _DomRendererFactory.ɵfac 42575 })); 42576 return DomRendererFactory2; 42577})(); 42578/*#__PURE__*/(() => { 42579 (typeof ngDevMode === "undefined" || ngDevMode) && void 0; 42580})(); 42581class DefaultDomRenderer2 { 42582 constructor(eventManager, doc, ngZone, platformIsServer, tracingService) { 42583 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "eventManager", void 0); 42584 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "doc", void 0); 42585 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "ngZone", void 0); 42586 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "platformIsServer", void 0); 42587 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "tracingService", void 0); 42588 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "data", Object.create(null)); 42589 /** 42590 * By default this renderer throws when encountering synthetic properties 42591 * This can be disabled for example by the AsyncAnimationRendererFactory 42592 */ 42593 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "throwOnSyntheticProps", true); 42594 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "destroyNode", null); 42595 this.eventManager = eventManager; 42596 this.doc = doc; 42597 this.ngZone = ngZone; 42598 this.platformIsServer = platformIsServer; 42599 this.tracingService = tracingService; 42600 } 42601 destroy() {} 42602 createElement(name, namespace) { 42603 if (namespace) { 42604 // TODO: `|| namespace` was added in 42605 // https://github.com/angular/angular/commit/2b9cc8503d48173492c29f5a271b61126104fbdb to 42606 // support how Ivy passed around the namespace URI rather than short name at the time. It did 42607 // not, however extend the support to other parts of the system (setAttribute, setAttribute, 42608 // and the ServerRenderer). We should decide what exactly the semantics for dealing with 42609 // namespaces should be and make it consistent. 42610 // Related issues: 42611 // https://github.com/angular/angular/issues/44028 42612 // https://github.com/angular/angular/issues/44883 42613 return this.doc.createElementNS(NAMESPACE_URIS[namespace] || namespace, name); 42614 } 42615 return this.doc.createElement(name); 42616 } 42617 createComment(value) { 42618 return this.doc.createComment(value); 42619 } 42620 createText(value) { 42621 return this.doc.createTextNode(value); 42622 } 42623 appendChild(parent, newChild) { 42624 const targetParent = isTemplateNode(parent) ? parent.content : parent; 42625 targetParent.appendChild(newChild); 42626 } 42627 insertBefore(parent, newChild, refChild) { 42628 if (parent) { 42629 const targetParent = isTemplateNode(parent) ? parent.content : parent; 42630 targetParent.insertBefore(newChild, refChild); 42631 } 42632 } 42633 removeChild(_parent, oldChild) { 42634 oldChild.remove(); 42635 } 42636 selectRootElement(selectorOrNode, preserveContent) { 42637 let el = typeof selectorOrNode === 'string' ? this.doc.querySelector(selectorOrNode) : selectorOrNode; 42638 if (!el) { 42639 throw new _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵRuntimeError"](-5104 /* RuntimeErrorCode.ROOT_NODE_NOT_FOUND */, (typeof ngDevMode === 'undefined' || ngDevMode) && `The selector "${selectorOrNode}" did not match any elements`); 42640 } 42641 if (!preserveContent) { 42642 el.textContent = ''; 42643 } 42644 return el; 42645 } 42646 parentNode(node) { 42647 return node.parentNode; 42648 } 42649 nextSibling(node) { 42650 return node.nextSibling; 42651 } 42652 setAttribute(el, name, value, namespace) { 42653 if (namespace) { 42654 name = namespace + ':' + name;
42655 const namespaceUri = NAMESPACE_URIS[namespace]; 42656 if (namespaceUri) { 42657 el.setAttributeNS(namespaceUri, name, value); 42658 } else { 42659 el.setAttribute(name, value); 42660 } 42661 } else { 42662 el.setAttribute(name, value); 42663 } 42664 } 42665 removeAttribute(el, name, namespace) { 42666 if (namespace) { 42667 const namespaceUri = NAMESPACE_URIS[namespace]; 42668 if (namespaceUri) { 42669 el.removeAttributeNS(namespaceUri, name); 42670 } else { 42671 el.removeAttribute(`${namespace}:${name}`); 42672 } 42673 } else { 42674 el.removeAttribute(name); 42675 } 42676 } 42677 addClass(el, name) { 42678 el.classList.add(name); 42679 } 42680 removeClass(el, name) { 42681 el.classList.remove(name); 42682 } 42683 setStyle(el, style, value, flags) { 42684 if (flags & (_angular_core__WEBPACK_IMPORTED_MODULE_2__.RendererStyleFlags2.DashCase | _angular_core__WEBPACK_IMPORTED_MODULE_2__.RendererStyleFlags2.Important)) { 42685 el.style.setProperty(style, value, flags & _angular_core__WEBPACK_IMPORTED_MODULE_2__.RendererStyleFlags2.Important ? 'important' : ''); 42686 } else { 42687 el.style[style] = value; 42688 } 42689 } 42690 removeStyle(el, style, flags) { 42691 if (flags & _angular_core__WEBPACK_IMPORTED_MODULE_2__.RendererStyleFlags2.DashCase) { 42692 // removeProperty has no effect when used on camelCased properties. 42693 el.style.removeProperty(style); 42694 } else { 42695 el.style[style] = ''; 42696 } 42697 } 42698 setProperty(el, name, value) { 42699 if (el == null) { 42700 return; 42701 } 42702 (typeof ngDevMode === 'undefined' || ngDevMode) && this.throwOnSyntheticProps && checkNoSyntheticProp(name, 'property'); 42703 el[name] = value; 42704 } 42705 setValue(node, value) { 42706 node.nodeValue = value; 42707 } 42708 listen(target, event, callback, options) { 42709 var _this$tracingService; 42710 (typeof ngDevMode === 'undefined' || ngDevMode) && this.throwOnSyntheticProps && checkNoSyntheticProp(event, 'listener'); 42711 if (typeof target === 'string') { 42712 target = (0,_angular_common__WEBPACK_IMPORTED_MODULE_5__.getDOM)().getGlobalEventTarget(this.doc, target); 42713 if (!target) { 42714 throw new _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵRuntimeError"](5102 /* RuntimeErrorCode.UNSUPPORTED_EVENT_TARGET */, (typeof ngDevMode === 'undefined' || ngDevMode) && `Unsupported event target ${target} for event ${event}`); 42715 } 42716 } 42717 let wrappedCallback = this.decoratePreventDefault(callback); 42718 if ((_this$tracingService = this.tracingService) !== null && _this$tracingService !== void 0 && _this$tracingService.wrapEventListener) { 42719 wrappedCallback = this.tracingService.wrapEventListener(target, event, wrappedCallback); 42720 } 42721 return this.eventManager.addEventListener(target, event, wrappedCallback, options); 42722 } 42723 decoratePreventDefault(eventHandler) { 42724 // `DebugNode.triggerEventHandler` needs to know if the listener was created with 42725 // decoratePreventDefault or is a listener added outside the Angular context so it can handle 42726 // the two differently. In the first case, the special '__ngUnwrap__' token is passed to the 42727 // unwrap the listener (see below). 42728 return event => { 42729 // Ivy uses '__ngUnwrap__' as a special token that allows us to unwrap the function 42730 // so that it can be invoked programmatically by `DebugNode.triggerEventHandler`. The 42731 // debug_node can inspect the listener toString contents for the existence of this special 42732 // token. Because the token is a string literal, it is ensured to not be modified by compiled 42733 // code. 42734 if (event === '__ngUnwrap__') { 42735 return eventHandler; 42736 } 42737 // Run the event handler inside the ngZone because event handlers are not patched 42738 // by Zone on the server. This is required only for tests. 42739 const allowDefaultBehavior = this.platformIsServer ? this.ngZone.runGuarded(() => eventHandler(event)) : eventHandler(event); 42740 if (allowDefaultBehavior === false) { 42741 event.preventDefault(); 42742 } 42743 return undefined; 42744 }; 42745 } 42746} 42747const AT_CHARCODE = /*#__PURE__*/(() => '@'.charCodeAt(0))(); 42748function checkNoSyntheticProp(name, nameKind) { 42749 if (name.charCodeAt(0) === AT_CHARCODE) { 42750 throw new _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵRuntimeError"](5105 /* RuntimeErrorCode.UNEXPECTED_SYNTHETIC_PROPERTY */, `Unexpected synthetic ${nameKind} ${name} found. Please make sure that: 42751 - Make sure \`provideAnimationsAsync()\`, \`provideAnimations()\` or \`provideNoopAnimations()\` call was added to a list of providers used to bootstrap an application. 42752 - There is a corresponding animation configuration named \`${name}\` defined in the \`animations\` field of the \`@Component\` decorator (see https://angular.dev/api/core/Component#animations).`); 42753 } 42754} 42755function isTemplateNode(node) { 42756 return node.tagName === 'TEMPLATE' && node.content !== undefined; 42757} 42758class ShadowDomRenderer extends DefaultDomRenderer2 {
42759 constructor(eventManager, sharedStylesHost, hostEl, component, doc, ngZone, nonce, platformIsServer, tracingService) { 42760 var _component$getExterna; 42761 super(eventManager, doc, ngZone, platformIsServer, tracingService); 42762 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "sharedStylesHost", void 0); 42763 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "hostEl", void 0); 42764 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "shadowRoot", void 0); 42765 this.sharedStylesHost = sharedStylesHost; 42766 this.hostEl = hostEl; 42767 this.shadowRoot = hostEl.attachShadow({ 42768 mode: 'open' 42769 }); 42770 this.sharedStylesHost.addHost(this.shadowRoot); 42771 let styles = component.styles; 42772 if (ngDevMode) { 42773 var _getDOM$getBaseHref; 42774 // We only do this in development, as for production users should not add CSS sourcemaps to components. 42775 const baseHref = (_getDOM$getBaseHref = (0,_angular_common__WEBPACK_IMPORTED_MODULE_5__.getDOM)().getBaseHref(doc)) !== null && _getDOM$getBaseHref !== void 0 ? _getDOM$getBaseHref : ''; 42776 styles = addBaseHrefToCssSourceMap(baseHref, styles); 42777 } 42778 styles = shimStylesContent(component.id, styles); 42779 for (const style of styles) { 42780 const styleEl = document.createElement('style'); 42781 if (nonce) { 42782 styleEl.setAttribute('nonce', nonce); 42783 } 42784 styleEl.textContent = style; 42785 this.shadowRoot.appendChild(styleEl); 42786 } 42787 // Apply any external component styles to the shadow root for the component's element. 42788 // The ShadowDOM renderer uses an alternative execution path for component styles that 42789 // does not use the SharedStylesHost that other encapsulation modes leverage. Much like 42790 // the manual addition of embedded styles directly above, any external stylesheets 42791 // must be manually added here to ensure ShadowDOM components are correctly styled. 42792 // TODO: Consider reworking the DOM Renderers to consolidate style handling. 42793 const styleUrls = (_component$getExterna = component.getExternalStyles) === null || _component$getExterna === void 0 ? void 0 : _component$getExterna.call(component); 42794 if (styleUrls) { 42795 for (const styleUrl of styleUrls) { 42796 const linkEl = createLinkElement(styleUrl, doc); 42797 if (nonce) { 42798 linkEl.setAttribute('nonce', nonce); 42799 } 42800 this.shadowRoot.appendChild(linkEl); 42801 } 42802 } 42803 } 42804 nodeOrShadowRoot(node) { 42805 return node === this.hostEl ? this.shadowRoot : node; 42806 } 42807 appendChild(parent, newChild) { 42808 return super.appendChild(this.nodeOrShadowRoot(parent), newChild); 42809 } 42810 insertBefore(parent, newChild, refChild) { 42811 return super.insertBefore(this.nodeOrShadowRoot(parent), newChild, refChild); 42812 } 42813 removeChild(_parent, oldChild) { 42814 return super.removeChild(null, oldChild); 42815 } 42816 parentNode(node) { 42817 return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(node))); 42818 } 42819 destroy() { 42820 this.sharedStylesHost.removeHost(this.shadowRoot); 42821 } 42822} 42823class NoneEncapsulationDomRenderer extends DefaultDomRenderer2 { 42824 constructor(eventManager, sharedStylesHost, component, removeStylesOnCompDestroy, doc, ngZone, platformIsServer, tracingService, compId) { 42825 var _component$getExterna2; 42826 super(eventManager, doc, ngZone, platformIsServer, tracingService); 42827 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "sharedStylesHost", void 0); 42828 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "removeStylesOnCompDestroy", void 0); 42829 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "styles", void 0); 42830 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "styleUrls", void 0); 42831 this.sharedStylesHost = sharedStylesHost; 42832 this.removeStylesOnCompDestroy = removeStylesOnCompDestroy; 42833 let styles = component.styles; 42834 if (ngDevMode) { 42835 var _getDOM$getBaseHref2; 42836 // We only do this in development, as for production users should not add CSS sourcemaps to components. 42837 const baseHref = (_getDOM$getBaseHref2 = (0,_angular_common__WEBPACK_IMPORTED_MODULE_5__.getDOM)().getBaseHref(doc)) !== null && _getDOM$getBaseHref2 !== void 0 ? _getDOM$getBaseHref2 : ''; 42838 styles = addBaseHrefToCssSourceMap(baseHref, styles); 42839 } 42840 this.styles = compId ? shimStylesContent(compId, styles) : styles; 42841 this.styleUrls = (_component$getExterna2 = component.getExternalStyles) === null || _component$getExterna2 === void 0 ? void 0 : _component$getExterna2.call(component, compId); 42842 } 42843 applyStyles() { 42844 this.sharedStylesHost.addStyles(this.styles, this.styleUrls); 42845 } 42846 destroy() { 42847 if (!this.removeStylesOnCompDestroy) { 42848 return; 42849 } 42850 this.sharedStylesHost.removeStyles(this.styles, this.styleUrls); 42851 } 42852}
42853class EmulatedEncapsulationDomRenderer2 extends NoneEncapsulationDomRenderer { 42854 constructor(eventManager, sharedStylesHost, component, appId, removeStylesOnCompDestroy, doc, ngZone, platformIsServer, tracingService) { 42855 const compId = appId + '-' + component.id; 42856 super(eventManager, sharedStylesHost, component, removeStylesOnCompDestroy, doc, ngZone, platformIsServer, tracingService, compId); 42857 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "contentAttr", void 0); 42858 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_1__["default"])(this, "hostAttr", void 0); 42859 this.contentAttr = shimContentAttribute(compId); 42860 this.hostAttr = shimHostAttribute(compId); 42861 } 42862 applyToHost(element) { 42863 this.applyStyles(); 42864 this.setAttribute(element, this.hostAttr, ''); 42865 } 42866 createElement(parent, name) { 42867 const el = super.createElement(parent, name); 42868 super.setAttribute(el, this.contentAttr, ''); 42869 return el; 42870 } 42871} 42872 42873//# sourceMappingURL=dom_renderer-DGKzginR.mjs.map 42874 42875/***/ }), 42876 42877/***/ 65478: 42878/*!**********************************************************!*\ 42879 !*** ./node_modules/@angular/cdk/fesm2022/scrolling.mjs ***! 42880 \**********************************************************/ 42881/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { 42882 42883__webpack_require__.r(__webpack_exports__); 42884/* harmony export */ __webpack_require__.d(__webpack_exports__, { 42885/* harmony export */ CdkFixedSizeVirtualScroll: () => (/* binding */ CdkFixedSizeVirtualScroll), 42886/* harmony export */ CdkScrollable: () => (/* binding */ CdkScrollable), 42887/* harmony export */ CdkScrollableModule: () => (/* binding */ CdkScrollableModule), 42888/* harmony export */ CdkVirtualForOf: () => (/* binding */ CdkVirtualForOf), 42889/* harmony export */ CdkVirtualScrollViewport: () => (/* binding */ CdkVirtualScrollViewport), 42890/* harmony export */ CdkVirtualScrollable: () => (/* binding */ CdkVirtualScrollable), 42891/* harmony export */ CdkVirtualScrollableElement: () => (/* binding */ CdkVirtualScrollableElement), 42892/* harmony export */ CdkVirtualScrollableWindow: () => (/* binding */ CdkVirtualScrollableWindow), 42893/* harmony export */ DEFAULT_RESIZE_TIME: () => (/* binding */ DEFAULT_RESIZE_TIME), 42894/* harmony export */ DEFAULT_SCROLL_TIME: () => (/* binding */ DEFAULT_SCROLL_TIME), 42895/* harmony export */ FixedSizeVirtualScrollStrategy: () => (/* binding */ FixedSizeVirtualScrollStrategy), 42896/* harmony export */ ScrollDispatcher: () => (/* binding */ ScrollDispatcher), 42897/* harmony export */ ScrollingModule: () => (/* binding */ ScrollingModule), 42898/* harmony export */ VIRTUAL_SCROLLABLE: () => (/* binding */ VIRTUAL_SCROLLABLE), 42899/* harmony export */ VIRTUAL_SCROLL_STRATEGY: () => (/* binding */ VIRTUAL_SCROLL_STRATEGY), 42900/* harmony export */ ViewportRuler: () => (/* binding */ ViewportRuler), 42901/* harmony export */ _fixedSizeVirtualScrollStrategyFactory: () => (/* binding */ _fixedSizeVirtualScrollStrategyFactory), 42902/* harmony export */ "ɵɵDir": () => (/* reexport safe */ _bidi_mjs__WEBPACK_IMPORTED_MODULE_1__.Dir) 42903/* harmony export */ }); 42904/* harmony import */ var C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/defineProperty.js */ 64467); 42905/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/core */ 17705); 42906/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rxjs */ 45286); 42907/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! rxjs */ 14421); 42908/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! rxjs */ 27389); 42909/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! rxjs */ 52949); 42910/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! rxjs */ 13967); 42911/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! rxjs */ 31805); 42912/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! rxjs */ 8982); 42913/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! rxjs/operators */ 20522); 42914/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! rxjs/operators */ 18542); 42915/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! rxjs/operators */ 58728); 42916/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! rxjs/operators */ 23176); 42917/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! rxjs/operators */ 7605); 42918/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! rxjs/operators */ 7414); 42919/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! rxjs/operators */ 49090); 42920/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! rxjs/operators */ 68712); 42921/* harmony import */ var _element_x4z00URv_mjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./element-x4z00URv.mjs */ 79355); 42922/* harmony import */ var _platform_DmdVEw_C_mjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./platform-DmdVEw_C.mjs */ 99536); 42923/* harmony import */ var _directionality_CBXD4hga_mjs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./directionality-CBXD4hga.mjs */ 11845); 42924/* harmony import */ var _scrolling_BkvA05C8_mjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./scrolling-BkvA05C8.mjs */ 89273); 42925/* harmony import */ var _bidi_mjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./bidi.mjs */ 28203); 42926/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @angular/common */ 59361); 42927/* harmony import */ var _recycle_view_repeater_strategy_DoWdPqVw_mjs__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./recycle-view-repeater-strategy-DoWdPqVw.mjs */ 34726); 42928/* harmony import */ var _data_source_D34wiQZj_mjs__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./data-source-D34wiQZj.mjs */ 82448); 42929 42930 42931 42932 42933 42934 42935 42936 42937 42938 42939const _c0 = ["contentWrapper"]; 42940const _c1 = ["*"]; 42941 42942 42943 42944 42945 42946/** The injection token used to specify the virtual scrolling strategy. */ 42947const VIRTUAL_SCROLL_STRATEGY = /*#__PURE__*/new _angular_core__WEBPACK_IMPORTED_MODULE_2__.InjectionToken('VIRTUAL_SCROLL_STRATEGY'); 42948 42949/** Virtual scrolling strategy for lists with items of known fixed size. */ 42950class FixedSizeVirtualScrollStrategy { 42951 /** 42952 * @param itemSize The size of the items in the virtually scrolling list. 42953 * @param minBufferPx The minimum amount of buffer (in pixels) before needing to render more 42954 * @param maxBufferPx The amount of buffer (in pixels) to render when rendering more. 42955 */ 42956 constructor(itemSize, minBufferPx, maxBufferPx) { 42957 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_scrolledIndexChange", new rxjs__WEBPACK_IMPORTED_MODULE_3__.Subject()); 42958 /** @docs-private Implemented as part of VirtualScrollStrategy. */ 42959 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "scrolledIndexChange", this._scrolledIndexChange.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_4__.distinctUntilChanged)())); 42960 /** The attached viewport. */ 42961 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_viewport", null); 42962 /** The size of the items in the virtually scrolling list. */ 42963 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_itemSize", void 0); 42964 /** The minimum amount of buffer rendered beyond the viewport (in pixels). */ 42965 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_minBufferPx", void 0); 42966 /** The number of buffer items to render beyond the edge of the viewport (in pixels). */ 42967 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_maxBufferPx", void 0); 42968 this._itemSize = itemSize; 42969 this._minBufferPx = minBufferPx; 42970 this._maxBufferPx = maxBufferPx; 42971 } 42972 /**
42973 * Attaches this scroll strategy to a viewport. 42974 * @param viewport The viewport to attach this strategy to. 42975 */ 42976 attach(viewport) { 42977 this._viewport = viewport; 42978 this._updateTotalContentSize(); 42979 this._updateRenderedRange(); 42980 } 42981 /** Detaches this scroll strategy from the currently attached viewport. */ 42982 detach() { 42983 this._scrolledIndexChange.complete(); 42984 this._viewport = null; 42985 } 42986 /** 42987 * Update the item size and buffer size. 42988 * @param itemSize The size of the items in the virtually scrolling list. 42989 * @param minBufferPx The minimum amount of buffer (in pixels) before needing to render more 42990 * @param maxBufferPx The amount of buffer (in pixels) to render when rendering more. 42991 */ 42992 updateItemAndBufferSize(itemSize, minBufferPx, maxBufferPx) { 42993 if (maxBufferPx < minBufferPx && (typeof ngDevMode === 'undefined' || ngDevMode)) { 42994 throw Error('CDK virtual scroll: maxBufferPx must be greater than or equal to minBufferPx'); 42995 } 42996 this._itemSize = itemSize; 42997 this._minBufferPx = minBufferPx; 42998 this._maxBufferPx = maxBufferPx; 42999 this._updateTotalContentSize(); 43000 this._updateRenderedRange(); 43001 } 43002 /** @docs-private Implemented as part of VirtualScrollStrategy. */ 43003 onContentScrolled() { 43004 this._updateRenderedRange(); 43005 } 43006 /** @docs-private Implemented as part of VirtualScrollStrategy. */ 43007 onDataLengthChanged() { 43008 this._updateTotalContentSize(); 43009 this._updateRenderedRange(); 43010 } 43011 /** @docs-private Implemented as part of VirtualScrollStrategy. */ 43012 onContentRendered() { 43013 /* no-op */ 43014 } 43015 /** @docs-private Implemented as part of VirtualScrollStrategy. */ 43016 onRenderedOffsetChanged() { 43017 /* no-op */ 43018 } 43019 /** 43020 * Scroll to the offset for the given index. 43021 * @param index The index of the element to scroll to. 43022 * @param behavior The ScrollBehavior to use when scrolling. 43023 */ 43024 scrollToIndex(index, behavior) { 43025 if (this._viewport) { 43026 this._viewport.scrollToOffset(index * this._itemSize, behavior); 43027 } 43028 } 43029 /** Update the viewport's total content size. */ 43030 _updateTotalContentSize() { 43031 if (!this._viewport) { 43032 return; 43033 } 43034 this._viewport.setTotalContentSize(this._viewport.getDataLength() * this._itemSize); 43035 } 43036 /** Update the viewport's rendered range. */ 43037 _updateRenderedRange() { 43038 if (!this._viewport) { 43039 return; 43040 } 43041 const renderedRange = this._viewport.getRenderedRange(); 43042 const newRange = { 43043 start: renderedRange.start, 43044 end: renderedRange.end 43045 }; 43046 const viewportSize = this._viewport.getViewportSize(); 43047 const dataLength = this._viewport.getDataLength(); 43048 let scrollOffset = this._viewport.measureScrollOffset(); 43049 // Prevent NaN as result when dividing by zero. 43050 let firstVisibleIndex = this._itemSize > 0 ? scrollOffset / this._itemSize : 0; 43051 // If user scrolls to the bottom of the list and data changes to a smaller list 43052 if (newRange.end > dataLength) { 43053 // We have to recalculate the first visible index based on new data length and viewport size. 43054 const maxVisibleItems = Math.ceil(viewportSize / this._itemSize); 43055 const newVisibleIndex = Math.max(0, Math.min(firstVisibleIndex, dataLength - maxVisibleItems)); 43056 // If first visible index changed we must update scroll offset to handle start/end buffers 43057 // Current range must also be adjusted to cover the new position (bottom of new list). 43058 if (firstVisibleIndex != newVisibleIndex) { 43059 firstVisibleIndex = newVisibleIndex; 43060 scrollOffset = newVisibleIndex * this._itemSize; 43061 newRange.start = Math.floor(firstVisibleIndex); 43062 } 43063 newRange.end = Math.max(0, Math.min(dataLength, newRange.start + maxVisibleItems)); 43064 } 43065 const startBuffer = scrollOffset - newRange.start * this._itemSize; 43066 if (startBuffer < this._minBufferPx && newRange.start != 0) { 43067 const expandStart = Math.ceil((this._maxBufferPx - startBuffer) / this._itemSize); 43068 newRange.start = Math.max(0, newRange.start - expandStart); 43069 newRange.end = Math.min(dataLength, Math.ceil(firstVisibleIndex + (viewportSize + this._minBufferPx) / this._itemSize)); 43070 } else { 43071 const endBuffer = newRange.end * this._itemSize - (scrollOffset + viewportSize); 43072 if (endBuffer < this._minBufferPx && newRange.end != dataLength) { 43073 const expandEnd = Math.ceil((this._maxBufferPx - endBuffer) / this._itemSize); 43074 if (expandEnd > 0) { 43075 newRange.end = Math.min(dataLength, newRange.end + expandEnd); 43076 newRange.start = Math.max(0, Math.floor(firstVisibleIndex - this._minBufferPx / this._itemSize)); 43077 } 43078 } 43079 } 43080 this._viewport.setRenderedRange(newRange); 43081 this._viewport.setRenderedContentOffset(this._itemSize * newRange.start); 43082 this._scrolledIndexChange.next(Math.floor(firstVisibleIndex)); 43083 } 43084} 43085/** 43086 * Provider factory for `FixedSizeVirtualScrollStrategy` that simply extracts the already created 43087 * `FixedSizeVirtualScrollStrategy` from the given directive. 43088 * @param fixedSizeDir The instance of `CdkFixedSizeVirtualScroll` to extract the 43089 * `FixedSizeVirtualScrollStrategy` from. 43090 */ 43091function _fixedSizeVirtualScrollStrategyFactory(fixedSizeDir) { 43092 return fixedSizeDir._scrollStrategy; 43093} 43094/** A virtual scroll strategy that supports fixed-size items. */ 43095let CdkFixedSizeVirtualScroll = /*#__PURE__*/(() => { 43096 var _CdkFixedSizeVirtualScroll; 43097 class CdkFixedSizeVirtualScroll { 43098 constructor() { 43099 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_itemSize", 20); 43100 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_minBufferPx", 100); 43101 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_maxBufferPx", 200); 43102 /** The scroll strategy used by this directive. */ 43103 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_scrollStrategy", new FixedSizeVirtualScrollStrategy(this.itemSize, this.minBufferPx, this.maxBufferPx)); 43104 } 43105 /** The size of the items in the list (in pixels). */ 43106 get itemSize() { 43107 return this._itemSize; 43108 } 43109 set itemSize(value) { 43110 this._itemSize = (0,_element_x4z00URv_mjs__WEBPACK_IMPORTED_MODULE_5__.c)(value); 43111 } 43112 /** 43113 * The minimum amount of buffer rendered beyond the viewport (in pixels). 43114 * If the amount of buffer dips below this number, more items will be rendered. Defaults to 100px. 43115 */ 43116 get minBufferPx() { 43117 return this._minBufferPx; 43118 } 43119 set minBufferPx(value) { 43120 this._minBufferPx = (0,_element_x4z00URv_mjs__WEBPACK_IMPORTED_MODULE_5__.c)(value); 43121 } 43122 /** 43123 * The number of pixels worth of buffer to render for when rendering new items. Defaults to 200px. 43124 */ 43125 get maxBufferPx() { 43126 return this._maxBufferPx; 43127 } 43128 set maxBufferPx(value) { 43129 this._maxBufferPx = (0,_element_x4z00URv_mjs__WEBPACK_IMPORTED_MODULE_5__.c)(value); 43130 } 43131 ngOnChanges() { 43132 this._scrollStrategy.updateItemAndBufferSize(this.itemSize, this.minBufferPx, this.maxBufferPx); 43133 } 43134 } 43135 _CdkFixedSizeVirtualScroll = CdkFixedSizeVirtualScroll; 43136 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(CdkFixedSizeVirtualScroll, "\u0275fac", function _CdkFixedSizeVirtualScroll_Factory(__ngFactoryType__) { 43137 return new (__ngFactoryType__ || _CdkFixedSizeVirtualScroll)(); 43138 }); 43139 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(CdkFixedSizeVirtualScroll, "\u0275dir", /* @__P
43139URE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineDirective"]({ 43140 type: _CdkFixedSizeVirtualScroll, 43141 selectors: [["cdk-virtual-scroll-viewport", "itemSize", ""]], 43142 inputs: { 43143 itemSize: "itemSize", 43144 minBufferPx: "minBufferPx", 43145 maxBufferPx: "maxBufferPx" 43146 }, 43147 features: [_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵProvidersFeature"]([{ 43148 provide: VIRTUAL_SCROLL_STRATEGY, 43149 useFactory: _fixedSizeVirtualScrollStrategyFactory, 43150 deps: [(0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.forwardRef)(() => _CdkFixedSizeVirtualScroll)] 43151 }]), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵNgOnChangesFeature"]] 43152 })); 43153 return CdkFixedSizeVirtualScroll; 43154})(); 43155/*#__PURE__*/(() => { 43156 (typeof ngDevMode === "undefined" || ngDevMode) && void 0; 43157})(); 43158 43159/** Time in ms to throttle the scrolling events by default. */ 43160const DEFAULT_SCROLL_TIME = 20; 43161/** 43162 * Service contained all registered Scrollable references and emits an event when any one of the 43163 * Scrollable references emit a scrolled event. 43164 */ 43165let ScrollDispatcher = /*#__PURE__*/(() => { 43166 var _ScrollDispatcher; 43167 class ScrollDispatcher { 43168 constructor() { 43169 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_ngZone", (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_2__.NgZone)); 43170 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_platform", (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(_platform_DmdVEw_C_mjs__WEBPACK_IMPORTED_MODULE_6__.P)); 43171 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_renderer", (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_2__.RendererFactory2).createRenderer(null, null)); 43172 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_cleanupGlobalListener", void 0); 43173 /** Subject for notifying that a registered scrollable reference element has been scrolled. */ 43174 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_scrolled", new rxjs__WEBPACK_IMPORTED_MODULE_3__.Subject()); 43175 /** Keeps track of the amount of subscriptions to `scrolled`. Used for cleaning up afterwards. */ 43176 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_scrolledCount", 0); 43177 /** 43178 * Map of all the scrollable references that are registered with the service and their 43179 * scroll event subscriptions. 43180 */ 43181 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "scrollContainers", new Map()); 43182 } 43183 /** 43184 * Registers a scrollable instance with the service and listens for its scrolled events. When the 43185 * scrollable is scrolled, the service emits the event to its scrolled observable. 43186 * @param scrollable Scrollable instance to be registered. 43187 */ 43188 register(scrollable) { 43189 if (!this.scrollContainers.has(scrollable)) { 43190 this.scrollContainers.set(scrollable, scrollable.elementScrolled().subscribe(() => this._scrolled.next(scrollable))); 43191 } 43192 } 43193 /** 43194 * De-registers a Scrollable reference and unsubscribes from its scroll event observable. 43195 * @param scrollable Scrollable instance to be deregistered. 43196 */ 43197 deregister(scrollable) { 43198 const scrollableReference = this.scrollContainers.get(scrollable); 43199 if (scrollableReference) { 43200 scrollableReference.unsubscribe(); 43201 this.scrollContainers.delete(scrollable); 43202 } 43203 } 43204 /** 43205 * Returns an observable that emits an event whenever any of the registered Scrollable 43206 * references (or window, document, or body) fire a scrolled event. Can provide a time in ms 43207 * to override the default "throttle" time. 43208 * 43209 * **Note:** in order to avoid hitting change detection for every scroll event, 43210 * all of the events emitted from this stream will be run outside the Angular zone. 43211 * If you need to update any data bindings as a result of a scroll event, you have 43212 * to run the callback using `NgZone.run`. 43213 */ 43214 scrolled(auditTimeInMs = DEFAULT_SCROLL_TIME) { 43215 if (!this._platform.isBrowser) { 43216 return (0,rxjs__WEBPACK_IMPORTED_MODULE_7__.of)(); 43217 }
43218 return new rxjs__WEBPACK_IMPORTED_MODULE_8__.Observable(observer => { 43219 if (!this._cleanupGlobalListener) { 43220 this._cleanupGlobalListener = this._ngZone.runOutsideAngular(() => this._renderer.listen('document', 'scroll', () => this._scrolled.next())); 43221 } 43222 // In the case of a 0ms delay, use an observable without auditTime 43223 // since it does add a perceptible delay in processing overhead. 43224 const subscription = auditTimeInMs > 0 ? this._scrolled.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_9__.auditTime)(auditTimeInMs)).subscribe(observer) : this._scrolled.subscribe(observer); 43225 this._scrolledCount++; 43226 return () => { 43227 subscription.unsubscribe(); 43228 this._scrolledCount--; 43229 if (!this._scrolledCount) { 43230 var _this$_cleanupGlobalL; 43231 (_this$_cleanupGlobalL = this._cleanupGlobalListener) === null || _this$_cleanupGlobalL === void 0 || _this$_cleanupGlobalL.call(this); 43232 this._cleanupGlobalListener = undefined; 43233 } 43234 }; 43235 }); 43236 } 43237 ngOnDestroy() { 43238 var _this$_cleanupGlobalL2; 43239 (_this$_cleanupGlobalL2 = this._cleanupGlobalListener) === null || _this$_cleanupGlobalL2 === void 0 || _this$_cleanupGlobalL2.call(this); 43240 this._cleanupGlobalListener = undefined; 43241 this.scrollContainers.forEach((_, container) => this.deregister(container)); 43242 this._scrolled.complete(); 43243 } 43244 /** 43245 * Returns an observable that emits whenever any of the 43246 * scrollable ancestors of an element are scrolled. 43247 * @param elementOrElementRef Element whose ancestors to listen for. 43248 * @param auditTimeInMs Time to throttle the scroll events. 43249 */ 43250 ancestorScrolled(elementOrElementRef, auditTimeInMs) { 43251 const ancestors = this.getAncestorScrollContainers(elementOrElementRef); 43252 return this.scrolled(auditTimeInMs).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_10__.filter)(target => !target || ancestors.indexOf(target) > -1)); 43253 } 43254 /** Returns all registered Scrollables that contain the provided element. */ 43255 getAncestorScrollContainers(elementOrElementRef) { 43256 const scrollingContainers = []; 43257 this.scrollContainers.forEach((_subscription, scrollable) => { 43258 if (this._scrollableContainsElement(scrollable, elementOrElementRef)) { 43259 scrollingContainers.push(scrollable); 43260 } 43261 }); 43262 return scrollingContainers; 43263 } 43264 /** Returns true if the element is contained within the provided Scrollable. */ 43265 _scrollableContainsElement(scrollable, elementOrElementRef) { 43266 let element = (0,_element_x4z00URv_mjs__WEBPACK_IMPORTED_MODULE_5__.a)(elementOrElementRef); 43267 let scrollableElement = scrollable.getElementRef().nativeElement; 43268 // Traverse through the element parents until we reach null, checking if any of the elements 43269 // are the scrollable's element. 43270 do { 43271 if (element == scrollableElement) { 43272 return true; 43273 } 43274 } while (element = element.parentElement); 43275 return false; 43276 } 43277 } 43278 _ScrollDispatcher = ScrollDispatcher; 43279 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(ScrollDispatcher, "\u0275fac", function _ScrollDispatcher_Factory(__ngFactoryType__) { 43280 return new (__ngFactoryType__ || _ScrollDispatcher)(); 43281 }); 43282 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(ScrollDispatcher, "\u0275prov", /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineInjectable"]({ 43283 token: _ScrollDispatcher, 43284 factory: _ScrollDispatcher.ɵfac, 43285 providedIn: 'root' 43286 })); 43287 return ScrollDispatcher; 43288})(); 43289/*#__PURE__*/(() => { 43290 (typeof ngDevMode === "undefined" || ngDevMode) && void 0; 43291})(); 43292 43293/** 43294 * Sends an event when the directive's element is scrolled. Registers itself with the 43295 * ScrollDispatcher service to include itself as part of its collection of scrolling events that it 43296 * can be listened to through the service. 43297 */ 43298let CdkScrollable = /*#__PURE__*/(() => { 43299 var _CdkScrollable; 43300 class CdkScrollable { 43301 constructor() { 43302 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "elementRef", (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_2__.ElementRef)); 43303 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "scrollDispatcher", (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(ScrollDispatcher)); 43304 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "ngZone", (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_2__.NgZone)); 43305 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "dir", (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(_directionality_CBXD4hga_mjs__WEBPACK_IMPORTED_MODULE_11__.D, {
43306 optional: true 43307 })); 43308 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_scrollElement", this.elementRef.nativeElement); 43309 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_destroyed", new rxjs__WEBPACK_IMPORTED_MODULE_3__.Subject()); 43310 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_renderer", (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_2__.Renderer2)); 43311 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_cleanupScroll", void 0); 43312 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_elementScrolled", new rxjs__WEBPACK_IMPORTED_MODULE_3__.Subject()); 43313 } 43314 ngOnInit() { 43315 this._cleanupScroll = this.ngZone.runOutsideAngular(() => this._renderer.listen(this._scrollElement, 'scroll', event => this._elementScrolled.next(event))); 43316 this.scrollDispatcher.register(this); 43317 } 43318 ngOnDestroy() { 43319 var _this$_cleanupScroll; 43320 (_this$_cleanupScroll = this._cleanupScroll) === null || _this$_cleanupScroll === void 0 || _this$_cleanupScroll.call(this); 43321 this._elementScrolled.complete(); 43322 this.scrollDispatcher.deregister(this); 43323 this._destroyed.next(); 43324 this._destroyed.complete(); 43325 } 43326 /** Returns observable that emits when a scroll event is fired on the host element. */ 43327 elementScrolled() { 43328 return this._elementScrolled; 43329 } 43330 /** Gets the ElementRef for the viewport. */ 43331 getElementRef() { 43332 return this.elementRef; 43333 } 43334 /** 43335 * Scrolls to the specified offsets. This is a normalized version of the browser's native scrollTo 43336 * method, since browsers are not consistent about what scrollLeft means in RTL. For this method 43337 * left and right always refer to the left and right side of the scrolling container irrespective 43338 * of the layout direction. start and end refer to left and right in an LTR context and vice-versa 43339 * in an RTL context. 43340 * @param options specified the offsets to scroll to. 43341 */ 43342 scrollTo(options) { 43343 const el = this.elementRef.nativeElement; 43344 const isRtl = this.dir && this.dir.value == 'rtl'; 43345 // Rewrite start & end offsets as right or left offsets. 43346 if (options.left == null) { 43347 options.left = isRtl ? options.end : options.start; 43348 } 43349 if (options.right == null) { 43350 options.right = isRtl ? options.start : options.end; 43351 } 43352 // Rewrite the bottom offset as a top offset. 43353 if (options.bottom != null) { 43354 options.top = el.scrollHeight - el.clientHeight - options.bottom; 43355 } 43356 // Rewrite the right offset as a left offset. 43357 if (isRtl && (0,_scrolling_BkvA05C8_mjs__WEBPACK_IMPORTED_MODULE_12__.g)() != _scrolling_BkvA05C8_mjs__WEBPACK_IMPORTED_MODULE_12__.R.NORMAL) { 43358 if (options.left != null) { 43359 options.right = el.scrollWidth - el.clientWidth - options.left; 43360 } 43361 if ((0,_scrolling_BkvA05C8_mjs__WEBPACK_IMPORTED_MODULE_12__.g)() == _scrolling_BkvA05C8_mjs__WEBPACK_IMPORTED_MODULE_12__.R.INVERTED) { 43362 options.left = options.right; 43363 } else if ((0,_scrolling_BkvA05C8_mjs__WEBPACK_IMPORTED_MODULE_12__.g)() == _scrolling_BkvA05C8_mjs__WEBPACK_IMPORTED_MODULE_12__.R.NEGATED) { 43364 options.left = options.right ? -options.right : options.right; 43365 } 43366 } else { 43367 if (options.right != null) { 43368 options.left = el.scrollWidth - el.clientWidth - options.right; 43369 } 43370 } 43371 this._applyScrollToOptions(options); 43372 } 43373 _applyScrollToOptions(options) { 43374 const el = this.elementRef.nativeElement; 43375 if ((0,_scrolling_BkvA05C8_mjs__WEBPACK_IMPORTED_MODULE_12__.s)()) { 43376 el.scrollTo(options); 43377 } else { 43378 if (options.top != null) { 43379 el.scrollTop = options.top; 43380 } 43381 if (options.left != null) { 43382 el.scrollLeft = options.left; 43383 } 43384 } 43385 } 43386 /** 43387 * Measures the scroll offset relative to the specified edge of the viewport. This method can be 43388 * used instead of directly checking scrollLeft or scrollTop, since browsers are not consistent 43389 * about what scrollLeft means in RTL. The values returned by this method are normalized such that 43390 * left and right always refer to the left and right side of the scrolling container irrespective 43391 * of the layout direction. start and end refer to left and right in an LTR context and vice-versa 43392 * in an RTL context. 43393 * @param from The edge to measure from. 43394 */ 43395 measureScrollOffset(from) { 43396 const LEFT = 'left'; 43397 const RIGHT = 'right'; 43398 const el = this.elementRef.nativeElement;
43399 if (from == 'top') { 43400 return el.scrollTop; 43401 } 43402 if (from == 'bottom') { 43403 return el.scrollHeight - el.clientHeight - el.scrollTop; 43404 } 43405 // Rewrite start & end as left or right offsets. 43406 const isRtl = this.dir && this.dir.value == 'rtl'; 43407 if (from == 'start') { 43408 from = isRtl ? RIGHT : LEFT; 43409 } else if (from == 'end') { 43410 from = isRtl ? LEFT : RIGHT; 43411 } 43412 if (isRtl && (0,_scrolling_BkvA05C8_mjs__WEBPACK_IMPORTED_MODULE_12__.g)() == _scrolling_BkvA05C8_mjs__WEBPACK_IMPORTED_MODULE_12__.R.INVERTED) { 43413 // For INVERTED, scrollLeft is (scrollWidth - clientWidth) when scrolled all the way left and 43414 // 0 when scrolled all the way right. 43415 if (from == LEFT) { 43416 return el.scrollWidth - el.clientWidth - el.scrollLeft; 43417 } else { 43418 return el.scrollLeft; 43419 } 43420 } else if (isRtl && (0,_scrolling_BkvA05C8_mjs__WEBPACK_IMPORTED_MODULE_12__.g)() == _scrolling_BkvA05C8_mjs__WEBPACK_IMPORTED_MODULE_12__.R.NEGATED) { 43421 // For NEGATED, scrollLeft is -(scrollWidth - clientWidth) when scrolled all the way left and 43422 // 0 when scrolled all the way right. 43423 if (from == LEFT) { 43424 return el.scrollLeft + el.scrollWidth - el.clientWidth; 43425 } else { 43426 return -el.scrollLeft; 43427 } 43428 } else { 43429 // For NORMAL, as well as non-RTL contexts, scrollLeft is 0 when scrolled all the way left and 43430 // (scrollWidth - clientWidth) when scrolled all the way right. 43431 if (from == LEFT) { 43432 return el.scrollLeft; 43433 } else { 43434 return el.scrollWidth - el.clientWidth - el.scrollLeft; 43435 } 43436 } 43437 } 43438 } 43439 _CdkScrollable = CdkScrollable; 43440 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(CdkScrollable, "\u0275fac", function _CdkScrollable_Factory(__ngFactoryType__) { 43441 return new (__ngFactoryType__ || _CdkScrollable)(); 43442 }); 43443 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(CdkScrollable, "\u0275dir", /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineDirective"]({ 43444 type: _CdkScrollable, 43445 selectors: [["", "cdk-scrollable", ""], ["", "cdkScrollable", ""]] 43446 })); 43447 return CdkScrollable; 43448})(); 43449/*#__PURE__*/(() => { 43450 (typeof ngDevMode === "undefined" || ngDevMode) && void 0; 43451})(); 43452 43453/** Time in ms to throttle the resize events by default. */ 43454const DEFAULT_RESIZE_TIME = 20; 43455/** 43456 * Simple utility for getting the bounds of the browser viewport. 43457 * @docs-private 43458 */ 43459let ViewportRuler = /*#__PURE__*/(() => { 43460 var _ViewportRuler; 43461 class ViewportRuler { 43462 constructor() { 43463 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_platform", (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(_platform_DmdVEw_C_mjs__WEBPACK_IMPORTED_MODULE_6__.P)); 43464 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_listeners", void 0); 43465 /** Cached viewport dimensions. */ 43466 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_viewportSize", void 0); 43467 /** Stream of viewport change events. */ 43468 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_change", new rxjs__WEBPACK_IMPORTED_MODULE_3__.Subject()); 43469 /** Used to reference correct document/window */ 43470 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_document", (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(_angular_common__WEBPACK_IMPORTED_MODULE_13__.DOCUMENT, { 43471 optional: true 43472 })); 43473 const ngZone = (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_2__.NgZone); 43474 const renderer = (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_2__.RendererFactory2).createRenderer(null, null); 43475 ngZone.runOutsideAngular(() => { 43476 if (this._platform.isBrowser) { 43477 const changeListener = event => this._change.next(event); 43478 this._listeners = [renderer.listen('window', 'resize', changeListener), renderer.listen('window', 'orientationchange', changeListener)]; 43479 } 43480 // Clear the cached position so that the viewport is re-measured next time it is required. 43481 // We don't need to keep track of the subscription, because it is completed on destroy. 43482 this.change().subscribe(() => this._viewportSize = null); 43483 }); 43484 } 43485 ngOnDestroy() { 43486 var _this$_listeners; 43487 (_this$_listeners = this._listeners) === null || _this$_listeners === void 0 || _this$_listeners.forEac
43487h(cleanup => cleanup()); 43488 this._change.complete(); 43489 } 43490 /** Returns the viewport's width and height. */ 43491 getViewportSize() { 43492 if (!this._viewportSize) { 43493 this._updateViewportSize(); 43494 } 43495 const output = { 43496 width: this._viewportSize.width, 43497 height: this._viewportSize.height 43498 }; 43499 // If we're not on a browser, don't cache the size since it'll be mocked out anyway. 43500 if (!this._platform.isBrowser) { 43501 this._viewportSize = null; 43502 } 43503 return output; 43504 } 43505 /** Gets a DOMRect for the viewport's bounds. */ 43506 getViewportRect() { 43507 // Use the document element's bounding rect rather than the window scroll properties 43508 // (e.g. pageYOffset, scrollY) due to in issue in Chrome and IE where window scroll 43509 // properties and client coordinates (boundingClientRect, clientX/Y, etc.) are in different 43510 // conceptual viewports. Under most circumstances these viewports are equivalent, but they 43511 // can disagree when the page is pinch-zoomed (on devices that support touch). 43512 // See https://bugs.chromium.org/p/chromium/issues/detail?id=489206#c4 43513 // We use the documentElement instead of the body because, by default (without a css reset) 43514 // browsers typically give the document body an 8px margin, which is not included in 43515 // getBoundingClientRect(). 43516 const scrollPosition = this.getViewportScrollPosition(); 43517 const { 43518 width, 43519 height 43520 } = this.getViewportSize(); 43521 return { 43522 top: scrollPosition.top, 43523 left: scrollPosition.left, 43524 bottom: scrollPosition.top + height, 43525 right: scrollPosition.left + width, 43526 height, 43527 width 43528 }; 43529 } 43530 /** Gets the (top, left) scroll position of the viewport. */ 43531 getViewportScrollPosition() { 43532 // While we can get a reference to the fake document 43533 // during SSR, it doesn't have getBoundingClientRect. 43534 if (!this._platform.isBrowser) { 43535 return { 43536 top: 0, 43537 left: 0 43538 }; 43539 } 43540 // The top-left-corner of the viewport is determined by the scroll position of the document 43541 // body, normally just (scrollLeft, scrollTop). However, Chrome and Firefox disagree about 43542 // whether `document.body` or `document.documentElement` is the scrolled element, so reading 43543 // `scrollTop` and `scrollLeft` is inconsistent. However, using the bounding rect of 43544 // `document.documentElement` works consistently, where the `top` and `left` values will 43545 // equal negative the scroll position. 43546 const document = this._document; 43547 const window = this._getWindow(); 43548 const documentElement = document.documentElement; 43549 const documentRect = documentElement.getBoundingClientRect(); 43550 const top = -documentRect.top || document.body.scrollTop || window.scrollY || documentElement.scrollTop || 0; 43551 const left = -documentRect.left || document.body.scrollLeft || window.scrollX || documentElement.scrollLeft || 0; 43552 return { 43553 top, 43554 left 43555 }; 43556 } 43557 /** 43558 * Returns a stream that emits whenever the size of the viewport changes. 43559 * This stream emits outside of the Angular zone. 43560 * @param throttleTime Time in milliseconds to throttle the stream. 43561 */ 43562 change(throttleTime = DEFAULT_RESIZE_TIME) { 43563 return throttleTime > 0 ? this._change.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_9__.auditTime)(throttleTime)) : this._change; 43564 } 43565 /** Use defaultView of injected document if available or fallback to global window reference */ 43566 _getWindow() { 43567 return this._document.defaultView || window; 43568 } 43569 /** Updates the cached viewport size. */ 43570 _updateViewportSize() { 43571 const window = this._getWindow(); 43572 this._viewportSize = this._platform.isBrowser ? { 43573 width: window.innerWidth, 43574 height: window.innerHeight 43575 } : { 43576 width: 0, 43577 height: 0 43578 }; 43579 } 43580 } 43581 _ViewportRuler = ViewportRuler; 43582 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(ViewportRuler, "\u0275fac", function _ViewportRuler_Factory(__ngFactoryType__) { 43583 return new (__ngFactoryType__ || _ViewportRuler)(); 43584 }); 43585 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(ViewportRuler, "\u0275prov", /* @__P
43585URE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineInjectable"]({ 43586 token: _ViewportRuler, 43587 factory: _ViewportRuler.ɵfac, 43588 providedIn: 'root' 43589 })); 43590 return ViewportRuler; 43591})(); 43592/*#__PURE__*/(() => { 43593 (typeof ngDevMode === "undefined" || ngDevMode) && void 0; 43594})(); 43595const VIRTUAL_SCROLLABLE = /*#__PURE__*/new _angular_core__WEBPACK_IMPORTED_MODULE_2__.InjectionToken('VIRTUAL_SCROLLABLE'); 43596/** 43597 * Extending the {@link CdkScrollable} to be used as scrolling container for virtual scrolling. 43598 */ 43599let CdkVirtualScrollable = /*#__PURE__*/(() => { 43600 var _CdkVirtualScrollable; 43601 class CdkVirtualScrollable extends CdkScrollable { 43602 constructor() { 43603 super(); 43604 } 43605 /** 43606 * Measure the viewport size for the provided orientation. 43607 * 43608 * @param orientation The orientation to measure the size from. 43609 */ 43610 measureViewportSize(orientation) { 43611 const viewportEl = this.elementRef.nativeElement; 43612 return orientation === 'horizontal' ? viewportEl.clientWidth : viewportEl.clientHeight; 43613 } 43614 } 43615 _CdkVirtualScrollable = CdkVirtualScrollable; 43616 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(CdkVirtualScrollable, "\u0275fac", function _CdkVirtualScrollable_Factory(__ngFactoryType__) { 43617 return new (__ngFactoryType__ || _CdkVirtualScrollable)(); 43618 }); 43619 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(CdkVirtualScrollable, "\u0275dir", /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineDirective"]({ 43620 type: _CdkVirtualScrollable, 43621 features: [_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵInheritDefinitionFeature"]] 43622 })); 43623 return CdkVirtualScrollable; 43624})(); 43625/*#__PURE__*/(() => { 43626 (typeof ngDevMode === "undefined" || ngDevMode) && void 0; 43627})(); 43628 43629/** Checks if the given ranges are equal. */ 43630function rangesEqual(r1, r2) { 43631 return r1.start == r2.start && r1.end == r2.end; 43632} 43633/** 43634 * Scheduler to be used for scroll events. Needs to fall back to 43635 * something that doesn't rely on requestAnimationFrame on environments 43636 * that don't support it (e.g. server-side rendering). 43637 */ 43638const SCROLL_SCHEDULER = typeof requestAnimationFrame !== 'undefined' ? rxjs__WEBPACK_IMPORTED_MODULE_14__.animationFrame : rxjs__WEBPACK_IMPORTED_MODULE_15__.asap; 43639/** A viewport that virtualizes its scrolling with the help of `CdkVirtualForOf`. */ 43640let CdkVirtualScrollViewport = /*#__PURE__*/(() => { 43641 var _CdkVirtualScrollViewport; 43642 class CdkVirtualScrollViewport extends CdkVirtualScrollable { 43643 /** The direction the viewport scrolls. */ 43644 get orientation() { 43645 return this._orientation; 43646 } 43647 set orientation(orientation) { 43648 if (this._orientation !== orientation) { 43649 this._orientation = orientation; 43650 this._calculateSpacerSize(); 43651 } 43652 } 43653 constructor() { 43654 super(); 43655 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "elementRef", (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_2__.ElementRef)); 43656 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_changeDetectorRef", (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_2__.ChangeDetectorRef)); 43657 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_scrollStrategy", (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(VIRTUAL_SCROLL_STRATEGY, { 43658 optional: true 43659 })); 43660 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "scrollable", (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(VIRTUAL_SCROLLABLE, { 43661 optional: true 43662 })); 43663 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_platform", (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(_platform_DmdVEw_C_mjs__WEBPACK_IMPORTED_MODULE_6__.P)); 43664 /** Emits when the viewport is detached from a CdkVirtualForOf. */ 43665 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_detachedSubject", new rxjs__WEBPACK_IMPORTED_MODULE_3__.Subject()); 43666 /** Emits when the rendered range changes. */ 43667 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_renderedRangeSubject", new rxjs__WEBPACK_IMPORTED_MODULE_3__.Subject()); 43668 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_orientation", 'vertical'); 43669 /** 43670 * Whether rendered items should persist in the DOM after scrolling out of view. By default, items 43671 * will be removed. 43672 */ 43673 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "appendOnly", false); 43674 // Note: we don't use the typical EventEmitter here because we need to subscribe to the scroll 43675 // strategy lazily (i.e. only if the user is actually listening to the events). We do this because 43676 // depending on how the strategy calculates the scrolled index, it may come at a cost to 43677 // performance. 43678 /** Emits when the index of the first element visible in the viewport changes. */ 43679 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "scrolledIndexChange", new rxjs__WEBPACK_IMPORTED_MODULE_8__.Observable(
43679observer => this._scrollStrategy.scrolledIndexChange.subscribe(index => Promise.resolve().then(() => this.ngZone.run(() => observer.next(index)))))); 43680 /** The element that wraps the rendered content. */ 43681 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_contentWrapper", void 0); 43682 /** A stream that emits whenever the rendered range changes. */ 43683 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "renderedRangeStream", this._renderedRangeSubject); 43684 /** 43685 * The total size of all content (in pixels), including content that is not currently rendered. 43686 */ 43687 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_totalContentSize", 0); 43688 /** A string representing the `style.width` property value to be used for the spacer element. */ 43689 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_totalContentWidth", ''); 43690 /** A string representing the `style.height` property value to be used for the spacer element. */ 43691 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_totalContentHeight", ''); 43692 /** 43693 * The CSS transform applied to the rendered subset of items so that they appear within the bounds 43694 * of the visible viewport. 43695 */ 43696 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_renderedContentTransform", void 0); 43697 /** The currently rendered range of indices. */ 43698 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_renderedRange", { 43699 start: 0, 43700 end: 0 43701 }); 43702 /** The length of the data bound to this viewport (in number of items). */ 43703 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_dataLength", 0); 43704 /** The size of the viewport (in pixels). */ 43705 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_viewportSize", 0); 43706 /** the currently attached CdkVirtualScrollRepeater. */ 43707 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_forOf", void 0); 43708 /** The last rendered content offset that was set. */ 43709 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_renderedContentOffset", 0); 43710 /** 43711 * Whether the last rendered content offset was to the end of the content (and therefore needs to 43712 * be rewritten as an offset to the start of the content). 43713 */ 43714 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_renderedContentOffsetNeedsRewrite", false); 43715 /** Whether there is a pending change detection cycle. */ 43716 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_isChangeDetectionPending", false); 43717 /** A list of functions to run after the next change detection cycle. */ 43718 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_runAfterChangeDetection", []); 43719 /** Subscription to changes in the viewport size. */ 43720 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_viewportChanges", rxjs__WEBPACK_IMPORTED_MODULE_16__.Subscription.EMPTY); 43721 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_injector", (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_2__.Injector)); 43722 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_isDestroyed", false); 43723 const viewportRuler = (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(ViewportRuler); 43724 if (!this._scrollStrategy && (typeof ngDevMode === 'undefined' || ngDevMode)) { 43725 throw Error('Error: cdk-virtual-scroll-viewport requires the "itemSize" property to be set.'); 43726 } 43727 this._viewportChanges = viewportRuler.change().subscribe(() => { 43728 this.checkViewportSize(); 43729 }); 43730 if (!this.scrollable) { 43731 // No scrollable is provided, so the virtual-scroll-viewport needs to become a scrollable 43732 this.elementRef.nativeElement.classList.add('cdk-virtual-scrollable'); 43733 this.scrollable = this; 43734 } 43735 } 43736 ngOnInit() { 43737 // Scrolling depends on the element dimensions which we can't get during SSR. 43738 if (!this._platform.isBrowser) { 43739 return; 43740 } 43741 if (this.scrollable === this) { 43742 super.ngOnInit(); 43743 } 43744 // It's still too early to measure the viewport at this point. Deferring with a promise allows 43745 // the Viewport to be rendered with the correct size before we measure. We run this outside the 43746 // zone to avoid causing more change detection cycles. We handle the change detection loop 43747 // ourselves instead. 43748 this.ngZone.runOutsideAngular(() => Promise.resolve().then(() => { 43749 this._measureViewportSize(); 43750 this._scrollStrategy.attach(this); 43751 this.scrollable.elementScrolled().pipe( 43752 // Start off with a fake scroll event so we properly detect our initial position. 43753 (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_17__.startWith)(null), 43754 // Collect multiple events into one until the next animation frame. This way if 43755 // there are multiple scroll events in the same frame we only need to recheck 43756 // our layout once. 43757 (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_9__.auditTime)(0, SCROLL_SCHEDULER), 43758 // Usually `elementScrolled` is completed when the scrollable is destroyed, but 43759 // that may not be the case if a `CdkVirtualScrollableElement` is used so we have 43760 // to unsubscribe here just in case. 43761 (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_18__.takeUntil)(this._destroyed)).subscribe(() => this._scrollStrategy.onContentScrolled()); 43762 this._markChangeDetectionNeeded(); 43763 })); 43764 } 43765 ngOnDestroy() { 43766 this.detach(); 43767 this._scrollStrategy.detach(); 43768 // Complete all subjects 43769 this._renderedRangeSubject.complete(); 43770 this._detachedSubject.complete(); 43771 this._viewportChanges.unsubscribe(); 43772 this._isDestroyed = true; 43773 super.ngOnDestroy(); 43774 } 43775 /** Attaches a `CdkVirtualScrollRepeater` to this viewport. */ 43776 attach(forOf) { 43777 if (this._forOf && (typeof ngDevMode === 'undefined' || ngDevMode)) { 43778 throw Error('CdkVirtualScrollViewport is already attached.'); 43779 } 43780 // Subscribe to the data stream of the CdkVirtualForOf to keep track of when the data length 43781 // changes. Run outside the zone to avoid triggering change detection, since we're managing the 43782 // change detection loop ourselves. 43783 this.ngZone.runOutsideAngular(() => { 43784 this._forOf = forOf; 43785 this._forOf.dataStream.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_18__.takeUntil)(this._detachedSubject)).subscribe(data => { 43786 const newLength = data.length; 43787 if (newLength !== this._dataLength) { 43788 this._dataLength = newLength; 43789 this._scrollStrategy.onDataLengthChanged(); 43790 } 43791 this._doChangeDetection(); 43792 }); 43793 }); 43794 }
43795 /** Detaches the current `CdkVirtualForOf`. */ 43796 detach() { 43797 this._forOf = null; 43798 this._detachedSubject.next(); 43799 } 43800 /** Gets the length of the data bound to this viewport (in number of items). */ 43801 getDataLength() { 43802 return this._dataLength; 43803 } 43804 /** Gets the size of the viewport (in pixels). */ 43805 getViewportSize() { 43806 return this._viewportSize; 43807 } 43808 // TODO(mmalerba): This is technically out of sync with what's really rendered until a render 43809 // cycle happens. I'm being careful to only call it after the render cycle is complete and before 43810 // setting it to something else, but its error prone and should probably be split into 43811 // `pendingRange` and `renderedRange`, the latter reflecting whats actually in the DOM. 43812 /** Get the current rendered range of items. */ 43813 getRenderedRange() { 43814 return this._renderedRange; 43815 } 43816 measureBoundingClientRectWithScrollOffset(from) { 43817 return this.getElementRef().nativeElement.getBoundingClientRect()[from]; 43818 } 43819 /** 43820 * Sets the total size of all content (in pixels), including content that is not currently 43821 * rendered. 43822 */ 43823 setTotalContentSize(size) { 43824 if (this._totalContentSize !== size) { 43825 this._totalContentSize = size; 43826 this._calculateSpacerSize(); 43827 this._markChangeDetectionNeeded(); 43828 } 43829 } 43830 /** Sets the currently rendered range of indices. */ 43831 setRenderedRange(range) { 43832 if (!rangesEqual(this._renderedRange, range)) { 43833 if (this.appendOnly) { 43834 range = { 43835 start: 0, 43836 end: Math.max(this._renderedRange.end, range.end) 43837 }; 43838 } 43839 this._renderedRangeSubject.next(this._renderedRange = range); 43840 this._markChangeDetectionNeeded(() => this._scrollStrategy.onContentRendered()); 43841 } 43842 } 43843 /** 43844 * Gets the offset from the start of the viewport to the start of the rendered data (in pixels). 43845 */ 43846 getOffsetToRenderedContentStart() { 43847 return this._renderedContentOffsetNeedsRewrite ? null : this._renderedContentOffset; 43848 } 43849 /** 43850 * Sets the offset from the start of the viewport to either the start or end of the rendered data 43851 * (in pixels). 43852 */ 43853 setRenderedContentOffset(offset, to = 'to-start') { 43854 // In appendOnly, we always start from the top 43855 offset = this.appendOnly && to === 'to-start' ? 0 : offset; 43856 // For a horizontal viewport in a right-to-left language we need to translate along the x-axis 43857 // in the negative direction. 43858 const isRtl = this.dir && this.dir.value == 'rtl'; 43859 const isHorizontal = this.orientation == 'horizontal'; 43860 const axis = isHorizontal ? 'X' : 'Y'; 43861 const axisDirection = isHorizontal && isRtl ? -1 : 1; 43862 let transform = `translate${axis}(${Number(axisDirection * offset)}px)`; 43863 this._renderedContentOffset = offset; 43864 if (to === 'to-end') { 43865 transform += ` translate${axis}(-100%)`; 43866 // The viewport should rewrite this as a `to-start` offset on the next render cycle. Otherwise 43867 // elements will appear to expand in the wrong direction (e.g. `mat-expansion-panel` would 43868 // expand upward). 43869 this._renderedContentOffsetNeedsRewrite = true; 43870 } 43871 if (this._renderedContentTransform != transform) { 43872 // We know this value is safe because we parse `offset` with `Number()` before passing it 43873 // into the string. 43874 this._renderedContentTransform = transform; 43875 this._markChangeDetectionNeeded(() => { 43876 if (this._renderedContentOffsetNeedsRewrite) { 43877 this._renderedContentOffset -= this.measureRenderedContentSize(); 43878 this._renderedContentOffsetNeedsRewrite = false; 43879 this.setRenderedContentOffset(this._renderedContentOffset); 43880 } else { 43881 this._scrollStrategy.onRenderedOffsetChanged(); 43882 } 43883 }); 43884 } 43885 } 43886 /** 43887 * Scrolls to the given offset from the start of the viewport. Please note that this is not always 43888 * the same as setting `scrollTop` or `scrollLeft`. In a horizontal viewport with right-to-left 43889 * direction, this would be the equivalent of setting a fictional `scrollRight` property. 43890 * @param offset The offset to scroll to. 43891 * @param behavior The ScrollBehavior to use when scrolling. Default is behavior is `auto`. 43892 */ 43893 scrollToOffset(offset, behavior = 'auto') { 43894 const options = { 43895 behavior 43896 }; 43897 if (this.orientation === 'horizontal') { 43898 options.start = offset; 43899 } else { 43900 options.top = offset; 43901 } 43902 this.scrollable.scrollTo(options); 43903 } 43904 /** 43905 * Scrolls to the offset for the given index. 43906 * @param index The index of the element to scroll to. 43907 * @param behavior The ScrollBehavior to use when scrolling. Default is behavior is `auto`. 43908 */ 43909 scrollToIndex(index, behavior = 'auto') { 43910 this._scrollStrategy.scrollToIndex(index, behavior); 43911 } 43912 /** 43913 * Gets the current scroll offset from the start of the scrollable (in pixels). 43914 * @param from The edge to measure the offset from. Defaults to 'top' in vertical mode and 'start' 43915 * in horizontal mode. 43916 */ 43917 measureScrollOffset(from) { 43918 // This is to break the call cycle 43919 let measureScrollOffset; 43920 if (this.scrollable == this) { 43921 measureScrollOffset = _from => super.measureScrollOffset(_from); 43922 } else { 43923 measureScrollOffset = _from => this.scrollable.measureScrollOffset(_from); 43924 } 43925 return Math.max(0, measureScrollOffset(from !== null && from !== void 0 ? from : this.orientation === 'horizontal' ? 'start' : 'top') - this.measureViewportOffset()); 43926 } 43927 /** 43928 * Measures the offset of the viewport from the scrolling container 43929 * @param from The edge to measure from. 43930 */ 43931 measureViewportOffset(from) { 43932 var _this$dir; 43933 let fromRect; 43934 const LEFT = 'left'; 43935 const RIGHT = 'right'; 43936 const isRtl = ((_this$dir = this.dir) === null || _this$dir === void 0 ? void 0 : _this$dir.value) == 'rtl'; 43937 if (from == 'start') {
43938 fromRect = isRtl ? RIGHT : LEFT; 43939 } else if (from == 'end') { 43940 fromRect = isRtl ? LEFT : RIGHT; 43941 } else if (from) { 43942 fromRect = from; 43943 } else { 43944 fromRect = this.orientation === 'horizontal' ? 'left' : 'top'; 43945 } 43946 const scrollerClientRect = this.scrollable.measureBoundingClientRectWithScrollOffset(fromRect); 43947 const viewportClientRect = this.elementRef.nativeElement.getBoundingClientRect()[fromRect]; 43948 return viewportClientRect - scrollerClientRect; 43949 } 43950 /** Measure the combined size of all of the rendered items. */ 43951 measureRenderedContentSize() { 43952 const contentEl = this._contentWrapper.nativeElement; 43953 return this.orientation === 'horizontal' ? contentEl.offsetWidth : contentEl.offsetHeight; 43954 } 43955 /** 43956 * Measure the total combined size of the given range. Throws if the range includes items that are 43957 * not rendered. 43958 */ 43959 measureRangeSize(range) { 43960 if (!this._forOf) { 43961 return 0; 43962 } 43963 return this._forOf.measureRangeSize(range, this.orientation); 43964 } 43965 /** Update the viewport dimensions and re-render. */ 43966 checkViewportSize() { 43967 // TODO: Cleanup later when add logic for handling content resize 43968 this._measureViewportSize(); 43969 this._scrollStrategy.onDataLengthChanged(); 43970 } 43971 /** Measure the viewport size. */ 43972 _measureViewportSize() { 43973 this._viewportSize = this.scrollable.measureViewportSize(this.orientation); 43974 } 43975 /** Queue up change detection to run. */ 43976 _markChangeDetectionNeeded(runAfter) { 43977 if (runAfter) { 43978 this._runAfterChangeDetection.push(runAfter); 43979 } 43980 // Use a Promise to batch together calls to `_doChangeDetection`. This way if we set a bunch of 43981 // properties sequentially we only have to run `_doChangeDetection` once at the end. 43982 if (!this._isChangeDetectionPending) { 43983 this._isChangeDetectionPending = true; 43984 this.ngZone.runOutsideAngular(() => Promise.resolve().then(() => { 43985 this._doChangeDetection(); 43986 })); 43987 } 43988 } 43989 /** Run change detection. */ 43990 _doChangeDetection() { 43991 if (this._isDestroyed) { 43992 return; 43993 } 43994 this.ngZone.run(() => { 43995 // Apply changes to Angular bindings. Note: We must call `markForCheck` to run change detection 43996 // from the root, since the repeated items are content projected in. Calling `detectChanges` 43997 // instead does not properly check the projected content. 43998 this._changeDetectorRef.markForCheck(); 43999 // Apply the content transform. The transform can't be set via an Angular binding because 44000 // bypassSecurityTrustStyle is banned in Google. However the value is safe, it's composed of 44001 // string literals, a variable that can only be 'X' or 'Y', and user input that is run through 44002 // the `Number` function first to coerce it to a numeric value. 44003 this._contentWrapper.nativeElement.style.transform = this._renderedContentTransform; 44004 (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.afterNextRender)(() => { 44005 this._isChangeDetectionPending = false; 44006 const runAfterChangeDetection = this._runAfterChangeDetection; 44007 this._runAfterChangeDetection = []; 44008 for (const fn of runAfterChangeDetection) { 44009 fn(); 44010 } 44011 }, { 44012 injector: this._injector 44013 }); 44014 }); 44015 } 44016 /** Calculates the `style.width` and `style.height` for the spacer element. */ 44017 _calculateSpacerSize() { 44018 this._totalContentHeight = this.orientation === 'horizontal' ? '' : `${this._totalContentSize}px`; 44019 this._totalContentWidth = this.orientation === 'horizontal' ? `${this._totalContentSize}px` : ''; 44020 } 44021 } 44022 _CdkVirtualScrollViewport = CdkVirtualScrollViewport; 44023 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(CdkVirtualScrollViewport, "\u0275fac", function _CdkVirtualScrollViewport_Factory(__ngFactoryType__) { 44024 return new (__ngFactoryType__ || _CdkVirtualScrollViewport)(); 44025 }); 44026 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(CdkVirtualScrollViewport, "\u0275cmp", /* @__P
44026URE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineComponent"]({ 44027 type: _CdkVirtualScrollViewport, 44028 selectors: [["cdk-virtual-scroll-viewport"]], 44029 viewQuery: function _CdkVirtualScrollViewport_Query(rf, ctx) { 44030 if (rf & 1) { 44031 _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵviewQuery"](_c0, 7); 44032 } 44033 if (rf & 2) { 44034 let _t; 44035 _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵqueryRefresh"](_t = _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵloadQuery"]()) && (ctx._contentWrapper = _t.first); 44036 } 44037 }, 44038 hostAttrs: [1, "cdk-virtual-scroll-viewport"], 44039 hostVars: 4, 44040 hostBindings: function _CdkVirtualScrollViewport_HostBindings(rf, ctx) { 44041 if (rf & 2) { 44042 _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵclassProp"]("cdk-virtual-scroll-orientation-horizontal", ctx.orientation === "horizontal")("cdk-virtual-scroll-orientation-vertical", ctx.orientation !== "horizontal"); 44043 } 44044 }, 44045 inputs: { 44046 orientation: "orientation", 44047 appendOnly: [2, "appendOnly", "appendOnly", _angular_core__WEBPACK_IMPORTED_MODULE_2__.booleanAttribute] 44048 }, 44049 outputs: { 44050 scrolledIndexChange: "scrolledIndexChange" 44051 }, 44052 features: [_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵProvidersFeature"]([{ 44053 provide: CdkScrollable, 44054 useFactory: (virtualScrollable, viewport) => virtualScrollable || viewport, 44055 deps: [[new _angular_core__WEBPACK_IMPORTED_MODULE_2__.Optional(), new _angular_core__WEBPACK_IMPORTED_MODULE_2__.Inject(VIRTUAL_SCROLLABLE)], _CdkVirtualScrollViewport] 44056 }]), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵInheritDefinitionFeature"]], 44057 ngContentSelectors: _c1, 44058 decls: 4, 44059 vars: 4, 44060 consts: [["contentWrapper", ""], [1, "cdk-virtual-scroll-content-wrapper"], [1, "cdk-virtual-scroll-spacer"]], 44061 template: function _CdkVirtualScrollViewport_Template(rf, ctx) { 44062 if (rf & 1) { 44063 _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵprojectionDef"](); 44064 _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](0, "div", 1, 0); 44065 _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵprojection"](2); 44066 _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"](); 44067 _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelement"](3, "div", 2); 44068 } 44069 if (rf & 2) { 44070 _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵadvance"](3); 44071 _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵstyleProp"]("width", ctx._totalContentWidth)("height", ctx._totalContentHeight); 44072 } 44073 }, 44074 styles: ["cdk-virtual-scroll-viewport{display:block;position:relative;transform:translateZ(0)}.cdk-virtual-scrollable{overflow:auto;will-change:scroll-position;contain:strict}.cdk-virtual-scroll-content-wrapper{position:absolute;top:0;left:0;contain:content}[dir=rtl] .cdk-virtual-scroll-content-wrapper{right:0;left:auto}.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper{min-height:100%}.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>dl:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>ol:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>table:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>ul:not([cdkVirtualFor]){padding-left:0;padding-right:0;margin-left:0;margin-right:0;border-left-width:0;border-right-width:0;outline:none}.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper{min-width:100%}.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>dl:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>ol:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>table:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>ul:not([cdkVirtualFor]){padding-top:0;padding-bottom:0;margin-top:0;margin-bottom:0;border-top-width:0;border-bottom-width:0;outline:none}.cdk-virtual-scroll-spacer{height:1px;transform-origin:0 0;flex:0 0 auto}[dir=rtl] .cdk-virtual-scroll-spacer{transform-origin:100% 0}\n"], 44075 encapsulation: 2, 44076 changeDetection: 0 44077 })); 44078 return CdkVirtualScrollViewport; 44079})(); 44080/*#__PURE__*/(() => { 44081 (typeof ngDevMode === "undefined" || ngDevMode) && void 0; 44082})(); 44083 44084/** Helper to extract the offset of a DOM Node in a certain direction. */ 44085function getOffset(orientation, direction, node) { 44086 const el = node; 44087 if (!el.getBoundingClientRect) { 44088 return 0; 44089 } 44090 const rect = el.getBoundingClientRect(); 44091 if (orientation === 'horizontal') { 44092 return direction === 'start' ? rect.left : rect.right; 44093 } 44094 return direction === 'start' ? rect.top : rect.bottom; 44095} 44096/** 44097 * A directive similar to `ngForOf` to be used for rendering data inside a virtual scrolling 44098 * container. 44099 */ 44100let CdkVirtualForOf = /*#__PURE__*/(() => { 44101 var _CdkVirtualForOf; 44102 class CdkVirtualForOf { 44103 /** The DataSource to display. */ 44104 get cdkVirtualForOf() { 44105 return this._cdkVirtualForOf; 44106 } 44107 set cdkVirtualForOf(value) { 44108 this._cdkVirtualForOf = value; 44109 if ((0,_data_source_D34wiQZj_mjs__WEBPACK_IMPORTED_MODULE_19__.i)(value)) { 44110 this._dataSourceChanges.next(value); 44111 } else { 44112 // If value is an an NgIterable, convert it to an array.
44113 this._dataSourceChanges.next(new _recycle_view_repeater_strategy_DoWdPqVw_mjs__WEBPACK_IMPORTED_MODULE_20__.A((0,rxjs__WEBPACK_IMPORTED_MODULE_21__.isObservable)(value) ? value : Array.from(value || []))); 44114 } 44115 } 44116 /** 44117 * The `TrackByFunction` to use for tracking changes. The `TrackByFunction` takes the index and 44118 * the item and produces a value to be used as the item's identity when tracking changes. 44119 */ 44120 get cdkVirtualForTrackBy() { 44121 return this._cdkVirtualForTrackBy; 44122 } 44123 set cdkVirtualForTrackBy(fn) { 44124 this._needsUpdate = true; 44125 this._cdkVirtualForTrackBy = fn ? (index, item) => fn(index + (this._renderedRange ? this._renderedRange.start : 0), item) : undefined; 44126 } 44127 /** The template used to stamp out new elements. */ 44128 set cdkVirtualForTemplate(value) { 44129 if (value) { 44130 this._needsUpdate = true; 44131 this._template = value; 44132 } 44133 } 44134 /** 44135 * The size of the cache used to store templates that are not being used for re-use later. 44136 * Setting the cache size to `0` will disable caching. Defaults to 20 templates. 44137 */ 44138 get cdkVirtualForTemplateCacheSize() { 44139 return this._viewRepeater.viewCacheSize; 44140 } 44141 set cdkVirtualForTemplateCacheSize(size) { 44142 this._viewRepeater.viewCacheSize = (0,_element_x4z00URv_mjs__WEBPACK_IMPORTED_MODULE_5__.c)(size); 44143 } 44144 /** Emits whenever the data in the current DataSource changes. */ 44145 44146 constructor() { 44147 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_viewContainerRef", (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_2__.ViewContainerRef)); 44148 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_template", (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_2__.TemplateRef)); 44149 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_differs", (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_2__.IterableDiffers)); 44150 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_viewRepeater", (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(_recycle_view_repeater_strategy_DoWdPqVw_mjs__WEBPACK_IMPORTED_MODULE_20__.b)); 44151 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_viewport", (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(CdkVirtualScrollViewport, { 44152 skipSelf: true 44153 })); 44154 /** Emits when the rendered view of the data changes. */ 44155 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "viewChange", new rxjs__WEBPACK_IMPORTED_MODULE_3__.Subject()); 44156 /** Subject that emits when a new DataSource instance is given. */ 44157 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_dataSourceChanges", new rxjs__WEBPACK_IMPORTED_MODULE_3__.Subject()); 44158 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_cdkVirtualForOf", void 0); 44159 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_cdkVirtualForTrackBy", void 0); 44160 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "dataStream", this._dataSourceChanges.pipe( 44161 // Start off with null `DataSource`. 44162 (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_17__.startWith)(null), 44163 // Bundle up the previous and current data sources so we can work with both. 44164 (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_22__.pairwise)(), 44165 // Use `_changeDataSource` to disconnect from the previous data source and connect to the 44166 // new one, passing back a stream of data changes which we run through `switchMap` to give 44167 // us a data stream that emits the latest data from whatever the current `DataSource` is. 44168 (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_23__.switchMap)(([prev, cur]) => this._changeDataSource(prev, cur)), 44169 // Replay the last emitted data when someone subscribes. 44170 (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_24__.shareReplay)(1))); 44171 /** The differ used to calculate changes to the data. */ 44172 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_differ", null); 44173 /** The most recent data emitted from the DataSource. */ 44174 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_data", void 0); 44175 /** The currently rendered items. */ 44176 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_renderedItems", void 0); 44177 /** The currently rendered range of indices. */ 44178 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_renderedRange", void 0); 44179 /** Whether the rendered data should be updated during the next ngDoCheck cycle. */ 44180 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_needsUpdate", false); 44181 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_destroyed", new rxjs__WEBPACK_IMPORTED_MODULE_3__.Subject()); 44182 const ngZone = (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_2__.NgZone); 44183 this.dataStream.subscribe(data => { 44184 this._data = data; 44185 this._onRenderedDataChange(); 44186 }); 44187 this._viewport.renderedRangeStream.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_18__.takeUntil)(this._destroyed)).subscribe(range => { 44188 this._renderedRange = range; 44189 if (this.viewChange.observers.length) { 44190 ngZone.run(() => this.viewChange.next(this._renderedRange)); 44191 } 44192 this._onRenderedDataChange(); 44193 }); 44194 this._viewport.attach(this); 44195 } 44196 /** 44197 * Measures the combined size (width for horizontal orientation, height for vertical) of all items 44198 * in the specified range. Throws an error if the range includes items that are not currently 44199 * rendered. 44200 */ 44201 measureRangeSize(range, orientation) { 44202 if (range.start >= range.end) { 44203 return 0; 44204 } 44205 if ((range.start < this._renderedRange.start || range.end > this._renderedRange.end) && (typeof ngDevMode === 'undefined' || ngDevMode)) { 44206 throw Error(`Error: attempted to measure an item that isn't rendered.`); 44207 } 44208 // The index into the list of rendered views for the first item in the range. 44209 const renderedStartIndex = range.start - this._renderedRange.start; 44210 // The length of the range we're measuring. 44211 const rangeLen = range.end - range.start;
44212 // Loop over all the views, find the first and land node and compute the size by subtracting 44213 // the top of the first node from the bottom of the last one. 44214 let firstNode; 44215 let lastNode; 44216 // Find the first node by starting from the beginning and going forwards. 44217 for (let i = 0; i < rangeLen; i++) { 44218 const view = this._viewContainerRef.get(i + renderedStartIndex); 44219 if (view && view.rootNodes.length) { 44220 firstNode = lastNode = view.rootNodes[0]; 44221 break; 44222 } 44223 } 44224 // Find the last node by starting from the end and going backwards. 44225 for (let i = rangeLen - 1; i > -1; i--) { 44226 const view = this._viewContainerRef.get(i + renderedStartIndex); 44227 if (view && view.rootNodes.length) { 44228 lastNode = view.rootNodes[view.rootNodes.length - 1]; 44229 break; 44230 } 44231 } 44232 return firstNode && lastNode ? getOffset(orientation, 'end', lastNode) - getOffset(orientation, 'start', firstNode) : 0; 44233 } 44234 ngDoCheck() { 44235 if (this._differ && this._needsUpdate) { 44236 // TODO(mmalerba): We should differentiate needs update due to scrolling and a new portion of 44237 // this list being rendered (can use simpler algorithm) vs needs update due to data actually 44238 // changing (need to do this diff). 44239 const changes = this._differ.diff(this._renderedItems); 44240 if (!changes) { 44241 this._updateContext(); 44242 } else { 44243 this._applyChanges(changes); 44244 } 44245 this._needsUpdate = false; 44246 } 44247 } 44248 ngOnDestroy() { 44249 this._viewport.detach(); 44250 this._dataSourceChanges.next(undefined); 44251 this._dataSourceChanges.complete(); 44252 this.viewChange.complete(); 44253 this._destroyed.next(); 44254 this._destroyed.complete(); 44255 this._viewRepeater.detach(); 44256 } 44257 /** React to scroll state changes in the viewport. */ 44258 _onRenderedDataChange() { 44259 if (!this._renderedRange) { 44260 return; 44261 } 44262 this._renderedItems = this._data.slice(this._renderedRange.start, this._renderedRange.end); 44263 if (!this._differ) { 44264 // Use a wrapper function for the `trackBy` so any new values are 44265 // picked up automatically without having to recreate the differ. 44266 this._differ = this._differs.find(this._renderedItems).create((index, item) => { 44267 return this.cdkVirtualForTrackBy ? this.cdkVirtualForTrackBy(index, item) : item; 44268 }); 44269 } 44270 this._needsUpdate = true; 44271 } 44272 /** Swap out one `DataSource` for another. */ 44273 _changeDataSource(oldDs, newDs) { 44274 if (oldDs) { 44275 oldDs.disconnect(this); 44276 } 44277 this._needsUpdate = true; 44278 return newDs ? newDs.connect(this) : (0,rxjs__WEBPACK_IMPORTED_MODULE_7__.of)(); 44279 } 44280 /** Update the `CdkVirtualForOfContext` for all views. */ 44281 _updateContext() { 44282 const count = this._data.length; 44283 let i = this._viewContainerRef.length; 44284 while (i--) { 44285 const view = this._viewContainerRef.get(i); 44286 view.context.index = this._renderedRange.start + i; 44287 view.context.count = count; 44288 this._updateComputedContextProperties(view.context); 44289 view.detectChanges(); 44290 } 44291 } 44292 /** Apply changes to the DOM. */ 44293 _applyChanges(changes) { 44294 this._viewRepeater.applyChanges(changes, this._viewContainerRef, (record, _adjustedPreviousIndex, currentIndex) => this._getEmbeddedViewArgs(record, currentIndex), record => record.item); 44295 // Update $implicit for any items that had an identity change.
44296 changes.forEachIdentityChange(record => { 44297 const view = this._viewContainerRef.get(record.currentIndex); 44298 view.context.$implicit = record.item; 44299 }); 44300 // Update the context variables on all items. 44301 const count = this._data.length; 44302 let i = this._viewContainerRef.length; 44303 while (i--) { 44304 const view = this._viewContainerRef.get(i); 44305 view.context.index = this._renderedRange.start + i; 44306 view.context.count = count; 44307 this._updateComputedContextProperties(view.context); 44308 } 44309 } 44310 /** Update the computed properties on the `CdkVirtualForOfContext`. */ 44311 _updateComputedContextProperties(context) { 44312 context.first = context.index === 0; 44313 context.last = context.index === context.count - 1; 44314 context.even = context.index % 2 === 0; 44315 context.odd = !context.even; 44316 } 44317 _getEmbeddedViewArgs(record, index) { 44318 // Note that it's important that we insert the item directly at the proper index, 44319 // rather than inserting it and the moving it in place, because if there's a directive 44320 // on the same node that injects the `ViewContainerRef`, Angular will insert another 44321 // comment node which can throw off the move when it's being repeated for all items. 44322 return { 44323 templateRef: this._template, 44324 context: { 44325 $implicit: record.item, 44326 // It's guaranteed that the iterable is not "undefined" or "null" because we only 44327 // generate views for elements if the "cdkVirtualForOf" iterable has elements. 44328 cdkVirtualForOf: this._cdkVirtualForOf, 44329 index: -1, 44330 count: -1, 44331 first: false, 44332 last: false, 44333 odd: false, 44334 even: false 44335 }, 44336 index 44337 }; 44338 } 44339 static ngTemplateContextGuard(directive, context) { 44340 return true; 44341 } 44342 } 44343 _CdkVirtualForOf = CdkVirtualForOf; 44344 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(CdkVirtualForOf, "\u0275fac", function _CdkVirtualForOf_Factory(__ngFactoryType__) { 44345 return new (__ngFactoryType__ || _CdkVirtualForOf)(); 44346 }); 44347 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(CdkVirtualForOf, "\u0275dir", /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineDirective"]({ 44348 type: _CdkVirtualForOf, 44349 selectors: [["", "cdkVirtualFor", "", "cdkVirtualForOf", ""]], 44350 inputs: { 44351 cdkVirtualForOf: "cdkVirtualForOf", 44352 cdkVirtualForTrackBy: "cdkVirtualForTrackBy", 44353 cdkVirtualForTemplate: "cdkVirtualForTemplate", 44354 cdkVirtualForTemplateCacheSize: "cdkVirtualForTemplateCacheSize" 44355 }, 44356 features: [_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵProvidersFeature"]([{ 44357 provide: _recycle_view_repeater_strategy_DoWdPqVw_mjs__WEBPACK_IMPORTED_MODULE_20__.b, 44358 useClass: _recycle_view_repeater_strategy_DoWdPqVw_mjs__WEBPACK_IMPORTED_MODULE_20__._ 44359 }])] 44360 })); 44361 return CdkVirtualForOf; 44362})(); 44363/*#__PURE__*/(() => { 44364 (typeof ngDevMode === "undefined" || ngDevMode) && void 0; 44365})(); 44366 44367/** 44368 * Provides a virtual scrollable for the element it is attached to. 44369 */ 44370let CdkVirtualScrollableElement = /*#__PURE__*/(() => { 44371 var _CdkVirtualScrollableElement; 44372 class CdkVirtualScrollableElement extends CdkVirtualScrollable { 44373 constructor() { 44374 super(); 44375 } 44376 measureBoundingClientRectWithScrollOffset(from) { 44377 return this.getElementRef().nativeElement.getBoundingClientRect()[from] - this.measureScrollOffset(from); 44378 } 44379 } 44380 _CdkVirtualScrollableElement = CdkVirtualScrollableElement; 44381 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(CdkVirtualScrollableElement, "\u0275fac", function _CdkVirtualScrollableElement_Factory(__ngFactoryType__) { 44382 return new (__ngFactoryType__ || _CdkVirtualScrollableElement)(); 44383 }); 44384 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(CdkVirtualScrollableElement, "\u0275dir", /* @__P
44384URE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineDirective"]({ 44385 type: _CdkVirtualScrollableElement, 44386 selectors: [["", "cdkVirtualScrollingElement", ""]], 44387 hostAttrs: [1, "cdk-virtual-scrollable"], 44388 features: [_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵProvidersFeature"]([{ 44389 provide: VIRTUAL_SCROLLABLE, 44390 useExisting: _CdkVirtualScrollableElement 44391 }]), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵInheritDefinitionFeature"]] 44392 })); 44393 return CdkVirtualScrollableElement; 44394})(); 44395/*#__PURE__*/(() => { 44396 (typeof ngDevMode === "undefined" || ngDevMode) && void 0; 44397})(); 44398 44399/** 44400 * Provides as virtual scrollable for the global / window scrollbar. 44401 */ 44402let CdkVirtualScrollableWindow = /*#__PURE__*/(() => { 44403 var _CdkVirtualScrollableWindow; 44404 class CdkVirtualScrollableWindow extends CdkVirtualScrollable { 44405 constructor() { 44406 super(); 44407 const document = (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(_angular_common__WEBPACK_IMPORTED_MODULE_13__.DOCUMENT); 44408 this.elementRef = new _angular_core__WEBPACK_IMPORTED_MODULE_2__.ElementRef(document.documentElement); 44409 this._scrollElement = document; 44410 } 44411 measureBoundingClientRectWithScrollOffset(from) { 44412 return this.getElementRef().nativeElement.getBoundingClientRect()[from]; 44413 } 44414 } 44415 _CdkVirtualScrollableWindow = CdkVirtualScrollableWindow; 44416 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(CdkVirtualScrollableWindow, "\u0275fac", function _CdkVirtualScrollableWindow_Factory(__ngFactoryType__) { 44417 return new (__ngFactoryType__ || _CdkVirtualScrollableWindow)(); 44418 }); 44419 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(CdkVirtualScrollableWindow, "\u0275dir", /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineDirective"]({ 44420 type: _CdkVirtualScrollableWindow, 44421 selectors: [["cdk-virtual-scroll-viewport", "scrollWindow", ""]], 44422 features: [_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵProvidersFeature"]([{ 44423 provide: VIRTUAL_SCROLLABLE, 44424 useExisting: _CdkVirtualScrollableWindow 44425 }]), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵInheritDefinitionFeature"]] 44426 })); 44427 return CdkVirtualScrollableWindow; 44428})(); 44429/*#__PURE__*/(() => { 44430 (typeof ngDevMode === "undefined" || ngDevMode) && void 0; 44431})(); 44432let CdkScrollableModule = /*#__PURE__*/(() => { 44433 var _CdkScrollableModule; 44434 class CdkScrollableModule {} 44435 _CdkScrollableModule = CdkScrollableModule; 44436 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(CdkScrollableModule, "\u0275fac", function _CdkScrollableModule_Factory(__ngFactoryType__) { 44437 return new (__ngFactoryType__ || _CdkScrollableModule)(); 44438 }); 44439 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(CdkScrollableModule, "\u0275mod", /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineNgModule"]({ 44440 type: _CdkScrollableModule 44441 })); 44442 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(CdkScrollableModule, "\u0275inj", /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineInjector"]({})); 44443 return CdkScrollableModule; 44444})(); 44445/*#__PURE__*/(() => { 44446 (typeof ngDevMode === "undefined" || ngDevMode) && void 0; 44447})(); 44448/** 44449 * @docs-primary-export 44450 */ 44451let ScrollingModule = /*#__PURE__*/(() => { 44452 var _ScrollingModule; 44453 class ScrollingModule {} 44454 _ScrollingModule = ScrollingModule; 44455 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(ScrollingModule, "\u0275fac", function _ScrollingModule_Factory(__ngFactoryType__) { 44456 return new (__ngFactoryType__ || _ScrollingModule)(); 44457 }); 44458 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(ScrollingModule, "\u0275mod", /* @__P
44458URE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineNgModule"]({ 44459 type: _ScrollingModule 44460 })); 44461 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(ScrollingModule, "\u0275inj", /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineInjector"]({ 44462 imports: [_bidi_mjs__WEBPACK_IMPORTED_MODULE_1__.BidiModule, CdkScrollableModule, _bidi_mjs__WEBPACK_IMPORTED_MODULE_1__.BidiModule, CdkScrollableModule] 44463 })); 44464 return ScrollingModule; 44465})(); 44466/*#__PURE__*/(() => { 44467 (typeof ngDevMode === "undefined" || ngDevMode) && void 0; 44468})(); 44469 44470//# sourceMappingURL=scrolling.mjs.map 44471 44472/***/ }), 44473 44474/***/ 67336: 44475/*!*********************************************************!*\ 44476 !*** ./node_modules/@angular/cdk/fesm2022/keycodes.mjs ***! 44477 \*********************************************************/ 44478/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { 44479 44480__webpack_require__.r(__webpack_exports__); 44481/* harmony export */ __webpack_require__.d(__webpack_exports__, { 44482/* harmony export */ A: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.A), 44483/* harmony export */ ALT: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.d), 44484/* harmony export */ APOSTROPHE: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.aX), 44485/* harmony export */ AT_SIGN: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.a1), 44486/* harmony export */ B: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.a2), 44487/* harmony export */ BACKSLASH: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.a_), 44488/* harmony export */ BACKSPACE: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.B), 44489/* harmony export */ C: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.a3), 44490/* harmony export */ CAPS_LOCK: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.y), 44491/* harmony export */ CLOSE_SQUARE_BRACKET: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.a$), 44492/* harmony export */ COMMA: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.u), 44493/* harmony export */ CONTEXT_MENU: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.as), 44494/* harmony export */ CONTROL: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.C), 44495/* harmony export */ D: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.a4), 44496/* harmony export */ DASH: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.aV), 44497/* harmony export */ DELETE: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.i), 44498/* harmony export */ DOWN_ARROW: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.D), 44499/* harmony export */ E: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.a5), 44500/* harmony export */ EIGHT: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.Y), 44501/* harmony export */ END: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.E), 44502/* harmony export */ ENTER: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.c), 44503/* harmony export */ EQUALS: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.aU), 44504/* harmony export */ ESCAPE: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.g), 44505/* harmony export */ F: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.a6), 44506/* harmony export */ F1: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.F), 44507/* harmony export */ F10: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.r), 44508/* harmony export */ F11: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.s), 44509/* harmony export */ F12: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.t), 44510/* harmony export */ F2: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.j), 44511/* harmony export */ F3: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.k), 44512/* harmony export */ F4: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.l), 44513/* harmony export */ F5: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.m), 44514/* harmony export */ F6: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.n), 44515/* harmony export */ F7: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.o), 44516/* harmony export */ F8: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.p), 44517/* harmony export */ F9: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.q), 44518/* harmony export */ FF_EQUALS: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.$), 44519/* harmony export */ FF_MINUS: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.aL), 44520/* harmony export */ FF_MUTE: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.aP), 44521/* harmony export */ FF_SEMICOLON: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__._), 44522/* harmony export */ FF_VOLUME_DOWN: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.aQ), 44523/* harmony export */ FF_VOLUME_UP: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.aS), 44524/* harmony export */ FIRST_MEDIA: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.aK), 44525/* harmony export */ FIVE: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.V), 44526/* harmony export */ FOUR: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.Q), 44527/* harmony export */ G: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.a7), 44528/* harmony export */ H: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.a8), 44529/* harmony export */ HOME: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.H), 44530/* harmony export */ I: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.a9), 44531/* harmony export */ INSERT: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.I), 44532/* harmony export */ J: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.aa), 44533/* harmony export */ K: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.ab), 44534/* harmony export */ L: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.ac), 44535/* harmony export */ LAST_MEDIA: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.aR), 44536/* harmony export */ LEFT_ARROW: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.L), 44537/* harmony export */ M: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.ad), 44538/* harmony export */ MAC_ENTER: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.v), 44539/* harmony export */ MAC_META: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.M), 44540/* harmony export */ MAC_WK_CMD_LEFT: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.aq), 44541/* harmony export */ MAC_WK_CMD_RIGHT: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.ar), 44542/* harmony export */ META: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.e), 44543/* harmony export */ MUTE: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.aM), 44544/* harmony export */ N: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.ae), 44545/* harmony export */ NINE: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.N), 44546/* harmony export */ NUMPAD_DIVIDE: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.aH), 44547/* harmony export */ NUMPAD_EIGHT: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.aB), 44548/* harmony export */ NUMPAD_FIVE: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.ay), 44549/* harmony export */ NUMPAD_FOUR: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.ax), 44550/* harmony export */ NUMPAD_MINUS: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.aF), 44551/* harmony export */ NUMPAD_MULTIPLY: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.aD), 44552/* harmony export */ NUMPAD_NINE: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.aC), 44553/* harmony export */ NUMPAD_ONE: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.au), 44554/* harmony export */ NUMPAD_PERIOD: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.aG), 44555/* harmony export */ NUMPAD_PLUS: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.aE), 44556/* harmony export */ NUMPAD_SEVEN: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.aA), 44557/* harmony export */ NUMPAD_SIX: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.az), 44558/* harmony export */ NUMPAD_THREE: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.aw), 44559/* harmony export */ NUMPAD_TWO: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.av), 44560/* harmony export */ NUMPAD_ZERO: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.at), 44561/* harmony export */ NUM_CENTER: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.w), 44562/* harmony export */ NUM_LOCK: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.aI), 44563/* harmony export */ O: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.af), 44564/* harmony export */ ONE: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.O), 44565/* harmony export */ OPEN_SQUARE_BRACKET: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.aZ), 44566/* harmony export */ P: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.ag), 44567/* harmony export */ PAGE_DOWN: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.P), 44568/* harmony export */ PAGE_UP: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.a), 44569/* harmony export */ PAUSE: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.x), 44570/* harmony export */ PERIOD: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.h), 44571/* harmony export */ PLUS_SIGN: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.z), 44572/* harmony export */ PRINT_SCREEN: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.G), 44573/* harmony export */ Q: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.ah), 44574/* harmony export */ QUESTION_MARK: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.a0), 44575/* harmony export */ R: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.ai), 44576/* harmony export */ RIGHT_ARROW: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.R), 44577/* harmony export */ S: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.aj), 44578/* harmony export */ SCROLL_LOCK: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.aJ), 44579/* harmony export */ SEMICOLON: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.aT), 44580/* harmony export */ SEVEN: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.X), 44581/* harmony export */ SHIFT: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.f), 44582/* harmony export */ SINGLE_QUOTE: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.b0), 44583/* harmony export */ SIX: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.W), 44584/* harmony export */ SLASH: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.aW), 44585/* harmony export */ SPACE: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.S), 44586/* harmony export */ T: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.ak), 44587/* harmony export */ TAB: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.T), 44588/* harmony export */ THREE: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.K), 44589/* harmony export */ TILDE: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.aY), 44590/* harmony export */ TWO: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.J), 44591/* harmony export */ U: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.al), 44592/* harmony export */ UP_ARROW: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.U), 44593/* harmony export */ V: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.am), 44594/* harmony export */ VOLUME_DOWN: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.aN), 44595/* harmony export */ VOLUME_UP: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.aO), 44596/* harmony export */ W: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.an), 44597/* harmony export */ X: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.ao), 44598/* harmony export */ Y: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.ap), 44599/* harmony export */ Z: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.Z), 44600/* harmony export */ ZERO: () => (/* reexport safe */ _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__.b), 44601/* harmony export */ hasModifierKey: () => (/* binding */ hasModifierKey) 44602/* harmony export */ }); 44603/* harmony import */ var _keycodes_CpHkExLC_mjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./keycodes-CpHkExLC.mjs */ 17035); 44604 44605 44606/** 44607 * Checks whether a modifier key is pressed. 44608 * @param event Event to be checked. 44609 */ 44610function hasModifierKey(event, ...modifiers) { 44611 if (modifiers.length) { 44612 return modifiers.some(modifier => event[modifier]); 44613 } 44614 return event.altKey || event.shiftKey || event.ctrlKey || event.metaKey; 44615} 44616 44617//# sourceMappingURL=keycodes.mjs.map 44618 44619/***/ }), 44620 44621/***/ 67418: 44622/*!*********************************************************************************!*\ 44623 !*** ./node_modules/@angular/cdk/fesm2022/backwards-compatibility-DHR38MsD.mjs ***! 44624 \*********************************************************************************/ 44625/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { 44626 44627__webpack_require__.r(__webpack_exports__); 44628/* harmony export */ __webpack_require__.d(__webpack_exports__, { 44629/* harmony export */ _: () => (/* binding */ _bindEventWithOptions) 44630/* harmony export */ }); 44631/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 17705); 44632 44633 44634// TODO(crisbeto): remove this function when making breaking changes for v20. 44635/** 44636 * Binds an event listener with specific options in a backwards-compatible way. 44637 * This function is necessary, because `Renderer2.listen` only supports listener options
44638 * after 19.1 and during the v19 period we support any 19.x version. 44639 * @docs-private 44640 */ 44641function _bindEventWithOptions(renderer, target, eventName, callback, options) { 44642 const major = parseInt(_angular_core__WEBPACK_IMPORTED_MODULE_0__.VERSION.major); 44643 const minor = parseInt(_angular_core__WEBPACK_IMPORTED_MODULE_0__.VERSION.minor); 44644 // Event options in `listen` are only supported in 19.1 and beyond. 44645 // We also allow 0.0.x, because that indicates a build at HEAD. 44646 if (major > 19 || major === 19 && minor > 0 || major === 0 && minor === 0) { 44647 return renderer.listen(target, eventName, callback, options); 44648 } 44649 target.addEventListener(eventName, callback, options); 44650 return () => { 44651 target.removeEventListener(eventName, callback, options); 44652 }; 44653} 44654 44655//# sourceMappingURL=backwards-compatibility-DHR38MsD.mjs.map 44656 44657/***/ }), 44658 44659/***/ 68008: 44660/*!***************************************************************!*\ 44661 !*** ./node_modules/@angular/animations/fesm2022/browser.mjs ***! 44662 \***************************************************************/ 44663/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { 44664 44665__webpack_require__.r(__webpack_exports__); 44666/* harmony export */ __webpack_require__.d(__webpack_exports__, { 44667/* harmony export */ AnimationDriver: () => (/* binding */ AnimationDriver), 44668/* harmony export */ NoopAnimationDriver: () => (/* binding */ NoopAnimationDriver), 44669/* harmony export */ "ɵAnimation": () => (/* binding */ Animation), 44670/* harmony export */ "ɵAnimationEngine": () => (/* binding */ AnimationEngine), 44671/* harmony export */ "ɵAnimationRenderer": () => (/* binding */ AnimationRenderer), 44672/* harmony export */ "ɵAnimationRendererFactory": () => (/* binding */ AnimationRendererFactory), 44673/* harmony export */ "ɵAnimationStyleNormalizer": () => (/* binding */ AnimationStyleNormalizer), 44674/* harmony export */ "ɵBaseAnimationRenderer": () => (/* binding */ BaseAnimationRenderer), 44675/* harmony export */ "ɵENTER_CLASSNAME": () => (/* reexport safe */ _util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.ENTER_CLASSNAME), 44676/* harmony export */ "ɵLEAVE_CLASSNAME": () => (/* reexport safe */ _util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.LEAVE_CLASSNAME), 44677/* harmony export */ "ɵNoopAnimationStyleNormalizer": () => (/* binding */ NoopAnimationStyleNormalizer), 44678/* harmony export */ "ɵTransitionAnimationPlayer": () => (/* binding */ TransitionAnimationPlayer), 44679/* harmony export */ "ɵWebAnimationsDriver": () => (/* binding */ WebAnimationsDriver), 44680/* harmony export */ "ɵWebAnimationsPlayer": () => (/* binding */ WebAnimationsPlayer), 44681/* harmony export */ "ɵWebAnimationsStyleNormalizer": () => (/* binding */ WebAnimationsStyleNormalizer), 44682/* harmony export */ "ɵallowPreviousPlayerStylesMerge": () => (/* reexport safe */ _util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.allowPreviousPlayerStylesMerge), 44683/* harmony export */ "ɵcamelCaseToDashCase": () => (/* reexport safe */ _util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.camelCaseToDashCase), 44684/* harmony export */ "ɵcontainsElement": () => (/* reexport safe */ _util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.containsElement), 44685/* harmony export */ "ɵcreateEngine": () => (/* binding */ createEngine), 44686/* harmony export */ "ɵgetParentElement": () => (/* reexport safe */ _util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.getParentElement), 44687/* harmony export */ "ɵinvokeQuery": () => (/* reexport safe */ _util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.invokeQuery), 44688/* harmony export */ "ɵnormalizeKeyframes": () => (/* reexport safe */ _util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.normalizeKeyframes$1), 44689/* harmony export */ "ɵvalidateStyleProperty": () => (/* reexport safe */ _util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.validateStyleProperty), 44690/* harmony export */ "ɵvalidateWebAnimatableStyleProperty": () => (/* reexport safe */ _util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.validateWebAnimatableStyleProperty) 44691/* harmony export */ }); 44692/* harmony import */ var C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js */ 80045); 44693/* harmony import */ var C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/objectSpread2.js */ 89379); 44694/* harmony import */ var C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/defineProperty.js */ 64467); 44695/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/core */ 17705); 44696/* harmony import */ var _util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./util-D9FfmVnv.mjs */ 6485); 44697/* harmony import */ var _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./private_export-faY_wCkZ.mjs */ 60969); 44698 44699 44700 44701const _excluded = ["value"]; 44702/** 44703 * @license Angular v19.2.14 44704 * (c) 2010-2025 Google LLC. https://angular.io/ 44705 * License: MIT 44706 */ 44707 44708 44709 44710 44711 44712 44713/** 44714 * @publicApi 44715 * 44716 * `AnimationDriver` implentation for Noop animations 44717 */ 44718let NoopAnimationDriver = /*#__PURE__*/(() => { 44719 var _NoopAnimationDriver; 44720 class NoopAnimationDriver { 44721 /** 44722 * @returns Whether `prop` is a valid CSS property 44723 */ 44724 validateStyleProperty(prop) { 44725 return (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.validateStyleProperty)(prop); 44726 } 44727 /** 44728 * 44729 * @returns Whether elm1 contains elm2. 44730 */ 44731 containsElement(elm1, elm2) { 44732 return (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.containsElement)(elm1, elm2); 44733 } 44734 /** 44735 * @returns Rhe parent of the given element or `null` if the element is the `document` 44736 */ 44737 getParentElement(element) { 44738 return (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.getParentElement)(element); 44739 } 44740 /** 44741 * @returns The result of the query selector on the element. The array will contain up to 1 item 44742 * if `multi` is `false`. 44743 */ 44744 query(element, selector, multi) { 44745 return (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.invokeQuery)(element, selector, multi); 44746 } 44747 /** 44748 * @returns The `defaultValue` or empty string 44749 */ 44750 computeStyle(element, prop, defaultValue) { 44751 return defaultValue || ''; 44752 } 44753 /** 44754 * @returns An `NoopAnimationPlayer` 44755 */ 44756 animate(element, keyframes, duration, delay, easing, previousPlayers = [], scrubberAccessRequested) { 44757 return new _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_4__.NoopAnimationPlayer(duration, delay); 44758 } 44759 } 44760 _NoopAnimationDriver = NoopAnimationDriver; 44761 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(NoopAnimationDriver, "\u0275fac", function _NoopAnimationDriver_Factory(__ngFactoryType__) { 44762 return new (__ngFactoryType__ || _NoopAnimationDriver)(); 44763 }); 44764 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(NoopAnimationDriver, "\u0275prov", /* @__P
44764URE__ */_angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵdefineInjectable"]({ 44765 token: _NoopAnimationDriver, 44766 factory: _NoopAnimationDriver.ɵfac 44767 })); 44768 return NoopAnimationDriver; 44769})(); 44770/*#__PURE__*/(() => { 44771 (typeof ngDevMode === "undefined" || ngDevMode) && void 0; 44772})(); 44773/** 44774 * @publicApi 44775 */ 44776class AnimationDriver {} 44777/** 44778 * @deprecated Use the NoopAnimationDriver class. 44779 */ 44780(0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(AnimationDriver, "NOOP", /*#__PURE__*/new NoopAnimationDriver()); 44781class AnimationStyleNormalizer {} 44782class NoopAnimationStyleNormalizer { 44783 normalizePropertyName(propertyName, errors) { 44784 return propertyName; 44785 } 44786 normalizeStyleValue(userProvidedProperty, normalizedProperty, value, errors) { 44787 return value; 44788 } 44789} 44790const DIMENSIONAL_PROP_SET = /*#__PURE__*/new Set(['width', 'height', 'minWidth', 'minHeight', 'maxWidth', 'maxHeight', 'left', 'top', 'bottom', 'right', 'fontSize', 'outlineWidth', 'outlineOffset', 'paddingTop', 'paddingLeft', 'paddingBottom', 'paddingRight', 'marginTop', 'marginLeft', 'marginBottom', 'marginRight', 'borderRadius', 'borderWidth', 'borderTopWidth', 'borderLeftWidth', 'borderRightWidth', 'borderBottomWidth', 'textIndent', 'perspective']); 44791class WebAnimationsStyleNormalizer extends AnimationStyleNormalizer { 44792 normalizePropertyName(propertyName, errors) { 44793 return (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.dashCaseToCamelCase)(propertyName); 44794 } 44795 normalizeStyleValue(userProvidedProperty, normalizedProperty, value, errors) { 44796 let unit = ''; 44797 const strVal = value.toString().trim(); 44798 if (DIMENSIONAL_PROP_SET.has(normalizedProperty) && value !== 0 && value !== '0') { 44799 if (typeof value === 'number') { 44800 unit = 'px'; 44801 } else { 44802 const valAndSuffixMatch = value.match(/^[+-]?[\d\.]+([a-z]*)$/); 44803 if (valAndSuffixMatch && valAndSuffixMatch[1].length == 0) { 44804 errors.push((0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.invalidCssUnitValue)(userProvidedProperty, value)); 44805 } 44806 } 44807 } 44808 return strVal + unit; 44809 } 44810} 44811function createListOfWarnings(warnings) { 44812 const LINE_START = '\n - '; 44813 return `${LINE_START}${warnings.filter(Boolean).map(warning => warning).join(LINE_START)}`; 44814} 44815function warnValidation(warnings) { 44816 console.warn(`animation validation warnings:${createListOfWarnings(warnings)}`); 44817} 44818function warnTriggerBuild(name, warnings) { 44819 console.warn(`The animation trigger "${name}" has built with the following warnings:${createListOfWarnings(warnings)}`); 44820} 44821function warnRegister(warnings) { 44822 console.warn(`Animation built with the following warnings:${createListOfWarnings(warnings)}`); 44823} 44824function pushUnrecognizedPropertiesWarning(warnings, props) { 44825 if (props.length) { 44826 warnings.push(`The following provided properties are not recognized: ${props.join(', ')}`); 44827 } 44828} 44829const ANY_STATE = '*'; 44830function parseTransitionExpr(transitionValue, errors) { 44831 const expressions = []; 44832 if (typeof transitionValue == 'string') { 44833 transitionValue.split(/\s*,\s*/).forEach(str => parseInnerTransitionStr(str, expressions, errors)); 44834 } else { 44835 expressions.push(transitionValue); 44836 } 44837 return expressions; 44838} 44839function parseInnerTransitionStr(eventStr, expressions, errors) { 44840 if (eventStr[0] == ':') { 44841 const result = parseAnimationAlias(eventStr, errors); 44842 if (typeof result == 'function') { 44843 expressions.push(result); 44844 return; 44845 } 44846 eventStr = result; 44847 } 44848 const match = eventStr.match(/^(\*|[-\w]+)\s*(<?[=-]>)\s*(\*|[-\w]+)$/); 44849 if (match == null || match.length < 4) { 44850 errors.push((0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.invalidExpression)(eventStr)); 44851 return expressions; 44852 } 44853 const fromState = match[1]; 44854 const separator = match[2]; 44855 const toState = match[3]; 44856 expressions.push(makeLambdaFromStates(fromState, toState)); 44857 const isFullAnyStateExpr = fromState == ANY_STATE && toState == ANY_STATE; 44858 if (separator[0] == '<' && !isFullAnyStateExpr) { 44859 expressions.push(makeLambdaFromStates(toState, fromState)); 44860 } 44861 return; 44862} 44863function parseAnimationAlias(alias, errors) { 44864 switch (alias) { 44865 case ':enter': 44866 return 'void => *'; 44867 case ':leave': 44868 return '* => void'; 44869 case ':increment': 44870 return (fromState, toState) => parseFloat(toState) > parseFloat(fromState); 44871 case ':decrement': 44872 return (fromState, toState) => parseFloat(toState) < parseFloat(fromState); 44873 default: 44874 errors.push((0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.invali
44874dTransitionAlias)(alias)); 44875 return '* => *'; 44876 } 44877} 44878// DO NOT REFACTOR ... keep the follow set instantiations 44879// with the values intact (closure compiler for some reason 44880// removes follow-up lines that add the values outside of 44881// the constructor... 44882const TRUE_BOOLEAN_VALUES = /*#__PURE__*/new Set(['true', '1']); 44883const FALSE_BOOLEAN_VALUES = /*#__PURE__*/new Set(['false', '0']); 44884function makeLambdaFromStates(lhs, rhs) { 44885 const LHS_MATCH_BOOLEAN = TRUE_BOOLEAN_VALUES.has(lhs) || FALSE_BOOLEAN_VALUES.has(lhs); 44886 const RHS_MATCH_BOOLEAN = TRUE_BOOLEAN_VALUES.has(rhs) || FALSE_BOOLEAN_VALUES.has(rhs); 44887 return (fromState, toState) => { 44888 let lhsMatch = lhs == ANY_STATE || lhs == fromState; 44889 let rhsMatch = rhs == ANY_STATE || rhs == toState; 44890 if (!lhsMatch && LHS_MATCH_BOOLEAN && typeof fromState === 'boolean') { 44891 lhsMatch = fromState ? TRUE_BOOLEAN_VALUES.has(lhs) : FALSE_BOOLEAN_VALUES.has(lhs); 44892 } 44893 if (!rhsMatch && RHS_MATCH_BOOLEAN && typeof toState === 'boolean') { 44894 rhsMatch = toState ? TRUE_BOOLEAN_VALUES.has(rhs) : FALSE_BOOLEAN_VALUES.has(rhs); 44895 } 44896 return lhsMatch && rhsMatch; 44897 }; 44898} 44899const SELF_TOKEN = ':self'; 44900const SELF_TOKEN_REGEX = /* @__PURE__ */new RegExp(`s*${SELF_TOKEN}s*,?`, 'g'); 44901/* 44902 * [Validation] 44903 * The visitor code below will traverse the animation AST generated by the animation verb functions 44904 * (the output is a tree of objects) and attempt to perform a series of validations on the data. The 44905 * following corner-cases will be validated: 44906 * 44907 * 1. Overlap of animations 44908 * Given that a CSS property cannot be animated in more than one place at the same time, it's 44909 * important that this behavior is detected and validated. The way in which this occurs is that 44910 * each time a style property is examined, a string-map containing the property will be updated with 44911 * the start and end times for when the property is used within an animation step. 44912 * 44913 * If there are two or more parallel animations that are currently running (these are invoked by the 44914 * group()) on the same element then the validator will throw an error. Since the start/end timing 44915 * values are collected for each property then if the current animation step is animating the same 44916 * property and its timing values fall anywhere into the window of time that the property is 44917 * currently being animated within then this is what causes an error. 44918 * 44919 * 2. Timing values 44920 * The validator will validate to see if a timing value of `duration delay easing` or 44921 * `durationNumber` is valid or not. 44922 * 44923 * (note that upon validation the code below will replace the timing data with an object c
44923ontaining 44924 * {duration,delay,easing}. 44925 * 44926 * 3. Offset Validation 44927 * Each of the style() calls are allowed to have an offset value when placed inside of keyframes(). 44928 * Offsets within keyframes() are considered valid when: 44929 * 44930 * - No offsets are used at all 44931 * - Each style() entry contains an offset value 44932 * - Each offset is between 0 and 1 44933 * - Each offset is greater to or equal than the previous one 44934 * 44935 * Otherwise an error will be thrown. 44936 */ 44937function buildAnimationAst(driver, metadata, errors, warnings) { 44938 return new AnimationAstBuilderVisitor(driver).build(metadata, errors, warnings); 44939} 44940const ROOT_SELECTOR = ''; 44941class AnimationAstBuilderVisitor { 44942 constructor(_driver) { 44943 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_driver", void 0); 44944 this._driver = _driver; 44945 } 44946 build(metadata, errors, warnings) { 44947 const context = new AnimationAstBuilderContext(errors); 44948 this._resetContextStyleTimingState(context); 44949 const ast = (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.visitDslNode)(this, (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.normalizeAnimationEntry)(metadata), context); 44950 if (typeof ngDevMode === 'undefined' || ngDevMode) { 44951 if (context.unsupportedCSSPropertiesFound.size) { 44952 pushUnrecognizedPropertiesWarning(warnings, [...context.unsupportedCSSPropertiesFound.keys()]); 44953 } 44954 } 44955 return ast; 44956 } 44957 _resetContextStyleTimingState(context) { 44958 context.currentQuerySelector = ROOT_SELECTOR; 44959 context.collectedStyles = new Map(); 44960 context.collectedStyles.set(ROOT_SELECTOR, new Map()); 44961 context.currentTime = 0; 44962 } 44963 visitTrigger(metadata, context) { 44964 let queryCount = context.queryCount = 0; 44965 let depCount = context.depCount = 0; 44966 const states = []; 44967 const transitions = []; 44968 if (metadata.name.charAt(0) == '@') { 44969 context.errors.push((0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.invalidTrigger)()); 44970 } 44971 metadata.definitions.forEach(def => { 44972 this._resetContextStyleTimingState(context); 44973 if (def.type == _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_4__.AnimationMetadataType.State) { 44974 const stateDef = def; 44975 const name = stateDef.name; 44976 name.toString().split(/\s*,\s*/).forEach(n => { 44977 stateDef.name = n; 44978 states.push(this.visitState(stateDef, context)); 44979 }); 44980 stateDef.name = name; 44981 } else if (def.type == _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_4__.AnimationMetadataType.Transition) { 44982 const transition = this.visitTransition(def, context); 44983 queryCount += transition.queryCount; 44984 depCount += transition.depCount; 44985 transitions.push(transition); 44986 } else { 44987 context.errors.push((0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.invalidDefinition)()); 44988 } 44989 }); 44990 return { 44991 type: _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_4__.AnimationMetadataType.Trigger, 44992 name: metadata.name, 44993 states, 44994 transitions, 44995 queryCount, 44996 depCount, 44997 options: null 44998 }; 44999 } 45000 visitState(metadata, context) { 45001 const styleAst = this.visitStyle(metadata.styles, context); 45002 const astParams = metadata.options && metadata.options.params || null; 45003 if (styleAst.containsDynamicStyles) { 45004 const missingSubs = new Set(); 45005 const params = astParams || {}; 45006 styleAst.styles.forEach(style => { 45007 if (style instanceof Map) { 45008 style.forEach(value => { 45009 (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.extractStyleParams)(value).forEach(sub => { 45010 if (!params.hasOwnProperty(sub)) { 45011 missingSubs.add(sub); 45012 } 45013 }); 45014 }); 45015 } 45016 }); 45017 if (missingSubs.size) { 45018 context.errors.push((0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.invalidState)(metadata.name, [...missingSubs.values()])); 45019 } 45020 } 45021 return { 45022 type: _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_4__.AnimationMetadataType.State, 45023 name: metadata.name, 45024 style: styleAst, 45025 options: astParams ? { 45026 params: astParams 45027 } : null 45028 }; 45029 } 45030 visitTransition(metadata, context) { 45031 context.queryCount = 0; 45032 context.depCount = 0; 45033 const animation = (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.visitDslNode)(this, (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.normalizeAnimationEntry)(metadata.animation), context); 45034 const matchers = parseTransitionExpr(metadata.expr, context.errors); 45035 return { 45036 type: _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_4__.AnimationMetadataType.Transition, 45037 matchers, 45038 animation, 45039 queryCount: context.queryCount, 45040 depCount: context.depCount, 45041 options: normalizeAnimationOptions(metadata.options) 45042 }; 45043 } 45044 visitSequence(metadata, context) { 45045 return { 45046 type: _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_4__.AnimationMetadataType.Sequence, 45047 steps: metadata.steps.map(s => (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.visitDslNode)(this, s, context)), 45048 options: normalizeAnimationOptions(metadata.options) 45049 }; 45050 } 45051 visitGroup(metadata, context) { 45052 const currentTime = context.currentTime; 45053 let furthestTime = 0; 45054 const steps = metadata.steps.map(step => { 45055 context.currentTime = currentTime; 45056 const innerAst = (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.visitDslNode)(this, step, context); 45057 furthestTime = Math.max(furthestTime, context.currentTime); 45058 return innerAst; 45059 }); 45060 context.currentTime = furthestTime; 45061 return { 45062 type: _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_4__.AnimationMetadataType.Group, 45063 steps, 45064 options: normalizeAnimationOptions(metadata.options) 45065 }; 45066 } 45067 visitAnimate(metadata, context) { 45068 const timingAst = constructTimingAst(metadata.timings, context.errors); 45069 context.currentAnimateTimings = timingAst; 45070 let styleAst; 45071 let styleMetadata = metadata.styles ? metadata.styles : (0,_private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_4__.style)({}); 45072 if (styleMetadata.type == _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_4__.AnimationMetadataType.
vendor: 9,225 bytes, lines 45072-45291
45072Keyframes) { 45073 styleAst = this.visitKeyframes(styleMetadata, context); 45074 } else { 45075 let styleMetadata = metadata.styles; 45076 let isEmpty = false; 45077 if (!styleMetadata) { 45078 isEmpty = true; 45079 const newStyleData = {}; 45080 if (timingAst.easing) { 45081 newStyleData['easing'] = timingAst.easing; 45082 } 45083 styleMetadata = (0,_private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_4__.style)(newStyleData); 45084 } 45085 context.currentTime += timingAst.duration + timingAst.delay; 45086 const _styleAst = this.visitStyle(styleMetadata, context); 45087 _styleAst.isEmptyStep = isEmpty; 45088 styleAst = _styleAst; 45089 } 45090 context.currentAnimateTimings = null; 45091 return { 45092 type: _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_4__.AnimationMetadataType.Animate, 45093 timings: timingAst, 45094 style: styleAst, 45095 options: null 45096 }; 45097 } 45098 visitStyle(metadata, context) { 45099 const ast = this._makeStyleAst(metadata, context); 45100 this._validateStyleAst(ast, context); 45101 return ast; 45102 } 45103 _makeStyleAst(metadata, context) { 45104 const styles = []; 45105 const metadataStyles = Array.isArray(metadata.styles) ? metadata.styles : [metadata.styles]; 45106 for (let styleTuple of metadataStyles) { 45107 if (typeof styleTuple === 'string') { 45108 if (styleTuple === _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_4__.AUTO_STYLE) { 45109 styles.push(styleTuple); 45110 } else { 45111 context.errors.push((0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.invalidStyleValue)(styleTuple)); 45112 } 45113 } else { 45114 styles.push(new Map(Object.entries(styleTuple))); 45115 } 45116 } 45117 let containsDynamicStyles = false; 45118 let collectedEasing = null; 45119 styles.forEach(styleData => { 45120 if (styleData instanceof Map) { 45121 if (styleData.has('easing')) { 45122 collectedEasing = styleData.get('easing'); 45123 styleData.delete('easing'); 45124 } 45125 if (!containsDynamicStyles) { 45126 for (let value of styleData.values()) { 45127 if (value.toString().indexOf(_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.SUBSTITUTION_EXPR_START) >= 0) { 45128 containsDynamicStyles = true; 45129 break; 45130 } 45131 } 45132 } 45133 } 45134 }); 45135 return { 45136 type: _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_4__.AnimationMetadataType.Style, 45137 styles, 45138 easing: collectedEasing, 45139 offset: metadata.offset, 45140 containsDynamicStyles, 45141 options: null 45142 }; 45143 } 45144 _validateStyleAst(ast, context) { 45145 const timings = context.currentAnimateTimings; 45146 let endTime = context.currentTime; 45147 let startTime = context.currentTime; 45148 if (timings && startTime > 0) { 45149 startTime -= timings.duration + timings.delay; 45150 } 45151 ast.styles.forEach(tuple => { 45152 if (typeof tuple === 'string') return; 45153 tuple.forEach((value, prop) => { 45154 if (typeof ngDevMode === 'undefined' || ngDevMode) { 45155 if (!this._driver.validateStyleProperty(prop)) { 45156 tuple.delete(prop); 45157 context.unsupportedCSSPropertiesFound.add(prop); 45158 return; 45159 } 45160 } 45161 // This is guaranteed to have a defined Map at this querySelector location making it 45162 // safe to add the assertion here. It is set as a default empty map in prior methods. 45163 const collectedStyles = context.collectedStyles.get(context.currentQuerySelector); 45164 const collectedEntry = collectedStyles.get(prop); 45165 let updateCollectedStyle = true; 45166 if (collectedEntry) { 45167 if (startTime != endTime && startTime >= collectedEntry.startTime && endTime <= collectedEntry.endTime) { 45168 context.errors.push((0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.invalidParallelAnimation)(prop, collectedEntry.startTime, collectedEntry.endTime, startTime, endTime)); 45169 updateCollectedStyle = false; 45170 } 45171 // we always choose the smaller start time value since we 45172 // want to have a record of the entire animation window where 45173 // the style property is being animated in between 45174 startTime = collectedEntry.startTime; 45175 } 45176 if (updateCollectedStyle) { 45177 collectedStyles.set(prop, { 45178 startTime, 45179 endTime 45180 }); 45181 } 45182 if (context.options) { 45183 (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.validateStyleParams)(value, context.options, context.errors); 45184 } 45185 }); 45186 }); 45187 } 45188 visitKeyframes(metadata, context) { 45189 const ast = { 45190 type: _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_4__.AnimationMetadataType.Keyframes, 45191 styles: [], 45192 options: null 45193 }; 45194 if (!context.currentAnimateTimings) { 45195 context.errors.push((0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.invalidKeyframes)()); 45196 return ast; 45197 } 45198 const MAX_KEYFRAME_OFFSET = 1; 45199 let totalKeyframesWithOffsets = 0; 45200 const offsets = []; 45201 let offsetsOutOfOrder = false; 45202 let keyframesOutOfRange = false; 45203 let previousOffset = 0; 45204 const keyframes = metadata.steps.map(styles => { 45205 const style = this._makeStyleAst(styles, context); 45206 let offsetVal = style.offset != null ? style.offset : consumeOffset(style.styles); 45207 let offset = 0; 45208 if (offsetVal != null) { 45209 totalKeyframesWithOffsets++; 45210 offset = style.offset = offsetVal; 45211 } 45212 keyframesOutOfRange = keyframesOutOfRange || offset < 0 || offset > 1; 45213 offsetsOutOfOrder = offsetsOutOfOrder || offset < previousOffset; 45214 previousOffset = offset; 45215 offsets.push(offset); 45216 return style; 45217 }); 45218 if (keyframesOutOfRange) { 45219 context.errors.push((0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.invalidOffset)()); 45220 } 45221 if (offsetsOutOfOrder) { 45222 context.errors.push((0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.keyframeOffsetsOutOfOrder)()); 45223 } 45224 const length = metadata.steps.length; 45225 let generatedOffset = 0; 45226 if (totalKeyframesWithOffsets > 0 && totalKeyframesWithOffsets < length) { 45227 context.errors.push((0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.keyframesMissingOffsets)()); 45228 } else if (totalKeyframesWithOffsets == 0) { 45229 generatedOffset = MAX_KEYFRAME_OFFSET / (length - 1); 45230 } 45231 const limit = length - 1; 45232 const currentTime = context.currentTime; 45233 const currentAnimateTimings = context.currentAnimateTimings; 45234 const animateDuration = currentAnimateTimings.duration; 45235 keyframes.forEach((kf, i) => { 45236 const offset = generatedOffset > 0 ? i == limit ? 1 : generatedOffset * i : offsets[i]; 45237 const durationUpToThisFrame = offset * animateDuration; 45238 context.currentTime = currentTime + currentAnimateTimings.delay + durationUpToThisFrame; 45239 currentAnimateTimings.duration = durationUpToThisFrame; 45240 this._validateStyleAst(kf, context); 45241 kf.offset = offset; 45242 ast.styles.push(kf); 45243 }); 45244 return ast; 45245 } 45246 visitReference(metadata, context) { 45247 return { 45248 type: _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_4__.AnimationMetadataType.Reference, 45249 animation: (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.visitDslNode)(this, (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.normalizeAnimationEntry)(metadata.animation), context), 45250 options: normalizeAnimationOptions(metadata.options) 45251 }; 45252 } 45253 visitAnimateChild(metadata, context) { 45254 context.depCount++; 45255 return { 45256 type: _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_4__.AnimationMetadataType.AnimateChild, 45257 options: normalizeAnimationOptions(metadata.options) 45258 }; 45259 } 45260 visitAnimateRef(metadata, context) { 45261 return { 45262 type: _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_4__.AnimationMetadataType.AnimateRef, 45263 animation: this.visitReference(metadata.animation, context), 45264 options: normalizeAnimationOptions(metadata.options) 45265 }; 45266 } 45267 visitQuery(metadata, context) { 45268 const parentSelector = context.currentQuerySelector; 45269 const options = metadata.options || {}; 45270 context.queryCount++; 45271 context.currentQuery = metadata; 45272 const [selector, includeSelf] = normalizeSelector(metadata.selector); 45273 context.currentQuerySelector = parentSelector.length ? parentSelector + ' ' + selector : selector; 45274 (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.getOrSetDefaultValue)(context.collectedStyles, context.currentQuerySelector, new Map()); 45275 const animation = (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.visitDslNode)(this, (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.normalizeAnimationEntry)(metadata.animation), context); 45276 context.currentQuery = null; 45277 context.currentQuerySelector = parentSelector; 45278 return { 45279 type: _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_4__.AnimationMetadataType.Query, 45280 selector, 45281 limit: options.limit || 0, 45282 optional: !!options.optional, 45283 includeSelf, 45284 animation, 45285 originalSelector: metadata.selector, 45286 options: normalizeAnimationOptions(metadata.options) 45287 }; 45288 } 45289 visitStagger(metadata, context) { 45290 if (!context.currentQuery) { 45291 context.errors.push((0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.invali
45291dStagger)()); 45292 } 45293 const timings = metadata.timings === 'full' ? { 45294 duration: 0, 45295 delay: 0, 45296 easing: 'full' 45297 } : (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.resolveTiming)(metadata.timings, context.errors, true); 45298 return { 45299 type: _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_4__.AnimationMetadataType.Stagger, 45300 animation: (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.visitDslNode)(this, (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.normalizeAnimationEntry)(metadata.animation), context), 45301 timings, 45302 options: null 45303 }; 45304 } 45305} 45306function normalizeSelector(selector) { 45307 const hasAmpersand = selector.split(/\s*,\s*/).find(token => token == SELF_TOKEN) ? true : false; 45308 if (hasAmpersand) { 45309 selector = selector.replace(SELF_TOKEN_REGEX, ''); 45310 } 45311 // Note: the :enter and :leave aren't normalized here since those 45312 // selectors are filled in at runtime during timeline building 45313 selector = selector.replace(/@\*/g, _util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.NG_TRIGGER_SELECTOR).replace(/@\w+/g, match => _util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.NG_TRIGGER_SELECTOR + '-' + match.slice(1)).replace(/:animating/g, _util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.NG_ANIMATING_SELECTOR); 45314 return [selector, hasAmpersand]; 45315} 45316function normalizeParams(obj) { 45317 return obj ? (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1__["default"])({}, obj) : null; 45318} 45319class AnimationAstBuilderContext { 45320 constructor(errors) { 45321 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "errors", void 0); 45322 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "queryCount", 0); 45323 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "depCount", 0); 45324 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "currentTransition", null); 45325 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "currentQuery", null); 45326 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "currentQuerySelector", null); 45327 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "currentAnimateTimings", null); 45328 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "currentTime", 0); 45329 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "collectedStyles", new Map()); 45330 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "options", null); 45331 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "unsupportedCSSPropertiesFound", new Set()); 45332 this.errors = errors; 45333 } 45334} 45335function consumeOffset(styles) { 45336 if (typeof styles == 'string') return null; 45337 let offset = null; 45338 if (Array.isArray(styles)) { 45339 styles.forEach(styleTuple => { 45340 if (styleTuple instanceof Map && styleTuple.has('offset')) { 45341 const obj = styleTuple; 45342 offset = parseFloat(obj.get('offset')); 45343 obj.delete('offset'); 45344 } 45345 }); 45346 } else if (styles instanceof Map && styles.has('offset')) { 45347 const obj = styles; 45348 offset = parseFloat(obj.get('offset')); 45349 obj.delete('offset'); 45350 } 45351 return offset; 45352} 45353function constructTimingAst(value, errors) { 45354 if (value.hasOwnProperty('duration')) { 45355 return value; 45356 } 45357 if (typeof value == 'number') { 45358 const duration = (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.resolveTiming)(value, errors).duration; 45359 return makeTimingAst(duration, 0, ''); 45360 } 45361 const strValue = value; 45362 const isDynamic = strValue.split(/\s+/).some(v => v.charAt(0) == '{' && v.charAt(1) == '{'); 45363 if (isDynamic) { 45364 const ast = makeTimingAst(0, 0, ''); 45365 ast.dynamic = true; 45366 ast.strValue = strValue; 45367 return ast; 45368 } 45369 const timings = (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.resolveTiming)(strValue, errors); 45370 return makeTimingAst(timings.duration, timings.delay, timings.easing); 45371} 45372function normalizeAnimationOptions(options) { 45373 if (options) { 45374 options = (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1__["default"])({}, options); 45375 if (options['params']) { 45376 options['params'] = normalizeParams(options['params']); 45377 } 45378 } else { 45379 options = {}; 45380 } 45381 return options; 45382} 45383function makeTimingAst(duration, delay, easing) { 45384 return { 45385 duration, 45386 delay, 45387 easing 45388 }; 45389}
45390function createTimelineInstruction(element, keyframes, preStyleProps, postStyleProps, duration, delay, easing = null, subTimeline = false) { 45391 return { 45392 type: 1 /* AnimationTransitionInstructionType.TimelineAnimation */, 45393 element, 45394 keyframes, 45395 preStyleProps, 45396 postStyleProps, 45397 duration, 45398 delay, 45399 totalTime: duration + delay, 45400 easing, 45401 subTimeline 45402 }; 45403} 45404class ElementInstructionMap { 45405 constructor() { 45406 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_map", new Map()); 45407 } 45408 get(element) { 45409 return this._map.get(element) || []; 45410 } 45411 append(element, instructions) { 45412 let existingInstructions = this._map.get(element); 45413 if (!existingInstructions) { 45414 this._map.set(element, existingInstructions = []); 45415 } 45416 existingInstructions.push(...instructions); 45417 } 45418 has(element) { 45419 return this._map.has(element); 45420 } 45421 clear() { 45422 this._map.clear(); 45423 } 45424} 45425const ONE_FRAME_IN_MILLISECONDS = 1; 45426const ENTER_TOKEN = ':enter'; 45427const ENTER_TOKEN_REGEX = /* @__PURE__ */new RegExp(ENTER_TOKEN, 'g'); 45428const LEAVE_TOKEN = ':leave'; 45429const LEAVE_TOKEN_REGEX = /* @__PURE__ */new RegExp(LEAVE_TOKEN, 'g'); 45430/* 45431 * The code within this file aims to generate web-animations-compatible keyframes from Angular's 45432 * animation DSL code. 45433 * 45434 * The code below will be converted from: 45435 * 45436 * ```ts 45437 * sequence([ 45438 * style({ opacity: 0 }), 45439 * animate(1000, style({ opacity: 0 })) 45440 * ]) 45441 * ``` 45442 * 45443 * To: 45444 * ```ts 45445 * keyframes = [{ opacity: 0, offset: 0 }, { opacity: 1, offset: 1 }] 45446 * duration = 1000 45447 * delay = 0 45448 * easing = '' 45449 * ``` 45450 * 45451 * For this operation to cover the combination of animation verbs (style, animate, group, etc...) a 45452 * combination of AST traversal and merge-sort-like algorithms are used. 45453 * 45454 * [AST Traversal] 45455 * Each of the animation verbs, when executed, will return an string-map object representing what 45456 * type of action it is (style, animate, group, etc...) and the data associated with it. This means 45457 * that when functional composition mix of these functions is evaluated (like in the example above) 45458 * then it will end up producing a tree of objects representing the animation itself. 45459 * 45460 * When this animation object tree is processed by the visitor code below it will visit each of the 45461 * verb statements within the visitor. And during each visit it will build the context of the 45462 * animation keyframes by interacting with the `TimelineBuilder`. 45463 * 45464 * [TimelineBuilder] 45465 * This class is responsible for tracking the styles and building a series of keyframe objects for a 45466 * timeline between a start and end time. The builder starts off with an initial timeline and each 45467 * time the AST comes across a `group()`, `keyframes()` or a combination of the two within a 45468 * `sequence()` then it will generate a sub timeline for each step as well as a new one after 45469 * they are complete. 45470 * 45471 * As the AST is traversed, the timing state on each of the timelines will be incremented. If a sub 45472 * timeline was created (based on one of the cases above) then the parent timeline will attempt to 45473 * merge the styles used within the sub timelines into itself (only with group() this will happen). 45474 * This happens with a merge operation (much like how the merge works in mergeSort) and it will only 45475 * copy the most recently used styles from the sub timelines into the parent timeline. This ensures 45476 * that if the styles are used later on in another phase of the animation then they will be the most 45477 * up-to-date values. 45478 * 45479 * [How Missing Styles Are Updated] 45480 * Each timeline has a `backFill` property which is responsible for filling in new styles into 45481 * already processed keyframes if a new style shows up later within the animation sequence. 45482 * 45483 * ```ts 45484 * sequence([ 45485 * style({ width: 0 }), 45486 * animate(1000, style({ width: 100 })), 45487 * animate(1000, style({ width: 200 })), 45488 * animate(1000, style({ width: 300 })) 45489 * animate(1000, style({ width: 400, height: 400 })) // notice how `height` doesn't exist anywhere 45490 * else 45491 * ]) 45492 * ``` 45493 * 45494 * What is happening here is that the `height` value is added later in the sequence, but is missing 45495 * from all previous animation steps. Therefore when a keyframe is created it would also be missing 45496 * from all previous keyframes up until where it is first used. For the timeline keyframe generation 45497 * to properly fill in the style it will place the previous value (the value from the parent 45498 * timeline) or a default value of `*` into the backFill map. 45499 * 45500 * When a sub-timeline is created it will have its own backFill property. This is done so that 45501 * styles present within the sub-timeline do not accidentally seep into the previous/future timeline 45502 * keyframes 45503 * 45504 * [Validation] 45505 * The code in this file is not responsible for validation. That functionality happens with within 45506 * the `AnimationValidatorVisitor` code. 45507 */ 45508function buildAnimationTimelines(driver, rootElement, ast, enterClassName, leaveClassName, startingStyles = new Map(), finalStyles = new Map(), options, subInstru
vendor: 1,966 bytes, lines 45508-45539
45508ctions, errors = []) { 45509 return new AnimationTimelineBuilderVisitor().buildKeyframes(driver, rootElement, ast, enterClassName, leaveClassName, startingStyles, finalStyles, options, subInstructions, errors); 45510} 45511class AnimationTimelineBuilderVisitor { 45512 buildKeyframes(driver, rootElement, ast, enterClassName, leaveClassName, startingStyles, finalStyles, options, subInstructions, errors = []) { 45513 subInstructions = subInstructions || new ElementInstructionMap(); 45514 const context = new AnimationTimelineContext(driver, rootElement, subInstructions, enterClassName, leaveClassName, errors, []); 45515 context.options = options; 45516 const delay = options.delay ? (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.resolveTimingValue)(options.delay) : 0; 45517 context.currentTimeline.delayNextStep(delay); 45518 context.currentTimeline.setStyles([startingStyles], null, context.errors, options); 45519 (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.visitDslNode)(this, ast, context); 45520 // this checks to see if an actual animation happened 45521 const timelines = context.timelines.filter(timeline => timeline.containsAnimation()); 45522 // note: we just want to apply the final styles for the rootElement, so we do not 45523 // just apply the styles to the last timeline but the last timeline which 45524 // element is the root one (basically `*`-styles are replaced with the actual 45525 // state style values only for the root element) 45526 if (timelines.length && finalStyles.size) { 45527 let lastRootTimeline; 45528 for (let i = timelines.length - 1; i >= 0; i--) { 45529 const timeline = timelines[i]; 45530 if (timeline.element === rootElement) { 45531 lastRootTimeline = timeline; 45532 break; 45533 } 45534 } 45535 if (lastRootTimeline && !lastRootTimeline.allowOnlyTimelineStyles()) { 45536 lastRootTimeline.setStyles([finalStyles], null, context.errors, options); 45537 } 45538 } 45539 return timelines.length ? timelines.map(timeline =>
45539 timeline.buildKeyframes()) : [createTimelineInstruction(rootElement, [], [], [], 0, delay, '', false)]; 45540 } 45541 visitTrigger(ast, context) { 45542 // these values are not visited in this AST 45543 } 45544 visitState(ast, context) { 45545 // these values are not visited in this AST 45546 } 45547 visitTransition(ast, context) { 45548 // these values are not visited in this AST 45549 } 45550 visitAnimateChild(ast, context) { 45551 const elementInstructions = context.subInstructions.get(context.element); 45552 if (elementInstructions) { 45553 const innerContext = context.createSubContext(ast.options); 45554 const startTime = context.currentTimeline.currentTime; 45555 const endTime = this._visitSubInstructions(elementInstructions, innerContext, innerContext.options); 45556 if (startTime != endTime) { 45557 // we do this on the upper context because we created a sub context for 45558 // the sub child animations 45559 context.transformIntoNewTimeline(endTime); 45560 } 45561 } 45562 context.previousNode = ast; 45563 } 45564 visitAnimateRef(ast, context) { 45565 const innerContext = context.createSubContext(ast.options); 45566 innerContext.transformIntoNewTimeline(); 45567 this._applyAnimationRefDelays([ast.options, ast.animation.options], context, innerContext); 45568 this.visitReference(ast.animation, innerContext); 45569 context.transformIntoNewTimeline(innerContext.currentTimeline.currentTime); 45570 context.previousNode = ast; 45571 } 45572 _applyAnimationRefDelays(animationsRefsOptions, context, innerContext) { 45573 for (const animationRefOptions of animationsRefsOptions) { 45574 const animationDelay = animationRefOptions === null || animationRefOptions === void 0 ? void 0 : animationRefOptions.delay; 45575 if (animationDelay) { 45576 var _animationRefOptions$; 45577 const animationDelayValue = typeof animationDelay === 'number' ? animationDelay : (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.resolveTimingValue)((0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.interpolateParams)(animationDelay, (_animationRefOptions$ = animationRefOptions === null || animationRefOptions === void 0 ? void 0 : animationRefOptions.params) !== null && _animationRefOptions$ !== void 0 ? _animationRefOptions$ : {}, context.errors)); 45578 innerContext.delayNextStep(animationDelayValue); 45579 } 45580 } 45581 } 45582 _visitSubInstructions(instructions, context, options) { 45583 const startTime = context.currentTimeline.currentTime; 45584 let furthestTime = startTime; 45585 // this is a special-case for when a user wants to skip a sub 45586 // animation from being fired entirely. 45587 const duration = options.duration != null ? (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.resolveTimingValue)(options.duration) : null; 45588 const delay = options.delay != null ? (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.resolveTimingValue)(options.delay) : null; 45589 if (duration !== 0) { 45590 instructions.forEach(instruction => { 45591 const instructionTimings = context.appendInstructionToTimeline(instruction, duration, delay); 45592 furthestTime = Math.max(furthestTime, instructionTimings.duration + instructionTimings.delay); 45593 }); 45594 } 45595 return furthestTime; 45596 } 45597 visitReference(ast, context) { 45598 context.updateOptions(ast.options, true); 45599 (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.visitDslNode)(this, ast.animation, context); 45600 context.previousNode = ast; 45601 } 45602 visitSequence(ast, context) { 45603 const subContextCount = context.subContextCount;
vendor: 8,738 bytes, lines 45604-45790
45604 let ctx = context; 45605 const options = ast.options; 45606 if (options && (options.params || options.delay)) { 45607 ctx = context.createSubContext(options); 45608 ctx.transformIntoNewTimeline(); 45609 if (options.delay != null) { 45610 if (ctx.previousNode.type == _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_4__.AnimationMetadataType.Style) { 45611 ctx.currentTimeline.snapshotCurrentStyles(); 45612 ctx.previousNode = DEFAULT_NOOP_PREVIOUS_NODE; 45613 } 45614 const delay = (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.resolveTimingValue)(options.delay); 45615 ctx.delayNextStep(delay); 45616 } 45617 } 45618 if (ast.steps.length) { 45619 ast.steps.forEach(s => (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.visitDslNode)(this, s, ctx)); 45620 // this is here just in case the inner steps only contain or end with a style() call 45621 ctx.currentTimeline.applyStylesToKeyframe(); 45622 // this means that some animation function within the sequence 45623 // ended up creating a sub timeline (which means the current 45624 // timeline cannot overlap with the contents of the sequence) 45625 if (ctx.subContextCount > subContextCount) { 45626 ctx.transformIntoNewTimeline(); 45627 } 45628 } 45629 context.previousNode = ast; 45630 } 45631 visitGroup(ast, context) { 45632 const innerTimelines = []; 45633 let furthestTime = context.currentTimeline.currentTime; 45634 const delay = ast.options && ast.options.delay ? (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.resolveTimingValue)(ast.options.delay) : 0; 45635 ast.steps.forEach(s => { 45636 const innerContext = context.createSubContext(ast.options); 45637 if (delay) { 45638 innerContext.delayNextStep(delay); 45639 } 45640 (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.visitDslNode)(this, s, innerContext); 45641 furthestTime = Math.max(furthestTime, innerContext.currentTimeline.currentTime); 45642 innerTimelines.push(innerContext.currentTimeline); 45643 }); 45644 // this operation is run after the AST loop because otherwise 45645 // if the parent timeline's collected styles were updated then 45646 // it would pass in invalid data into the new-to-be forked items 45647 innerTimelines.forEach(timeline => context.currentTimeline.mergeTimelineCollectedStyles(timeline)); 45648 context.transformIntoNewTimeline(furthestTime); 45649 context.previousNode = ast; 45650 } 45651 _visitTiming(ast, context) { 45652 if (ast.dynamic) { 45653 const strValue = ast.strValue; 45654 const timingValue = context.params ? (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.interpolateParams)(strValue, context.params, context.errors) : strValue; 45655 return (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.resolveTiming)(timingValue, context.errors); 45656 } else { 45657 return { 45658 duration: ast.duration, 45659 delay: ast.delay, 45660 easing: ast.easing 45661 }; 45662 } 45663 } 45664 visitAnimate(ast, context) { 45665 const timings = context.currentAnimateTimings = this._visitTiming(ast.timings, context); 45666 const timeline = context.currentTimeline; 45667 if (timings.delay) { 45668 context.incrementTime(timings.delay); 45669 timeline.snapshotCurrentStyles(); 45670 } 45671 const style = ast.style; 45672 if (style.type == _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_4__.AnimationMetadataType.Keyframes) { 45673 this.visitKeyframes(style, context); 45674 } else { 45675 context.incrementTime(timings.duration); 45676 this.visitStyle(style, context); 45677 timeline.applyStylesToKeyframe(); 45678 } 45679 context.currentAnimateTimings = null; 45680 context.previousNode = ast; 45681 } 45682 visitStyle(ast, context) { 45683 const timeline = context.currentTimeline; 45684 const timings = context.currentAnimateTimings; 45685 // this is a special case for when a style() call 45686 // directly follows an animate() call (but not inside of an animate() call) 45687 if (!timings && timeline.hasCurrentStyleProperties()) { 45688 timeline.forwardFrame(); 45689 } 45690 const easing = timings && timings.easing || ast.easing; 45691 if (ast.isEmptyStep) { 45692 timeline.applyEmptyStep(easing); 45693 } else { 45694 timeline.setStyles(ast.styles, easing, context.errors, context.options); 45695 } 45696 context.previousNode = ast; 45697 } 45698 visitKeyframes(ast, context) { 45699 const currentAnimateTimings = context.currentAnimateTimings; 45700 const startTime = context.currentTimeline.duration; 45701 const duration = currentAnimateTimings.duration; 45702 const innerContext = context.createSubContext(); 45703 const innerTimeline = innerContext.currentTimeline; 45704 innerTimeline.easing = currentAnimateTimings.easing; 45705 ast.styles.forEach(step => { 45706 const offset = step.offset || 0; 45707 innerTimeline.forwardTime(offset * duration); 45708 innerTimeline.setStyles(step.styles, step.easing, context.errors, context.options); 45709 innerTimeline.applyStylesToKeyframe(); 45710 }); 45711 // this will ensure that the parent timeline gets all the styles from 45712 // the child even if the new timeline below is not used 45713 context.currentTimeline.mergeTimelineCollectedStyles(innerTimeline); 45714 // we do this because the window between this timeline and the sub timeline 45715 // should ensure that the styles within are exactly the same as they were before 45716 context.transformIntoNewTimeline(startTime + duration); 45717 context.previousNode = ast; 45718 } 45719 visitQuery(ast, context) { 45720 // in the event that the first step before this is a style step we need 45721 // to ensure the styles are applied before the children are animated 45722 const startTime = context.currentTimeline.currentTime; 45723 const options = ast.options || {}; 45724 const delay = options.delay ? (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.resolveTimingValue)(options.delay) : 0; 45725 if (delay && (context.previousNode.type === _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_4__.AnimationMetadataType.Style || startTime == 0 && context.currentTimeline.hasCurrentStyleProperties())) { 45726 context.currentTimeline.snapshotCurrentStyles(); 45727 context.previousNode = DEFAULT_NOOP_PREVIOUS_NODE; 45728 } 45729 let furthestTime = startTime; 45730 const elms = context.invokeQuery(ast.selector, ast.originalSelector, ast.limit, ast.includeSelf, options.optional ? true : false, context.errors); 45731 context.currentQueryTotal = elms.length; 45732 let sameElementTimeline = null; 45733 elms.forEach((element, i) => { 45734 context.currentQueryIndex = i; 45735 const innerContext = context.createSubContext(ast.options, element); 45736 if (delay) { 45737 innerContext.delayNextStep(delay); 45738 } 45739 if (element === context.element) { 45740 sameElementTimeline = innerContext.currentTimeline; 45741 } 45742 (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.visitDslNode)(this, ast.animation, innerContext); 45743 // this is here just incase the inner steps only contain or end 45744 // with a style() call (which is here to signal that this is a preparatory 45745 // call to style an element before it is animated again) 45746 innerContext.currentTimeline.applyStylesToKeyframe(); 45747 const endTime = innerContext.currentTimeline.currentTime; 45748 furthestTime = Math.max(furthestTime, endTime); 45749 }); 45750 context.currentQueryIndex = 0; 45751 context.currentQueryTotal = 0; 45752 context.transformIntoNewTimeline(furthestTime); 45753 if (sameElementTimeline) { 45754 context.currentTimeline.mergeTimelineCollectedStyles(sameElementTimeline); 45755 context.currentTimeline.snapshotCurrentStyles(); 45756 } 45757 context.previousNode = ast; 45758 } 45759 visitStagger(ast, context) { 45760 const parentContext = context.parentContext; 45761 const tl = context.currentTimeline; 45762 const timings = ast.timings; 45763 const duration = Math.abs(timings.duration); 45764 const maxTime = duration * (context.currentQueryTotal - 1); 45765 let delay = duration * context.currentQueryIndex; 45766 let staggerTransformer = timings.duration < 0 ? 'reverse' : timings.easing; 45767 switch (staggerTransformer) { 45768 case 'reverse': 45769 delay = maxTime - delay; 45770 break; 45771 case 'full': 45772 delay = parentContext.currentStaggerTime; 45773 break; 45774 } 45775 const timeline = context.currentTimeline; 45776 if (delay) { 45777 timeline.delayNextStep(delay); 45778 } 45779 const startingTime = timeline.currentTime; 45780 (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.visitDslNode)(this, ast.animation, context); 45781 context.previousNode = ast; 45782 // time = duration + delay 45783 // the reason why this computation is so complex is because 45784 // the inner timeline may either have a delay value or a stretched 45785 // keyframe depending on if a subtimeline is not used or is used. 45786 parentContext.currentStaggerTime = tl.currentTime - startingTime + (tl.startTime - parentContext.currentTimeline.startTime); 45787 } 45788} 45789const DEFAULT_NOOP_PREVIOUS_NODE = {}; 45790class AnimationTimelineContext {
45791 constructor(_driver, element, subInstructions, _enterClassName, _leaveClassName, errors, timelines, initialTimeline) { 45792 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_driver", void 0); 45793 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "element", void 0); 45794 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "subInstructions", void 0); 45795 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_enterClassName", void 0); 45796 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_leaveClassName", void 0); 45797 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "errors", void 0); 45798 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "timelines", void 0); 45799 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "parentContext", null); 45800 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "currentTimeline", void 0); 45801 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "currentAnimateTimings", null); 45802 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "previousNode", DEFAULT_NOOP_PREVIOUS_NODE); 45803 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "subContextCount", 0); 45804 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "options", {}); 45805 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "currentQueryIndex", 0); 45806 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "currentQueryTotal", 0); 45807 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "currentStaggerTime", 0); 45808 this._driver = _driver; 45809 this.element = element; 45810 this.subInstructions = subInstructions; 45811 this._enterClassName = _enterClassName; 45812 this._leaveClassName = _leaveClassName; 45813 this.errors = errors; 45814 this.timelines = timelines; 45815 this.currentTimeline = initialTimeline || new TimelineBuilder(this._driver, element, 0); 45816 timelines.push(this.currentTimeline); 45817 } 45818 get params() { 45819 return this.options.params; 45820 } 45821 updateOptions(options, skipIfExists) { 45822 if (!options) return; 45823 const newOptions = options; 45824 let optionsToUpdate = this.options; 45825 // NOTE: this will get patched up when other animation methods support duration overrides 45826 if (newOptions.duration != null) { 45827 optionsToUpdate.duration = (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.resolveTimingValue)(newOptions.duration); 45828 } 45829 if (newOptions.delay != null) { 45830 optionsToUpdate.delay = (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.resolveTimingValue)(newOptions.delay); 45831 } 45832 const newParams = newOptions.params; 45833 if (newParams) { 45834 let paramsToUpdate = optionsToUpdate.params; 45835 if (!paramsToUpdate) { 45836 paramsToUpdate = this.options.params = {}; 45837 }
vendor: 16,320 bytes, lines 45838-46179
45838 Object.keys(newParams).forEach(name => { 45839 if (!skipIfExists || !paramsToUpdate.hasOwnProperty(name)) { 45840 paramsToUpdate[name] = (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.interpolateParams)(newParams[name], paramsToUpdate, this.errors); 45841 } 45842 }); 45843 } 45844 } 45845 _copyOptions() { 45846 const options = {}; 45847 if (this.options) { 45848 const oldParams = this.options.params; 45849 if (oldParams) { 45850 const params = options['params'] = {}; 45851 Object.keys(oldParams).forEach(name => { 45852 params[name] = oldParams[name]; 45853 }); 45854 } 45855 } 45856 return options; 45857 } 45858 createSubContext(options = null, element, newTime) { 45859 const target = element || this.element; 45860 const context = new AnimationTimelineContext(this._driver, target, this.subInstructions, this._enterClassName, this._leaveClassName, this.errors, this.timelines, this.currentTimeline.fork(target, newTime || 0)); 45861 context.previousNode = this.previousNode; 45862 context.currentAnimateTimings = this.currentAnimateTimings; 45863 context.options = this._copyOptions(); 45864 context.updateOptions(options); 45865 context.currentQueryIndex = this.currentQueryIndex; 45866 context.currentQueryTotal = this.currentQueryTotal; 45867 context.parentContext = this; 45868 this.subContextCount++; 45869 return context; 45870 } 45871 transformIntoNewTimeline(newTime) { 45872 this.previousNode = DEFAULT_NOOP_PREVIOUS_NODE; 45873 this.currentTimeline = this.currentTimeline.fork(this.element, newTime); 45874 this.timelines.push(this.currentTimeline); 45875 return this.currentTimeline; 45876 } 45877 appendInstructionToTimeline(instruction, duration, delay) { 45878 const updatedTimings = { 45879 duration: duration != null ? duration : instruction.duration, 45880 delay: this.currentTimeline.currentTime + (delay != null ? delay : 0) + instruction.delay, 45881 easing: '' 45882 }; 45883 const builder = new SubTimelineBuilder(this._driver, instruction.element, instruction.keyframes, instruction.preStyleProps, instruction.postStyleProps, updatedTimings, instruction.stretchStartingKeyframe); 45884 this.timelines.push(builder); 45885 return updatedTimings; 45886 } 45887 incrementTime(time) { 45888 this.currentTimeline.forwardTime(this.currentTimeline.duration + time); 45889 } 45890 delayNextStep(delay) { 45891 // negative delays are not yet supported 45892 if (delay > 0) { 45893 this.currentTimeline.delayNextStep(delay); 45894 } 45895 } 45896 invokeQuery(selector, originalSelector, limit, includeSelf, optional, errors) { 45897 let results = []; 45898 if (includeSelf) { 45899 results.push(this.element); 45900 } 45901 if (selector.length > 0) { 45902 // only if :self is used then the selector can be empty 45903 selector = selector.replace(ENTER_TOKEN_REGEX, '.' + this._enterClassName); 45904 selector = selector.replace(LEAVE_TOKEN_REGEX, '.' + this._leaveClassName); 45905 const multi = limit != 1; 45906 let elements = this._driver.query(this.element, selector, multi); 45907 if (limit !== 0) { 45908 elements = limit < 0 ? elements.slice(elements.length + limit, elements.length) : elements.slice(0, limit); 45909 } 45910 results.push(...elements); 45911 } 45912 if (!optional && results.length == 0) { 45913 errors.push((0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.invalidQuery)(originalSelector)); 45914 } 45915 return results; 45916 } 45917} 45918class TimelineBuilder { 45919 constructor(_driver, element, startTime, _elementTimelineStylesLookup) { 45920 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_driver", void 0); 45921 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "element", void 0); 45922 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "startTime", void 0); 45923 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_elementTimelineStylesLookup", void 0); 45924 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "duration", 0); 45925 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "easing", null); 45926 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_previousKeyframe", new Map()); 45927 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_currentKeyframe", new Map()); 45928 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_keyframes", new Map()); 45929 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_styleSummary", new Map()); 45930 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_localTimelineStyles", new Map()); 45931 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_globalTimelineStyles", void 0); 45932 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_pendingStyles", new Map()); 45933 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_backFill", new Map()); 45934 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_currentEmptyStepKeyframe", null); 45935 this._driver = _driver; 45936 this.element = element; 45937 this.startTime = startTime; 45938 this._elementTimelineStylesLookup = _elementTimelineStylesLookup; 45939 if (!this._elementTimelineStylesLookup) { 45940 this._elementTimelineStylesLookup = new Map(); 45941 } 45942 this._globalTimelineStyles = this._elementTimelineStylesLookup.get(element); 45943 if (!this._globalTimelineStyles) { 45944 this._globalTimelineStyles = this._localTimelineStyles; 45945 this._elementTimelineStylesLookup.set(element, this._localTimelineStyles); 45946 } 45947 this._loadKeyframe(); 45948 } 45949 containsAnimation() { 45950 switch (this._keyframes.size) { 45951 case 0: 45952 return false; 45953 case 1: 45954 return this.hasCurrentStyleProperties(); 45955 default: 45956 return true; 45957 } 45958 } 45959 hasCurrentStyleProperties() { 45960 return this._currentKeyframe.size > 0; 45961 } 45962 get currentTime() { 45963 return this.startTime + this.duration; 45964 } 45965 delayNextStep(delay) { 45966 // in the event that a style() step is placed right before a stagger() 45967 // and that style() step is the very first style() value in the animation 45968 // then we need to make a copy of the keyframe [0, copy, 1] so that the delay 45969 // properly applies the style() values to work with the stagger... 45970 const hasPreStyleStep = this._keyframes.size === 1 && this._pendingStyles.size; 45971 if (this.duration || hasPreStyleStep) { 45972 this.forwardTime(this.currentTime + delay); 45973 if (hasPreStyleStep) { 45974 this.snapshotCurrentStyles(); 45975 } 45976 } else { 45977 this.startTime += delay; 45978 } 45979 } 45980 fork(element, currentTime) { 45981 this.applyStylesToKeyframe(); 45982 return new TimelineBuilder(this._driver, element, currentTime || this.currentTime, this._elementTimelineStylesLookup); 45983 } 45984 _loadKeyframe() { 45985 if (this._currentKeyframe) { 45986 this._previousKeyframe = this._currentKeyframe; 45987 } 45988 this._currentKeyframe = this._keyframes.get(this.duration); 45989 if (!this._currentKeyframe) { 45990 this._currentKeyframe = new Map(); 45991 this._keyframes.set(this.duration, this._currentKeyframe); 45992 } 45993 } 45994 forwardFrame() { 45995 this.duration += ONE_FRAME_IN_MILLISECONDS; 45996 this._loadKeyframe(); 45997 } 45998 forwardTime(time) { 45999 this.applyStylesToKeyframe(); 46000 this.duration = time; 46001 this._loadKeyframe(); 46002 } 46003 _updateStyle(prop, value) { 46004 this._localTimelineStyles.set(prop, value); 46005 this._globalTimelineStyles.set(prop, value); 46006 this._styleSummary.set(prop, { 46007 time: this.currentTime, 46008 value 46009 }); 46010 } 46011 allowOnlyTimelineStyles() { 46012 return this._currentEmptyStepKeyframe !== this._currentKeyframe; 46013 } 46014 applyEmptyStep(easing) { 46015 if (easing) { 46016 this._previousKeyframe.set('easing', easing); 46017 } 46018 // special case for animate(duration): 46019 // all missing styles are filled with a `*` value then 46020 // if any destination styles are filled in later on the same 46021 // keyframe then they will override the overridden styles 46022 // We use `_globalTimelineStyles` here because there may be 46023 // styles in previous keyframes that are not present in this timeline 46024 for (let [prop, value] of this._globalTimelineStyles) { 46025 this._backFill.set(prop, value || _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_4__.AUTO_STYLE); 46026 this._currentKeyframe.set(prop, _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_4__.AUTO_STYLE); 46027 } 46028 this._currentEmptyStepKeyframe = this._currentKeyframe; 46029 } 46030 setStyles(input, easing, errors, options) { 46031 if (easing) { 46032 this._previousKeyframe.set('easing', easing); 46033 } 46034 const params = options && options.params || {}; 46035 const styles = flattenStyles(input, this._globalTimelineStyles); 46036 for (let [prop, value] of styles) { 46037 const val = (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.interpolateParams)(value, params, errors); 46038 this._pendingStyles.set(prop, val); 46039 if (!this._localTimelineStyles.has(prop)) { 46040 var _this$_globalTimeline; 46041 this._backFill.set(prop, (_this$_globalTimeline = this._globalTimelineStyles.get(prop)) !== null && _this$_globalTimeline !== void 0 ? _this$_globalTimeline : _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_4__.AUTO_STYLE); 46042 } 46043 this._updateStyle(prop, val); 46044 } 46045 } 46046 applyStylesToKeyframe() { 46047 if (this._pendingStyles.size == 0) return; 46048 this._pendingStyles.forEach((val, prop) => { 46049 this._currentKeyframe.set(prop, val); 46050 }); 46051 this._pendingStyles.clear(); 46052 this._localTimelineStyles.forEach((val, prop) => { 46053 if (!this._currentKeyframe.has(prop)) { 46054 this._currentKeyframe.set(prop, val); 46055 } 46056 }); 46057 } 46058 snapshotCurrentStyles() { 46059 for (let [prop, val] of this._localTimelineStyles) { 46060 this._pendingStyles.set(prop, val); 46061 this._updateStyle(prop, val); 46062 } 46063 } 46064 getFinalKeyframe() { 46065 return this._keyframes.get(this.duration); 46066 } 46067 get properties() { 46068 const properties = []; 46069 for (let prop in this._currentKeyframe) { 46070 properties.push(prop); 46071 } 46072 return properties; 46073 } 46074 mergeTimelineCollectedStyles(timeline) { 46075 timeline._styleSummary.forEach((details1, prop) => { 46076 const details0 = this._styleSummary.get(prop); 46077 if (!details0 || details1.time > details0.time) { 46078 this._updateStyle(prop, details1.value); 46079 } 46080 }); 46081 } 46082 buildKeyframes() { 46083 this.applyStylesToKeyframe(); 46084 const preStyleProps = new Set(); 46085 const postStyleProps = new Set(); 46086 const isEmpty = this._keyframes.size === 1 && this.duration === 0; 46087 let finalKeyframes = []; 46088 this._keyframes.forEach((keyframe, time) => { 46089 const finalKeyframe = new Map([...this._backFill, ...keyframe]); 46090 finalKeyframe.forEach((value, prop) => { 46091 if (value === _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_4__["ɵPRE_STYLE"]) { 46092 preStyleProps.add(prop); 46093 } else if (value === _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_4__.AUTO_STYLE) { 46094 postStyleProps.add(prop); 46095 } 46096 }); 46097 if (!isEmpty) { 46098 finalKeyframe.set('offset', time / this.duration); 46099 } 46100 finalKeyframes.push(finalKeyframe); 46101 }); 46102 const preProps = [...preStyleProps.values()]; 46103 const postProps = [...postStyleProps.values()]; 46104 // special case for a 0-second animation (which is designed just to place styles onscreen) 46105 if (isEmpty) { 46106 const kf0 = finalKeyframes[0]; 46107 const kf1 = new Map(kf0); 46108 kf0.set('offset', 0); 46109 kf1.set('offset', 1); 46110 finalKeyframes = [kf0, kf1]; 46111 } 46112 return createTimelineInstruction(this.element, finalKeyframes, preProps, postProps, this.duration, this.startTime, this.easing, false); 46113 } 46114} 46115class SubTimelineBuilder extends TimelineBuilder { 46116 constructor(driver, element, keyframes, preStyleProps, postStyleProps, timings, _stretchStartingKeyframe = false) { 46117 super(driver, element, timings.delay); 46118 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "keyframes", void 0); 46119 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "preStyleProps", void 0); 46120 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "postStyleProps", void 0); 46121 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_stretchStartingKeyframe", void 0); 46122 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "timings", void 0); 46123 this.keyframes = keyframes; 46124 this.preStyleProps = preStyleProps; 46125 this.postStyleProps = postStyleProps; 46126 this._stretchStartingKeyframe = _stretchStartingKeyframe; 46127 this.timings = { 46128 duration: timings.duration, 46129 delay: timings.delay, 46130 easing: timings.easing 46131 }; 46132 } 46133 containsAnimation() { 46134 return this.keyframes.length > 1; 46135 } 46136 buildKeyframes() { 46137 let keyframes = this.keyframes; 46138 let { 46139 delay, 46140 duration, 46141 easing 46142 } = this.timings; 46143 if (this._stretchStartingKeyframe && delay) { 46144 const newKeyframes = []; 46145 const totalTime = duration + delay; 46146 const startingGap = delay / totalTime; 46147 // the original starting keyframe now starts once the delay is done 46148 const newFirstKeyframe = new Map(keyframes[0]); 46149 newFirstKeyframe.set('offset', 0); 46150 newKeyframes.push(newFirstKeyframe); 46151 const oldFirstKeyframe = new Map(keyframes[0]); 46152 oldFirstKeyframe.set('offset', roundOffset(startingGap)); 46153 newKeyframes.push(oldFirstKeyframe); 46154 /* 46155 When the keyframe is stretched then it means that the delay before the animation 46156 starts is gone. Instead the first keyframe is placed at the start of the animation 46157 and it is then copied to where it starts when the original delay is over. This basically 46158 means nothing animates during that delay, but the styles are still rendered. For this 46159 to work the original offset values that exist in the original keyframes must be "warped" 46160 so that they can take the new keyframe + delay into account. 46161 delay=1000, duration=1000, keyframes = 0 .5 1 46162 turns into 46163 delay=0, duration=2000, keyframes = 0 .33 .66 1 46164 */ 46165 // offsets between 1 ... n -1 are all warped by the keyframe stretch 46166 const limit = keyframes.length - 1; 46167 for (let i = 1; i <= limit; i++) { 46168 let kf = new Map(keyframes[i]); 46169 const oldOffset = kf.get('offset'); 46170 const timeAtKeyframe = delay + oldOffset * duration; 46171 kf.set('offset', roundOffset(timeAtKeyframe / totalTime)); 46172 newKeyframes.push(kf); 46173 } 46174 // the new starting keyframe should be added at the start 46175 duration = totalTime; 46176 delay = 0; 46177 easing = ''; 46178 keyframes = newKeyframes; 46179 }
46180 return createTimelineInstruction(this.element, keyframes, this.preStyleProps, this.postStyleProps, duration, delay, easing, true); 46181 } 46182} 46183function roundOffset(offset, decimalPoints = 3) { 46184 const mult = Math.pow(10, decimalPoints - 1); 46185 return Math.round(offset * mult) / mult; 46186} 46187function flattenStyles(input, allStyles) { 46188 const styles = new Map(); 46189 let allProperties; 46190 input.forEach(token => { 46191 if (token === '*') { 46192 allProperties !== null && allProperties !== void 0 ? allProperties : allProperties = allStyles.keys(); 46193 for (let prop of allProperties) { 46194 styles.set(prop, _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_4__.AUTO_STYLE); 46195 } 46196 } else { 46197 for (let [prop, val] of token) { 46198 styles.set(prop, val); 46199 } 46200 } 46201 }); 46202 return styles; 46203} 46204function createTransitionInstruction(element, triggerName, fromState, toState, isRemovalTransition, fromStyles, toStyles, timelines, queriedElements, preStyleProps, postStyleProps, totalTime, errors) { 46205 return { 46206 type: 0 /* AnimationTransitionInstructionType.TransitionAnimation */, 46207 element, 46208 triggerName, 46209 isRemovalTransition, 46210 fromState, 46211 fromStyles, 46212 toState, 46213 toStyles, 46214 timelines, 46215 queriedElements, 46216 preStyleProps, 46217 postStyleProps, 46218 totalTime, 46219 errors 46220 }; 46221} 46222const EMPTY_OBJECT = {}; 46223class AnimationTransitionFactory { 46224 constructor(_triggerName, ast, _stateStyles) { 46225 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_triggerName", void 0); 46226 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "ast", void 0); 46227 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_stateStyles", void 0); 46228 this._triggerName = _triggerName; 46229 this.ast = ast; 46230 this._stateStyles = _stateStyles; 46231 } 46232 match(currentState, nextState, element, params) { 46233 return oneOrMoreTransitionsMatch(this.ast.matchers, currentState, nextState, element, params); 46234 } 46235 buildStyles(stateName, params, errors) { 46236 let styler = this._stateStyles.get('*'); 46237 if (stateName !== undefined) { 46238 styler = this._stateStyles.get(stateName === null || stateName === void 0 ? void 0 : stateName.toString()) || styler; 46239 } 46240 return styler ? styler.buildStyles(params, errors) : new Map(); 46241 } 46242 build(driver, element, currentState, nextState, enterClassName, leaveClassName, currentOptions, nextOptions, subInstructions, skipAstBuild) { 46243 var _this$ast$options; 46244 const errors = []; 46245 const transitionAnimationParams = this.ast.options && this.ast.options.params || EMPTY_OBJECT; 46246 const currentAnimationParams = currentOptions && currentOptions.params || EMPTY_OBJECT; 46247 const currentStateStyles = this.buildStyles(currentState, currentAnimationParams, errors); 46248 const nextAnimationParams = nextOptions && nextOptions.params || EMPTY_OBJECT; 46249 const nextStateStyles = this.buildStyles(nextState, nextAnimationParams, errors); 46250 const queriedElements = new Set(); 46251 const preStyleMap = new Map(); 46252 const postStyleMap = new Map(); 46253 const isRemoval = nextState === 'void'; 46254 const animationOptions = { 46255 params: applyParamDefaults(nextAnimationParams, transitionAnimationParams), 46256 delay: (_this$ast$options = this.ast.options) === null || _this$ast$options === void 0 ? void 0 : _this$ast$options.delay 46257 }; 46258 const timelines = skipAstBuild ? [] : buildAnimationTimelines(driver, element, this.ast.animation, enterClassName, leaveClassName, currentStateStyles, nextStateStyles, animationOptions, subInstructions, errors); 46259 let totalTime = 0; 46260 timelines.forEach(tl => { 46261 totalTime = Math.max(tl.duration + tl.delay, totalTime); 46262 }); 46263 if (errors.length) { 46264 return createTransitionInstruction(element, this._triggerName, currentState, nextState, isRemoval, currentStateStyles, nextStateStyles, [], [], preStyleMap, postStyleMap, totalTime, errors); 46265 }
46266 timelines.forEach(tl => { 46267 const elm = tl.element; 46268 const preProps = (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.getOrSetDefaultValue)(preStyleMap, elm, new Set()); 46269 tl.preStyleProps.forEach(prop => preProps.add(prop)); 46270 const postProps = (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.getOrSetDefaultValue)(postStyleMap, elm, new Set()); 46271 tl.postStyleProps.forEach(prop => postProps.add(prop)); 46272 if (elm !== element) { 46273 queriedElements.add(elm); 46274 } 46275 }); 46276 if (typeof ngDevMode === 'undefined' || ngDevMode) { 46277 checkNonAnimatableInTimelines(timelines, this._triggerName, driver); 46278 } 46279 return createTransitionInstruction(element, this._triggerName, currentState, nextState, isRemoval, currentStateStyles, nextStateStyles, timelines, [...queriedElements.values()], preStyleMap, postStyleMap, totalTime); 46280 } 46281} 46282/** 46283 * Checks inside a set of timelines if they try to animate a css property which is not considered 46284 * animatable, in that case it prints a warning on the console. 46285 * Besides that the function doesn't have any other effect. 46286 * 46287 * Note: this check is done here after the timelines are built instead of doing on a lower level so 46288 * that we can make sure that the warning appears only once per instruction (we can aggregate here 46289 * all the issues instead of finding them separately). 46290 * 46291 * @param timelines The built timelines for the current instruction. 46292 * @param triggerName The name of the trigger for the current instruction. 46293 * @param driver Animation driver used to perform the check. 46294 * 46295 */ 46296function checkNonAnimatableInTimelines(timelines, triggerName, driver) { 46297 if (!driver.validateAnimatableStyleProperty) { 46298 return; 46299 } 46300 const allowedNonAnimatableProps = new Set([ 46301 // 'easing' is a utility/synthetic prop we use to represent 46302 // easing functions, it represents a property of the animation 46303 // which is not animatable but different values can be used 46304 // in different steps 46305 'easing']); 46306 const invalidNonAnimatableProps = new Set(); 46307 timelines.forEach(({ 46308 keyframes 46309 }) => { 46310 const nonAnimatablePropsInitialValues = new Map(); 46311 keyframes.forEach(keyframe => { 46312 const entriesToCheck = Array.from(keyframe.entries()).filter(([prop]) => !allowedNonAnimatableProps.has(prop)); 46313 for (const [prop, value] of entriesToCheck) { 46314 if (!driver.validateAnimatableStyleProperty(prop)) { 46315 if (nonAnimatablePropsInitialValues.has(prop) && !invalidNonAnimatableProps.has(prop)) { 46316 const propInitialValue = nonAnimatablePropsInitialValues.get(prop); 46317 if (propInitialValue !== value) { 46318 invalidNonAnimatableProps.add(prop); 46319 } 46320 } else { 46321 nonAnimatablePropsInitialValues.set(prop, value); 46322 } 46323 } 46324 } 46325 }); 46326 }); 46327 if (invalidNonAnimatableProps.size > 0) { 46328 console.warn(`Warning: The animation trigger "${triggerName}" is attempting to animate the following` + ' not animatable properties: ' + Array.from(invalidNonAnimatableProps).join(', ') + '\n' + '(to check the list of all animatable properties visit https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_animated_properties)'); 46329 } 46330} 46331function oneOrMoreTransitionsMatch(matchFns, currentState, nextState, element, params) { 46332 return matchFns.some(fn => fn(currentState, nextState, element, params)); 46333} 46334function applyParamDefaults(userParams, defaults) { 46335 const result = (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_1__["default"])({}, defaults); 46336 Object.entries(userParams).forEach(([key, value]) => { 46337 if (value != null) { 46338 result[key] = value; 46339 } 46340 }); 46341 return result; 46342} 46343class AnimationStateStyles { 46344 constructor(styles, defaultParams, normalizer) { 46345 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "styles", void 0); 46346 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "defaultParams", void 0); 46347 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "normalizer", void 0); 46348 this.styles = styles; 46349 this.defaultParams = defaultParams; 46350 this.normalizer = normalizer; 46351 } 46352 buildStyles(params, errors) { 46353 const finalStyles = new Map(); 46354 const combinedParams = applyParamDefaults(params, this.defaultParams);
46355 this.styles.styles.forEach(value => { 46356 if (typeof value !== 'string') { 46357 value.forEach((val, prop) => { 46358 if (val) { 46359 val = (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.interpolateParams)(val, combinedParams, errors); 46360 } 46361 const normalizedProp = this.normalizer.normalizePropertyName(prop, errors); 46362 val = this.normalizer.normalizeStyleValue(prop, normalizedProp, val, errors); 46363 finalStyles.set(prop, val); 46364 }); 46365 } 46366 }); 46367 return finalStyles; 46368 } 46369} 46370function buildTrigger(name, ast, normalizer) { 46371 return new AnimationTrigger(name, ast, normalizer); 46372} 46373class AnimationTrigger { 46374 constructor(name, ast, _normalizer) { 46375 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "name", void 0); 46376 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "ast", void 0); 46377 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_normalizer", void 0); 46378 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "transitionFactories", []); 46379 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "fallbackTransition", void 0); 46380 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "states", new Map()); 46381 this.name = name; 46382 this.ast = ast; 46383 this._normalizer = _normalizer; 46384 ast.states.forEach(ast => { 46385 const defaultParams = ast.options && ast.options.params || {}; 46386 this.states.set(ast.name, new AnimationStateStyles(ast.style, defaultParams, _normalizer)); 46387 }); 46388 balanceProperties(this.states, 'true', '1'); 46389 balanceProperties(this.states, 'false', '0'); 46390 ast.transitions.forEach(ast => { 46391 this.transitionFactories.push(new AnimationTransitionFactory(name, ast, this.states)); 46392 }); 46393 this.fallbackTransition = createFallbackTransition(name, this.states); 46394 } 46395 get containsQueries() { 46396 return this.ast.queryCount > 0; 46397 } 46398 matchTransition(currentState, nextState, element, params) { 46399 const entry = this.transitionFactories.find(f => f.match(currentState, nextState, element, params)); 46400 return entry || null; 46401 } 46402 matchStyles(currentState, params, errors) { 46403 return this.fallbackTransition.buildStyles(currentState, params, errors); 46404 } 46405} 46406function createFallbackTransition(triggerName, states, normalizer) { 46407 const matchers = [(fromState, toState) => true]; 46408 const animation = { 46409 type: _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_4__.AnimationMetadataType.Sequence, 46410 steps: [], 46411 options: null 46412 }; 46413 const transition = { 46414 type: _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_4__.AnimationMetadataType.Transition, 46415 animation, 46416 matchers, 46417 options: null, 46418 queryCount: 0, 46419 depCount: 0 46420 }; 46421 return new AnimationTransitionFactory(triggerName, transition, states); 46422} 46423function balanceProperties(stateMap, key1, key2) { 46424 if (stateMap.has(key1)) { 46425 if (!stateMap.has(key2)) { 46426 stateMap.set(key2, stateMap.get(key1)); 46427 } 46428 } else if (stateMap.has(key2)) { 46429 stateMap.set(key1, stateMap.get(key2)); 46430 } 46431} 46432const EMPTY_INSTRUCTION_MAP = /* @__PURE__ */new ElementInstructionMap(); 46433class TimelineAnimationEngine { 46434 constructor(bodyNode, _driver, _normalizer) { 46435 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "bodyNode", void 0); 46436 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_driver", void 0); 46437 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_normalizer", void 0); 46438 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_animations", new Map()); 46439 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_playersById", new Map()); 46440 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "players", []); 46441 this.bodyNode = bodyNode; 46442 this._driver = _driver; 46443 this._normalizer = _normalizer; 46444 } 46445 register(id, metadata) { 46446 const errors = []; 46447 const warnings = []; 46448 const ast = buildAnimationAst(this._driver, metadata, errors, warnings); 46449 if (errors.length) { 46450 throw (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.registerFailed)(errors); 46451 } else { 46452 if (typeof ngDevMode === 'undefined' || ngDevMode) { 46453 if (warnings.length) { 46454 warnRegister(warnings); 46455 } 46456 } 46457 this._animations.set(id, ast); 46458 } 46459 } 46460 _buildPlayer(i, preStyles, postStyles) { 46461 const element = i.element;
46462 const keyframes = (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.normalizeKeyframes)(this._normalizer, i.keyframes, preStyles, postStyles); 46463 return this._driver.animate(element, keyframes, i.duration, i.delay, i.easing, [], true); 46464 } 46465 create(id, element, options = {}) { 46466 const errors = []; 46467 const ast = this._animations.get(id); 46468 let instructions; 46469 const autoStylesMap = new Map(); 46470 if (ast) { 46471 instructions = buildAnimationTimelines(this._driver, element, ast, _util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.ENTER_CLASSNAME, _util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.LEAVE_CLASSNAME, new Map(), new Map(), options, EMPTY_INSTRUCTION_MAP, errors); 46472 instructions.forEach(inst => { 46473 const styles = (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.getOrSetDefaultValue)(autoStylesMap, inst.element, new Map()); 46474 inst.postStyleProps.forEach(prop => styles.set(prop, null)); 46475 }); 46476 } else { 46477 errors.push((0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.missingOrDestroyedAnimation)()); 46478 instructions = []; 46479 } 46480 if (errors.length) { 46481 throw (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.createAnimationFailed)(errors); 46482 } 46483 autoStylesMap.forEach((styles, element) => { 46484 styles.forEach((_, prop) => { 46485 styles.set(prop, this._driver.computeStyle(element, prop, _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_4__.AUTO_STYLE)); 46486 }); 46487 }); 46488 const players = instructions.map(i => { 46489 const styles = autoStylesMap.get(i.element); 46490 return this._buildPlayer(i, new Map(), styles); 46491 }); 46492 const player = (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.optimizeGroupPlayer)(players); 46493 this._playersById.set(id, player); 46494 player.onDestroy(() => this.destroy(id)); 46495 this.players.push(player); 46496 return player; 46497 } 46498 destroy(id) { 46499 const player = this._getPlayer(id); 46500 player.destroy(); 46501 this._playersById.delete(id); 46502 const index = this.players.indexOf(player); 46503 if (index >= 0) { 46504 this.players.splice(index, 1); 46505 } 46506 } 46507 _getPlayer(id) { 46508 const player = this._playersById.get(id); 46509 if (!player) { 46510 throw (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.missingPlayer)(id); 46511 } 46512 return player; 46513 } 46514 listen(id, element, eventName, callback) { 46515 // triggerName, fromState, toState are all ignored for timeline animations 46516 const baseEvent = (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.makeAnimationEvent)(element, '', '', ''); 46517 (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.listenOnPlayer)(this._getPlayer(id), eventName, baseEvent, callback); 46518 return () => {}; 46519 } 46520 command(id, element, command, args) { 46521 if (command == 'register') { 46522 this.register(id, args[0]); 46523 return; 46524 } 46525 if (command == 'create') { 46526 const options = args[0] || {}; 46527 this.create(id, element, options); 46528 return; 46529 } 46530 const player = this._getPlayer(id); 46531 switch (command) { 46532 case 'play': 46533 player.play(); 46534 break; 46535 case 'pause': 46536 player.pause(); 46537 break; 46538 case 'reset': 46539 player.reset(); 46540 break; 46541 case 'restart': 46542 player.restart(); 46543 break; 46544 case 'finish': 46545 player.finish(); 46546 break; 46547 case 'init': 46548 player.init(); 46549 break; 46550 case 'setPosition': 46551 player.setPosition(parseFloat(args[0])); 46552 break; 46553 case 'destroy': 46554 this.destroy(id); 46555 break; 46556 } 46557 } 46558} 46559const QUEUED_CLASSNAME = 'ng-animate-queued'; 46560const QUEUED_SELECTOR = '.ng-animate-queued'; 46561const DISABLED_CLASSNAME = 'ng-animate-disabled'; 46562const DISABLED_SELECTOR = '.ng-animate-disabled'; 46563const STAR_CLASSNAME = 'ng-star-inserted'; 46564const STAR_SELECTOR = '.ng-star-inserted'; 46565const EMPTY_PLAYER_ARRAY = []; 46566const NULL_REMOVAL_STATE = { 46567 namespaceId: '', 46568 setForRemoval: false, 46569 setForMove: false, 46570 hasAnimation: false, 46571 removedBeforeQueried: false 46572}; 46573const NULL_REMOVED_QUERIED_STATE = { 46574 namespaceId: '', 46575 setForMove: false, 46576 setForRemoval: false, 46577 hasAnimation: false, 46578 removedBeforeQueried: true 46579}; 46580const REMOVAL_FLAG = '__ng_removed'; 46581class StateValue { 46582 get params() { 46583 return this.options.params; 46584 } 46585 constructor(input, namespaceId = '') { 46586 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "namespaceId", void 0); 46587 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "value", void 0); 46588 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "options", void 0); 46589 this.namespaceId = namespaceId; 46590 const isObj = input && input.hasOwnProperty('value'); 46591 const value = isObj ? input['value'] : input; 46592 this.value = normalizeTriggerValue(value); 46593 if (isObj) { 46594 // we drop the value property from options. 46595 const { 46596 value 46597 } = input, 46598 options = (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_objectWithoutProperties_js__WEBPACK_IMPORTED_MODULE_0__["default"])(input, _excluded); 46599 this.options = options; 46600 } else { 46601 this.options = {}; 46602 } 46603 if (!this.options.params) { 46604 this.options.params = {}; 46605 } 46606 } 46607 absorbOptions(options) { 46608 const newParams = options.params; 46609 if (newParams) { 46610 const oldParams = this.options.params;
46611 Object.keys(newParams).forEach(prop => { 46612 if (oldParams[prop] == null) { 46613 oldParams[prop] = newParams[prop]; 46614 } 46615 }); 46616 } 46617 } 46618} 46619const VOID_VALUE = 'void'; 46620const DEFAULT_STATE_VALUE = /* @__PURE__ */new StateValue(VOID_VALUE); 46621class AnimationTransitionNamespace { 46622 constructor(id, hostElement, _engine) { 46623 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "id", void 0); 46624 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "hostElement", void 0); 46625 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_engine", void 0); 46626 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "players", []); 46627 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_triggers", new Map()); 46628 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_queue", []); 46629 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_elementListeners", new Map()); 46630 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_hostClassName", void 0); 46631 this.id = id; 46632 this.hostElement = hostElement; 46633 this._engine = _engine; 46634 this._hostClassName = 'ng-tns-' + id; 46635 addClass(hostElement, this._hostClassName); 46636 } 46637 listen(element, name, phase, callback) { 46638 if (!this._triggers.has(name)) { 46639 throw (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.missingTrigger)(phase, name); 46640 } 46641 if (phase == null || phase.length == 0) { 46642 throw (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.missingEvent)(name); 46643 } 46644 if (!isTriggerEventValid(phase)) { 46645 throw (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.unsupportedTriggerEvent)(phase, name); 46646 } 46647 const listeners = (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.getOrSetDefaultValue)(this._elementListeners, element, []); 46648 const data = { 46649 name, 46650 phase, 46651 callback 46652 }; 46653 listeners.push(data); 46654 const triggersWithStates = (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.getOrSetDefaultValue)(this._engine.statesByElement, element, new Map()); 46655 if (!triggersWithStates.has(name)) { 46656 addClass(element, _util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.NG_TRIGGER_CLASSNAME); 46657 addClass(element, _util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.NG_TRIGGER_CLASSNAME + '-' + name); 46658 triggersWithStates.set(name, DEFAULT_STATE_VALUE); 46659 } 46660 return () => { 46661 // the event listener is removed AFTER the flush has occurred such 46662 // that leave animations callbacks can fire (otherwise if the node 46663 // is removed in between then the listeners would be deregistered) 46664 this._engine.afterFlush(() => { 46665 const index = listeners.indexOf(data); 46666 if (index >= 0) { 46667 listeners.splice(index, 1); 46668 } 46669 if (!this._triggers.has(name)) { 46670 triggersWithStates.delete(name); 46671 } 46672 }); 46673 }; 46674 } 46675 register(name, ast) { 46676 if (this._triggers.has(name)) { 46677 // throw 46678 return false; 46679 } else { 46680 this._triggers.set(name, ast); 46681 return true; 46682 } 46683 } 46684 _getTrigger(name) { 46685 const trigger = this._triggers.get(name); 46686 if (!trigger) { 46687 throw (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.unregisteredTrigger)(name); 46688 } 46689 return trigger; 46690 } 46691 trigger(element, triggerName, value, defaultToFallback = true) { 46692 const trigger = this._getTrigger(triggerName); 46693 const player = new TransitionAnimationPlayer(this.id, triggerName, element); 46694 let triggersWithStates = this._engine.statesByElement.get(element); 46695 if (!triggersWithStates) { 46696 addClass(element, _util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.NG_TRIGGER_CLASSNAME); 46697 addClass(element, _util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.NG_TRIGGER_CLASSNAME + '-' + triggerName); 46698 this._engine.statesByElement.set(element, triggersWithStates = new Map()); 46699 } 46700 let fromState = triggersWithStates.get(triggerName); 46701 const toState = new StateValue(value, this.id); 46702 const isObj = value && value.hasOwnProperty('value'); 46703 if (!isObj && fromState) { 46704 toState.absorbOptions(fromState.options); 46705 } 46706 triggersWithStates.set(triggerName, toState); 46707 if (!fromState) { 46708 fromState = DEFAULT_STATE_VALUE; 46709 } 46710 const isRemoval = toState.value === VOID_VALUE; 46711 // normally this isn't reached by here, however, if an object expression 46712 // is passed in then it may be a new object each time. Comparing the value 46713 // is important since that will stay the same despite there being a new object. 46714 // The removal arc here is special cased because the same element is triggered 46715 // twice in the event that it contains animations on the outer/inner portions 46716 // of the host container 46717 if (!isRemoval && fromState.value === toState.value) { 46718 // this means that despite the value not changing, some inner params 46719 // have changed which means that the animation final styles need to be applied 46720 if (!objEquals(fromState.params, toState.params)) { 46721 const errors = []; 46722 const fromStyles = trigger.matchStyles(fromState.value, fromState.params, errors); 46723 const toStyles = trigger.matchStyles(toState.value, toState.params, errors); 46724 if (errors.length) { 46725 this._engine.reportError(errors); 46726 } else { 46727 this._engine.afterFlush(() => { 46728 (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.eraseStyles)(element, fromStyles); 46729 (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.setStyles)(element, toStyles); 46730 }); 46731 } 46732 } 46733 return; 46734 } 46735 const playersOnElement = (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.getOrSetDefaultValue)(this._engine.playersByElement, element, []); 46736 playersOnElement.forEach(player => { 46737 // only remove the player if it is queued on the EXACT same trigger/namespace 46738 // we only also deal with queued players here because if the animation has 46739 // started then we want to keep the player alive until the flush happens 46740 // (which is where the previousPlayers are passed into the new player) 46741 if (player.namespaceId == this.id && player.triggerName == triggerName && player.queued) { 46742 player.destroy(); 46743 } 46744 }); 46745 let transition = trigger.matchTransition(fromState.value, toState.value, element, toState.params); 46746 let isFallbackTransition = false;
vendor: 8,948 bytes, lines 46747-46968
46747 if (!transition) { 46748 if (!defaultToFallback) return; 46749 transition = trigger.fallbackTransition; 46750 isFallbackTransition = true; 46751 } 46752 this._engine.totalQueuedPlayers++; 46753 this._queue.push({ 46754 element, 46755 triggerName, 46756 transition, 46757 fromState, 46758 toState, 46759 player, 46760 isFallbackTransition 46761 }); 46762 if (!isFallbackTransition) { 46763 addClass(element, QUEUED_CLASSNAME); 46764 player.onStart(() => { 46765 removeClass(element, QUEUED_CLASSNAME); 46766 }); 46767 } 46768 player.onDone(() => { 46769 let index = this.players.indexOf(player); 46770 if (index >= 0) { 46771 this.players.splice(index, 1); 46772 } 46773 const players = this._engine.playersByElement.get(element); 46774 if (players) { 46775 let index = players.indexOf(player); 46776 if (index >= 0) { 46777 players.splice(index, 1); 46778 } 46779 } 46780 }); 46781 this.players.push(player); 46782 playersOnElement.push(player); 46783 return player; 46784 } 46785 deregister(name) { 46786 this._triggers.delete(name); 46787 this._engine.statesByElement.forEach(stateMap => stateMap.delete(name)); 46788 this._elementListeners.forEach((listeners, element) => { 46789 this._elementListeners.set(element, listeners.filter(entry => { 46790 return entry.name != name; 46791 })); 46792 }); 46793 } 46794 clearElementCache(element) { 46795 this._engine.statesByElement.delete(element); 46796 this._elementListeners.delete(element); 46797 const elementPlayers = this._engine.playersByElement.get(element); 46798 if (elementPlayers) { 46799 elementPlayers.forEach(player => player.destroy()); 46800 this._engine.playersByElement.delete(element); 46801 } 46802 } 46803 _signalRemovalForInnerTriggers(rootElement, context) { 46804 const elements = this._engine.driver.query(rootElement, _util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.NG_TRIGGER_SELECTOR, true); 46805 // emulate a leave animation for all inner nodes within this node. 46806 // If there are no animations found for any of the nodes then clear the cache 46807 // for the element. 46808 elements.forEach(elm => { 46809 // this means that an inner remove() operation has already kicked off 46810 // the animation on this element... 46811 if (elm[REMOVAL_FLAG]) return; 46812 const namespaces = this._engine.fetchNamespacesByElement(elm); 46813 if (namespaces.size) { 46814 namespaces.forEach(ns => ns.triggerLeaveAnimation(elm, context, false, true)); 46815 } else { 46816 this.clearElementCache(elm); 46817 } 46818 }); 46819 // If the child elements were removed along with the parent, their animations might not 46820 // have completed. Clear all the elements from the cache so we don't end up with a memory leak. 46821 this._engine.afterFlushAnimationsDone(() => elements.forEach(elm => this.clearElementCache(elm))); 46822 } 46823 triggerLeaveAnimation(element, context, destroyAfterComplete, defaultToFallback) { 46824 const triggerStates = this._engine.statesByElement.get(element); 46825 const previousTriggersValues = new Map(); 46826 if (triggerStates) { 46827 const players = []; 46828 triggerStates.forEach((state, triggerName) => { 46829 previousTriggersValues.set(triggerName, state.value); 46830 // this check is here in the event that an element is removed 46831 // twice (both on the host level and the component level) 46832 if (this._triggers.has(triggerName)) { 46833 const player = this.trigger(element, triggerName, VOID_VALUE, defaultToFallback); 46834 if (player) { 46835 players.push(player); 46836 } 46837 } 46838 }); 46839 if (players.length) { 46840 this._engine.markElementAsRemoved(this.id, element, true, context, previousTriggersValues); 46841 if (destroyAfterComplete) { 46842 (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.optimizeGroupPlayer)(players).onDone(() => this._engine.processLeaveNode(element)); 46843 } 46844 return true; 46845 } 46846 } 46847 return false; 46848 } 46849 prepareLeaveAnimationListeners(element) { 46850 const listeners = this._elementListeners.get(element); 46851 const elementStates = this._engine.statesByElement.get(element); 46852 // if this statement fails then it means that the element was picked up 46853 // by an earlier flush (or there are no listeners at all to track the leave). 46854 if (listeners && elementStates) { 46855 const visitedTriggers = new Set(); 46856 listeners.forEach(listener => { 46857 const triggerName = listener.name; 46858 if (visitedTriggers.has(triggerName)) return; 46859 visitedTriggers.add(triggerName); 46860 const trigger = this._triggers.get(triggerName); 46861 const transition = trigger.fallbackTransition; 46862 const fromState = elementStates.get(triggerName) || DEFAULT_STATE_VALUE; 46863 const toState = new StateValue(VOID_VALUE); 46864 const player = new TransitionAnimationPlayer(this.id, triggerName, element); 46865 this._engine.totalQueuedPlayers++; 46866 this._queue.push({ 46867 element, 46868 triggerName, 46869 transition, 46870 fromState, 46871 toState, 46872 player, 46873 isFallbackTransition: true 46874 }); 46875 }); 46876 } 46877 } 46878 removeNode(element, context) { 46879 const engine = this._engine; 46880 if (element.childElementCount) { 46881 this._signalRemovalForInnerTriggers(element, context); 46882 } 46883 // this means that a * => VOID animation was detected and kicked off 46884 if (this.triggerLeaveAnimation(element, context, true)) return; 46885 // find the player that is animating and make sure that the 46886 // removal is delayed until that player has completed 46887 let containsPotentialParentTransition = false; 46888 if (engine.totalAnimations) { 46889 const currentPlayers = engine.players.length ? engine.playersByQueriedElement.get(element) : []; 46890 // when this `if statement` does not continue forward it means that 46891 // a previous animation query has selected the current element and 46892 // is animating it. In this situation want to continue forwards and 46893 // allow the element to be queued up for animation later. 46894 if (currentPlayers && currentPlayers.length) { 46895 containsPotentialParentTransition = true; 46896 } else { 46897 let parent = element; 46898 while (parent = parent.parentNode) { 46899 const triggers = engine.statesByElement.get(parent); 46900 if (triggers) { 46901 containsPotentialParentTransition = true; 46902 break; 46903 } 46904 } 46905 } 46906 } 46907 // at this stage we know that the element will either get removed 46908 // during flush or will be picked up by a parent query. Either way 46909 // we need to fire the listeners for this element when it DOES get 46910 // removed (once the query parent animation is done or after flush) 46911 this.prepareLeaveAnimationListeners(element); 46912 // whether or not a parent has an animation we need to delay the deferral of the leave 46913 // operation until we have more information (which we do after flush() has been called) 46914 if (containsPotentialParentTransition) { 46915 engine.markElementAsRemoved(this.id, element, false, context); 46916 } else { 46917 const removalFlag = element[REMOVAL_FLAG]; 46918 if (!removalFlag || removalFlag === NULL_REMOVAL_STATE) { 46919 // we do this after the flush has occurred such 46920 // that the callbacks can be fired 46921 engine.afterFlush(() => this.clearElementCache(element)); 46922 engine.destroyInnerAnimations(element); 46923 engine._onRemovalComplete(element, context); 46924 } 46925 } 46926 } 46927 insertNode(element, parent) { 46928 addClass(element, this._hostClassName); 46929 } 46930 drainQueuedTransitions(microtaskId) { 46931 const instructions = []; 46932 this._queue.forEach(entry => { 46933 const player = entry.player; 46934 if (player.destroyed) return; 46935 const element = entry.element; 46936 const listeners = this._elementListeners.get(element); 46937 if (listeners) { 46938 listeners.forEach(listener => { 46939 if (listener.name == entry.triggerName) { 46940 const baseEvent = (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.makeAnimationEvent)(element, entry.triggerName, entry.fromState.value, entry.toState.value); 46941 baseEvent['_data'] = microtaskId; 46942 (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.listenOnPlayer)(entry.player, listener.phase, baseEvent, listener.callback); 46943 } 46944 }); 46945 } 46946 if (player.markedForDestroy) { 46947 this._engine.afterFlush(() => { 46948 // now we can destroy the element properly since the event listeners have 46949 // been bound to the player 46950 player.destroy(); 46951 }); 46952 } else { 46953 instructions.push(entry); 46954 } 46955 }); 46956 this._queue = []; 46957 return instructions.sort((a, b) => { 46958 // if depCount == 0 them move to front 46959 // otherwise if a contains b then move back 46960 const d0 = a.transition.ast.depCount; 46961 const d1 = b.transition.ast.depCount; 46962 if (d0 == 0 || d1 == 0) { 46963 return d0 - d1; 46964 } 46965 return this._engine.driver.containsElement(a.element, b.element) ? 1 : -1; 46966 }); 46967 } 46968 destroy(context) {
46969 this.players.forEach(p => p.destroy()); 46970 this._signalRemovalForInnerTriggers(this.hostElement, context); 46971 } 46972} 46973class TransitionAnimationEngine { 46974 /** @internal */ 46975 _onRemovalComplete(element, context) { 46976 this.onRemovalComplete(element, context); 46977 } 46978 constructor(bodyNode, driver, _normalizer) { 46979 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "bodyNode", void 0); 46980 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "driver", void 0); 46981 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_normalizer", void 0); 46982 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "players", []); 46983 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "newHostElements", new Map()); 46984 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "playersByElement", new Map()); 46985 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "playersByQueriedElement", new Map()); 46986 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "statesByElement", new Map()); 46987 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "disabledNodes", new Set()); 46988 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "totalAnimations", 0); 46989 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "totalQueuedPlayers", 0); 46990 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_namespaceLookup", {}); 46991 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_namespaceList", []); 46992 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_flushFns", []); 46993 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_whenQuietFns", []); 46994 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "namespacesByHostElement", new Map()); 46995 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "collectedEnterElements", []); 46996 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "collectedLeaveElements", []); 46997 // this method is designed to be overridden by the code that uses this engine 46998 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "onRemovalComplete", (element, context) => {}); 46999 this.bodyNode = bodyNode; 47000 this.driver = driver; 47001 this._normalizer = _normalizer; 47002 } 47003 get queuedPlayers() { 47004 const players = []; 47005 this._namespaceList.forEach(ns => {
vendor: 8,981 bytes, lines 47006-47231
47006 ns.players.forEach(player => { 47007 if (player.queued) { 47008 players.push(player); 47009 } 47010 }); 47011 }); 47012 return players; 47013 } 47014 createNamespace(namespaceId, hostElement) { 47015 const ns = new AnimationTransitionNamespace(namespaceId, hostElement, this); 47016 if (this.bodyNode && this.driver.containsElement(this.bodyNode, hostElement)) { 47017 this._balanceNamespaceList(ns, hostElement); 47018 } else { 47019 // defer this later until flush during when the host element has 47020 // been inserted so that we know exactly where to place it in 47021 // the namespace list 47022 this.newHostElements.set(hostElement, ns); 47023 // given that this host element is a part of the animation code, it 47024 // may or may not be inserted by a parent node that is of an 47025 // animation renderer type. If this happens then we can still have 47026 // access to this item when we query for :enter nodes. If the parent 47027 // is a renderer then the set data-structure will normalize the entry 47028 this.collectEnterElement(hostElement); 47029 } 47030 return this._namespaceLookup[namespaceId] = ns; 47031 } 47032 _balanceNamespaceList(ns, hostElement) { 47033 const namespaceList = this._namespaceList; 47034 const namespacesByHostElement = this.namespacesByHostElement; 47035 const limit = namespaceList.length - 1; 47036 if (limit >= 0) { 47037 let found = false; 47038 // Find the closest ancestor with an existing namespace so we can then insert `ns` after it, 47039 // establishing a top-down ordering of namespaces in `this._namespaceList`. 47040 let ancestor = this.driver.getParentElement(hostElement); 47041 while (ancestor) { 47042 const ancestorNs = namespacesByHostElement.get(ancestor); 47043 if (ancestorNs) { 47044 // An animation namespace has been registered for this ancestor, so we insert `ns` 47045 // right after it to establish top-down ordering of animation namespaces. 47046 const index = namespaceList.indexOf(ancestorNs); 47047 namespaceList.splice(index + 1, 0, ns); 47048 found = true; 47049 break; 47050 } 47051 ancestor = this.driver.getParentElement(ancestor); 47052 } 47053 if (!found) { 47054 // No namespace exists that is an ancestor of `ns`, so `ns` is inserted at the front to 47055 // ensure that any existing descendants are ordered after `ns`, retaining the desired 47056 // top-down ordering. 47057 namespaceList.unshift(ns); 47058 } 47059 } else { 47060 namespaceList.push(ns); 47061 } 47062 namespacesByHostElement.set(hostElement, ns); 47063 return ns; 47064 } 47065 register(namespaceId, hostElement) { 47066 let ns = this._namespaceLookup[namespaceId]; 47067 if (!ns) { 47068 ns = this.createNamespace(namespaceId, hostElement); 47069 } 47070 return ns; 47071 } 47072 registerTrigger(namespaceId, name, trigger) { 47073 let ns = this._namespaceLookup[namespaceId]; 47074 if (ns && ns.register(name, trigger)) { 47075 this.totalAnimations++; 47076 } 47077 } 47078 destroy(namespaceId, context) { 47079 if (!namespaceId) return; 47080 this.afterFlush(() => {}); 47081 this.afterFlushAnimationsDone(() => { 47082 const ns = this._fetchNamespace(namespaceId); 47083 this.namespacesByHostElement.delete(ns.hostElement); 47084 const index = this._namespaceList.indexOf(ns); 47085 if (index >= 0) { 47086 this._namespaceList.splice(index, 1); 47087 } 47088 ns.destroy(context); 47089 delete this._namespaceLookup[namespaceId]; 47090 }); 47091 } 47092 _fetchNamespace(id) { 47093 return this._namespaceLookup[id]; 47094 } 47095 fetchNamespacesByElement(element) { 47096 // normally there should only be one namespace per element, however 47097 // if @triggers are placed on both the component element and then 47098 // its host element (within the component code) then there will be 47099 // two namespaces returned. We use a set here to simply deduplicate 47100 // the namespaces in case (for the reason described above) there are multiple triggers 47101 const namespaces = new Set(); 47102 const elementStates = this.statesByElement.get(element); 47103 if (elementStates) { 47104 for (let stateValue of elementStates.values()) { 47105 if (stateValue.namespaceId) { 47106 const ns = this._fetchNamespace(stateValue.namespaceId); 47107 if (ns) { 47108 namespaces.add(ns); 47109 } 47110 } 47111 } 47112 } 47113 return namespaces; 47114 } 47115 trigger(namespaceId, element, name, value) { 47116 if (isElementNode(element)) { 47117 const ns = this._fetchNamespace(namespaceId); 47118 if (ns) { 47119 ns.trigger(element, name, value); 47120 return true; 47121 } 47122 } 47123 return false; 47124 } 47125 insertNode(namespaceId, element, parent, insertBefore) { 47126 if (!isElementNode(element)) return; 47127 // special case for when an element is removed and reinserted (move operation) 47128 // when this occurs we do not want to use the element for deletion later 47129 const details = element[REMOVAL_FLAG]; 47130 if (details && details.setForRemoval) { 47131 details.setForRemoval = false; 47132 details.setForMove = true; 47133 const index = this.collectedLeaveElements.indexOf(element); 47134 if (index >= 0) { 47135 this.collectedLeaveElements.splice(index, 1); 47136 } 47137 } 47138 // in the event that the namespaceId is blank then the caller 47139 // code does not contain any animation code in it, but it is 47140 // just being called so that the node is marked as being inserted 47141 if (namespaceId) { 47142 const ns = this._fetchNamespace(namespaceId); 47143 // This if-statement is a workaround for router issue #21947. 47144 // The router sometimes hits a race condition where while a route 47145 // is being instantiated a new navigation arrives, triggering leave 47146 // animation of DOM that has not been fully initialized, until this 47147 // is resolved, we need to handle the scenario when DOM is not in a 47148 // consistent state during the animation. 47149 if (ns) { 47150 ns.insertNode(element, parent); 47151 } 47152 } 47153 // only *directives and host elements are inserted before 47154 if (insertBefore) { 47155 this.collectEnterElement(element); 47156 } 47157 } 47158 collectEnterElement(element) { 47159 this.collectedEnterElements.push(element); 47160 } 47161 markElementAsDisabled(element, value) { 47162 if (value) { 47163 if (!this.disabledNodes.has(element)) { 47164 this.disabledNodes.add(element); 47165 addClass(element, DISABLED_CLASSNAME); 47166 } 47167 } else if (this.disabledNodes.has(element)) { 47168 this.disabledNodes.delete(element); 47169 removeClass(element, DISABLED_CLASSNAME); 47170 } 47171 } 47172 removeNode(namespaceId, element, context) { 47173 if (isElementNode(element)) { 47174 const ns = namespaceId ? this._fetchNamespace(namespaceId) : null; 47175 if (ns) { 47176 ns.removeNode(element, context); 47177 } else { 47178 this.markElementAsRemoved(namespaceId, element, false, context); 47179 } 47180 const hostNS = this.namespacesByHostElement.get(element); 47181 if (hostNS && hostNS.id !== namespaceId) { 47182 hostNS.removeNode(element, context); 47183 } 47184 } else { 47185 this._onRemovalComplete(element, context); 47186 } 47187 } 47188 markElementAsRemoved(namespaceId, element, hasAnimation, context, previousTriggersValues) { 47189 this.collectedLeaveElements.push(element); 47190 element[REMOVAL_FLAG] = { 47191 namespaceId, 47192 setForRemoval: context, 47193 hasAnimation, 47194 removedBeforeQueried: false, 47195 previousTriggersValues 47196 }; 47197 } 47198 listen(namespaceId, element, name, phase, callback) { 47199 if (isElementNode(element)) { 47200 return this._fetchNamespace(namespaceId).listen(element, name, phase, callback); 47201 } 47202 return () => {}; 47203 } 47204 _buildInstruction(entry, subTimelines, enterClassName, leaveClassName, skipBuildAst) { 47205 return entry.transition.build(this.driver, entry.element, entry.fromState.value, entry.toState.value, enterClassName, leaveClassName, entry.fromState.options, entry.toState.options, subTimelines, skipBuildAst); 47206 } 47207 destroyInnerAnimations(containerElement) { 47208 let elements = this.driver.query(containerElement, _util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.NG_TRIGGER_SELECTOR, true); 47209 elements.forEach(element => this.destroyActiveAnimationsForElement(element)); 47210 if (this.playersByQueriedElement.size == 0) return; 47211 elements = this.driver.query(containerElement, _util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.NG_ANIMATING_SELECTOR, true); 47212 elements.forEach(element => this.finishActiveQueriedAnimationOnElement(element)); 47213 } 47214 destroyActiveAnimationsForElement(element) { 47215 const players = this.playersByElement.get(element); 47216 if (players) { 47217 players.forEach(player => { 47218 // special case for when an element is set for destruction, but hasn't started. 47219 // in this situation we want to delay the destruction until the flush occurs 47220 // so that any event listeners attached to the player are triggered. 47221 if (player.queued) { 47222 player.markedForDestroy = true; 47223 } else { 47224 player.destroy(); 47225 } 47226 }); 47227 } 47228 } 47229 finishActiveQueriedAnimationOnElement(element) { 47230 const players = this.playersByQueriedElement.get(element); 47231 if (players) {
47232 players.forEach(player => player.finish()); 47233 } 47234 } 47235 whenRenderingDone() { 47236 return new Promise(resolve => { 47237 if (this.players.length) { 47238 return (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.optimizeGroupPlayer)(this.players).onDone(() => resolve()); 47239 } else { 47240 resolve(); 47241 } 47242 }); 47243 } 47244 processLeaveNode(element) { 47245 var _element$classList; 47246 const details = element[REMOVAL_FLAG]; 47247 if (details && details.setForRemoval) { 47248 // this will prevent it from removing it twice 47249 element[REMOVAL_FLAG] = NULL_REMOVAL_STATE; 47250 if (details.namespaceId) { 47251 this.destroyInnerAnimations(element); 47252 const ns = this._fetchNamespace(details.namespaceId); 47253 if (ns) { 47254 ns.clearElementCache(element); 47255 } 47256 } 47257 this._onRemovalComplete(element, details.setForRemoval); 47258 } 47259 if ((_element$classList = element.classList) !== null && _element$classList !== void 0 && _element$classList.contains(DISABLED_CLASSNAME)) { 47260 this.markElementAsDisabled(element, false); 47261 } 47262 this.driver.query(element, DISABLED_SELECTOR, true).forEach(node => { 47263 this.markElementAsDisabled(node, false); 47264 }); 47265 } 47266 flush(microtaskId = -1) { 47267 let players = []; 47268 if (this.newHostElements.size) { 47269 this.newHostElements.forEach((ns, element) => this._balanceNamespaceList(ns, element)); 47270 this.newHostElements.clear(); 47271 } 47272 if (this.totalAnimations && this.collectedEnterElements.length) { 47273 for (let i = 0; i < this.collectedEnterElements.length; i++) { 47274 const elm = this.collectedEnterElements[i]; 47275 addClass(elm, STAR_CLASSNAME); 47276 } 47277 } 47278 if (this._namespaceList.length && (this.totalQueuedPlayers || this.collectedLeaveElements.length)) { 47279 const cleanupFns = [];
47280 try { 47281 players = this._flushAnimations(cleanupFns, microtaskId); 47282 } finally { 47283 for (let i = 0; i < cleanupFns.length; i++) { 47284 cleanupFns[i](); 47285 } 47286 } 47287 } else { 47288 for (let i = 0; i < this.collectedLeaveElements.length; i++) { 47289 const element = this.collectedLeaveElements[i]; 47290 this.processLeaveNode(element); 47291 } 47292 } 47293 this.totalQueuedPlayers = 0; 47294 this.collectedEnterElements.length = 0; 47295 this.collectedLeaveElements.length = 0; 47296 this._flushFns.forEach(fn => fn()); 47297 this._flushFns = []; 47298 if (this._whenQuietFns.length) { 47299 // we move these over to a variable so that 47300 // if any new callbacks are registered in another 47301 // flush they do not populate the existing set 47302 const quietFns = this._whenQuietFns; 47303 this._whenQuietFns = []; 47304 if (players.length) { 47305 (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.optimizeGroupPlayer)(players).onDone(() => { 47306 quietFns.forEach(fn => fn()); 47307 }); 47308 } else { 47309 quietFns.forEach(fn => fn()); 47310 } 47311 } 47312 } 47313 reportError(errors) { 47314 throw (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.triggerTransitionsFailed)(errors); 47315 } 47316 _flushAnimations(cleanupFns, microtaskId) { 47317 const subTimelines = new ElementInstructionMap(); 47318 const skippedPlayers = []; 47319 const skippedPlayersMap = new Map(); 47320 const queuedInstructions = []; 47321 const queriedElements = new Map(); 47322 const allPreStyleElements = new Map(); 47323 const allPostStyleElements = new Map(); 47324 const disabledElementsSet = new Set(); 47325 this.disabledNodes.forEach(node => { 47326 disabledElementsSet.add(node); 47327 const nodesThatAreDisabled = this.driver.query(node, QUEUED_SELECTOR, true); 47328 for (let i = 0; i < nodesThatAreDisabled.length; i++) { 47329 disabledElementsSet.add(nodesThatAreDisabled[i]); 47330 } 47331 }); 47332 const bodyNode = this.bodyNode; 47333 const allTriggerElements = Array.from(this.statesByElement.keys()); 47334 const enterNodeMap = buildRootMap(allTriggerElements, this.collectedEnterElements); 47335 // this must occur before the instructions are built below such that 47336 // the :enter queries match the elements (since the timeline queries 47337 // are fired during instruction building). 47338 const enterNodeMapIds = new Map(); 47339 let i = 0;
47340 enterNodeMap.forEach((nodes, root) => { 47341 const className = _util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.ENTER_CLASSNAME + i++; 47342 enterNodeMapIds.set(root, className); 47343 nodes.forEach(node => addClass(node, className)); 47344 }); 47345 const allLeaveNodes = []; 47346 const mergedLeaveNodes = new Set(); 47347 const leaveNodesWithoutAnimations = new Set(); 47348 for (let i = 0; i < this.collectedLeaveElements.length; i++) { 47349 const element = this.collectedLeaveElements[i]; 47350 const details = element[REMOVAL_FLAG]; 47351 if (details && details.setForRemoval) { 47352 allLeaveNodes.push(element); 47353 mergedLeaveNodes.add(element); 47354 if (details.hasAnimation) { 47355 this.driver.query(element, STAR_SELECTOR, true).forEach(elm => mergedLeaveNodes.add(elm)); 47356 } else { 47357 leaveNodesWithoutAnimations.add(element); 47358 } 47359 } 47360 } 47361 const leaveNodeMapIds = new Map(); 47362 const leaveNodeMap = buildRootMap(allTriggerElements, Array.from(mergedLeaveNodes)); 47363 leaveNodeMap.forEac
47363h((nodes, root) => { 47364 const className = _util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.LEAVE_CLASSNAME + i++; 47365 leaveNodeMapIds.set(root, className); 47366 nodes.forEach(node => addClass(node, className)); 47367 }); 47368 cleanupFns.push(() => { 47369 enterNodeMap.forEach((nodes, root) => { 47370 const className = enterNodeMapIds.get(root); 47371 nodes.forEach(node => removeClass(node, className)); 47372 }); 47373 leaveNodeMap.forEach((nodes, root) => { 47374 const className = leaveNodeMapIds.get(root); 47375 nodes.forEach(node => removeClass(node, className)); 47376 }); 47377 allLeaveNodes.forEach(element => { 47378 this.processLeaveNode(element); 47379 }); 47380 }); 47381 const allPlayers = []; 47382 const erroneousTransitions = []; 47383 for (let i = this._namespaceList.length - 1; i >= 0; i--) { 47384 const ns = this._namespaceList[i]; 47385 ns.drainQueuedTransitions(microtaskId).forEach(entry => { 47386 const player = entry.player; 47387 const element = entry.element; 47388 allPlayers.push(player); 47389 if (this.collectedEnterElements.length) { 47390 const details = element[REMOVAL_FLAG]; 47391 // animations for move operations (elements being removed and reinserted, 47392 // e.g. when the order of an *ngFor list changes) are currently not supported 47393 if (details && details.setForMove) { 47394 if (details.previousTriggersValues && details.previousTriggersValues.has(entry.triggerName)) { 47395 const previousValue = details.previousTriggersValues.get(entry.triggerName); 47396 // we need to restore the previous trigger value since the element has 47397 // only been moved and hasn't actually left the DOM 47398 const triggersWithStates = this.statesByElement.get(entry.element); 47399 if (triggersWithStates && triggersWithStates.has(entry.triggerName)) { 47400 const state = triggersWithStates.get(entry.triggerName); 47401 state.value = previousValue; 47402 triggersWithStates.set(entry.triggerName, state); 47403 } 47404 } 47405 player.destroy(); 47406 return; 47407 } 47408 } 47409 const nodeIsOrphaned = !bodyNode || !this.driver.containsElement(bodyNode, element); 47410 const leaveClassName = leaveNodeMapIds.get(element); 47411 const enterClassName = enterNodeMapIds.get(element); 47412 const instruction = this._buildInstruction(entry, subTimelines, enterClassName, leaveClassName, nodeIsOrphaned); 47413 if (instruction.errors && instruction.errors.length) { 47414 erroneousTransitions.push(instruction); 47415 return; 47416 } 47417 // even though the element may not be in the DOM, it may still 47418 // be added at a later point (due to the mechanics of content 47419 // projection and/or dynamic component insertion) therefore it's 47420 // important to still style the element. 47421 if (nodeIsOrphaned) { 47422 player.onStart(() => (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.eraseStyles)(element, instruction.fromStyles)); 47423 player.onDestroy(() => (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.setStyles)(element, instruction.toStyles)); 47424 skippedPlayers.push(player); 47425 return; 47426 } 47427 // if an unmatched transition is queued and ready to go 47428 // then it SHOULD NOT render an animation and cancel the 47429 // previously running animations. 47430 if (entry.isFallbackTransition) { 47431 player.onStart(() => (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.eraseStyles)(element, instruction.fromStyles)); 47432 player.onDestroy(() => (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.setStyles)(element, instruction.toStyles)); 47433 skippedPlayers.push(player); 47434 return; 47435 } 47436 // this means that if a parent animation uses this animation as a sub-trigger 47437 // then it will instruct the timeline builder not to add a player delay, but 47438 // instead stretch the first keyframe gap until the animation starts. This is 47439 // important in order to prevent extra initialization styles from being 47440 // required by the user for the animation. 47441 const timelines = [];
47442 instruction.timelines.forEach(tl => { 47443 tl.stretchStartingKeyframe = true; 47444 if (!this.disabledNodes.has(tl.element)) { 47445 timelines.push(tl); 47446 } 47447 }); 47448 instruction.timelines = timelines; 47449 subTimelines.append(element, instruction.timelines); 47450 const tuple = { 47451 instruction, 47452 player, 47453 element 47454 }; 47455 queuedInstructions.push(tuple); 47456 instruction.queriedElements.forEach(element => (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.getOrSetDefaultValue)(queriedElements, element, []).push(player)); 47457 instruction.preStyleProps.forEach((stringMap, element) => { 47458 if (stringMap.size) { 47459 let setVal = allPreStyleElements.get(element); 47460 if (!setVal) { 47461 allPreStyleElements.set(element, setVal = new Set()); 47462 } 47463 stringMap.forEach((_, prop) => setVal.add(prop)); 47464 } 47465 }); 47466 instruction.postStyleProps.forEach((stringMap, element) => { 47467 let setVal = allPostStyleElements.get(element); 47468 if (!setVal) { 47469 allPostStyleElements.set(element, setVal = new Set()); 47470 } 47471 stringMap.forEach((_, prop) => setVal.add(prop)); 47472 }); 47473 }); 47474 } 47475 if (erroneousTransitions.length) { 47476 const errors = []; 47477 erroneousTransitions.forEach(instruction => { 47478 errors.push((0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.transitionFailed)(instruction.triggerName, instruction.errors)); 47479 }); 47480 allPlayers.forEach(player => player.destroy()); 47481 this.reportError(errors); 47482 } 47483 const allPreviousPlayersMap = new Map(); 47484 // this map tells us which element in the DOM tree is contained by 47485 // which animation. Further down this map will get populated once 47486 // the players are built and in doing so we can use it to efficiently 47487 // figure out if a sub player is skipped due to a parent player having priority. 47488 const animationElementMap = new Map(); 47489 queuedInstructions.forEach(entry => { 47490 const element = entry.element; 47491 if (subTimelines.has(element)) { 47492 animationElementMap.set(element, element); 47493 this._beforeAnimationBuild(entry.player.namespaceId, entry.instruction, allPreviousPlayersMap); 47494 } 47495 }); 47496 skippedPlayers.forEach(player => { 47497 const element = player.element; 47498 const previousPlayers = this._getPreviousPlayers(element, false, player.namespaceId, player.triggerName, null); 47499 previousPlayers.forEach(prevPlayer => { 47500 (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.getOrSetDefaultValue)(allPreviousPlayersMap, element, []).push(prevPlayer); 47501 prevPlayer.destroy(); 47502 }); 47503 }); 47504 // this is a special case for nodes that will be removed either by 47505 // having their own leave animations or by being queried in a container 47506 // that will be removed once a parent animation is complete. The idea 47507 // here is that * styles must be identical to ! styles because of 47508 // backwards compatibility (* is also filled in by default in many places). 47509 // Otherwise * styles will return an empty value or "auto" since the element 47510 // passed to getComputedStyle will not be visible (since * === destination) 47511 const replaceNodes = allLeaveNodes.filter(node => { 47512 return replacePostStylesAsPre(node, allPreStyleElements, allPostStyleElements); 47513 }); 47514 // POST STAGE: fill the * styles 47515 const postStylesMap = new Map(); 47516 const allLeaveQueriedNodes = cloakAndComputeStyles(postStylesMap, this.driver, leaveNodesWithoutAnimations, allPostStyleElements, _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_4__.AUTO_STYLE); 47517 allLeaveQueriedNodes.forEach(node => { 47518 if (replacePostStylesAsPre(node, allPreStyleElements, allPostStyleElements)) { 47519 replaceNodes.push(node); 47520 } 47521 }); 47522 // PRE STAGE: fill the ! styles 47523 const preStylesMap = new Map();
47524 enterNodeMap.forEach((nodes, root) => { 47525 cloakAndComputeStyles(preStylesMap, this.driver, new Set(nodes), allPreStyleElements, _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_4__["ɵPRE_STYLE"]); 47526 }); 47527 replaceNodes.forEach(node => { 47528 var _post$entries, _pre$entries; 47529 const post = postStylesMap.get(node); 47530 const pre = preStylesMap.get(node); 47531 postStylesMap.set(node, new Map([...((_post$entries = post === null || post === void 0 ? void 0 : post.entries()) !== null && _post$entries !== void 0 ? _post$entries : []), ...((_pre$entries = pre === null || pre === void 0 ? void 0 : pre.entries()) !== null && _pre$entries !== void 0 ? _pre$entries : [])])); 47532 }); 47533 const rootPlayers = []; 47534 const subPlayers = []; 47535 const NO_PARENT_ANIMATION_ELEMENT_DETECTED = {}; 47536 queuedInstructions.forEach(entry => { 47537 const { 47538 element, 47539 player, 47540 instruction 47541 } = entry; 47542 // this means that it was never consumed by a parent animation which 47543 // means that it is independent and therefore should be set for animation 47544 if (subTimelines.has(element)) { 47545 if (disabledElementsSet.has(element)) { 47546 player.onDestroy(() => (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.setStyles)(element, instruction.toStyles)); 47547 player.disabled = true; 47548 player.overrideTotalTime(instruction.totalTime); 47549 skippedPlayers.push(player); 47550 return; 47551 } 47552 // this will flow up the DOM and query the map to figure out 47553 // if a parent animation has priority over it. In the situation 47554 // that a parent is detected then it will cancel the loop. If 47555 // nothing is detected, or it takes a few hops to find a parent, 47556 // then it will fill in the missing nodes and signal them as having 47557 // a detected parent (or a NO_PARENT value via a special constant). 47558 let parentWithAnimation = NO_PARENT_ANIMATION_ELEMENT_DETECTED; 47559 if (animationElementMap.size > 1) { 47560 let elm = element; 47561 const parentsToAdd = []; 47562 while (elm = elm.parentNode) { 47563 const detectedParent = animationElementMap.get(elm); 47564 if (detectedParent) { 47565 parentWithAnimation = detectedParent; 47566 break; 47567 } 47568 parentsToAdd.push(elm); 47569 } 47570 parentsToAdd.forEach(parent => animationElementMap.set(parent, parentWithAnimation)); 47571 } 47572 const innerPlayer = this._buildAnimation(player.namespaceId, instruction, allPreviousPlayersMap, skippedPlayersMap, preStylesMap, postStylesMap); 47573 player.setRealPlayer(innerPlayer); 47574 if (parentWithAnimation === NO_PARENT_ANIMATION_ELEMENT_DETECTED) { 47575 rootPlayers.push(player); 47576 } else { 47577 const parentPlayers = this.playersByElement.get(parentWithAnimation); 47578 if (parentPlayers && parentPlayers.length) { 47579 player.parentPlayer = (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.optimizeGroupPlayer)(parentPlayers); 47580 } 47581 skippedPlayers.push(player); 47582 } 47583 } else { 47584 (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.eraseStyles)(element, instruction.fromStyles); 47585 player.onDestroy(() => (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.setStyles)(element, instruction.toStyles)); 47586 // there still might be a ancestor player animating this 47587 // element therefore we will still add it as a sub player 47588 // even if its animation may be disabled 47589 subPlayers.push(player); 47590 if (disabledElementsSet.has(element)) { 47591 skippedPlayers.push(player); 47592 } 47593 } 47594 }); 47595 // find all of the sub players' corresponding inner animation players 47596 subPlayers.forEach(player => { 47597 // even if no players are found for a sub animation it 47598 // will still complete itself after the next tick since it's Noop 47599 const playersForElement = skippedPlayersMap.get(player.element); 47600 if (playersForElement && playersForElement.length) { 47601 const innerPlayer = (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.optimizeGroupPlayer)(playersForElement); 47602 player.setRealPlayer(innerPlayer); 47603 } 47604 }); 47605 // the reason why we don't actually play the animation is 47606 // because all that a skipped player is designed to do is to 47607 // fire the start/done transition callback events
47608 skippedPlayers.forEach(player => { 47609 if (player.parentPlayer) { 47610 player.syncPlayerEvents(player.parentPlayer); 47611 } else { 47612 player.destroy(); 47613 } 47614 }); 47615 // run through all of the queued removals and see if they 47616 // were picked up by a query. If not then perform the removal 47617 // operation right away unless a parent animation is ongoing. 47618 for (let i = 0; i < allLeaveNodes.length; i++) { 47619 const element = allLeaveNodes[i]; 47620 const details = element[REMOVAL_FLAG]; 47621 removeClass(element, _util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.LEAVE_CLASSNAME); 47622 // this means the element has a removal animation that is being 47623 // taken care of and therefore the inner elements will hang around 47624 // until that animation is over (or the parent queried animation) 47625 if (details && details.hasAnimation) continue; 47626 let players = []; 47627 // if this element is queried or if it contains queried children 47628 // then we want for the element not to be removed from the page 47629 // until the queried animations have finished 47630 if (queriedElements.size) { 47631 let queriedPlayerResults = queriedElements.get(element); 47632 if (queriedPlayerResults && queriedPlayerResults.length) { 47633 players.push(...queriedPlayerResults); 47634 } 47635 let queriedInnerElements = this.driver.query(element, _util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.NG_ANIMATING_SELECTOR, true); 47636 for (let j = 0; j < queriedInnerElements.length; j++) { 47637 let queriedPlayers = queriedElements.get(queriedInnerElements[j]); 47638 if (queriedPlayers && queriedPlayers.length) { 47639 players.push(...queriedPlayers); 47640 } 47641 } 47642 } 47643 const activePlayers = players.filter(p => !p.destroyed); 47644 if (activePlayers.length) { 47645 removeNodesAfterAnimationDone(this, element, activePlayers); 47646 } else { 47647 this.processLeaveNode(element); 47648 } 47649 } 47650 // this is required so the cleanup method doesn't remove them 47651 allLeaveNodes.length = 0; 47652 rootPlayers.forEach(player => { 47653 this.players.push(player); 47654 player.onDone(() => { 47655 player.destroy(); 47656 const index = this.players.indexOf(player); 47657 this.players.splice(index, 1); 47658 }); 47659 player.play(); 47660 }); 47661 return rootPlayers; 47662 } 47663 afterFlush(callback) { 47664 this._flushFns.push(callback); 47665 } 47666 afterFlushAnimationsDone(callback) { 47667 this._whenQuietFns.push(callback); 47668 } 47669 _getPreviousPlayers(element, isQueriedElement, namespaceId, triggerName, toStateValue) { 47670 let players = []; 47671 if (isQueriedElement) { 47672 const queriedElementPlayers = this.playersByQueriedElement.get(element); 47673 if (queriedElementPlayers) { 47674 players = queriedElementPlayers; 47675 } 47676 } else { 47677 const elementPlayers = this.playersByElement.get(element); 47678 if (elementPlayers) { 47679 const isRemovalAnimation = !toStateValue || toStateValue == VOID_VALUE; 47680 elementPlayers.forEach(player => { 47681 if (player.queued) return; 47682 if (!isRemovalAnimation && player.triggerName != triggerName) return; 47683 players.push(player); 47684 }); 47685 } 47686 } 47687 if (namespaceId || triggerName) { 47688 players = players.filter(player => { 47689 if (namespaceId && namespaceId != player.namespaceId) return false; 47690 if (triggerName && triggerName != player.triggerName) return false; 47691 return true; 47692 }); 47693 } 47694 return players; 47695 } 47696 _beforeAnimationBuild(namespaceId, instruction, allPreviousPlayersMap) { 47697 const triggerName = instruction.triggerName; 47698 const rootElement = instruction.element; 47699 // when a removal animation occurs, ALL previous players are collected 47700 // and destroyed (even if they are outside of the current namespace) 47701 const targetNameSpaceId = instruction.isRemovalTransition ? undefined : namespaceId; 47702 const targetTriggerName = instruction.isRemovalTransition ? undefined : triggerName;
47703 for (const timelineInstruction of instruction.timelines) { 47704 const element = timelineInstruction.element; 47705 const isQueriedElement = element !== rootElement; 47706 const players = (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.getOrSetDefaultValue)(allPreviousPlayersMap, element, []); 47707 const previousPlayers = this._getPreviousPlayers(element, isQueriedElement, targetNameSpaceId, targetTriggerName, instruction.toState); 47708 previousPlayers.forEach(player => { 47709 const realPlayer = player.getRealPlayer(); 47710 if (realPlayer.beforeDestroy) { 47711 realPlayer.beforeDestroy(); 47712 } 47713 player.destroy(); 47714 players.push(player); 47715 }); 47716 } 47717 // this needs to be done so that the PRE/POST styles can be 47718 // computed properly without interfering with the previous animation 47719 (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.eraseStyles)(rootElement, instruction.fromStyles); 47720 } 47721 _buildAnimation(namespaceId, instruction, allPreviousPlayersMap, skippedPlayersMap, preStylesMap, postStylesMap) { 47722 const triggerName = instruction.triggerName; 47723 const rootElement = instruction.element; 47724 // we first run this so that the previous animation player 47725 // data can be passed into the successive animation players 47726 const allQueriedPlayers = []; 47727 const allConsumedElements = new Set(); 47728 const allSubElements = new Set(); 47729 const allNewPlayers = instruction.timelines.map(timelineInstru
47729ction => { 47730 const element = timelineInstruction.element; 47731 allConsumedElements.add(element); 47732 // FIXME (matsko): make sure to-be-removed animations are removed properly 47733 const details = element[REMOVAL_FLAG]; 47734 if (details && details.removedBeforeQueried) return new _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_4__.NoopAnimationPlayer(timelineInstruction.duration, timelineInstruction.delay); 47735 const isQueriedElement = element !== rootElement; 47736 const previousPlayers = flattenGroupPlayers((allPreviousPlayersMap.get(element) || EMPTY_PLAYER_ARRAY).map(p => p.getRealPlayer())).filter(p => { 47737 // the `element` is not apart of the AnimationPlayer definition, but 47738 // Mock/WebAnimations 47739 // use the element within their implementation. This will be added in Angular5 to 47740 // AnimationPlayer 47741 const pp = p; 47742 return pp.element ? pp.element === element : false; 47743 }); 47744 const preStyles = preStylesMap.get(element); 47745 const postStyles = postStylesMap.get(element); 47746 const keyframes = (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.normalizeKeyframes)(this._normalizer, timelineInstru
47746ction.keyframes, preStyles, postStyles); 47747 const player = this._buildPlayer(timelineInstruction, keyframes, previousPlayers); 47748 // this means that this particular player belongs to a sub trigger. It is 47749 // important that we match this player up with the corresponding (@trigger.listener) 47750 if (timelineInstruction.subTimeline && skippedPlayersMap) { 47751 allSubElements.add(element); 47752 } 47753 if (isQueriedElement) { 47754 const wrappedPlayer = new TransitionAnimationPlayer(namespaceId, triggerName, element); 47755 wrappedPlayer.setRealPlayer(player); 47756 allQueriedPlayers.push(wrappedPlayer); 47757 } 47758 return player; 47759 }); 47760 allQueriedPlayers.forEach(player => { 47761 (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.getOrSetDefaultValue)(this.playersByQueriedElement, player.element, []).push(player); 47762 player.onDone(() => deleteOrUnsetInMap(this.playersByQueriedElement, player.element, player)); 47763 }); 47764 allConsumedElements.forEach(element => addClass(element, _util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.NG_ANIMATING_CLASSNAME)); 47765 const player = (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.optimizeGroupPlayer)(allNewPlayers); 47766 player.onDestroy(() => { 47767 allConsumedElements.forEach(element => removeClass(element, _util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.NG_ANIMATING_CLASSNAME)); 47768 (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.setStyles)(rootElement, instruction.toStyles); 47769 }); 47770 // this basically makes all of the callbacks for sub element animations 47771 // be dependent on the upper players for when they finish 47772 allSubElements.forEach(element => { 47773 (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.getOrSetDefaultValue)(skippedPlayersMap, element, []).push(player); 47774 }); 47775 return player; 47776 } 47777 _buildPlayer(instruction, keyframes, previousPlayers) { 47778 if (keyframes.length > 0) { 47779 return this.driver.animate(instruction.element, keyframes, instruction.duration, instruction.delay, instruction.easing, previousPlayers); 47780 } 47781 // special case for when an empty transition|definition is provided 47782 // ... there is no point in rendering an empty animation 47783 return new _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_4__.NoopAnimationPlayer(instruction.duration, instruction.delay); 47784 } 47785} 47786class TransitionAnimationPlayer { 47787 constructor(namespaceId, triggerName, element) { 47788 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "namespaceId", void 0); 47789 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "triggerName", void 0); 47790 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "element", void 0); 47791 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_player", new _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_4__.NoopAnimationPlayer()); 47792 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_containsRealPlayer", false); 47793 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_queuedCallbacks", new Map()); 47794 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "destroyed", false); 47795 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "parentPlayer", null); 47796 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "markedForDestroy", false); 47797 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "disabled", false); 47798 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "queued", true); 47799 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "totalTime", 0); 47800 this.namespaceId = namespaceId; 47801 this.triggerName = triggerName; 47802 this.element = element; 47803 } 47804 setRealPlayer(player) { 47805 if (this._containsRealPlayer) return; 47806 this._player = player; 47807 this._queuedCallbacks.forEach((callbacks, phase) => { 47808 callbacks.forEach(callback => (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.listenOnPlayer)(player, phase, undefined, callback)); 47809 }); 47810 this._queuedCallbacks.clear(); 47811 this._containsRealPlayer = true; 47812 this.overrideTotalTime(player.totalTime); 47813 this.queued = false;
vendor: 4,095 bytes, lines 47814-47956
47814 } 47815 getRealPlayer() { 47816 return this._player; 47817 } 47818 overrideTotalTime(totalTime) { 47819 this.totalTime = totalTime; 47820 } 47821 syncPlayerEvents(player) { 47822 const p = this._player; 47823 if (p.triggerCallback) { 47824 player.onStart(() => p.triggerCallback('start')); 47825 } 47826 player.onDone(() => this.finish()); 47827 player.onDestroy(() => this.destroy()); 47828 } 47829 _queueEvent(name, callback) { 47830 (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.getOrSetDefaultValue)(this._queuedCallbacks, name, []).push(callback); 47831 } 47832 onDone(fn) { 47833 if (this.queued) { 47834 this._queueEvent('done', fn); 47835 } 47836 this._player.onDone(fn); 47837 } 47838 onStart(fn) { 47839 if (this.queued) { 47840 this._queueEvent('start', fn); 47841 } 47842 this._player.onStart(fn); 47843 } 47844 onDestroy(fn) { 47845 if (this.queued) { 47846 this._queueEvent('destroy', fn); 47847 } 47848 this._player.onDestroy(fn); 47849 } 47850 init() { 47851 this._player.init(); 47852 } 47853 hasStarted() { 47854 return this.queued ? false : this._player.hasStarted(); 47855 } 47856 play() { 47857 !this.queued && this._player.play(); 47858 } 47859 pause() { 47860 !this.queued && this._player.pause(); 47861 } 47862 restart() { 47863 !this.queued && this._player.restart(); 47864 } 47865 finish() { 47866 this._player.finish(); 47867 } 47868 destroy() { 47869 this.destroyed = true; 47870 this._player.destroy(); 47871 } 47872 reset() { 47873 !this.queued && this._player.reset(); 47874 } 47875 setPosition(p) { 47876 if (!this.queued) { 47877 this._player.setPosition(p); 47878 } 47879 } 47880 getPosition() { 47881 return this.queued ? 0 : this._player.getPosition(); 47882 } 47883 /** @internal */ 47884 triggerCallback(phaseName) { 47885 const p = this._player; 47886 if (p.triggerCallback) { 47887 p.triggerCallback(phaseName); 47888 } 47889 } 47890} 47891function deleteOrUnsetInMap(map, key, value) { 47892 let currentValues = map.get(key); 47893 if (currentValues) { 47894 if (currentValues.length) { 47895 const index = currentValues.indexOf(value); 47896 currentValues.splice(index, 1); 47897 } 47898 if (currentValues.length == 0) { 47899 map.delete(key); 47900 } 47901 } 47902 return currentValues; 47903} 47904function normalizeTriggerValue(value) { 47905 // we use `!= null` here because it's the most simple 47906 // way to test against a "falsy" value without mixing 47907 // in empty strings or a zero value. DO NOT OPTIMIZE. 47908 return value != null ? value : null; 47909} 47910function isElementNode(node) { 47911 return node && node['nodeType'] === 1; 47912} 47913function isTriggerEventValid(eventName) { 47914 return eventName == 'start' || eventName == 'done'; 47915} 47916function cloakElement(element, value) { 47917 const oldValue = element.style.display; 47918 element.style.display = value != null ? value : 'none'; 47919 return oldValue; 47920} 47921function cloakAndComputeStyles(valuesMap, driver, elements, elementPropsMap, defaultStyle) { 47922 const cloakVals = []; 47923 elements.forEach(element => cloakVals.push(cloakElement(element))); 47924 const failedElements = []; 47925 elementPropsMap.forEach((props, element) => { 47926 const styles = new Map(); 47927 props.forEach(prop => { 47928 const value = driver.computeStyle(element, prop, defaultStyle); 47929 styles.set(prop, value); 47930 // there is no easy way to detect this because a sub element could be removed 47931 // by a parent animation element being detached. 47932 if (!value || value.length == 0) { 47933 element[REMOVAL_FLAG] = NULL_REMOVED_QUERIED_STATE; 47934 failedElements.push(element); 47935 } 47936 }); 47937 valuesMap.set(element, styles); 47938 }); 47939 // we use a index variable here since Set.forEach(a, i) does not return 47940 // an index value for the closure (but instead just the value) 47941 let i = 0; 47942 elements.forEach(element => cloakElement(element, cloakVals[i++])); 47943 return failedElements; 47944} 47945/* 47946Since the Angular renderer code will return a collection of inserted 47947nodes in all areas of a DOM tree, it's up to this algorithm to figure 47948out which nodes are roots for each animation @trigger. 47949 47950By placing each inserted node into a Set and traversing upwards, it 47951is possible to find the @trigger elements and well any direct *star 47952insertion nodes, if a @trigger root is found then the enter element 47953is placed into the Map[@trigger] spot. 47954 */ 47955function buildRootMap(roots, nodes) { 47956 const rootMap = new Map();
47957 roots.forEach(root => rootMap.set(root, [])); 47958 if (nodes.length == 0) return rootMap; 47959 const NULL_NODE = 1; 47960 const nodeSet = new Set(nodes); 47961 const localRootMap = new Map(); 47962 function getRoot(node) { 47963 if (!node) return NULL_NODE; 47964 let root = localRootMap.get(node); 47965 if (root) return root; 47966 const parent = node.parentNode; 47967 if (rootMap.has(parent)) { 47968 // ngIf inside @trigger 47969 root = parent; 47970 } else if (nodeSet.has(parent)) { 47971 // ngIf inside ngIf 47972 root = NULL_NODE; 47973 } else { 47974 // recurse upwards 47975 root = getRoot(parent); 47976 } 47977 localRootMap.set(node, root); 47978 return root; 47979 } 47980 nodes.forEach(node => { 47981 const root = getRoot(node); 47982 if (root !== NULL_NODE) { 47983 rootMap.get(root).push(node); 47984 } 47985 }); 47986 return rootMap; 47987} 47988function addClass(element, className) { 47989 var _element$classList2; 47990 (_element$classList2 = element.classList) === null || _element$classList2 === void 0 || _element$classList2.add(className); 47991} 47992function removeClass(element, className) { 47993 var _element$classList3; 47994 (_element$classList3 = element.classList) === null || _element$classList3 === void 0 || _element$classList3.remove(className); 47995} 47996function removeNodesAfterAnimationDone(engine, element, players) { 47997 (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.optimizeGroupPlayer)(players).onDone(() => engine.processLeaveNode(element)); 47998} 47999function flattenGroupPlayers(players) { 48000 const finalPlayers = []; 48001 _flattenGroupPlayersRecur(players, finalPlayers); 48002 return finalPlayers; 48003} 48004function _flattenGroupPlayersRecur(players, finalPlayers) { 48005 for (let i = 0; i < players.length; i++) { 48006 const player = players[i]; 48007 if (player instanceof _private_export_faY_wCkZ_mjs__WEBPACK_IMPORTED_MODULE_4__.AnimationGroupPlayer) { 48008 _flattenGroupPlayersRecur(player.players, finalPlayers); 48009 } else { 48010 finalPlayers.push(player); 48011 } 48012 } 48013} 48014function objEquals(a, b) { 48015 const k1 = Object.keys(a); 48016 const k2 = Object.keys(b); 48017 if (k1.length != k2.length) return false; 48018 for (let i = 0; i < k1.length; i++) { 48019 const prop = k1[i]; 48020 if (!b.hasOwnProperty(prop) || a[prop] !== b[prop]) return false; 48021 } 48022 return true; 48023} 48024function replacePostStylesAsPre(element, allPreStyleElements, allPostStyleElements) { 48025 const postEntry = allPostStyleElements.get(element); 48026 if (!postEntry) return false; 48027 let preEntry = allPreStyleElements.get(element); 48028 if (preEntry) { 48029 postEntry.forEach(data => preEntry.add(data)); 48030 } else { 48031 allPreStyleElements.set(element, postEntry); 48032 } 48033 allPostStyleElements.delete(element); 48034 return true; 48035} 48036class AnimationEngine { 48037 constructor(doc, _driver, _normalizer) { 48038 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_driver", void 0); 48039 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_normalizer", void 0); 48040 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_transitionEngine", void 0); 48041 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_timelineEngine", void 0); 48042 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_triggerCache", {}); 48043 // this method is designed to be overridden by the code that uses this engine 48044 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "onRemovalComplete", (element, context) => {}); 48045 this._driver = _driver; 48046 this._normalizer = _normalizer; 48047 this._transitionEngine = new TransitionAnimationEngine(doc.body, _driver, _normalizer); 48048 this._timelineEngine = new TimelineAnimationEngine(doc.body, _driver, _normalizer); 48049 this._transitionEngine.onRemovalComplete = (element, context) => this.onRemovalComplete(element, context); 48050 } 48051 registerTrigger(componentId, namespaceId, hostElement, name, metadata) { 48052 const cacheKey = componentId + '-' + name; 48053 let trigger = this._triggerCache[cacheKey]; 48054 if (!trigger) { 48055 const errors = []; 48056 const warnings = []; 48057 const ast = buildAnimationAst(this._driver, metadata, errors, warnings); 48058 if (errors.length) { 48059 throw (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.triggerBuildFailed)(name, errors); 48060 } 48061 if (typeof ngDevMode === 'undefined' || ngDevMode) { 48062 if (warnings.length) { 48063 warnTriggerBuild(name, warnings); 48064 } 48065 } 48066 trigger = buildTrigger(name, ast, this._normalizer); 48067 this._triggerCache[cacheKey] = trigger; 48068 } 48069 this._transitionEngine.registerTrigger(namespaceId, name, trigger); 48070 } 48071 register(namespaceId, hostElement) { 48072 this._transitionEngine.register(namespaceId, hostElement); 48073 } 48074 destroy(namespaceId, context) { 48075 this._transitionEngine.destroy(namespaceId, context); 48076 } 48077 onInsert(namespaceId, element, parent, insertBefore) {
48078 this._transitionEngine.insertNode(namespaceId, element, parent, insertBefore); 48079 } 48080 onRemove(namespaceId, element, context) { 48081 this._transitionEngine.removeNode(namespaceId, element, context); 48082 } 48083 disableAnimations(element, disable) { 48084 this._transitionEngine.markElementAsDisabled(element, disable); 48085 } 48086 process(namespaceId, element, property, value) { 48087 if (property.charAt(0) == '@') { 48088 const [id, action] = (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.parseTimelineCommand)(property); 48089 const args = value; 48090 this._timelineEngine.command(id, element, action, args); 48091 } else { 48092 this._transitionEngine.trigger(namespaceId, element, property, value); 48093 } 48094 } 48095 listen(namespaceId, element, eventName, eventPhase, callback) { 48096 // @@listen 48097 if (eventName.charAt(0) == '@') { 48098 const [id, action] = (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.parseTimelineCommand)(eventName); 48099 return this._timelineEngine.listen(id, element, action, callback); 48100 } 48101 return this._transitionEngine.listen(namespaceId, element, eventName, eventPhase, callback); 48102 } 48103 flush(microtaskId = -1) { 48104 this._transitionEngine.flush(microtaskId); 48105 } 48106 get players() { 48107 return [...this._transitionEngine.players, ...this._timelineEngine.players]; 48108 } 48109 whenRenderingDone() { 48110 return this._transitionEngine.whenRenderingDone(); 48111 } 48112 afterFlushAnimationsDone(cb) { 48113 this._transitionEngine.afterFlushAnimationsDone(cb); 48114 } 48115} 48116 48117/** 48118 * Returns an instance of `SpecialCasedStyles` if and when any special (non animateable) styles are 48119 * detected. 48120 * 48121 * In CSS there exist properties that cannot be animated within a keyframe animation 48122 * (whether it be via CSS keyframes or web-animations) and the animation implementation 48123 * will ignore them. This function is designed to detect those special cased styles and 48124 * return a container that will be executed at the start and end of the animation. 48125 * 48126 * @returns an instance of `SpecialCasedStyles` if any special styles are detected otherwise `null` 48127 */ 48128function packageNonAnimatableStyles(element, styles) { 48129 let startStyles = null; 48130 let endStyles = null; 48131 if (Array.isArray(styles) && styles.length) { 48132 startStyles = filterNonAnimatableStyles(styles[0]); 48133 if (styles.length > 1) { 48134 endStyles = filterNonAnimatableStyles(styles[styles.length - 1]); 48135 } 48136 } else if (styles instanceof Map) { 48137 startStyles = filterNonAnimatableStyles(styles); 48138 } 48139 return startStyles || endStyles ? new SpecialCasedStyles(element, startStyles, endStyles) : null; 48140} 48141/** 48142 * Designed to be executed during a keyframe-based animation to apply any special-cased styles. 48143 * 48144 * When started (when the `start()` method is run) then the provided `startStyles` 48145 * will be applied. When finished (when the `finish()` method is called) the 48146 * `endStyles` will be applied as well any any starting styles. Finally when 48147 * `destroy()` is called then all styles will be removed. 48148 */ 48149let SpecialCasedStyles = /*#__PURE__*/(() => { 48150 class SpecialCasedStyles { 48151 constructor(_element, _startStyles, _endStyles) { 48152 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_element", void 0); 48153 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_startStyles", void 0); 48154 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_endStyles", void 0); 48155 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_state", 0 /* SpecialCasedStylesState.Pending */); 48156 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_initialStyles", void 0); 48157 this._element = _element; 48158 this._startStyles = _startStyles; 48159 this._endStyles = _endStyles; 48160 let initialStyles = SpecialCasedStyles.initialStylesByElement.get(_element); 48161 if (!initialStyles) { 48162 SpecialCasedStyles.initialStylesByElement.set(_element, initialStyles = new Map()); 48163 } 48164 this._initialStyles = initialStyles; 48165 } 48166 start() { 48167 if (this._state < 1 /* SpecialCasedStylesState.Started */) { 48168 if (this._startStyles) { 48169 (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.setStyles)(this._element, this._startStyles, this._initialStyles); 48170 } 48171 this._state = 1 /* SpecialCasedStylesState.Started */; 48172 } 48173 } 48174 finish() { 48175 this.start(); 48176 if (this._state < 2 /* SpecialCasedStylesState.Finished */) { 48177 (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.setStyles)(this._element, this._initialStyles); 48178 if (this._endStyles) { 48179 (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.setStyles)(this._element, this._endStyles); 48180 this._endStyles = null; 48181 } 48182 this._state = 1 /* SpecialCasedStylesState.Started */; 48183 } 48184 } 48185 destroy() { 48186 this.finish(); 48187 if (this._state < 3 /* SpecialCasedStylesState.Destroyed */) { 48188 SpecialCasedStyles.initialStylesByElement.delete(this._element); 48189 if (this._startStyles) { 48190 (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.eraseStyles)(this._element, this._startStyles); 48191 this._endStyles = null; 48192 } 48193 if (this._endStyles) { 48194 (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.eraseStyles)(this._element, this._endStyles); 48195 this._endStyles = null; 48196 } 48197 (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.setStyles)(this._element, this._initialStyles); 48198 this._state = 3 /* SpecialCasedStylesState.Destroyed */; 48199 } 48200 } 48201 } 48202 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(SpecialCasedStyles, "initialStylesByElement", /* @__P
48202URE__ */new WeakMap()); 48203 return SpecialCasedStyles; 48204})(); 48205function filterNonAnimatableStyles(styles) { 48206 let result = null; 48207 styles.forEach((val, prop) => { 48208 if (isNonAnimatableStyle(prop)) { 48209 result = result || new Map(); 48210 result.set(prop, val); 48211 } 48212 }); 48213 return result; 48214} 48215function isNonAnimatableStyle(prop) { 48216 return prop === 'display' || prop === 'position'; 48217} 48218class WebAnimationsPlayer { 48219 constructor(element, keyframes, options, _specialStyles) { 48220 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "element", void 0); 48221 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "keyframes", void 0); 48222 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "options", void 0); 48223 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_specialStyles", void 0); 48224 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_onDoneFns", []); 48225 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_onStartFns", []); 48226 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_onDestroyFns", []); 48227 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_duration", void 0); 48228 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_delay", void 0); 48229 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_initialized", false); 48230 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_finished", false); 48231 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_started", false); 48232 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_destroyed", false); 48233 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_finalKeyframe", void 0); 48234 // the following original fns are persistent copies of the _onStartFns and _onDoneFns 48235 // and are used to reset the fns to their original values upon reset() 48236 // (since the _onStartFns and _onDoneFns get deleted after they are called) 48237 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_originalOnDoneFns", []); 48238 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_originalOnStartFns", []); 48239 // using non-null assertion because it's re(set) by init(); 48240 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "domPlayer", void 0); 48241 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "time", 0); 48242 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "parentPlayer", null); 48243 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "currentSnapshot", new Map()); 48244 this.element = element; 48245 this.keyframes = keyframes; 48246 this.options = options; 48247 this._specialStyles = _specialStyles; 48248 this._duration = options['duration'];
48249 this._delay = options['delay'] || 0; 48250 this.time = this._duration + this._delay; 48251 } 48252 _onFinish() { 48253 if (!this._finished) { 48254 this._finished = true; 48255 this._onDoneFns.forEach(fn => fn()); 48256 this._onDoneFns = []; 48257 } 48258 } 48259 init() { 48260 this._buildPlayer(); 48261 this._preparePlayerBeforeStart(); 48262 } 48263 _buildPlayer() { 48264 if (this._initialized) return; 48265 this._initialized = true; 48266 const keyframes = this.keyframes; 48267 // @ts-expect-error overwriting a readonly property 48268 this.domPlayer = this._triggerWebAnimation(this.element, keyframes, this.options); 48269 this._finalKeyframe = keyframes.length ? keyframes[keyframes.length - 1] : new Map(); 48270 const onFinish = () => this._onFinish(); 48271 this.domPlayer.addEventListener('finish', onFinish); 48272 this.onDestroy(() => { 48273 // We must remove the `finish` event listener once an animation has completed all its 48274 // iterations. This action is necessary to prevent a memory leak since the listener captures 48275 // `this`, creating a closure that prevents `this` from being garbage collected. 48276 this.domPlayer.removeEventListener('finish', onFinish); 48277 }); 48278 } 48279 _preparePlayerBeforeStart() { 48280 // this is required so that the player doesn't start to animate right away 48281 if (this._delay) { 48282 this._resetDomPlayerState(); 48283 } else { 48284 this.domPlayer.pause(); 48285 } 48286 } 48287 _convertKeyframesToObject(keyframes) { 48288 const kfs = []; 48289 keyframes.forEach(frame => { 48290 kfs.push(Object.fromEntries(frame)); 48291 }); 48292 return kfs; 48293 } 48294 /** @internal */ 48295 _triggerWebAnimation(element, keyframes, options) { 48296 return element.animate(this._convertKeyframesToObject(keyframes), options); 48297 } 48298 onStart(fn) { 48299 this._originalOnStartFns.push(fn); 48300 this._onStartFns.push(fn); 48301 } 48302 onDone(fn) { 48303 this._originalOnDoneFns.push(fn); 48304 this._onDoneFns.push(fn); 48305 } 48306 onDestroy(fn) { 48307 this._onDestroyFns.push(fn); 48308 } 48309 play() { 48310 this._buildPlayer(); 48311 if (!this.hasStarted()) { 48312 this._onStartFns.forEach(fn => fn()); 48313 this._onStartFns = []; 48314 this._started = true; 48315 if (this._specialStyles) { 48316 this._specialStyles.start(); 48317 } 48318 } 48319 this.domPlayer.play(); 48320 } 48321 pause() { 48322 this.init(); 48323 this.domPlayer.pause(); 48324 } 48325 finish() { 48326 this.init(); 48327 if (this._specialStyles) { 48328 this._specialStyles.finish(); 48329 } 48330 this._onFinish(); 48331 this.domPlayer.finish(); 48332 } 48333 reset() { 48334 this._resetDomPlayerState(); 48335 this._destroyed = false; 48336 this._finished = false; 48337 this._started = false; 48338 this._onStartFns = this._originalOnStartFns; 48339 this._onDoneFns = this._originalOnDoneFns; 48340 } 48341 _resetDomPlayerState() { 48342 if (this.domPlayer) { 48343 this.domPlayer.cancel(); 48344 } 48345 } 48346 restart() { 48347 this.reset(); 48348 this.play(); 48349 } 48350 hasStarted() { 48351 return this._started; 48352 } 48353 destroy() { 48354 if (!this._destroyed) { 48355 this._destroyed = true; 48356 this._resetDomPlayerState(); 48357 this._onFinish(); 48358 if (this._specialStyles) { 48359 this._specialStyles.destroy(); 48360 } 48361 this._onDestroyFns.forEach(fn => fn()); 48362 this._onDestroyFns = []; 48363 } 48364 } 48365 setPosition(p) { 48366 if (this.domPlayer === undefined) { 48367 this.init(); 48368 } 48369 this.domPlayer.currentTime = p * this.time; 48370 } 48371 getPosition() { 48372 var _this$domPlayer$curre; 48373 // tsc is complaining with TS2362 without the conversion to number 48374 return +((_this$domPlayer$curre = this.domPlayer.currentTime) !== null && _this$domPlayer$curre !== void 0 ? _this$domPlayer$curre : 0) / this.time; 48375 } 48376 get totalTime() { 48377 return this._delay + this._duration; 48378 } 48379 beforeDestroy() { 48380 const styles = new Map(); 48381 if (this.hasStarted()) { 48382 // note: this code is invoked only when the `play` function was called prior to this 48383 // (thus `hasStarted` returns true), this implies that the code that initializes 48384 // `_finalKeyframe` has also been executed and the non-null assertion can be safely used here 48385 const finalKeyframe = this._finalKeyframe; 48386 finalKeyframe.forEach((val, prop) => { 48387 if (prop !== 'offset') { 48388 styles.set(prop, this._finished ? val : (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.computeStyle)(this.element, prop)); 48389 } 48390 }); 48391 } 48392 this.currentSnapshot = styles; 48393 } 48394 /** @internal */ 48395 triggerCallback(phaseName) { 48396 const methods = phaseName === 'start' ? this._onStartFns : this._onDoneFns; 48397 methods.forEach(fn => fn()); 48398 methods.length = 0; 48399 } 48400} 48401class WebAnimationsDriver { 48402 validateStyleProperty(prop) { 48403 // Perform actual validation in dev mode only, in prod mode this check is a noop. 48404 if (typeof ngDevMode === 'undefined' || ngDevMode) { 48405 return (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.validateStyleProperty)(prop); 48406 } 48407 return true; 48408 } 48409 validateAnimatableStyleProperty(prop) { 48410 // Perform actual validation in dev mode only, in prod mode this check is a noop. 48411 if (typeof ngDevMode === 'undefined' || ngDevMode) { 48412 const cssProp = (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.camelCaseToDashCase)(prop); 48413 return (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.validateWebAnimatableStyleProperty)(cssProp); 48414 } 48415 return true; 48416 } 48417 containsElement(elm1, elm2) { 48418 return (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.containsElement)(elm1, elm2); 48419 } 48420 getParentElement(element) { 48421 return (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.getParentElement)(element); 48422 } 48423 query(element, selector, multi) { 48424 return (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.invokeQuery)(element, selector, multi); 48425 } 48426 computeStyle(element, prop, defaultValue) { 48427 return (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.computeStyle)(element, prop); 48428 } 48429 animate(element, keyframes, duration, delay, easing, previousPlayers = []) { 48430 const fill = delay == 0 ? 'both' : 'forwards'; 48431 const playerOptions = { 48432 duration, 48433 delay, 48434 fill 48435 }; 48436 // we check for this to avoid having a null|undefined value be present 48437 // for the easing (which results in an error for certain browsers #9752) 48438 if (easing) { 48439 playerOptions['easing'] = easing; 48440 } 48441 const previousStyles = new Map(); 48442 const previousWebAnimationPlayers = previousPlayers.filter(player => player instanceof WebAnimationsPlayer); 48443 if ((0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.allowPreviousPlayerStylesMerge)(duration, delay)) {
48444 previousWebAnimationPlayers.forEach(player => { 48445 player.currentSnapshot.forEach((val, prop) => previousStyles.set(prop, val)); 48446 }); 48447 } 48448 let _keyframes = (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.normalizeKeyframes$1)(keyframes).map(styles => new Map(styles)); 48449 _keyframes = (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.balancePreviousStylesIntoKeyframes)(element, _keyframes, previousStyles); 48450 const specialStyles = packageNonAnimatableStyles(element, _keyframes); 48451 return new WebAnimationsPlayer(element, _keyframes, playerOptions, specialStyles); 48452 } 48453} 48454function createEngine(type, doc) { 48455 // TODO: find a way to make this tree shakable. 48456 if (type === 'noop') { 48457 return new AnimationEngine(doc, new NoopAnimationDriver(), new NoopAnimationStyleNormalizer()); 48458 } 48459 return new AnimationEngine(doc, new WebAnimationsDriver(), new WebAnimationsStyleNormalizer()); 48460} 48461class Animation { 48462 constructor(_driver, input) { 48463 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_driver", void 0); 48464 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_animationAst", void 0); 48465 this._driver = _driver; 48466 const errors = []; 48467 const warnings = []; 48468 const ast = buildAnimationAst(_driver, input, errors, warnings); 48469 if (errors.length) { 48470 throw (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.validationFailed)(errors); 48471 } 48472 if (typeof ngDevMode === 'undefined' || ngDevMode) { 48473 if (warnings.length) { 48474 warnValidation(warnings); 48475 } 48476 } 48477 this._animationAst = ast; 48478 } 48479 buildTimelines(element, startingStyles, destinationStyles, options, subInstructions) { 48480 const start = Array.isArray(startingStyles) ? (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.normalizeStyles)(startingStyles) : startingStyles; 48481 const dest = Array.isArray(destinationStyles) ? (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.normalizeStyles)(destinationStyles) : destinationStyles; 48482 const errors = []; 48483 subInstructions = subInstructions || new ElementInstructionMap(); 48484 const result = buildAnimationTimelines(this._driver, element, this._animationAst, _util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.ENTER_CLASSNAME, _util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.LEAVE_CLASSNAME, start, dest, options, subInstructions, errors); 48485 if (errors.length) { 48486 throw (0,_util_D9FfmVnv_mjs__WEBPACK_IMPORTED_MODULE_3__.buildingFailed)(errors); 48487 } 48488 return result; 48489 } 48490} 48491const ANIMATION_PREFIX = '@'; 48492const DISABLE_ANIMATIONS_FLAG = '@.disabled'; 48493class BaseAnimationRenderer { 48494 constructor(namespaceId, delegate, engine, _onDestroy) { 48495 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "namespaceId", void 0); 48496 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "delegate", void 0); 48497 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "engine", void 0); 48498 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_onDestroy", void 0); 48499 // We need to explicitly type this property because of an api-extractor bug 48500 // See https://github.com/microsoft/rushstack/issues/4390 48501 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "\u0275type", 0 /* AnimationRendererType.Regular */); 48502 this.namespaceId = namespaceId; 48503 this.delegate = delegate; 48504 this.engine = engine; 48505 this._onDestroy = _onDestroy; 48506 } 48507 get data() { 48508 return this.delegate.data; 48509 } 48510 destroyNode(node) { 48511 var _this$delegate$destro, _this$delegate; 48512 (_this$delegate$destro = (_this$delegate = this.delegate).destroyNode) === null || _this$delegate$destro === void 0 || _this$delegate$destro.call(_this$delegate, node); 48513 } 48514 destroy() { 48515 var _this$_onDestroy; 48516 this.engine.destroy(this.namespaceId, this.delegate); 48517 this.engine.afterFlushAnimationsDone(() => { 48518 // Call the renderer destroy method after the animations has finished as otherwise 48519 // styles will be removed too early which will cause an unstyled animation. 48520 queueMicrotask(() => { 48521 this.delegate.destroy(); 48522 }); 48523 }); 48524 (_this$_onDestroy = this._onDestroy) === null || _this$_onDestroy === void 0 || _this$_onDestroy.call(this); 48525 } 48526 createElement(name, namespace) { 48527 return this.delegate.createElement(name, namespace); 48528 } 48529 createComment(value) { 48530 return this.delegate.createComment(value); 48531 } 48532 createText(value) { 48533 return this.delegate.createText(value); 48534 } 48535 appendChild(parent, newChild) { 48536 this.delegate.appendChild(parent, newChild); 48537 this.engine.onInsert(this.namespaceId, newChild, parent, false); 48538 } 48539 insertBefore(parent, newChild, refChild, isMove = true) { 48540 this.delegate.insertBefore(parent, newChild, refChild); 48541 // If `isMove` true than we should animate this insert. 48542 this.engine.onInsert(this.namespaceId, newChild, parent, isMove); 48543 } 48544 removeChild(parent, oldChild, isHostElement) { 48545 // Prior to the changes in #57203, this method wasn't being called at all by `core` if the child 48546 // doesn't have a parent. There appears to be some animation-specific downstream logic that 48547 // depends on the null check happening before the animation engine. This check keeps the old 48548 // behavior while allowing `core` to not have to check for the parent element anymore. 48549 if (this.parentNode(oldChild)) { 48550 this.engine.onRemove(this.namespaceId, oldChild, this.delegate); 48551 } 48552 } 48553 selectRootElement(selectorOrNode, preserveContent) { 48554 return this.delegate.selectRootElement(selectorOrNode, preserveContent); 48555 } 48556 parentNode(node) { 48557 return this.delegate.parentNode(node); 48558 } 48559 nextSibling(node) { 48560 return this.delegate.nextSibling(node); 48561 } 48562 setAttribute(el, name, value, namespace) { 48563 this.delegate.setAttribute(el, name, value, namespace); 48564 } 48565 removeAttribute(el, name, namespace) { 48566 this.delegate.removeAttribute(el, name, namespace); 48567 } 48568 addClass(el, name) { 48569 this.delegate.addClass(el, name); 48570 } 48571 removeClass(el, name) { 48572 this.delegate.removeClass(el, name); 48573 } 48574 setStyle(el, style, value, flags) { 48575 this.delegate.setStyle(el, style, value, flags); 48576 } 48577 removeStyle(el, style, flags) { 48578 this.delegate.removeStyle(el, style, flags); 48579 } 48580 setProperty(el, name, value) { 48581 if (name.charAt(0) == ANIMATION_PREFIX && name == DISABLE_ANIMATIONS_FLAG) { 48582 this.disableAnimations(el, !!value); 48583 } else { 48584 this.delegate.setProperty(el, name, value); 48585 } 48586 } 48587 setValue(node, value) { 48588 this.delegate.setValue(node, value); 48589 } 48590 listen(target, eventName, callback, options) { 48591 return this.delegate.listen(target, eventName, callback, options); 48592 } 48593 disableAnimations(element, value) { 48594 this.engine.disableAnimations(element, value); 48595 } 48596} 48597class AnimationRenderer extends BaseAnimationRenderer {
48598 constructor(factory, namespaceId, delegate, engine, onDestroy) { 48599 super(namespaceId, delegate, engine, onDestroy); 48600 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "factory", void 0); 48601 this.factory = factory; 48602 this.namespaceId = namespaceId; 48603 } 48604 setProperty(el, name, value) { 48605 if (name.charAt(0) == ANIMATION_PREFIX) { 48606 if (name.charAt(1) == '.' && name == DISABLE_ANIMATIONS_FLAG) { 48607 value = value === undefined ? true : !!value; 48608 this.disableAnimations(el, value); 48609 } else { 48610 this.engine.process(this.namespaceId, el, name.slice(1), value); 48611 } 48612 } else { 48613 this.delegate.setProperty(el, name, value); 48614 } 48615 } 48616 listen(target, eventName, callback, options) { 48617 if (eventName.charAt(0) == ANIMATION_PREFIX) { 48618 const element = resolveElementFromTarget(target); 48619 let name = eventName.slice(1); 48620 let phase = ''; 48621 // @listener.phase is for trigger animation callbacks 48622 // @@listener is for animation builder callbacks 48623 if (name.charAt(0) != ANIMATION_PREFIX) { 48624 [name, phase] = parseTriggerCallbackName(name); 48625 } 48626 return this.engine.listen(this.namespaceId, element, name, phase, event => { 48627 const countId = event['_data'] || -1; 48628 this.factory.scheduleListenerCallback(countId, callback, event); 48629 }); 48630 } 48631 return this.delegate.listen(target, eventName, callback, options); 48632 } 48633} 48634function resolveElementFromTarget(target) { 48635 switch (target) { 48636 case 'body': 48637 return document.body; 48638 case 'document': 48639 return document; 48640 case 'window': 48641 return window; 48642 default: 48643 return target; 48644 } 48645} 48646function parseTriggerCallbackName(triggerName) { 48647 const dotIndex = triggerName.indexOf('.'); 48648 const trigger = triggerName.substring(0, dotIndex); 48649 const phase = triggerName.slice(dotIndex + 1); 48650 return [trigger, phase]; 48651} 48652class AnimationRendererFactory { 48653 constructor(delegate, engine, _zone) { 48654 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "delegate", void 0); 48655 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "engine", void 0); 48656 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_zone", void 0); 48657 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_currentId", 0); 48658 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_microtaskId", 1); 48659 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_animationCallbacksBuffer", []); 48660 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_rendererCache", new Map()); 48661 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_2__["default"])(this, "_cdRecurDepth", 0); 48662 this.delegate = delegate; 48663 this.engine = engine; 48664 this._zone = _zone; 48665 engine.onRemovalComplete = (element, delegate) => { 48666 delegate === null || delegate === void 0 || delegate.removeChild(null, element); 48667 }; 48668 } 48669 createRenderer(hostElement, type) { 48670 var _type$data; 48671 const EMPTY_NAMESPACE_ID = ''; 48672 // cache the delegates to find out which cached delegate can 48673 // be used by which cached renderer 48674 const delegate = this.delegate.createRenderer(hostElement, type); 48675 if (!hostElement || !(type !== null && type !== void 0 && (_type$data = type.data) !== null && _type$data !== void 0 && _type$data['animation'])) { 48676 const cache = this._rendererCache; 48677 let renderer = cache.get(delegate); 48678 if (!renderer) { 48679 // Ensure that the renderer is removed from the cache on destroy 48680 // since it may contain references to detached DOM nodes. 48681 const onRendererDestroy = () => cache.delete(delegate); 48682 renderer = new BaseAnimationRenderer(EMPTY_NAMESPACE_ID, delegate, this.engine, onRendererDestroy); 48683 // only cache this result when the base renderer is used 48684 cache.set(delegate, renderer); 48685 } 48686 return renderer; 48687 } 48688 const componentId = type.id; 48689 const namespaceId = type.id + '-' + this._currentId; 48690 this._currentId++; 48691 this.engine.register(namespaceId, hostElement); 48692 const registerTrigger = trigger => { 48693 if (Array.isArray(trigger)) { 48694 trigger.forEach(registerTrigger); 48695 } else { 48696 this.engine.registerTrigger(componentId, namespaceId, hostElement, trigger.name, trigger); 48697 } 48698 }; 48699 const animationTriggers = type.data['animation'];
48700 animationTriggers.forEach(registerTrigger); 48701 return new AnimationRenderer(this, namespaceId, delegate, this.engine); 48702 } 48703 begin() { 48704 this._cdRecurDepth++; 48705 if (this.delegate.begin) { 48706 this.delegate.begin(); 48707 } 48708 } 48709 _scheduleCountTask() { 48710 queueMicrotask(() => { 48711 this._microtaskId++; 48712 }); 48713 } 48714 /** @internal */ 48715 scheduleListenerCallback(count, fn, data) { 48716 if (count >= 0 && count < this._microtaskId) { 48717 this._zone.run(() => fn(data)); 48718 return; 48719 } 48720 const animationCallbacksBuffer = this._animationCallbacksBuffer; 48721 if (animationCallbacksBuffer.length == 0) { 48722 queueMicrotask(() => { 48723 this._zone.run(() => { 48724 animationCallbacksBuffer.forEach(tuple => { 48725 const [fn, data] = tuple; 48726 fn(data); 48727 }); 48728 this._animationCallbacksBuffer = []; 48729 }); 48730 }); 48731 } 48732 animationCallbacksBuffer.push([fn, data]); 48733 } 48734 end() { 48735 this._cdRecurDepth--; 48736 // this is to prevent animations from running twice when an inner 48737 // component does CD when a parent component instead has inserted it 48738 if (this._cdRecurDepth == 0) { 48739 this._zone.runOutsideAngular(() => { 48740 this._scheduleCountTask(); 48741 this.engine.flush(this._microtaskId); 48742 }); 48743 } 48744 if (this.delegate.end) { 48745 this.delegate.end(); 48746 } 48747 } 48748 whenRenderingDone() { 48749 return this.engine.whenRenderingDone(); 48750 } 48751 /** 48752 * Used during HMR to clear any cached data about a component. 48753 * @param componentId ID of the component that is being replaced. 48754 */ 48755 componentReplaced(componentId) { 48756 var _this$delegate$compon, _this$delegate2; 48757 // Flush the engine since the renderer destruction waits for animations to be done. 48758 this.engine.flush(); 48759 (_this$delegate$compon = (_this$delegate2 = this.delegate).componentReplaced) === null || _this$delegate$compon === void 0 || _this$delegate$compon.call(_this$delegate2, componentId); 48760 } 48761} 48762 48763//# sourceMappingURL=browser.mjs.map 48764 48765/***/ }), 48766 48767/***/ 79355: 48768/*!*****************************************************************!*\ 48769 !*** ./node_modules/@angular/cdk/fesm2022/element-x4z00URv.mjs ***! 48770 \*****************************************************************/ 48771/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { 48772 48773__webpack_require__.r(__webpack_exports__); 48774/* harmony export */ __webpack_require__.d(__webpack_exports__, { 48775/* harmony export */ _: () => (/* binding */ _isNumberValue), 48776/* harmony export */ a: () => (/* binding */ coerceElement), 48777/* harmony export */ c: () => (/* binding */ coerceNumberProperty) 48778/* harmony export */ }); 48779/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 17705); 48780 48781function coerceNumberProperty(value, fallbackValue = 0) { 48782 if (_isNumberValue(value)) { 48783 return Number(value); 48784 } 48785 return arguments.length === 2 ? fallbackValue : 0; 48786} 48787/** 48788 * Whether the provided value is considered a number. 48789 * @docs-private 48790 */ 48791function _isNumberValue(value) { 48792 // parseFloat(value) handles most of the cases we're interested in (it treats null, empty string, 48793 // and other non-number values as NaN, where Number just uses 0) but it considers the string 48794 // '123hello' to be a valid number. Therefore we also check if Number(value) is NaN. 48795 return !isNaN(parseFloat(value)) && !isNaN(Number(value)); 48796} 48797 48798/** 48799 * Coerces an ElementRef or an Element into an element. 48800 * Useful for APIs that can accept either a ref or the native element itself. 48801 */ 48802function coerceElement(elementOrRef) { 48803 return elementOrRef instanceof _angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef ? elementOrRef.nativeElement : elementOrRef; 48804} 48805 48806//# sourceMappingURL=element-x4z00URv.mjs.map 48807 48808/***/ }), 48809 48810/***/ 79629: 48811/*!********************************************************************!*\ 48812 !*** ./node_modules/@angular/cdk/fesm2022/shadow-dom-B0oHn41l.mjs ***! 48813 \********************************************************************/ 48814/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { 48815 48816__webpack_require__.r(__webpack_exports__); 48817/* harmony export */ __webpack_require__.d(__webpack_exports__, { 48818/* harmony export */ _: () => (/* binding */ _getEventTarget), 48819/* harmony export */ a: () => (/* binding */ _getShadowRoot), 48820/* harmony export */ b: () => (/* binding */ _supportsShadowDom), 48821/* harmony export */ c: () => (/* binding */ _getFocusedElementPierceShadowDom)
48822/* harmony export */ }); 48823let shadowDomIsSupported; 48824/** Checks whether the user's browser support Shadow DOM. */ 48825function _supportsShadowDom() { 48826 if (shadowDomIsSupported == null) { 48827 const head = typeof document !== 'undefined' ? document.head : null; 48828 shadowDomIsSupported = !!(head && (head.createShadowRoot || head.attachShadow)); 48829 } 48830 return shadowDomIsSupported; 48831} 48832/** Gets the shadow root of an element, if supported and the element is inside the Shadow DOM. */ 48833function _getShadowRoot(element) { 48834 if (_supportsShadowDom()) { 48835 const rootNode = element.getRootNode ? element.getRootNode() : null; 48836 // Note that this should be caught by `_supportsShadowDom`, but some 48837 // teams have been able to hit this code path on unsupported browsers. 48838 if (typeof ShadowRoot !== 'undefined' && ShadowRoot && rootNode instanceof ShadowRoot) { 48839 return rootNode; 48840 } 48841 } 48842 return null; 48843} 48844/** 48845 * Gets the currently-focused element on the page while 48846 * also piercing through Shadow DOM boundaries. 48847 */ 48848function _getFocusedElementPierceShadowDom() { 48849 let activeElement = typeof document !== 'undefined' && document ? document.activeElement : null; 48850 while (activeElement && activeElement.shadowRoot) { 48851 const newActiveElement = activeElement.shadowRoot.activeElement; 48852 if (newActiveElement === activeElement) { 48853 break; 48854 } else { 48855 activeElement = newActiveElement; 48856 } 48857 } 48858 return activeElement; 48859} 48860/** Gets the target of an event while accounting for Shadow DOM. */ 48861function _getEventTarget(event) { 48862 // If an event is bound outside the Shadow DOM, the `event.target` will 48863 // point to the shadow root so we have to use `composedPath` instead. 48864 return event.composedPath ? event.composedPath()[0] : event.target; 48865} 48866 48867//# sourceMappingURL=shadow-dom-B0oHn41l.mjs.map 48868 48869/***/ }), 48870 48871/***/ 82448: 48872/*!*********************************************************************!*\ 48873 !*** ./node_modules/@angular/cdk/fesm2022/data-source-D34wiQZj.mjs ***! 48874 \*********************************************************************/ 48875/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { 48876 48877__webpack_require__.r(__webpack_exports__); 48878/* harmony export */ __webpack_require__.d(__webpack_exports__, { 48879/* harmony export */ D: () => (/* binding */ DataSource), 48880/* harmony export */ i: () => (/* binding */ isDataSource) 48881/* harmony export */ }); 48882/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rxjs */ 14725); 48883 48884class DataSource {} 48885/** Checks whether an object is a data source. */ 48886function isDataSource(value) { 48887 // Check if the value is a DataSource by observing if it has a connect function. Cannot 48888 // be checked as an `instanceof DataSource` since people could create their own sources 48889 // that match the interface, but don't extend DataSource. We also can't use `isObservable` 48890 // here, because of some internal apps. 48891 return value && typeof value.connect === 'function' && !(value instanceof rxjs__WEBPACK_IMPORTED_MODULE_0__.ConnectableObservable); 48892} 48893 48894//# sourceMappingURL=data-source-D34wiQZj.mjs.map 48895 48896/***/ }), 48897 48898/***/ 84790: 48899/*!**********************************************************************!*\ 48900 !*** ./node_modules/@angular/cdk/fesm2022/style-loader-Cu9AvjH9.mjs ***! 48901 \**********************************************************************/ 48902/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { 48903 48904__webpack_require__.r(__webpack_exports__); 48905/* harmony export */ __webpack_require__.d(__webpack_exports__, { 48906/* harmony export */ _: () => (/* binding */ _CdkPrivateStyleLoader) 48907/* harmony export */ }); 48908/* harmony import */ var C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/defineProperty.js */ 64467); 48909/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ 17705); 48910 48911 48912 48913 48914/** Apps in which we've loaded styles. */ 48915const appsWithLoaders = /*#__PURE__*/new WeakMap(); 48916/** 48917 * Service that loads structural styles dynamically 48918 * and ensures that they're only loaded once per app. 48919 */ 48920let _CdkPrivateStyleLoader = /*#__PURE__*/(() => { 48921 var _CdkPrivateStyleLoader2;
48922 class _CdkPrivateStyleLoader { 48923 constructor() { 48924 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_appRef", void 0); 48925 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_injector", (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_1__.Injector)); 48926 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_environmentInjector", (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_1__.EnvironmentInjector)); 48927 } 48928 /** 48929 * Loads a set of styles. 48930 * @param loader Component which will be instantiated to load the styles. 48931 */ 48932 load(loader) { 48933 // Resolve the app ref lazily to avoid circular dependency errors if this is called too early. 48934 const appRef = this._appRef = this._appRef || this._injector.get(_angular_core__WEBPACK_IMPORTED_MODULE_1__.ApplicationRef); 48935 let data = appsWithLoaders.get(appRef); 48936 // If we haven't loaded for this app before, we have to initialize it. 48937 if (!data) { 48938 data = { 48939 loaders: new Set(), 48940 refs: [] 48941 }; 48942 appsWithLoaders.set(appRef, data); 48943 // When the app is destroyed, we need to clean up all the related loaders. 48944 appRef.onDestroy(() => { 48945 var _appsWithLoaders$get; 48946 (_appsWithLoaders$get = appsWithLoaders.get(appRef)) === null || _appsWithLoaders$get === void 0 || _appsWithLoaders$get.refs.forEach(ref => ref.destroy()); 48947 appsWithLoaders.delete(appRef); 48948 }); 48949 } 48950 // If the loader hasn't been loaded before, we need to instatiate it. 48951 if (!data.loaders.has(loader)) { 48952 data.loaders.add(loader); 48953 data.refs.push((0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.createComponent)(loader, { 48954 environmentInjector: this._environmentInjector 48955 })); 48956 } 48957 } 48958 } 48959 _CdkPrivateStyleLoader2 = _CdkPrivateStyleLoader; 48960 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_CdkPrivateStyleLoader, "\u0275fac", function _CdkPrivateStyleLoader2_Factory(__ngFactoryType__) { 48961 return new (__ngFactoryType__ || _CdkPrivateStyleLoader2)(); 48962 }); 48963 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(_CdkPrivateStyleLoader, "\u0275prov", /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ 48964 token: _CdkPrivateStyleLoader2, 48965 factory: _CdkPrivateStyleLoader2.ɵfac, 48966 providedIn: 'root' 48967 })); 48968 return _CdkPrivateStyleLoader; 48969})(); 48970/*#__PURE__*/(() => { 48971 (typeof ngDevMode === "undefined" || ngDevMode) && void 0; 48972})(); 48973 48974//# sourceMappingURL=style-loader-Cu9AvjH9.mjs.map 48975 48976/***/ }), 48977 48978/***/ 89273: 48979/*!*******************************************************************!*\ 48980 !*** ./node_modules/@angular/cdk/fesm2022/scrolling-BkvA05C8.mjs ***! 48981 \*******************************************************************/ 48982/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { 48983 48984__webpack_require__.r(__webpack_exports__); 48985/* harmony export */ __webpack_require__.d(__webpack_exports__, { 48986/* harmony export */ R: () => (/* binding */ RtlScrollAxisType), 48987/* harmony export */ g: () => (/* binding */ getRtlScrollAxisType), 48988/* harmony export */ s: () => (/* binding */ supportsScrollBehavior) 48989/* harmony export */ }); 48990/** The possible ways the browser may handle the horizontal scroll axis in RTL languages. */ 48991var RtlScrollAxisType = /*#__PURE__*/function (RtlScrollAxisType) { 48992 /** 48993 * scrollLeft is 0 when scrolled all the way left and (scrollWidth - clientWidth) when scrolled 48994 * all the way right. 48995 */ 48996 RtlScrollAxisType[RtlScrollAxisType["NORMAL"] = 0] = "NORMAL"; 48997 /** 48998 * scrollLeft is -(scrollWidth - clientWidth) when scrolled all the way left and 0 when scrolled 48999 * all the way right. 49000 */ 49001 RtlScrollAxisType[RtlScrollAxisType["NEGATED"] = 1] = "NEGATED"; 49002 /** 49003 * scrollLeft is (scrollWidth - clientWidth) when scrolled all the way left and 0 when scrolled 49004 * all the way right. 49005 */ 49006 RtlScrollAxisType[RtlScrollAxisType["INVERTED"] = 2] = "INVERTED"; 49007 return RtlScrollAxisType; 49008}(RtlScrollAxisType || {}); 49009/** Cached result of the way the browser handles the horizontal scroll axis in RTL mode. */ 49010let rtlScrollAxisType; 49011/** Cached result of the check that indicates whether the browser supports scroll behaviors. */ 49012let scrollBehaviorSupported; 49013/** Check whether the browser supports scroll behaviors. */ 49014function supportsScrollBehavior() { 49015 if (scrollBehaviorSupported == null) { 49016 // If we're not in the browser, it can't be supported. Also check for `Element`, because 49017 // some projects stub out the global `document` during SSR which can throw us off. 49018 if (typeof document !== 'object' || !document || typeof Element !== 'function' || !Element) { 49019 scrollBehaviorSupported = false;
49020 return scrollBehaviorSupported; 49021 } 49022 // If the element can have a `scrollBehavior` style, we can be sure that it's supported. 49023 if ('scrollBehavior' in document.documentElement.style) { 49024 scrollBehaviorSupported = true; 49025 } else { 49026 // At this point we have 3 possibilities: `scrollTo` isn't supported at all, it's 49027 // supported but it doesn't handle scroll behavior, or it has been polyfilled. 49028 const scrollToFunction = Element.prototype.scrollTo; 49029 if (scrollToFunction) { 49030 // We can detect if the function has been polyfilled by calling `toString` on it. Native 49031 // functions are obfuscated using `[native code]`, whereas if it was overwritten we'd get 49032 // the actual function source. Via https://davidwalsh.name/detect-native-function. Consider 49033 // polyfilled functions as supporting scroll behavior. 49034 scrollBehaviorSupported = !/\{\s*\[native code\]\s*\}/.test(scrollToFunction.toString()); 49035 } else { 49036 scrollBehaviorSupported = false; 49037 } 49038 } 49039 } 49040 return scrollBehaviorSupported; 49041} 49042/** 49043 * Checks the type of RTL scroll axis used by this browser. As of time of writing, Chrome is NORMAL, 49044 * Firefox & Safari are NEGATED, and IE & Edge are INVERTED. 49045 */ 49046function getRtlScrollAxisType() { 49047 // We can't check unless we're on the browser. Just assume 'normal' if we're not. 49048 if (typeof document !== 'object' || !document) { 49049 return RtlScrollAxisType.NORMAL; 49050 } 49051 if (rtlScrollAxisType == null) { 49052 // Create a 1px wide scrolling container and a 2px wide content element. 49053 const scrollContainer = document.createElement('div'); 49054 const containerStyle = scrollContainer.style; 49055 scrollContainer.dir = 'rtl'; 49056 containerStyle.width = '1px'; 49057 containerStyle.overflow = 'auto'; 49058 containerStyle.visibility = 'hidden'; 49059 containerStyle.pointerEvents = 'none'; 49060 containerStyle.position = 'absolute'; 49061 const content = document.createElement('div'); 49062 const contentStyle = content.style; 49063 contentStyle.width = '2px'; 49064 contentStyle.height = '1px'; 49065 scrollContainer.appendChild(content); 49066 document.body.appendChild(scrollContainer); 49067 rtlScrollAxisType = RtlScrollAxisType.NORMAL; 49068 // The viewport starts scrolled all the way to the right in RTL mode. If we are in a NORMAL 49069 // browser this would mean that the scrollLeft should be 1. If it's zero instead we know we're 49070 // dealing with one of the other two types of browsers. 49071 if (scrollContainer.scrollLeft === 0) { 49072 // In a NEGATED browser the scrollLeft is always somewhere in [-maxScrollAmount, 0]. For an 49073 // INVERTED browser it is always somewhere in [0, maxScrollAmount]. We can determine which by 49074 // setting to the scrollLeft to 1. This is past the max for a NEGATED browser, so it will 49075 // return 0 when we read it again. 49076 scrollContainer.scrollLeft = 1; 49077 rtlScrollAxisType = scrollContainer.scrollLeft === 0 ? RtlScrollAxisType.NEGATED : RtlScrollAxisType.INVERTED; 49078 } 49079 scrollContainer.remove(); 49080 } 49081 return rtlScrollAxisType; 49082} 49083 49084//# sourceMappingURL=scrolling-BkvA05C8.mjs.map 49085 49086/***/ }), 49087 49088/***/ 99536: 49089/*!******************************************************************!*\ 49090 !*** ./node_modules/@angular/cdk/fesm2022/platform-DmdVEw_C.mjs ***! 49091 \******************************************************************/ 49092/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { 49093 49094__webpack_require__.r(__webpack_exports__); 49095/* harmony export */ __webpack_require__.d(__webpack_exports__, { 49096/* harmony export */ P: () => (/* binding */ Platform) 49097/* harmony export */ }); 49098/* harmony import */ var C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/defineProperty.js */ 64467); 49099/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ 17705); 49100/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/common */ 69377); 49101 49102 49103 49104 49105 49106// Whether the current platform supports the V8 Break Iterator. The V8 check 49107// is necessary to detect all Blink based browsers. 49108let hasV8BreakIterator; 49109// We need a try/catch around the reference to `Intl`, because accessing it in some cases can 49110// cause IE to throw. These cases are tied to particular versions of Windows and can happen if 49111// the consumer is providing a polyfilled `Map`. See: 49112// https://github.com/Microsoft/ChakraCore/issues/3189 49113// https://github.com/angular/components/issues/15687 49114try { 49115 hasV8BreakIterator = typeof Intl !== 'undefined' && Intl.v8BreakIterator; 49116} catch (_unused) { 49117 hasV8BreakIterator = false;
49118} 49119/** 49120 * Service to detect the current platform by comparing the userAgent strings and 49121 * checking browser-specific global properties. 49122 */ 49123let Platform = /*#__PURE__*/(() => { 49124 var _Platform; 49125 class Platform { 49126 constructor() { 49127 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "_platformId", (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_1__.PLATFORM_ID)); 49128 // We want to use the Angular platform check because if the Document is shimmed 49129 // without the navigator, the following checks will fail. This is preferred because 49130 // sometimes the Document may be shimmed without the user's knowledge or intention 49131 /** Whether the Angular application is being rendered in the browser. */ 49132 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "isBrowser", this._platformId ? (0,_angular_common__WEBPACK_IMPORTED_MODULE_2__.isPlatformBrowser)(this._platformId) : typeof document === 'object' && !!document); 49133 /** Whether the current browser is Microsoft Edge. */ 49134 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "EDGE", this.isBrowser && /(edge)/i.test(navigator.userAgent)); 49135 /** Whether the current rendering engine is Microsoft Trident. */ 49136 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "TRIDENT", this.isBrowser && /(msie|trident)/i.test(navigator.userAgent)); 49137 // EdgeHTML and Trident mock Blink specific things and need to be excluded from this check. 49138 /** Whether the current rendering engine is Blink. */ 49139 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "BLINK", this.isBrowser && !!(window.chrome || hasV8BreakIterator) && typeof CSS !== 'undefined' && !this.EDGE && !this.TRIDENT); 49140 // Webkit is part of the userAgent in EdgeHTML, Blink and Trident. Therefore we need to 49141 // ensure that Webkit runs standalone and is not used as another engine's base. 49142 /** Whether the current rendering engine is WebKit. */ 49143 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "WEBKIT", this.isBrowser && /AppleWebKit/i.test(navigator.userAgent) && !this.BLINK && !this.EDGE && !this.TRIDENT); 49144 /** Whether the current platform is Apple iOS. */ 49145 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "IOS", this.isBrowser && /iPad|iPhone|iPod/.test(navigator.userAgent) && !('MSStream' in window)); 49146 // It's difficult to detect the plain Gecko engine, because most of the browsers identify 49147 // them self as Gecko-like browsers and modify the userAgent's according to that. 49148 // Since we only cover one explicit Firefox case, we can simply check for Firefox 49149 // instead of having an unstable check for Gecko. 49150 /** Whether the current browser is Firefox. */ 49151 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "FIREFOX", this.isBrowser && /(firefox|minefield)/i.test(navigator.userAgent)); 49152 /** Whether the current platform is Android. */ 49153 // Trident on mobile adds the android platform to the userAgent to trick detections. 49154 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "ANDROID", this.isBrowser && /android/i.test(navigator.userAgent) && !this.TRIDENT); 49155 // Safari browsers will include the Safari keyword in their userAgent. Some browsers may fake 49156 // this and just place the Safari keyword in the userAgent. To be more safe about Safari every 49157 // Safari browser should also use Webkit as its layout engine. 49158 /** Whether the current browser is Safari. */ 49159 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "SAFARI", this.isBrowser && /safari/i.test(navigator.userAgent) && this.WEBKIT); 49160 } 49161 } 49162 _Platform = Platform; 49163 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Platform, "\u0275fac", function _Platform_Factory(__ngFactoryType__) { 49164 return new (__ngFactoryType__ || _Platform)(); 49165 }); 49166 (0,C_Build_Source_WebPortal_RC_Dev_Webs_RetailPortal_node_modules_babel_runtime_helpers_esm_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(Platform, "\u0275prov", /* @__P
49166URE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({ 49167 token: _Platform, 49168 factory: _Platform.ɵfac, 49169 providedIn: 'root' 49170 })); 49171 return Platform; 49172})(); 49173/*#__PURE__*/(() => { 49174 (typeof ngDevMode === "undefined" || ngDevMode) && void 0; 49175})(); 49176 49177//# sourceMappingURL=platform-DmdVEw_C.mjs.map 49178 49179/***/ }) 49180 49181}]);
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.