UNPKG

423 kBJavaScriptView Raw
1(function (global, factory) {
2 typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/core'), require('@angular/material'), require('@vendasta/core/image-transformation'), require('@vendasta/uikit'), require('@vendasta/core/shared'), require('rxjs'), require('@ngx-translate/core'), require('rxjs/operators'), require('@angular/forms'), require('@angular/material/list'), require('@vendasta/forms'), require('@vendasta/core/billing'), require('@vendasta/sales-orders'), require('uuid/v4'), require('@angular/material/progress-spinner'), require('util'), require('@vendasta/core/marketplace-packages'), require('@angular/animations')) :
3 typeof define === 'function' && define.amd ? define('@vendasta/store', ['exports', '@angular/common', '@angular/core', '@angular/material', '@vendasta/core/image-transformation', '@vendasta/uikit', '@vendasta/core/shared', 'rxjs', '@ngx-translate/core', 'rxjs/operators', '@angular/forms', '@angular/material/list', '@vendasta/forms', '@vendasta/core/billing', '@vendasta/sales-orders', 'uuid/v4', '@angular/material/progress-spinner', 'util', '@vendasta/core/marketplace-packages', '@angular/animations'], factory) :
4 (global = global || self, factory((global.vendasta = global.vendasta || {}, global.vendasta.store = {}), global.ng.common, global.ng.core, global.ng.material, global.imageTransformation, global.vendasta.uikit, global.shared, global.rxjs, global.core$1, global.rxjs.operators, global.ng.forms, global.ng.material.list, global.vendasta.forms, global.billing, global.salesOrders, global.uuid, global.ng.material['progress-spinner'], global.util, global.marketplacePackages, global.ng.animations));
5}(this, (function (exports, common, core, material, imageTransformation, uikit, shared, rxjs, core$1, operators, forms, list, forms$1, billing, salesOrders, uuid, progressSpinner, util, marketplacePackages, animations) { 'use strict';
6
7 uuid = uuid && uuid.hasOwnProperty('default') ? uuid['default'] : uuid;
8
9 /*! *****************************************************************************
10 Copyright (c) Microsoft Corporation. All rights reserved.
11 Licensed under the Apache License, Version 2.0 (the "License"); you may not use
12 this file except in compliance with the License. You may obtain a copy of the
13 License at http://www.apache.org/licenses/LICENSE-2.0
14
15 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
17 WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
18 MERCHANTABLITY OR NON-INFRINGEMENT.
19
20 See the Apache Version 2.0 License for specific language governing permissions
21 and limitations under the License.
22 ***************************************************************************** */
23 /* global Reflect, Promise */
24
25 var extendStatics = function(d, b) {
26 extendStatics = Object.setPrototypeOf ||
27 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
28 function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
29 return extendStatics(d, b);
30 };
31
32 function __extends(d, b) {
33 extendStatics(d, b);
34 function __() { this.constructor = d; }
35 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
36 }
37
38 var __assign = function() {
39 __assign = Object.assign || function __assign(t) {
40 for (var s, i = 1, n = arguments.length; i < n; i++) {
41 s = arguments[i];
42 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
43 }
44 return t;
45 };
46 return __assign.apply(this, arguments);
47 };
48
49 function __rest(s, e) {
50 var t = {};
51 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
52 t[p] = s[p];
53 if (s != null && typeof Object.getOwnPropertySymbols === "function")
54 for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
55 if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
56 t[p[i]] = s[p[i]];
57 }
58 return t;
59 }
60
61 function __decorate(decorators, target, key, desc) {
62 var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
63 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
64 else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
65 return c > 3 && r && Object.defineProperty(target, key, r), r;
66 }
67
68 function __param(paramIndex, decorator) {
69 return function (target, key) { decorator(target, key, paramIndex); }
70 }
71
72 function __metadata(metadataKey, metadataValue) {
73 if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
74 }
75
76 function __awaiter(thisArg, _arguments, P, generator) {
77 return new (P || (P = Promise))(function (resolve, reject) {
78 function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
79 function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
80 function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
81 step((generator = generator.apply(thisArg, _arguments || [])).next());
82 });
83 }
84
85 function __generator(thisArg, body) {
86 var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
87 return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
88 function verb(n) { return function (v) { return step([n, v]); }; }
89 function step(op) {
90 if (f) throw new TypeError("Generator is already executing.");
91 while (_) try {
92 if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
93 if (y = 0, t) op = [op[0] & 2, t.value];
94 switch (op[0]) {
95 case 0: case 1: t = op; break;
96 case 4: _.label++; return { value: op[1], done: false };
97 case 5: _.label++; y = op[1]; op = [0]; continue;
98 case 7: op = _.ops.pop(); _.trys.pop(); continue;
99 default:
100 if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
101 if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
102 if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
103 if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
104 if (t[2]) _.ops.pop();
105 _.trys.pop(); continue;
106 }
107 op = body.call(thisArg, _);
108 } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
109 if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
110 }
111 }
112
113 function __exportStar(m, exports) {
114 for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
115 }
116
117 function __values(o) {
118 var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
119 if (m) return m.call(o);
120 return {
121 next: function () {
122 if (o && i >= o.length) o = void 0;
123 return { value: o && o[i++], done: !o };
124 }
125 };
126 }
127
128 function __read(o, n) {
129 var m = typeof Symbol === "function" && o[Symbol.iterator];
130 if (!m) return o;
131 var i = m.call(o), r, ar = [], e;
132 try {
133 while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
134 }
135 catch (error) { e = { error: error }; }
136 finally {
137 try {
138 if (r && !r.done && (m = i["return"])) m.call(i);
139 }
140 finally { if (e) throw e.error; }
141 }
142 return ar;
143 }
144
145 function __spread() {
146 for (var ar = [], i = 0; i < arguments.length; i++)
147 ar = ar.concat(__read(arguments[i]));
148 return ar;
149 }
150
151 function __spreadArrays() {
152 for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
153 for (var r = Array(s), k = 0, i = 0; i < il; i++)
154 for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
155 r[k] = a[j];
156 return r;
157 };
158
159 function __await(v) {
160 return this instanceof __await ? (this.v = v, this) : new __await(v);
161 }
162
163 function __asyncGenerator(thisArg, _arguments, generator) {
164 if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
165 var g = generator.apply(thisArg, _arguments || []), i, q = [];
166 return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
167 function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
168 function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
169 function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
170 function fulfill(value) { resume("next", value); }
171 function reject(value) { resume("throw", value); }
172 function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
173 }
174
175 function __asyncDelegator(o) {
176 var i, p;
177 return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
178 function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
179 }
180
181 function __asyncValues(o) {
182 if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
183 var m = o[Symbol.asyncIterator], i;
184 return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
185 function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
186 function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
187 }
188
189 function __makeTemplateObject(cooked, raw) {
190 if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
191 return cooked;
192 };
193
194 function __importStar(mod) {
195 if (mod && mod.__esModule) return mod;
196 var result = {};
197 if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
198 result.default = mod;
199 return result;
200 }
201
202 function __importDefault(mod) {
203 return (mod && mod.__esModule) ? mod : { default: mod };
204 }
205
206 /**
207 * @fileoverview added by tsickle
208 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
209 */
210 var VaPricingComponent = /** @class */ (function () {
211 function VaPricingComponent(translateService, displayPriceService) {
212 var _this = this;
213 this.translateService = translateService;
214 this.displayPriceService = displayPriceService;
215 this.pricing = null;
216 this.wrapFrequency = false;
217 this.isAddon = false;
218 this.hasVerifiedContract = false;
219 this.highlightPrice = true;
220 this.loaded = true;
221 this.pricing$$ = new rxjs.BehaviorSubject(null);
222 this.billedProduct$$ = new rxjs.BehaviorSubject(null);
223 this.hasVerifiedContract$$ = new rxjs.BehaviorSubject(false);
224 this.isFree$ = rxjs.combineLatest([this.pricing$, this.billedProduct$, this.hasVerifiedContract$]).pipe(operators.map((/**
225 * @param {?} __0
226 * @return {?}
227 */
228 function (_a) {
229 var _b = __read(_a, 3), pricing = _b[0], billedProduct = _b[1], hasVerifiedContract = _b[2];
230 /** @type {?} */
231 var isFreeHelper = (/**
232 * @param {?} prices
233 * @return {?}
234 */
235 function (prices) {
236 return prices ? prices.some((/**
237 * @param {?} p
238 * @return {?}
239 */
240 function (p) { return p.price === 0 || p.price === undefined; })) : false;
241 });
242 if (hasVerifiedContract && billedProduct) {
243 return billedProduct.pricingTiers.length === 1 ? isFreeHelper(billedProduct.pricingTiers) : false;
244 }
245 return !!pricing && isFreeHelper(pricing.prices);
246 })));
247 this.shouldContactSales$ = rxjs.combineLatest([this.pricing$, this.billedProduct$, this.hasVerifiedContract$]).pipe(operators.map((/**
248 * @param {?} __0
249 * @return {?}
250 */
251 function (_a) {
252 var _b = __read(_a, 3), pricing = _b[0], billedProduct = _b[1], hasVerifiedContract = _b[2];
253 /** @type {?} */
254 var nestedPricesIsContactSales = (/**
255 * @param {?} prices
256 * @return {?}
257 */
258 function (prices) {
259 return prices && prices.length > 0 ? prices.some((/**
260 * @param {?} p
261 * @return {?}
262 */
263 function (p) { return p.price === null || p.price < 0; })) : true;
264 });
265 if (hasVerifiedContract && billedProduct) {
266 return nestedPricesIsContactSales(billedProduct.pricingTiers);
267 }
268 if (!pricing) {
269 return true;
270 }
271 return nestedPricesIsContactSales(pricing.prices);
272 })));
273 this.isFlatPrice$ = this.billedProduct$.pipe(operators.map((/**
274 * @param {?} billedProduct
275 * @return {?}
276 */
277 function (billedProduct) { return billedProduct.pricingTiers.length === 1; })));
278 this.pricingTierData$ = this.billedProduct$.pipe(operators.switchMap((/**
279 * @param {?} billedProduct
280 * @return {?}
281 */
282 function (billedProduct) {
283 /** @type {?} */
284 var pricingTierObservables = billedProduct.pricingTiers.map((/**
285 * @param {?} pricingTier
286 * @return {?}
287 */
288 function (pricingTier) {
289 return rxjs.combineLatest(rxjs.of(pricingTier.isStartingPrice), _this.buildPricingTierString(pricingTier), _this.buildPricingTierForProduct(pricingTier, billedProduct.billingFrequency), _this.buildPricingTierForAddon(pricingTier), _this.buildPriceStringForTier(pricingTier, billedProduct.billingFrequency, pricingTier.isStartingPrice), _this.buildPriceStringForTier(pricingTier)).pipe(operators.map((/**
290 * @param {?} __0
291 * @return {?}
292 */
293 function (_a) {
294 var _b = __read(_a, 6), isStartingPrice = _b[0], pricingTierString = _b[1], pricingTierForProduct = _b[2], pricingTierForAddon = _b[3], priceStringForTier = _b[4], priceStringForTierWithoutFreq = _b[5];
295 return {
296 isStartingPrice: isStartingPrice,
297 pricingTierString: pricingTierString,
298 pricingTierForProduct: pricingTierForProduct,
299 pricingTierForAddon: pricingTierForAddon,
300 priceStringForTier: priceStringForTier,
301 priceStringForTierWithoutFreq: priceStringForTierWithoutFreq
302 };
303 })));
304 }));
305 return rxjs.combineLatest.apply(void 0, __spread(pricingTierObservables));
306 })));
307 this.priceData$ = this.pricing$.pipe(operators.switchMap((/**
308 * @param {?} pricing
309 * @return {?}
310 */
311 function (pricing) {
312 /** @type {?} */
313 var priceObservables = pricing.prices.map((/**
314 * @param {?} price
315 * @return {?}
316 */
317 function (price) {
318 return rxjs.combineLatest(rxjs.of(price.isStartingPrice), _this.buildPriceStringForPricing(price, pricing.currency, true, false), _this.buildPriceStringForPricing(price, pricing.currency, false, true), _this.buildFrequencyString(price.frequency)).pipe(operators.map((/**
319 * @param {?} __0
320 * @return {?}
321 */
322 function (_a) {
323 var _b = __read(_a, 4), isStartingPrice = _b[0], priceStringForPricingWithoutFrequency = _b[1], priceStringForPricingWithFrequency = _b[2], frequencyString = _b[3];
324 return {
325 isStartingPrice: isStartingPrice,
326 priceStringForPricingWithoutFrequency: priceStringForPricingWithoutFrequency,
327 priceStringForPricingWithFrequency: priceStringForPricingWithFrequency,
328 frequencyString: frequencyString
329 };
330 })));
331 }));
332 return rxjs.combineLatest.apply(void 0, __spread(priceObservables));
333 })));
334 this.commitmentMessage$ = this.buildCommitmentMessage();
335 }
336 Object.defineProperty(VaPricingComponent.prototype, "pricing$", {
337 get: /**
338 * @return {?}
339 */
340 function () {
341 return this.pricing$$.asObservable();
342 },
343 enumerable: true,
344 configurable: true
345 });
346 Object.defineProperty(VaPricingComponent.prototype, "billedProduct$", {
347 get: /**
348 * @return {?}
349 */
350 function () {
351 return this.billedProduct$$.asObservable();
352 },
353 enumerable: true,
354 configurable: true
355 });
356 Object.defineProperty(VaPricingComponent.prototype, "hasVerifiedContract$", {
357 get: /**
358 * @return {?}
359 */
360 function () {
361 return this.hasVerifiedContract$$.asObservable();
362 },
363 enumerable: true,
364 configurable: true
365 });
366 /**
367 * @param {?} changes
368 * @return {?}
369 */
370 VaPricingComponent.prototype.ngOnChanges = /**
371 * @param {?} changes
372 * @return {?}
373 */
374 function (changes) {
375 if (changes.hasOwnProperty('pricing')) {
376 this.pricing$$.next(changes.pricing.currentValue);
377 }
378 if (changes.hasOwnProperty('billedProduct')) {
379 this.billedProduct$$.next(changes.billedProduct.currentValue);
380 }
381 if (changes.hasOwnProperty('hasVerifiedContract')) {
382 this.hasVerifiedContract$$.next(changes.hasVerifiedContract.currentValue);
383 }
384 };
385 /**
386 * @param {?} tier
387 * @return {?}
388 */
389 VaPricingComponent.prototype.buildPricingTierString = /**
390 * @param {?} tier
391 * @return {?}
392 */
393 function (tier) {
394 /** @type {?} */
395 var max = String(tier.rangeMax);
396 if (tier.rangeMax === -1) {
397 max = '∞';
398 if (tier.rangeMin === 0 || tier.rangeMin === 1) {
399 return rxjs.of('');
400 }
401 }
402 return this.translateService.stream('FRONTEND.STORE.MIN_TO_MAX', { minRange: String(tier.rangeMin), maxRange: max });
403 };
404 /**
405 * @param {?} tier
406 * @param {?=} frequency
407 * @return {?}
408 */
409 VaPricingComponent.prototype.buildPricingTierForProduct = /**
410 * @param {?} tier
411 * @param {?=} frequency
412 * @return {?}
413 */
414 function (tier, frequency) {
415 var _this = this;
416 return rxjs.combineLatest(this.buildPricingTierString(tier), this.buildFrequencyString(frequency)).pipe(operators.switchMap((/**
417 * @param {?} __0
418 * @return {?}
419 */
420 function (_a) {
421 var _b = __read(_a, 2), pricingTier = _b[0], formattedFrequency = _b[1];
422 if (pricingTier) {
423 return _this.translateService.stream('FRONTEND.STORE.PRODUCT_PRICING_WITH_FREQUENCY', {
424 pricingTier: pricingTier,
425 frequency: formattedFrequency
426 });
427 }
428 return rxjs.of(formattedFrequency);
429 })));
430 };
431 /**
432 * @param {?} tier
433 * @return {?}
434 */
435 VaPricingComponent.prototype.buildPricingTierForAddon = /**
436 * @param {?} tier
437 * @return {?}
438 */
439 function (tier) {
440 return this.buildPricingTierString(tier).pipe(operators.map((/**
441 * @param {?} pricingRange
442 * @return {?}
443 */
444 function (pricingRange) { return pricingRange ? pricingRange : ''; })));
445 };
446 /**
447 * @param {?} price
448 * @param {?} currency
449 * @param {?} excludeFrequency
450 * @param {?} canIncludeStartingAtPrefix
451 * @return {?}
452 */
453 VaPricingComponent.prototype.buildPriceStringForPricing = /**
454 * @param {?} price
455 * @param {?} currency
456 * @param {?} excludeFrequency
457 * @param {?} canIncludeStartingAtPrefix
458 * @return {?}
459 */
460 function (price, currency, excludeFrequency, canIncludeStartingAtPrefix) {
461 return this.displayPriceService.formatDisplayPrice(price.price, currency, (/** @type {?} */ ((excludeFrequency ? '' : price.frequency))), true, true, true, price.isStartingPrice && canIncludeStartingAtPrefix);
462 };
463 /**
464 * @param {?} tier
465 * @param {?=} frequency
466 * @param {?=} isStartingPrice
467 * @return {?}
468 */
469 VaPricingComponent.prototype.buildPriceStringForTier = /**
470 * @param {?} tier
471 * @param {?=} frequency
472 * @param {?=} isStartingPrice
473 * @return {?}
474 */
475 function (tier, frequency, isStartingPrice) {
476 return this.displayPriceService.formatDisplayPrice(tier.price, this.billedProduct.currency, (/** @type {?} */ (frequency)), undefined, undefined, undefined, isStartingPrice);
477 };
478 /**
479 * @param {?=} frequency
480 * @return {?}
481 */
482 VaPricingComponent.prototype.buildFrequencyString = /**
483 * @param {?=} frequency
484 * @return {?}
485 */
486 function (frequency) {
487 return this.displayPriceService.formatBillingFrequency(frequency);
488 };
489 /**
490 * @return {?}
491 */
492 VaPricingComponent.prototype.buildCommitmentMessage = /**
493 * @return {?}
494 */
495 function () {
496 var _this = this;
497 return rxjs.combineLatest([
498 this.translateService.stream('FRONTEND.STORE.PRICING_FREQUENCIES'),
499 this.billedProduct$,
500 this.pricing$,
501 this.isFree$,
502 this.shouldContactSales$
503 ]).pipe(operators.switchMap((/**
504 * @param {?} __0
505 * @return {?}
506 */
507 function (_a) {
508 var _b = __read(_a, 5), frequencyTranslations = _b[0], billedProduct = _b[1], pricing = _b[2], isFree = _b[3], shouldContactSales = _b[4];
509 /** @type {?} */
510 var frequency = billedProduct ? billedProduct.billingFrequency.toString().toLowerCase() :
511 pricing && pricing.prices.length > 0 ? pricing.prices[0].frequency.toLowerCase() : '';
512 /** @type {?} */
513 var frequencyString = '';
514 if (frequency === 'yearly') {
515 frequencyString = frequencyTranslations.YEAR;
516 }
517 else if (frequency === 'monthly') {
518 frequencyString = frequencyTranslations.MONTH;
519 }
520 if (!frequencyString || isFree || shouldContactSales) {
521 return rxjs.of('');
522 }
523 if (billedProduct && billedProduct.commitment) {
524 /** @type {?} */
525 var initial = billedProduct.commitment.initial;
526 /** @type {?} */
527 var recurring = billedProduct.commitment.recurring;
528 return _this.translateService.stream('FRONTEND.STORE.COMMITMENT_WITH_RENEWAL', {
529 initial: initial,
530 frequencyString: frequencyString,
531 recurring: recurring,
532 });
533 }
534 return rxjs.of('');
535 })));
536 };
537 VaPricingComponent.decorators = [
538 { type: core.Component, args: [{
539 selector: 'va-pricing',
540 template: "<ng-container *ngIf=\"highlightPrice\">\n <highlight-pricing [pricing]=\"pricing\"\n [billedProduct]=\"billedProduct\"\n [highlightPrice]=\"highlightPrice\"\n [isAddon]=\"isAddon\"\n [hasVerifiedContract]=\"hasVerifiedContract\"\n [wrapFrequency]=\"wrapFrequency\"\n [loaded]=\"loaded\">\n </highlight-pricing>\n</ng-container>\n<ng-container *ngIf=\"!highlightPrice\">\n <table-pricing [pricing]=\"pricing\"\n [highlightPrice]=\"highlightPrice\"\n [billedProduct]=\"billedProduct\"\n [hasVerifiedContract]=\"hasVerifiedContract\"\n [loaded]=\"loaded\">\n </table-pricing>\n</ng-container>\n",
541 styles: [""]
542 }] }
543 ];
544 /** @nocollapse */
545 VaPricingComponent.ctorParameters = function () { return [
546 { type: core$1.TranslateService },
547 { type: shared.DisplayPriceService }
548 ]; };
549 VaPricingComponent.propDecorators = {
550 pricing: [{ type: core.Input }],
551 billedProduct: [{ type: core.Input }],
552 wrapFrequency: [{ type: core.Input }],
553 isAddon: [{ type: core.Input }],
554 hasVerifiedContract: [{ type: core.Input }],
555 highlightPrice: [{ type: core.Input }],
556 loaded: [{ type: core.Input }]
557 };
558 return VaPricingComponent;
559 }());
560 if (false) {
561 /** @type {?} */
562 VaPricingComponent.prototype.pricing;
563 /** @type {?} */
564 VaPricingComponent.prototype.billedProduct;
565 /** @type {?} */
566 VaPricingComponent.prototype.wrapFrequency;
567 /** @type {?} */
568 VaPricingComponent.prototype.isAddon;
569 /** @type {?} */
570 VaPricingComponent.prototype.hasVerifiedContract;
571 /** @type {?} */
572 VaPricingComponent.prototype.highlightPrice;
573 /** @type {?} */
574 VaPricingComponent.prototype.loaded;
575 /** @type {?} */
576 VaPricingComponent.prototype.pricing$$;
577 /** @type {?} */
578 VaPricingComponent.prototype.billedProduct$$;
579 /** @type {?} */
580 VaPricingComponent.prototype.hasVerifiedContract$$;
581 /** @type {?} */
582 VaPricingComponent.prototype.isFree$;
583 /** @type {?} */
584 VaPricingComponent.prototype.shouldContactSales$;
585 /** @type {?} */
586 VaPricingComponent.prototype.isFlatPrice$;
587 /** @type {?} */
588 VaPricingComponent.prototype.pricingTierData$;
589 /** @type {?} */
590 VaPricingComponent.prototype.priceData$;
591 /** @type {?} */
592 VaPricingComponent.prototype.commitmentMessage$;
593 /**
594 * @type {?}
595 * @private
596 */
597 VaPricingComponent.prototype.translateService;
598 /**
599 * @type {?}
600 * @private
601 */
602 VaPricingComponent.prototype.displayPriceService;
603 }
604
605 /**
606 * @fileoverview added by tsickle
607 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
608 */
609 var HighlightPricingComponent = /** @class */ (function (_super) {
610 __extends(HighlightPricingComponent, _super);
611 function HighlightPricingComponent() {
612 return _super !== null && _super.apply(this, arguments) || this;
613 }
614 HighlightPricingComponent.decorators = [
615 { type: core.Component, args: [{
616 selector: 'highlight-pricing',
617 template: "<ng-container *ngIf=\"loaded; else loading\">\n <div class=\"no-price\" *ngIf=\"shouldContactSales$ | async; else dontContactSales\">\n {{ 'FRONTEND.STORE.CONTACT_SALES' | translate }}\n </div>\n <ng-template #dontContactSales>\n <div class=\"no-price\" *ngIf=\"isFree$ | async; else notFree\">\n <b>{{ 'FRONTEND.STORE.FREE' | translate }}</b>\n </div>\n <ng-template #notFree>\n <ng-container *ngIf=\"!isAddon\">\n <ng-container *ngIf=\"hasVerifiedContract && billedProduct; else usePricing\">\n <div *ngFor=\"let tier of pricingTierData$ | async\" class=\"price-box\">\n <span>\n <span *ngIf=\"tier.isStartingPrice\" class=\"starting-at\">{{ 'FRONTEND.STORE.STARTING_AT' | translate }}</span>\n <b class=\"price-number\">{{ tier.priceStringForTierWithoutFreq }}</b>\n </span>\n <span class=\"tier-billing-freq\" [ngClass]=\"{'va-wrap': wrapFrequency}\">\n {{ tier.pricingTierForProduct }}\n </span>\n </div>\n </ng-container>\n <ng-template #usePricing>\n <ng-container *ngIf=\"pricing?.prices\">\n <div *ngFor=\"let price of priceData$ | async; let i = index\" class=\"price-box\">\n <span>\n <span *ngIf=\"price.isStartingPrice\" class=\"starting-at\">{{ 'FRONTEND.STORE.STARTING_AT' | translate }}</span>\n <b class=\"price-number\">\n <ng-container *ngIf=\"i == 1\">+</ng-container>\n {{ price.priceStringForPricingWithoutFrequency }}\n </b>\n </span>\n <span *ngIf=\"price.frequencyString\" class=\"billing-freq\" [ngClass]=\"{'va-wrap': wrapFrequency}\">\n {{ price.frequencyString }}\n </span>\n </div>\n </ng-container>\n </ng-template>\n </ng-container>\n <ng-container *ngIf=\"isAddon\">\n <div *ngIf=\"hasVerifiedContract && billedProduct; else useAddonPricing\">\n <div *ngFor=\"let tier of pricingTierData$ | async\" class=\"price-box\">\n <span class=\"addon-billing-freq\">\n {{ tier.pricingTierForAddon }}\n </span>\n <span>\n <span *ngIf=\"tier.isStartingPrice\" class=\"starting-at\">{{ 'FRONTEND.STORE.STARTING_AT' | translate }}</span>\n <b class=\"price-number\">\n {{ tier.priceStringForTier }}\n </b>\n </span>\n </div>\n </div>\n <ng-template #useAddonPricing>\n <div class=\"price-box\">\n <span *ngIf=\"pricing?.prices[0].frequency\" class=\"addon-billing-freq\">\n {{ (priceData$ | async)[0]?.frequencyString }}\n </span>\n <span>\n <span *ngIf=\"pricing?.prices[0]?.isStartingPrice\" class=\"starting-at\">\n {{ 'FRONTEND.STORE.STARTING_AT' | translate }}\n </span>\n <b class=\"price-number\">\n {{ (priceData$ | async)[0]?.priceStringForPricingWithoutFrequency }}\n </b>\n </span>\n </div>\n </ng-template>\n </ng-container>\n <div class=\"commitment\" *ngIf=\"billedProduct && billedProduct.commitment && billedProduct.commitment.initial > 1\">\n {{ commitmentMessage$ | async }}\n </div>\n </ng-template>\n </ng-template>\n</ng-container>\n<ng-template #loading>\n <div class=\"stencil-pricing stencil-shimmer\"></div>\n</ng-template>\n",
618 styles: [":host{color:#9e9e9e}.starting-at{margin-right:5px}.price-box{display:-webkit-box;display:flex;-webkit-box-align:baseline;align-items:baseline;-webkit-box-orient:horizontal;-webkit-box-direction:reverse;flex-direction:row-reverse}.no-price{text-align:center}b{color:#212121;font-size:20px}@media screen and (max-width:600px){.no-price,.price-box,b{font-size:16px}}.billing-freq{text-transform:capitalize;-webkit-box-flex:1;flex:1}.tier-billing-freq{-webkit-box-flex:1;flex:1}.addon-billing-freq{padding-left:5px}.va-wrap{display:block}.stencil-pricing{height:1em}.commitment{color:#9e9e9e;font-size:12px;font-style:italic}"]
619 }] }
620 ];
621 return HighlightPricingComponent;
622 }(VaPricingComponent));
623
624 /**
625 * @fileoverview added by tsickle
626 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
627 */
628 var TablePricingComponent = /** @class */ (function (_super) {
629 __extends(TablePricingComponent, _super);
630 function TablePricingComponent() {
631 return _super !== null && _super.apply(this, arguments) || this;
632 }
633 TablePricingComponent.decorators = [
634 { type: core.Component, args: [{
635 selector: 'table-pricing',
636 template: "<ng-container *ngIf=\"loaded; else loading\">\n <div *ngIf=\"hasVerifiedContract && billedProduct; else usePricing\">\n <div class=\"price-container\" *ngIf=\"isFlatPrice$ | async; else notFlatPrice\">\n <div class=\"price\">\n {{ (pricingTierData$ | async)[0]?.priceStringForTier }}\n </div>\n </div>\n <ng-template #notFlatPrice>\n <div class=\"price-container--tiered\" *ngIf=\"!(isFlatPrice$ | async)\">\n <div class=\"pricing-tier\" *ngFor=\"let tier of pricingTierData$ | async\">\n <div class=\"pricing-tier__range\">{{ tier.pricingTierString }}</div>\n <div class=\"pricing-tier__price\">\n {{ tier.priceStringForTier }}\n </div>\n </div>\n </div>\n </ng-template>\n <div class=\"commitment\" *ngIf=\"billedProduct && billedProduct.commitment && billedProduct.commitment.initial > 1\">\n {{ commitmentMessage$ | async }}\n </div>\n </div>\n <ng-template #usePricing>\n <div class=\"gray-font\">\n <ng-container *ngIf=\"shouldContactSales$ | async; else dontContactSales\">\n {{ 'FRONTEND.STORE.CONTACT_SALES' | translate }}\n </ng-container>\n <ng-template #dontContactSales>\n <ng-container *ngIf=\"isFree$ | async; else notFree\">\n {{ 'FRONTEND.STORE.FREE' | translate }}\n </ng-container>\n <ng-template #notFree>\n {{ (priceData$ | async)[0].priceStringForPricingWithFrequency }}\n <div class=\"commitment\" *ngIf=\"billedProduct && billedProduct.commitment && billedProduct.commitment.initial > 1\">\n {{ commitmentMessage$ | async }}\n </div>\n </ng-template>\n </ng-template>\n </div>\n </ng-template>\n</ng-container>\n<ng-template #loading>\n <div class=\"stencil-pricing stencil-shimmer\"></div>\n</ng-template>\n",
637 styles: [":host{color:#616161}.price-container--tiered{font-size:12px;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;display:-webkit-box;display:flex;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.price-container--tiered .pricing-tier{border-bottom:1px solid #e0e0e0;padding:5px 0;display:-webkit-box;display:flex}.price-container--tiered .pricing-tier:first-child{padding-top:0}.price-container--tiered .pricing-tier:last-child{padding-bottom:0;border-bottom:none}.price-container--tiered .pricing-tier .pricing-tier__range{padding-right:20px;-webkit-box-flex:1;flex:1}.stencil-pricing{height:1em}.commitment{color:#9e9e9e;font-size:12px;font-style:italic}"]
638 }] }
639 ];
640 return TablePricingComponent;
641 }(VaPricingComponent));
642
643 /**
644 * @fileoverview added by tsickle
645 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
646 */
647 /*tslint:disable*/
648 var En = /** @class */ (function () {
649 function En() {
650 }
651 En.en = {
652 "FRONTEND.STORE": {
653 "TOTAL": "Total",
654 "CONTACT_SALES": "Contact Sales",
655 "FREE": "Free",
656 "STARTING_AT": "Starting at",
657 "ENABLED_UPPER": "ENABLED",
658 "ENABLE_UPPER": "ENABLE",
659 "MIN_TO_MAX": "{{minRange}} to {{maxRange}}",
660 "PRODUCT_PRICING_WITH_FREQUENCY": "{{pricingTier}} accounts {{frequency}}",
661 "COMMITMENT_WITH_RENEWAL": "*{{initial}} {{frequencyString}} minimum, renews for {{recurring}} {{frequencyString}} periods",
662 "COMMITMENT": "${{initial}} ${{frequencyString}} commitment",
663 "PRICING_FREQUENCIES": {
664 "MONTH": "month",
665 "YEAR": "year"
666 },
667 "REQUIRES_DESCRIPTOR": "(Requires {{requirementName}})",
668 "ADMINISTRATIVE_QUESTIONS": "Administrative Questions",
669 "AUTO_TITLE_TEXT": {
670 "SOME_FIELDS_INVALID": "* Some fields are invalid and/or required but empty",
671 "OPTIONAL_FIELDS_UNANSWERED": "Optional fields unanswered",
672 "COMPLETE": "Complete"
673 },
674 "REQUIRES": "Requires",
675 "ENABLED_WITH_PREREQUISITE": "Enabled with {{prerequisite}}",
676 "PRICE_APPLIES_PER_UNIT": "Price applies per unit within a range",
677 "PRICE_APPLIES_TO_ALL_UNITS": "Price applies to all units once range is met",
678 "PRICING": "Pricing",
679 "FAQS": "FAQs",
680 "GALLERY": "Gallery",
681 "FILES": "Files",
682 "GET_IT_NOW": "Get It Now",
683 "CONTAINS_NUM_ITEMS": "Contains {{itemCount}} items"
684 }
685 };
686 return En;
687 }());
688 if (false) {
689 /** @type {?} */
690 En.en;
691 }
692
693 /**
694 * @fileoverview added by tsickle
695 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
696 */
697 /*tslint:disable*/
698 var Cs = /** @class */ (function () {
699 function Cs() {
700 }
701 Cs.cs = {
702 "FRONTEND.STORE": {
703 "TOTAL": "Celkem",
704 "CONTACT_SALES": "Kontaktovat obchodního zástupce",
705 "FREE": "Zdarma",
706 "STARTING_AT": "Začíná na",
707 "ENABLED_UPPER": "POVOLENO",
708 "ENABLE_UPPER": "POVOLIT",
709 "MIN_TO_MAX": "{{minRange}} až {{maxRange}}",
710 "PRODUCT_PRICING_WITH_FREQUENCY": "{{pricingTier}} účtů za {{frequency}}",
711 "COMMITMENT_WITH_RENEWAL": "*{{initial}} {{frequencyString}} minimum, obnovuje se na {{recurring}} {{frequencyString}}",
712 "COMMITMENT": "Závazek {{initial}} {{frequencyString}}",
713 "PRICING_FREQUENCIES": {
714 "MONTH": "měsíč",
715 "YEAR": "rok"
716 },
717 "REQUIRES_DESCRIPTOR": "(Vyžaduje {{requirementName}})",
718 "ADMINISTRATIVE_QUESTIONS": "Administrativní otázky",
719 "AUTO_TITLE_TEXT": {
720 "SOME_FIELDS_INVALID": "* Některá pole jsou neplatná a/nebo povinná, ale prázdná",
721 "OPTIONAL_FIELDS_UNANSWERED": "Volitelná pole nezodpovězena",
722 "COMPLETE": "Kompletní"
723 },
724 "REQUIRES": "Vyžaduje",
725 "ENABLED_WITH_PREREQUISITE": "Povoleno s {{prerequisite}}",
726 "PRICE_APPLIES_PER_UNIT": "Cena platí za jednotku v rozsahu",
727 "PRICE_APPLIES_TO_ALL_UNITS": "Cena se vztahuje na všechny jednotky, jakmile je dosaženo rozsahu",
728 "PRICING": "Cena",
729 "FAQS": "FAQ",
730 "GALLERY": "Galerie",
731 "FILES": "Soubory",
732 "GET_IT_NOW": "Získat hned",
733 "CONTAINS_NUM_ITEMS": "Obsahuje {{itemCount}} položek"
734 }
735 };
736 return Cs;
737 }());
738 if (false) {
739 /** @type {?} */
740 Cs.cs;
741 }
742
743 /**
744 * @fileoverview added by tsickle
745 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
746 */
747 var VaPricingModule = /** @class */ (function () {
748 function VaPricingModule(translateService, currentLang$, defaultLang$) {
749 this.translateService = translateService;
750 if (!this.translateService.translations.hasOwnProperty('en')) {
751 this.translateService.reloadLang('en');
752 }
753 if (!this.translateService.translations.hasOwnProperty('cs')) {
754 this.translateService.reloadLang('cs');
755 }
756 this.translateService.setTranslation('en', En.en, true);
757 this.translateService.setTranslation('cs', Cs.cs, true);
758 if (currentLang$) {
759 currentLang$.subscribe((/**
760 * @param {?} currentLang
761 * @return {?}
762 */
763 function (currentLang) { return translateService.use(currentLang); }));
764 }
765 if (defaultLang$) {
766 defaultLang$.subscribe((/**
767 * @param {?} defaultLang
768 * @return {?}
769 */
770 function (defaultLang) { return translateService.setDefaultLang(defaultLang); }));
771 }
772 }
773 VaPricingModule.decorators = [
774 { type: core.NgModule, args: [{
775 imports: [
776 common.CommonModule,
777 shared.CoreSharedModule,
778 core$1.TranslateModule.forChild()
779 ],
780 declarations: [VaPricingComponent, HighlightPricingComponent, TablePricingComponent],
781 exports: [VaPricingComponent]
782 },] }
783 ];
784 /** @nocollapse */
785 VaPricingModule.ctorParameters = function () { return [
786 { type: core$1.TranslateService },
787 { type: rxjs.Observable, decorators: [{ type: core.Optional }, { type: core.Inject, args: ['CURRENT_LANG',] }] },
788 { type: rxjs.Observable, decorators: [{ type: core.Optional }, { type: core.Inject, args: ['DEFAULT_LANG',] }] }
789 ]; };
790 return VaPricingModule;
791 }());
792 if (false) {
793 /**
794 * @type {?}
795 * @private
796 */
797 VaPricingModule.prototype.translateService;
798 }
799
800 /**
801 * @fileoverview added by tsickle
802 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
803 */
804 var StoreCardComponent = /** @class */ (function () {
805 function StoreCardComponent(imageTransformationService) {
806 this.imageTransformationService = imageTransformationService;
807 this.purchasedClicked = new core.EventEmitter();
808 this.cardClicked = new core.EventEmitter();
809 this.descriptionClicked = new core.EventEmitter();
810 this.bannerClicked = new core.EventEmitter();
811 }
812 /**
813 * @return {?}
814 */
815 StoreCardComponent.prototype.getBannerColorForName = /**
816 * @return {?}
817 */
818 function () {
819 // determine an icon color for a product with no icon by using the product name
820 /** @type {?} */
821 var COLOR_CODES = [
822 '#EF5350', '#42A5F5', '#66BB6A', '#FFA726', '#AB47BC', '#FFCA28', '#EC407A', '#26C6DA',
823 '#FF7B57'
824 ];
825 /** @type {?} */
826 var nameSum = 0;
827 /** @type {?} */
828 var defaultColor = '#808080';
829 if (!this.item.name) {
830 return defaultColor;
831 }
832 for (var i = 0; i < this.item.name.length; i++) {
833 nameSum += this.item.name[i].charCodeAt(0);
834 }
835 /** @type {?} */
836 var index = nameSum % COLOR_CODES.length;
837 return COLOR_CODES[index];
838 };
839 /**
840 * @param {?} imageUrl
841 * @return {?}
842 */
843 StoreCardComponent.prototype.getSrcsetHeaderUrls = /**
844 * @param {?} imageUrl
845 * @return {?}
846 */
847 function (imageUrl) {
848 return this.imageTransformationService.getSrcSetForImage(imageUrl, [680, 1360, 2720]);
849 };
850 StoreCardComponent.decorators = [
851 { type: core.Component, args: [{
852 selector: 'va-store-card',
853 template: "\n<mat-card class=\"hover-card\" *ngIf=\"item\" (click)=\"cardClicked.emit(item)\">\n<div class=\"hover-area\">\n <div class=\"product-banner\" (click)=\"bannerClicked.emit(item)\"\n [style.background-color]=\"item.headerImageUrl ? '': getBannerColorForName()\">\n <img class=\"img-container\" *ngIf=\"item.headerImageUrl\"\n [src]=\"item.headerImageUrl\" [srcset]=\"getSrcsetHeaderUrls(item.headerImageUrl)\">\n </div>\n\n <div class=\"description\" (click)=\"descriptionClicked.emit(item)\">\n <mat-card-header>\n <va-icon mat-card-avatar [diameter]=\"40\" [name]=\"item.name\" [iconUrl]=\"item.iconUrl\"></va-icon>\n <mat-card-title>{{item.name}}</mat-card-title>\n <mat-card-subtitle>\n <ng-container *ngIf=\"item.pricing; else formatted\">\n <va-pricing [pricing]=\"item.pricing\"\n [highlightPrice]=\"false\"></va-pricing>\n </ng-container>\n <ng-template #formatted>{{item.formattedPrice}}</ng-template>\n </mat-card-subtitle>\n </mat-card-header>\n <mat-card-content> {{ item.tagline }}\n </mat-card-content>\n </div>\n\n <button *ngIf=\"item.purchased !== undefined\"\n mat-button color=\"primary\" class=\"enabled-indicator\" (click)=\"purchasedClicked.emit(item)\" [disabled]=\"item.purchased\">\n <i *ngIf=\"!item.purchased\" class=\"material-icons\">add</i>\n <i *ngIf=\"item.purchased\" class=\"material-icons\" style=\"color: #39B74A\">check</i>\n <span>{{ (item.purchased ? 'FRONTEND.STORE.ENABLED_UPPER' : 'FRONTEND.STORE.ENABLE_UPPER') | translate }}</span>\n </button>\n </div>\n</mat-card>\n ",
854 styles: [":host{position:relative}::ng-deep .mat-card-header-text{width:100%}mat-card.hover-card{overflow:hidden;padding:0;margin-bottom:0}mat-card.hover-card mat-card-subtitle,mat-card.hover-card mat-card-title{margin:0 80px 0 0;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}mat-card.hover-card mat-card-subtitle{font-size:12px;margin-top:4px}.hover-area{position:relative;cursor:pointer}.product-banner{max-height:133px;overflow:hidden;display:-webkit-box;display:flex;width:100%;height:100px;-webkit-box-align:center;align-items:center;-webkit-box-pack:center;justify-content:center}.product-banner img{max-width:100%}@media screen and (min-width:480px){.hover-area{padding-top:55%}.hover-area:hover .description{top:0}.hover-area:hover .enabled-indicator span{width:70px}.product-banner{max-height:none;position:absolute;height:60%;top:0}}.description{box-sizing:border-box;padding:10px 16px 0;overflow:hidden;background:#fff;color:#212121;-webkit-transition:.3s;transition:.3s}.description:after{content:'';display:block;width:100%;height:40%;position:absolute;bottom:0;left:0;background:-webkit-gradient(linear,left top,left bottom,color-stop(40%,rgba(255,255,255,0)),color-stop(70%,#fff));background:linear-gradient(rgba(255,255,255,0) 40%,#fff 70%)}mat-card-header{box-sizing:border-box;padding-bottom:16px;margin:0;height:40%;display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center}mat-card-content{min-height:40px;max-height:80px;padding:16px;margin:0 -16px;border-top:1px solid #e0e0e0;font-size:12px}.enabled-indicator{position:absolute;right:8px;bottom:8px}.enabled-indicator span{display:inline-block;width:70px;overflow:hidden;-webkit-transition:.3s;transition:.3s}@media screen and (min-width:480px){.description{position:absolute;top:60%;width:100%;height:100%}.description:after{height:70%}mat-card-content{min-height:0;max-height:none}.enabled-indicator span{width:0}}button[mat-button]{padding:0 8px;min-width:0}mat-card-actions{position:relative;padding:8px!important;margin:0!important;text-align:right;border-top:1px solid #e0e0e0;background-color:#fff;color:#212121}.status{font-size:14px}.img-container{height:100%;width:100%}"]
855 }] }
856 ];
857 /** @nocollapse */
858 StoreCardComponent.ctorParameters = function () { return [
859 { type: imageTransformation.ImageTransformationService }
860 ]; };
861 StoreCardComponent.propDecorators = {
862 item: [{ type: core.Input }],
863 purchasedClicked: [{ type: core.Output }],
864 cardClicked: [{ type: core.Output }],
865 descriptionClicked: [{ type: core.Output }],
866 bannerClicked: [{ type: core.Output }]
867 };
868 return StoreCardComponent;
869 }());
870 if (false) {
871 /** @type {?} */
872 StoreCardComponent.prototype.item;
873 /** @type {?} */
874 StoreCardComponent.prototype.purchasedClicked;
875 /** @type {?} */
876 StoreCardComponent.prototype.cardClicked;
877 /** @type {?} */
878 StoreCardComponent.prototype.descriptionClicked;
879 /** @type {?} */
880 StoreCardComponent.prototype.bannerClicked;
881 /**
882 * @type {?}
883 * @private
884 */
885 StoreCardComponent.prototype.imageTransformationService;
886 }
887
888 /**
889 * @fileoverview added by tsickle
890 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
891 */
892 var StoreCardModule = /** @class */ (function () {
893 function StoreCardModule(translateService, currentLang$, defaultLang$) {
894 this.translateService = translateService;
895 if (!this.translateService.translations.hasOwnProperty('en')) {
896 this.translateService.reloadLang('en');
897 }
898 if (!this.translateService.translations.hasOwnProperty('cs')) {
899 this.translateService.reloadLang('cs');
900 }
901 this.translateService.setTranslation('en', En.en, true);
902 this.translateService.setTranslation('cs', Cs.cs, true);
903 if (currentLang$) {
904 currentLang$.subscribe((/**
905 * @param {?} currentLang
906 * @return {?}
907 */
908 function (currentLang) { return translateService.use(currentLang); }));
909 }
910 if (defaultLang$) {
911 defaultLang$.subscribe((/**
912 * @param {?} defaultLang
913 * @return {?}
914 */
915 function (defaultLang) { return translateService.setDefaultLang(defaultLang); }));
916 }
917 }
918 StoreCardModule.decorators = [
919 { type: core.NgModule, args: [{
920 imports: [
921 common.CommonModule,
922 uikit.VaIconModule,
923 material.MatCardModule,
924 material.MatButtonModule,
925 material.MatIconModule,
926 material.MatMenuModule,
927 imageTransformation.ImageTransformationModule,
928 VaPricingModule,
929 core$1.TranslateModule.forChild()
930 ],
931 declarations: [StoreCardComponent],
932 exports: [StoreCardComponent]
933 },] }
934 ];
935 /** @nocollapse */
936 StoreCardModule.ctorParameters = function () { return [
937 { type: core$1.TranslateService },
938 { type: rxjs.Observable, decorators: [{ type: core.Optional }, { type: core.Inject, args: ['CURRENT_LANG',] }] },
939 { type: rxjs.Observable, decorators: [{ type: core.Optional }, { type: core.Inject, args: ['DEFAULT_LANG',] }] }
940 ]; };
941 return StoreCardModule;
942 }());
943 if (false) {
944 /**
945 * @type {?}
946 * @private
947 */
948 StoreCardModule.prototype.translateService;
949 }
950
951 /**
952 * @fileoverview added by tsickle
953 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
954 */
955 var StoreComponent = /** @class */ (function () {
956 function StoreComponent() {
957 this.items = [];
958 this.searchable = true;
959 this.itemClicked = new core.EventEmitter();
960 }
961 Object.defineProperty(StoreComponent.prototype, "filteredItems", {
962 get: /**
963 * @return {?}
964 */
965 function () {
966 var _this = this;
967 if (this.filterTerm) {
968 return this.items.filter((/**
969 * @param {?} pkg
970 * @return {?}
971 */
972 function (pkg) { return pkg.name.toLowerCase().indexOf(_this.filterTerm.toLowerCase()) !== -1; }));
973 }
974 return this.items;
975 },
976 enumerable: true,
977 configurable: true
978 });
979 StoreComponent.decorators = [
980 { type: core.Component, args: [{
981 selector: 'va-store',
982 template: "\n <div class=\"toolbar\">\n <div *ngIf=\"searchable\" class=\"table-controls-row\">\n <va-search-box (update)=\"filterTerm = $event\"></va-search-box>\n </div>\n </div>\n <div class=\"row row-gutters\">\n <div *ngFor=\"let item of filteredItems\" class=\"col-flex\">\n <va-store-card [item]=\"item\" (cardClicked)=\"this.itemClicked.emit(item)\"></va-store-card>\n </div>\n </div>\n ",
983 styles: [".flex-row{display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row}.toolbar{padding:0;background-color:#fff;color:#616161}.toolbar .disabled{cursor:default}.toolbar .disabled mat-icon{cursor:default;color:#9e9e9e}.toolbar va-search-box{margin-right:10px;width:350px}.toolbar .table-controls-row{padding:0 10px 10px;display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;-webkit-box-align:center;align-items:center}.toolbar .table-controls-row:first-of-type{padding-top:10px}.top-border{border-top:1px solid #fff}.selected{background-color:#fff}.row{display:-webkit-box;display:flex;flex-wrap:wrap}.row+.row-gutters{margin-top:0}.row-gutters{margin-top:-20px;margin-left:-20px}.row-gutters>.col-flex{padding-top:20px;padding-left:20px}.col-flex{position:relative;max-width:100%;box-sizing:border-box;-webkit-box-flex:0;flex:0 0 auto;width:100%}@media screen and (min-width:480px){.col-flex{width:50%}}@media screen and (min-width:1200px){.col-flex{width:33.333333%}}"]
984 }] }
985 ];
986 StoreComponent.propDecorators = {
987 items: [{ type: core.Input }],
988 searchable: [{ type: core.Input }],
989 itemClicked: [{ type: core.Output }]
990 };
991 return StoreComponent;
992 }());
993 if (false) {
994 /** @type {?} */
995 StoreComponent.prototype.items;
996 /** @type {?} */
997 StoreComponent.prototype.searchable;
998 /** @type {?} */
999 StoreComponent.prototype.itemClicked;
1000 /** @type {?} */
1001 StoreComponent.prototype.filterTerm;
1002 }
1003
1004 /**
1005 * @fileoverview added by tsickle
1006 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1007 */
1008 var DropDownFormSectionComponent = /** @class */ (function () {
1009 function DropDownFormSectionComponent(translateService) {
1010 this.translateService = translateService;
1011 this.startOpen = false;
1012 this.displayAutoTitle = false;
1013 this.titleText = '';
1014 this.displayAutoDescription = true;
1015 this.descriptionText = '';
1016 this.editingHint = '';
1017 this.expandable = true;
1018 this.autoDescriptionText = '';
1019 this.iconName = 'help_outline';
1020 this.subscriptions = [];
1021 this.uniqueIndex = 1;
1022 this.autoTitleText = '';
1023 }
1024 /**
1025 * @return {?}
1026 */
1027 DropDownFormSectionComponent.prototype.ngOnInit = /**
1028 * @return {?}
1029 */
1030 function () {
1031 var _this = this;
1032 /** @type {?} */
1033 var allFieldsHidden = this.fields.reduce((/**
1034 * @param {?} p
1035 * @param {?} c
1036 * @param {?} i
1037 * @param {?} a
1038 * @return {?}
1039 */
1040 function (p, c, i, a) { return p && c.hidden; }), true);
1041 if (allFieldsHidden) {
1042 this.expandable = false;
1043 }
1044 while (this.parentForm.controls.hasOwnProperty(this.titleText + this.uniqueIndex)) {
1045 this.uniqueIndex += 1;
1046 }
1047 this.parentForm.addControl(this.titleText + this.uniqueIndex, this.toFormGroup(this.fields));
1048 /** @type {?} */
1049 var form = (/** @type {?} */ (this.parentForm.controls[this.titleText + this.uniqueIndex]));
1050 for (var key in form.controls) {
1051 if (form.controls.hasOwnProperty(key)) {
1052 if (this.prepopulatedData != null && this.prepopulatedData.hasOwnProperty(key)) {
1053 form.controls[key].setValue(this.prepopulatedData[key]);
1054 }
1055 }
1056 }
1057 this.subscriptions.push(rxjs.combineLatest([
1058 form.statusChanges,
1059 this.translateService.stream('FRONTEND.STORE.AUTO_TITLE_TEXT')
1060 ]).subscribe((/**
1061 * @param {?} __0
1062 * @return {?}
1063 */
1064 function (_a) {
1065 var _b = __read(_a, 2), change = _b[0], autoTitleText = _b[1];
1066 /** @type {?} */
1067 var missingFields = false;
1068 for (var control in form.controls) {
1069 if (!form.controls[control].value || (form.controls[control].value.constructor === Array && !form.controls[control].value[0])) {
1070 _this.iconName = 'help_outline';
1071 missingFields = true;
1072 if (change === 'INVALID') {
1073 _this.autoTitleText = autoTitleText.SOME_FIELDS_INVALID;
1074 if (form.controls[control].dirty || form.controls[control].touched) {
1075 _this.iconName = 'warning';
1076 break;
1077 }
1078 }
1079 else {
1080 _this.autoTitleText = autoTitleText.OPTIONAL_FIELDS_UNANSWERED;
1081 }
1082 }
1083 }
1084 if (!missingFields) {
1085 _this.iconName = 'check_circle';
1086 _this.autoTitleText = autoTitleText.COMPLETE;
1087 }
1088 })));
1089 if (this.displayAutoDescription) {
1090 this.subscriptions.push(form.valueChanges.subscribe((/**
1091 * @param {?} changes
1092 * @return {?}
1093 */
1094 function (changes) {
1095 /** @type {?} */
1096 var description = '';
1097 for (var key in changes) {
1098 if (changes.hasOwnProperty(key) && changes[key] != null && changes[key].length > 0) {
1099 if (changes[key][0].name) {
1100 for (var fileKey in changes[key]) {
1101 if (changes[key][fileKey] != null) {
1102 description += changes[key][fileKey].name;
1103 description += ', ';
1104 }
1105 }
1106 }
1107 else {
1108 description += changes[key];
1109 description += ', ';
1110 }
1111 }
1112 }
1113 _this.autoDescriptionText = description.substring(0, description.length - 2);
1114 })));
1115 }
1116 form.updateValueAndValidity({ onlySelf: false, emitEvent: true });
1117 };
1118 /**
1119 * @param {?} formFields
1120 * @return {?}
1121 */
1122 DropDownFormSectionComponent.prototype.toFormGroup = /**
1123 * @param {?} formFields
1124 * @return {?}
1125 */
1126 function (formFields) {
1127 var _this = this;
1128 /** @type {?} */
1129 var group = {};
1130 formFields.forEach((/**
1131 * @param {?} field
1132 * @return {?}
1133 */
1134 function (field) {
1135 /** @type {?} */
1136 var validations;
1137 if (!field.required || field.hidden) {
1138 validations = field.validator;
1139 }
1140 else if (field.controlType === 'checkbox') {
1141 validations = [forms.Validators.requiredTrue, field.validator];
1142 }
1143 else {
1144 validations = [forms.Validators.required, field.validator];
1145 }
1146 /** @type {?} */
1147 var formControl = new forms.FormControl({ value: field.value, disabled: field.disabled }, validations);
1148 group[field.id] = formControl;
1149 _this.subscriptions.push(formControl.valueChanges.subscribe((/**
1150 * @param {?} value
1151 * @return {?}
1152 */
1153 function (value) { return (field.value = value); })));
1154 }));
1155 return new forms.FormGroup(group);
1156 };
1157 /**
1158 * @return {?}
1159 */
1160 DropDownFormSectionComponent.prototype.ngOnDestroy = /**
1161 * @return {?}
1162 */
1163 function () {
1164 this.subscriptions.forEach((/**
1165 * @param {?} subscription
1166 * @return {?}
1167 */
1168 function (subscription) { return subscription.unsubscribe(); }));
1169 };
1170 DropDownFormSectionComponent.decorators = [
1171 { type: core.Component, args: [{
1172 selector: 'va-dropdown-form-section',
1173 template: "\n <mat-expansion-panel *ngIf=\"expandable || expandable == undefined\" [expanded]=\"startOpen\">\n <mat-expansion-panel-header [collapsedHeight]=\"'*'\" [expandedHeight]=\"'*'\">\n <div class=\"dropdown-form-header\">\n <mat-icon\n [ngClass]=\"{invalid: iconName=='warning', valid: iconName=='check_circle', question: iconName=='help_outline'}\">\n {{ iconName }}\n </mat-icon>\n <mat-panel-title *ngIf=\"!displayAutoTitle\">\n {{ titleText }}\n </mat-panel-title>\n <mat-panel-title *ngIf=\"displayAutoTitle\"\n [ngClass]=\"{valid: iconName=='check_circle', invalid: iconName=='warning'}\">\n <div class=\"title\"> {{ titleText }}</div>\n <div *ngIf=\"titleText && autoTitleText\"> &nbsp;</div>\n <div><ng-container><i> {{autoTitleText}} </i></ng-container></div>\n </mat-panel-title>\n <mat-panel-description *ngIf=\"displayAutoDescription\" [ngClass]=\"{invalid: iconName=='warning'}\">\n {{ autoDescriptionText }}\n </mat-panel-description>\n <mat-panel-description *ngIf=\"!displayAutoDescription\" [ngClass]=\"{invalid: iconName=='warning'}\">\n <i> {{descriptionText}} </i>\n </mat-panel-description>\n </div>\n </mat-expansion-panel-header>\n <div class=\"expansion-panel-body\">\n <va-field *ngFor=\"let field of fields\" [field]=\"field\"\n [form]=\"parentForm.controls[titleText + uniqueIndex]\"\n ></va-field>\n <p *ngIf=\"editingHint != ''\" class=\"editing-hint\"><i>{{ editingHint }}</i></p>\n </div>\n </mat-expansion-panel>\n ",
1174 styles: [":host-context(va-dropdown-form-section){font-size:14px}:host-context(va-dropdown-form-section) .expansion-panel-body{margin-top:-10px;display:block}@media screen and (min-width:600px){:host-context(va-dropdown-form-section) .expansion-panel-body{width:60%}}.mat-expanded,.mat-expansion-panel{-webkit-transition:margin .4s;transition:margin .4s}mat-expansion-panel-header{min-height:48px;padding:12px 24px}.dropdown-form-header{width:90%;display:-webkit-box;display:flex}mat-panel-description{align-self:center;-webkit-box-flex:inherit;flex:inherit;display:initial;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}mat-panel-description.invalid{color:#c62828}mat-icon{margin-right:7px;-ms-grid-row-align:center;align-self:center}mat-icon.valid{color:#4caf50}mat-icon.invalid{color:#c62828}mat-icon.question{color:#9e9e9e}mat-panel-title{align-self:center;-webkit-box-flex:0;flex:none;margin-right:20px;display:-webkit-box;display:flex;max-width:100%}mat-panel-title div{display:-webkit-box;display:flex}mat-panel-title.valid{color:#4caf50}mat-panel-title.invalid{color:#c62828}.editing-hint{color:#9e9e9e}.title{color:#212121}.not-expandable-card{background:#fff;cursor:default;font-size:15px;display:-webkit-box;display:flex;height:48px;-webkit-box-align:center;align-items:center;box-shadow:0 3px 1px -2px rgba(0,0,0,.2),0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12)}.not-expandable-card .not-expandable-icon{margin-left:24px}.not-expandable-card .not-expandable-header{display:-webkit-box;display:flex}.not-expandable-card .not-expandable-description{margin-left:22px}.not-expandable-card .valid{color:#4caf50}"]
1175 }] }
1176 ];
1177 /** @nocollapse */
1178 DropDownFormSectionComponent.ctorParameters = function () { return [
1179 { type: core$1.TranslateService }
1180 ]; };
1181 DropDownFormSectionComponent.propDecorators = {
1182 prepopulatedData: [{ type: core.Input }],
1183 startOpen: [{ type: core.Input }],
1184 parentForm: [{ type: core.Input }],
1185 displayAutoTitle: [{ type: core.Input }],
1186 titleText: [{ type: core.Input }],
1187 displayAutoDescription: [{ type: core.Input }],
1188 descriptionText: [{ type: core.Input }],
1189 fields: [{ type: core.Input }],
1190 editingHint: [{ type: core.Input }],
1191 expandable: [{ type: core.Input }]
1192 };
1193 return DropDownFormSectionComponent;
1194 }());
1195 if (false) {
1196 /** @type {?} */
1197 DropDownFormSectionComponent.prototype.prepopulatedData;
1198 /** @type {?} */
1199 DropDownFormSectionComponent.prototype.startOpen;
1200 /** @type {?} */
1201 DropDownFormSectionComponent.prototype.parentForm;
1202 /** @type {?} */
1203 DropDownFormSectionComponent.prototype.displayAutoTitle;
1204 /** @type {?} */
1205 DropDownFormSectionComponent.prototype.titleText;
1206 /** @type {?} */
1207 DropDownFormSectionComponent.prototype.displayAutoDescription;
1208 /** @type {?} */
1209 DropDownFormSectionComponent.prototype.descriptionText;
1210 /** @type {?} */
1211 DropDownFormSectionComponent.prototype.fields;
1212 /** @type {?} */
1213 DropDownFormSectionComponent.prototype.editingHint;
1214 /** @type {?} */
1215 DropDownFormSectionComponent.prototype.expandable;
1216 /** @type {?} */
1217 DropDownFormSectionComponent.prototype.autoDescriptionText;
1218 /** @type {?} */
1219 DropDownFormSectionComponent.prototype.iconName;
1220 /** @type {?} */
1221 DropDownFormSectionComponent.prototype.subscriptions;
1222 /** @type {?} */
1223 DropDownFormSectionComponent.prototype.uniqueIndex;
1224 /** @type {?} */
1225 DropDownFormSectionComponent.prototype.autoTitleText;
1226 /**
1227 * @type {?}
1228 * @private
1229 */
1230 DropDownFormSectionComponent.prototype.translateService;
1231 }
1232
1233 /**
1234 * @fileoverview added by tsickle
1235 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1236 */
1237 var FieldComponent = /** @class */ (function () {
1238 function FieldComponent() {
1239 }
1240 Object.defineProperty(FieldComponent.prototype, "isValid", {
1241 get: /**
1242 * @return {?}
1243 */
1244 function () {
1245 return this.form.controls[this.field.id].valid || this.form.controls[this.field.id].pristine;
1246 },
1247 enumerable: true,
1248 configurable: true
1249 });
1250 /**
1251 * @param {?} field
1252 * @return {?}
1253 */
1254 FieldComponent.prototype.showCheckboxError = /**
1255 * @param {?} field
1256 * @return {?}
1257 */
1258 function (field) {
1259 return this.form.controls[field].errors && this.form.controls[field].errors.required && this.form.controls[field].touched;
1260 };
1261 FieldComponent.decorators = [
1262 { type: core.Component, args: [{
1263 selector: 'va-field',
1264 template: "<ng-container [ngSwitch]=\"field.controlType\" [formGroup]=\"form\">\n <div *ngIf=\"!field.hidden\" [ngClass]=\"{'for-office-use-only': field.forOfficeUseOnly}\">\n <span *ngIf=\"field.forOfficeUseOnly\" class=\"office-text\">*For Office Use Only</span>\n\n <ng-container *ngSwitchCase=\"'dropdown'\">\n <ng-container *ngIf=\"!field.allowMultiples\">\n <mat-form-field class=\"form-field-container\">\n <mat-select matInput [formControlName]=\"field.id\" [id]=\"field.id\" [placeholder]=\"field.getLabel()\">\n <mat-option *ngFor=\"let option of field.options\" [value]=\"option.value\">{{ option.label }}</mat-option>\n </mat-select>\n <mat-hint *ngIf=\"field.description\"> {{ field.description }} </mat-hint>\n </mat-form-field>\n </ng-container>\n <ng-container *ngIf=\"field.allowMultiples\">\n <va-input-tags class=\"form-field-container\" [id]=\"field.id\" [formControlName]=\"field.id\"\n [placeholder]=\"field.getLabel()\"\n [tooltip]=\"field.description\"\n [required]=\"field.required\"\n [options]=\"field.options\"\n [allowDuplicates]=\"field.allowDuplicates\"\n [maxFields]=\"field.maxChoices\">\n </va-input-tags>\n </ng-container>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'textbox'\">\n <mat-form-field class=\"form-field-container\">\n <span matPrefix *ngIf=\"field.prefix\"> {{ field.prefix}} &nbsp;</span>\n <input matInput [type]=\"field.textboxType\" [id]=\"field.id\" [formControlName]=\"field.id\" [placeholder]=\"field.getLabel()\" [pattern]=\"field.regexValidator || ''\"\n [readonly]=\"field.displayOnly\" [ngClass]=\"{'display-only': field.displayOnly}\">\n <span matSuffix *ngIf=\"field.suffix\"> &nbsp;{{ field.suffix }} </span>\n <mat-hint *ngIf=\"field.description\"> {{ field.description }} </mat-hint>\n <mat-error *ngIf=\"form.controls[field.id].hasError('pattern')\"> {{field.regexErrorMessage}} </mat-error>\n </mat-form-field>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'checkbox'\">\n <div class=\"form-field-container checkbox\">\n <mat-checkbox [formControlName]=\"field.id\" [id]=\"field.id\" ngControlDefault></mat-checkbox>\n <div class=\"checkbox-placeholder\"> {{field.label}}</div>\n <mat-error *ngIf=\"showCheckboxError(field.id)\" class=\"checkboxError\"> *Required </mat-error>\n </div>\n <div class=\"checkbox-description\" *ngIf=\"field.description\">{{ field.description }}</div>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'textarea'\">\n <mat-form-field class=\"form-field-container\">\n <textarea matInput [formControlName]=\"field.id\" [placeholder]=\"field.getLabel()\" [id]=\"field.id\"></textarea>\n <mat-hint *ngIf=\"field.description\"> {{ field.description }} </mat-hint>\n </mat-form-field>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'file'\">\n <div class=\"form-field-container\">\n <file-group-uploader [uploadUrl]=\"field.uploadUrl\" [label]=\"field.getLabel()\" [description]=\"field.description\" [formGroup]=\"form\" [formControlName]=\"field.id\"\n [numFiles]=\"field.numFiles\" class=\"form-field-container\"></file-group-uploader>\n </div>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'vbcuser'\">\n <mat-form-field class=\"form-field-container\">\n <mat-select matInput [formControlName]=\"field.id\" [id]=\"field.id\" [placeholder]=\"field.getLabel()\">\n <mat-option *ngFor=\"let option of field.options\" [value]=\"option.value\" [disabled]=\"option.disabled\">{{ option.label }}</mat-option>\n </mat-select>\n <mat-hint *ngIf=\"field.description\"> {{ field.description }} </mat-hint>\n </mat-form-field>\n </ng-container>\n </div>\n</ng-container>\n",
1265 styles: [".form-field-container{font-size:16px;width:100%;margin:10px 0}.checkbox{display:-webkit-box;display:flex;padding:5px 0;color:rgba(0,0,0,.54);margin-top:24px}.checkbox .checkbox-placeholder{margin-left:10px}.checkbox-description{margin-top:-14px;margin-left:32px;color:rgba(0,0,0,.54);font-size:12px}.for-office-use-only{position:relative}.office-text{font-size:8px;position:absolute;right:5px}.display-only{color:rgba(0,0,0,.38)}.checkboxError{padding-left:16px}"]
1266 }] }
1267 ];
1268 FieldComponent.propDecorators = {
1269 field: [{ type: core.Input }],
1270 form: [{ type: core.Input }]
1271 };
1272 return FieldComponent;
1273 }());
1274 if (false) {
1275 /** @type {?} */
1276 FieldComponent.prototype.field;
1277 /** @type {?} */
1278 FieldComponent.prototype.form;
1279 }
1280
1281 /**
1282 * @fileoverview added by tsickle
1283 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1284 */
1285 var FieldService = /** @class */ (function () {
1286 function FieldService() {
1287 }
1288 /**
1289 * @param {?} field
1290 * @return {?}
1291 */
1292 FieldService.prototype.createFormControl = /**
1293 * @param {?} field
1294 * @return {?}
1295 */
1296 function (field) {
1297 if (field.required) {
1298 return new forms.FormControl(field.value, forms.Validators.required);
1299 }
1300 else {
1301 return new forms.FormControl(field.value);
1302 }
1303 };
1304 /**
1305 * @param {?} formFields
1306 * @param {?} subscriptions
1307 * @return {?}
1308 */
1309 FieldService.prototype.toFormGroup = /**
1310 * @param {?} formFields
1311 * @param {?} subscriptions
1312 * @return {?}
1313 */
1314 function (formFields, subscriptions) {
1315 var _this = this;
1316 /** @type {?} */
1317 var group = {};
1318 formFields.forEach((/**
1319 * @param {?} field
1320 * @return {?}
1321 */
1322 function (field) {
1323 /** @type {?} */
1324 var formControl;
1325 if (field.controlType === 'checkbox') {
1326 formControl = new forms.FormControl(field.value);
1327 }
1328 else {
1329 formControl = _this.createFormControl(field);
1330 }
1331 group[field.id] = formControl;
1332 if (subscriptions) {
1333 subscriptions.push(formControl.valueChanges.subscribe((/**
1334 * @param {?} value
1335 * @return {?}
1336 */
1337 function (value) { return (field.value = value); })));
1338 }
1339 }));
1340 return new forms.FormGroup(group);
1341 };
1342 FieldService.decorators = [
1343 { type: core.Injectable }
1344 ];
1345 return FieldService;
1346 }());
1347
1348 /**
1349 * @fileoverview added by tsickle
1350 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1351 */
1352 var VaHeaderContainerComponent = /** @class */ (function () {
1353 function VaHeaderContainerComponent(translateService) {
1354 this.translateService = translateService;
1355 this.loaded = true;
1356 this.showEnableAddon = false;
1357 this.prerequisiteSelected = new core.EventEmitter();
1358 this.actionSelected = new core.EventEmitter();
1359 this.primaryPricingActionSelected = new core.EventEmitter();
1360 this.pricingActionSelected = new core.EventEmitter();
1361 }
1362 /**
1363 * @return {?}
1364 */
1365 VaHeaderContainerComponent.prototype.onActionSelected = /**
1366 * @return {?}
1367 */
1368 function () {
1369 this.actionSelected.emit();
1370 };
1371 /**
1372 * @return {?}
1373 */
1374 VaHeaderContainerComponent.prototype.onPrerequisiteSelected = /**
1375 * @return {?}
1376 */
1377 function () {
1378 this.prerequisiteSelected.emit();
1379 };
1380 /**
1381 * @param {?} billedProduct
1382 * @return {?}
1383 */
1384 VaHeaderContainerComponent.prototype.showPricingModel = /**
1385 * @param {?} billedProduct
1386 * @return {?}
1387 */
1388 function (billedProduct) {
1389 return billedProduct && [billing.BillingModel.Tiered, billing.BillingModel.Stairstep].includes(billedProduct.billingModel);
1390 };
1391 /**
1392 * @param {?} billingModel
1393 * @return {?}
1394 */
1395 VaHeaderContainerComponent.prototype.getPricingModelTooltips = /**
1396 * @param {?} billingModel
1397 * @return {?}
1398 */
1399 function (billingModel) {
1400 switch (billingModel) {
1401 case billing.BillingModel.Stairstep:
1402 return this.translateService.stream('FRONTEND.STORE.PRICE_APPLIES_PER_UNIT');
1403 case billing.BillingModel.Tiered:
1404 return this.translateService.stream('FRONTEND.STORE.PRICE_APPLIES_TO_ALL_UNITS');
1405 default:
1406 return rxjs.of('');
1407 }
1408 };
1409 VaHeaderContainerComponent.decorators = [
1410 { type: core.Component, args: [{
1411 selector: 'va-header-container',
1412 template: "<div class=\"header-container\">\n <div class=\"product-overview\">\n <div class=\"product-id\">\n\n <va-icon [iconUrl]=\"iconUrl\" [name]=\"title\" [diameter]=\"120\"></va-icon>\n\n <div class=\"product-id-text\">\n\n <h1 [ngClass]=\"{'stencil-title stencil-shimmer': !title, 'product-title': title}\">\n {{ title }}\n </h1>\n\n <span [ngClass]=\"{'stencil-tagline stencil-shimmer': !title && !tagline, 'tagline': tagline}\">\n {{ tagline }}\n </span>\n\n <div *ngIf=\"prerequisite\" class=\"prerequisite\">\n <span class=\"requires-text\">{{ 'FRONTEND.STORE.REQUIRES' | translate }}</span>\n <span>{{ prerequisite }}</span>\n </div>\n\n <mat-chip-list>\n <mat-chip *ngFor=\"let chip of chipLabels\">{{ chip }}</mat-chip>\n </mat-chip-list>\n\n </div>\n </div>\n\n <div class=\"pricing\">\n\n <button *ngIf=\"showAction && !showEnableAddon\" mat-raised-button class=\"app-enable-button\" [disabled]=\"!actionEnabled\" (click)=\"onActionSelected()\">\n {{ actionLabel }}\n </button>\n\n <button *ngIf=\"showEnableAddon && !showAction\" mat-raised-button class=\"app-enable-button\" [disabled]=\"!showEnableAddon\" (click)=\"onActionSelected()\">\n {{ actionLabel }}\n </button>\n\n <div *ngIf=\"prerequisiteLabel && !showEnableAddon\" class=\"addon-enable\" (click)=\"onPrerequisiteSelected()\">\n {{ 'FRONTEND.STORE.ENABLED_WITH_PREREQUISITE' | translate: {prerequisite: prerequisiteLabel } }}\n </div>\n\n <div *ngIf=\"showPricing\" class=\"price-box\">\n <div *ngIf=\"pricing?.prices?.length\" class=\"wholesale-price\">{{ pricingLabel }}\n <div *ngIf=\"showPricingModel(billedProduct) && hasVerifiedContract\"\n class=\"pricing-model\"\n [matTooltip]=\"getPricingModelTooltips(billedProduct.billingModel) | async\">({{ billedProduct.billingModel }})\n </div>\n </div>\n <va-pricing [pricing]=\"pricing\"\n [billedProduct]=\"billedProduct\"\n [hasVerifiedContract]=\"hasVerifiedContract\"\n [loaded]=\"loaded\"></va-pricing>\n </div>\n\n <p *ngIf=\"pricingActionEnabled\" class=\"pricing-action-container\">\n <a (click)=\"primaryPricingActionSelected.emit()\">{{ primaryPricingActionLabel }}</a>\n <a (click)=\"pricingActionSelected.emit()\">{{ pricingActionLabel }}</a>\n </p>\n\n </div>\n\n </div>\n</div>\n",
1413 styles: [":host{font-size:16px}.product-title{font-size:24px}.product-overview{display:-webkit-box;display:flex;flex-wrap:wrap;border-bottom:1px solid #e0e0e0}.product-overview h1{margin:0;font-weight:400;line-height:1.2}.product-overview mat-chip{margin-bottom:3px}.product-id{display:-webkit-box;display:flex;width:100%;padding:24px;-webkit-box-flex:1;flex-grow:1}.product-id va-icon{margin-right:20px}@media screen and (max-width:600px){.product-id va-icon ::ng-deep .va-icon-container{width:40px!important;height:40px!important}.product-id va-icon ::ng-deep .va-icon-container span{line-height:40px!important;font-size:15px!important}}.product-id .product-id-text{display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;-webkit-box-pack:center;justify-content:center}.product-id span{overflow:hidden}.product-id .tagline{color:#616161;margin:.5em 0 1em;font-size:16px}@media screen and (min-width:600px){.product-title{font-size:32px}.product-id .tagline{font-size:20px}.product-id{width:66%;padding-right:20px}}.product-id .prerequisite{margin:.5em 0 1em;font-size:14px}.product-id .requires-text{color:#9e9e9e}.inline-link{display:-webkit-inline-box!important;display:inline-flex!important;color:#1e88e5;cursor:pointer;padding-top:5px}.pricing{display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;width:100%;padding:0 24px 24px;color:#616161}@media screen and (min-width:600px){.pricing{width:34%;padding-top:24px;padding-left:20px}}.pricing span{display:block}.pricing span:nth-child(2){margin:.5em 0 1em}.pricing .price{font-size:24px;font-weight:700;line-height:1;color:#4caf50}.pricing .price-box{padding-top:10px}.pricing .pricing-action-container{display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;margin:8px 0}.pricing .pricing-action-container mat-icon{vertical-align:middle;margin-right:6px}.pricing .pricing-action-container a{cursor:pointer;margin:5px 0}.pricing .pricing-model{display:inline-block;font-size:.8rem;color:#9e9e9e;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.app-enable-button{height:inherit;color:#fff;background-color:#4caf50;font-size:20px;padding:14px 16px;line-height:1}.addon-enable{height:inherit;background-color:#e0e0e0;font-size:14px;padding:14px 16px;line-height:1;color:#1e88e5;cursor:pointer;text-align:center}.wholesale-price{margin-top:0;padding-bottom:8px;margin-bottom:4px;border-bottom:1px solid #e0e0e0}.stencil-title{height:32px;width:200px;margin-bottom:5px!important}.stencil-tagline{height:32px;width:250px}"]
1414 }] }
1415 ];
1416 /** @nocollapse */
1417 VaHeaderContainerComponent.ctorParameters = function () { return [
1418 { type: core$1.TranslateService }
1419 ]; };
1420 VaHeaderContainerComponent.propDecorators = {
1421 iconUrl: [{ type: core.Input }],
1422 title: [{ type: core.Input }],
1423 tagline: [{ type: core.Input }],
1424 prerequisite: [{ type: core.Input }],
1425 chipLabels: [{ type: core.Input }],
1426 pricing: [{ type: core.Input }],
1427 billedProduct: [{ type: core.Input }],
1428 loaded: [{ type: core.Input }],
1429 hasVerifiedContract: [{ type: core.Input }],
1430 pricingLabel: [{ type: core.Input }],
1431 primaryPricingActionLabel: [{ type: core.Input }],
1432 pricingActionLabel: [{ type: core.Input }],
1433 pricingActionEnabled: [{ type: core.Input }],
1434 actionEnabled: [{ type: core.Input }],
1435 actionLabel: [{ type: core.Input }],
1436 showAction: [{ type: core.Input }],
1437 showPricing: [{ type: core.Input }],
1438 showEnableAddon: [{ type: core.Input }],
1439 prerequisiteLabel: [{ type: core.Input }],
1440 prerequisiteSelected: [{ type: core.Output }],
1441 actionSelected: [{ type: core.Output }],
1442 primaryPricingActionSelected: [{ type: core.Output }],
1443 pricingActionSelected: [{ type: core.Output }]
1444 };
1445 return VaHeaderContainerComponent;
1446 }());
1447 if (false) {
1448 /** @type {?} */
1449 VaHeaderContainerComponent.prototype.iconUrl;
1450 /** @type {?} */
1451 VaHeaderContainerComponent.prototype.title;
1452 /** @type {?} */
1453 VaHeaderContainerComponent.prototype.tagline;
1454 /** @type {?} */
1455 VaHeaderContainerComponent.prototype.prerequisite;
1456 /** @type {?} */
1457 VaHeaderContainerComponent.prototype.chipLabels;
1458 /** @type {?} */
1459 VaHeaderContainerComponent.prototype.pricing;
1460 /** @type {?} */
1461 VaHeaderContainerComponent.prototype.billedProduct;
1462 /** @type {?} */
1463 VaHeaderContainerComponent.prototype.loaded;
1464 /** @type {?} */
1465 VaHeaderContainerComponent.prototype.hasVerifiedContract;
1466 /** @type {?} */
1467 VaHeaderContainerComponent.prototype.pricingLabel;
1468 /** @type {?} */
1469 VaHeaderContainerComponent.prototype.primaryPricingActionLabel;
1470 /** @type {?} */
1471 VaHeaderContainerComponent.prototype.pricingActionLabel;
1472 /** @type {?} */
1473 VaHeaderContainerComponent.prototype.pricingActionEnabled;
1474 /** @type {?} */
1475 VaHeaderContainerComponent.prototype.actionEnabled;
1476 /** @type {?} */
1477 VaHeaderContainerComponent.prototype.actionLabel;
1478 /** @type {?} */
1479 VaHeaderContainerComponent.prototype.showAction;
1480 /** @type {?} */
1481 VaHeaderContainerComponent.prototype.showPricing;
1482 /** @type {?} */
1483 VaHeaderContainerComponent.prototype.showEnableAddon;
1484 /** @type {?} */
1485 VaHeaderContainerComponent.prototype.prerequisiteLabel;
1486 /** @type {?} */
1487 VaHeaderContainerComponent.prototype.prerequisiteSelected;
1488 /** @type {?} */
1489 VaHeaderContainerComponent.prototype.actionSelected;
1490 /** @type {?} */
1491 VaHeaderContainerComponent.prototype.primaryPricingActionSelected;
1492 /** @type {?} */
1493 VaHeaderContainerComponent.prototype.pricingActionSelected;
1494 /**
1495 * @type {?}
1496 * @private
1497 */
1498 VaHeaderContainerComponent.prototype.translateService;
1499 }
1500
1501 /**
1502 * @fileoverview added by tsickle
1503 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1504 */
1505 var VaHeaderContainerModule = /** @class */ (function () {
1506 function VaHeaderContainerModule(translateService, currentLang$, defaultLang$) {
1507 this.translateService = translateService;
1508 if (!this.translateService.translations.hasOwnProperty('en')) {
1509 this.translateService.reloadLang('en');
1510 }
1511 if (!this.translateService.translations.hasOwnProperty('cs')) {
1512 this.translateService.reloadLang('cs');
1513 }
1514 this.translateService.setTranslation('en', En.en, true);
1515 this.translateService.setTranslation('cs', Cs.cs, true);
1516 if (currentLang$) {
1517 currentLang$.subscribe((/**
1518 * @param {?} currentLang
1519 * @return {?}
1520 */
1521 function (currentLang) { return translateService.use(currentLang); }));
1522 }
1523 if (defaultLang$) {
1524 defaultLang$.subscribe((/**
1525 * @param {?} defaultLang
1526 * @return {?}
1527 */
1528 function (defaultLang) { return translateService.setDefaultLang(defaultLang); }));
1529 }
1530 }
1531 VaHeaderContainerModule.decorators = [
1532 { type: core.NgModule, args: [{
1533 imports: [
1534 common.CommonModule,
1535 material.MatIconModule,
1536 VaPricingModule,
1537 uikit.VaIconModule,
1538 material.MatChipsModule,
1539 material.MatButtonModule,
1540 material.MatTooltipModule,
1541 core$1.TranslateModule.forChild()
1542 ],
1543 declarations: [VaHeaderContainerComponent],
1544 exports: [VaHeaderContainerComponent]
1545 },] }
1546 ];
1547 /** @nocollapse */
1548 VaHeaderContainerModule.ctorParameters = function () { return [
1549 { type: core$1.TranslateService },
1550 { type: rxjs.Observable, decorators: [{ type: core.Optional }, { type: core.Inject, args: ['CURRENT_LANG',] }] },
1551 { type: rxjs.Observable, decorators: [{ type: core.Optional }, { type: core.Inject, args: ['DEFAULT_LANG',] }] }
1552 ]; };
1553 return VaHeaderContainerModule;
1554 }());
1555 if (false) {
1556 /**
1557 * @type {?}
1558 * @private
1559 */
1560 VaHeaderContainerModule.prototype.translateService;
1561 }
1562
1563 /**
1564 * @fileoverview added by tsickle
1565 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1566 */
1567 var OrderFormSectionData = /** @class */ (function () {
1568 function OrderFormSectionData() {
1569 }
1570 return OrderFormSectionData;
1571 }());
1572 if (false) {
1573 /** @type {?} */
1574 OrderFormSectionData.prototype.parentForm;
1575 /** @type {?} */
1576 OrderFormSectionData.prototype.titleText;
1577 /** @type {?} */
1578 OrderFormSectionData.prototype.subtitleText;
1579 /** @type {?} */
1580 OrderFormSectionData.prototype.descriptionText;
1581 /** @type {?} */
1582 OrderFormSectionData.prototype.iconUrl;
1583 /** @type {?} */
1584 OrderFormSectionData.prototype.primarySection;
1585 /** @type {?} */
1586 OrderFormSectionData.prototype.subsections;
1587 }
1588
1589 /**
1590 * @fileoverview added by tsickle
1591 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1592 */
1593 var OrderFormSectionComponent = /** @class */ (function () {
1594 function OrderFormSectionComponent() {
1595 }
1596 /**
1597 * @return {?}
1598 */
1599 OrderFormSectionComponent.prototype.ngOnInit = /**
1600 * @return {?}
1601 */
1602 function () {
1603 // The first section should always be expanded.
1604 /** @type {?} */
1605 var topSection = this.getTopSection();
1606 if (topSection) {
1607 topSection.startOpen = true;
1608 }
1609 };
1610 /**
1611 * @return {?}
1612 */
1613 OrderFormSectionComponent.prototype.getTopSection = /**
1614 * @return {?}
1615 */
1616 function () {
1617 if (!this.data) {
1618 return null;
1619 }
1620 if (this.data.primarySection) {
1621 return this.data.primarySection;
1622 }
1623 if (this.data.subsections && this.data.subsections.length > 0) {
1624 return this.data.subsections[0];
1625 }
1626 return null;
1627 };
1628 OrderFormSectionComponent.decorators = [
1629 { type: core.Component, args: [{
1630 selector: 'va-order-form-section',
1631 template: "<div>\n <mat-card class=\"va-order-form-section-header mat-card\">\n <div class=\"product-overview\">\n <div class=\"product-id\">\n <va-icon [iconUrl]=\"data.iconUrl\" [name]=\"data.titleText\" [diameter]=\"45\"></va-icon>\n <div class=\"product-id-text\">\n <h1 class=\"product-title\">{{ data.titleText }}</h1>\n <span *ngIf=\"data.subtitleText\" class=\"tagline\">{{ data.subtitleText }}</span>\n </div>\n </div>\n <div class=\"description\" *ngIf=\"data.descriptionText\">\n <span>{{ data.descriptionText }}</span>\n </div>\n </div>\n </mat-card>\n <va-dropdown-form-section class=\"va-primary-form-section\" *ngIf=\"data.primarySection\"\n [titleText]=\"data.primarySection.titleText\"\n [editingHint]=\"data.primarySection.editingHint\"\n [displayAutoDescription]=\"data.primarySection.displayAutoDescription\"\n [descriptionText]=\"data.primarySection.descriptionText\"\n [displayAutoTitle]=\"data.primarySection.displayAutoTitle\"\n [prepopulatedData]=\"data.primarySection.prepopulatedData\"\n [parentForm]=\"data.parentForm\"\n [fields]=\"data.primarySection.fields\"\n [startOpen]=\"data.primarySection.startOpen\"\n [expandable]=\"data.primarySection.expandable\">\n </va-dropdown-form-section>\n <ng-container *ngIf=\"data.subsections?.length > 0\">\n <va-dropdown-form-section class=\"va-secondary-form-section\" *ngFor=\"let addon of data.subsections\"\n [titleText]=\"addon.titleText\"\n [editingHint]=\"addon.editingHint\"\n [displayAutoDescription]=\"addon.displayAutoDescription\"\n [descriptionText]=\"addon.descriptionText\"\n [displayAutoTitle]=\"addon.displayAutoTitle\"\n [prepopulatedData]=\"addon.prepopulatedData\"\n [parentForm]=\"data.parentForm\"\n [fields]=\"addon.fields\"\n [startOpen]=\"addon.startOpen\"\n [expandable]=\"addon.expandable\">\n </va-dropdown-form-section>\n </ng-container>\n <ng-container *ngIf=\"!data.primarySection && !(data.subsections?.length > 0)\">\n <mat-card class=\"not-expandable-card\">\n <ng-content></ng-content>\n </mat-card>\n </ng-container>\n</div>\n",
1632 styles: [":host{font-size:16px}mat-card.va-order-form-section-header{margin-bottom:0;border-bottom-color:#e0e0e0;border-bottom-width:1px;box-shadow:0 0 1px -2px rgba(0,0,0,.2),0 0 2px 0 rgba(0,0,0,.14),0 0 5px 0 rgba(0,0,0,.12)}.product-title{font-size:16px}va-mat-card{margin-bottom:24px}.product-overview{display:-webkit-box;display:flex;flex-wrap:wrap}.product-overview h1{margin:0;font-weight:700}.product-id{display:-webkit-box;display:flex;width:100%;-webkit-box-flex:1;flex-grow:1}.product-id va-icon{margin-right:20px}@media screen and (max-width:600px){.product-id va-icon ::ng-deep .va-icon-container{width:40px!important;height:40px!important}}.product-id .product-id-text{display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;-webkit-box-pack:center;justify-content:center}.product-id span{display:block;overflow:hidden}.product-id .tagline{color:#616161;margin-top:8px;font-size:16px}@media screen and (min-width:600px){.product-id{width:66%;padding-right:16px}}.description{padding-top:16px;width:100%;color:#616161}"]
1633 }] }
1634 ];
1635 /** @nocollapse */
1636 OrderFormSectionComponent.ctorParameters = function () { return []; };
1637 OrderFormSectionComponent.propDecorators = {
1638 data: [{ type: core.Input }]
1639 };
1640 return OrderFormSectionComponent;
1641 }());
1642 if (false) {
1643 /** @type {?} */
1644 OrderFormSectionComponent.prototype.data;
1645 }
1646
1647 /**
1648 * @fileoverview added by tsickle
1649 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1650 */
1651 var DropDownFormSectionData = /** @class */ (function () {
1652 function DropDownFormSectionData() {
1653 /* tslint:disable */
1654 this.expandable = true;
1655 /* tslint:enable */
1656 }
1657 return DropDownFormSectionData;
1658 }());
1659 if (false) {
1660 /** @type {?} */
1661 DropDownFormSectionData.prototype.prepopulatedData;
1662 /** @type {?} */
1663 DropDownFormSectionData.prototype.startOpen;
1664 /** @type {?} */
1665 DropDownFormSectionData.prototype.parentForm;
1666 /** @type {?} */
1667 DropDownFormSectionData.prototype.displayAutoTitle;
1668 /** @type {?} */
1669 DropDownFormSectionData.prototype.titleText;
1670 /** @type {?} */
1671 DropDownFormSectionData.prototype.displayAutoDescription;
1672 /** @type {?} */
1673 DropDownFormSectionData.prototype.descriptionText;
1674 /** @type {?} */
1675 DropDownFormSectionData.prototype.fields;
1676 /** @type {?} */
1677 DropDownFormSectionData.prototype.editingHint;
1678 /** @type {?} */
1679 DropDownFormSectionData.prototype.expandable;
1680 }
1681
1682 /**
1683 * @fileoverview added by tsickle
1684 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1685 */
1686 /**
1687 * @record
1688 */
1689 function OrderLabelsInterface() { }
1690 if (false) {
1691 /** @type {?} */
1692 OrderLabelsInterface.prototype.commonForm;
1693 }
1694 /**
1695 * @record
1696 */
1697 function OrderFormInterface() { }
1698 if (false) {
1699 /** @type {?} */
1700 OrderFormInterface.prototype.appId;
1701 /** @type {?|undefined} */
1702 OrderFormInterface.prototype.addonId;
1703 /** @type {?|undefined} */
1704 OrderFormInterface.prototype.commonForm;
1705 /** @type {?|undefined} */
1706 OrderFormInterface.prototype.commonFormRequiredFields;
1707 /** @type {?|undefined} */
1708 OrderFormInterface.prototype.customFields;
1709 }
1710 /**
1711 * @record
1712 */
1713 function IncludedCommonFormFieldsInterface() { }
1714 if (false) {
1715 /** @type {?|undefined} */
1716 IncludedCommonFormFieldsInterface.prototype.businessName;
1717 /** @type {?|undefined} */
1718 IncludedCommonFormFieldsInterface.prototype.businessAddress;
1719 /** @type {?|undefined} */
1720 IncludedCommonFormFieldsInterface.prototype.businessPhoneNumber;
1721 /** @type {?|undefined} */
1722 IncludedCommonFormFieldsInterface.prototype.businessAccountGroupId;
1723 /** @type {?|undefined} */
1724 IncludedCommonFormFieldsInterface.prototype.businessWebsite;
1725 /** @type {?|undefined} */
1726 IncludedCommonFormFieldsInterface.prototype.salespersonName;
1727 /** @type {?|undefined} */
1728 IncludedCommonFormFieldsInterface.prototype.salespersonPhoneNumber;
1729 /** @type {?|undefined} */
1730 IncludedCommonFormFieldsInterface.prototype.salespersonEmail;
1731 /** @type {?|undefined} */
1732 IncludedCommonFormFieldsInterface.prototype.contactName;
1733 /** @type {?|undefined} */
1734 IncludedCommonFormFieldsInterface.prototype.contactPhoneNumber;
1735 /** @type {?|undefined} */
1736 IncludedCommonFormFieldsInterface.prototype.contactEmail;
1737 }
1738 /**
1739 * @record
1740 */
1741 function CommonFormSectionInterface() { }
1742 if (false) {
1743 /** @type {?} */
1744 CommonFormSectionInterface.prototype.fields;
1745 /** @type {?|undefined} */
1746 CommonFormSectionInterface.prototype.sectionName;
1747 /** @type {?|undefined} */
1748 CommonFormSectionInterface.prototype.populatedData;
1749 }
1750 /**
1751 * @record
1752 */
1753 function AddonKeyInterface() { }
1754 if (false) {
1755 /** @type {?|undefined} */
1756 AddonKeyInterface.prototype.addonId;
1757 /** @type {?|undefined} */
1758 AddonKeyInterface.prototype.appId;
1759 }
1760 /**
1761 * @record
1762 */
1763 function CommonFormFieldInterface() { }
1764 if (false) {
1765 /** @type {?|undefined} */
1766 CommonFormFieldInterface.prototype.productIds;
1767 /** @type {?|undefined} */
1768 CommonFormFieldInterface.prototype.addonKeys;
1769 }
1770 /**
1771 * @record
1772 */
1773 function CommonFieldIdsInterface() { }
1774 if (false) {
1775 /** @type {?} */
1776 CommonFieldIdsInterface.prototype.fieldId;
1777 /** @type {?} */
1778 CommonFieldIdsInterface.prototype.required;
1779 }
1780 /**
1781 * @record
1782 */
1783 function CommonFormData() { }
1784 if (false) {
1785 /** @type {?|undefined} */
1786 CommonFormData.prototype.contact_email;
1787 /** @type {?|undefined} */
1788 CommonFormData.prototype.contact_name;
1789 /** @type {?|undefined} */
1790 CommonFormData.prototype.contact_phone_number;
1791 /** @type {?|undefined} */
1792 CommonFormData.prototype.business_account_group_id;
1793 /** @type {?|undefined} */
1794 CommonFormData.prototype.business_name;
1795 /** @type {?|undefined} */
1796 CommonFormData.prototype.business_address;
1797 /** @type {?|undefined} */
1798 CommonFormData.prototype.business_phone_number;
1799 /** @type {?|undefined} */
1800 CommonFormData.prototype.business_website;
1801 /** @type {?|undefined} */
1802 CommonFormData.prototype.salesperson_name;
1803 /** @type {?|undefined} */
1804 CommonFormData.prototype.salesperson_email;
1805 /** @type {?|undefined} */
1806 CommonFormData.prototype.salesperson_phone_number;
1807 }
1808 var ProductOrderFormSectionData = /** @class */ (function (_super) {
1809 __extends(ProductOrderFormSectionData, _super);
1810 function ProductOrderFormSectionData() {
1811 return _super !== null && _super.apply(this, arguments) || this;
1812 }
1813 return ProductOrderFormSectionData;
1814 }(OrderFormSectionData));
1815 if (false) {
1816 /** @type {?} */
1817 ProductOrderFormSectionData.prototype.productId;
1818 /** @type {?} */
1819 ProductOrderFormSectionData.prototype.subsections;
1820 }
1821 var AddonDropDownFormSectionData = /** @class */ (function (_super) {
1822 __extends(AddonDropDownFormSectionData, _super);
1823 function AddonDropDownFormSectionData() {
1824 return _super !== null && _super.apply(this, arguments) || this;
1825 }
1826 return AddonDropDownFormSectionData;
1827 }(DropDownFormSectionData));
1828 if (false) {
1829 /** @type {?} */
1830 AddonDropDownFormSectionData.prototype.productId;
1831 /** @type {?} */
1832 AddonDropDownFormSectionData.prototype.addonId;
1833 }
1834 /**
1835 * @record
1836 */
1837 function ProductInfoInterface() { }
1838 if (false) {
1839 /** @type {?} */
1840 ProductInfoInterface.prototype.productId;
1841 /** @type {?|undefined} */
1842 ProductInfoInterface.prototype.name;
1843 /** @type {?|undefined} */
1844 ProductInfoInterface.prototype.tagline;
1845 /** @type {?|undefined} */
1846 ProductInfoInterface.prototype.icon;
1847 /** @type {?|undefined} */
1848 ProductInfoInterface.prototype.addonInfo;
1849 }
1850 /**
1851 * @record
1852 */
1853 function AddonInfoInterface() { }
1854 if (false) {
1855 /** @type {?} */
1856 AddonInfoInterface.prototype.addonId;
1857 /** @type {?|undefined} */
1858 AddonInfoInterface.prototype.name;
1859 }
1860 /**
1861 * @record
1862 */
1863 function CustomFieldsAnswers() { }
1864 if (false) {
1865 /** @type {?} */
1866 CustomFieldsAnswers.prototype.productID;
1867 /** @type {?|undefined} */
1868 CustomFieldsAnswers.prototype.addonKey;
1869 /** @type {?} */
1870 CustomFieldsAnswers.prototype.customFieldsAnswers;
1871 }
1872 /**
1873 * @record
1874 */
1875 function CustomFieldsAnswer() { }
1876 if (false) {
1877 /** @type {?} */
1878 CustomFieldsAnswer.prototype.fieldId;
1879 /** @type {?|undefined} */
1880 CustomFieldsAnswer.prototype.answer;
1881 }
1882 /**
1883 * @record
1884 */
1885 function OrderFormOptionsInterface() { }
1886 if (false) {
1887 /** @type {?|undefined} */
1888 OrderFormOptionsInterface.prototype.bypassRequiredQuestions;
1889 /** @type {?|undefined} */
1890 OrderFormOptionsInterface.prototype.readOnly;
1891 /** @type {?|undefined} */
1892 OrderFormOptionsInterface.prototype.showOfficeUseQuestions;
1893 }
1894
1895 /**
1896 * @fileoverview added by tsickle
1897 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1898 */
1899 var OrderFormService = /** @class */ (function () {
1900 function OrderFormService() {
1901 }
1902 /**
1903 * @private
1904 * @param {?} orderForm
1905 * @return {?}
1906 */
1907 OrderFormService.extractRequiredCommonFieldIds = /**
1908 * @private
1909 * @param {?} orderForm
1910 * @return {?}
1911 */
1912 function (orderForm) {
1913 if (!orderForm || !orderForm.commonFormRequiredFields) {
1914 return [];
1915 }
1916 return Object.keys(orderForm.commonFormRequiredFields).filter((/**
1917 * @param {?} k
1918 * @return {?}
1919 */
1920 function (k) { return orderForm.commonFormRequiredFields[k]; }));
1921 };
1922 /**
1923 * @private
1924 * @param {?} orderForms
1925 * @return {?}
1926 */
1927 OrderFormService.buildCommonFieldIds = /**
1928 * @private
1929 * @param {?} orderForms
1930 * @return {?}
1931 */
1932 function (orderForms) {
1933 var _this = this;
1934 /** @type {?} */
1935 var commonFieldIdsMap = new Map();
1936 for (var key in OrderFormService.camelToSnakeCaseMap) {
1937 if (key) {
1938 commonFieldIdsMap.set(key, {
1939 fieldId: key,
1940 required: false,
1941 });
1942 }
1943 }
1944 orderForms.map((/**
1945 * @param {?} orderForm
1946 * @return {?}
1947 */
1948 function (orderForm) {
1949 /** @type {?} */
1950 var requiredCommonFieldIds = _this.extractRequiredCommonFieldIds(orderForm);
1951 requiredCommonFieldIds.map((/**
1952 * @param {?} fieldId
1953 * @return {?}
1954 */
1955 function (fieldId) {
1956 /** @type {?} */
1957 var commonFieldId = commonFieldIdsMap.get(fieldId);
1958 commonFieldId.required = true;
1959 commonFieldIdsMap.set(fieldId, commonFieldId);
1960 }));
1961 }));
1962 return Array.from(commonFieldIdsMap.values());
1963 };
1964 /**
1965 * @private
1966 * @param {?} fieldIds
1967 * @param {?} commonData
1968 * @param {?} labels
1969 * @param {?} options
1970 * @return {?}
1971 */
1972 OrderFormService.fillCommonFormSections = /**
1973 * @private
1974 * @param {?} fieldIds
1975 * @param {?} commonData
1976 * @param {?} labels
1977 * @param {?} options
1978 * @return {?}
1979 */
1980 function (fieldIds, commonData, labels, options) {
1981 /** @type {?} */
1982 var commonFormSections = OrderFormService.buildCommonOrderFormFields(fieldIds, labels, options);
1983 return commonFormSections.map((/**
1984 * @param {?} section
1985 * @return {?}
1986 */
1987 function (section) { return (__assign({}, section, { populatedData: commonData })); }));
1988 };
1989 /**
1990 * @private
1991 * @param {?} fieldIds
1992 * @param {?} labels
1993 * @param {?} options
1994 * @return {?}
1995 */
1996 OrderFormService.buildCommonOrderFormFields = /**
1997 * @private
1998 * @param {?} fieldIds
1999 * @param {?} labels
2000 * @param {?} options
2001 * @return {?}
2002 */
2003 function (fieldIds, labels, options) {
2004 var e_1, _a;
2005 /** @type {?} */
2006 var businessSection = {
2007 sectionName: labels.commonForm.businessSectionTitle || 'Business',
2008 fields: []
2009 };
2010 /** @type {?} */
2011 var salespersonSection = {
2012 sectionName: labels.commonForm.salespersonSectionTitle || 'Salesperson',
2013 fields: []
2014 };
2015 /** @type {?} */
2016 var contactSection = {
2017 sectionName: labels.commonForm.contactSectionTitle || 'Contact',
2018 fields: []
2019 };
2020 try {
2021 for (var fieldIds_1 = __values(fieldIds), fieldIds_1_1 = fieldIds_1.next(); !fieldIds_1_1.done; fieldIds_1_1 = fieldIds_1.next()) {
2022 var field = fieldIds_1_1.value;
2023 /** @type {?} */
2024 var fieldLabel = this.getLabelForFieldId(field.fieldId, labels);
2025 /** @type {?} */
2026 var commonFormField = new TextboxField({
2027 id: OrderFormService.camelToSnakeCaseMap[field.fieldId],
2028 label: fieldLabel,
2029 textboxType: 'text'
2030 });
2031 commonFormField.displayOnly = commonFormField.id === 'business_account_group_id';
2032 commonFormField.disabled = options.readOnly;
2033 if (!options.bypassRequiredQuestions) {
2034 commonFormField.required = field.required;
2035 }
2036 if (field.fieldId.startsWith('contact')) {
2037 contactSection.fields.push(commonFormField);
2038 }
2039 if (field.fieldId.startsWith('business')) {
2040 businessSection.fields.push(commonFormField);
2041 }
2042 if (field.fieldId.startsWith('salesperson')) {
2043 if (!options.showOfficeUseQuestions) {
2044 commonFormField.hidden = true;
2045 }
2046 salespersonSection.fields.push(commonFormField);
2047 }
2048 }
2049 }
2050 catch (e_1_1) { e_1 = { error: e_1_1 }; }
2051 finally {
2052 try {
2053 if (fieldIds_1_1 && !fieldIds_1_1.done && (_a = fieldIds_1.return)) _a.call(fieldIds_1);
2054 }
2055 finally { if (e_1) throw e_1.error; }
2056 }
2057 return [businessSection, contactSection, salespersonSection].filter((/**
2058 * @param {?} section
2059 * @return {?}
2060 */
2061 function (section) {
2062 return section.fields ? section.fields.length > 0 : false;
2063 }));
2064 };
2065 /**
2066 * @private
2067 * @param {?} fieldId
2068 * @param {?} labels
2069 * @return {?}
2070 */
2071 OrderFormService.getLabelForFieldId = /**
2072 * @private
2073 * @param {?} fieldId
2074 * @param {?} labels
2075 * @return {?}
2076 */
2077 function (fieldId, labels) {
2078 return labels.commonForm[fieldId] || '';
2079 };
2080 /**
2081 * @private
2082 * @param {?} parentForm
2083 * @return {?}
2084 */
2085 OrderFormService.buildOrderFormSectionData = /**
2086 * @private
2087 * @param {?} parentForm
2088 * @return {?}
2089 */
2090 function (parentForm) {
2091 /** @type {?} */
2092 var section = new AddonDropDownFormSectionData();
2093 section.displayAutoTitle = true;
2094 section.descriptionText = '';
2095 section.displayAutoDescription = false;
2096 section.parentForm = parentForm;
2097 return section;
2098 };
2099 /**
2100 * @private
2101 * @param {?} customFields
2102 * @param {?} fileUploadUrl
2103 * @param {?} users
2104 * @param {?} answers
2105 * @param {?} options
2106 * @return {?}
2107 */
2108 OrderFormService.buildCustomOrderFormFields = /**
2109 * @private
2110 * @param {?} customFields
2111 * @param {?} fileUploadUrl
2112 * @param {?} users
2113 * @param {?} answers
2114 * @param {?} options
2115 * @return {?}
2116 */
2117 function (customFields, fileUploadUrl, users, answers, options) {
2118 /** @type {?} */
2119 var fieldTypeMap = {
2120 text: TextboxField,
2121 textbox: TextboxField,
2122 dropdown: DropdownField,
2123 checkbox: CheckboxField,
2124 file: FileUploadGroupField,
2125 textarea: TextareaField,
2126 vbcuser: VBCUserField
2127 };
2128 return customFields
2129 .filter((/**
2130 * @param {?} field
2131 * @return {?}
2132 */
2133 function (field) {
2134 return fieldTypeMap[field.type];
2135 }))
2136 .map((/**
2137 * @param {?} field
2138 * @return {?}
2139 */
2140 function (field) {
2141 /** @type {?} */
2142 var fieldClass = fieldTypeMap[field.type];
2143 /** @type {?} */
2144 var result = ((/**
2145 * @return {?}
2146 */
2147 function () {
2148 switch (fieldClass) {
2149 case VBCUserField:
2150 /** @type {?} */
2151 var fieldConfig = (/** @type {?} */ ({
2152 description: field.description,
2153 id: field.id,
2154 required: field.required,
2155 type: field.type,
2156 label: field.label,
2157 forOfficeUseOnly: field.forOfficeUseOnly,
2158 hidden: field.hidden,
2159 users: users // TODO: Get users in this component
2160 }));
2161 return new VBCUserField(fieldConfig);
2162 case FileUploadGroupField:
2163 /** @type {?} */
2164 var uploadField = (/** @type {?} */ (field));
2165 uploadField.uploadUrl = fileUploadUrl;
2166 return new FileUploadGroupField(uploadField);
2167 default:
2168 return new fieldClass(field);
2169 }
2170 }))();
2171 result.id = OrderFormService.encodeCustomFieldId(field.id);
2172 if (!options.showOfficeUseQuestions) {
2173 result.hidden = result.forOfficeUseOnly ? true : result.hidden;
2174 }
2175 result.required = options.bypassRequiredQuestions ? false : result.required;
2176 result.disabled = options.readOnly ? options.readOnly : result.disabled;
2177 if (answers) {
2178 /** @type {?} */
2179 var ca = answers.find((/**
2180 * @param {?} a
2181 * @return {?}
2182 */
2183 function (a) { return a.fieldId === field.id; }));
2184 if (ca) {
2185 try {
2186 result.value = JSON.parse(ca.answer);
2187 }
2188 catch (error) {
2189 result.value = ca.answer;
2190 }
2191 }
2192 }
2193 return result;
2194 }));
2195 };
2196 // Different products can have order form fields with the same fieldID, which will cause problem.
2197 // Please refer to https://github.com/vendasta/business-center-client/pull/1002
2198 // We will prefix the fieldID with uuid, and take it off before we same the order form into session storage
2199 // Different products can have order form fields with the same fieldID, which will cause problem.
2200 // Please refer to https://github.com/vendasta/business-center-client/pull/1002
2201 // We will prefix the fieldID with uuid, and take it off before we same the order form into session storage
2202 /**
2203 * @private
2204 * @param {?} fieldId
2205 * @return {?}
2206 */
2207 OrderFormService.encodeCustomFieldId =
2208 // Different products can have order form fields with the same fieldID, which will cause problem.
2209 // Please refer to https://github.com/vendasta/business-center-client/pull/1002
2210 // We will prefix the fieldID with uuid, and take it off before we same the order form into session storage
2211 /**
2212 * @private
2213 * @param {?} fieldId
2214 * @return {?}
2215 */
2216 function (fieldId) {
2217 /** @type {?} */
2218 var id = uuid();
2219 return id + "#" + fieldId;
2220 };
2221 /**
2222 * @private
2223 * @param {?} fieldId
2224 * @return {?}
2225 */
2226 OrderFormService.decodeCustomFieldId = /**
2227 * @private
2228 * @param {?} fieldId
2229 * @return {?}
2230 */
2231 function (fieldId) {
2232 return fieldId.replace(new RegExp('(.*#)'), '');
2233 };
2234 /**
2235 * @private
2236 * @param {?} fieldType
2237 * @return {?}
2238 */
2239 OrderFormService.mapFieldType = /**
2240 * @private
2241 * @param {?} fieldType
2242 * @return {?}
2243 */
2244 function (fieldType) {
2245 switch (fieldType) {
2246 case 'textbox':
2247 return salesOrders.FieldType.TEXT;
2248 case 'textarea':
2249 return salesOrders.FieldType.TEXTAREA;
2250 case 'checkbox':
2251 return salesOrders.FieldType.CHECKBOX;
2252 case 'dropdown':
2253 return salesOrders.FieldType.DROPDOWN;
2254 case 'file':
2255 return salesOrders.FieldType.FILE;
2256 case 'vbcuser':
2257 return salesOrders.FieldType.VBCUSER;
2258 default:
2259 return salesOrders.FieldType.NOT_SPECIFIED;
2260 }
2261 };
2262 /**
2263 * @private
2264 * @param {?} fieldBase
2265 * @return {?}
2266 */
2267 OrderFormService.orderFieldToSalesOrderField = /**
2268 * @private
2269 * @param {?} fieldBase
2270 * @return {?}
2271 */
2272 function (fieldBase) {
2273 return new salesOrders.Field({
2274 fieldId: OrderFormService.decodeCustomFieldId(fieldBase.id),
2275 fieldType: OrderFormService.mapFieldType(fieldBase.controlType),
2276 label: fieldBase.label,
2277 description: fieldBase.description || '',
2278 prefix: fieldBase.prefix || '',
2279 suffix: fieldBase.suffix || '',
2280 regexValidator: fieldBase.regexValidator || '',
2281 regexErrorMessage: fieldBase.regexErrorMessage || '',
2282 answer: fieldBase.value ? JSON.stringify(fieldBase.value) : 'null'
2283 });
2284 };
2285 /**
2286 * @private
2287 * @param {?} orderFormData
2288 * @return {?}
2289 */
2290 OrderFormService.productOrderFormToCustomFields = /**
2291 * @private
2292 * @param {?} orderFormData
2293 * @return {?}
2294 */
2295 function (orderFormData) {
2296 var _this = this;
2297 /** @type {?} */
2298 var primaryCustomField = new salesOrders.CustomField();
2299 primaryCustomField.productId = orderFormData.productId;
2300 primaryCustomField.fields = orderFormData.primarySection
2301 ? orderFormData.primarySection.fields.map((/**
2302 * @param {?} field
2303 * @return {?}
2304 */
2305 function (field) { return _this.orderFieldToSalesOrderField(field); }))
2306 : [];
2307 /** @type {?} */
2308 var secondaryCustomFields = orderFormData.subsections.map((/**
2309 * @param {?} subsection
2310 * @return {?}
2311 */
2312 function (subsection) {
2313 /** @type {?} */
2314 var customField = new salesOrders.CustomField();
2315 if (subsection.addonId) {
2316 customField.addonKey = new salesOrders.AddonKey({
2317 appId: subsection.productId,
2318 addonId: subsection.addonId
2319 });
2320 }
2321 else {
2322 customField.productId = orderFormData.productId;
2323 }
2324 customField.fields = subsection.fields.map((/**
2325 * @param {?} field
2326 * @return {?}
2327 */
2328 function (field) { return _this.orderFieldToSalesOrderField(field); }));
2329 return customField;
2330 }));
2331 return [].concat(primaryCustomField, secondaryCustomFields);
2332 };
2333 /**
2334 * @param {?} orderForms
2335 * @param {?} commonData
2336 * @param {?} labels
2337 * @param {?} options
2338 * @return {?}
2339 */
2340 OrderFormService.getCommonFormSections = /**
2341 * @param {?} orderForms
2342 * @param {?} commonData
2343 * @param {?} labels
2344 * @param {?} options
2345 * @return {?}
2346 */
2347 function (orderForms, commonData, labels, options) {
2348 /** @type {?} */
2349 var fieldIds = OrderFormService.buildCommonFieldIds(orderForms);
2350 return OrderFormService.fillCommonFormSections(fieldIds, commonData, labels, options);
2351 };
2352 /**
2353 * @param {?} orderForms
2354 * @param {?} products
2355 * @param {?} parentForm
2356 * @param {?} fileUploadUrl
2357 * @param {?} users
2358 * @param {?} answers
2359 * @param {?} options
2360 * @return {?}
2361 */
2362 OrderFormService.getCustomFormSections = /**
2363 * @param {?} orderForms
2364 * @param {?} products
2365 * @param {?} parentForm
2366 * @param {?} fileUploadUrl
2367 * @param {?} users
2368 * @param {?} answers
2369 * @param {?} options
2370 * @return {?}
2371 */
2372 function (orderForms, products, parentForm, fileUploadUrl, users, answers, options) {
2373 /** @type {?} */
2374 var formSections = products.map((/**
2375 * @param {?} product
2376 * @return {?}
2377 */
2378 function (product) {
2379 /** @type {?} */
2380 var subsections = [];
2381 (product.addonInfo || []).map((/**
2382 * @param {?} addon
2383 * @return {?}
2384 */
2385 function (addon) {
2386 /** @type {?} */
2387 var addonOrderForms = orderForms.filter((/**
2388 * @param {?} o
2389 * @return {?}
2390 */
2391 function (o) { return o.addonId === addon.addonId; }));
2392 /** @type {?} */
2393 var addonAnswers = (answers || []).filter((/**
2394 * @param {?} a
2395 * @return {?}
2396 */
2397 function (a) { return a.addonKey &&
2398 a.addonKey.appId === product.productId && a.addonKey.addonId === addon.addonId && a.productID === product.productId; }));
2399 addonOrderForms.map((/**
2400 * @param {?} addonOrderForm
2401 * @param {?} index
2402 * @return {?}
2403 */
2404 function (addonOrderForm, index) {
2405 if (addonOrderForm && addonOrderForm.customFields && addonOrderForm.customFields.length > 0) {
2406 /** @type {?} */
2407 var addonSection = OrderFormService.buildOrderFormSectionData(parentForm);
2408 /** @type {?} */
2409 var addonAnswersForThisSpecificFormIndex = (addonAnswers.length > index) ? addonAnswers[index].customFieldsAnswers : [];
2410 /** @type {?} */
2411 var formFields = OrderFormService.buildCustomOrderFormFields(addonOrderForm.customFields, fileUploadUrl, users, addonAnswersForThisSpecificFormIndex, options);
2412 addonSection.expandable = true;
2413 addonSection.titleText = addon.name;
2414 addonSection.fields = formFields;
2415 addonSection.productId = product.productId;
2416 addonSection.addonId = addon.addonId;
2417 subsections.push(addonSection);
2418 }
2419 }));
2420 }));
2421 /** @type {?} */
2422 var foundOrderForms = orderForms.reduce((/**
2423 * @param {?} orderFormsFound
2424 * @param {?} o
2425 * @return {?}
2426 */
2427 function (orderFormsFound, o) {
2428 if (o.appId === product.productId && !o.addonId) {
2429 orderFormsFound.push(o);
2430 }
2431 return orderFormsFound;
2432 }), []);
2433 var _a = __read(foundOrderForms), primaryOrder = _a[0], otherOrdersForSameProduct = _a.slice(1);
2434 /** @type {?} */
2435 var productHasOrderForm = primaryOrder && primaryOrder.customFields && primaryOrder.customFields.length > 0;
2436 if (subsections.length > 0 || productHasOrderForm) {
2437 /** @type {?} */
2438 var sectionData = new ProductOrderFormSectionData();
2439 sectionData.productId = product.productId;
2440 sectionData.parentForm = parentForm;
2441 sectionData.titleText = product.name;
2442 sectionData.subtitleText = product.tagline;
2443 sectionData.descriptionText = ''; // TODO: build the description string to show which common data this form uses
2444 sectionData.iconUrl = product.icon;
2445 if (productHasOrderForm) {
2446 /** @type {?} */
2447 var section_1 = OrderFormService.buildOrderFormSectionData(parentForm);
2448 section_1.titleText = product.name;
2449 /** @type {?} */
2450 var productAnswers = [];
2451 if (answers) {
2452 productAnswers = answers.filter((/**
2453 * @param {?} a
2454 * @return {?}
2455 */
2456 function (a) { return !a.addonKey && a.productID === product.productId; }));
2457 }
2458 var _b = __read(productAnswers), firstProductAnswers = _b[0], otherProductAnswers_1 = _b.slice(1);
2459 section_1.fields = OrderFormService.buildCustomOrderFormFields(primaryOrder.customFields, fileUploadUrl, users, firstProductAnswers ? firstProductAnswers.customFieldsAnswers : [], options);
2460 sectionData.primarySection = section_1;
2461 otherOrdersForSameProduct.forEach((/**
2462 * @param {?} _
2463 * @param {?} index
2464 * @return {?}
2465 */
2466 function (_, index) {
2467 /**
2468 * Clone the same section to avoid child component from modifying all as if these are all the top section.
2469 * All sections need to be re-created or else they will have the same id and send repeated data as well.
2470 * @type {?}
2471 */
2472 var dupeSection = __assign({}, section_1);
2473 /** @type {?} */
2474 var answersForSpecificForm = (otherProductAnswers_1.length > index) ? otherProductAnswers_1[index].customFieldsAnswers : [];
2475 dupeSection.fields = OrderFormService.buildCustomOrderFormFields(primaryOrder.customFields, fileUploadUrl, users, answersForSpecificForm, options);
2476 subsections.unshift(dupeSection);
2477 }));
2478 }
2479 sectionData.subsections = subsections;
2480 return sectionData;
2481 }
2482 return null;
2483 })).filter((/**
2484 * @param {?} s
2485 * @return {?}
2486 */
2487 function (s) { return !!s; }));
2488 return formSections;
2489 };
2490 /**
2491 * @param {?} extraFields
2492 * @param {?} parentForm
2493 * @param {?} fileUploadUrl
2494 * @param {?} users
2495 * @param {?} answers
2496 * @param {?} options
2497 * @return {?}
2498 */
2499 OrderFormService.getExtraFieldsSection = /**
2500 * @param {?} extraFields
2501 * @param {?} parentForm
2502 * @param {?} fileUploadUrl
2503 * @param {?} users
2504 * @param {?} answers
2505 * @param {?} options
2506 * @return {?}
2507 */
2508 function (extraFields, parentForm, fileUploadUrl, users, answers, options) {
2509 if (!extraFields || extraFields.length < 1) {
2510 return null;
2511 }
2512 /** @type {?} */
2513 var section = OrderFormService.buildOrderFormSectionData(parentForm);
2514 section.fields = OrderFormService.buildCustomOrderFormFields(extraFields, fileUploadUrl, users, answers, options);
2515 return section;
2516 };
2517 /**
2518 * @param {?} customFormSections
2519 * @return {?}
2520 */
2521 OrderFormService.getCustomFieldsData = /**
2522 * @param {?} customFormSections
2523 * @return {?}
2524 */
2525 function (customFormSections) {
2526 /** @type {?} */
2527 var customFormData = customFormSections.reduce((/**
2528 * @param {?} acc
2529 * @param {?} orderFormData
2530 * @return {?}
2531 */
2532 function (acc, orderFormData) {
2533 acc = acc.concat(OrderFormService.productOrderFormToCustomFields(orderFormData));
2534 return acc;
2535 }), []);
2536 return customFormData;
2537 };
2538 /**
2539 * @param {?} commonFormSections
2540 * @return {?}
2541 */
2542 OrderFormService.getCommonFieldsData = /**
2543 * @param {?} commonFormSections
2544 * @return {?}
2545 */
2546 function (commonFormSections) {
2547 /** @type {?} */
2548 var commonFields = [];
2549 if (commonFormSections) {
2550 commonFields = commonFormSections.reduce((/**
2551 * @param {?} acc
2552 * @param {?} group
2553 * @return {?}
2554 */
2555 function (acc, group) {
2556 /** @type {?} */
2557 var fields = group.fields.map((/**
2558 * @param {?} singleField
2559 * @return {?}
2560 */
2561 function (singleField) {
2562 /** @type {?} */
2563 var field = OrderFormService.orderFieldToSalesOrderField(singleField);
2564 if (field.fieldId) {
2565 return new salesOrders.CommonField({
2566 field: field,
2567 productIds: singleField.productIds,
2568 addonKeys: singleField.addonKeys
2569 });
2570 }
2571 }));
2572 return acc.concat(fields);
2573 }), []);
2574 }
2575 return commonFields;
2576 };
2577 /**
2578 * @param {?} extraFieldsSection
2579 * @return {?}
2580 */
2581 OrderFormService.getExtraFieldsData = /**
2582 * @param {?} extraFieldsSection
2583 * @return {?}
2584 */
2585 function (extraFieldsSection) {
2586 /** @type {?} */
2587 var extraFieldsData = [];
2588 if (!!extraFieldsSection) {
2589 extraFieldsData = extraFieldsSection.fields.map((/**
2590 * @param {?} field
2591 * @return {?}
2592 */
2593 function (field) { return OrderFormService.orderFieldToSalesOrderField(field); }));
2594 }
2595 return extraFieldsData;
2596 };
2597 OrderFormService.camelToSnakeCaseMap = {
2598 'contactName': 'contact_name',
2599 'contactEmail': 'contact_email',
2600 'contactPhoneNumber': 'contact_phone_number',
2601 'businessAccountGroupId': 'business_account_group_id',
2602 'businessName': 'business_name',
2603 'businessAddress': 'business_address',
2604 'businessPhoneNumber': 'business_phone_number',
2605 'businessWebsite': 'business_website',
2606 'salespersonName': 'salesperson_name',
2607 'salespersonEmail': 'salesperson_email',
2608 'salespersonPhoneNumber': 'salesperson_phone_number'
2609 };
2610 OrderFormService.decorators = [
2611 { type: core.Injectable }
2612 ];
2613 /** @nocollapse */
2614 OrderFormService.ctorParameters = function () { return []; };
2615 return OrderFormService;
2616 }());
2617 if (false) {
2618 /** @type {?} */
2619 OrderFormService.camelToSnakeCaseMap;
2620 }
2621
2622 /**
2623 * @fileoverview added by tsickle
2624 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2625 */
2626 var OrderFormComponent = /** @class */ (function () {
2627 function OrderFormComponent() {
2628 this.dropdownOpen$$ = new rxjs.BehaviorSubject(false);
2629 this.dropdownOpen$ = this.dropdownOpen$$.asObservable();
2630 }
2631 /**
2632 * @return {?}
2633 */
2634 OrderFormComponent.prototype.ngOnInit = /**
2635 * @return {?}
2636 */
2637 function () {
2638 /** @type {?} */
2639 var options = new OrderFormOptions(this.orderFormOptions || {});
2640 this.commonFormSections = OrderFormService.getCommonFormSections(this.orderForms, this.commonData, this.labels, options);
2641 this.customFormSections = OrderFormService.getCustomFormSections(this.orderForms, this.productInfo, this.parentForm, this.fileUploadUrl, this.users, this.answers, options);
2642 // TODO: Handle MyCorporation OrderForm (handled in a separate component right now)
2643 this.extraFieldsSection = OrderFormService.getExtraFieldsSection(this.extraFields, this.parentForm, this.fileUploadUrl, this.users, this.extraFieldsAnswers, options);
2644 };
2645 /**
2646 * returns the data from common form fields in a format that is usable by sales orders
2647 */
2648 /**
2649 * returns the data from common form fields in a format that is usable by sales orders
2650 * @return {?}
2651 */
2652 OrderFormComponent.prototype.getCommonFormData = /**
2653 * returns the data from common form fields in a format that is usable by sales orders
2654 * @return {?}
2655 */
2656 function () {
2657 return OrderFormService.getCommonFieldsData(this.commonFormSections);
2658 };
2659 /**
2660 * returns the data from custom forms in a format that is usable by sales orders
2661 */
2662 /**
2663 * returns the data from custom forms in a format that is usable by sales orders
2664 * @return {?}
2665 */
2666 OrderFormComponent.prototype.getCustomFormData = /**
2667 * returns the data from custom forms in a format that is usable by sales orders
2668 * @return {?}
2669 */
2670 function () {
2671 return OrderFormService.getCustomFieldsData(this.customFormSections);
2672 };
2673 /**
2674 * returns the data from extra fields in a format that is usable by sales orders
2675 */
2676 /**
2677 * returns the data from extra fields in a format that is usable by sales orders
2678 * @return {?}
2679 */
2680 OrderFormComponent.prototype.getExtraFieldsData = /**
2681 * returns the data from extra fields in a format that is usable by sales orders
2682 * @return {?}
2683 */
2684 function () {
2685 return OrderFormService.getExtraFieldsData(this.extraFieldsSection);
2686 };
2687 /**
2688 * changes the read only state of the sales order form
2689 */
2690 /**
2691 * changes the read only state of the sales order form
2692 * @param {?} readOnly
2693 * @return {?}
2694 */
2695 OrderFormComponent.prototype.changeReadOnly = /**
2696 * changes the read only state of the sales order form
2697 * @param {?} readOnly
2698 * @return {?}
2699 */
2700 function (readOnly) {
2701 this.orderFormOptions.readOnly = readOnly;
2702 readOnly ? this.parentForm.disable() : this.parentForm.enable();
2703 };
2704 /**
2705 * @return {?}
2706 */
2707 OrderFormComponent.prototype.openDropdown = /**
2708 * @return {?}
2709 */
2710 function () {
2711 this.dropdownOpen$$.next(true);
2712 };
2713 OrderFormComponent.decorators = [
2714 { type: core.Component, args: [{
2715 template: "<form [formGroup]=\"parentForm\">\n <!-- Common Fields -->\n <div *ngIf=\"commonFormSections?.length > 0\" class=\"common-form-container\">\n <mat-card class=\"common-form-header\">\n <mat-card-title class=\"common-form-header-title\">{{ labels.commonForm.headerTitle }}</mat-card-title>\n <div class=\"common-form-header-text\">{{ labels.commonForm.headerText }}</div>\n </mat-card>\n <va-dropdown-form-section\n *ngFor=\"let formSection of commonFormSections\"\n [parentForm]=\"parentForm\"\n [prepopulatedData]=\"formSection.populatedData\"\n [fields]=\"formSection.fields\"\n [titleText]=\"formSection.sectionName\"\n [startOpen]=\"dropdownOpen$ | async\"\n editingHint=\"{{ labels.commonForm.editingHint }}\"\n >\n </va-dropdown-form-section>\n <ng-container *ngIf=\"extraFieldsSection\">\n <va-dropdown-form-section\n [parentForm]=\"parentForm\"\n [prepopulatedData]=\"extraFieldsSection.prepopulatedData\"\n [fields]=\"extraFieldsSection.fields\"\n [displayAutoDescription]=false\n [startOpen]=\"true\"\n [titleText]=\"'FRONTEND.STORE.ADMINISTRATIVE_QUESTIONS' | translate\"\n >\n </va-dropdown-form-section>\n </ng-container>\n </div>\n\n <!--Custom Fields-->\n <div *ngIf=\"customFormSections?.length > 0\" class=\"custom-form-container\">\n <va-order-form-section *ngFor=\"let sectionData of customFormSections\" [data]=\"sectionData\"></va-order-form-section>\n </div>\n</form>\n",
2716 providers: [],
2717 selector: 'va-order-form',
2718 styles: [".common-form-container{margin-bottom:16px}mat-card.common-form-header{margin-bottom:0;border-bottom-color:#fafafa;border-bottom-width:1px;box-shadow:0 0 1px -2px rgba(0,0,0,.2),0 0 2px 0 rgba(0,0,0,.14),0 0 5px 0 rgba(0,0,0,.12)}.common-form-header-text{font-size:15px;color:#9e9e9e}.common-form-header-title{margin-bottom:0;padding-bottom:15px}va-order-form-section{display:block;margin-bottom:16px}"]
2719 }] }
2720 ];
2721 OrderFormComponent.propDecorators = {
2722 commonData: [{ type: core.Input }],
2723 answers: [{ type: core.Input }],
2724 parentForm: [{ type: core.Input }],
2725 fileUploadUrl: [{ type: core.Input }],
2726 orderForms: [{ type: core.Input }],
2727 productInfo: [{ type: core.Input }],
2728 labels: [{ type: core.Input }],
2729 users: [{ type: core.Input }],
2730 extraFields: [{ type: core.Input }],
2731 extraFieldsAnswers: [{ type: core.Input }],
2732 orderFormOptions: [{ type: core.Input }]
2733 };
2734 return OrderFormComponent;
2735 }());
2736 if (false) {
2737 /** @type {?} */
2738 OrderFormComponent.prototype.commonData;
2739 /** @type {?} */
2740 OrderFormComponent.prototype.answers;
2741 /** @type {?} */
2742 OrderFormComponent.prototype.parentForm;
2743 /** @type {?} */
2744 OrderFormComponent.prototype.fileUploadUrl;
2745 /** @type {?} */
2746 OrderFormComponent.prototype.orderForms;
2747 /** @type {?} */
2748 OrderFormComponent.prototype.productInfo;
2749 /** @type {?} */
2750 OrderFormComponent.prototype.labels;
2751 /** @type {?} */
2752 OrderFormComponent.prototype.users;
2753 /** @type {?} */
2754 OrderFormComponent.prototype.extraFields;
2755 /** @type {?} */
2756 OrderFormComponent.prototype.extraFieldsAnswers;
2757 /** @type {?} */
2758 OrderFormComponent.prototype.orderFormOptions;
2759 /** @type {?} */
2760 OrderFormComponent.prototype.commonFormSections;
2761 /** @type {?} */
2762 OrderFormComponent.prototype.customFormSections;
2763 /** @type {?} */
2764 OrderFormComponent.prototype.extraFieldsSection;
2765 /** @type {?} */
2766 OrderFormComponent.prototype.dropdownOpen$$;
2767 /** @type {?} */
2768 OrderFormComponent.prototype.dropdownOpen$;
2769 }
2770 var OrderFormOptions = /** @class */ (function () {
2771 function OrderFormOptions(i) {
2772 this.bypassRequiredQuestions = !!i.bypassRequiredQuestions;
2773 this.readOnly = !!i.readOnly;
2774 this.showOfficeUseQuestions = !!i.showOfficeUseQuestions;
2775 }
2776 return OrderFormOptions;
2777 }());
2778 if (false) {
2779 /** @type {?} */
2780 OrderFormOptions.prototype.bypassRequiredQuestions;
2781 /** @type {?} */
2782 OrderFormOptions.prototype.readOnly;
2783 /** @type {?} */
2784 OrderFormOptions.prototype.showOfficeUseQuestions;
2785 }
2786
2787 /**
2788 * @fileoverview added by tsickle
2789 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2790 */
2791 /** @type {?} */
2792 var FILES = 'file';
2793 /** @type {?} */
2794 var DROP_DOWN = 'dropdown';
2795 /** @type {?} */
2796 var CHECK_BOX = 'checkbox';
2797 /** @type {?} */
2798 var TEXT_AREA = 'textarea';
2799 /** @type {?} */
2800 var TEXT_BOX = 'textbox';
2801 /** @type {?} */
2802 var BUSINESS_USER = 'vbcuser';
2803 /**
2804 * @record
2805 */
2806 function FieldBaseOptions() { }
2807 if (false) {
2808 /** @type {?} */
2809 FieldBaseOptions.prototype.id;
2810 /** @type {?} */
2811 FieldBaseOptions.prototype.label;
2812 /** @type {?|undefined} */
2813 FieldBaseOptions.prototype.required;
2814 /** @type {?|undefined} */
2815 FieldBaseOptions.prototype.description;
2816 /** @type {?|undefined} */
2817 FieldBaseOptions.prototype.type;
2818 /** @type {?|undefined} */
2819 FieldBaseOptions.prototype.prefix;
2820 /** @type {?|undefined} */
2821 FieldBaseOptions.prototype.suffix;
2822 /** @type {?|undefined} */
2823 FieldBaseOptions.prototype.regexValidator;
2824 /** @type {?|undefined} */
2825 FieldBaseOptions.prototype.regexErrorMessage;
2826 /** @type {?|undefined} */
2827 FieldBaseOptions.prototype.disabled;
2828 /** @type {?|undefined} */
2829 FieldBaseOptions.prototype.forOfficeUseOnly;
2830 /** @type {?|undefined} */
2831 FieldBaseOptions.prototype.hidden;
2832 /** @type {?|undefined} */
2833 FieldBaseOptions.prototype.displayOnly;
2834 }
2835 /**
2836 * @abstract
2837 * @template T
2838 */
2839 var /**
2840 * @abstract
2841 * @template T
2842 */
2843 FieldBase = /** @class */ (function () {
2844 function FieldBase(options) {
2845 this.id = options.id;
2846 this.label = options.label;
2847 this.required = !!options.required;
2848 this.description = options.description || null;
2849 options.type = options.type === 'text' ? 'textbox' : options.type;
2850 this.controlType = (/** @type {?} */ (options.type));
2851 this.prefix = options.prefix;
2852 this.suffix = options.suffix;
2853 this.regexValidator = options.regexValidator;
2854 this.regexErrorMessage = options.regexErrorMessage;
2855 this.disabled = options.disabled || false;
2856 this.validator = this.validatorBuilder();
2857 this.forOfficeUseOnly = !!options.forOfficeUseOnly;
2858 this.hidden = options.hidden;
2859 this.displayOnly = options.displayOnly;
2860 }
2861 /**
2862 * @return {?}
2863 */
2864 FieldBase.prototype.getLabel = /**
2865 * @return {?}
2866 */
2867 function () {
2868 /** @type {?} */
2869 var fieldLabel = this.label;
2870 if (this.required) {
2871 fieldLabel += ' *';
2872 }
2873 return fieldLabel;
2874 };
2875 /**
2876 * @protected
2877 * @return {?}
2878 */
2879 FieldBase.prototype.validatorBuilder = /**
2880 * @protected
2881 * @return {?}
2882 */
2883 function () {
2884 return (/**
2885 * @param {?} control
2886 * @return {?}
2887 */
2888 function (control) {
2889 return null;
2890 });
2891 };
2892 return FieldBase;
2893 }());
2894 if (false) {
2895 /** @type {?} */
2896 FieldBase.prototype.value;
2897 /** @type {?} */
2898 FieldBase.prototype.id;
2899 /** @type {?} */
2900 FieldBase.prototype.label;
2901 /** @type {?} */
2902 FieldBase.prototype.required;
2903 /** @type {?} */
2904 FieldBase.prototype.order;
2905 /** @type {?} */
2906 FieldBase.prototype.description;
2907 /** @type {?} */
2908 FieldBase.prototype.controlType;
2909 /** @type {?} */
2910 FieldBase.prototype.prefix;
2911 /** @type {?} */
2912 FieldBase.prototype.suffix;
2913 /** @type {?} */
2914 FieldBase.prototype.regexValidator;
2915 /** @type {?} */
2916 FieldBase.prototype.regexErrorMessage;
2917 /** @type {?} */
2918 FieldBase.prototype.disabled;
2919 /** @type {?} */
2920 FieldBase.prototype.validator;
2921 /** @type {?} */
2922 FieldBase.prototype.forOfficeUseOnly;
2923 /** @type {?} */
2924 FieldBase.prototype.hidden;
2925 /** @type {?} */
2926 FieldBase.prototype.displayOnly;
2927 }
2928
2929 /**
2930 * @fileoverview added by tsickle
2931 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2932 */
2933 var FieldBuilderComponent = /** @class */ (function () {
2934 function FieldBuilderComponent() {
2935 this.removeField = new core.EventEmitter(null);
2936 }
2937 /**
2938 * @param {?} option
2939 * @param {?} required
2940 * @return {?}
2941 */
2942 FieldBuilderComponent.createDropDownOption = /**
2943 * @param {?} option
2944 * @param {?} required
2945 * @return {?}
2946 */
2947 function (option, required) {
2948 return new forms.FormGroup({
2949 label: new forms.FormControl(option.label || option.value, required ? [forms.Validators.required] : []),
2950 value: new forms.FormControl(option.value),
2951 useValue: new forms.FormControl(!!option.value)
2952 });
2953 };
2954 /**
2955 * @param {?} options
2956 * @return {?}
2957 */
2958 FieldBuilderComponent.createDropDownOptions = /**
2959 * @param {?} options
2960 * @return {?}
2961 */
2962 function (options) {
2963 if (options === null || options === undefined) {
2964 options = [];
2965 }
2966 /** @type {?} */
2967 var orderFormFieldsGroupArray = options.map((/**
2968 * @param {?} option
2969 * @return {?}
2970 */
2971 function (option) { return FieldBuilderComponent.createDropDownOption(option, false); }));
2972 return new forms.FormArray(orderFormFieldsGroupArray);
2973 };
2974 /**
2975 * @param {?} orderFormField
2976 * @return {?}
2977 */
2978 FieldBuilderComponent.createOrderFormFieldGroup = /**
2979 * @param {?} orderFormField
2980 * @return {?}
2981 */
2982 function (orderFormField) {
2983 /** @type {?} */
2984 var orderFormFieldGroup = new forms.FormGroup({
2985 descriptionControl: new forms.FormControl(orderFormField.description, []),
2986 labelControl: new forms.FormControl(orderFormField.label, [forms.Validators.required]),
2987 idControl: new forms.FormControl(orderFormField.id, [forms.Validators.required]),
2988 requiredControl: new forms.FormControl(orderFormField.required || false, []),
2989 uploadUrlControl: new forms.FormControl(orderFormField.uploadUrl, []),
2990 prefixControl: new forms.FormControl(orderFormField.prefix, []),
2991 suffixControl: new forms.FormControl(orderFormField.suffix, []),
2992 regexValidatorControl: new forms.FormControl(orderFormField.regexValidator, regexValidator()),
2993 regexErrorMessageControl: new forms.FormControl(orderFormField.regexErrorMessage, []),
2994 typeControl: new forms.FormControl(getFieldInterface(orderFormField.type), [forms.Validators.required]),
2995 allowMultiples: new forms.FormControl(orderFormField.allowMultiples || false, []),
2996 allowDuplicates: new forms.FormControl(orderFormField.allowDuplicates || false, []),
2997 maxChoices: new forms.FormControl(orderFormField.maxChoices ? orderFormField.maxChoices : 1, [forms.Validators.min(1), numberValidator()]),
2998 forOfficeUseOnly: new forms.FormControl(orderFormField.forOfficeUseOnly || false, [])
2999 });
3000 if (orderFormField.optionsWithLabels) {
3001 /** @type {?} */
3002 var optionsArray = FieldBuilderComponent.createDropDownOptions(orderFormField.optionsWithLabels);
3003 orderFormFieldGroup.addControl('optionsFormArray', optionsArray);
3004 }
3005 else if (orderFormField.options) {
3006 /** @type {?} */
3007 var optionsArray = FieldBuilderComponent.createDropDownOptions(orderFormField.options.map((/**
3008 * @param {?} option
3009 * @return {?}
3010 */
3011 function (option) { return ({ label: option }); })));
3012 orderFormFieldGroup.addControl('optionsFormArray', optionsArray);
3013 }
3014 else {
3015 orderFormFieldGroup.addControl('optionsFormArray', new forms.FormArray([]));
3016 }
3017 return orderFormFieldGroup;
3018 };
3019 /**
3020 * @return {?}
3021 */
3022 FieldBuilderComponent.prototype.ngOnInit = /**
3023 * @return {?}
3024 */
3025 function () {
3026 if (!this.supportedFieldTypes || this.supportedFieldTypes.length < 1) {
3027 this.supportedFieldTypes = FORM_FIELDS;
3028 }
3029 this.initForm();
3030 };
3031 /**
3032 * @return {?}
3033 */
3034 FieldBuilderComponent.prototype.initForm = /**
3035 * @return {?}
3036 */
3037 function () {
3038 // Check to see if form has been initiated
3039 if (!this.orderFormFieldGroup.get('labelControl')) {
3040 this.orderFormFieldGroup =
3041 FieldBuilderComponent.createOrderFormFieldGroup({});
3042 }
3043 };
3044 /**
3045 * @return {?}
3046 */
3047 FieldBuilderComponent.prototype.getOptionsArray = /**
3048 * @return {?}
3049 */
3050 function () {
3051 return (/** @type {?} */ (this.orderFormFieldGroup.get('optionsFormArray')));
3052 };
3053 /**
3054 * @return {?}
3055 */
3056 FieldBuilderComponent.prototype.getCurrentFieldInterface = /**
3057 * @return {?}
3058 */
3059 function () {
3060 /** @type {?} */
3061 var formFieldTypeInterface = ((/** @type {?} */ (this.orderFormFieldGroup.get('typeControl').value)));
3062 return formFieldTypeInterface ? formFieldTypeInterface.id : null;
3063 };
3064 /**
3065 * @param {?} index
3066 * @return {?}
3067 */
3068 FieldBuilderComponent.prototype.removeOption = /**
3069 * @param {?} index
3070 * @return {?}
3071 */
3072 function (index) {
3073 /** @type {?} */
3074 var formArray = this.getOptionsArray();
3075 formArray.removeAt(index);
3076 };
3077 /**
3078 * @return {?}
3079 */
3080 FieldBuilderComponent.prototype.addOption = /**
3081 * @return {?}
3082 */
3083 function () {
3084 /** @type {?} */
3085 var fieldArray = this.getOptionsArray();
3086 fieldArray.push(FieldBuilderComponent.createDropDownOption({ label: '' }, true));
3087 };
3088 /**
3089 * @return {?}
3090 */
3091 FieldBuilderComponent.prototype.getFormValues = /**
3092 * @return {?}
3093 */
3094 function () {
3095 /** @type {?} */
3096 var obj = {};
3097 obj.label = this.orderFormFieldGroup.get('labelControl').value;
3098 obj.id = this.orderFormFieldGroup.get('idControl').value;
3099 /** @type {?} */
3100 var formFieldType = ((/** @type {?} */ (this.orderFormFieldGroup.get('typeControl').value)));
3101 obj.type = formFieldType ? formFieldType.id : null;
3102 // Options will be nested under their own form control in the larger Orderformfield array
3103 /** @type {?} */
3104 var optionsArray = ((/** @type {?} */ (this.orderFormFieldGroup.get('optionsFormArray'))));
3105 if (optionsArray && optionsArray.value) {
3106 obj.options = optionsArray.value.map((/**
3107 * @param {?} option
3108 * @return {?}
3109 */
3110 function (option) { return option.value || option.label; }));
3111 obj.optionsWithLabels = optionsArray.value.map((/**
3112 * @param {?} option
3113 * @return {?}
3114 */
3115 function (option) { return ({ label: option.label, value: option.value }); }));
3116 }
3117 obj.description = this.orderFormFieldGroup.get('descriptionControl').value;
3118 obj.required = this.orderFormFieldGroup.get('requiredControl').value || false;
3119 obj.uploadUrl = this.orderFormFieldGroup.get('uploadUrlControl').value;
3120 obj.prefix = this.orderFormFieldGroup.get('prefixControl').value;
3121 obj.suffix = this.orderFormFieldGroup.get('suffixControl').value;
3122 obj.regexValidator = this.orderFormFieldGroup.get('regexValidatorControl').value;
3123 obj.regexErrorMessage = this.orderFormFieldGroup.get('regexErrorMessageControl').value;
3124 obj.allowMultiples = this.orderFormFieldGroup.get('allowMultiples').value || false;
3125 obj.allowDuplicates = this.orderFormFieldGroup.get('allowDuplicates').value || false;
3126 obj.maxChoices = this.orderFormFieldGroup.get('maxChoices').value || 1;
3127 obj.forOfficeUseOnly = this.orderFormFieldGroup.get('forOfficeUseOnly').value || false;
3128 return obj;
3129 };
3130 FieldBuilderComponent.decorators = [
3131 { type: core.Component, args: [{
3132 selector: 'va-field-builder',
3133 template: "<div class=\"color-primary grab-mask order-form-field-form-container\" [formGroup]=\"orderFormFieldGroup\">\n <mat-form-field class=\"order-form-mat-form-field\">\n <mat-select matInput formControlName=\"typeControl\" placeholder=\"Type\" required novalidate>\n <mat-option *ngFor=\"let field of supportedFieldTypes\" [value]=\"field\">\n {{ field.name }}\n </mat-option>\n </mat-select>\n <mat-error *ngIf=\"'typeControl.invalid'\">Form Field type is Required</mat-error>\n </mat-form-field>\n <span class=\"options\">\n <mat-checkbox color=\"primary\" [formControlName]=\"'requiredControl'\"> Required</mat-checkbox>\n <mat-checkbox color=\"primary\" [formControlName]=\"'forOfficeUseOnly'\" class=\"underlined\" matTooltip=\"This question will not be shown to end users\"> For Office Use Only</mat-checkbox>\n </span>\n <!-- Options if drop down type is selected -->\n <ng-container *ngIf=\"getCurrentFieldInterface() && getCurrentFieldInterface() === 'dropdown'\">\n <div formArrayName=\"optionsFormArray\" *ngFor=\"let option of getOptionsArray().controls; let i = index;\">\n <div class=\"removable-form-field dropdown-option\">\n <mat-form-field class=\"dropdown-option-label\">\n <input matInput [formControl]=\"option.get('label')\" placeholder=\"Option\">\n </mat-form-field>\n <mat-form-field class=\"dropdown-option-value\" *ngIf=\"option.get('useValue').value\">\n <input matInput [formControl]=\"option.get('value')\" placeholder=\"Value\">\n </mat-form-field>\n <a class=\"dropdown-option-value\" (click)=\"option.get('useValue').setValue(true)\" *ngIf=\"!option.get('useValue').value\">+ Assign Value</a>\n <button mat-icon-button type=\"button\" color=\"primary\" (click)=\"removeOption(i)\">\n <mat-icon aria-label=\"Clear Button\">clear</mat-icon>\n </button>\n </div>\n </div>\n <div class=\"order-form-mat-form-field\">\n <a (click)=\"addOption()\">+ Option</a>\n </div>\n <div class=\"dropdown-config\">\n <mat-checkbox color=\"primary\" [formControlName]=\"'allowMultiples'\"> Allow Multiples</mat-checkbox>\n <ng-container *ngIf=\"orderFormFieldGroup.controls.allowMultiples.value\">\n <mat-checkbox class=\"required-checkbox\" color=\"primary\" [formControlName]=\"'allowDuplicates'\"> Allow Duplicates</mat-checkbox>\n <div>\n <mat-form-field class=\"order-form-mat-form-field\">\n <input matInput formControlName=\"maxChoices\" placeholder=\"Maximum Number of Choices\" required type=\"number\">\n <mat-hint>Must be greater than 0</mat-hint>\n <mat-error *ngIf=\"'maxChoices.invalid'\">Max Choices must be a number larger than 0</mat-error>\n </mat-form-field>\n </div>\n </ng-container>\n </div>\n </ng-container>\n <div>\n <mat-form-field class=\"order-form-mat-form-field\">\n <input matInput formControlName=\"labelControl\" placeholder=\"Label\" required novalidate>\n <mat-hint>Keep it short. Recommended: Max 140 characters</mat-hint>\n <mat-error *ngIf=\"'idControl.invalid'\">Label is Required</mat-error>\n </mat-form-field>\n </div>\n <!-- Prefix/suffix if textbox type is selected -->\n <ng-container *ngIf=\"getCurrentFieldInterface() && getCurrentFieldInterface() === 'textbox'\">\n <ng-container *ngIf=\"showSuffixes\">\n <mat-form-field>\n <input matInput formControlName=\"prefixControl\" placeholder=\"Prefix\">\n </mat-form-field>\n <mat-form-field>\n <input matInput formControlName=\"suffixControl\" placeholder=\"Suffix\">\n </mat-form-field>\n <div class=\"show-hide-text-button\"><a (click)=\"showSuffixes = !showSuffixes\">Hide Prefix/Suffix</a></div>\n </ng-container>\n <div *ngIf=\"!showSuffixes\" class=\"show-hide-text-button\">\n <a (click)=\"showSuffixes = !showSuffixes\">+ Prefix/Suffix</a>\n <div class=\"hidden-note\">- Values will apply even though currently hidden </div>\n </div>\n </ng-container>\n\n <div>\n <mat-form-field class=\"order-form-mat-form-field\">\n <input matInput formControlName=\"idControl\" placeholder=\"ID\" required>\n <mat-error *ngIf=\"'idControl.invalid'\">Id is Required</mat-error>\n <mat-hint>ID must be unique</mat-hint>\n </mat-form-field>\n </div>\n\n\n <!-- Upload url if file type is selected -->\n <ng-container *ngIf=\"getCurrentFieldInterface() && getCurrentFieldInterface() === 'file'\">\n <mat-form-field>\n <input matInput formControlName=\"uploadUrlControl\" placeholder=\"Upload URL\">\n </mat-form-field>\n </ng-container>\n\n\n <!-- Prefix/suffix if textbox type is selected -->\n <ng-container *ngIf=\"getCurrentFieldInterface() && getCurrentFieldInterface() === 'textbox'\">\n\n <!-- RegexValidator/RegexErrorMessage if textbox type is selected -->\n <ng-container *ngIf=\"showValidators\">\n <mat-form-field>\n <input matInput formControlName=\"regexValidatorControl\" placeholder=\"Regex Validator\">\n <mat-error *ngIf=\"'regexValidatorControl.invalid'\"> Must be a valid regular expression </mat-error>\n </mat-form-field>\n <mat-form-field>\n <input matInput formControlName=\"regexErrorMessageControl\" placeholder=\"Regex Error Message\">\n <mat-hint> Error displayed to the user when the regular expression is not matched </mat-hint>\n </mat-form-field>\n <div class=\"show-hide-text-button\">\n <a (click)=\"showValidators = !showValidators\">Hide Validation</a>\n </div>\n </ng-container>\n <div *ngIf=\"!showValidators\" class=\"show-hide-text-button\">\n <a (click)=\"showValidators = !showValidators\">+ Validation</a>\n <div class=\"hidden-note\"> - Values will apply even though currently hidden </div>\n </div>\n </ng-container>\n\n <!-- Optional description -->\n <div class=\"removable-form-field\">\n <mat-form-field>\n <input matInput formControlName=\"descriptionControl\" placeholder=\"Hint text\">\n <mat-hint>A short sentence to show below the field if you absolutely need extra instruction</mat-hint>\n </mat-form-field>\n </div>\n\n <div class=\"delete-field-section\">\n <button mat-icon-button type=\"button\" color=\"primary\" (click)=\"removeField.emit()\">\n Delete field\n <!-- <mat-icon aria-label=\"Clear Button\">clear</mat-icon> -->\n </button>\n </div>\n</div>\n",
3134 changeDetection: core.ChangeDetectionStrategy.OnPush,
3135 styles: [".show-hide-text-button{margin-bottom:2em;display:-webkit-box;display:flex}.show-hide-text-button .hidden-note{font-size:10px;margin-left:7px;color:#9e9e9e;-ms-grid-row-align:center;align-self:center}.options{padding-left:15px;width:15%;display:inline-block}.dropdown-option,mat-form-field{width:85%}.delete-field-section{text-align:right}.mat-icon-button{width:auto;color:rgba(0,0,0,.54)!important}.mat-icon-button:hover{color:#c62828!important}.dropdown-config{margin-top:17px}.dropdown-config mat-checkbox{margin-right:16px}.dropdown-option{display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center}.dropdown-option-label{-webkit-box-flex:1;flex:1 1 auto;margin-right:16px}.dropdown-option-value{-webkit-box-flex:0;flex:0 1 33%}.underlined{border-bottom:1px dotted}"]
3136 }] }
3137 ];
3138 FieldBuilderComponent.propDecorators = {
3139 orderFormFieldGroup: [{ type: core.Input }],
3140 supportedFieldTypes: [{ type: core.Input }],
3141 removeField: [{ type: core.Output }]
3142 };
3143 return FieldBuilderComponent;
3144 }());
3145 if (false) {
3146 /** @type {?} */
3147 FieldBuilderComponent.prototype.orderFormFieldGroup;
3148 /** @type {?} */
3149 FieldBuilderComponent.prototype.supportedFieldTypes;
3150 /** @type {?} */
3151 FieldBuilderComponent.prototype.removeField;
3152 /** @type {?} */
3153 FieldBuilderComponent.prototype.showValidators;
3154 /** @type {?} */
3155 FieldBuilderComponent.prototype.showSuffixes;
3156 }
3157 // Validation to ensure supplied regex is valid
3158 /**
3159 * @return {?}
3160 */
3161 function regexValidator() {
3162 return (/**
3163 * @param {?} control
3164 * @return {?}
3165 */
3166 function (control) {
3167 try {
3168 /** @type {?} */
3169 var _ = new RegExp(control.value || '');
3170 }
3171 catch (e) {
3172 return { 'regex': true };
3173 }
3174 return null;
3175 });
3176 }
3177 /**
3178 * @return {?}
3179 */
3180 function numberValidator() {
3181 return (/**
3182 * @param {?} control
3183 * @return {?}
3184 */
3185 function (control) {
3186 /** @type {?} */
3187 var isNumber = /^\d+$/;
3188 if (isNumber.test(control.value)) {
3189 return null;
3190 }
3191 return { 'number': true };
3192 });
3193 }
3194 /**
3195 * @record
3196 */
3197 function FormFieldInterface() { }
3198 if (false) {
3199 /** @type {?} */
3200 FormFieldInterface.prototype.id;
3201 /** @type {?} */
3202 FormFieldInterface.prototype.name;
3203 }
3204 /** @type {?} */
3205 var FORM_FIELDS = [
3206 { id: FILES, name: 'Files' }, { id: DROP_DOWN, name: 'Drop Down' },
3207 { id: CHECK_BOX, name: 'Check Box' }, { id: TEXT_AREA, name: 'Text Area' },
3208 { id: TEXT_BOX, name: 'Text Box' }, { id: BUSINESS_USER, name: 'End User' }
3209 ];
3210 /**
3211 * @param {?} formFieldId
3212 * @return {?}
3213 */
3214 function getFieldInterface(formFieldId) {
3215 return getFormFieldInterfaceFromId(((/** @type {?} */ (formFieldId))));
3216 }
3217 /**
3218 * @param {?} id
3219 * @return {?}
3220 */
3221 function getFormFieldInterfaceFromId(id) {
3222 return FORM_FIELDS.find((/**
3223 * @param {?} obj
3224 * @return {?}
3225 */
3226 function (obj) { return obj.id === id; }));
3227 }
3228
3229 /**
3230 * @fileoverview added by tsickle
3231 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3232 */
3233 var OrderItemListService = /** @class */ (function () {
3234 function OrderItemListService() {
3235 }
3236 /**
3237 * @param {?} items
3238 * @return {?}
3239 */
3240 OrderItemListService.getPriceSummary = /**
3241 * @param {?} items
3242 * @return {?}
3243 */
3244 function (items) {
3245 if (!items) {
3246 return { items: [], includesUndefinedPricing: false };
3247 }
3248 /** @type {?} */
3249 var includesUndefinedPricing = false;
3250 /** @type {?} */
3251 var summaryItems = items.reduce((/**
3252 * @param {?} currentArray
3253 * @param {?} item
3254 * @return {?}
3255 */
3256 function (currentArray, item) {
3257 if (item.pricing.prices.length <= 0) {
3258 includesUndefinedPricing = true;
3259 return currentArray;
3260 }
3261 item.pricing.prices.map((/**
3262 * @param {?} price
3263 * @return {?}
3264 */
3265 function (price) {
3266 if (!price || price.price < 0) {
3267 includesUndefinedPricing = true;
3268 return;
3269 }
3270 /** @type {?} */
3271 var freq = price.billingFrequency;
3272 /** @type {?} */
3273 var cur = item.pricing.currency;
3274 /** @type {?} */
3275 var existingCurIndex = currentArray.findIndex((/**
3276 * @param {?} summaryItem
3277 * @return {?}
3278 */
3279 function (summaryItem) { return summaryItem.currency === cur; }));
3280 /** @type {?} */
3281 var pricing = {
3282 currency: cur,
3283 prices: []
3284 };
3285 if (existingCurIndex > -1) {
3286 pricing = currentArray[existingCurIndex];
3287 }
3288 /** @type {?} */
3289 var existingFreqIndex = pricing.prices.findIndex((/**
3290 * @param {?} summaryItem
3291 * @return {?}
3292 */
3293 function (summaryItem) { return summaryItem.billingFrequency === freq; }));
3294 /** @type {?} */
3295 var quantifiedPrice = price.price !== null ? price.price * item.quantity : null;
3296 /** @type {?} */
3297 var quantifiedDiscount = (price.discountAmount || 0) * item.quantity;
3298 if (existingFreqIndex > -1) {
3299 pricing.prices[existingFreqIndex] = {
3300 price: pricing.prices[existingFreqIndex].price + quantifiedPrice,
3301 billingFrequency: freq,
3302 discountAmount: pricing.prices[existingFreqIndex].discountAmount + quantifiedDiscount
3303 };
3304 }
3305 else {
3306 pricing.prices.push({
3307 price: quantifiedPrice,
3308 billingFrequency: freq,
3309 discountAmount: quantifiedDiscount
3310 });
3311 }
3312 if (existingCurIndex > -1) {
3313 currentArray[existingCurIndex] = pricing;
3314 }
3315 else {
3316 currentArray.push(pricing);
3317 }
3318 }));
3319 return currentArray;
3320 }), []);
3321 return { items: summaryItems, includesUndefinedPricing: includesUndefinedPricing };
3322 };
3323 return OrderItemListService;
3324 }());
3325
3326 /**
3327 * @fileoverview added by tsickle
3328 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3329 */
3330 var OrderItemListComponent = /** @class */ (function () {
3331 function OrderItemListComponent() {
3332 this.includesUndefinedPricing = false;
3333 }
3334 Object.defineProperty(OrderItemListComponent.prototype, "orderItems", {
3335 set: /**
3336 * @param {?} items
3337 * @return {?}
3338 */
3339 function (items) {
3340 this.items = items || [];
3341 /** @type {?} */
3342 var summary = OrderItemListService.getPriceSummary(items);
3343 this.summaryItems = summary.items;
3344 this.includesUndefinedPricing = summary.includesUndefinedPricing;
3345 },
3346 enumerable: true,
3347 configurable: true
3348 });
3349 /**
3350 * @param {?} price
3351 * @return {?}
3352 */
3353 OrderItemListComponent.prototype.calculateTotalPrice = /**
3354 * @param {?} price
3355 * @return {?}
3356 */
3357 function (price) {
3358 if (price.price === null) {
3359 return null;
3360 }
3361 /** @type {?} */
3362 var totalPrice = price.price - price.discountAmount;
3363 if (!this.taxOptions) {
3364 return totalPrice;
3365 }
3366 /** @type {?} */
3367 var taxTotal = this.taxOptions.reduce((/**
3368 * @param {?} all
3369 * @param {?} tax
3370 * @return {?}
3371 */
3372 function (all, tax) { return all + (tax.percentage * totalPrice); }), 0);
3373 return totalPrice + taxTotal;
3374 };
3375 /**
3376 * @param {?} tax
3377 * @return {?}
3378 */
3379 OrderItemListComponent.prototype.buildTaxLabel = /**
3380 * @param {?} tax
3381 * @return {?}
3382 */
3383 function (tax) {
3384 /** @type {?} */
3385 var taxPercentage = Number(tax.percentage * 100).toFixed(2);
3386 return tax.label + " (" + taxPercentage + "%)";
3387 };
3388 /**
3389 * @return {?}
3390 */
3391 OrderItemListComponent.prototype.isFree = /**
3392 * @return {?}
3393 */
3394 function () {
3395 /** @type {?} */
3396 var summaryTotal = this.summaryItems.reduce((/**
3397 * @param {?} all
3398 * @param {?} item
3399 * @return {?}
3400 */
3401 function (all, item) {
3402 /** @type {?} */
3403 var totalPrices = item.prices.reduce((/**
3404 * @param {?} acc
3405 * @param {?} price
3406 * @return {?}
3407 */
3408 function (acc, price) { return acc + price.price; }), 0);
3409 return all + totalPrices;
3410 }), 0);
3411 return summaryTotal === 0;
3412 };
3413 OrderItemListComponent.decorators = [
3414 { type: core.Component, args: [{
3415 selector: 'va-order-item-list',
3416 template: "<div class=\"va-order-item-list\">\n <mat-list class=\"product-list\" *ngIf=\"items; else loading\">\n <ng-container *ngFor=\"let item of items\">\n <mat-list-item>\n <div class=\"list-item\">\n <div class=\"left-section\">\n <div class=\"icon-and-name\">\n <div class=\"icon-container\">\n <va-icon [diameter]=\"32\" [iconUrl]=\"item.icon\" [name]=\"item.name\"></va-icon>\n </div>\n <div>\n <div>\n {{ item.name }}\n <va-badge color=\"blue-solid\" *ngIf=\"item.editionName\">\n <span> {{ item.editionName }} </span>\n </va-badge>\n <span *ngIf=\"item.quantity > 1\"> ({{ item.quantity }})</span>\n </div>\n </div>\n </div>\n </div>\n <div class=\"right-section\" *ngIf=\"!hidePricing && item.pricing\">\n <ng-container *ngIf=\"item.pricing.prices?.length > 0\">\n <ng-container *ngFor=\"let price of item.pricing.prices\">\n <div matLine>\n <strong *ngIf=\"!price.discountAmount\">{{ price.price | price: item.pricing.currency }}</strong>\n <ng-container *ngIf=\"price.price && price.discountAmount > 0\">\n <span matTooltipPosition=\"left\" class=\"item-price-before-discount\"\n [matTooltip]=\"price.discountAmount | price: item.pricing.currency\">\n {{ price.price | price: item.pricing.currency }}\n </span>\n <strong>{{ price.price - price.discountAmount | price: item.pricing.currency }}</strong>\n </ng-container>\n </div>\n <div matLine class=\"tertiary-font-color\" *ngIf=\"price.price > 0\">\n {{ price.billingFrequency | formatBillingFrequency }}\n </div>\n </ng-container>\n </ng-container>\n <ng-container *ngIf=\"item.pricing.prices?.length <= 0\">\n <mat-list-item class=\"summary-list-item\">\n <div matLine>\n <strong>{{ null | price: 'CAD' }}</strong>\n </div>\n </mat-list-item>\n </ng-container>\n </div>\n </div>\n </mat-list-item>\n <mat-divider></mat-divider>\n </ng-container>\n </mat-list>\n\n <div *ngIf=\"!hidePricing\">\n <div *ngIf=\"items; else loading\">\n <div class=\"total-header\">\n {{ 'FRONTEND.STORE.TOTAL' | translate }}\n </div>\n <mat-list class=\"summary-list\">\n <ng-container *ngIf=\"includesUndefinedPricing; else totalIsDefined\">\n <mat-list-item class=\"summary-list-item\">\n <div matLine>\n <strong>{{ null | price: 'CAD' }}</strong>\n </div>\n </mat-list-item>\n </ng-container>\n\n <ng-template #totalIsDefined>\n <ng-container *ngIf=\"isFree(); else totalNotFree\">\n <div class=\"summary-item-group\">\n <mat-list-item class=\"summary-list-item\">\n <div matLine>\n <strong>{{ 0 | price: 'USD' }}</strong>\n </div>\n </mat-list-item>\n </div>\n </ng-container>\n\n <ng-template #totalNotFree>\n <ng-container *ngFor=\"let item of summaryItems\">\n <div class=\"summary-item-group\" *ngFor=\"let price of item.prices\">\n <ng-container *ngIf=\"price.price > 0\">\n <div class=\"tax-calculation\">\n <mat-list-item class=\"summary-list-item tax-item\">\n <div matLine *ngIf=\"taxOptions\">\n <strong>{{ price.price - price.discountAmount | price: item.currency }}</strong>\n </div>\n </mat-list-item>\n <ng-container *ngFor=\"let tax of taxOptions\">\n <mat-list-item class=\"summary-list-item tax-item\">\n <div matLine class=\"tax-label\">\n <span>\n {{ buildTaxLabel(tax) }}\n </span>\n <strong>\n +{{ (price.price - price.discountAmount) * tax.percentage | price: item.currency }}\n </strong>\n </div>\n </mat-list-item>\n </ng-container>\n </div>\n\n <mat-list-item class=\"summary-list-item\" [ngClass]=\"{ 'result-item': (price.price > 0 && taxOptions) }\">\n <div matLine>\n <strong>{{ calculateTotalPrice(price) | price: item.currency }}</strong>\n </div>\n </mat-list-item>\n\n <mat-list-item class=\"summary-list-item\">\n <div matLine class=\"tertiary-font-color\">\n {{ price.billingFrequency | formatBillingFrequency }}\n </div>\n </mat-list-item>\n </ng-container>\n </div>\n </ng-container>\n\n </ng-template>\n </ng-template>\n </mat-list>\n </div>\n </div>\n\n <ng-template #loading>\n <div class=\"stencil-shimmer\"></div>\n </ng-template>\n\n</div>\n",
3417 styles: ["::ng-deep .va-order-item-list .mat-list-item{height:auto!important}::ng-deep .va-order-item-list .mat-list .mat-list-item-content{padding:10px 0!important}::ng-deep .va-order-item-list .mat-list .summary-list-item .mat-list-item-content{padding:0!important}.product-list{padding:0;position:relative}.product-list .list-item{display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center;-webkit-box-pack:justify;justify-content:space-between;width:100%}.product-list .list-item .left-section .icon-and-name{display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center}.product-list .list-item .left-section .icon-and-name .icon-container{margin-right:16px}.product-list .list-item .right-section{margin-left:1em;text-align:right;align-self:flex-start}.total-header{background-color:#616161;color:#fff;line-height:2;height:2em;font-weight:700;padding-right:14px;text-align:right}.summary-list{padding:8px 0;background-color:#f5f5f5}.summary-list .summary-list-item{padding-right:14px;text-align:right}.summary-list .summary-item-group{padding:10px 0}.summary-list .summary-list-item.tax-item{color:#9e9e9e;font-size:14px}.summary-list .summary-list-item.result-item{text-decoration:overline;padding-top:5px}.summary-list .tax-label{font-size:12px}.tertiary-font-color{color:#212121;font-size:14px!important}.stencil-shimmer{width:100%;min-height:20px;margin-bottom:4px}.item-price-before-discount{font-size:14px;margin-right:8px;color:#9e9e9e;text-decoration:line-through;border-bottom:1px dotted #9e9e9e}"]
3418 }] }
3419 ];
3420 OrderItemListComponent.propDecorators = {
3421 taxOptions: [{ type: core.Input }],
3422 hidePricing: [{ type: core.Input }],
3423 orderItems: [{ type: core.Input }]
3424 };
3425 return OrderItemListComponent;
3426 }());
3427 if (false) {
3428 /** @type {?} */
3429 OrderItemListComponent.prototype.items;
3430 /** @type {?} */
3431 OrderItemListComponent.prototype.summaryItems;
3432 /** @type {?} */
3433 OrderItemListComponent.prototype.includesUndefinedPricing;
3434 /** @type {?} */
3435 OrderItemListComponent.prototype.taxOptions;
3436 /** @type {?} */
3437 OrderItemListComponent.prototype.hidePricing;
3438 }
3439
3440 /**
3441 * @fileoverview added by tsickle
3442 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3443 */
3444 var PricePipe = /** @class */ (function () {
3445 function PricePipe() {
3446 }
3447 /**
3448 * @param {?} value
3449 * @param {?} currency
3450 * @param {?=} billingFrequency
3451 * @param {?=} isCents
3452 * @param {?=} translateZero
3453 * @param {?=} displaySymbol
3454 * @return {?}
3455 */
3456 PricePipe.prototype.transform = /**
3457 * @param {?} value
3458 * @param {?} currency
3459 * @param {?=} billingFrequency
3460 * @param {?=} isCents
3461 * @param {?=} translateZero
3462 * @param {?=} displaySymbol
3463 * @return {?}
3464 */
3465 function (value, currency, billingFrequency, isCents, translateZero, displaySymbol) {
3466 if (isCents === void 0) { isCents = true; }
3467 if (translateZero === void 0) { translateZero = true; }
3468 if (displaySymbol === void 0) { displaySymbol = true; }
3469 return shared.formatDisplayPrice(value, currency, billingFrequency, isCents, translateZero, displaySymbol);
3470 };
3471 PricePipe.decorators = [
3472 { type: core.Pipe, args: [{ name: 'price' },] }
3473 ];
3474 return PricePipe;
3475 }());
3476 var FormatBillingFrequencyPipe = /** @class */ (function () {
3477 function FormatBillingFrequencyPipe() {
3478 }
3479 /**
3480 * @param {?} value
3481 * @return {?}
3482 */
3483 FormatBillingFrequencyPipe.prototype.transform = /**
3484 * @param {?} value
3485 * @return {?}
3486 */
3487 function (value) {
3488 return shared.formatBillingFrequency(value);
3489 };
3490 FormatBillingFrequencyPipe.decorators = [
3491 { type: core.Pipe, args: [{ name: 'formatBillingFrequency' },] }
3492 ];
3493 return FormatBillingFrequencyPipe;
3494 }());
3495
3496 /**
3497 * @fileoverview added by tsickle
3498 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3499 */
3500 var VaOrderFormModule = /** @class */ (function () {
3501 function VaOrderFormModule(translateService, currentLang$, defaultLang$) {
3502 this.translateService = translateService;
3503 if (!this.translateService.translations.hasOwnProperty('en')) {
3504 this.translateService.reloadLang('en');
3505 }
3506 if (!this.translateService.translations.hasOwnProperty('cs')) {
3507 this.translateService.reloadLang('cs');
3508 }
3509 this.translateService.setTranslation('en', En.en, true);
3510 this.translateService.setTranslation('cs', Cs.cs, true);
3511 if (currentLang$) {
3512 currentLang$.subscribe((/**
3513 * @param {?} currentLang
3514 * @return {?}
3515 */
3516 function (currentLang) { return translateService.use(currentLang); }));
3517 }
3518 if (defaultLang$) {
3519 defaultLang$.subscribe((/**
3520 * @param {?} defaultLang
3521 * @return {?}
3522 */
3523 function (defaultLang) { return translateService.setDefaultLang(defaultLang); }));
3524 }
3525 }
3526 VaOrderFormModule.decorators = [
3527 { type: core.NgModule, args: [{
3528 imports: [
3529 common.CommonModule,
3530 forms.FormsModule,
3531 material.MatButtonModule,
3532 material.MatCheckboxModule,
3533 material.MatExpansionModule,
3534 material.MatIconModule,
3535 material.MatInputModule,
3536 material.MatOptionModule,
3537 material.MatProgressSpinnerModule,
3538 material.MatSelectModule,
3539 material.MatCardModule,
3540 material.MatTooltipModule,
3541 forms.ReactiveFormsModule,
3542 forms$1.VaFormsModule,
3543 VaHeaderContainerModule,
3544 uikit.VaIconModule,
3545 forms$1.VaFormsModule,
3546 uikit.VaBadgeModule,
3547 list.MatListModule,
3548 core$1.TranslateModule.forChild(),
3549 ],
3550 declarations: [
3551 DropDownFormSectionComponent,
3552 FieldComponent,
3553 OrderFormSectionComponent,
3554 OrderFormComponent,
3555 FieldBuilderComponent,
3556 OrderItemListComponent,
3557 PricePipe,
3558 FormatBillingFrequencyPipe,
3559 ],
3560 exports: [
3561 DropDownFormSectionComponent,
3562 FieldComponent,
3563 OrderFormSectionComponent,
3564 OrderFormComponent,
3565 FieldBuilderComponent,
3566 OrderItemListComponent,
3567 ],
3568 providers: [
3569 FieldService,
3570 OrderFormService,
3571 OrderItemListService,
3572 ]
3573 },] }
3574 ];
3575 /** @nocollapse */
3576 VaOrderFormModule.ctorParameters = function () { return [
3577 { type: core$1.TranslateService },
3578 { type: rxjs.Observable, decorators: [{ type: core.Optional }, { type: core.Inject, args: ['CURRENT_LANG',] }] },
3579 { type: rxjs.Observable, decorators: [{ type: core.Optional }, { type: core.Inject, args: ['DEFAULT_LANG',] }] }
3580 ]; };
3581 return VaOrderFormModule;
3582 }());
3583 if (false) {
3584 /**
3585 * @type {?}
3586 * @private
3587 */
3588 VaOrderFormModule.prototype.translateService;
3589 }
3590
3591 /**
3592 * @fileoverview added by tsickle
3593 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3594 */
3595 var StoreService = /** @class */ (function () {
3596 function StoreService() {
3597 }
3598 /**
3599 * @param {?} formGroup
3600 * @return {?}
3601 */
3602 StoreService.prototype.markFormsAsTouched = /**
3603 * @param {?} formGroup
3604 * @return {?}
3605 */
3606 function (formGroup) {
3607 for (var key in formGroup.controls) {
3608 if (formGroup.controls[key] instanceof forms.FormGroup) {
3609 this.markFormsAsTouched((/** @type {?} */ (formGroup.controls[key])));
3610 }
3611 else {
3612 ((/** @type {?} */ (formGroup.controls[key]))).markAsTouched();
3613 ((/** @type {?} */ (formGroup.controls[key]))).updateValueAndValidity();
3614 }
3615 }
3616 };
3617 StoreService.decorators = [
3618 { type: core.Injectable }
3619 ];
3620 return StoreService;
3621 }());
3622
3623 /**
3624 * @fileoverview added by tsickle
3625 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3626 */
3627 var File = /** @class */ (function () {
3628 function File(url) {
3629 this.url = url;
3630 this.url = url;
3631 }
3632 Object.defineProperty(File.prototype, "name", {
3633 get: /**
3634 * @return {?}
3635 */
3636 function () {
3637 return this.url ? this.url.substring(this.url.lastIndexOf('/') + 1, this.url.lastIndexOf('.')) : null;
3638 },
3639 enumerable: true,
3640 configurable: true
3641 });
3642 Object.defineProperty(File.prototype, "icon", {
3643 get: /**
3644 * @return {?}
3645 */
3646 function () {
3647 /** @type {?} */
3648 var ext = this.url ? this.url.substring(this.url.lastIndexOf('.') + 1) : null;
3649 switch (ext) {
3650 case 'pdf':
3651 return 'icon-pdf';
3652 case 'ppt':
3653 return 'icon-ppt';
3654 default:
3655 return 'icon-docs';
3656 }
3657 },
3658 enumerable: true,
3659 configurable: true
3660 });
3661 return File;
3662 }());
3663 if (false) {
3664 /** @type {?} */
3665 File.prototype.url;
3666 }
3667
3668 /**
3669 * @fileoverview added by tsickle
3670 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3671 */
3672 /**
3673 * @record
3674 */
3675 function Pricing() { }
3676 if (false) {
3677 /** @type {?} */
3678 Pricing.prototype.currency;
3679 /** @type {?} */
3680 Pricing.prototype.prices;
3681 }
3682 /**
3683 * @record
3684 */
3685 function Price() { }
3686 if (false) {
3687 /** @type {?} */
3688 Price.prototype.price;
3689 /** @type {?} */
3690 Price.prototype.frequency;
3691 /** @type {?|undefined} */
3692 Price.prototype.isStartingPrice;
3693 }
3694 /** @type {?} */
3695 var CONTACT_SALES = -1;
3696
3697 /**
3698 * @fileoverview added by tsickle
3699 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3700 */
3701 var Sellable = /** @class */ (function () {
3702 function Sellable() {
3703 }
3704 Object.defineProperty(Sellable.prototype, "isFree", {
3705 get: /**
3706 * @return {?}
3707 */
3708 function () {
3709 return this.pricing && this.pricing.prices ? this.pricing.prices.some((/**
3710 * @param {?} p
3711 * @return {?}
3712 */
3713 function (p) { return p.price === 0 || p.price === undefined; })) : false;
3714 },
3715 enumerable: true,
3716 configurable: true
3717 });
3718 Object.defineProperty(Sellable.prototype, "shouldContactSales", {
3719 get: /**
3720 * @return {?}
3721 */
3722 function () {
3723 return this.pricing && this.pricing.prices ?
3724 this.pricing.prices.some((/**
3725 * @param {?} p
3726 * @return {?}
3727 */
3728 function (p) { return p.price === null || p.price === CONTACT_SALES; })) ||
3729 this.pricing.prices.length === 0 : true;
3730 },
3731 enumerable: true,
3732 configurable: true
3733 });
3734 /**
3735 * @param {?} inputString
3736 * @return {?}
3737 */
3738 Sellable.getCapitalizeFirstLetter = /**
3739 * @param {?} inputString
3740 * @return {?}
3741 */
3742 function (inputString) {
3743 return inputString ? inputString.charAt(0).toUpperCase() + inputString.slice(1) : null;
3744 };
3745 Object.defineProperty(Sellable.prototype, "formattedPricingList", {
3746 get: /**
3747 * @return {?}
3748 */
3749 function () {
3750 if (this.pricing && this.pricing.prices && this.pricing.prices.length) {
3751 /** @type {?} */
3752 var hasCurrencyAndIsNotUSD = this.pricing.currency && this.pricing.currency !== 'USD';
3753 /** @type {?} */
3754 var currencyStr_1 = hasCurrencyAndIsNotUSD ? this.pricing.currency : '';
3755 /** @type {?} */
3756 var currencySymbol_1 = Sellable.getCurrencySymbol(this.pricing.currency);
3757 return this.pricing.prices.map((/**
3758 * @param {?} price
3759 * @return {?}
3760 */
3761 function (price) {
3762 /** @type {?} */
3763 var frequencyStr = price.frequency ? '/ ' + Sellable.getCapitalizeFirstLetter(price.frequency) : '';
3764 /** @type {?} */
3765 var roundedPrice = ((price.price || 0) / 100.0).toFixed(2);
3766 /** @type {?} */
3767 var startingAtPrefix = price.isStartingPrice ? 'Starting at ' : '';
3768 /** @type {?} */
3769 var priceStr = "" + startingAtPrefix + currencySymbol_1 + roundedPrice + " " + currencyStr_1 + " " + frequencyStr;
3770 return (priceStr.trim().replace(/\s+/g, ' '));
3771 }));
3772 }
3773 else {
3774 return ['Contact Sales'];
3775 }
3776 },
3777 enumerable: true,
3778 configurable: true
3779 });
3780 Object.defineProperty(Sellable.prototype, "priceStrings", {
3781 get: /**
3782 * @return {?}
3783 */
3784 function () {
3785 if (this.shouldContactSales) {
3786 return ['Contact Sales'];
3787 }
3788 if (this.isFree) {
3789 return ['Free'];
3790 }
3791 return this.formattedPricingList;
3792 },
3793 enumerable: true,
3794 configurable: true
3795 });
3796 Object.defineProperty(Sellable.prototype, "formattedWholesalePrice", {
3797 get: /**
3798 * @return {?}
3799 */
3800 function () {
3801 return this.priceStrings.join(' + ');
3802 },
3803 enumerable: true,
3804 configurable: true
3805 });
3806 /**
3807 * @param {?} currency
3808 * @return {?}
3809 */
3810 Sellable.getCurrencySymbol = /**
3811 * @param {?} currency
3812 * @return {?}
3813 */
3814 function (currency) {
3815 /** @type {?} */
3816 var currencySymbol = '$';
3817 switch (currency) {
3818 case 'EUR':
3819 currencySymbol = '\u20AC';
3820 break;
3821 case 'GBP':
3822 currencySymbol = '\u00A3';
3823 break;
3824 case 'CHF':
3825 currencySymbol = 'Fr';
3826 break;
3827 case 'CNY':
3828 currencySymbol = '\u00A5';
3829 break;
3830 case 'JPY':
3831 currencySymbol = '\u00A5';
3832 break;
3833 case 'CZK':
3834 currencySymbol = 'K\u010d';
3835 break;
3836 case 'INR':
3837 currencySymbol = '\u20B9';
3838 break;
3839 case 'KHR':
3840 currencySymbol = '\u17DB';
3841 break;
3842 case 'KRW':
3843 currencySymbol = '\u20A9';
3844 break;
3845 case 'NOK':
3846 currencySymbol = 'kr';
3847 break;
3848 case 'SEK':
3849 currencySymbol = 'kr';
3850 break;
3851 case 'RUB':
3852 currencySymbol = '\u20BD';
3853 break;
3854 case 'TRY':
3855 currencySymbol = '\u20BA';
3856 break;
3857 case 'ZAR':
3858 currencySymbol = 'R';
3859 break;
3860 default:
3861 currencySymbol = '$';
3862 break;
3863 }
3864 return currencySymbol;
3865 };
3866 return Sellable;
3867 }());
3868 if (false) {
3869 /** @type {?} */
3870 Sellable.prototype.pricing;
3871 }
3872
3873 /**
3874 * @fileoverview added by tsickle
3875 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3876 */
3877 // @dynamic
3878 var
3879 // @dynamic
3880 CaseTransform = /** @class */ (function () {
3881 function CaseTransform() {
3882 }
3883 /**
3884 * @param {?} value
3885 * @return {?}
3886 */
3887 CaseTransform.snakeToCamelCase = /**
3888 * @param {?} value
3889 * @return {?}
3890 */
3891 function (value) {
3892 return value ? value.replace(new RegExp(/_/g), ' ').replace(/\b\w/g, (/**
3893 * @param {?} l
3894 * @return {?}
3895 */
3896 function (l) { return l.toUpperCase(); }))
3897 .replace(/\b\w/, (/**
3898 * @param {?} l
3899 * @return {?}
3900 */
3901 function (l) { return l.toLowerCase(); })).replace(/\s/g, '') : value;
3902 };
3903 /**
3904 * @param {?} value
3905 * @return {?}
3906 */
3907 CaseTransform.lowerToTitleCase = /**
3908 * @param {?} value
3909 * @return {?}
3910 */
3911 function (value) {
3912 // Code taken from https://github.com/gouch/to-title-case to support the proper spec.
3913 /** @type {?} */
3914 var smallWords = /^(a|an|and|as|at|but|by|en|for|if|in|nor|of|on|or|per|the|to|vs?\.?|via)$/i;
3915 return value ? value.replace(/[A-Za-z0-9\u00C0-\u00FF]+[^\s-]*/g, (/**
3916 * @param {?} match
3917 * @param {?} index
3918 * @param {?} title
3919 * @return {?}
3920 */
3921 function (match, index, title) {
3922 if (index > 0 && index + match.length !== title.length &&
3923 match.search(smallWords) > -1 && title.charAt(index - 2) !== ':' &&
3924 (title.charAt(index + match.length) !== '-' || title.charAt(index - 1) === '-') &&
3925 title.charAt(index - 1).search(/[^\s-]/) < 0) {
3926 return match.toLowerCase();
3927 }
3928 if (match.substr(1).search(/[A-Z]|\../) > -1) {
3929 return match;
3930 }
3931 return match.charAt(0).toUpperCase() + match.substr(1);
3932 })) : value;
3933 };
3934 ;
3935 return CaseTransform;
3936 }());
3937
3938 /**
3939 * @fileoverview added by tsickle
3940 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
3941 */
3942 /** @type {?} */
3943 var COLOR_CODES = [
3944 '#EF5350', '#42A5F5', '#66BB6A', '#FFA726', '#AB47BC', '#FFCA28', '#EC407A', '#26C6DA',
3945 '#FF7B57'
3946 ];
3947 /** @type {?} */
3948 var DEFAULT_COLOR = '#808080';
3949 var Product = /** @class */ (function (_super) {
3950 __extends(Product, _super);
3951 function Product(data) {
3952 var _this = _super.call(this) || this;
3953 _this.addons = [];
3954 data = data || {};
3955 _this.pricing = data.pricing;
3956 _this.productId = data.productId;
3957 _this.editionId = data.editionId;
3958 _this.editionName = data.editionName;
3959 _this.name = data.name;
3960 _this.description = data.description;
3961 _this.tagline = data.tagline;
3962 _this.iconUrl = data.iconUrl;
3963 _this.entryUrl = data.entryUrl;
3964 _this.screenshotUrls = data.screenshotUrls;
3965 _this.pdfUploadUrls = data.pdfUploadUrls;
3966 _this.lmiCategories = data.lmiCategories;
3967 _this.keySellingPoints = data.keySellingPoints;
3968 _this.faqs = data.faqs;
3969 _this.wholesalePrice = data.wholesalePrice;
3970 _this.currency = data.currency;
3971 _this.billingFrequency = data.billingFrequency;
3972 _this.isArchived = data.isArchived;
3973 _this.addons = data.addons;
3974 _this.restrictions = data.restrictions;
3975 _this.billingId = data.billingId;
3976 if (data.hasOwnProperty('pdfUploadUrls')) {
3977 _this.files = _this.pdfUploadUrls ? _this.pdfUploadUrls.map((/**
3978 * @param {?} url
3979 * @return {?}
3980 */
3981 function (url) { return new File(url); })) : null;
3982 }
3983 return _this;
3984 }
3985 /**
3986 * @param {?} data
3987 * @return {?}
3988 */
3989 Product.fromApi = /**
3990 * @param {?} data
3991 * @return {?}
3992 */
3993 function (data) {
3994 /** @type {?} */
3995 var newProduct = {};
3996 data = data || {};
3997 for (var key in data) {
3998 if (data.hasOwnProperty(key)) {
3999 /** @type {?} */
4000 var newKey = CaseTransform.snakeToCamelCase(key);
4001 newProduct[newKey] = data[key];
4002 }
4003 }
4004 return new Product(newProduct);
4005 };
4006 Object.defineProperty(Product.prototype, "iconStyle", {
4007 get: /**
4008 * @return {?}
4009 */
4010 function () {
4011 return this.iconUrl ? "url(\"" + this.iconUrl + "\") no-repeat center / 100% 100%" : null;
4012 },
4013 enumerable: true,
4014 configurable: true
4015 });
4016 Object.defineProperty(Product.prototype, "iconColor", {
4017 get: /**
4018 * @return {?}
4019 */
4020 function () {
4021 // determine an icon color for a product with no icon by using the product name
4022 if (!this.name) {
4023 return DEFAULT_COLOR;
4024 }
4025 /** @type {?} */
4026 var nameSum = 0;
4027 for (var i = 0; i < this.name.length; i++) {
4028 nameSum += this.name[i].charCodeAt(0);
4029 }
4030 /** @type {?} */
4031 var index = nameSum % COLOR_CODES.length;
4032 return COLOR_CODES[index];
4033 },
4034 enumerable: true,
4035 configurable: true
4036 });
4037 /**
4038 * @return {?}
4039 */
4040 Product.prototype.getLmiCategoryNames = /**
4041 * @return {?}
4042 */
4043 function () {
4044 /** @type {?} */
4045 var lmiCategories = this.lmiCategories || [];
4046 return lmiCategories.map((/**
4047 * @param {?} lmiCategory
4048 * @return {?}
4049 */
4050 function (lmiCategory) { return CaseTransform.lowerToTitleCase(lmiCategory.toLowerCase().replace(/_/g, ' ')); }));
4051 };
4052 return Product;
4053 }(Sellable));
4054 if (false) {
4055 /** @type {?} */
4056 Product.prototype.productId;
4057 /** @type {?} */
4058 Product.prototype.editionId;
4059 /** @type {?} */
4060 Product.prototype.editionName;
4061 /** @type {?} */
4062 Product.prototype.name;
4063 /** @type {?} */
4064 Product.prototype.description;
4065 /** @type {?} */
4066 Product.prototype.tagline;
4067 /** @type {?} */
4068 Product.prototype.iconUrl;
4069 /** @type {?} */
4070 Product.prototype.entryUrl;
4071 /** @type {?} */
4072 Product.prototype.screenshotUrls;
4073 /** @type {?} */
4074 Product.prototype.pdfUploadUrls;
4075 /** @type {?} */
4076 Product.prototype.lmiCategories;
4077 /** @type {?} */
4078 Product.prototype.keySellingPoints;
4079 /** @type {?} */
4080 Product.prototype.faqs;
4081 /** @type {?} */
4082 Product.prototype.wholesalePrice;
4083 /** @type {?} */
4084 Product.prototype.currency;
4085 /** @type {?} */
4086 Product.prototype.billingFrequency;
4087 /** @type {?} */
4088 Product.prototype.billingId;
4089 /** @type {?} */
4090 Product.prototype.isArchived;
4091 /** @type {?} */
4092 Product.prototype.addons;
4093 /** @type {?} */
4094 Product.prototype.files;
4095 /** @type {?} */
4096 Product.prototype.restrictions;
4097 /** @type {?} */
4098 Product.prototype.trialConfiguration;
4099 }
4100 var ProductWithParent = /** @class */ (function (_super) {
4101 __extends(ProductWithParent, _super);
4102 function ProductWithParent(data) {
4103 var _this = _super.call(this, data) || this;
4104 _this.parentId = data.parentId;
4105 _this.parentName = data.parentName;
4106 _this.parentIconUrl = data.parentIconUrl;
4107 _this.multipleActivations = data.multipleActivations || false;
4108 return _this;
4109 }
4110 /**
4111 * @param {?} data
4112 * @return {?}
4113 */
4114 ProductWithParent.fromApi = /**
4115 * @param {?} data
4116 * @return {?}
4117 */
4118 function (data) {
4119 /** @type {?} */
4120 var newProduct = {};
4121 data = data || {};
4122 for (var key in data) {
4123 if (data.hasOwnProperty(key)) {
4124 /** @type {?} */
4125 var newKey = CaseTransform.snakeToCamelCase(key);
4126 newProduct[newKey] = data[key];
4127 }
4128 }
4129 return new ProductWithParent(newProduct);
4130 };
4131 return ProductWithParent;
4132 }(Product));
4133 if (false) {
4134 /** @type {?} */
4135 ProductWithParent.prototype.parentId;
4136 /** @type {?} */
4137 ProductWithParent.prototype.parentName;
4138 /** @type {?} */
4139 ProductWithParent.prototype.parentIconUrl;
4140 /** @type {?} */
4141 ProductWithParent.prototype.multipleActivations;
4142 }
4143 /**
4144 * @record
4145 */
4146 function TrialConfigurationInterface() { }
4147 if (false) {
4148 /** @type {?} */
4149 TrialConfigurationInterface.prototype.trialEnabled;
4150 /** @type {?} */
4151 TrialConfigurationInterface.prototype.trialDuration;
4152 }
4153
4154 /**
4155 * @fileoverview added by tsickle
4156 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4157 */
4158 var AddonDetailsComponent = /** @class */ (function () {
4159 function AddonDetailsComponent() {
4160 this.hasVerifiedContract = false;
4161 this.loaded = true;
4162 this.showPricing = true;
4163 this.showEnableAddon = false;
4164 this.actionEnabled = false;
4165 this.prerequisiteSelected = new core.EventEmitter();
4166 this.actionSelected = new core.EventEmitter();
4167 }
4168 /**
4169 * @return {?}
4170 */
4171 AddonDetailsComponent.prototype.onPrerequisiteSelected = /**
4172 * @return {?}
4173 */
4174 function () {
4175 this.prerequisiteSelected.emit();
4176 };
4177 /**
4178 * @return {?}
4179 */
4180 AddonDetailsComponent.prototype.onActionSelected = /**
4181 * @return {?}
4182 */
4183 function () {
4184 this.actionSelected.emit();
4185 };
4186 /**
4187 * @param {?} product
4188 * @param {?} addon
4189 * @return {?}
4190 */
4191 AddonDetailsComponent.prototype.getPricing = /**
4192 * @param {?} product
4193 * @param {?} addon
4194 * @return {?}
4195 */
4196 function (product, addon) {
4197 return {
4198 currency: product.currency,
4199 prices: [
4200 {
4201 price: addon.price,
4202 frequency: addon.billingFrequency ? addon.billingFrequency : 'Monthly'
4203 }
4204 ]
4205 };
4206 };
4207 Object.defineProperty(AddonDetailsComponent.prototype, "pricingLabel", {
4208 get: /**
4209 * @return {?}
4210 */
4211 function () {
4212 return this.reseller ? 'Wholesale Pricing' : 'Pricing';
4213 },
4214 enumerable: true,
4215 configurable: true
4216 });
4217 AddonDetailsComponent.decorators = [
4218 { type: core.Component, args: [{
4219 selector: 'addon-details',
4220 template: "<div class=\"addon-page\">\n <va-header-container [iconUrl]=\"addon.icon\"\n [title]=\"addon.title\"\n [tagline]=\"addon.tagline\"\n [chipLabels]=\"product.getLmiCategoryNames()\"\n [pricing]=\"getPricing(product, addon)\"\n [pricingLabel]=\"pricingLabel\"\n [prerequisiteLabel]=\"product.name\"\n [billedProduct]=\"billedProduct\"\n [hasVerifiedContract]=\"hasVerifiedContract\"\n [loaded]=\"loaded\"\n [showPricing]=\"showPricing\"\n [actionLabel]=\"'Enable Add-on'\"\n [showEnableAddon]=\"showEnableAddon\"\n (actionSelected)=\"onActionSelected()\"\n (prerequisiteSelected)=\"onPrerequisiteSelected()\">\n </va-header-container>\n\n <div class=\"addon-details addon-content\">\n <ng-container *ngIf=\"reseller\">\n <div class=\"left-column\">\n <div *ngIf=\"addon.resellerMarketing?.description || addon.resellerMarketing?.keySellingPoints\">\n <va-selling-info [description]=\"addon.resellerMarketing?.description\"\n [keySellingPoints]=\"addon.resellerMarketing?.keySellingPoints\"></va-selling-info>\n </div>\n <section *ngIf=\"addon.resellerMarketing?.faqs?.length > 0 && addon.resellerMarketing?.faqs[0].question\">\n <h2 class=\"va-addon-title\">FAQs</h2>\n <va-faqs [faqs]=\"addon.resellerMarketing?.faqs\"></va-faqs>\n </section>\n </div>\n <div class=\"right-column\">\n <section *ngIf=\"addon.restrictions?.country?.whitelist\">\n <supported-countries [countryCodes]=\"addon.restrictions.country.whitelist\"></supported-countries>\n </section>\n <section *ngIf=\"addon.screenshots?.length > 0\">\n <h2 class=\"va-addon-title\">Gallery</h2>\n <va-image-gallery [imageUrls]=\"addon.screenshots\"></va-image-gallery>\n </section>\n <section *ngIf=\"addon.resellerMarketing?.files?.length > 0\">\n <h2 class=\"va-addon-title\">Files</h2>\n <va-files [files]=\"addon.resellerMarketingFiles\"></va-files>\n </section>\n </div>\n </ng-container>\n\n <ng-container *ngIf=\"!reseller\">\n <div class=\"left-column\">\n <div *ngIf=\"addon.endUserMarketing?.description || addon.endUserMarketing?.keySellingPoints\">\n <va-selling-info [description]=\"addon.endUserMarketing?.description\"\n [keySellingPoints]=\"addon.endUserMarketing?.keySellingPoints\"></va-selling-info>\n </div>\n <section *ngIf=\"addon.endUserMarketing?.faqs?.length > 0 && addon.endUserMarketing?.faqs[0].question\">\n <h2 class=\"va-addon-title\">FAQs</h2>\n <va-faqs [faqs]=\"addon.endUserMarketing?.faqs\"></va-faqs>\n </section>\n </div>\n\n <div class=\"right-column\">\n <section *ngIf=\"addon.restrictions?.country?.whitelist?.length > 0\">\n <supported-countries [countryCodes]=\"addon.restrictions.country.whitelist\"></supported-countries>\n </section>\n <section *ngIf=\"addon.screenshots?.length > 0\">\n <h2 class=\"va-addon-title\">Gallery</h2>\n <va-image-gallery [imageUrls]=\"addon.screenshots\"></va-image-gallery>\n </section>\n <section *ngIf=\"addon.endUserMarketing?.files?.length > 0\">\n <h2 class=\"va-addon-title\">Files</h2>\n <va-files [files]=\"addon.endUserMarketingFiles\"></va-files>\n </section>\n </div>\n </ng-container>\n </div>\n\n</div>\n",
4221 styles: [":host{display:block;font-size:14px;line-height:1.4}:host *{box-sizing:border-box}.va-addon-title{font-size:32px;font-weight:300;margin-top:0;color:#212121}@media screen and (min-width:600px){.va-addon-title{font-size:32px}}img{max-width:100%}va-icon{display:inline-block}.addon-page{position:relative;margin:0 auto 20px;background:#fff;box-shadow:0 3px 10px rgba(33,33,33,.3);overflow:hidden;font-size:16px;color:#212121}.addon-page .item-amount{color:#999;font-size:14px;text-align:right;margin:0 24px 8px}section{padding:24px}.left-column{width:66%}@media screen and (max-width:600px){.left-column{width:100%}}.right-column{width:34%}.addon-content{display:-webkit-box;display:flex}@media screen and (max-width:600px){.right-column{width:100%}.addon-content{-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}}"]
4222 }] }
4223 ];
4224 AddonDetailsComponent.propDecorators = {
4225 product: [{ type: core.Input }],
4226 addon: [{ type: core.Input }],
4227 reseller: [{ type: core.Input }],
4228 billedProduct: [{ type: core.Input }],
4229 hasVerifiedContract: [{ type: core.Input }],
4230 loaded: [{ type: core.Input }],
4231 showPricing: [{ type: core.Input }],
4232 showEnableAddon: [{ type: core.Input }],
4233 actionEnabled: [{ type: core.Input }],
4234 prerequisiteSelected: [{ type: core.Output }],
4235 actionSelected: [{ type: core.Output }]
4236 };
4237 return AddonDetailsComponent;
4238 }());
4239 if (false) {
4240 /** @type {?} */
4241 AddonDetailsComponent.prototype.product;
4242 /** @type {?} */
4243 AddonDetailsComponent.prototype.addon;
4244 /** @type {?} */
4245 AddonDetailsComponent.prototype.reseller;
4246 /** @type {?} */
4247 AddonDetailsComponent.prototype.billedProduct;
4248 /** @type {?} */
4249 AddonDetailsComponent.prototype.hasVerifiedContract;
4250 /** @type {?} */
4251 AddonDetailsComponent.prototype.loaded;
4252 /** @type {?} */
4253 AddonDetailsComponent.prototype.showPricing;
4254 /** @type {?} */
4255 AddonDetailsComponent.prototype.showEnableAddon;
4256 /** @type {?} */
4257 AddonDetailsComponent.prototype.actionEnabled;
4258 /** @type {?} */
4259 AddonDetailsComponent.prototype.prerequisiteSelected;
4260 /** @type {?} */
4261 AddonDetailsComponent.prototype.actionSelected;
4262 }
4263
4264 /**
4265 * @fileoverview added by tsickle
4266 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4267 */
4268 var VaFilesComponent = /** @class */ (function () {
4269 function VaFilesComponent() {
4270 }
4271 VaFilesComponent.decorators = [
4272 { type: core.Component, args: [{
4273 selector: 'va-files',
4274 template: "\n <div class=\"va-files file-list-container\" *ngFor=\"let file of files\">\n <mat-icon class=\"file-icon\">insert_drive_file</mat-icon>\n <a [href]=\"file.url\" target=\"_blank\">{{ file.name }}</a>\n </div>",
4275 styles: [".va-files{display:-webkit-inline-box;display:inline-flex;margin-bottom:16px}.va-files a{color:#212121;font-size:16px;font-weight:700;-ms-grid-row-align:center;align-self:center;padding-left:8px;text-decoration:none}.va-files .file-icon{vertical-align:middle}.va-files .file-list-container{display:-webkit-box;display:flex}"]
4276 }] }
4277 ];
4278 VaFilesComponent.propDecorators = {
4279 files: [{ type: core.Input }]
4280 };
4281 return VaFilesComponent;
4282 }());
4283 if (false) {
4284 /** @type {?} */
4285 VaFilesComponent.prototype.files;
4286 }
4287
4288 /**
4289 * @fileoverview added by tsickle
4290 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4291 */
4292 var VaFilesModule = /** @class */ (function () {
4293 function VaFilesModule() {
4294 }
4295 VaFilesModule.decorators = [
4296 { type: core.NgModule, args: [{
4297 imports: [
4298 common.CommonModule,
4299 material.MatIconModule
4300 ],
4301 declarations: [VaFilesComponent],
4302 exports: [VaFilesComponent]
4303 },] }
4304 ];
4305 return VaFilesModule;
4306 }());
4307
4308 /**
4309 * @fileoverview added by tsickle
4310 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4311 */
4312 var VaFaqsComponent = /** @class */ (function () {
4313 function VaFaqsComponent() {
4314 this.openFaqs = [];
4315 }
4316 /**
4317 * @param {?} index
4318 * @return {?}
4319 */
4320 VaFaqsComponent.prototype.toggleFaq = /**
4321 * @param {?} index
4322 * @return {?}
4323 */
4324 function (index) {
4325 if (this.openFaqs.indexOf(index) >= 0) {
4326 this.openFaqs.splice(this.openFaqs.indexOf(index), 1); // Remove
4327 }
4328 else {
4329 this.openFaqs.push(index); // Insert
4330 }
4331 };
4332 /**
4333 * @param {?} index
4334 * @return {?}
4335 */
4336 VaFaqsComponent.prototype.isFaqOpen = /**
4337 * @param {?} index
4338 * @return {?}
4339 */
4340 function (index) {
4341 return this.openFaqs.indexOf(index) >= 0;
4342 };
4343 /**
4344 * @param {?} index
4345 * @return {?}
4346 */
4347 VaFaqsComponent.prototype.faqIcon = /**
4348 * @param {?} index
4349 * @return {?}
4350 */
4351 function (index) {
4352 return this.isFaqOpen(index) ? 'keyboard_arrow_up' : 'keyboard_arrow_down';
4353 };
4354 VaFaqsComponent.decorators = [
4355 { type: core.Component, args: [{
4356 selector: 'va-faqs',
4357 template: "\n <div class=\"va-faq\" *ngFor=\"let faq of faqs; let i = index;\">\n <div class=\"question\" (click)=\"toggleFaq(i)\">\n <span>{{ faq.question }}</span>\n <mat-icon>{{ faqIcon(i) }}</mat-icon>\n </div>\n <span class=\"answer\" [ngClass]=\"{'show': isFaqOpen(i) }\" [innerHtml]=\"faq.answer | vaSanitize\"></span>\n </div>",
4358 styles: [".va-faq{font-size:16px;display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;-webkit-box-pack:start;justify-content:flex-start;padding:12px 0;border-bottom:1px solid #e0e0e0}.va-faq:first-of-type{border-top:1px solid #e0e0e0}.va-faq .question{display:-webkit-box;display:flex;-webkit-box-pack:justify;justify-content:space-between;-webkit-box-align:center;align-items:center;color:#212121;cursor:pointer}.va-faq .answer{color:#616161;height:0;overflow:hidden}.va-faq .show{padding-top:12px;height:inherit}"]
4359 }] }
4360 ];
4361 VaFaqsComponent.propDecorators = {
4362 faqs: [{ type: core.Input }]
4363 };
4364 return VaFaqsComponent;
4365 }());
4366 if (false) {
4367 /** @type {?} */
4368 VaFaqsComponent.prototype.faqs;
4369 /** @type {?} */
4370 VaFaqsComponent.prototype.openFaqs;
4371 }
4372
4373 /**
4374 * @fileoverview added by tsickle
4375 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4376 */
4377 var VaFaqsModule = /** @class */ (function () {
4378 function VaFaqsModule() {
4379 }
4380 VaFaqsModule.decorators = [
4381 { type: core.NgModule, args: [{
4382 imports: [common.CommonModule, material.MatIconModule, uikit.VaSafeHtmlModule],
4383 declarations: [VaFaqsComponent],
4384 exports: [VaFaqsComponent]
4385 },] }
4386 ];
4387 return VaFaqsModule;
4388 }());
4389
4390 /**
4391 * @fileoverview added by tsickle
4392 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4393 */
4394 var VaSellingInfoComponent = /** @class */ (function () {
4395 function VaSellingInfoComponent() {
4396 }
4397 Object.defineProperty(VaSellingInfoComponent.prototype, "filterDescription", {
4398 get: /**
4399 * @return {?}
4400 */
4401 function () {
4402 /** @type {?} */
4403 var desc = this.description.replace(/max-width:\d*[^\"]/i, 'max-width:100%');
4404 if ((desc.indexOf('"max-width:100%"') === -1) && (desc.indexOf('<iframe ') !== -1)) {
4405 /** @type {?} */
4406 var index = desc.indexOf('<iframe ') + 7;
4407 return desc.substr(0, index) + ' style="max-width:100%"' + desc.substr(index);
4408 }
4409 return String(desc);
4410 },
4411 enumerable: true,
4412 configurable: true
4413 });
4414 VaSellingInfoComponent.decorators = [
4415 { type: core.Component, args: [{
4416 selector: 'va-selling-info',
4417 template: "\n <section *ngIf=\"description\" class=\"resize\" [innerHtml]=\"filterDescription | vaSafeHtml\"></section>\n <section *ngIf=\"keySellingPoints && keySellingPoints.length > 0\" class=\"key-selling-points\">\n <div *ngFor=\"let ksp of keySellingPoints\" class=\"key-selling-point\">\n <mat-icon>check_circle</mat-icon>\n {{ ksp }}\n </div>\n </section>\n ",
4418 styles: ["section{padding:24px}section ::ng-deep>:first-child{margin-top:0;padding-top:0}#description *{max-width:100%!important}.key-selling-point{display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center;padding-bottom:24px;font-size:16px}@media screen and (max-width:600px){.resize{font-size:16px}.key-selling-point{-webkit-box-align:start;align-items:flex-start}}.key-selling-point:last-of-type{padding-bottom:0}.key-selling-point mat-icon{color:#4caf50;font-size:32px;width:32px;height:32px;margin-right:20px}"]
4419 }] }
4420 ];
4421 VaSellingInfoComponent.propDecorators = {
4422 description: [{ type: core.Input }],
4423 keySellingPoints: [{ type: core.Input }]
4424 };
4425 return VaSellingInfoComponent;
4426 }());
4427 if (false) {
4428 /** @type {?} */
4429 VaSellingInfoComponent.prototype.description;
4430 /** @type {?} */
4431 VaSellingInfoComponent.prototype.keySellingPoints;
4432 }
4433
4434 /**
4435 * @fileoverview added by tsickle
4436 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4437 */
4438 var VaSellingInfoModule = /** @class */ (function () {
4439 function VaSellingInfoModule() {
4440 }
4441 VaSellingInfoModule.decorators = [
4442 { type: core.NgModule, args: [{
4443 imports: [common.CommonModule, material.MatIconModule, uikit.VaSafeHtmlModule],
4444 declarations: [VaSellingInfoComponent],
4445 exports: [VaSellingInfoComponent]
4446 },] }
4447 ];
4448 return VaSellingInfoModule;
4449 }());
4450
4451 /**
4452 * @fileoverview added by tsickle
4453 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4454 */
4455 var SupportedCountriesComponent = /** @class */ (function () {
4456 function SupportedCountriesComponent() {
4457 }
4458 SupportedCountriesComponent.decorators = [
4459 { type: core.Component, args: [{
4460 selector: 'supported-countries',
4461 template: "\n <span class=\"supported-text\"> Supported Countries: </span>\n <div class=\"flags\">\n <span *ngFor=\"let countryCode of countryCodes\" matTooltip=\"{{countryCode}}\" matTooltipPosition=\"below\"\n class=\"flag-icon flag-icon-{{countryCode.toLowerCase()}}\">\n </span>\n </div>\n ",
4462 styles: [".flag-icon{margin-right:10px}.supported-text{margin-right:3px}.flags{display:inline-block}"]
4463 }] }
4464 ];
4465 SupportedCountriesComponent.propDecorators = {
4466 countryCodes: [{ type: core.Input }]
4467 };
4468 return SupportedCountriesComponent;
4469 }());
4470 if (false) {
4471 /** @type {?} */
4472 SupportedCountriesComponent.prototype.countryCodes;
4473 }
4474
4475 /**
4476 * @fileoverview added by tsickle
4477 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4478 */
4479 var RestrictionsModule = /** @class */ (function () {
4480 function RestrictionsModule() {
4481 }
4482 RestrictionsModule.decorators = [
4483 { type: core.NgModule, args: [{
4484 imports: [common.CommonModule, material.MatTooltipModule],
4485 declarations: [SupportedCountriesComponent],
4486 exports: [SupportedCountriesComponent]
4487 },] }
4488 ];
4489 return RestrictionsModule;
4490 }());
4491
4492 /**
4493 * @fileoverview added by tsickle
4494 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4495 */
4496 var AddonModule = /** @class */ (function () {
4497 function AddonModule() {
4498 }
4499 AddonModule.decorators = [
4500 { type: core.NgModule, args: [{
4501 imports: [
4502 common.CommonModule,
4503 uikit.VaListModule,
4504 uikit.VaImageGalleryModule,
4505 uikit.VaIconModule,
4506 VaPricingModule,
4507 VaFilesModule,
4508 VaFaqsModule,
4509 VaSellingInfoModule,
4510 VaHeaderContainerModule,
4511 uikit.VaSafeHtmlModule,
4512 progressSpinner.MatProgressSpinnerModule,
4513 uikit.VaBreadcrumbsModule,
4514 RestrictionsModule
4515 ],
4516 exports: [AddonDetailsComponent],
4517 declarations: [AddonDetailsComponent],
4518 providers: [],
4519 entryComponents: []
4520 },] }
4521 ];
4522 return AddonModule;
4523 }());
4524
4525 /**
4526 * @fileoverview added by tsickle
4527 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4528 */
4529 var DetailsStencilComponent = /** @class */ (function () {
4530 function DetailsStencilComponent() {
4531 }
4532 DetailsStencilComponent.decorators = [
4533 { type: core.Component, args: [{
4534 selector: 'details-stencil',
4535 template: "\n <div class=\"details\">\n\n <mat-card class=\"details-header\">\n <div class=\"details-column-0\">\n <div class=\"details-column-0-1\">\n <div class=\"details-icon stencil-shimmer\"></div>\n </div>\n <div class=\"details-column-0-2\">\n <div class=\"details-title stencil-shimmer\"></div>\n <div class=\"details-title stencil-shimmer\"></div>\n </div>\n </div>\n <div class=\"details-column-1\">\n <div class=\"details-column-1-0 stencil-shimmer\"></div>\n <div class=\"details-column-1-1 stencil-shimmer\"></div>\n </div>\n </mat-card>\n\n <mat-card>\n <div class=\"details-box-large stencil-shimmer\"></div>\n </mat-card>\n\n <mat-card class=\"details-body\">\n <div class=\"details-body-column-0\" >\n <div class=\"details-icon-small stencil-shimmer\"></div>\n <div class=\"details-icon-small stencil-shimmer\"></div>\n <div class=\"details-icon-small stencil-shimmer\"></div>\n <div class=\"details-icon-small stencil-shimmer\"></div>\n <div class=\"details-icon-small stencil-shimmer\"></div>\n <div class=\"details-icon-small stencil-shimmer\"></div>\n <div class=\"details-icon-small stencil-shimmer\"></div>\n </div>\n <div class=\"details-body-column-1\">\n <div class=\"details-line stencil-shimmer\"></div>\n <div class=\"details-line stencil-shimmer\"></div>\n <div class=\"details-line stencil-shimmer\"></div>\n <div class=\"details-line stencil-shimmer\"></div>\n <div class=\"details-line stencil-shimmer\"></div>\n <div class=\"details-line stencil-shimmer\"></div>\n <div class=\"details-line stencil-shimmer\"></div>\n </div>\n <div class=\"details-body-column-2\">\n <div class=\"details-box stencil-shimmer\"></div>\n <div class=\"details-box stencil-shimmer\"></div>\n <div class=\"details-box stencil-shimmer\"></div>\n <div class=\"details-box stencil-shimmer\"></div>\n <div class=\"details-box stencil-shimmer\"></div>\n </div>\n </mat-card>\n\n </div>\n ",
4536 styles: [".details{position:relative;margin:0 auto 20px;background:#fff;box-shadow:0 3px 10px rgba(33,33,33,.3);overflow:hidden;font-size:16px}.details-header{display:-webkit-box;display:flex;height:180px}.details-column-0{display:-webkit-box;display:flex;width:66%}@media screen and (max-width:600px){.details-column-0{width:100%}}.details-column-0-1{display:-webkit-box;display:flex;width:25%;min-width:120px}@media screen and (max-width:600px){.details-column-0-1{width:50%}}.details-icon{height:120px;width:120px;border-radius:50%}.details-title{margin:20px 0 20px 20px;height:32px;width:250px}@media screen and (max-width:600px){.details-title{width:120px}}.details-column-1{width:34%;display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}@media screen and (max-width:1100px){.details-column-1{width:0}}.details-column-1-0{height:32px;margin:10px 0}.details-column-1-1{height:70px}@media screen and (max-width:600px){.details-column-1-0{width:0;margin:0}.details-column-1-1{height:0}}.details-box-large{display:-webkit-box;display:flex;width:650px;height:150px}@media screen and (max-width:1100px){.details-box-large{width:100%}}.details-body{display:-webkit-box;display:flex;height:500px;width:100%}.details-body-column-0{width:10%;display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}@media screen and (max-width:600px){.details-body-column-0{width:0%}}.details-body-column-1{width:56%;display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}@media screen and (max-width:600px){.details-body-column-1{width:100%}}.details-icon-small{margin-bottom:24px;display:-webkit-box;display:flex;height:32px;width:32px;border-radius:50%}.details-line{margin-bottom:24px;height:32px;width:400px}@media screen and (max-width:600px){.details-line{width:100%;margin-right:10px}}.details-body-column-2{width:34%;display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}@media screen and (max-width:1100px){.details-body-column-2{width:0}}.details-box{height:70px;margin-bottom:10px}@media screen and (max-width:600px){.details-box{width:0;margin:0}}"]
4537 }] }
4538 ];
4539 return DetailsStencilComponent;
4540 }());
4541
4542 /**
4543 * @fileoverview added by tsickle
4544 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4545 */
4546 var CardStencilComponent = /** @class */ (function () {
4547 function CardStencilComponent() {
4548 }
4549 CardStencilComponent.decorators = [
4550 { type: core.Component, args: [{
4551 selector: 'card-stencil',
4552 template: "\n <div class=\"card-stencil-container\">\n <mat-card class=\"card-stencil\">\n <div class=\"card-stencil-header stencil-shimmer\"></div>\n <div class=\"card-stencil-footer\">\n <div class=\"card-stencil-circle stencil-shimmer\"></div>\n <div>\n <div class=\"card-stencil-line-large stencil-shimmer\"></div>\n <div class=\"card-stencil-line-medium stencil-shimmer\"></div>\n </div>\n </div>\n </mat-card>\n </div>\n ",
4553 styles: [".card-stencil-container{position:relative;width:100%;padding-bottom:100%;margin-bottom:-45%}.card-stencil{position:absolute;width:100%;height:55%;padding:0;margin-bottom:0}.card-stencil-header{display:-webkit-box;display:flex;height:60%}.card-stencil-footer{display:-webkit-box;display:flex;height:40%;-webkit-box-align:center;align-items:center}.card-stencil-circle{margin:0 16px;height:60px;width:60px;border-radius:50%}@media screen and (max-width:650px){.card-stencil-circle{width:45px;height:45px}}.card-stencil-line-large{height:20px;width:200px;margin-bottom:10px}@media screen and (max-width:650px){.card-stencil-line-large{width:100px;height:10px}}.card-stencil-line-medium{height:20px;width:160px}@media screen and (max-width:650px){.card-stencil-line-medium{width:80px;height:10px}}"]
4554 }] }
4555 ];
4556 return CardStencilComponent;
4557 }());
4558
4559 /**
4560 * @fileoverview added by tsickle
4561 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4562 */
4563 var CardListStencilComponent = /** @class */ (function () {
4564 function CardListStencilComponent() {
4565 this.numCards = 3;
4566 this.cards = [];
4567 }
4568 /**
4569 * @return {?}
4570 */
4571 CardListStencilComponent.prototype.ngOnInit = /**
4572 * @return {?}
4573 */
4574 function () {
4575 for (var n = 0; n < this.numCards; n++) {
4576 this.cards.push(n);
4577 }
4578 };
4579 CardListStencilComponent.decorators = [
4580 { type: core.Component, args: [{
4581 selector: 'card-stencil-list',
4582 template: "\n <div class=\"row row-gutters\">\n <div *ngFor=\"let _ of cards\" class=\"col-flex\">\n <card-stencil></card-stencil>\n </div>\n </div>\n ",
4583 styles: ["\n .row {\n display: flex;\n flex-wrap: wrap;\n }\n\n .row + .row-gutters {\n margin-top: 0;\n }\n\n .row-gutters {\n margin-top: -20px;\n margin-left: -20px;\n }\n\n .row-gutters > .col-flex {\n padding-top: 20px;\n padding-left: 20px;\n }\n\n .col-flex {\n position: relative;\n max-width: 100%;\n box-sizing: border-box;\n flex: 0 0 auto;\n width: 100%;\n }\n\n @media screen and (min-width: 480px) {\n .col-flex {\n width: 50%;\n }\n }\n\n @media screen and (min-width: 1200px) {\n\n .col-flex {\n width: 33.333333%;\n }\n }\n\n "]
4584 }] }
4585 ];
4586 CardListStencilComponent.propDecorators = {
4587 numCards: [{ type: core.Input }]
4588 };
4589 return CardListStencilComponent;
4590 }());
4591 if (false) {
4592 /** @type {?} */
4593 CardListStencilComponent.prototype.numCards;
4594 /** @type {?} */
4595 CardListStencilComponent.prototype.cards;
4596 }
4597
4598 /**
4599 * @fileoverview added by tsickle
4600 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4601 */
4602 var SearchBarStencilComponent = /** @class */ (function () {
4603 function SearchBarStencilComponent() {
4604 }
4605 SearchBarStencilComponent.decorators = [
4606 { type: core.Component, args: [{
4607 selector: 'search-bar-stencil',
4608 template: "\n <div class=\"search-bar-stencil-container\">\n <div class=\"search-bar-stencil-line stencil-shimmer\">\n <div class=\"search-bar-stencil-icon\"></div>\n </div>\n </div>\n ",
4609 styles: ["\n .search-bar-stencil-container {\n height: 52px;\n display: flex;\n align-content: center;\n background-color: white;\n border-radius: 2px;\n }\n .search-bar-stencil-line {\n height: 30px;\n width: 350px;\n margin: auto 10px;\n display: flex;\n justify-content: flex-end;\n }\n .search-bar-stencil-icon {\n background-color: white;\n width: 20px;\n height: 20px;\n margin: auto 5px;\n }\n "]
4610 }] }
4611 ];
4612 return SearchBarStencilComponent;
4613 }());
4614
4615 /**
4616 * @fileoverview added by tsickle
4617 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4618 */
4619 var ListStencilComponent = /** @class */ (function () {
4620 function ListStencilComponent() {
4621 this.showHeader = true;
4622 this.numRows = 3;
4623 this.rowHeight = '51px'; // defaults to height of partner center business tab height (95px for marketplace)
4624 // defaults to height of partner center business tab height (95px for marketplace)
4625 this.sidePadding = '17px'; // defaults to padding on partner center business padding (38px for marketplace)
4626 // defaults to padding on partner center business padding (38px for marketplace)
4627 this.rows = []; // this is to turn the number of rows into an arbitrary list so we can loop through them
4628 }
4629 /**
4630 * @return {?}
4631 */
4632 ListStencilComponent.prototype.ngOnInit = /**
4633 * @return {?}
4634 */
4635 function () {
4636 for (var n = 0; n < this.numRows; n++) {
4637 this.rows.push(n);
4638 }
4639 // if you think this is gross i agree
4640 // if you think this is gross and actually have a solution hit me up otherwise just enjoy the magic.
4641 // determine the height of each row for the table
4642 this.listItemRowStyles = {
4643 'height': "" + this.rowHeight,
4644 'padding': "0 " + this.sidePadding
4645 };
4646 };
4647 ListStencilComponent.decorators = [
4648 { type: core.Component, args: [{
4649 selector: 'list-stencil',
4650 template: "\n <mat-card class=\"list-container\">\n <div *ngIf=\"showHeader\" class=\"list-header stencil-shimmer\" style=\"\"></div>\n <div *ngFor=\"let _ of rows\">\n <div class=\"list-item-row\" [ngStyle]=\"listItemRowStyles\">\n <div class=\"stencil-shimmer\" style=\"margin: 0; padding: 0; width: 100%; height: 80%;\"></div>\n </div>\n </div>\n </mat-card>\n ",
4651 styles: ["\n .list-container { padding: 0; }\n .list-header { height: 40px; }\n .list-item-row { height: 50px; display: flex; justify-content: space-between; align-items: center; }\n "]
4652 }] }
4653 ];
4654 ListStencilComponent.propDecorators = {
4655 showHeader: [{ type: core.Input }],
4656 numRows: [{ type: core.Input }],
4657 rowHeight: [{ type: core.Input }],
4658 sidePadding: [{ type: core.Input }]
4659 };
4660 return ListStencilComponent;
4661 }());
4662 if (false) {
4663 /** @type {?} */
4664 ListStencilComponent.prototype.showHeader;
4665 /** @type {?} */
4666 ListStencilComponent.prototype.numRows;
4667 /** @type {?} */
4668 ListStencilComponent.prototype.rowHeight;
4669 /** @type {?} */
4670 ListStencilComponent.prototype.sidePadding;
4671 /** @type {?} */
4672 ListStencilComponent.prototype.rows;
4673 /** @type {?} */
4674 ListStencilComponent.prototype.listItemRowStyles;
4675 }
4676
4677 /**
4678 * @fileoverview added by tsickle
4679 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4680 */
4681 var StencilsModule = /** @class */ (function () {
4682 function StencilsModule() {
4683 }
4684 StencilsModule.decorators = [
4685 { type: core.NgModule, args: [{
4686 imports: [common.CommonModule, material.MatCardModule, material.MatIconModule, material.MatInputModule, material.MatSelectModule, material.MatExpansionModule, material.MatCheckboxModule],
4687 declarations: [DetailsStencilComponent, CardStencilComponent, CardListStencilComponent, SearchBarStencilComponent, ListStencilComponent],
4688 exports: [DetailsStencilComponent, CardStencilComponent, CardListStencilComponent, SearchBarStencilComponent, ListStencilComponent]
4689 },] }
4690 ];
4691 return StencilsModule;
4692 }());
4693
4694 /**
4695 * @fileoverview added by tsickle
4696 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4697 */
4698 var VaAddonListComponent = /** @class */ (function () {
4699 function VaAddonListComponent(billingService, cdr) {
4700 this.billingService = billingService;
4701 this.cdr = cdr;
4702 this.showPricing = true;
4703 this._hasVerifiedContract = null;
4704 this._canAccessContractPricing = null;
4705 this.addonSelected = new core.EventEmitter();
4706 this.billedProductsMap = new Map();
4707 this.billedProductLoaded = new Map();
4708 this.subscriptions = [];
4709 }
4710 Object.defineProperty(VaAddonListComponent.prototype, "addons", {
4711 set: /**
4712 * @param {?} addons
4713 * @return {?}
4714 */
4715 function (addons) {
4716 this._addons = addons;
4717 this.populateBilledProduct();
4718 },
4719 enumerable: true,
4720 configurable: true
4721 });
4722 Object.defineProperty(VaAddonListComponent.prototype, "hasVerifiedContract", {
4723 set: /**
4724 * @param {?} value
4725 * @return {?}
4726 */
4727 function (value) {
4728 this._hasVerifiedContract = value;
4729 this.populateBilledProduct();
4730 },
4731 enumerable: true,
4732 configurable: true
4733 });
4734 Object.defineProperty(VaAddonListComponent.prototype, "canAccessContractPricing", {
4735 set: /**
4736 * @param {?} value
4737 * @return {?}
4738 */
4739 function (value) {
4740 this._canAccessContractPricing = value;
4741 this.populateBilledProduct();
4742 },
4743 enumerable: true,
4744 configurable: true
4745 });
4746 /**
4747 * @return {?}
4748 */
4749 VaAddonListComponent.prototype.ngOnInit = /**
4750 * @return {?}
4751 */
4752 function () {
4753 this.populateBilledProduct();
4754 };
4755 /**
4756 * @return {?}
4757 */
4758 VaAddonListComponent.prototype.populateBilledProduct = /**
4759 * @return {?}
4760 */
4761 function () {
4762 var _this = this;
4763 if (this.displayContractPricing()) {
4764 /** @type {?} */
4765 var billingIDs = this._addons.map((/**
4766 * @param {?} a
4767 * @return {?}
4768 */
4769 function (a) {
4770 _this.billedProductsMap.set(a.addonId, null);
4771 _this.billedProductLoaded.set(a.addonId, false);
4772 return a.billingId;
4773 }));
4774 this.subscriptions.push(this.billingService.getMultiProductPricing(this.partnerID, billingIDs).subscribe((/**
4775 * @param {?} pricing
4776 * @return {?}
4777 */
4778 function (pricing) {
4779 _this._addons.forEach((/**
4780 * @param {?} addon
4781 * @return {?}
4782 */
4783 function (addon) {
4784 /** @type {?} */
4785 var addonPricing = pricing[addon.billingId];
4786 if (!addonPricing) {
4787 return;
4788 }
4789 /** @type {?} */
4790 var billedProduct = billing.buildBilledProductFromProductPricingAndAddon(addon, addonPricing);
4791 _this.billedProductsMap.set(addon.addonId, billedProduct);
4792 _this.billedProductLoaded.set(addon.addonId, true);
4793 }));
4794 _this.cdr.detectChanges();
4795 })));
4796 }
4797 };
4798 /**
4799 * @param {?} addonId
4800 * @return {?}
4801 */
4802 VaAddonListComponent.prototype.onClick = /**
4803 * @param {?} addonId
4804 * @return {?}
4805 */
4806 function (addonId) {
4807 this.addonSelected.emit(addonId);
4808 };
4809 /**
4810 * @param {?} object
4811 * @return {?}
4812 */
4813 VaAddonListComponent.prototype.instanceOfPricing = /**
4814 * @param {?} object
4815 * @return {?}
4816 */
4817 function (object) {
4818 if (typeof object === 'number') {
4819 return false;
4820 }
4821 return object.currency !== undefined && object.prices !== undefined;
4822 };
4823 /**
4824 * @param {?} addon
4825 * @return {?}
4826 */
4827 VaAddonListComponent.prototype.getDisplayPricing = /**
4828 * @param {?} addon
4829 * @return {?}
4830 */
4831 function (addon) {
4832 /** @type {?} */
4833 var price = addon.price;
4834 if (price && this.instanceOfPricing(price)) {
4835 return price;
4836 }
4837 return {
4838 currency: addon.currency,
4839 prices: [
4840 {
4841 price: addon.price,
4842 frequency: addon.billingFrequency ? addon.billingFrequency : 'Monthly'
4843 }
4844 ]
4845 };
4846 };
4847 /**
4848 * @return {?}
4849 */
4850 VaAddonListComponent.prototype.noData = /**
4851 * @return {?}
4852 */
4853 function () {
4854 return util.isNullOrUndefined(this._hasVerifiedContract) || util.isNullOrUndefined(this._canAccessContractPricing);
4855 };
4856 /**
4857 * @return {?}
4858 */
4859 VaAddonListComponent.prototype.displayContractPricing = /**
4860 * @return {?}
4861 */
4862 function () {
4863 return this._canAccessContractPricing && this._hasVerifiedContract;
4864 };
4865 /**
4866 * @param {?} addon
4867 * @return {?}
4868 */
4869 VaAddonListComponent.prototype.isBilledProductLoaded = /**
4870 * @param {?} addon
4871 * @return {?}
4872 */
4873 function (addon) {
4874 if (this.noData()) {
4875 return false;
4876 }
4877 if (this.displayContractPricing()) {
4878 /** @type {?} */
4879 var value = this.billedProductLoaded.get(addon.addonId);
4880 return value ? value : false;
4881 }
4882 return true;
4883 };
4884 /**
4885 * @return {?}
4886 */
4887 VaAddonListComponent.prototype.ngOnDestroy = /**
4888 * @return {?}
4889 */
4890 function () {
4891 this.subscriptions.forEach((/**
4892 * @param {?} subscription
4893 * @return {?}
4894 */
4895 function (subscription) { return subscription.unsubscribe(); }));
4896 };
4897 VaAddonListComponent.decorators = [
4898 { type: core.Component, args: [{
4899 selector: 'va-addon-list',
4900 template: "<mat-list *ngIf=\"_addons\" class=\"addon-list\">\n <mat-divider></mat-divider>\n <ng-container *ngFor=\"let addon of _addons\">\n <mat-list-item (click)=\"onClick(addon.addonId)\">\n <div class=\"addon-icon-title\">\n <img *ngIf=\"addon.icon;else noIcon\" class=\"addon-icon\" [src]=\"addon.icon\" mat-list-avatar/>\n <ng-template #noIcon>\n <mat-icon class=\"addon-default-icon\" mat-list-icon>add_circle</mat-icon>\n </ng-template>\n <div class=\"addon-title-tagline\">\n <p class=\"addon-title\" matLine>{{ addon.title }} </p>\n <p class=\"addon-tagline\" matLine>{{ addon.tagline }}</p>\n </div>\n </div>\n <div *ngIf=\"showPricing\" class=\"price-section\">\n <va-pricing\n [pricing]=\"getDisplayPricing(addon)\"\n [highlightPrice]=\"false\"\n [hasVerifiedContract]=\"_hasVerifiedContract\"\n [billedProduct]=\"billedProductsMap.get(addon.addonId)\"\n [loaded]=\"isBilledProductLoaded(addon)\">\n </va-pricing>\n </div>\n </mat-list-item>\n <mat-divider></mat-divider>\n </ng-container>\n</mat-list>\n",
4901 styles: [":host{display:block}h2+:host{margin:-8px 0}:host ::ng-deep .mat-list-item.mat-2-line{height:auto!important}:host ::ng-deep .mat-list .mat-list-item .mat-list-item-content{padding:8px;-webkit-box-align:start;align-items:flex-start;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}@media screen and (min-width:800px){:host ::ng-deep .mat-list .mat-list-item .mat-list-item-content{-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row}}.addon-list{position:relative}.addon-default-icon{margin:0 5px;color:#4caf50}.addon-icon{width:32px;height:32px}.addon-icon-title{-webkit-box-flex:1;flex-grow:1;display:-webkit-box;display:flex;width:100%}@media screen and (min-width:800px){.addon-icon-title{width:auto}}.addon-title-tagline{padding:0 16px 10px 8px;-webkit-box-flex:1;flex-grow:1}.addon-title-tagline .addon-title{color:#212121;font-size:16px;line-height:1.2;margin:6px 0;white-space:normal}.addon-title-tagline .addon-tagline{color:#616161;font-size:14px;margin:0;white-space:normal}.price-section{min-width:10em;margin-top:6px;flex-shrink:0}mat-list-item:hover{background-color:#fafafa!important;cursor:pointer!important}"]
4902 }] }
4903 ];
4904 /** @nocollapse */
4905 VaAddonListComponent.ctorParameters = function () { return [
4906 { type: billing.BillingService },
4907 { type: core.ChangeDetectorRef }
4908 ]; };
4909 VaAddonListComponent.propDecorators = {
4910 addons: [{ type: core.Input, args: ['addons',] }],
4911 showPricing: [{ type: core.Input }],
4912 partnerID: [{ type: core.Input }],
4913 hasVerifiedContract: [{ type: core.Input, args: ['hasVerifiedContract',] }],
4914 canAccessContractPricing: [{ type: core.Input, args: ['canAccessContractPricing',] }],
4915 addonSelected: [{ type: core.Output }]
4916 };
4917 return VaAddonListComponent;
4918 }());
4919 if (false) {
4920 /** @type {?} */
4921 VaAddonListComponent.prototype._addons;
4922 /** @type {?} */
4923 VaAddonListComponent.prototype.showPricing;
4924 /** @type {?} */
4925 VaAddonListComponent.prototype.partnerID;
4926 /** @type {?} */
4927 VaAddonListComponent.prototype._hasVerifiedContract;
4928 /** @type {?} */
4929 VaAddonListComponent.prototype._canAccessContractPricing;
4930 /** @type {?} */
4931 VaAddonListComponent.prototype.addonSelected;
4932 /** @type {?} */
4933 VaAddonListComponent.prototype.billedProductsMap;
4934 /**
4935 * @type {?}
4936 * @private
4937 */
4938 VaAddonListComponent.prototype.billedProductLoaded;
4939 /**
4940 * @type {?}
4941 * @private
4942 */
4943 VaAddonListComponent.prototype.subscriptions;
4944 /**
4945 * @type {?}
4946 * @private
4947 */
4948 VaAddonListComponent.prototype.billingService;
4949 /**
4950 * @type {?}
4951 * @private
4952 */
4953 VaAddonListComponent.prototype.cdr;
4954 }
4955
4956 /**
4957 * @fileoverview added by tsickle
4958 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4959 */
4960 var VaAddonListModule = /** @class */ (function () {
4961 function VaAddonListModule() {
4962 }
4963 VaAddonListModule.decorators = [
4964 { type: core.NgModule, args: [{
4965 imports: [
4966 billing.BillingModule,
4967 common.CommonModule,
4968 material.MatIconModule,
4969 material.MatListModule,
4970 material.MatDividerModule,
4971 VaPricingModule
4972 ],
4973 declarations: [VaAddonListComponent],
4974 exports: [VaAddonListComponent]
4975 },] }
4976 ];
4977 return VaAddonListModule;
4978 }());
4979
4980 /**
4981 * @fileoverview added by tsickle
4982 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
4983 */
4984 /**
4985 * @record
4986 */
4987 function HeimdallServiceTokenInterface() { }
4988 if (false) {
4989 /**
4990 * @param {?} category
4991 * @param {?} action
4992 * @param {?} label
4993 * @param {?=} value
4994 * @param {?=} dimensions
4995 * @return {?}
4996 */
4997 HeimdallServiceTokenInterface.prototype.track = function (category, action, label, value, dimensions) { };
4998 }
4999 /** @type {?} */
5000 var HeimdallServiceToken = new core.InjectionToken('HeimdallService');
5001 var HeimdallClient = /** @class */ (function () {
5002 function HeimdallClient(userEvents) {
5003 this.userEvents = userEvents;
5004 }
5005 /**
5006 * @param {?} category
5007 * @param {?} action
5008 * @param {?} label
5009 * @param {?=} value
5010 * @param {?=} dimensions
5011 * @return {?}
5012 */
5013 HeimdallClient.prototype.track = /**
5014 * @param {?} category
5015 * @param {?} action
5016 * @param {?} label
5017 * @param {?=} value
5018 * @param {?=} dimensions
5019 * @return {?}
5020 */
5021 function (category, action, label, value, dimensions) {
5022 this.userEvents.track(category, action, label, value, dimensions);
5023 };
5024 HeimdallClient.decorators = [
5025 { type: core.Injectable }
5026 ];
5027 /** @nocollapse */
5028 HeimdallClient.ctorParameters = function () { return [
5029 { type: undefined, decorators: [{ type: core.Inject, args: [HeimdallServiceToken,] }] }
5030 ]; };
5031 return HeimdallClient;
5032 }());
5033 if (false) {
5034 /**
5035 * @type {?}
5036 * @private
5037 */
5038 HeimdallClient.prototype.userEvents;
5039 }
5040 var HeimdallClientModule = /** @class */ (function () {
5041 function HeimdallClientModule() {
5042 }
5043 HeimdallClientModule.decorators = [
5044 { type: core.NgModule, args: [{
5045 providers: [HeimdallClient]
5046 },] }
5047 ];
5048 return HeimdallClientModule;
5049 }());
5050
5051 /**
5052 * @fileoverview added by tsickle
5053 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
5054 */
5055 /** @type {?} */
5056 var STOREFRONT_FILTER_NAME = 'Store Filters';
5057 /**
5058 * @record
5059 */
5060 function StorefrontCategory() { }
5061 if (false) {
5062 /** @type {?} */
5063 StorefrontCategory.prototype.id;
5064 /** @type {?} */
5065 StorefrontCategory.prototype.name;
5066 /** @type {?} */
5067 StorefrontCategory.prototype.packageIds;
5068 }
5069 var StorefrontComponent = /** @class */ (function () {
5070 function StorefrontComponent(userEvents, filterService, translateService) {
5071 this.userEvents = userEvents;
5072 this.filterService = filterService;
5073 this.translateService = translateService;
5074 this.useCustomCase = false;
5075 this.categorySelected = new core.EventEmitter();
5076 this.packageIdSelected = new core.EventEmitter();
5077 this.getDataForCategory = new core.EventEmitter();
5078 this.categories$$ = new rxjs.BehaviorSubject([]);
5079 this.packagesMap$$ = new rxjs.BehaviorSubject(new Map());
5080 this.searchTerm$$ = new rxjs.BehaviorSubject('');
5081 this.selectedCateoryId$$ = new rxjs.BehaviorSubject('');
5082 if (!this.translateService.translations.hasOwnProperty('en')) {
5083 this.translateService.reloadLang('en');
5084 }
5085 if (!this.translateService.translations.hasOwnProperty('cs')) {
5086 this.translateService.reloadLang('cs');
5087 }
5088 this.translateService.setTranslation('en', En.en, true);
5089 this.translateService.setTranslation('cs', Cs.cs, true);
5090 }
5091 Object.defineProperty(StorefrontComponent.prototype, "categories", {
5092 set: /**
5093 * @param {?} value
5094 * @return {?}
5095 */
5096 function (value) {
5097 this.categories$$.next(value || []);
5098 },
5099 enumerable: true,
5100 configurable: true
5101 });
5102 Object.defineProperty(StorefrontComponent.prototype, "categoryIdToStoreItemListMap", {
5103 set: /**
5104 * @param {?} value
5105 * @return {?}
5106 */
5107 function (value) {
5108 this.packagesMap$$.next(value || new Map());
5109 },
5110 enumerable: true,
5111 configurable: true
5112 });
5113 /**
5114 * @return {?}
5115 */
5116 StorefrontComponent.prototype.ngOnInit = /**
5117 * @return {?}
5118 */
5119 function () {
5120 var _this = this;
5121 /** @type {?} */
5122 var lmiCategoryCheckboxList = LMI_CATEGORIES.map((/**
5123 * @param {?} category
5124 * @return {?}
5125 */
5126 function (category) {
5127 return new uikit.CheckboxFilterField({
5128 name: category.name,
5129 id: category.categoryId,
5130 value: false,
5131 condition: (/**
5132 * @param {?} item
5133 * @return {?}
5134 */
5135 function (item) {
5136 /** @type {?} */
5137 var lmiCategories = [];
5138 if (item.lmiCategories) {
5139 lmiCategories = item.lmiCategories.map((/**
5140 * @param {?} cat
5141 * @return {?}
5142 */
5143 function (cat) {
5144 return marketplacePackages.Categories[cat].toLowerCase();
5145 }));
5146 }
5147 return lmiCategories.indexOf(category.categoryId) > -1;
5148 })
5149 });
5150 }));
5151 /** @type {?} */
5152 var lmiCategoryFilterSection = new uikit.FilterSection({
5153 title: 'LMI Category',
5154 type: 'or',
5155 fields: lmiCategoryCheckboxList
5156 });
5157 this.lmiCategoryFilter = new uikit.Filters(STOREFRONT_FILTER_NAME, [
5158 lmiCategoryFilterSection
5159 ]);
5160 this.filters$ = this.categories$$.pipe(operators.map((/**
5161 * @param {?} categories
5162 * @return {?}
5163 */
5164 function (categories) {
5165 /** @type {?} */
5166 var tabbedFilterField = new uikit.TabbedFilterField({
5167 name: '',
5168 value: null,
5169 id: 'categorytab',
5170 options: categories
5171 });
5172 /** @type {?} */
5173 var filters = new uikit.Filters(STOREFRONT_FILTER_NAME, [
5174 new uikit.FilterSection({
5175 title: 'Categories',
5176 type: 'or',
5177 fields: [tabbedFilterField]
5178 }),
5179 lmiCategoryFilterSection
5180 ]);
5181 return filters;
5182 })));
5183 this.filterService.setFilters(this.lmiCategoryFilter);
5184 this.searchTermSubscription = this.searchTerm$$.asObservable().pipe(operators.debounceTime(300), operators.distinctUntilChanged()).subscribe((/**
5185 * @param {?} searchTerm
5186 * @return {?}
5187 */
5188 function (searchTerm) { return _this.userEvents.track('store', 'search-input', '', 1, { 'searchTerm': searchTerm }); }));
5189 /** @type {?} */
5190 var selectedLMIFilters$ = this.filterService.filters.fieldValuesObservable.pipe(operators.startWith([]), operators.map((/**
5191 * @return {?}
5192 */
5193 function () {
5194 return _this.lmiCategoryFilter.fields.filter((/**
5195 * @param {?} item
5196 * @return {?}
5197 */
5198 function (item) { return item.value; }));
5199 })));
5200 this.showLMIFilter$ = selectedLMIFilters$.pipe(operators.filter((/**
5201 * @param {?} selectedLMIFilters
5202 * @return {?}
5203 */
5204 function (selectedLMIFilters) { return !!selectedLMIFilters; })), operators.take(1), operators.map((/**
5205 * @param {?} selectedLMIFilters
5206 * @return {?}
5207 */
5208 function (selectedLMIFilters) { return selectedLMIFilters.length > 0; })));
5209 this.filteredItems$ = rxjs.combineLatest(this.packagesMap$$, this.searchTerm$$, this.selectedCateoryId$$, selectedLMIFilters$).pipe(operators.map((/**
5210 * @param {?} __0
5211 * @return {?}
5212 */
5213 function (_a) {
5214 var _b = __read(_a, 4), packages = _b[0], searchTerm = _b[1], selectedCategoryId = _b[2], selectedLMIFilters = _b[3];
5215 /** @type {?} */
5216 var storeItems = [];
5217 if (packages.size) {
5218 storeItems = (selectedCategoryId ? packages.get(selectedCategoryId) : packages.get(Array.from(packages.keys())[0]));
5219 }
5220 storeItems = storeItems ? _this.lmiCategoryFilter.applyFilters(storeItems) : [];
5221 return searchTerm ? storeItems.filter((/**
5222 * @param {?} item
5223 * @return {?}
5224 */
5225 function (item) { return item.name.toLowerCase().indexOf(searchTerm.toLowerCase()) !== -1; })) : storeItems;
5226 })));
5227 };
5228 /**
5229 * @return {?}
5230 */
5231 StorefrontComponent.prototype.ngOnDestroy = /**
5232 * @return {?}
5233 */
5234 function () {
5235 this.searchTermSubscription.unsubscribe();
5236 };
5237 /**
5238 * @param {?} term
5239 * @return {?}
5240 */
5241 StorefrontComponent.prototype.onSearchTermChanged = /**
5242 * @param {?} term
5243 * @return {?}
5244 */
5245 function (term) {
5246 this.searchTerm$$.next(term);
5247 };
5248 /**
5249 * @param {?} filterField
5250 * @return {?}
5251 */
5252 StorefrontComponent.prototype.onFieldValueChanged = /**
5253 * @param {?} filterField
5254 * @return {?}
5255 */
5256 function (filterField) {
5257 if (!(filterField instanceof uikit.TabbedFilterField)) {
5258 return;
5259 }
5260 this.selectedCateoryId$$.next(filterField.value.id);
5261 this.categorySelected.emit((/** @type {?} */ (filterField.value)));
5262 /** @type {?} */
5263 var currentStoreItemsForSelectCategory = this.packagesMap$$.getValue().get(filterField.value.id);
5264 if (!(currentStoreItemsForSelectCategory && currentStoreItemsForSelectCategory.length)) {
5265 this.getDataForCategory.emit((/** @type {?} */ (filterField.value)));
5266 }
5267 };
5268 /**
5269 * @param {?} item
5270 * @return {?}
5271 */
5272 StorefrontComponent.prototype.storeItemClicked = /**
5273 * @param {?} item
5274 * @return {?}
5275 */
5276 function (item) {
5277 this.packageIdSelected.emit(item.id);
5278 };
5279 StorefrontComponent.decorators = [
5280 { type: core.Component, args: [{
5281 selector: 'va-storefront',
5282 template: "<va-filter-container\n [filters]=\"filters$ | async\"\n (searchTermChanged)=\"onSearchTermChanged($event)\"\n (fieldValueChanged)=\"onFieldValueChanged($event)\"\n [theme]=\"'plain'\"\n [filterIsOpen]=\"showLMIFilter$ | async\"\n [useCustomCase]=\"useCustomCase\"\n >\n <va-store\n [items]=\"filteredItems$ | async\"\n [searchable]=\"false\"\n (itemClicked)=\"storeItemClicked($event)\"\n content>\n </va-store>\n</va-filter-container>\n",
5283 styles: [".public-store-container{padding:20px}va-store{margin-top:20px;display:block}@media only screen and (device-width:375px) and (-webkit-device-pixel-ratio:2){::ng-deep va-filter-tabbed{width:280px}::ng-deep .filter-container .toolbar.toolbar{background:0 0}}@media only screen and (device-width:414px) and (-webkit-device-pixel-ratio:3){::ng-deep va-filter-tabbed{width:280px}::ng-deep .filter-container .toolbar.toolbar{background:0 0}}"]
5284 }] }
5285 ];
5286 /** @nocollapse */
5287 StorefrontComponent.ctorParameters = function () { return [
5288 { type: undefined, decorators: [{ type: core.Inject, args: [HeimdallServiceToken,] }] },
5289 { type: uikit.FilterService },
5290 { type: core$1.TranslateService }
5291 ]; };
5292 StorefrontComponent.propDecorators = {
5293 categories: [{ type: core.Input }],
5294 categoryIdToStoreItemListMap: [{ type: core.Input }],
5295 useCustomCase: [{ type: core.Input }],
5296 categorySelected: [{ type: core.Output }],
5297 packageIdSelected: [{ type: core.Output }],
5298 getDataForCategory: [{ type: core.Output }]
5299 };
5300 return StorefrontComponent;
5301 }());
5302 if (false) {
5303 /** @type {?} */
5304 StorefrontComponent.prototype.useCustomCase;
5305 /** @type {?} */
5306 StorefrontComponent.prototype.categorySelected;
5307 /** @type {?} */
5308 StorefrontComponent.prototype.packageIdSelected;
5309 /** @type {?} */
5310 StorefrontComponent.prototype.getDataForCategory;
5311 /**
5312 * @type {?}
5313 * @private
5314 */
5315 StorefrontComponent.prototype.categories$$;
5316 /**
5317 * @type {?}
5318 * @private
5319 */
5320 StorefrontComponent.prototype.packagesMap$$;
5321 /**
5322 * @type {?}
5323 * @private
5324 */
5325 StorefrontComponent.prototype.searchTerm$$;
5326 /**
5327 * @type {?}
5328 * @private
5329 */
5330 StorefrontComponent.prototype.selectedCateoryId$$;
5331 /**
5332 * @type {?}
5333 * @private
5334 */
5335 StorefrontComponent.prototype.lmiCategoryFilter;
5336 /** @type {?} */
5337 StorefrontComponent.prototype.filters$;
5338 /** @type {?} */
5339 StorefrontComponent.prototype.filteredItems$;
5340 /** @type {?} */
5341 StorefrontComponent.prototype.searchTermSubscription;
5342 /** @type {?} */
5343 StorefrontComponent.prototype.showLMIFilter$;
5344 /**
5345 * @type {?}
5346 * @private
5347 */
5348 StorefrontComponent.prototype.userEvents;
5349 /**
5350 * @type {?}
5351 * @private
5352 */
5353 StorefrontComponent.prototype.filterService;
5354 /**
5355 * @type {?}
5356 * @private
5357 */
5358 StorefrontComponent.prototype.translateService;
5359 }
5360
5361 /**
5362 * @fileoverview added by tsickle
5363 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
5364 */
5365 var StoreModule = /** @class */ (function () {
5366 function StoreModule(translateService, currentLang$, defaultLang$) {
5367 this.translateService = translateService;
5368 if (!this.translateService.translations.hasOwnProperty('en')) {
5369 this.translateService.reloadLang('en');
5370 }
5371 if (!this.translateService.translations.hasOwnProperty('cs')) {
5372 this.translateService.reloadLang('cs');
5373 }
5374 this.translateService.setTranslation('en', En.en, true);
5375 this.translateService.setTranslation('cs', Cs.cs, true);
5376 if (currentLang$) {
5377 currentLang$.subscribe((/**
5378 * @param {?} currentLang
5379 * @return {?}
5380 */
5381 function (currentLang) { return translateService.use(currentLang); }));
5382 }
5383 if (defaultLang$) {
5384 defaultLang$.subscribe((/**
5385 * @param {?} defaultLang
5386 * @return {?}
5387 */
5388 function (defaultLang) { return translateService.setDefaultLang(defaultLang); }));
5389 }
5390 }
5391 StoreModule.decorators = [
5392 { type: core.NgModule, args: [{
5393 imports: [common.CommonModule, uikit.UIKitModule, material.MatCardModule, material.MatIconModule, material.MatInputModule, forms.FormsModule, forms.ReactiveFormsModule,
5394 material.MatSelectModule, material.MatExpansionModule, material.MatCheckboxModule, StoreCardModule, VaOrderFormModule, AddonModule, StencilsModule,
5395 VaPricingModule, VaAddonListModule, HeimdallClientModule, core$1.TranslateModule.forChild()],
5396 declarations: [StoreComponent, StorefrontComponent],
5397 providers: [StoreService, uikit.FilterService],
5398 exports: [StoreComponent, StoreCardModule, VaOrderFormModule, StencilsModule, StorefrontComponent]
5399 },] }
5400 ];
5401 /** @nocollapse */
5402 StoreModule.ctorParameters = function () { return [
5403 { type: core$1.TranslateService },
5404 { type: rxjs.Observable, decorators: [{ type: core.Optional }, { type: core.Inject, args: ['CURRENT_LANG',] }] },
5405 { type: rxjs.Observable, decorators: [{ type: core.Optional }, { type: core.Inject, args: ['DEFAULT_LANG',] }] }
5406 ]; };
5407 return StoreModule;
5408 }());
5409 if (false) {
5410 /**
5411 * @type {?}
5412 * @private
5413 */
5414 StoreModule.prototype.translateService;
5415 }
5416
5417 /**
5418 * @fileoverview added by tsickle
5419 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
5420 */
5421 /**
5422 * @record
5423 */
5424 function LmiCategory() { }
5425 if (false) {
5426 /** @type {?} */
5427 LmiCategory.prototype.name;
5428 /** @type {?} */
5429 LmiCategory.prototype.categoryId;
5430 }
5431 /** @type {?} */
5432 var LMI_CATEGORIES = [
5433 { name: 'Listings', categoryId: 'listings' },
5434 { name: 'Social', categoryId: 'social' },
5435 { name: 'Reputation', categoryId: 'reputation' },
5436 { name: 'SEO', categoryId: 'seo' },
5437 { name: 'Website', categoryId: 'website' },
5438 { name: 'Advertising', categoryId: 'advertising' },
5439 { name: 'Content & Experience', categoryId: 'content_and_experience' }
5440 ];
5441 /** @type {?} */
5442 var LMI_CATEGORY_MAP = LMI_CATEGORIES.reduce((/**
5443 * @param {?} previous
5444 * @param {?} current
5445 * @return {?}
5446 */
5447 function (previous, current) {
5448 previous[current.categoryId] = current;
5449 return previous;
5450 }), {});
5451 /** @type {?} */
5452 var LMI_CATEGORIES_BY_NAME = LMI_CATEGORIES.reduce((/**
5453 * @param {?} previous
5454 * @param {?} current
5455 * @return {?}
5456 */
5457 function (previous, current) {
5458 previous[current.name] = current;
5459 return previous;
5460 }), {});
5461
5462 /**
5463 * @fileoverview added by tsickle
5464 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
5465 */
5466 var VaSalespersonDetailsComponent = /** @class */ (function () {
5467 function VaSalespersonDetailsComponent() {
5468 this.showGetItNow = true;
5469 this.getItNow = new core.EventEmitter();
5470 }
5471 /**
5472 * @return {?}
5473 */
5474 VaSalespersonDetailsComponent.prototype.onGetItNowSelected = /**
5475 * @return {?}
5476 */
5477 function () {
5478 this.getItNow.emit(this.salesperson);
5479 };
5480 Object.defineProperty(VaSalespersonDetailsComponent.prototype, "iconUrl", {
5481 get: /**
5482 * @return {?}
5483 */
5484 function () {
5485 return this.salesperson && this.salesperson.photoUrlSecure ?
5486 this.salesperson.photoUrlSecure :
5487 'https://vbc-frontend.storage-download.googleapis.com/salesperson-details/default_sales_person.jpg';
5488 },
5489 enumerable: true,
5490 configurable: true
5491 });
5492 Object.defineProperty(VaSalespersonDetailsComponent.prototype, "name", {
5493 get: /**
5494 * @return {?}
5495 */
5496 function () {
5497 return this.salesperson && this.salesperson.formattedName ?
5498 this.salesperson.formattedName : '';
5499 },
5500 enumerable: true,
5501 configurable: true
5502 });
5503 Object.defineProperty(VaSalespersonDetailsComponent.prototype, "title", {
5504 get: /**
5505 * @return {?}
5506 */
5507 function () {
5508 return this.salesperson && this.salesperson.jobTitle ?
5509 this.salesperson.jobTitle : '';
5510 },
5511 enumerable: true,
5512 configurable: true
5513 });
5514 Object.defineProperty(VaSalespersonDetailsComponent.prototype, "email", {
5515 get: /**
5516 * @return {?}
5517 */
5518 function () {
5519 return this.salesperson && this.salesperson.email ?
5520 this.salesperson.email : '';
5521 },
5522 enumerable: true,
5523 configurable: true
5524 });
5525 Object.defineProperty(VaSalespersonDetailsComponent.prototype, "cityAndState", {
5526 get: /**
5527 * @return {?}
5528 */
5529 function () {
5530 return this.salesperson && this.salesperson.city && this.salesperson.state ?
5531 this.salesperson.city + ', ' + this.salesperson.state : '';
5532 },
5533 enumerable: true,
5534 configurable: true
5535 });
5536 VaSalespersonDetailsComponent.decorators = [
5537 { type: core.Component, args: [{
5538 selector: 'va-salesperson-details',
5539 template: "<div class=\"container\">\n <div class=\"salesperson-contact-info\">\n\n <div class=\"salesperson-image\" *ngIf=\"salesperson\">\n <va-icon [iconUrl]=\"iconUrl\" [diameter]=\"60\"></va-icon>\n </div>\n\n <div>\n <div class=\"salesperson-name\">{{ name }}</div>\n <div>{{ title }}</div>\n <div>{{ cityAndState }}</div>\n <div><a href=\"mailto:{{ email }}\">{{ email }}</a></div>\n </div>\n\n <div *ngIf=\"!salesperson\" class=\"generic-contact\">\n Contact {{ brandName ? \"your \" + brandName : \"a\" }} representative today!\n </div>\n\n <div class=\"pricing\">\n <va-pricing [pricing]=\"packagePricing\" wrapFrequency=\"true\"></va-pricing>\n <div class=\"cta get-it-now-bottom-button\">\n <button mat-button *ngIf=\"salesperson && showGetItNow\" (click)=\"onGetItNowSelected()\" class=\"now-button\">\n Get it Now\n </button>\n </div>\n </div>\n </div>\n</div>\n",
5540 styles: ["a{color:#1e88e5;text-decoration:none}.container{width:100%;margin:0 auto;background-color:#fff;box-shadow:1px 1px 1px 0 rgba(0,0,0,.2)}.salesperson-image{margin-right:20px}.salesperson-contact-info{display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center;padding:24px;font-size:14px;color:#9e9e9e}@media screen and (max-width:600px){.salesperson-contact-info{-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;display:inline-block}}.salesperson-name{font-size:20px;font-weight:700;color:#212121}.generic-contact{margin-left:20px}.pricing{display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center;-webkit-box-flex:1;flex-grow:1;-webkit-box-pack:end;justify-content:flex-end}.pricing ::ng-deep .price-box{-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row}.pricing ::ng-deep .price-number{margin-right:4px}@media screen and (min-width:600px){.pricing{padding-left:16px}}.pricing va-pricing{margin-right:20px}.now-button{font-size:14px;color:#fff;background-color:#4caf50}"]
5541 }] }
5542 ];
5543 VaSalespersonDetailsComponent.propDecorators = {
5544 salesperson: [{ type: core.Input }],
5545 packagePricing: [{ type: core.Input }],
5546 brandName: [{ type: core.Input }],
5547 showGetItNow: [{ type: core.Input }],
5548 getItNow: [{ type: core.Output }]
5549 };
5550 return VaSalespersonDetailsComponent;
5551 }());
5552 if (false) {
5553 /** @type {?} */
5554 VaSalespersonDetailsComponent.prototype.salesperson;
5555 /** @type {?} */
5556 VaSalespersonDetailsComponent.prototype.packagePricing;
5557 /** @type {?} */
5558 VaSalespersonDetailsComponent.prototype.brandName;
5559 /** @type {?} */
5560 VaSalespersonDetailsComponent.prototype.showGetItNow;
5561 /** @type {?} */
5562 VaSalespersonDetailsComponent.prototype.getItNow;
5563 }
5564
5565 /**
5566 * @fileoverview added by tsickle
5567 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
5568 */
5569 var VaSalespersonDetailsModule = /** @class */ (function () {
5570 function VaSalespersonDetailsModule() {
5571 }
5572 VaSalespersonDetailsModule.decorators = [
5573 { type: core.NgModule, args: [{
5574 imports: [
5575 common.CommonModule,
5576 material.MatButtonModule,
5577 material.MatIconModule,
5578 uikit.VaIconModule,
5579 VaPricingModule,
5580 ],
5581 declarations: [
5582 VaSalespersonDetailsComponent
5583 ],
5584 exports: [
5585 VaSalespersonDetailsComponent
5586 ],
5587 entryComponents: [
5588 VaSalespersonDetailsComponent
5589 ]
5590 },] }
5591 ];
5592 return VaSalespersonDetailsModule;
5593 }());
5594
5595 /**
5596 * @fileoverview added by tsickle
5597 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
5598 */
5599 var Package = /** @class */ (function (_super) {
5600 __extends(Package, _super);
5601 function Package() {
5602 return _super !== null && _super.apply(this, arguments) || this;
5603 }
5604 // the order the product / addons in the package
5605 /**
5606 * @param {?} data
5607 * @return {?}
5608 */
5609 Package.fromApi =
5610 // the order the product / addons in the package
5611 /**
5612 * @param {?} data
5613 * @return {?}
5614 */
5615 function (data) {
5616 /** @type {?} */
5617 var newPackage = new Package();
5618 if (!data.pricing && data.selling_price) {
5619 data.pricing = {
5620 currency: data.currency,
5621 prices: [{
5622 price: data.selling_price * 100,
5623 frequency: data.billingFrequency,
5624 isStartingPrice: false,
5625 }]
5626 };
5627 }
5628 Object.assign(newPackage, data);
5629 if (!newPackage.name) {
5630 newPackage.name = 'Untitled';
5631 }
5632 if (data.created) {
5633 newPackage.createdDate = new Date(data.created);
5634 }
5635 if (data.updated) {
5636 newPackage.updatedDate = new Date(data.updated);
5637 }
5638 return newPackage;
5639 };
5640 Object.defineProperty(Package.prototype, "isPackageFree", {
5641 get: /**
5642 * @return {?}
5643 */
5644 function () {
5645 return this.isFree;
5646 },
5647 enumerable: true,
5648 configurable: true
5649 });
5650 return Package;
5651 }(Sellable));
5652 if (false) {
5653 /** @type {?} */
5654 Package.prototype.solution_id;
5655 /** @type {?} */
5656 Package.prototype.partner_id;
5657 /** @type {?} */
5658 Package.prototype.market_id;
5659 /** @type {?} */
5660 Package.prototype.name;
5661 /** @type {?} */
5662 Package.prototype.icon;
5663 /** @type {?} */
5664 Package.prototype.status;
5665 /** @type {?} */
5666 Package.prototype.tagline;
5667 /** @type {?} */
5668 Package.prototype.header_image_url;
5669 /** @type {?} */
5670 Package.prototype.content;
5671 /** @type {?} */
5672 Package.prototype.products;
5673 /** @type {?} */
5674 Package.prototype.addon_keys;
5675 /** @type {?} */
5676 Package.prototype.hide_product_icons_and_names;
5677 /** @type {?} */
5678 Package.prototype.hide_product_details;
5679 /** @type {?} */
5680 Package.prototype.createdDate;
5681 /** @type {?} */
5682 Package.prototype.updatedDate;
5683 /** @type {?} */
5684 Package.prototype.productOrder;
5685 }
5686
5687 /**
5688 * @fileoverview added by tsickle
5689 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
5690 */
5691 /**
5692 * @param {?} combined
5693 * @param {?} order
5694 * @return {?}
5695 */
5696 function orderProductsAndAddons(combined, order) {
5697 if (!order || order.length === 0) {
5698 return combined || [];
5699 }
5700 if (!combined || combined.length === 0) {
5701 return [];
5702 }
5703 /** @type {?} */
5704 var itemMap = (combined || []).reduce((/**
5705 * @param {?} m
5706 * @param {?} curr
5707 * @return {?}
5708 */
5709 function (m, curr) {
5710 m.set(getUniqueProductAddonId(curr), curr);
5711 return m;
5712 }), new Map());
5713 /** @type {?} */
5714 var combinedIdList = combined.map(getUniqueProductAddonId);
5715 /** @type {?} */
5716 var finalOrderedIds = combineProductOrderWithContainedProducts(order, combinedIdList);
5717 /** @type {?} */
5718 var orderedList = (/** @type {?} */ (finalOrderedIds.reduce((/**
5719 * @param {?} items
5720 * @param {?} id
5721 * @return {?}
5722 */
5723 function (items, id) {
5724 items.push(itemMap.get(id));
5725 return items;
5726 }), [])));
5727 return orderedList.filter(filterUniqueAndDefined);
5728 }
5729 /**
5730 * @param {?} elem
5731 * @param {?} pos
5732 * @param {?} arr
5733 * @return {?}
5734 */
5735 function filterUniqueAndDefined(elem, pos, arr) {
5736 return elem && arr.indexOf(elem) === pos;
5737 }
5738 /**
5739 * @param {?} productOrder
5740 * @param {?} itemIds
5741 * @return {?}
5742 */
5743 function combineProductOrderWithContainedProducts(productOrder, itemIds) {
5744 if (itemIds == null || itemIds.length === 0) {
5745 return [];
5746 }
5747 if (!productOrder || productOrder.length === 0) {
5748 return itemIds.filter(filterUniqueAndDefined);
5749 }
5750 return productOrder
5751 .filter((/**
5752 * @param {?} elem
5753 * @return {?}
5754 */
5755 function (elem) { return itemIds.indexOf(elem) >= 0; }))
5756 .concat(itemIds)
5757 .filter(filterUniqueAndDefined);
5758 }
5759 /**
5760 * @param {?} thing
5761 * @return {?}
5762 */
5763 function getUniqueProductAddonId(thing) {
5764 return thing['addonId'] || thing['productId'];
5765 }
5766
5767 /**
5768 * @fileoverview added by tsickle
5769 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
5770 */
5771 var VaPackageDetailsComponent = /** @class */ (function () {
5772 function VaPackageDetailsComponent() {
5773 this.showActionButton = true;
5774 this.showPricing = true;
5775 this.actionLabel = 'Get It Now';
5776 this.getItNow = new core.EventEmitter();
5777 this.standAloneProducts$$ = new rxjs.BehaviorSubject([]);
5778 this.products$ = new rxjs.BehaviorSubject([]);
5779 this.addons$ = new rxjs.BehaviorSubject([]);
5780 this.pkg$ = new rxjs.ReplaySubject(1);
5781 this.itemSelectedEvent$ = new rxjs.ReplaySubject(1);
5782 this.combinedItemsList$ = rxjs.combineLatest(this.products$, this.addons$, (/**
5783 * @param {?} products
5784 * @param {?} addons
5785 * @return {?}
5786 */
5787 function (products, addons) {
5788 return (/** @type {?} */ ([].concat(products || []).concat(addons || [])));
5789 }));
5790 this.orderedItemsList$ = rxjs.combineLatest(this.combinedItemsList$, this.pkg$, (/**
5791 * @param {?} combined
5792 * @param {?} pkg
5793 * @return {?}
5794 */
5795 function (combined, pkg) {
5796 return orderProductsAndAddons(combined, pkg ? pkg.productOrder || [] : []);
5797 }));
5798 /** @type {?} */
5799 var nonEmptyCombinedItemsList = this.combinedItemsList$.pipe(operators.skipWhile((/**
5800 * @param {?} items
5801 * @return {?}
5802 */
5803 function (items) { return !items || items.length === 0; })), operators.shareReplay(1));
5804 // Need to map to an index because that's how product selection works.
5805 /** @type {?} */
5806 var initialSelectedItem$ = nonEmptyCombinedItemsList.pipe(operators.map((/**
5807 * @param {?} _
5808 * @return {?}
5809 */
5810 function (_) { return 0; })), operators.take(1));
5811 /** @type {?} */
5812 var mergedSelection = rxjs.merge(initialSelectedItem$, this.itemSelectedEvent$);
5813 this.selectedItem$ = rxjs.combineLatest(mergedSelection, this.orderedItemsList$).pipe(operators.map((/**
5814 * @param {?} __0
5815 * @return {?}
5816 */
5817 function (_a) {
5818 var _b = __read(_a, 2), index = _b[0], items = _b[1];
5819 return items[index];
5820 })));
5821 this.lmiCategories$ = this.products$.pipe(operators.skipWhile((/**
5822 * @param {?} products
5823 * @return {?}
5824 */
5825 function (products) { return !products || products.length === 0; })), operators.map((/**
5826 * @param {?} products
5827 * @return {?}
5828 */
5829 function (products) {
5830 return VaPackageDetailsComponent.getLmiCategories(products);
5831 })));
5832 this.productNameForSingleAddon$ = nonEmptyCombinedItemsList.pipe(operators.map((/**
5833 * @param {?} items
5834 * @return {?}
5835 */
5836 function (items) {
5837 return VaPackageDetailsComponent.getProductNameForSingleAddon(items);
5838 })));
5839 this.displayTagName$ = rxjs.combineLatest(this.pkg$, this.combinedItemsList$).pipe(operators.map((/**
5840 * @param {?} __0
5841 * @return {?}
5842 */
5843 function (_a) {
5844 var _b = __read(_a, 2), pkg = _b[0], items = _b[1];
5845 return VaPackageDetailsComponent.getDisplayTagline(pkg, items);
5846 })));
5847 }
5848 Object.defineProperty(VaPackageDetailsComponent.prototype, "standAloneProducts", {
5849 set: /**
5850 * @param {?} standAloneProducts
5851 * @return {?}
5852 */
5853 function (standAloneProducts) {
5854 this.standAloneProducts$$.next(standAloneProducts);
5855 },
5856 enumerable: true,
5857 configurable: true
5858 });
5859 Object.defineProperty(VaPackageDetailsComponent.prototype, "products", {
5860 set: /**
5861 * @param {?} products
5862 * @return {?}
5863 */
5864 function (products) {
5865 this.products$.next(products);
5866 },
5867 enumerable: true,
5868 configurable: true
5869 });
5870 Object.defineProperty(VaPackageDetailsComponent.prototype, "addons", {
5871 set: /**
5872 * @param {?} addons
5873 * @return {?}
5874 */
5875 function (addons) {
5876 this.addons$.next(addons);
5877 },
5878 enumerable: true,
5879 configurable: true
5880 });
5881 Object.defineProperty(VaPackageDetailsComponent.prototype, "pkg", {
5882 set: /**
5883 * @param {?} pkg
5884 * @return {?}
5885 */
5886 function (pkg) {
5887 this.pkg$.next(pkg);
5888 },
5889 enumerable: true,
5890 configurable: true
5891 });
5892 /**
5893 * @param {?} products
5894 * @return {?}
5895 */
5896 VaPackageDetailsComponent.getLmiCategories = /**
5897 * @param {?} products
5898 * @return {?}
5899 */
5900 function (products) {
5901 /** @type {?} */
5902 var lmiCategories = [];
5903 if (products) {
5904 products.forEach((/**
5905 * @param {?} product
5906 * @return {?}
5907 */
5908 function (product) {
5909 lmiCategories = lmiCategories.concat(product.getLmiCategoryNames());
5910 }));
5911 }
5912 return new Set(lmiCategories);
5913 };
5914 /**
5915 * @param {?} pkg
5916 * @param {?} items
5917 * @return {?}
5918 */
5919 VaPackageDetailsComponent.getDisplayTagline = /**
5920 * @param {?} pkg
5921 * @param {?} items
5922 * @return {?}
5923 */
5924 function (pkg, items) {
5925 if (pkg && pkg.tagline) {
5926 return pkg.tagline;
5927 }
5928 else if (items && items.length === 1) {
5929 // Single product / addon package.
5930 return items[0].tagline || '';
5931 }
5932 return '';
5933 };
5934 /**
5935 * @param {?} items
5936 * @return {?}
5937 */
5938 VaPackageDetailsComponent.getProductNameForSingleAddon = /**
5939 * @param {?} items
5940 * @return {?}
5941 */
5942 function (items) {
5943 if (items && items.length === 1 && items[0] instanceof shared.Addon) {
5944 /** @type {?} */
5945 var addon = (/** @type {?} */ (items[0]));
5946 return addon.productName;
5947 }
5948 };
5949 /**
5950 * @param {?} i
5951 * @return {?}
5952 */
5953 VaPackageDetailsComponent.prototype.selectItem = /**
5954 * @param {?} i
5955 * @return {?}
5956 */
5957 function (i) {
5958 this.itemSelectedEvent$.next(i);
5959 };
5960 /**
5961 * @return {?}
5962 */
5963 VaPackageDetailsComponent.prototype.emitGetItNow = /**
5964 * @return {?}
5965 */
5966 function () {
5967 this.getItNow.emit();
5968 };
5969 VaPackageDetailsComponent.decorators = [
5970 { type: core.Component, args: [{
5971 selector: 'va-package-details',
5972 template: "<div *ngIf=\"pkg$ | async as pkg\" class=\"page\">\n <va-header-container [iconUrl]=\"pkg.icon\"\n [title]=\"pkg.name\"\n [tagline]=\"displayTagName$ | async\"\n [prerequisite]=\"productNameForSingleAddon$ | async\"\n [chipLabels]=\"lmiCategories$ | async\"\n [pricing]=\"pkg.pricing\"\n [pricingLabel]=\"'Pricing'\"\n [showAction]=\"showActionButton\"\n [showPricing]=\"showPricing\"\n [actionLabel]=\"actionLabel\"\n [actionEnabled]=true\n (actionSelected)=\"emitGetItNow()\"\n ></va-header-container>\n <ng-container *ngIf=\"pkg?.content\">\n <va-selling-info [description]=\"pkg.content\"></va-selling-info>\n </ng-container>\n\n <va-products-nav [items]=\"orderedItemsList$ | async\"\n [hideItemsNav]=\"pkg?.hide_product_icons_and_names\"\n (itemSelected)=\"selectItem($event)\"></va-products-nav>\n\n <ng-container *ngIf=\"selectedItem$ | async as selectedItem\">\n <div *ngIf=\"!pkg?.hide_product_details\" class=\"package-content\">\n <div class=\"left-column\">\n <section\n *ngIf=\"(selectedItem.endUserMarketing?.description || selectedItem.endUserMarketing?.keySellingPoints) ||\n (selectedItem.description || selectedItem.keySellingPoints)\">\n <va-selling-info [description]=\"selectedItem.endUserMarketing?.description || selectedItem.description\"\n [keySellingPoints]=\"selectedItem.endUserMarketing?.keySellingPoints || selectedItem.keySellingPoints\"></va-selling-info>\n </section>\n\n <section *ngIf=\"(selectedItem.endUserMarketing?.faqs?.length > 0\n && selectedItem.endUserMarketing?.faqs[0].question) || selectedItem.faqs?.length > 0\">\n <h2 class=\"va-component-title\">FAQs</h2>\n <va-faqs [faqs]=\"selectedItem.endUserMarketing?.faqs || selectedItem.faqs\"></va-faqs>\n </section>\n </div>\n\n <div class=\"right-column\">\n <section *ngIf=\"selectedItem.screenshotUrls?.length > 0 || selectedItem.screenshots?.length > 0\">\n <h2 class=\"va-component-title\">Gallery</h2>\n <va-image-gallery [imageUrls]=\"selectedItem.screenshotUrls || selectedItem.screenshots\"></va-image-gallery>\n </section>\n\n <section *ngIf=\"selectedItem.endUserMarketing?.files?.length > 0 || selectedItem.files?.length > 0\">\n <h2 class=\"va-component-title\">Files</h2>\n <va-files [files]=\"selectedItem.endUserMarketingFiles || selectedItem.files\"></va-files>\n </section>\n </div>\n </div>\n </ng-container>\n</div>\n",
5973 styles: [":host{display:block;font-size:14px;line-height:1.4}:host *{box-sizing:border-box}.va-component-title{font-size:24px;font-weight:300;margin-top:0}@media screen and (min-width:600px){.va-component-title{font-size:32px}}img{max-width:100%}va-icon{display:inline-block}.page{position:relative;margin:0 auto 20px;background:#fff;color:#212121;box-shadow:0 3px 10px rgba(33,33,33,.3);overflow:hidden;font-size:16px}.page .item-amount{color:#9e9e9e;font-size:14px;text-align:right;margin:0 24px 8px}section{padding:24px}.left-column{width:66%}@media screen and (max-width:600px){.left-column{width:100%}}.right-column{width:34%}.package-content{display:-webkit-box;display:flex}@media screen and (max-width:600px){.right-column{width:100%}.package-content{-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}}"]
5974 }] }
5975 ];
5976 /** @nocollapse */
5977 VaPackageDetailsComponent.ctorParameters = function () { return []; };
5978 VaPackageDetailsComponent.propDecorators = {
5979 showActionButton: [{ type: core.Input }],
5980 showPricing: [{ type: core.Input }],
5981 actionLabel: [{ type: core.Input }],
5982 getItNow: [{ type: core.Output }],
5983 standAloneProducts: [{ type: core.Input }],
5984 products: [{ type: core.Input }],
5985 addons: [{ type: core.Input }],
5986 pkg: [{ type: core.Input }]
5987 };
5988 return VaPackageDetailsComponent;
5989 }());
5990 if (false) {
5991 /** @type {?} */
5992 VaPackageDetailsComponent.prototype.showActionButton;
5993 /** @type {?} */
5994 VaPackageDetailsComponent.prototype.showPricing;
5995 /** @type {?} */
5996 VaPackageDetailsComponent.prototype.actionLabel;
5997 /** @type {?} */
5998 VaPackageDetailsComponent.prototype.getItNow;
5999 /** @type {?} */
6000 VaPackageDetailsComponent.prototype.standAloneProducts$$;
6001 /** @type {?} */
6002 VaPackageDetailsComponent.prototype.products$;
6003 /** @type {?} */
6004 VaPackageDetailsComponent.prototype.addons$;
6005 /** @type {?} */
6006 VaPackageDetailsComponent.prototype.pkg$;
6007 /** @type {?} */
6008 VaPackageDetailsComponent.prototype.itemSelectedEvent$;
6009 /** @type {?} */
6010 VaPackageDetailsComponent.prototype.selectedItem$;
6011 /** @type {?} */
6012 VaPackageDetailsComponent.prototype.combinedItemsList$;
6013 /** @type {?} */
6014 VaPackageDetailsComponent.prototype.orderedItemsList$;
6015 /** @type {?} */
6016 VaPackageDetailsComponent.prototype.lmiCategories$;
6017 /** @type {?} */
6018 VaPackageDetailsComponent.prototype.productNameForSingleAddon$;
6019 /** @type {?} */
6020 VaPackageDetailsComponent.prototype.displayTagName$;
6021 }
6022
6023 /**
6024 * @fileoverview added by tsickle
6025 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
6026 */
6027 var VaProductsNavComponent = /** @class */ (function () {
6028 function VaProductsNavComponent() {
6029 this.itemSelected = new core.EventEmitter();
6030 this.selectedIndex = 0;
6031 this.pageMarker = 0;
6032 }
6033 /**
6034 * @param {?} index
6035 * @return {?}
6036 */
6037 VaProductsNavComponent.prototype.onItemSelected = /**
6038 * @param {?} index
6039 * @return {?}
6040 */
6041 function (index) {
6042 this.selectedIndex = index;
6043 this.itemSelected.emit(index);
6044 };
6045 /**
6046 * @param {?} slides
6047 * @return {?}
6048 */
6049 VaProductsNavComponent.prototype.moveSlides = /**
6050 * @param {?} slides
6051 * @return {?}
6052 */
6053 function (slides) {
6054 /** @type {?} */
6055 var sliderWidth = Math.round(slides.offsetWidth / slides.children[0].clientWidth);
6056 /** @type {?} */
6057 var numSlides = Math.ceil(slides.children.length / sliderWidth);
6058 if (numSlides === 0) {
6059 return;
6060 }
6061 /** @type {?} */
6062 var pageWidth = slides.offsetWidth;
6063 /** @type {?} */
6064 var move = 0;
6065 if (this.pageMarker === -1) {
6066 this.pageMarker = numSlides - 1; // go to end
6067 move = pageWidth * this.pageMarker;
6068 slides.style.left = "-" + move + "px";
6069 }
6070 else if (this.pageMarker >= numSlides) {
6071 slides.style.left = '0px';
6072 this.pageMarker = 0; // reset
6073 }
6074 else {
6075 move = pageWidth * this.pageMarker;
6076 slides.style.left = "-" + move + "px";
6077 }
6078 };
6079 /**
6080 * @param {?} slides
6081 * @return {?}
6082 */
6083 VaProductsNavComponent.prototype.pageNext = /**
6084 * @param {?} slides
6085 * @return {?}
6086 */
6087 function (slides) {
6088 this.pageMarker++;
6089 this.moveSlides(slides);
6090 };
6091 /**
6092 * @param {?} slides
6093 * @return {?}
6094 */
6095 VaProductsNavComponent.prototype.pagePrev = /**
6096 * @param {?} slides
6097 * @return {?}
6098 */
6099 function (slides) {
6100 this.pageMarker--;
6101 this.moveSlides(slides);
6102 };
6103 VaProductsNavComponent.decorators = [
6104 { type: core.Component, args: [{
6105 selector: 'va-products-nav',
6106 template: "<p *ngIf=\"items?.length > 1\" class=\"item-amount\">{{ 'FRONTEND.STORE.CONTAINS_NUM_ITEMS' | translate: {itemCount: items.length} }}</p>\n<div class=\"wrapper\">\n <nav *ngIf=\"items && !hideItemsNav\" (swipeleft)=\"pageNext(slides)\" (swiperight)=\"pagePrev(slides)\">\n <div [ngClass]=\"{'hide-arrows': items && items.length < 5}\">\n <span class=\"prev\" (click)=\"pagePrev(slides)\"><mat-icon>keyboard_arrow_left</mat-icon></span>\n <span class=\"next\" (click)=\"pageNext(slides)\"><mat-icon>keyboard_arrow_right</mat-icon></span>\n </div>\n <ul class=\"slides\" #slides>\n <li *ngFor=\"let item of items; index as i;\" (click)=\"onItemSelected(i)\">\n <a [ngClass]=\"{'active': i === selectedIndex}\">\n <span class=\"icon-area\">\n <va-icon [iconUrl]=\"item.icon || item.iconUrl\" [name]=\"item.name || item.title\" [diameter]=\"80\"></va-icon>\n <va-icon *ngIf=\"item.addonId\" class=\"addon-indicator\" [iconUrl]=\"item.productIcon\" [name]=\"item.productName\" [diameter]=\"24\"></va-icon>\n </span>\n <p>{{ item.name || item.title }}</p>\n <div *ngIf=\"item.addonId\">\n <span class=\"requires-text\">{{ 'FRONTEND.STORE.REQUIRES' | translate }}</span>\n <span>{{item.productName}}</span>\n </div>\n </a>\n </li>\n </ul>\n </nav>\n</div>\n",
6107 styles: ["nav{position:relative;width:350px;margin:0 auto;background:#fff;border:1px solid #e0e0e0;border-width:1px 0;overflow:hidden}nav ul{display:-webkit-box;display:flex;flex-wrap:nowrap;list-style:none;margin:0 50px;padding:0;position:relative;left:0;-webkit-transition:left .3s;transition:left .3s;word-break:break-word}nav li{min-width:100%;-webkit-box-flex:1;flex:1 0 25%;text-align:center;font-size:14px}nav li:first-child a{border-right:1px solid #e0e0e0}nav a{position:relative;display:block;height:100%;padding:20px;text-decoration:none;color:#212121;-webkit-transition:background .3s;transition:background .3s;-webkit-box-align:center;align-items:center;border-right:1px solid #e0e0e0;cursor:pointer}nav a:hover{background-color:rgba(255,255,255,.6)}nav a.active{background-color:#fff}nav a.active:after{content:'';display:block;position:absolute;bottom:-1px;left:0;width:100%;height:1px;background-color:#fff}nav p{margin-bottom:0}nav .icon img{width:80px;min-width:80px;height:80px}nav .next,nav .prev{position:absolute;height:100%;width:50px;top:0;background:rgba(33,33,33,.1);cursor:pointer;text-align:center;opacity:1;-webkit-transition:opacity .3s;transition:opacity .3s;display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;-webkit-box-pack:center;justify-content:center;-webkit-box-align:center;align-items:center;z-index:1}nav .next:not(.disabled):hover,nav .prev:not(.disabled):hover{background:rgba(33,33,33,.3)}nav .prev{left:0}nav .next{right:0}nav .disabled{cursor:default;opacity:0}@media screen and (min-width:600px){nav{width:auto;overflow:initial}nav li{min-width:0;width:25%;-webkit-box-flex:0;flex-grow:0}nav .hide-arrows{display:none}nav .hide-arrows+.slides{margin:0}}va-icon{display:inline-block}.item-amount{color:#9e9e9e;font-size:14px;text-align:right;margin:0 24px 8px}.wrapper{overflow:hidden}.requires-text{color:#9e9e9e}.icon-area{position:relative;display:inline-block}.addon-indicator{position:absolute;border:2px solid #fff;border-radius:50%;bottom:-2px;right:-2px}"]
6108 }] }
6109 ];
6110 VaProductsNavComponent.propDecorators = {
6111 items: [{ type: core.Input }],
6112 hideItemsNav: [{ type: core.Input }],
6113 itemSelected: [{ type: core.Output }]
6114 };
6115 return VaProductsNavComponent;
6116 }());
6117 if (false) {
6118 /** @type {?} */
6119 VaProductsNavComponent.prototype.items;
6120 /** @type {?} */
6121 VaProductsNavComponent.prototype.hideItemsNav;
6122 /** @type {?} */
6123 VaProductsNavComponent.prototype.itemSelected;
6124 /** @type {?} */
6125 VaProductsNavComponent.prototype.selectedIndex;
6126 /** @type {?} */
6127 VaProductsNavComponent.prototype.pageMarker;
6128 }
6129
6130 /**
6131 * @fileoverview added by tsickle
6132 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
6133 */
6134 var ProductsNavV2Component = /** @class */ (function () {
6135 function ProductsNavV2Component() {
6136 this.itemSelected = new core.EventEmitter();
6137 this.selected_id = '';
6138 this.pageMarker = 0;
6139 }
6140 /**
6141 * @param {?} id
6142 * @return {?}
6143 */
6144 ProductsNavV2Component.prototype.onItemSelected = /**
6145 * @param {?} id
6146 * @return {?}
6147 */
6148 function (id) {
6149 this.selected_id = id;
6150 this.itemSelected.emit(id);
6151 };
6152 /**
6153 * @param {?} slides
6154 * @return {?}
6155 */
6156 ProductsNavV2Component.prototype.moveSlides = /**
6157 * @param {?} slides
6158 * @return {?}
6159 */
6160 function (slides) {
6161 /** @type {?} */
6162 var sliderWidth = Math.round(slides.offsetWidth / slides.children[0].clientWidth);
6163 /** @type {?} */
6164 var numSlides = Math.ceil(slides.children.length / sliderWidth);
6165 if (numSlides === 0) {
6166 return;
6167 }
6168 /** @type {?} */
6169 var pageWidth = slides.offsetWidth;
6170 /** @type {?} */
6171 var move = 0;
6172 if (this.pageMarker === -1) {
6173 this.pageMarker = numSlides - 1; // go to end
6174 move = pageWidth * this.pageMarker;
6175 slides.style.left = "-" + move + "px";
6176 }
6177 else if (this.pageMarker >= numSlides) {
6178 slides.style.left = '0px';
6179 this.pageMarker = 0; // reset
6180 }
6181 else {
6182 move = pageWidth * this.pageMarker;
6183 slides.style.left = "-" + move + "px";
6184 }
6185 };
6186 /**
6187 * @param {?} slides
6188 * @return {?}
6189 */
6190 ProductsNavV2Component.prototype.pageNext = /**
6191 * @param {?} slides
6192 * @return {?}
6193 */
6194 function (slides) {
6195 this.pageMarker++;
6196 this.moveSlides(slides);
6197 };
6198 /**
6199 * @param {?} slides
6200 * @return {?}
6201 */
6202 ProductsNavV2Component.prototype.pagePrev = /**
6203 * @param {?} slides
6204 * @return {?}
6205 */
6206 function (slides) {
6207 this.pageMarker--;
6208 this.moveSlides(slides);
6209 };
6210 ProductsNavV2Component.decorators = [
6211 { type: core.Component, args: [{
6212 selector: 'va-products-nav-v2',
6213 template: "<p *ngIf=\"items?.length > 1\" class=\"item-amount\">{{ 'FRONTEND.STORE.CONTAINS_NUM_ITEMS' | translate: {itemCount: items.length} }}</p>\n<div class=\"wrapper\">\n <nav *ngIf=\"items && !hideItemsNav\" (swipeleft)=\"pageNext(slides)\" (swiperight)=\"pagePrev(slides)\">\n <div [ngClass]=\"{'hide-arrows': items && items.length < 5}\">\n <span class=\"prev\" (click)=\"pagePrev(slides)\"><mat-icon>keyboard_arrow_left</mat-icon></span>\n <span class=\"next\" (click)=\"pageNext(slides)\"><mat-icon>keyboard_arrow_right</mat-icon></span>\n </div>\n <ul class=\"slides\" #slides>\n <li *ngFor=\"let lineItem of items;\" (click)=\"onItemSelected(lineItem?.item?.id)\">\n <a [ngClass]=\"{'active': lineItem?.item?.id === selected_id}\">\n <span class=\"icon-area\">\n <va-icon [iconUrl]=\"lineItem?.item?.icon\" [name]=\"lineItem?.item?.name\" [diameter]=\"80\"></va-icon>\n <va-icon *ngIf=\"lineItem?.parent?.id\" class=\"addon-indicator\" [iconUrl]=\"lineItem?.parent?.icon\" [name]=\"lineItem?.parent?.name\"\n [diameter]=\"24\"></va-icon>\n </span>\n <div class=\"name-container\">\n <div>{{ lineItem?.item?.name }}</div>\n <div *ngIf=\"lineItem?.item?.editionName\" class=\"edition-name\">{{ lineItem.item.editionName }}</div>\n </div>\n <div *ngIf=\"lineItem?.parent?.id\">\n <span class=\"requires-text\">{{ 'FRONTEND.STORE.REQUIRES' | translate }} </span>\n <span>{{lineItem?.parent.name}}</span>\n </div>\n </a>\n </li>\n </ul>\n </nav>\n</div>\n",
6214 styles: [".name-container{display:-webkit-box;display:flex;-webkit-box-pack:center;justify-content:center;-webkit-box-align:center;align-items:center;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}.name-container va-badge{margin-top:12px;margin-left:6px}nav{position:relative;width:350px;margin:0 auto;background:#fff;border:1px solid #e0e0e0;border-width:1px 0;overflow:hidden}nav ul{display:-webkit-box;display:flex;flex-wrap:nowrap;list-style:none;margin:0 50px;padding:0;position:relative;left:0;-webkit-transition:left .3s;transition:left .3s;word-break:break-word}nav li{min-width:100%;-webkit-box-flex:1;flex:1 0 25%;text-align:center;font-size:14px}nav li:first-child a{border-right:1px solid #e0e0e0}nav a{position:relative;display:block;height:100%;padding:20px;text-decoration:none;color:#212121;-webkit-transition:background .3s;transition:background .3s;-webkit-box-align:center;align-items:center;border-right:1px solid #e0e0e0;cursor:pointer}nav a:hover{background-color:rgba(255,255,255,.6)}nav a.active{background-color:#fff}nav a.active:after{content:'';display:block;position:absolute;bottom:-1px;left:0;width:100%;height:1px;background-color:#fff}nav p{margin-bottom:0}nav .icon img{width:80px;min-width:80px;height:80px}nav .next,nav .prev{position:absolute;height:100%;width:50px;top:0;background:rgba(33,33,33,.1);cursor:pointer;text-align:center;opacity:1;-webkit-transition:opacity .3s;transition:opacity .3s;display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;-webkit-box-pack:center;justify-content:center;-webkit-box-align:center;align-items:center;z-index:1}nav .next:not(.disabled):hover,nav .prev:not(.disabled):hover{background:rgba(33,33,33,.3)}nav .prev{left:0}nav .next{right:0}nav .disabled{cursor:default;opacity:0}@media screen and (min-width:600px){nav{width:auto;overflow:initial}nav li{min-width:0;width:25%;-webkit-box-flex:0;flex-grow:0}nav .hide-arrows{display:none}nav .hide-arrows+.slides{margin:0}}va-icon{display:inline-block}.item-amount{color:#9e9e9e;font-size:14px;text-align:right;margin:0 24px 8px}.wrapper{overflow:hidden}.requires-text{color:#9e9e9e}.icon-area{position:relative;display:inline-block}.addon-indicator{position:absolute;border:2px solid #fff;border-radius:50%;bottom:-2px;right:-2px}.edition-name{color:#9e9e9e;font-style:italic;text-align:center;width:100%;font-size:16px;margin-bottom:4px}"]
6215 }] }
6216 ];
6217 ProductsNavV2Component.propDecorators = {
6218 items: [{ type: core.Input }],
6219 hideItemsNav: [{ type: core.Input }],
6220 itemSelected: [{ type: core.Output }]
6221 };
6222 return ProductsNavV2Component;
6223 }());
6224 if (false) {
6225 /** @type {?} */
6226 ProductsNavV2Component.prototype.items;
6227 /** @type {?} */
6228 ProductsNavV2Component.prototype.hideItemsNav;
6229 /** @type {?} */
6230 ProductsNavV2Component.prototype.itemSelected;
6231 /** @type {?} */
6232 ProductsNavV2Component.prototype.selected_id;
6233 /** @type {?} */
6234 ProductsNavV2Component.prototype.pageMarker;
6235 }
6236
6237 /**
6238 * @fileoverview added by tsickle
6239 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
6240 */
6241 var VaProductsNavModule = /** @class */ (function () {
6242 function VaProductsNavModule(translateService, currentLang$, defaultLang$) {
6243 this.translateService = translateService;
6244 if (!this.translateService.translations.hasOwnProperty('en')) {
6245 this.translateService.reloadLang('en');
6246 }
6247 if (!this.translateService.translations.hasOwnProperty('cs')) {
6248 this.translateService.reloadLang('cs');
6249 }
6250 this.translateService.setTranslation('en', En.en, true);
6251 this.translateService.setTranslation('cs', Cs.cs, true);
6252 if (currentLang$) {
6253 currentLang$.subscribe((/**
6254 * @param {?} currentLang
6255 * @return {?}
6256 */
6257 function (currentLang) { return translateService.use(currentLang); }));
6258 }
6259 if (defaultLang$) {
6260 defaultLang$.subscribe((/**
6261 * @param {?} defaultLang
6262 * @return {?}
6263 */
6264 function (defaultLang) { return translateService.setDefaultLang(defaultLang); }));
6265 }
6266 }
6267 VaProductsNavModule.decorators = [
6268 { type: core.NgModule, args: [{
6269 imports: [
6270 common.CommonModule,
6271 material.MatIconModule,
6272 uikit.VaIconModule,
6273 uikit.VaBadgeModule,
6274 core$1.TranslateModule.forChild()
6275 ],
6276 declarations: [VaProductsNavComponent, ProductsNavV2Component],
6277 exports: [VaProductsNavComponent, ProductsNavV2Component]
6278 },] }
6279 ];
6280 /** @nocollapse */
6281 VaProductsNavModule.ctorParameters = function () { return [
6282 { type: core$1.TranslateService },
6283 { type: rxjs.Observable, decorators: [{ type: core.Optional }, { type: core.Inject, args: ['CURRENT_LANG',] }] },
6284 { type: rxjs.Observable, decorators: [{ type: core.Optional }, { type: core.Inject, args: ['DEFAULT_LANG',] }] }
6285 ]; };
6286 return VaProductsNavModule;
6287 }());
6288 if (false) {
6289 /**
6290 * @type {?}
6291 * @private
6292 */
6293 VaProductsNavModule.prototype.translateService;
6294 }
6295
6296 /**
6297 * @fileoverview added by tsickle
6298 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
6299 */
6300 var VaPackageDetailsModule = /** @class */ (function () {
6301 function VaPackageDetailsModule() {
6302 }
6303 VaPackageDetailsModule.decorators = [
6304 { type: core.NgModule, args: [{
6305 imports: [
6306 uikit.VaImageGalleryModule, common.CommonModule, material.MatIconModule, uikit.VaSafeHtmlModule, uikit.VaIconModule,
6307 VaPricingModule, material.MatButtonModule, VaFilesModule, VaFaqsModule, VaSellingInfoModule,
6308 VaHeaderContainerModule, VaAddonListModule, VaProductsNavModule
6309 ],
6310 declarations: [VaPackageDetailsComponent],
6311 exports: [VaPackageDetailsComponent],
6312 entryComponents: [VaPackageDetailsComponent]
6313 },] }
6314 ];
6315 return VaPackageDetailsModule;
6316 }());
6317
6318 /**
6319 * @fileoverview added by tsickle
6320 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
6321 */
6322 var PackageDetails = /** @class */ (function () {
6323 function PackageDetails() {
6324 }
6325 Object.defineProperty(PackageDetails.prototype, "isPackageFree", {
6326 get: /**
6327 * @return {?}
6328 */
6329 function () {
6330 /** @type {?} */
6331 var isFreeHelper = (/**
6332 * @param {?} prices
6333 * @return {?}
6334 */
6335 function (prices) {
6336 return prices ? prices.some((/**
6337 * @param {?} p
6338 * @return {?}
6339 */
6340 function (p) { return p.price === 0 || p.price === undefined; })) : false;
6341 });
6342 return this.pricing && isFreeHelper(this.pricing.prices);
6343 },
6344 enumerable: true,
6345 configurable: true
6346 });
6347 return PackageDetails;
6348 }());
6349 if (false) {
6350 /** @type {?} */
6351 PackageDetails.prototype.solution_id;
6352 /** @type {?} */
6353 PackageDetails.prototype.partner_id;
6354 /** @type {?} */
6355 PackageDetails.prototype.market_id;
6356 /** @type {?} */
6357 PackageDetails.prototype.name;
6358 /** @type {?} */
6359 PackageDetails.prototype.icon;
6360 /** @type {?} */
6361 PackageDetails.prototype.status;
6362 /** @type {?} */
6363 PackageDetails.prototype.tagline;
6364 /** @type {?} */
6365 PackageDetails.prototype.header_image_url;
6366 /** @type {?} */
6367 PackageDetails.prototype.content;
6368 /** @type {?} */
6369 PackageDetails.prototype.hide_product_icons_and_names;
6370 /** @type {?} */
6371 PackageDetails.prototype.hide_product_details;
6372 /** @type {?} */
6373 PackageDetails.prototype.createdDate;
6374 /** @type {?} */
6375 PackageDetails.prototype.updatedDate;
6376 /** @type {?} */
6377 PackageDetails.prototype.pricing;
6378 /** @type {?} */
6379 PackageDetails.prototype.line_items;
6380 /** @type {?} */
6381 PackageDetails.prototype.market_action;
6382 }
6383 /**
6384 * @param {?} data
6385 * @param {?} products
6386 * @return {?}
6387 */
6388 function convertToPackageDetails(data, products) {
6389 if (!data) {
6390 return undefined;
6391 }
6392 /** @type {?} */
6393 var newPackage = new PackageDetails();
6394 if (!data.pricing) {
6395 data.pricing = marketplacePackages.Pricing.fromProto({
6396 currency: undefined,
6397 prices: [{
6398 price: 0,
6399 frequency: undefined,
6400 isStartingPrice: false,
6401 }]
6402 });
6403 }
6404 Object.assign(newPackage, data);
6405 if (!newPackage.name) {
6406 newPackage.name = 'Untitled';
6407 }
6408 if (data.created) {
6409 newPackage.createdDate = new Date(data.created);
6410 }
6411 if (data.updated) {
6412 newPackage.updatedDate = new Date(data.updated);
6413 }
6414 if (data.lineItems) {
6415 newPackage.line_items = convertProtoLineItemsToStoreLineItems(data.lineItems, products);
6416 }
6417 if (typeof data.pricing.currency === 'number') {
6418 newPackage.pricing.currency = marketplacePackages.Currency[data.pricing.currency];
6419 }
6420 return newPackage;
6421 }
6422 /**
6423 * @param {?} protoLineItems
6424 * @param {?} products
6425 * @return {?}
6426 */
6427 function convertProtoLineItemsToStoreLineItems(protoLineItems, products) {
6428 if (!protoLineItems || !protoLineItems.lineItems || protoLineItems.lineItems.length === 0 || !products || products.length === 0) {
6429 return [];
6430 }
6431 return protoLineItems.lineItems.map((/**
6432 * @param {?} lineItem
6433 * @return {?}
6434 */
6435 function (lineItem) {
6436 /** @type {?} */
6437 var product = products.find((/**
6438 * @param {?} p
6439 * @return {?}
6440 */
6441 function (p) { return p.productId === lineItem.id; }));
6442 /** @type {?} */
6443 var parent;
6444 if (!!lineItem.parentId) {
6445 parent = products.find((/**
6446 * @param {?} p
6447 * @return {?}
6448 */
6449 function (p) { return p.productId === lineItem.parentId; }));
6450 }
6451 return convertProtoLineItemToStoreLineItem(lineItem, product, parent);
6452 }));
6453 }
6454 /**
6455 * @param {?} protoLineItem
6456 * @param {?} product
6457 * @param {?=} parentProduct
6458 * @return {?}
6459 */
6460 function convertProtoLineItemToStoreLineItem(protoLineItem, product, parentProduct) {
6461 if (!product || !protoLineItem) {
6462 return undefined;
6463 }
6464 /** @type {?} */
6465 var files = [];
6466 if (product.pdfUploadUrls && product.pdfUploadUrls.length > 0) {
6467 files = product.pdfUploadUrls.map((/**
6468 * @param {?} url
6469 * @return {?}
6470 */
6471 function (url) { return new File(url); }));
6472 }
6473 /** @type {?} */
6474 var lineItem = (/** @type {?} */ ({
6475 item: {
6476 id: protoLineItem.id,
6477 editionId: protoLineItem.editionId,
6478 icon: product.iconUrl,
6479 name: product.name,
6480 editionName: '',
6481 description: product.description,
6482 keySellingPoints: product.keySellingPoints,
6483 faqs: product.faqs,
6484 files: files,
6485 screenshotUrls: product.screenshotUrls,
6486 lmiCategories: [],
6487 },
6488 quantity: protoLineItem.quantity,
6489 parent: {}
6490 }));
6491 if (protoLineItem.parentId && parentProduct) {
6492 lineItem.parent = {
6493 id: protoLineItem.parentId,
6494 editionId: '',
6495 icon: parentProduct.iconUrl,
6496 name: parentProduct.name,
6497 editionName: '',
6498 };
6499 }
6500 return lineItem;
6501 }
6502
6503 /**
6504 * @fileoverview added by tsickle
6505 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
6506 */
6507 var VaPackageDetailsV2Component = /** @class */ (function () {
6508 function VaPackageDetailsV2Component(translateService, currentLang$) {
6509 var _this = this;
6510 this.translateService = translateService;
6511 this.showActionButton = true;
6512 this.showPricing = true;
6513 this.actionLabel = 'FRONTEND.STORE.GET_IT_NOW';
6514 this.getItNow = new core.EventEmitter();
6515 this.pkg$$ = new rxjs.ReplaySubject(1);
6516 this.itemSelectedEvent$$ = new rxjs.BehaviorSubject('');
6517 if (!this.translateService.translations.hasOwnProperty('en')) {
6518 this.translateService.reloadLang('en');
6519 }
6520 if (!this.translateService.translations.hasOwnProperty('cs')) {
6521 this.translateService.reloadLang('cs');
6522 }
6523 this.translateService.setTranslation('en', En.en, true);
6524 this.translateService.setTranslation('cs', Cs.cs, true);
6525 if (currentLang$) {
6526 currentLang$.subscribe((/**
6527 * @param {?} currentLang
6528 * @return {?}
6529 */
6530 function (currentLang) { return _this.translateService.use(currentLang); }));
6531 }
6532 this.orderedLineItems$ = this.pkg$$.pipe(operators.map((/**
6533 * @param {?} pkg
6534 * @return {?}
6535 */
6536 function (pkg) { return pkg.line_items; })), operators.filter((/**
6537 * @param {?} items
6538 * @return {?}
6539 */
6540 function (items) { return !!items || items.length === 0; })), operators.shareReplay(1));
6541 this.productNameForSingleAddon$ = this.orderedLineItems$.pipe(operators.map((/**
6542 * @param {?} items
6543 * @return {?}
6544 */
6545 function (items) { return _this.getParentsNameForItem(items); })));
6546 this.selectedItem$ = rxjs.combineLatest([this.itemSelectedEvent$$, this.orderedLineItems$]).pipe(operators.map((/**
6547 * @param {?} __0
6548 * @return {?}
6549 */
6550 function (_a) {
6551 var _b = __read(_a, 2), id = _b[0], lineItems = _b[1];
6552 return lineItems.find((/**
6553 * @param {?} lineItem
6554 * @return {?}
6555 */
6556 function (lineItem) { return lineItem.item.id === id; }));
6557 })));
6558 this.lmiCategories$ = this.orderedLineItems$.pipe(operators.map((/**
6559 * @param {?} lis
6560 * @return {?}
6561 */
6562 function (lis) {
6563 /** @type {?} */
6564 var lmiMap = (lis || []).reduce((/**
6565 * @param {?} prev
6566 * @param {?} li
6567 * @return {?}
6568 */
6569 function (prev, li) {
6570 if (li && li.item) {
6571 (li.item.lmiCategories || []).forEach((/**
6572 * @param {?} lmi
6573 * @return {?}
6574 */
6575 function (lmi) { return prev.set(lmi, lmi); }));
6576 }
6577 return prev;
6578 }), new Map());
6579 /** @type {?} */
6580 var lmiCats = [];
6581 lmiMap.forEach((/**
6582 * @param {?} v
6583 * @param {?} k
6584 * @return {?}
6585 */
6586 function (v, k) {
6587 lmiCats.push(k);
6588 }));
6589 return lmiCats;
6590 })));
6591 // Set the initial selected Item
6592 this.orderedLineItems$.pipe(operators.map((/**
6593 * @param {?} lineItems
6594 * @return {?}
6595 */
6596 function (lineItems) { return lineItems[0]; })), operators.tap((/**
6597 * @param {?} lineItem
6598 * @return {?}
6599 */
6600 function (lineItem) { return _this.selectItem(lineItem && lineItem.item ? lineItem.item.id : ''); })), operators.take(1)).subscribe();
6601 }
6602 Object.defineProperty(VaPackageDetailsV2Component.prototype, "pkg", {
6603 set: /**
6604 * @param {?} pkg
6605 * @return {?}
6606 */
6607 function (pkg) {
6608 this.pkg$$.next(pkg);
6609 },
6610 enumerable: true,
6611 configurable: true
6612 });
6613 /**
6614 * @param {?} id
6615 * @return {?}
6616 */
6617 VaPackageDetailsV2Component.prototype.selectItem = /**
6618 * @param {?} id
6619 * @return {?}
6620 */
6621 function (id) {
6622 this.itemSelectedEvent$$.next(id);
6623 };
6624 /**
6625 * @return {?}
6626 */
6627 VaPackageDetailsV2Component.prototype.emitGetItNow = /**
6628 * @return {?}
6629 */
6630 function () {
6631 this.getItNow.emit();
6632 };
6633 /**
6634 * @param {?} items
6635 * @return {?}
6636 */
6637 VaPackageDetailsV2Component.prototype.getParentsNameForItem = /**
6638 * @param {?} items
6639 * @return {?}
6640 */
6641 function (items) {
6642 if (items && items.length === 1 && items[0]) {
6643 return items[0].parent.name;
6644 }
6645 };
6646 VaPackageDetailsV2Component.decorators = [
6647 { type: core.Component, args: [{
6648 selector: 'va-package-details-v2',
6649 template: "<div *ngIf=\"pkg$$ | async as pkg\" class=\"page\">\n <va-header-container [iconUrl]=\"pkg.icon\"\n [title]=\"pkg.name\"\n [tagline]=\"pkg.tagline\"\n [prerequisite]=\"productNameForSingleAddon$ | async\"\n [chipLabels]=\"lmiCategories$ | async\"\n [pricing]=\"pkg.pricing\"\n [pricingLabel]=\"'FRONTEND.STORE.PRICING' | translate\"\n [showAction]=\"showActionButton\"\n [showPricing]=\"showPricing\"\n [actionLabel]=\"actionLabel | translate\"\n [actionEnabled]=true\n (actionSelected)=\"emitGetItNow()\"\n ></va-header-container>\n\n <ng-container *ngIf=\"pkg?.content\">\n <va-selling-info [description]=\"pkg.content\"></va-selling-info>\n </ng-container>\n\n <va-products-nav-v2 [items]=\"orderedLineItems$ | async\"\n [hideItemsNav]=\"pkg?.hide_product_icons_and_names\"\n (itemSelected)=\"selectItem($event)\"></va-products-nav-v2>\n\n <ng-container *ngIf=\"selectedItem$ | async as selectedItem\">\n <div *ngIf=\"!pkg?.hide_product_details\" class=\"package-content\">\n <div class=\"left-column\">\n <section *ngIf=\"selectedItem?.item?.description || selectedItem?.item?.keySellingPoints\">\n <va-selling-info [description]=\"selectedItem?.item?.description\"\n [keySellingPoints]=\"selectedItem?.item?.keySellingPoints\"></va-selling-info>\n </section>\n\n <section *ngIf=\"selectedItem?.item?.faqs?.length > 0 && selectedItem?.item?.faqs[0].question\">\n <h2 class=\"va-component-title\">{{ 'FRONTEND.STORE.FAQS' | translate }}</h2>\n <va-faqs [faqs]=\"selectedItem.item.faqs\"></va-faqs>\n </section>\n </div>\n\n <div class=\"right-column\">\n <section *ngIf=\"selectedItem?.item?.screenshotUrls?.length > 0\">\n <h2 class=\"va-component-title\">{{ 'FRONTEND.STORE.GALLERY' | translate }}</h2>\n <va-image-gallery [imageUrls]=\"selectedItem.item.screenshotUrls\"></va-image-gallery>\n </section>\n\n <section *ngIf=\"selectedItem?.item?.files?.length > 0\">\n <h2 class=\"va-component-title\">{{ 'FRONTEND.STORE.FILES' | translate }}</h2>\n <va-files [files]=\"selectedItem.item.files\"></va-files>\n </section>\n </div>\n </div>\n </ng-container>\n</div>\n",
6650 styles: [":host{display:block;font-size:14px;line-height:1.4}:host *{box-sizing:border-box}.va-component-title{font-size:24px;font-weight:300;margin-top:0}@media screen and (min-width:600px){.va-component-title{font-size:32px}}img{max-width:100%}va-icon{display:inline-block}.page{position:relative;margin:0 auto 20px;background:#fff;color:#212121;box-shadow:0 3px 10px rgba(33,33,33,.3);overflow:hidden;font-size:16px}.page .item-amount{color:#9e9e9e;font-size:14px;text-align:right;margin:0 24px 8px}section{padding:24px}.left-column{width:66%}@media screen and (max-width:600px){.left-column{width:100%}}.right-column{width:34%}.package-content{display:-webkit-box;display:flex}@media screen and (max-width:600px){.right-column{width:100%}.package-content{-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}}"]
6651 }] }
6652 ];
6653 /** @nocollapse */
6654 VaPackageDetailsV2Component.ctorParameters = function () { return [
6655 { type: core$1.TranslateService },
6656 { type: rxjs.Observable, decorators: [{ type: core.Optional }, { type: core.Inject, args: ['CURRENT_LANG',] }] }
6657 ]; };
6658 VaPackageDetailsV2Component.propDecorators = {
6659 showActionButton: [{ type: core.Input }],
6660 showPricing: [{ type: core.Input }],
6661 actionLabel: [{ type: core.Input }],
6662 pkg: [{ type: core.Input }],
6663 getItNow: [{ type: core.Output }]
6664 };
6665 return VaPackageDetailsV2Component;
6666 }());
6667 if (false) {
6668 /** @type {?} */
6669 VaPackageDetailsV2Component.prototype.showActionButton;
6670 /** @type {?} */
6671 VaPackageDetailsV2Component.prototype.showPricing;
6672 /** @type {?} */
6673 VaPackageDetailsV2Component.prototype.actionLabel;
6674 /** @type {?} */
6675 VaPackageDetailsV2Component.prototype.getItNow;
6676 /** @type {?} */
6677 VaPackageDetailsV2Component.prototype.pkg$$;
6678 /** @type {?} */
6679 VaPackageDetailsV2Component.prototype.itemSelectedEvent$$;
6680 /** @type {?} */
6681 VaPackageDetailsV2Component.prototype.selectedItem$;
6682 /** @type {?} */
6683 VaPackageDetailsV2Component.prototype.orderedLineItems$;
6684 /** @type {?} */
6685 VaPackageDetailsV2Component.prototype.productNameForSingleAddon$;
6686 /** @type {?} */
6687 VaPackageDetailsV2Component.prototype.lmiCategories$;
6688 /**
6689 * @type {?}
6690 * @private
6691 */
6692 VaPackageDetailsV2Component.prototype.translateService;
6693 }
6694
6695 /**
6696 * @fileoverview added by tsickle
6697 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
6698 */
6699 var VaPackageDetailsV2Module = /** @class */ (function () {
6700 function VaPackageDetailsV2Module(translateService, currentLang$, defaultLang$) {
6701 this.translateService = translateService;
6702 if (!this.translateService.translations.hasOwnProperty('en')) {
6703 this.translateService.reloadLang('en');
6704 }
6705 if (!this.translateService.translations.hasOwnProperty('cs')) {
6706 this.translateService.reloadLang('cs');
6707 }
6708 this.translateService.setTranslation('en', En.en, true);
6709 this.translateService.setTranslation('cs', Cs.cs, true);
6710 if (currentLang$) {
6711 currentLang$.subscribe((/**
6712 * @param {?} currentLang
6713 * @return {?}
6714 */
6715 function (currentLang) { return translateService.use(currentLang); }));
6716 }
6717 if (defaultLang$) {
6718 defaultLang$.subscribe((/**
6719 * @param {?} defaultLang
6720 * @return {?}
6721 */
6722 function (defaultLang) { return translateService.setDefaultLang(defaultLang); }));
6723 }
6724 }
6725 VaPackageDetailsV2Module.decorators = [
6726 { type: core.NgModule, args: [{
6727 imports: [
6728 uikit.VaImageGalleryModule,
6729 common.CommonModule,
6730 material.MatIconModule,
6731 uikit.VaSafeHtmlModule,
6732 uikit.VaIconModule,
6733 VaPricingModule,
6734 material.MatButtonModule,
6735 VaFilesModule,
6736 VaFaqsModule,
6737 VaSellingInfoModule,
6738 VaHeaderContainerModule,
6739 VaAddonListModule,
6740 VaProductsNavModule,
6741 core$1.TranslateModule.forChild()
6742 ],
6743 declarations: [VaPackageDetailsV2Component],
6744 exports: [VaPackageDetailsV2Component],
6745 entryComponents: [VaPackageDetailsV2Component]
6746 },] }
6747 ];
6748 /** @nocollapse */
6749 VaPackageDetailsV2Module.ctorParameters = function () { return [
6750 { type: core$1.TranslateService },
6751 { type: rxjs.Observable, decorators: [{ type: core.Optional }, { type: core.Inject, args: ['CURRENT_LANG',] }] },
6752 { type: rxjs.Observable, decorators: [{ type: core.Optional }, { type: core.Inject, args: ['DEFAULT_LANG',] }] }
6753 ]; };
6754 return VaPackageDetailsV2Module;
6755 }());
6756 if (false) {
6757 /**
6758 * @type {?}
6759 * @private
6760 */
6761 VaPackageDetailsV2Module.prototype.translateService;
6762 }
6763
6764 /**
6765 * @fileoverview added by tsickle
6766 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
6767 */
6768 /**
6769 * @record
6770 */
6771 function SalesPackage() { }
6772 if (false) {
6773 /** @type {?} */
6774 SalesPackage.prototype.formattedPrices;
6775 /** @type {?} */
6776 SalesPackage.prototype.packageId;
6777 /** @type {?} */
6778 SalesPackage.prototype.name;
6779 /** @type {?} */
6780 SalesPackage.prototype.icon;
6781 /** @type {?} */
6782 SalesPackage.prototype.productIds;
6783 /** @type {?} */
6784 SalesPackage.prototype.products;
6785 /** @type {?} */
6786 SalesPackage.prototype.addonsWithNoParent;
6787 /** @type {?} */
6788 SalesPackage.prototype.totalAddons;
6789 /** @type {?|undefined} */
6790 SalesPackage.prototype.activationStatus;
6791 }
6792 /**
6793 * @record
6794 */
6795 function SalesProduct() { }
6796 if (false) {
6797 /** @type {?} */
6798 SalesProduct.prototype.formattedPrices;
6799 /** @type {?} */
6800 SalesProduct.prototype.productId;
6801 /** @type {?} */
6802 SalesProduct.prototype.name;
6803 /** @type {?} */
6804 SalesProduct.prototype.icon;
6805 /** @type {?} */
6806 SalesProduct.prototype.tagline;
6807 /** @type {?|undefined} */
6808 SalesProduct.prototype.activationStatus;
6809 /** @type {?|undefined} */
6810 SalesProduct.prototype.editionId;
6811 /** @type {?|undefined} */
6812 SalesProduct.prototype.editionName;
6813 /** @type {?} */
6814 SalesProduct.prototype.addons;
6815 /** @type {?|undefined} */
6816 SalesProduct.prototype.parentInfo;
6817 }
6818 /**
6819 * @record
6820 */
6821 function ProductParentInfo() { }
6822 if (false) {
6823 /** @type {?} */
6824 ProductParentInfo.prototype.parentId;
6825 /** @type {?} */
6826 ProductParentInfo.prototype.parentName;
6827 /** @type {?} */
6828 ProductParentInfo.prototype.parentIconUrl;
6829 /** @type {?} */
6830 ProductParentInfo.prototype.multipleActivations;
6831 }
6832 /**
6833 * @record
6834 */
6835 function SalesAddon() { }
6836 if (false) {
6837 /** @type {?} */
6838 SalesAddon.prototype.parentId;
6839 /** @type {?} */
6840 SalesAddon.prototype.addonId;
6841 /** @type {?} */
6842 SalesAddon.prototype.name;
6843 /** @type {?} */
6844 SalesAddon.prototype.icon;
6845 /** @type {?} */
6846 SalesAddon.prototype.tagline;
6847 /** @type {?} */
6848 SalesAddon.prototype.parentName;
6849 /** @type {?} */
6850 SalesAddon.prototype.parentIcon;
6851 /** @type {?} */
6852 SalesAddon.prototype.multipleActivations;
6853 /** @type {?|undefined} */
6854 SalesAddon.prototype.activationStatus;
6855 }
6856 /**
6857 * @record
6858 */
6859 function PackageItemActivationStatus() { }
6860 if (false) {
6861 /** @type {?} */
6862 PackageItemActivationStatus.prototype.packageItemId;
6863 /** @type {?} */
6864 PackageItemActivationStatus.prototype.status;
6865 }
6866 /** @enum {number} */
6867 var ActivationStatus = {
6868 SUCCESS: 0,
6869 WARNING: 1,
6870 ERROR: 2,
6871 };
6872 ActivationStatus[ActivationStatus.SUCCESS] = 'SUCCESS';
6873 ActivationStatus[ActivationStatus.WARNING] = 'WARNING';
6874 ActivationStatus[ActivationStatus.ERROR] = 'ERROR';
6875 /**
6876 * @record
6877 */
6878 function StatusNotificationItem() { }
6879 if (false) {
6880 /** @type {?} */
6881 StatusNotificationItem.prototype.icon;
6882 /** @type {?} */
6883 StatusNotificationItem.prototype.text;
6884 /** @type {?} */
6885 StatusNotificationItem.prototype.status;
6886 }
6887 /**
6888 * @param {?} packages
6889 * @param {?} products
6890 * @param {?} addons
6891 * @return {?}
6892 */
6893 function buildSalesPackages(packages, products, addons) {
6894 if (!packages || packages.length < 1) {
6895 return [];
6896 }
6897 return packages.map((/**
6898 * @param {?} pkg
6899 * @return {?}
6900 */
6901 function (pkg) { return buildSalesPackageFromPackage(pkg, products, addons); }));
6902 }
6903 /**
6904 * @param {?} pkg
6905 * @param {?} products
6906 * @param {?} addons
6907 * @return {?}
6908 */
6909 function buildSalesPackageFromPackage(pkg, products, addons) {
6910 if (!pkg) {
6911 return null;
6912 }
6913 /** @type {?} */
6914 var salesProducts = buildSalesProducts(pkg, products, addons);
6915 // Addons can be in a package even if the parent product is not, this will create salesAddons with no parent
6916 /** @type {?} */
6917 var addonsWithNoParent = buildSalesAddonsWithNoParent(pkg, products, addons);
6918 return createSalesPackage(pkg, salesProducts, addonsWithNoParent);
6919 }
6920 /**
6921 * @param {?} pkg
6922 * @param {?} products
6923 * @param {?} addons
6924 * @return {?}
6925 */
6926 function buildSalesProducts(pkg, products, addons) {
6927 if (!(products && products.length && pkg.products && pkg.products.length)) {
6928 return [];
6929 }
6930 /** @type {?} */
6931 var productMap = new Map();
6932 products.forEach((/**
6933 * @param {?} product
6934 * @return {?}
6935 */
6936 function (product) { return productMap.set(product.productId, product); }));
6937 return pkg.products
6938 .map((/**
6939 * @param {?} productId
6940 * @return {?}
6941 */
6942 function (productId) {
6943 /** @type {?} */
6944 var productMatch = productMap.get(productId);
6945 /** @type {?} */
6946 var addonsInPackage = coerceAddonsForAddonKeys(addons, pkg.addon_keys);
6947 return productMatch ? buildSalesProductFromProduct(productMatch, addonsInPackage) : null;
6948 }))
6949 .filter((/**
6950 * @param {?} productItem
6951 * @return {?}
6952 */
6953 function (productItem) { return productItem; }));
6954 }
6955 /**
6956 * @param {?} addons
6957 * @param {?} addonKeys
6958 * @return {?}
6959 */
6960 function coerceAddonsForAddonKeys(addons, addonKeys) {
6961 if (!addons || addons.length === 0 || !addonKeys || addonKeys.length === 0) {
6962 return [];
6963 }
6964 return addons.reduce((/**
6965 * @param {?} addonsArray
6966 * @param {?} addon
6967 * @return {?}
6968 */
6969 function (addonsArray, addon) {
6970 /** @type {?} */
6971 var key = addonKeys.find((/**
6972 * @param {?} k
6973 * @return {?}
6974 */
6975 function (k) { return k.addonId === addon.addonId; }));
6976 if (key) {
6977 /** @type {?} */
6978 var quantity = key.quantity || 1;
6979 for (var i = 0; i < quantity; i++) {
6980 addonsArray.push(addon);
6981 }
6982 }
6983 return addonsArray;
6984 }), []);
6985 }
6986 /**
6987 * @param {?} pkg
6988 * @param {?} products
6989 * @param {?} addons
6990 * @return {?}
6991 */
6992 function buildSalesAddonsWithNoParent(pkg, products, addons) {
6993 if (!addons || addons.length < 1 || !pkg.addon_keys) {
6994 return [];
6995 }
6996 /** @type {?} */
6997 var productMap = new Map();
6998 products.forEach((/**
6999 * @param {?} product
7000 * @return {?}
7001 */
7002 function (product) { return productMap.set(product.productId, product); }));
7003 /** @type {?} */
7004 var addonsMap = new Map();
7005 addons.forEach((/**
7006 * @param {?} addon
7007 * @return {?}
7008 */
7009 function (addon) { return addonsMap.set(addon.addonId, addon); }));
7010 /** @type {?} */
7011 var addonsWithNoParent = pkg.addon_keys.reduce((/**
7012 * @param {?} addonArray
7013 * @param {?} addonKey
7014 * @return {?}
7015 */
7016 function (addonArray, addonKey) {
7017 if (pkg.products && pkg.products.some((/**
7018 * @param {?} productId
7019 * @return {?}
7020 */
7021 function (productId) { return productId === addonKey.appId; }))) {
7022 return addonArray || [];
7023 }
7024 /** @type {?} */
7025 var parentProduct = productMap.get(addonKey.appId);
7026 /** @type {?} */
7027 var parentName = parentProduct ? parentProduct.name : null;
7028 /** @type {?} */
7029 var parentIcon = parentProduct ? parentProduct.iconUrl : null;
7030 /** @type {?} */
7031 var quantity = addonKey.quantity || 1;
7032 /** @type {?} */
7033 var addon = addonsMap.get(addonKey.addonId);
7034 for (var i = 0; i < quantity; i++) {
7035 addonArray.push(createSalesAddon(addon, parentName, parentIcon));
7036 }
7037 return addonArray;
7038 }), []);
7039 return addonsWithNoParent;
7040 }
7041 /**
7042 * @param {?} product
7043 * @param {?} addons
7044 * @return {?}
7045 */
7046 function buildSalesProductFromProduct(product, addons) {
7047 if (!product) {
7048 return null;
7049 }
7050 if (!addons || addons.length < 1) {
7051 return createSalesProduct(product, null);
7052 }
7053 /** @type {?} */
7054 var productAddons = addons.filter((/**
7055 * @param {?} addon
7056 * @return {?}
7057 */
7058 function (addon) { return addon.appId === product.productId; }));
7059 /** @type {?} */
7060 var salesAddons = createSalesAddons(productAddons);
7061 return createSalesProduct(product, salesAddons);
7062 }
7063 /**
7064 * @param {?} pkg
7065 * @param {?} salesProducts
7066 * @param {?} addonsWithNoParent
7067 * @return {?}
7068 */
7069 function createSalesPackage(pkg, salesProducts, addonsWithNoParent) {
7070 var e_1, _a;
7071 /** @type {?} */
7072 var totalAddons = 0;
7073 try {
7074 for (var _b = __values(pkg.addon_keys || []), _c = _b.next(); !_c.done; _c = _b.next()) {
7075 var key = _c.value;
7076 totalAddons += key.quantity || 1;
7077 }
7078 }
7079 catch (e_1_1) { e_1 = { error: e_1_1 }; }
7080 finally {
7081 try {
7082 if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
7083 }
7084 finally { if (e_1) throw e_1.error; }
7085 }
7086 return {
7087 formattedPrices: pkg.priceStrings.join(', '),
7088 packageId: pkg.solution_id,
7089 name: pkg.name,
7090 icon: pkg.icon,
7091 productIds: pkg.products,
7092 products: salesProducts || [],
7093 addonsWithNoParent: addonsWithNoParent || [],
7094 totalAddons: totalAddons
7095 };
7096 }
7097 /**
7098 * @param {?} product
7099 * @param {?} salesAddons
7100 * @return {?}
7101 */
7102 function createSalesProduct(product, salesAddons) {
7103 /** @type {?} */
7104 var parentInfo;
7105 if (product instanceof ProductWithParent) {
7106 parentInfo = {
7107 parentId: product.parentId,
7108 parentName: product.parentName,
7109 parentIconUrl: product.parentIconUrl,
7110 multipleActivations: product.multipleActivations || false,
7111 };
7112 }
7113 return {
7114 formattedPrices: product.priceStrings.join(', '),
7115 productId: product.productId,
7116 name: product.name,
7117 tagline: product.tagline || '',
7118 icon: product.iconUrl,
7119 addons: salesAddons || [],
7120 editionId: product.editionId,
7121 editionName: product.editionName,
7122 parentInfo: parentInfo,
7123 };
7124 }
7125 /**
7126 * @param {?} addons
7127 * @return {?}
7128 */
7129 function createSalesAddons(addons) {
7130 return addons.map((/**
7131 * @param {?} addon
7132 * @return {?}
7133 */
7134 function (addon) { return createSalesAddon(addon); }));
7135 }
7136 /**
7137 * @param {?} addon
7138 * @param {?=} parentName
7139 * @param {?=} parentIcon
7140 * @return {?}
7141 */
7142 function createSalesAddon(addon, parentName, parentIcon) {
7143 return {
7144 parentId: addon.appId,
7145 addonId: addon.addonId,
7146 name: addon.title,
7147 tagline: addon.tagline || '',
7148 icon: addon.icon || '',
7149 multipleActivations: addon.multipleActivations,
7150 parentIcon: parentIcon || '',
7151 parentName: parentName || ''
7152 };
7153 }
7154 /**
7155 * @param {?} pkg
7156 * @param {?} products
7157 * @param {?} addons
7158 * @param {?} activationStatus
7159 * @return {?}
7160 */
7161 function createSalesPackageWithStatus(pkg, products, addons, activationStatus) {
7162 return {
7163 formattedPrices: pkg.formattedPrices,
7164 packageId: pkg.packageId,
7165 name: pkg.name,
7166 icon: pkg.icon,
7167 productIds: pkg.productIds,
7168 products: products || [],
7169 addonsWithNoParent: addons || [],
7170 activationStatus: activationStatus || null,
7171 totalAddons: pkg.totalAddons
7172 };
7173 }
7174 /**
7175 * @param {?} product
7176 * @param {?} addons
7177 * @param {?} activationStatus
7178 * @return {?}
7179 */
7180 function createSalesProductWithStatus(product, addons, activationStatus) {
7181 return {
7182 formattedPrices: product.formattedPrices,
7183 productId: product.productId,
7184 name: product.name,
7185 editionId: product.editionId,
7186 editionName: product.editionName,
7187 tagline: product.tagline,
7188 icon: product.icon,
7189 addons: addons || [],
7190 activationStatus: activationStatus || null,
7191 parentInfo: product.parentInfo || null,
7192 };
7193 }
7194 /**
7195 * @param {?} addon
7196 * @param {?} activationStatus
7197 * @return {?}
7198 */
7199 function createSalesAddonWithStatus(addon, activationStatus) {
7200 return {
7201 parentId: addon.parentId,
7202 addonId: addon.addonId,
7203 name: addon.name,
7204 tagline: addon.tagline,
7205 icon: addon.icon,
7206 parentIcon: addon.parentIcon,
7207 parentName: addon.parentName,
7208 multipleActivations: addon.multipleActivations,
7209 activationStatus: activationStatus || null
7210 };
7211 }
7212 /**
7213 * @param {?} salesPackages
7214 * @param {?} statuses
7215 * @return {?}
7216 */
7217 function addStatusesToSalesPackages(salesPackages, statuses) {
7218 if (!statuses || statuses.length === 0) {
7219 return salesPackages;
7220 }
7221 return salesPackages.map((/**
7222 * @param {?} salesPackage
7223 * @return {?}
7224 */
7225 function (salesPackage) {
7226 /** @type {?} */
7227 var newProducts = salesPackage.products.map((/**
7228 * @param {?} product
7229 * @return {?}
7230 */
7231 function (product) { return addStatusesToSalesProduct(product, statuses); }));
7232 /** @type {?} */
7233 var newAddonsWithNoParent = salesPackage.addonsWithNoParent.map((/**
7234 * @param {?} addon
7235 * @return {?}
7236 */
7237 function (addon) {
7238 /** @type {?} */
7239 var status = findStatus(statuses, addon.addonId);
7240 return addStatusesToSalesAddon(addon, status);
7241 }));
7242 /** @type {?} */
7243 var productStatuses = newProducts
7244 .map((/**
7245 * @param {?} product
7246 * @return {?}
7247 */
7248 function (product) { return product.activationStatus.status; }));
7249 /** @type {?} */
7250 var addonStatuses = newProducts
7251 .map((/**
7252 * @param {?} product
7253 * @return {?}
7254 */
7255 function (product) { return product.addons ? product.addons.map((/**
7256 * @param {?} addon
7257 * @return {?}
7258 */
7259 function (addon) { return addon.activationStatus.status; })) : []; }))
7260 .reduce((/**
7261 * @param {?} statusList
7262 * @param {?} reducedList
7263 * @return {?}
7264 */
7265 function (statusList, reducedList) { return reducedList.concat(statusList); }), []);
7266 /** @type {?} */
7267 var addonsWithNoParentStatuses = newAddonsWithNoParent
7268 .map((/**
7269 * @param {?} addon
7270 * @return {?}
7271 */
7272 function (addon) { return addon.activationStatus ? addon.activationStatus.status : null; }));
7273 /** @type {?} */
7274 var allStatuses = __spread(productStatuses, addonStatuses, addonsWithNoParentStatuses);
7275 /** @type {?} */
7276 var packageStatus = convertNumberToActivationStatus(Math.max.apply(Math, __spread(allStatuses)));
7277 /** @type {?} */
7278 var statusNotification = createStatusNotificationItemForPackage(packageStatus);
7279 return createSalesPackageWithStatus(salesPackage, newProducts, newAddonsWithNoParent, statusNotification);
7280 }));
7281 }
7282 /**
7283 * @param {?} product
7284 * @param {?} statuses
7285 * @return {?}
7286 */
7287 function addStatusesToSalesProduct(product, statuses) {
7288 if (!statuses || statuses.length === 0) {
7289 return product;
7290 }
7291 /** @type {?} */
7292 var productStatus = findStatus(statuses, product.productId);
7293 /** @type {?} */
7294 var statusNotification = createStatusNotificationItemForPackageItem(productStatus);
7295 if (!product.addons) {
7296 return createSalesProductWithStatus(product, null, statusNotification);
7297 }
7298 /** @type {?} */
7299 var newSalesAddons = product.addons.map((/**
7300 * @param {?} addon
7301 * @return {?}
7302 */
7303 function (addon) {
7304 /** @type {?} */
7305 var addonStatus = findStatus(statuses, addon.addonId);
7306 return addStatusesToSalesAddon(addon, addonStatus);
7307 }));
7308 return createSalesProductWithStatus(product, newSalesAddons, statusNotification);
7309 }
7310 /**
7311 * @param {?} addon
7312 * @param {?} status
7313 * @return {?}
7314 */
7315 function addStatusesToSalesAddon(addon, status) {
7316 /** @type {?} */
7317 var addonStatusNotification = createStatusNotificationItemForPackageItem(status);
7318 return createSalesAddonWithStatus(addon, addonStatusNotification);
7319 }
7320 /**
7321 * @param {?} statuses
7322 * @param {?} id
7323 * @return {?}
7324 */
7325 function findStatus(statuses, id) {
7326 if (!statuses || statuses.length <= 0) {
7327 return null;
7328 }
7329 /** @type {?} */
7330 var statusIndex = statuses.findIndex((/**
7331 * @param {?} s
7332 * @return {?}
7333 */
7334 function (s) {
7335 return s.packageItemId === id;
7336 }));
7337 if (statusIndex < 0) {
7338 return null;
7339 }
7340 /** @type {?} */
7341 var status = statuses[statusIndex].status;
7342 statuses.splice(statusIndex, 1);
7343 return status;
7344 }
7345 /**
7346 * @param {?} status
7347 * @return {?}
7348 */
7349 function createStatusNotificationItemForPackageItem(status) {
7350 switch (status) {
7351 case ActivationStatus.SUCCESS:
7352 return { icon: 'check_circle', status: status, text: 'Activated' };
7353 case ActivationStatus.WARNING:
7354 return { icon: 'warning', status: status, text: 'Already Activated' };
7355 default:
7356 return { icon: 'error', status: status, text: 'Activation Errors' };
7357 }
7358 }
7359 /**
7360 * @param {?} status
7361 * @return {?}
7362 */
7363 function createStatusNotificationItemForPackage(status) {
7364 switch (status) {
7365 case ActivationStatus.SUCCESS:
7366 return { icon: 'check_circle', status: status, text: 'Activated' };
7367 case ActivationStatus.WARNING:
7368 return { icon: 'warning', status: status, text: 'Activation Warnings' };
7369 default:
7370 return { icon: 'error', status: status, text: 'Activation Errors Occured' };
7371 }
7372 }
7373 /**
7374 * @param {?} number
7375 * @return {?}
7376 */
7377 function convertNumberToActivationStatus(number) {
7378 switch (number) {
7379 case 0:
7380 return ActivationStatus.SUCCESS;
7381 case 1:
7382 return ActivationStatus.WARNING;
7383 default:
7384 return ActivationStatus.ERROR;
7385 }
7386 }
7387
7388 /**
7389 * @fileoverview added by tsickle
7390 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
7391 */
7392 /** @enum {string} */
7393 var ListIndent = {
7394 INDENT_ZERO: 'indent-zero',
7395 INDENT_ONE: 'indent-one',
7396 INDENT_TWO: 'indent-two',
7397 };
7398 var VaPackageDropdownItemComponent = /** @class */ (function () {
7399 function VaPackageDropdownItemComponent() {
7400 this.enableDropdown = false;
7401 this.indent = ListIndent.INDENT_ZERO;
7402 this.itemToggled = new core.EventEmitter();
7403 }
7404 /**
7405 * @return {?}
7406 */
7407 VaPackageDropdownItemComponent.prototype.ngOnInit = /**
7408 * @return {?}
7409 */
7410 function () {
7411 };
7412 /**
7413 * @return {?}
7414 */
7415 VaPackageDropdownItemComponent.prototype.toggleItem = /**
7416 * @return {?}
7417 */
7418 function () {
7419 this.itemToggled.emit(null);
7420 };
7421 /**
7422 * @param {?} status
7423 * @return {?}
7424 */
7425 VaPackageDropdownItemComponent.prototype.isActivatedStatus = /**
7426 * @param {?} status
7427 * @return {?}
7428 */
7429 function (status) {
7430 return status === ActivationStatus.SUCCESS;
7431 };
7432 /**
7433 * @param {?} status
7434 * @return {?}
7435 */
7436 VaPackageDropdownItemComponent.prototype.isWarningStatus = /**
7437 * @param {?} status
7438 * @return {?}
7439 */
7440 function (status) {
7441 return status === ActivationStatus.WARNING;
7442 };
7443 /**
7444 * @param {?} status
7445 * @return {?}
7446 */
7447 VaPackageDropdownItemComponent.prototype.isErrorStatus = /**
7448 * @param {?} status
7449 * @return {?}
7450 */
7451 function (status) {
7452 return status === ActivationStatus.ERROR;
7453 };
7454 VaPackageDropdownItemComponent.decorators = [
7455 { type: core.Component, args: [{
7456 selector: 'va-package-dropdown-item',
7457 template: "<mat-list-item [ngClass]=\"indent\" class=\"va-dropdown-list-item\">\n <va-icon *ngIf=\"!secondaryIconUrl && !secondaryIconName; else dualIcon\" mat-list-avatar [name]=\"title\" [iconUrl]=\"iconUrl\" [diameter]=\"40\"></va-icon>\n <h3 mat-line class=\"va-dropdown-list-item__title\">{{ title }}\n <va-badge *ngIf=\"titleBadge\" small color=\"blue-solid\" class=\"va-dropdown-list-item__title-badge\">{{ titleBadge }}</va-badge>\n <span *ngIf=\"titleDescriptor\" class=\"va-dropdown-list-item__title-descriptor\">{{ titleDescriptor }}</span>\n </h3>\n <p class=\"package-dropdown-font\" mat-line>{{subtitle}}</p>\n\n <span *ngIf=\"!statusItem\" class=\"va-dropdown-list-item__layout\">\n <p class=\"va-dropdown-list-item__layout va-dropdown-list-item__notice\">{{ description }}</p>\n <ng-container *ngIf=\"enableDropdown; then dropdownButton\"></ng-container>\n </span>\n\n <span *ngIf=\"statusItem\" class=\"va-dropdown-list-item__layout va-dropdown-list-item__status\">\n <div [ngClass]=\"{\n 'activated': isActivatedStatus(statusItem.status),\n 'warning': isWarningStatus(statusItem.status),\n 'error': isErrorStatus(statusItem.status)}\">\n <mat-icon>{{statusItem.icon}}</mat-icon>\n </div>\n <p class=\"va-dropdown-list-item__notice\"\n [ngClass]=\"{\n 'activated': isActivatedStatus(statusItem.status),\n 'warning': isWarningStatus(statusItem.status),\n 'error': isErrorStatus(statusItem.status)}\">\n {{ statusItem.text }}\n </p>\n <ng-container *ngIf=\"enableDropdown; then dropdownButton\"></ng-container>\n </span>\n</mat-list-item>\n\n\n<ng-template #dropdownButton>\n <button *ngIf=\"enableDropdown\" mat-icon-button type=\"button\" (click)=\"toggleItem()\">\n <mat-icon mat-list-icon\n class=\"dropdown-icon\"\n [ngClass]=\"{'dropdown-icon-rotate-up': !toggleValue, 'dropdown-icon-rotate-down': toggleValue}\">\n keyboard_arrow_down\n </mat-icon>\n </button>\n</ng-template>\n\n<ng-template #dualIcon>\n <div class=\"dual-icon\">\n <va-icon mat-list-avatar [iconUrl]=\"iconUrl\" [name]=\"title\" [diameter]=\"40\"></va-icon>\n <va-icon mat-list-avatar class=\"secondary-icon\" [iconUrl]=\"secondaryIconUrl\" [diameter]=\"20\" [name]=\"secondaryIconName\"></va-icon>\n </div>\n</ng-template>\n",
7458 styles: [".va-dropdown-list-item{border-bottom:1px solid rgba(0,0,0,.12)}mat-list-item .va-dropdown-list-item__title{font-weight:700}.va-dropdown-list-item__title-badge{padding-bottom:4px}.indent-one{padding-left:30px}.va-dropdown-list-item__title-descriptor{font-size:11px;font-weight:700;font-style:italic}.indent-two{padding-left:30px}.indent-two .mat-list-avatar{margin-left:40px}.dual-icon{position:relative;display:inline-block;-webkit-box-ordinal-group:0;order:-1;margin-right:16px}.dual-icon .secondary-icon{position:absolute;border-radius:50%;bottom:-24px;right:-24px}.va-dropdown-list-item__layout{display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;-webkit-box-align:center;align-items:center}.va-dropdown-list-item__layout .va-dropdown-list-item__notice{width:-webkit-max-content;width:-moz-max-content;width:max-content;font-style:italic}@media screen and (max-width:500px){.va-dropdown-list-item__layout p{display:none}}.va-dropdown-list-item__layout mat-icon{padding:0}.va-dropdown-list-item__layout button{padding:0;min-width:0}.va-dropdown-list-item__layout button .dropdown-icon{color:rgba(0,0,0,.54)}.va-dropdown-list-item__layout button .dropdown-icon-rotate-down{-webkit-transform:rotate(180deg);transform:rotate(180deg);-webkit-transition:.4s;transition:.4s;pointer-events:none}.va-dropdown-list-item__layout button .dropdown-icon-rotate-up{-webkit-transform:rotate(0);transform:rotate(0);-webkit-transition:.4s;transition:.4s;pointer-events:none}.va-dropdown-list-item__status{display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;-webkit-box-align:center;align-items:center}.va-dropdown-list-item__status p{padding-left:6px;font-size:14px;white-space:nowrap}.va-dropdown-list-item__status .activated{color:#4caf50}.va-dropdown-list-item__status .warning{color:#ffa000}.va-dropdown-list-item__status .error{color:#c62828}", ".package-dropdown-font,.product-dropdown-font{color:rgba(0,0,0,.54);font-size:14px;font-weight:400}.package-list-container{border-top:1px solid rgba(0,0,0,.12);padding:0}.package-list-container mat-list{padding:0}.package-dropdown-stencil-display{display:-webkit-box;display:flex;width:100%;-webkit-box-flex:1;flex-grow:1}.package-dropdown-stencil-display va-icon{margin-right:20px}.package-dropdown-stencil-display .stencil-text{width:inherit;display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;-webkit-box-pack:center;justify-content:center}.package-dropdown-stencil-display .stencil-text .stencil-title{height:32px;width:40%;margin-bottom:5px!important;margin-top:0!important}.package-dropdown-stencil-display .stencil-text .stencil-tagline{height:32px;width:inherit}.product-or-addon-list{background-color:rgba(0,0,0,.04);overflow:hidden}"]
7459 }] }
7460 ];
7461 VaPackageDropdownItemComponent.propDecorators = {
7462 title: [{ type: core.Input }],
7463 titleBadge: [{ type: core.Input }],
7464 titleDescriptor: [{ type: core.Input }],
7465 iconUrl: [{ type: core.Input }],
7466 secondaryIconUrl: [{ type: core.Input }],
7467 secondaryIconName: [{ type: core.Input }],
7468 subtitle: [{ type: core.Input }],
7469 statusItem: [{ type: core.Input }],
7470 enableDropdown: [{ type: core.Input }],
7471 indent: [{ type: core.Input }],
7472 toggleValue: [{ type: core.Input }],
7473 description: [{ type: core.Input }],
7474 itemToggled: [{ type: core.Output }]
7475 };
7476 return VaPackageDropdownItemComponent;
7477 }());
7478 if (false) {
7479 /** @type {?} */
7480 VaPackageDropdownItemComponent.prototype.title;
7481 /** @type {?} */
7482 VaPackageDropdownItemComponent.prototype.titleBadge;
7483 /** @type {?} */
7484 VaPackageDropdownItemComponent.prototype.titleDescriptor;
7485 /** @type {?} */
7486 VaPackageDropdownItemComponent.prototype.iconUrl;
7487 /** @type {?} */
7488 VaPackageDropdownItemComponent.prototype.secondaryIconUrl;
7489 /** @type {?} */
7490 VaPackageDropdownItemComponent.prototype.secondaryIconName;
7491 /** @type {?} */
7492 VaPackageDropdownItemComponent.prototype.subtitle;
7493 /** @type {?} */
7494 VaPackageDropdownItemComponent.prototype.statusItem;
7495 /** @type {?} */
7496 VaPackageDropdownItemComponent.prototype.enableDropdown;
7497 /** @type {?} */
7498 VaPackageDropdownItemComponent.prototype.indent;
7499 /** @type {?} */
7500 VaPackageDropdownItemComponent.prototype.toggleValue;
7501 /** @type {?} */
7502 VaPackageDropdownItemComponent.prototype.description;
7503 /** @type {?} */
7504 VaPackageDropdownItemComponent.prototype.itemToggled;
7505 }
7506
7507 /**
7508 * @fileoverview added by tsickle
7509 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
7510 */
7511 /**
7512 * @record
7513 */
7514 function OrderLengthsForToggling() { }
7515 if (false) {
7516 /** @type {?} */
7517 OrderLengthsForToggling.prototype.packages;
7518 /** @type {?} */
7519 OrderLengthsForToggling.prototype.products;
7520 }
7521 var VaPackageDropdownComponent = /** @class */ (function () {
7522 function VaPackageDropdownComponent() {
7523 // controls whether only one dropdown can be expanded at a time
7524 this.singularDropdown = false;
7525 // hides pricing
7526 this.hidePricing = false;
7527 this.packageProductIndent = ListIndent.INDENT_ONE;
7528 this.packageAddonWithoutProductIndent = ListIndent.INDENT_ONE;
7529 this.packageAddonWithProductIndent = ListIndent.INDENT_TWO;
7530 this.productAddonIndent = ListIndent.INDENT_ONE;
7531 this.packages$$ = new rxjs.ReplaySubject(1);
7532 this.products$$ = new rxjs.ReplaySubject(1);
7533 this.standAloneProducts$$ = new rxjs.ReplaySubject(1);
7534 this.statuses$$ = new rxjs.BehaviorSubject([]);
7535 this.addons$$ = new rxjs.ReplaySubject(1);
7536 this.orderItemLengths$$ = new rxjs.BehaviorSubject((/** @type {?} */ ({
7537 packages: 0,
7538 products: 0
7539 })));
7540 this.packageToggles = [];
7541 this.productToggles = [];
7542 }
7543 Object.defineProperty(VaPackageDropdownComponent.prototype, "packages", {
7544 // packages in dropdown
7545 set:
7546 // packages in dropdown
7547 /**
7548 * @param {?} packages
7549 * @return {?}
7550 */
7551 function (packages) {
7552 this.packages$$.next(packages);
7553 },
7554 enumerable: true,
7555 configurable: true
7556 });
7557 Object.defineProperty(VaPackageDropdownComponent.prototype, "products", {
7558 // products within given packages
7559 set:
7560 // products within given packages
7561 /**
7562 * @param {?} products
7563 * @return {?}
7564 */
7565 function (products) {
7566 this.products$$.next(products);
7567 },
7568 enumerable: true,
7569 configurable: true
7570 });
7571 Object.defineProperty(VaPackageDropdownComponent.prototype, "standAloneProducts", {
7572 // products not associated with a package
7573 set:
7574 // products not associated with a package
7575 /**
7576 * @param {?} standAloneProducts
7577 * @return {?}
7578 */
7579 function (standAloneProducts) {
7580 this.standAloneProducts$$.next(standAloneProducts);
7581 },
7582 enumerable: true,
7583 configurable: true
7584 });
7585 Object.defineProperty(VaPackageDropdownComponent.prototype, "statuses", {
7586 // statuses for all products and addons
7587 set:
7588 // statuses for all products and addons
7589 /**
7590 * @param {?} statuses
7591 * @return {?}
7592 */
7593 function (statuses) {
7594 this.statuses$$.next(statuses);
7595 },
7596 enumerable: true,
7597 configurable: true
7598 });
7599 Object.defineProperty(VaPackageDropdownComponent.prototype, "addons", {
7600 // addons within given packages
7601 set:
7602 // addons within given packages
7603 /**
7604 * @param {?} addons
7605 * @return {?}
7606 */
7607 function (addons) {
7608 this.addons$$.next(addons);
7609 },
7610 enumerable: true,
7611 configurable: true
7612 });
7613 /**
7614 * @return {?}
7615 */
7616 VaPackageDropdownComponent.prototype.ngOnInit = /**
7617 * @return {?}
7618 */
7619 function () {
7620 var _this = this;
7621 /** @type {?} */
7622 var packages$ = this.packages$$.pipe(operators.filter((/**
7623 * @param {?} packages
7624 * @return {?}
7625 */
7626 function (packages) { return packages !== null; })));
7627 /** @type {?} */
7628 var products$ = this.products$$.pipe(operators.filter((/**
7629 * @param {?} products
7630 * @return {?}
7631 */
7632 function (products) { return products !== null; })));
7633 /** @type {?} */
7634 var addons$ = this.addons$$.pipe(operators.filter((/**
7635 * @param {?} addons
7636 * @return {?}
7637 */
7638 function (addons) { return addons !== null; })));
7639 /** @type {?} */
7640 var salesPackage$ = rxjs.zip(packages$, products$, addons$).pipe(operators.tap((/**
7641 * @param {?} __0
7642 * @return {?}
7643 */
7644 function (_a) {
7645 var _b = __read(_a, 3), packages = _b[0], products = _b[1], _ = _b[2];
7646 _this.orderItemLengths$$.next((/** @type {?} */ ({
7647 packages: packages.length,
7648 products: products.length
7649 })));
7650 })), operators.map((/**
7651 * @param {?} __0
7652 * @return {?}
7653 */
7654 function (_a) {
7655 var _b = __read(_a, 3), packages = _b[0], products = _b[1], addons = _b[2];
7656 return buildSalesPackages(packages, products, addons);
7657 })));
7658 this.salesPackages$ = rxjs.combineLatest(salesPackage$, this.statuses$$).pipe(operators.map((/**
7659 * @param {?} __0
7660 * @return {?}
7661 */
7662 function (_a) {
7663 var _b = __read(_a, 2), salesPackages = _b[0], statuses = _b[1];
7664 return addStatusesToSalesPackages(salesPackages, statuses);
7665 })), operators.startWith([]));
7666 this.salesProducts$ = rxjs.combineLatest(this.standAloneProducts$$, this.statuses$$).pipe(operators.filter((/**
7667 * @param {?} __0
7668 * @return {?}
7669 */
7670 function (_a) {
7671 var _b = __read(_a, 2), products = _b[0], _ = _b[1];
7672 return products !== null;
7673 })), operators.map((/**
7674 * @param {?} __0
7675 * @return {?}
7676 */
7677 function (_a) {
7678 var _b = __read(_a, 2), products = _b[0], statuses = _b[1];
7679 return products.map((/**
7680 * @param {?} p
7681 * @return {?}
7682 */
7683 function (p) {
7684 /** @type {?} */
7685 var addons = p.addons || null;
7686 /** @type {?} */
7687 var salesProducts = buildSalesProductFromProduct(p, addons);
7688 return addStatusesToSalesProduct(salesProducts, statuses);
7689 }));
7690 })), operators.startWith([]));
7691 this.templateData$ = rxjs.combineLatest(this.salesPackages$, this.salesProducts$).pipe(operators.map((/**
7692 * @param {?} __0
7693 * @return {?}
7694 */
7695 function (_a) {
7696 var _b = __read(_a, 2), packages = _b[0], products = _b[1];
7697 return ({ packages: packages, products: products });
7698 })));
7699 };
7700 /**
7701 * @return {?}
7702 */
7703 VaPackageDropdownComponent.prototype.openAllDropdowns = /**
7704 * @return {?}
7705 */
7706 function () {
7707 for (var x = 0; x < this.orderItemLengths$$.getValue().packages; x++) {
7708 this.packageToggles[x] = true;
7709 }
7710 for (var x = 0; x < this.orderItemLengths$$.getValue().products; x++) {
7711 this.productToggles[x] = true;
7712 }
7713 };
7714 /**
7715 * @param {?} indexToToggle
7716 * @return {?}
7717 */
7718 VaPackageDropdownComponent.prototype.togglePackage = /**
7719 * @param {?} indexToToggle
7720 * @return {?}
7721 */
7722 function (indexToToggle) {
7723 if (this.singularDropdown) {
7724 /** @type {?} */
7725 var openedIndex = this.packageToggles.findIndex((/**
7726 * @param {?} value
7727 * @return {?}
7728 */
7729 function (value) { return value === true; }));
7730 if (openedIndex !== indexToToggle) {
7731 this.packageToggles[openedIndex] = false;
7732 }
7733 /** @type {?} */
7734 var productOpenedIndex = this.productToggles.findIndex((/**
7735 * @param {?} value
7736 * @return {?}
7737 */
7738 function (value) { return value === true; }));
7739 if (productOpenedIndex > -1) {
7740 this.productToggles[productOpenedIndex] = false;
7741 }
7742 }
7743 this.packageToggles[indexToToggle] = !this.packageToggles[indexToToggle];
7744 };
7745 /**
7746 * @param {?} indexToToggle
7747 * @return {?}
7748 */
7749 VaPackageDropdownComponent.prototype.toggleProduct = /**
7750 * @param {?} indexToToggle
7751 * @return {?}
7752 */
7753 function (indexToToggle) {
7754 if (this.singularDropdown) {
7755 /** @type {?} */
7756 var openedIndex = this.productToggles.findIndex((/**
7757 * @param {?} value
7758 * @return {?}
7759 */
7760 function (value) { return value === true; }));
7761 if (openedIndex !== indexToToggle) {
7762 this.productToggles[openedIndex] = false;
7763 }
7764 /** @type {?} */
7765 var packageOpenedIndex = this.packageToggles.findIndex((/**
7766 * @param {?} value
7767 * @return {?}
7768 */
7769 function (value) { return value === true; }));
7770 if (packageOpenedIndex > -1) {
7771 this.packageToggles[packageOpenedIndex] = false;
7772 }
7773 }
7774 this.productToggles[indexToToggle] = !this.productToggles[indexToToggle];
7775 };
7776 /**
7777 * @param {?} product
7778 * @return {?}
7779 */
7780 VaPackageDropdownComponent.prototype.standAloneProductDescription = /**
7781 * @param {?} product
7782 * @return {?}
7783 */
7784 function (product) {
7785 if (product.addons && product.addons.length > 0) {
7786 /** @type {?} */
7787 var description = "Contains " + product.addons.length;
7788 description = product.addons.length === 1 ? description + " Addon" : description + " Addons";
7789 return description;
7790 }
7791 return '';
7792 };
7793 /**
7794 * @param {?} product
7795 * @return {?}
7796 */
7797 VaPackageDropdownComponent.prototype.standAloneProductWithParentDescription = /**
7798 * @param {?} product
7799 * @return {?}
7800 */
7801 function (product) {
7802 if (!product.parentInfo) {
7803 return '';
7804 }
7805 return "(Requires " + product.parentInfo.parentName + ")";
7806 };
7807 /**
7808 * @param {?} pkg
7809 * @return {?}
7810 */
7811 VaPackageDropdownComponent.prototype.packageDescription = /**
7812 * @param {?} pkg
7813 * @return {?}
7814 */
7815 function (pkg) {
7816 /** @type {?} */
7817 var hasProducts = pkg.products && pkg.products.length > 0;
7818 if (!hasProducts && pkg.totalAddons === 0) {
7819 return 'No Items in Package';
7820 }
7821 /** @type {?} */
7822 var description = '';
7823 /** @type {?} */
7824 var hasOneProduct = pkg.products && pkg.products.length === 1;
7825 if (hasProducts || pkg.totalAddons > 0) {
7826 description = 'Contains ';
7827 }
7828 if (hasProducts) {
7829 description = description + " " + pkg.products.length;
7830 description = hasOneProduct ? description + " Product" : description + " Products";
7831 }
7832 if (hasProducts && pkg.totalAddons > 0) {
7833 description = description + " & " + pkg.totalAddons;
7834 description = pkg.totalAddons === 1 ? description + " Addon" : description + " Addons";
7835 }
7836 return description;
7837 };
7838 VaPackageDropdownComponent.decorators = [
7839 { type: core.Component, args: [{
7840 selector: 'va-package-dropdown',
7841 animations: [
7842 animations.trigger('listAnimationStart', [
7843 animations.state('void', animations.style({ height: '0px' })),
7844 animations.state('*', animations.style({ height: '*' })),
7845 animations.transition('void => *', [animations.animate('0.25s ease')]),
7846 animations.transition('* => void', [animations.animate('0.25s ease')])
7847 ])
7848 ],
7849 template: "<ng-container *ngIf=\"templateData$ | async as data\">\n <mat-card class=\"package-list-container\" *ngIf=\"data.products?.length > 0 || data.packages?.length > 0 else loading\">\n <mat-list>\n <div class=\"package-list\" *ngFor=\"let package of data.packages; let packageIndex = index\">\n\n <va-package-dropdown-item\n [title]=\"package.name\"\n [iconUrl]=\"package.icon\"\n [subtitle]=\"hidePricing ? '' : package.formattedPrices\"\n [statusItem]=\"package.activationStatus\"\n [description]=\"packageDescription(package)\"\n [enableDropdown]=\"package.products?.length > 0 || package.addonsWithNoParent?.length > 0\"\n [toggleValue]=\"packageToggles[packageIndex]\"\n (itemToggled)=\"togglePackage(packageIndex)\"\n ></va-package-dropdown-item>\n\n <mat-list class=\"product-or-addon-list package-dropdown-font\" *ngIf=\"packageToggles[packageIndex]\"\n [@listAnimationStart]>\n <div *ngFor=\"let product of package.products\">\n <va-package-dropdown-item\n [title]=\"product.name\"\n [subtitle]=\"product.tagline\"\n [titleBadge]=\"product.editionName\"\n [iconUrl]=\"product.icon\"\n [statusItem]=\"product.activationStatus\"\n [indent]=\"packageProductIndent\"\n ></va-package-dropdown-item>\n\n <va-package-dropdown-item\n *ngFor=\"let addon of product.addons\"\n [title]=\"addon.name\"\n [subtitle]=\"addon.tagline\"\n [iconUrl]=\"addon.icon\"\n [statusItem]=\"addon.activationStatus\"\n [indent]=\"packageAddonWithProductIndent\"\n ></va-package-dropdown-item>\n </div>\n\n <va-package-dropdown-item\n *ngFor=\"let addon of package.addonsWithNoParent\"\n [title]=\"addon.name\"\n [titleDescriptor]=\"'FRONTEND.STORE.REQUIRES_DESCRIPTOR' | translate: {requirementName: addon.parentName}\"\n [subtitle]=\"addon.tagline\"\n [iconUrl]=\"addon.icon\"\n [secondaryIconUrl]=\"addon.parentIcon\"\n [secondaryIconName]=\"addon.parentName\"\n [statusItem]=\"addon.activationStatus\"\n [indent]=\"packageAddonWithoutProductIndent\"\n ></va-package-dropdown-item>\n </mat-list>\n </div>\n\n <div class=\"product-list\" *ngFor=\"let product of data.products; let productIndex = index\">\n <va-package-dropdown-item\n [title]=\"product.name\"\n [titleBadge]=\"product.editionName\"\n [titleDescriptor]=\"standAloneProductWithParentDescription(product)\"\n [iconUrl]=\"product.icon\"\n [subtitle]=\"hidePricing ? '' : product.formattedPrices\"\n [secondaryIconUrl]=\"product.parentInfo?.parentIconUrl\"\n [secondaryIconName]=\"product.parentInfo?.parentName\"\n [statusItem]=\"product.activationStatus\"\n [description]=\"standAloneProductDescription(product)\"\n [enableDropdown]=\"product.addons?.length > 0\"\n [toggleValue]=\"productToggles[productIndex]\"\n (itemToggled)=\"toggleProduct(productIndex)\"\n ></va-package-dropdown-item>\n\n <mat-list class=\"product-or-addon-list product-dropdown-font\" *ngIf=\"productToggles[productIndex]\"\n [@listAnimationStart]>\n <va-package-dropdown-item\n *ngFor=\"let addon of product.addons\"\n [title]=\"addon.name\"\n [subtitle]=\"addon.tagline\"\n [iconUrl]=\"addon.icon\"\n [statusItem]=\"addon.activationStatus\"\n [indent]=\"productAddonIndent\"\n ></va-package-dropdown-item>\n </mat-list>\n </div>\n\n </mat-list>\n </mat-card>\n</ng-container>\n\n<ng-template #loading>\n <mat-card>\n <div class=\"package-dropdown-stencil-display\">\n <va-icon [iconUrl]=\"\"></va-icon>\n <div class=\"stencil-text\">\n <h1 class=\"stencil-title stencil-shimmer\"></h1>\n <span class=\"stencil-tagline stencil-shimmer\"></span>\n </div>\n </div>\n </mat-card>\n</ng-template>\n",
7850 styles: [".package-dropdown-font,.product-dropdown-font{color:rgba(0,0,0,.54);font-size:14px;font-weight:400}.package-list-container{border-top:1px solid rgba(0,0,0,.12);padding:0}.package-list-container mat-list{padding:0}.package-dropdown-stencil-display{display:-webkit-box;display:flex;width:100%;-webkit-box-flex:1;flex-grow:1}.package-dropdown-stencil-display va-icon{margin-right:20px}.package-dropdown-stencil-display .stencil-text{width:inherit;display:-webkit-box;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;-webkit-box-pack:center;justify-content:center}.package-dropdown-stencil-display .stencil-text .stencil-title{height:32px;width:40%;margin-bottom:5px!important;margin-top:0!important}.package-dropdown-stencil-display .stencil-text .stencil-tagline{height:32px;width:inherit}.product-or-addon-list{background-color:rgba(0,0,0,.04);overflow:hidden}"]
7851 }] }
7852 ];
7853 VaPackageDropdownComponent.propDecorators = {
7854 packages: [{ type: core.Input }],
7855 products: [{ type: core.Input }],
7856 standAloneProducts: [{ type: core.Input }],
7857 statuses: [{ type: core.Input }],
7858 addons: [{ type: core.Input }],
7859 singularDropdown: [{ type: core.Input }],
7860 hidePricing: [{ type: core.Input }]
7861 };
7862 return VaPackageDropdownComponent;
7863 }());
7864 if (false) {
7865 /** @type {?} */
7866 VaPackageDropdownComponent.prototype.singularDropdown;
7867 /** @type {?} */
7868 VaPackageDropdownComponent.prototype.hidePricing;
7869 /** @type {?} */
7870 VaPackageDropdownComponent.prototype.packageProductIndent;
7871 /** @type {?} */
7872 VaPackageDropdownComponent.prototype.packageAddonWithoutProductIndent;
7873 /** @type {?} */
7874 VaPackageDropdownComponent.prototype.packageAddonWithProductIndent;
7875 /** @type {?} */
7876 VaPackageDropdownComponent.prototype.productAddonIndent;
7877 /** @type {?} */
7878 VaPackageDropdownComponent.prototype.packages$$;
7879 /** @type {?} */
7880 VaPackageDropdownComponent.prototype.products$$;
7881 /** @type {?} */
7882 VaPackageDropdownComponent.prototype.standAloneProducts$$;
7883 /** @type {?} */
7884 VaPackageDropdownComponent.prototype.statuses$$;
7885 /** @type {?} */
7886 VaPackageDropdownComponent.prototype.addons$$;
7887 /** @type {?} */
7888 VaPackageDropdownComponent.prototype.orderItemLengths$$;
7889 /** @type {?} */
7890 VaPackageDropdownComponent.prototype.templateData$;
7891 /** @type {?} */
7892 VaPackageDropdownComponent.prototype.salesPackages$;
7893 /** @type {?} */
7894 VaPackageDropdownComponent.prototype.salesProducts$;
7895 /** @type {?} */
7896 VaPackageDropdownComponent.prototype.packageToggles;
7897 /** @type {?} */
7898 VaPackageDropdownComponent.prototype.productToggles;
7899 }
7900
7901 /**
7902 * @fileoverview added by tsickle
7903 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
7904 */
7905 var VaPackageDropdownModule = /** @class */ (function () {
7906 function VaPackageDropdownModule(translateService, currentLang$, defaultLang$) {
7907 this.translateService = translateService;
7908 if (!this.translateService.translations.hasOwnProperty('en')) {
7909 this.translateService.reloadLang('en');
7910 }
7911 if (!this.translateService.translations.hasOwnProperty('cs')) {
7912 this.translateService.reloadLang('cs');
7913 }
7914 this.translateService.setTranslation('en', En.en, true);
7915 this.translateService.setTranslation('cs', Cs.cs, true);
7916 if (currentLang$) {
7917 currentLang$.subscribe((/**
7918 * @param {?} currentLang
7919 * @return {?}
7920 */
7921 function (currentLang) { return translateService.use(currentLang); }));
7922 }
7923 if (defaultLang$) {
7924 defaultLang$.subscribe((/**
7925 * @param {?} defaultLang
7926 * @return {?}
7927 */
7928 function (defaultLang) { return translateService.setDefaultLang(defaultLang); }));
7929 }
7930 }
7931 VaPackageDropdownModule.decorators = [
7932 { type: core.NgModule, args: [{
7933 imports: [
7934 common.CommonModule,
7935 material.MatButtonModule,
7936 material.MatCardModule,
7937 material.MatListModule,
7938 material.MatIconModule,
7939 uikit.VaIconModule,
7940 uikit.VaBadgeModule,
7941 core$1.TranslateModule.forChild()
7942 ],
7943 declarations: [VaPackageDropdownComponent, VaPackageDropdownItemComponent],
7944 exports: [VaPackageDropdownComponent],
7945 entryComponents: [VaPackageDropdownComponent]
7946 },] }
7947 ];
7948 /** @nocollapse */
7949 VaPackageDropdownModule.ctorParameters = function () { return [
7950 { type: core$1.TranslateService },
7951 { type: rxjs.Observable, decorators: [{ type: core.Optional }, { type: core.Inject, args: ['CURRENT_LANG',] }] },
7952 { type: rxjs.Observable, decorators: [{ type: core.Optional }, { type: core.Inject, args: ['DEFAULT_LANG',] }] }
7953 ]; };
7954 return VaPackageDropdownModule;
7955 }());
7956 if (false) {
7957 /**
7958 * @type {?}
7959 * @private
7960 */
7961 VaPackageDropdownModule.prototype.translateService;
7962 }
7963
7964 /**
7965 * @fileoverview added by tsickle
7966 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
7967 */
7968 var VaProductDetailsComponent = /** @class */ (function () {
7969 function VaProductDetailsComponent() {
7970 this.hasVerifiedContract = false;
7971 this.canAccessContractPricing = false;
7972 this.showActionButton = false;
7973 this.showPricing = false;
7974 this.showPricingAction = false;
7975 this.loaded = true;
7976 this.enableClicked = new core.EventEmitter();
7977 this.addonSelected = new core.EventEmitter();
7978 this.primaryPricingActionSelected = new core.EventEmitter();
7979 this.pricingActionSelected = new core.EventEmitter();
7980 }
7981 /**
7982 * @return {?}
7983 */
7984 VaProductDetailsComponent.prototype.getAddons = /**
7985 * @return {?}
7986 */
7987 function () {
7988 if (!this._addons) {
7989 this._addons = this.product.addons.map((/**
7990 * @param {?} addon
7991 * @return {?}
7992 */
7993 function (addon) { return shared.Addon.fromApi(addon); }));
7994 }
7995 return this._addons;
7996 };
7997 /**
7998 * @return {?}
7999 */
8000 VaProductDetailsComponent.prototype.getActionLabel = /**
8001 * @return {?}
8002 */
8003 function () {
8004 if (this.product.isArchived) {
8005 return 'Enable';
8006 }
8007 return 'Enabled';
8008 };
8009 Object.defineProperty(VaProductDetailsComponent.prototype, "price", {
8010 get: /**
8011 * @return {?}
8012 */
8013 function () {
8014 // NOTE: wholesalePrice = 0 means free, wholesalePrice = null || -1 means "contact sales"
8015 /** @type {?} */
8016 var prices = [];
8017 if (this.product.wholesalePrice !== CONTACT_SALES && this.product.wholesalePrice != null) {
8018 prices = [{
8019 price: this.product.wholesalePrice,
8020 frequency: this.product.billingFrequency
8021 }];
8022 }
8023 return {
8024 currency: this.product.currency,
8025 prices: prices
8026 };
8027 },
8028 enumerable: true,
8029 configurable: true
8030 });
8031 /**
8032 * @param {?} addonId
8033 * @return {?}
8034 */
8035 VaProductDetailsComponent.prototype.onAddonSelected = /**
8036 * @param {?} addonId
8037 * @return {?}
8038 */
8039 function (addonId) {
8040 this.addonSelected.emit(addonId);
8041 };
8042 VaProductDetailsComponent.decorators = [
8043 { type: core.Component, args: [{
8044 selector: 'va-product-details',
8045 template: "<div class=\"page\">\n <va-header-container [iconUrl]=\"product.iconUrl\"\n [title]=\"product.name\"\n [tagline]=\"product.tagline\"\n [chipLabels]=\"product.getLmiCategoryNames()\"\n [pricing]=\"price\"\n [pricingLabel]=\"'Wholesale Price'\"\n [primaryPricingActionLabel]=\"primaryPricingActionLabel\"\n [pricingActionLabel]=\"pricingActionLabel\"\n [pricingActionEnabled]=\"showPricingAction\"\n [actionLabel]=\"getActionLabel()\"\n [actionEnabled]=\"product.isArchived\"\n [showAction]=\"showActionButton\"\n [showPricing]=\"showPricing\"\n [billedProduct]=\"billedProduct\"\n [hasVerifiedContract]=\"hasVerifiedContract\"\n [loaded]=\"loaded\"\n (primaryPricingActionSelected)=\"primaryPricingActionSelected.emit()\"\n (pricingActionSelected)=\"pricingActionSelected.emit()\"\n (actionSelected)=\"enableClicked.emit()\">\n </va-header-container>\n <div class=\"product-details product-content\">\n <div class=\"left-column\">\n <ng-container *ngIf=\"product.description || product.keySellingPoints\">\n <va-selling-info [description]=\"product.description\"\n [keySellingPoints]=\"product.keySellingPoints\"></va-selling-info>\n </ng-container>\n <section *ngIf=\"product.addons?.length > 0\">\n <h2 class=\"va-component-title\">Add-Ons</h2>\n <va-addon-list (addonSelected)=\"onAddonSelected($event)\"\n [addons]=\"getAddons()\"\n [showPricing]=\"showPricing\"\n [hasVerifiedContract]=\"hasVerifiedContract\"\n [canAccessContractPricing]=\"canAccessContractPricing\"\n [partnerID]=\"partnerID\">\n </va-addon-list>\n </section>\n\n <section *ngIf=\"product.faqs?.length > 0\">\n <h2 class=\"va-component-title\">FAQs</h2>\n <va-faqs [faqs]=\"product.faqs\"></va-faqs>\n </section>\n </div>\n\n <div class=\"right-column\">\n <section *ngIf=\"product.restrictions?.country?.whitelist?.length > 0\">\n <supported-countries [countryCodes]=\"product.restrictions.country.whitelist\"></supported-countries>\n </section>\n\n <section *ngIf=\"product.screenshotUrls?.length > 0\">\n <h2 class=\"va-component-title\">Gallery</h2>\n <va-image-gallery [imageUrls]=\"product.screenshotUrls\"></va-image-gallery>\n </section>\n\n <section *ngIf=\"product.files?.length > 0\">\n <h2 class=\"va-component-title\">Files</h2>\n <va-files [files]=\"product.files\"></va-files>\n </section>\n </div>\n </div>\n</div>\n",
8046 styles: [":host{display:block;font-size:14px;line-height:1.4}:host *{box-sizing:border-box}.va-component-title{font-size:24px;font-weight:300;margin-top:0}@media screen and (min-width:600px){.va-component-title{font-size:32px}}img{max-width:100%}va-icon{display:inline-block}.sales-person-details{max-height:430px;overflow:hidden}.page{position:relative;margin:0 auto 20px;background:#fff;color:#212121;box-shadow:0 3px 10px rgba(33,33,33,.3);overflow:hidden;font-size:16px}.page .item-amount{color:#9e9e9e;font-size:14px;text-align:right;margin:0 24px 8px}section{padding:24px}.left-column{width:66%}@media screen and (max-width:600px){.left-column{width:100%}}.right-column{width:34%}.product-content{display:-webkit-box;display:flex}@media screen and (max-width:600px){.right-column{width:100%}.product-content{-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}}"]
8047 }] }
8048 ];
8049 VaProductDetailsComponent.propDecorators = {
8050 product: [{ type: core.Input }],
8051 billedProduct: [{ type: core.Input }],
8052 hasVerifiedContract: [{ type: core.Input }],
8053 canAccessContractPricing: [{ type: core.Input }],
8054 showActionButton: [{ type: core.Input }],
8055 showPricing: [{ type: core.Input }],
8056 primaryPricingActionLabel: [{ type: core.Input }],
8057 pricingActionLabel: [{ type: core.Input }],
8058 showPricingAction: [{ type: core.Input }],
8059 loaded: [{ type: core.Input }],
8060 partnerID: [{ type: core.Input }],
8061 enableClicked: [{ type: core.Output }],
8062 addonSelected: [{ type: core.Output }],
8063 primaryPricingActionSelected: [{ type: core.Output }],
8064 pricingActionSelected: [{ type: core.Output }]
8065 };
8066 return VaProductDetailsComponent;
8067 }());
8068 if (false) {
8069 /** @type {?} */
8070 VaProductDetailsComponent.prototype.product;
8071 /** @type {?} */
8072 VaProductDetailsComponent.prototype.billedProduct;
8073 /** @type {?} */
8074 VaProductDetailsComponent.prototype.hasVerifiedContract;
8075 /** @type {?} */
8076 VaProductDetailsComponent.prototype.canAccessContractPricing;
8077 /** @type {?} */
8078 VaProductDetailsComponent.prototype.showActionButton;
8079 /** @type {?} */
8080 VaProductDetailsComponent.prototype.showPricing;
8081 /** @type {?} */
8082 VaProductDetailsComponent.prototype.primaryPricingActionLabel;
8083 /** @type {?} */
8084 VaProductDetailsComponent.prototype.pricingActionLabel;
8085 /** @type {?} */
8086 VaProductDetailsComponent.prototype.showPricingAction;
8087 /** @type {?} */
8088 VaProductDetailsComponent.prototype.loaded;
8089 /** @type {?} */
8090 VaProductDetailsComponent.prototype.partnerID;
8091 /** @type {?} */
8092 VaProductDetailsComponent.prototype.enableClicked;
8093 /** @type {?} */
8094 VaProductDetailsComponent.prototype.addonSelected;
8095 /** @type {?} */
8096 VaProductDetailsComponent.prototype.primaryPricingActionSelected;
8097 /** @type {?} */
8098 VaProductDetailsComponent.prototype.pricingActionSelected;
8099 /**
8100 * @type {?}
8101 * @private
8102 */
8103 VaProductDetailsComponent.prototype._addons;
8104 }
8105
8106 /**
8107 * @fileoverview added by tsickle
8108 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
8109 */
8110 var VaProductDetailsModule = /** @class */ (function () {
8111 function VaProductDetailsModule() {
8112 }
8113 VaProductDetailsModule.decorators = [
8114 { type: core.NgModule, args: [{
8115 imports: [
8116 uikit.VaImageGalleryModule,
8117 common.CommonModule,
8118 uikit.VaIconModule,
8119 VaPricingModule, VaFilesModule, VaFaqsModule, VaSellingInfoModule,
8120 VaHeaderContainerModule, uikit.VaSafeHtmlModule, VaAddonListModule, RestrictionsModule
8121 ],
8122 declarations: [VaProductDetailsComponent],
8123 exports: [VaProductDetailsComponent],
8124 entryComponents: [VaProductDetailsComponent]
8125 },] }
8126 ];
8127 return VaProductDetailsModule;
8128 }());
8129
8130 /**
8131 * @fileoverview added by tsickle
8132 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
8133 */
8134 var ResellerItem = /** @class */ (function () {
8135 function ResellerItem(data) {
8136 this.quantity = 1;
8137 data = data || {};
8138 Object.assign(this, data);
8139 }
8140 return ResellerItem;
8141 }());
8142 if (false) {
8143 /** @type {?} */
8144 ResellerItem.prototype.appId;
8145 /** @type {?} */
8146 ResellerItem.prototype.addonId;
8147 /** @type {?} */
8148 ResellerItem.prototype.name;
8149 /** @type {?} */
8150 ResellerItem.prototype.icon;
8151 /** @type {?} */
8152 ResellerItem.prototype.tagline;
8153 /** @type {?} */
8154 ResellerItem.prototype.headerImage;
8155 /** @type {?} */
8156 ResellerItem.prototype.currency;
8157 /** @type {?} */
8158 ResellerItem.prototype.price;
8159 /** @type {?} */
8160 ResellerItem.prototype.billingFrequency;
8161 /** @type {?} */
8162 ResellerItem.prototype.lmiCategories;
8163 /** @type {?} */
8164 ResellerItem.prototype.enabled;
8165 /** @type {?} */
8166 ResellerItem.prototype.isCustom;
8167 /** @type {?} */
8168 ResellerItem.prototype.orderForm;
8169 /** @type {?} */
8170 ResellerItem.prototype.quantity;
8171 /** @type {?} */
8172 ResellerItem.prototype.allowMultipleActivations;
8173 /** @type {?} */
8174 ResellerItem.prototype.usesCustomizationForm;
8175 /** @type {?} */
8176 ResellerItem.prototype.usesActivationSpecificEntryUrl;
8177 /** @type {?} */
8178 ResellerItem.prototype.entryUrl;
8179 /** @type {?} */
8180 ResellerItem.prototype.restrictions;
8181 /** @type {?} */
8182 ResellerItem.prototype.activationRequiresApproval;
8183 /** @type {?} */
8184 ResellerItem.prototype.billingId;
8185 /** @type {?} */
8186 ResellerItem.prototype.usesEditions;
8187 /** @type {?} */
8188 ResellerItem.prototype.editionIds;
8189 /** @type {?} */
8190 ResellerItem.prototype.suggestedRetailPrice;
8191 /** @type {?} */
8192 ResellerItem.prototype.editionId;
8193 /** @type {?} */
8194 ResellerItem.prototype.trialConfiguration;
8195 /** @type {?} */
8196 ResellerItem.prototype.integration;
8197 }
8198
8199 /**
8200 * @fileoverview added by tsickle
8201 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
8202 */
8203 var CheckboxField = /** @class */ (function (_super) {
8204 __extends(CheckboxField, _super);
8205 function CheckboxField() {
8206 var _this = _super !== null && _super.apply(this, arguments) || this;
8207 _this.controlType = 'checkbox';
8208 return _this;
8209 }
8210 return CheckboxField;
8211 }(FieldBase));
8212 if (false) {
8213 /** @type {?} */
8214 CheckboxField.prototype.controlType;
8215 }
8216
8217 /**
8218 * @fileoverview added by tsickle
8219 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
8220 */
8221 /**
8222 * @record
8223 */
8224 function Option() { }
8225 if (false) {
8226 /** @type {?} */
8227 Option.prototype.value;
8228 /** @type {?} */
8229 Option.prototype.label;
8230 /** @type {?|undefined} */
8231 Option.prototype.disabled;
8232 }
8233 /**
8234 * @record
8235 */
8236 function DropDownFieldOptions() { }
8237 if (false) {
8238 /** @type {?} */
8239 DropDownFieldOptions.prototype.options;
8240 /** @type {?|undefined} */
8241 DropDownFieldOptions.prototype.allowMultiples;
8242 /** @type {?|undefined} */
8243 DropDownFieldOptions.prototype.allowDuplicates;
8244 /** @type {?|undefined} */
8245 DropDownFieldOptions.prototype.maxChoices;
8246 }
8247 var DropdownField = /** @class */ (function (_super) {
8248 __extends(DropdownField, _super);
8249 function DropdownField(options) {
8250 var _this = _super.call(this, options) || this;
8251 _this.controlType = 'dropdown';
8252 _this.options = [];
8253 if (!!options.options && options.options.length > 0) {
8254 // Because this typeof guard is on the element and not the array as a whole typescript doesn't recognize it as a valid type assertion
8255 // The ts-ignore's are required because of this
8256 if (typeof options.options[0] === 'string') {
8257 if (options.allowMultiples) {
8258 // @ts-ignore
8259 _this.options = options.options.map((/**
8260 * @param {?} o
8261 * @return {?}
8262 */
8263 function (o) { return ({ value: o, name: o }); }));
8264 }
8265 else {
8266 // @ts-ignore
8267 _this.options = options.options.map((/**
8268 * @param {?} o
8269 * @return {?}
8270 */
8271 function (o) { return ({ value: o, label: o }); }));
8272 }
8273 }
8274 else {
8275 if (options.allowMultiples) {
8276 // @ts-ignore
8277 _this.options = options.options.map((/**
8278 * @param {?} o
8279 * @return {?}
8280 */
8281 function (o) { return ({ value: o.value, name: o.label }); }));
8282 }
8283 else {
8284 // @ts-ignore
8285 _this.options = options.options;
8286 }
8287 }
8288 }
8289 _this.allowMultiples = !!options.allowMultiples;
8290 _this.allowDuplicates = !!options.allowDuplicates;
8291 _this.maxChoices = options.maxChoices ? options.maxChoices : 1;
8292 _this.validator = _this.validatorBuilder();
8293 return _this;
8294 }
8295 /**
8296 * @protected
8297 * @return {?}
8298 */
8299 DropdownField.prototype.validatorBuilder = /**
8300 * @protected
8301 * @return {?}
8302 */
8303 function () {
8304 /** @type {?} */
8305 var maxChoices = this.maxChoices;
8306 return (/**
8307 * @param {?} control
8308 * @return {?}
8309 */
8310 function (control) {
8311 if (Array.isArray(control.value) && maxChoices && control.value.length > maxChoices) {
8312 return { overMaxChoices: true };
8313 }
8314 });
8315 };
8316 return DropdownField;
8317 }(FieldBase));
8318 if (false) {
8319 /** @type {?} */
8320 DropdownField.prototype.controlType;
8321 /** @type {?} */
8322 DropdownField.prototype.options;
8323 /** @type {?} */
8324 DropdownField.prototype.allowMultiples;
8325 /** @type {?} */
8326 DropdownField.prototype.allowDuplicates;
8327 /** @type {?} */
8328 DropdownField.prototype.maxChoices;
8329 }
8330
8331 /**
8332 * @fileoverview added by tsickle
8333 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
8334 */
8335 /** @type {?} */
8336 var DEFAULT_NUM_FILES = 5;
8337 /**
8338 * @record
8339 */
8340 function FileUploadGroupFieldOptions() { }
8341 if (false) {
8342 /** @type {?} */
8343 FileUploadGroupFieldOptions.prototype.fileType;
8344 /** @type {?} */
8345 FileUploadGroupFieldOptions.prototype.uploadUrl;
8346 /** @type {?} */
8347 FileUploadGroupFieldOptions.prototype.numFiles;
8348 }
8349 var FileUploadGroupField = /** @class */ (function (_super) {
8350 __extends(FileUploadGroupField, _super);
8351 function FileUploadGroupField(options) {
8352 var _this = _super.call(this, options) || this;
8353 _this.controlType = 'file';
8354 if (!options.uploadUrl) {
8355 throw new Error('uploadUrl is required.');
8356 }
8357 _this.fileType = options.fileType || 'image';
8358 _this.numFiles = options.numFiles || DEFAULT_NUM_FILES;
8359 _this.uploadUrl = options.uploadUrl;
8360 _this.value = [];
8361 return _this;
8362 }
8363 return FileUploadGroupField;
8364 }(FieldBase));
8365 if (false) {
8366 /** @type {?} */
8367 FileUploadGroupField.prototype.controlType;
8368 /** @type {?} */
8369 FileUploadGroupField.prototype.fileType;
8370 /** @type {?} */
8371 FileUploadGroupField.prototype.uploadUrl;
8372 /** @type {?} */
8373 FileUploadGroupField.prototype.numFiles;
8374 }
8375
8376 /**
8377 * @fileoverview added by tsickle
8378 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
8379 */
8380 var TextareaField = /** @class */ (function (_super) {
8381 __extends(TextareaField, _super);
8382 function TextareaField() {
8383 var _this = _super !== null && _super.apply(this, arguments) || this;
8384 _this.controlType = 'textarea';
8385 return _this;
8386 }
8387 return TextareaField;
8388 }(FieldBase));
8389 if (false) {
8390 /** @type {?} */
8391 TextareaField.prototype.controlType;
8392 }
8393
8394 /**
8395 * @fileoverview added by tsickle
8396 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
8397 */
8398 /**
8399 * @record
8400 */
8401 function TextBoxFieldOptions() { }
8402 if (false) {
8403 /** @type {?} */
8404 TextBoxFieldOptions.prototype.textboxType;
8405 /** @type {?|undefined} */
8406 TextBoxFieldOptions.prototype.prefix;
8407 /** @type {?|undefined} */
8408 TextBoxFieldOptions.prototype.suffix;
8409 /** @type {?|undefined} */
8410 TextBoxFieldOptions.prototype.displayOnly;
8411 }
8412 var TextboxField = /** @class */ (function (_super) {
8413 __extends(TextboxField, _super);
8414 function TextboxField(options) {
8415 var _this = _super.call(this, options) || this;
8416 _this.controlType = 'textbox';
8417 _this.textboxType = options.textboxType || 'text';
8418 _this.prefix = options.prefix || '';
8419 _this.suffix = options.suffix || '';
8420 _this.regexValidator = options.regexValidator || '';
8421 _this.regexErrorMessage = options.regexErrorMessage || '';
8422 _this.displayOnly = options.displayOnly || false;
8423 return _this;
8424 }
8425 return TextboxField;
8426 }(FieldBase));
8427 if (false) {
8428 /** @type {?} */
8429 TextboxField.prototype.controlType;
8430 /** @type {?} */
8431 TextboxField.prototype.textboxType;
8432 /** @type {?} */
8433 TextboxField.prototype.prefix;
8434 /** @type {?} */
8435 TextboxField.prototype.suffix;
8436 /** @type {?} */
8437 TextboxField.prototype.regexValidator;
8438 /** @type {?} */
8439 TextboxField.prototype.regexErrorMessage;
8440 /** @type {?} */
8441 TextboxField.prototype.displayOnly;
8442 }
8443
8444 /**
8445 * @fileoverview added by tsickle
8446 * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
8447 */
8448 /**
8449 * @record
8450 */
8451 function User() { }
8452 if (false) {
8453 /** @type {?} */
8454 User.prototype.userId;
8455 /** @type {?} */
8456 User.prototype.email;
8457 /** @type {?|undefined} */
8458 User.prototype.firstName;
8459 /** @type {?|undefined} */
8460 User.prototype.lastName;
8461 }
8462 /**
8463 * @record
8464 */
8465 function VBCUserFieldOptions() { }
8466 if (false) {
8467 /** @type {?} */
8468 VBCUserFieldOptions.prototype.users;
8469 }
8470 var VBCUserField = /** @class */ (function (_super) {
8471 __extends(VBCUserField, _super);
8472 function VBCUserField(options) {
8473 var _this = _super.call(this, {
8474 id: options.id,
8475 label: options.label,
8476 required: options.required,
8477 description: options.description,
8478 options: getOptions(options.users),
8479 disabled: options.disabled,
8480 forOfficeUseOnly: options.forOfficeUseOnly
8481 }) || this;
8482 _this.controlType = 'vbcuser';
8483 return _this;
8484 }
8485 return VBCUserField;
8486 }(DropdownField));
8487 if (false) {
8488 /** @type {?} */
8489 VBCUserField.prototype.controlType;
8490 }
8491 /**
8492 * @param {?} vbcUsers
8493 * @return {?}
8494 */
8495 function getOptions(vbcUsers) {
8496 if (vbcUsers && vbcUsers.length > 0) {
8497 vbcUsers.sort(compareUsersByEmail);
8498 return vbcUsers.map((/**
8499 * @param {?} user
8500 * @return {?}
8501 */
8502 function (user) {
8503 /** @type {?} */
8504 var labelString = createLabelString(user.firstName, user.lastName, user.email);
8505 if (user.userId && user.email && user.firstName && user.lastName) {
8506 return {
8507 label: labelString,
8508 value: JSON.stringify({ firstName: user.firstName, lastName: user.lastName, email: user.email, id: user.userId })
8509 };
8510 }
8511 return { label: labelString, value: '', disabled: true };
8512 }));
8513 }
8514 return [{ label: 'No Users — Please add one to this account', value: '', disabled: true }];
8515 }
8516 /**
8517 * @param {?} a
8518 * @param {?} b
8519 * @return {?}
8520 */
8521 function compareUsersByEmail(a, b) {
8522 if (a == null) {
8523 return -1;
8524 }
8525 if (b == null) {
8526 return 1;
8527 }
8528 return a.email.localeCompare(b.email);
8529 }
8530 /**
8531 * @param {?} firstName
8532 * @param {?} lastName
8533 * @param {?} email
8534 * @return {?}
8535 */
8536 function createLabelString(firstName, lastName, email) {
8537 /** @type {?} */
8538 var returnString = '';
8539 returnString += firstName ? firstName + ' ' : '';
8540 returnString += lastName ? lastName + ' ' : '';
8541 returnString += email ? "(" + email + ")" : '';
8542 return returnString;
8543 }
8544
8545 exports.ActivationStatus = ActivationStatus;
8546 exports.AddonDetailsComponent = AddonDetailsComponent;
8547 exports.AddonDropDownFormSectionData = AddonDropDownFormSectionData;
8548 exports.AddonModule = AddonModule;
8549 exports.BUSINESS_USER = BUSINESS_USER;
8550 exports.CHECK_BOX = CHECK_BOX;
8551 exports.CONTACT_SALES = CONTACT_SALES;
8552 exports.CardListStencilComponent = CardListStencilComponent;
8553 exports.CardStencilComponent = CardStencilComponent;
8554 exports.CaseTransform = CaseTransform;
8555 exports.CheckboxField = CheckboxField;
8556 exports.DROP_DOWN = DROP_DOWN;
8557 exports.DetailsStencilComponent = DetailsStencilComponent;
8558 exports.DropDownFormSectionComponent = DropDownFormSectionComponent;
8559 exports.DropDownFormSectionData = DropDownFormSectionData;
8560 exports.DropdownField = DropdownField;
8561 exports.FILES = FILES;
8562 exports.FORM_FIELDS = FORM_FIELDS;
8563 exports.FieldBase = FieldBase;
8564 exports.FieldBuilderComponent = FieldBuilderComponent;
8565 exports.FieldComponent = FieldComponent;
8566 exports.FieldService = FieldService;
8567 exports.File = File;
8568 exports.FileUploadGroupField = FileUploadGroupField;
8569 exports.HeimdallServiceToken = HeimdallServiceToken;
8570 exports.LMI_CATEGORIES = LMI_CATEGORIES;
8571 exports.LMI_CATEGORIES_BY_NAME = LMI_CATEGORIES_BY_NAME;
8572 exports.LMI_CATEGORY_MAP = LMI_CATEGORY_MAP;
8573 exports.ListStencilComponent = ListStencilComponent;
8574 exports.OrderFormComponent = OrderFormComponent;
8575 exports.OrderFormSectionComponent = OrderFormSectionComponent;
8576 exports.OrderFormSectionData = OrderFormSectionData;
8577 exports.Package = Package;
8578 exports.PackageDetails = PackageDetails;
8579 exports.Product = Product;
8580 exports.ProductOrderFormSectionData = ProductOrderFormSectionData;
8581 exports.ProductWithParent = ProductWithParent;
8582 exports.ProductsNavV2Component = ProductsNavV2Component;
8583 exports.ResellerItem = ResellerItem;
8584 exports.RestrictionsModule = RestrictionsModule;
8585 exports.STOREFRONT_FILTER_NAME = STOREFRONT_FILTER_NAME;
8586 exports.SearchBarStencilComponent = SearchBarStencilComponent;
8587 exports.StencilsModule = StencilsModule;
8588 exports.StoreCardComponent = StoreCardComponent;
8589 exports.StoreCardModule = StoreCardModule;
8590 exports.StoreComponent = StoreComponent;
8591 exports.StoreModule = StoreModule;
8592 exports.StoreService = StoreService;
8593 exports.StorefrontComponent = StorefrontComponent;
8594 exports.TEXT_AREA = TEXT_AREA;
8595 exports.TEXT_BOX = TEXT_BOX;
8596 exports.TextareaField = TextareaField;
8597 exports.TextboxField = TextboxField;
8598 exports.VBCUserField = VBCUserField;
8599 exports.VaAddonListComponent = VaAddonListComponent;
8600 exports.VaAddonListModule = VaAddonListModule;
8601 exports.VaFaqsComponent = VaFaqsComponent;
8602 exports.VaFaqsModule = VaFaqsModule;
8603 exports.VaFilesComponent = VaFilesComponent;
8604 exports.VaFilesModule = VaFilesModule;
8605 exports.VaHeaderContainerComponent = VaHeaderContainerComponent;
8606 exports.VaHeaderContainerModule = VaHeaderContainerModule;
8607 exports.VaOrderFormModule = VaOrderFormModule;
8608 exports.VaPackageDetailsComponent = VaPackageDetailsComponent;
8609 exports.VaPackageDetailsModule = VaPackageDetailsModule;
8610 exports.VaPackageDetailsV2Component = VaPackageDetailsV2Component;
8611 exports.VaPackageDetailsV2Module = VaPackageDetailsV2Module;
8612 exports.VaPackageDropdownComponent = VaPackageDropdownComponent;
8613 exports.VaPackageDropdownModule = VaPackageDropdownModule;
8614 exports.VaPricingComponent = VaPricingComponent;
8615 exports.VaPricingModule = VaPricingModule;
8616 exports.VaProductDetailsComponent = VaProductDetailsComponent;
8617 exports.VaProductDetailsModule = VaProductDetailsModule;
8618 exports.VaProductsNavComponent = VaProductsNavComponent;
8619 exports.VaProductsNavModule = VaProductsNavModule;
8620 exports.VaSalespersonDetailsComponent = VaSalespersonDetailsComponent;
8621 exports.VaSalespersonDetailsModule = VaSalespersonDetailsModule;
8622 exports.VaSellingInfoComponent = VaSellingInfoComponent;
8623 exports.VaSellingInfoModule = VaSellingInfoModule;
8624 exports.combineProductOrderWithContainedProducts = combineProductOrderWithContainedProducts;
8625 exports.convertToPackageDetails = convertToPackageDetails;
8626 exports.getUniqueProductAddonId = getUniqueProductAddonId;
8627 exports.orderProductsAndAddons = orderProductsAndAddons;
8628 exports.ɵb = HeimdallClient;
8629 exports.ɵc = HeimdallClientModule;
8630 exports.ɵd = HighlightPricingComponent;
8631 exports.ɵe = TablePricingComponent;
8632 exports.ɵf = OrderItemListComponent;
8633 exports.ɵg = PricePipe;
8634 exports.ɵh = FormatBillingFrequencyPipe;
8635 exports.ɵi = OrderFormService;
8636 exports.ɵj = OrderItemListService;
8637 exports.ɵk = SupportedCountriesComponent;
8638 exports.ɵl = VaPackageDetailsV2Component;
8639 exports.ɵm = Sellable;
8640 exports.ɵn = VaPackageDropdownItemComponent;
8641
8642 Object.defineProperty(exports, '__esModule', { value: true });
8643
8644})));
8645//# sourceMappingURL=vendasta-store.umd.js.map