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 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
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 |
|
208 |
|
209 |
|
210 | var VaPricingComponent = (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 |
|
226 |
|
227 |
|
228 | function (_a) {
|
229 | var _b = __read(_a, 3), pricing = _b[0], billedProduct = _b[1], hasVerifiedContract = _b[2];
|
230 |
|
231 | var isFreeHelper = ( |
232 |
|
233 |
|
234 |
|
235 | function (prices) {
|
236 | return prices ? prices.some(( |
237 |
|
238 |
|
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 |
|
249 |
|
250 |
|
251 | function (_a) {
|
252 | var _b = __read(_a, 3), pricing = _b[0], billedProduct = _b[1], hasVerifiedContract = _b[2];
|
253 |
|
254 | var nestedPricesIsContactSales = ( |
255 |
|
256 |
|
257 |
|
258 | function (prices) {
|
259 | return prices && prices.length > 0 ? prices.some(( |
260 |
|
261 |
|
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 |
|
275 |
|
276 |
|
277 | function (billedProduct) { return billedProduct.pricingTiers.length === 1; })));
|
278 | this.pricingTierData$ = this.billedProduct$.pipe(operators.switchMap(( |
279 |
|
280 |
|
281 |
|
282 | function (billedProduct) {
|
283 |
|
284 | var pricingTierObservables = billedProduct.pricingTiers.map(( |
285 |
|
286 |
|
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 |
|
291 |
|
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 |
|
309 |
|
310 |
|
311 | function (pricing) {
|
312 |
|
313 | var priceObservables = pricing.prices.map(( |
314 |
|
315 |
|
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 |
|
320 |
|
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 |
|
368 |
|
369 |
|
370 | VaPricingComponent.prototype.ngOnChanges = |
371 |
|
372 |
|
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 |
|
387 |
|
388 |
|
389 | VaPricingComponent.prototype.buildPricingTierString = |
390 |
|
391 |
|
392 |
|
393 | function (tier) {
|
394 |
|
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 |
|
406 |
|
407 |
|
408 |
|
409 | VaPricingComponent.prototype.buildPricingTierForProduct = |
410 |
|
411 |
|
412 |
|
413 |
|
414 | function (tier, frequency) {
|
415 | var _this = this;
|
416 | return rxjs.combineLatest(this.buildPricingTierString(tier), this.buildFrequencyString(frequency)).pipe(operators.switchMap(( |
417 |
|
418 |
|
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 |
|
433 |
|
434 |
|
435 | VaPricingComponent.prototype.buildPricingTierForAddon = |
436 |
|
437 |
|
438 |
|
439 | function (tier) {
|
440 | return this.buildPricingTierString(tier).pipe(operators.map(( |
441 |
|
442 |
|
443 |
|
444 | function (pricingRange) { return pricingRange ? pricingRange : ''; })));
|
445 | };
|
446 | |
447 |
|
448 |
|
449 |
|
450 |
|
451 |
|
452 |
|
453 | VaPricingComponent.prototype.buildPriceStringForPricing = |
454 |
|
455 |
|
456 |
|
457 |
|
458 |
|
459 |
|
460 | function (price, currency, excludeFrequency, canIncludeStartingAtPrefix) {
|
461 | return this.displayPriceService.formatDisplayPrice(price.price, currency, ( ((excludeFrequency ? '' : price.frequency))), true, true, true, price.isStartingPrice && canIncludeStartingAtPrefix);
|
462 | };
|
463 | |
464 |
|
465 |
|
466 |
|
467 |
|
468 |
|
469 | VaPricingComponent.prototype.buildPriceStringForTier = |
470 |
|
471 |
|
472 |
|
473 |
|
474 |
|
475 | function (tier, frequency, isStartingPrice) {
|
476 | return this.displayPriceService.formatDisplayPrice(tier.price, this.billedProduct.currency, ( (frequency)), undefined, undefined, undefined, isStartingPrice);
|
477 | };
|
478 | |
479 |
|
480 |
|
481 |
|
482 | VaPricingComponent.prototype.buildFrequencyString = |
483 |
|
484 |
|
485 |
|
486 | function (frequency) {
|
487 | return this.displayPriceService.formatBillingFrequency(frequency);
|
488 | };
|
489 | |
490 |
|
491 |
|
492 | VaPricingComponent.prototype.buildCommitmentMessage = |
493 |
|
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 |
|
505 |
|
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 |
|
510 | var frequency = billedProduct ? billedProduct.billingFrequency.toString().toLowerCase() :
|
511 | pricing && pricing.prices.length > 0 ? pricing.prices[0].frequency.toLowerCase() : '';
|
512 |
|
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 |
|
525 | var initial = billedProduct.commitment.initial;
|
526 |
|
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 |
|
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 |
|
562 | VaPricingComponent.prototype.pricing;
|
563 |
|
564 | VaPricingComponent.prototype.billedProduct;
|
565 |
|
566 | VaPricingComponent.prototype.wrapFrequency;
|
567 |
|
568 | VaPricingComponent.prototype.isAddon;
|
569 |
|
570 | VaPricingComponent.prototype.hasVerifiedContract;
|
571 |
|
572 | VaPricingComponent.prototype.highlightPrice;
|
573 |
|
574 | VaPricingComponent.prototype.loaded;
|
575 |
|
576 | VaPricingComponent.prototype.pricing$$;
|
577 |
|
578 | VaPricingComponent.prototype.billedProduct$$;
|
579 |
|
580 | VaPricingComponent.prototype.hasVerifiedContract$$;
|
581 |
|
582 | VaPricingComponent.prototype.isFree$;
|
583 |
|
584 | VaPricingComponent.prototype.shouldContactSales$;
|
585 |
|
586 | VaPricingComponent.prototype.isFlatPrice$;
|
587 |
|
588 | VaPricingComponent.prototype.pricingTierData$;
|
589 |
|
590 | VaPricingComponent.prototype.priceData$;
|
591 |
|
592 | VaPricingComponent.prototype.commitmentMessage$;
|
593 | |
594 |
|
595 |
|
596 |
|
597 | VaPricingComponent.prototype.translateService;
|
598 | |
599 |
|
600 |
|
601 |
|
602 | VaPricingComponent.prototype.displayPriceService;
|
603 | }
|
604 |
|
605 | |
606 |
|
607 |
|
608 |
|
609 | var HighlightPricingComponent = (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 |
|
626 |
|
627 |
|
628 | var TablePricingComponent = (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 |
|
645 |
|
646 |
|
647 |
|
648 | var En = (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 |
|
690 | En.en;
|
691 | }
|
692 |
|
693 | |
694 |
|
695 |
|
696 |
|
697 |
|
698 | var Cs = (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 |
|
740 | Cs.cs;
|
741 | }
|
742 |
|
743 | |
744 |
|
745 |
|
746 |
|
747 | var VaPricingModule = (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 |
|
761 |
|
762 |
|
763 | function (currentLang) { return translateService.use(currentLang); }));
|
764 | }
|
765 | if (defaultLang$) {
|
766 | defaultLang$.subscribe(( |
767 |
|
768 |
|
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 |
|
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 |
|
795 |
|
796 |
|
797 | VaPricingModule.prototype.translateService;
|
798 | }
|
799 |
|
800 | |
801 |
|
802 |
|
803 |
|
804 | var StoreCardComponent = (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 |
|
814 |
|
815 | StoreCardComponent.prototype.getBannerColorForName = |
816 |
|
817 |
|
818 | function () {
|
819 |
|
820 |
|
821 | var COLOR_CODES = [
|
822 | '#EF5350', '#42A5F5', '#66BB6A', '#FFA726', '#AB47BC', '#FFCA28', '#EC407A', '#26C6DA',
|
823 | '#FF7B57'
|
824 | ];
|
825 |
|
826 | var nameSum = 0;
|
827 |
|
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 |
|
836 | var index = nameSum % COLOR_CODES.length;
|
837 | return COLOR_CODES[index];
|
838 | };
|
839 | |
840 |
|
841 |
|
842 |
|
843 | StoreCardComponent.prototype.getSrcsetHeaderUrls = |
844 |
|
845 |
|
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 |
|
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 |
|
872 | StoreCardComponent.prototype.item;
|
873 |
|
874 | StoreCardComponent.prototype.purchasedClicked;
|
875 |
|
876 | StoreCardComponent.prototype.cardClicked;
|
877 |
|
878 | StoreCardComponent.prototype.descriptionClicked;
|
879 |
|
880 | StoreCardComponent.prototype.bannerClicked;
|
881 | |
882 |
|
883 |
|
884 |
|
885 | StoreCardComponent.prototype.imageTransformationService;
|
886 | }
|
887 |
|
888 | |
889 |
|
890 |
|
891 |
|
892 | var StoreCardModule = (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 |
|
906 |
|
907 |
|
908 | function (currentLang) { return translateService.use(currentLang); }));
|
909 | }
|
910 | if (defaultLang$) {
|
911 | defaultLang$.subscribe(( |
912 |
|
913 |
|
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 |
|
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 |
|
946 |
|
947 |
|
948 | StoreCardModule.prototype.translateService;
|
949 | }
|
950 |
|
951 | |
952 |
|
953 |
|
954 |
|
955 | var StoreComponent = (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 |
|
970 |
|
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 |
|
995 | StoreComponent.prototype.items;
|
996 |
|
997 | StoreComponent.prototype.searchable;
|
998 |
|
999 | StoreComponent.prototype.itemClicked;
|
1000 |
|
1001 | StoreComponent.prototype.filterTerm;
|
1002 | }
|
1003 |
|
1004 | |
1005 |
|
1006 |
|
1007 |
|
1008 | var DropDownFormSectionComponent = (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 |
|
1026 |
|
1027 | DropDownFormSectionComponent.prototype.ngOnInit = |
1028 |
|
1029 |
|
1030 | function () {
|
1031 | var _this = this;
|
1032 |
|
1033 | var allFieldsHidden = this.fields.reduce(( |
1034 |
|
1035 |
|
1036 |
|
1037 |
|
1038 |
|
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 |
|
1049 | var form = ( (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 |
|
1062 |
|
1063 |
|
1064 | function (_a) {
|
1065 | var _b = __read(_a, 2), change = _b[0], autoTitleText = _b[1];
|
1066 |
|
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 |
|
1092 |
|
1093 |
|
1094 | function (changes) {
|
1095 |
|
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 |
|
1120 |
|
1121 |
|
1122 | DropDownFormSectionComponent.prototype.toFormGroup = |
1123 |
|
1124 |
|
1125 |
|
1126 | function (formFields) {
|
1127 | var _this = this;
|
1128 |
|
1129 | var group = {};
|
1130 | formFields.forEach(( |
1131 |
|
1132 |
|
1133 |
|
1134 | function (field) {
|
1135 |
|
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 |
|
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 |
|
1151 |
|
1152 |
|
1153 | function (value) { return (field.value = value); })));
|
1154 | }));
|
1155 | return new forms.FormGroup(group);
|
1156 | };
|
1157 | |
1158 |
|
1159 |
|
1160 | DropDownFormSectionComponent.prototype.ngOnDestroy = |
1161 |
|
1162 |
|
1163 | function () {
|
1164 | this.subscriptions.forEach(( |
1165 |
|
1166 |
|
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\"> </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 |
|
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 |
|
1197 | DropDownFormSectionComponent.prototype.prepopulatedData;
|
1198 |
|
1199 | DropDownFormSectionComponent.prototype.startOpen;
|
1200 |
|
1201 | DropDownFormSectionComponent.prototype.parentForm;
|
1202 |
|
1203 | DropDownFormSectionComponent.prototype.displayAutoTitle;
|
1204 |
|
1205 | DropDownFormSectionComponent.prototype.titleText;
|
1206 |
|
1207 | DropDownFormSectionComponent.prototype.displayAutoDescription;
|
1208 |
|
1209 | DropDownFormSectionComponent.prototype.descriptionText;
|
1210 |
|
1211 | DropDownFormSectionComponent.prototype.fields;
|
1212 |
|
1213 | DropDownFormSectionComponent.prototype.editingHint;
|
1214 |
|
1215 | DropDownFormSectionComponent.prototype.expandable;
|
1216 |
|
1217 | DropDownFormSectionComponent.prototype.autoDescriptionText;
|
1218 |
|
1219 | DropDownFormSectionComponent.prototype.iconName;
|
1220 |
|
1221 | DropDownFormSectionComponent.prototype.subscriptions;
|
1222 |
|
1223 | DropDownFormSectionComponent.prototype.uniqueIndex;
|
1224 |
|
1225 | DropDownFormSectionComponent.prototype.autoTitleText;
|
1226 | |
1227 |
|
1228 |
|
1229 |
|
1230 | DropDownFormSectionComponent.prototype.translateService;
|
1231 | }
|
1232 |
|
1233 | |
1234 |
|
1235 |
|
1236 |
|
1237 | var FieldComponent = (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 |
|
1252 |
|
1253 |
|
1254 | FieldComponent.prototype.showCheckboxError = |
1255 |
|
1256 |
|
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}} </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\"> {{ 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 |
|
1276 | FieldComponent.prototype.field;
|
1277 |
|
1278 | FieldComponent.prototype.form;
|
1279 | }
|
1280 |
|
1281 | |
1282 |
|
1283 |
|
1284 |
|
1285 | var FieldService = (function () {
|
1286 | function FieldService() {
|
1287 | }
|
1288 | |
1289 |
|
1290 |
|
1291 |
|
1292 | FieldService.prototype.createFormControl = |
1293 |
|
1294 |
|
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 |
|
1306 |
|
1307 |
|
1308 |
|
1309 | FieldService.prototype.toFormGroup = |
1310 |
|
1311 |
|
1312 |
|
1313 |
|
1314 | function (formFields, subscriptions) {
|
1315 | var _this = this;
|
1316 |
|
1317 | var group = {};
|
1318 | formFields.forEach(( |
1319 |
|
1320 |
|
1321 |
|
1322 | function (field) {
|
1323 |
|
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 |
|
1335 |
|
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 |
|
1350 |
|
1351 |
|
1352 | var VaHeaderContainerComponent = (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 |
|
1364 |
|
1365 | VaHeaderContainerComponent.prototype.onActionSelected = |
1366 |
|
1367 |
|
1368 | function () {
|
1369 | this.actionSelected.emit();
|
1370 | };
|
1371 | |
1372 |
|
1373 |
|
1374 | VaHeaderContainerComponent.prototype.onPrerequisiteSelected = |
1375 |
|
1376 |
|
1377 | function () {
|
1378 | this.prerequisiteSelected.emit();
|
1379 | };
|
1380 | |
1381 |
|
1382 |
|
1383 |
|
1384 | VaHeaderContainerComponent.prototype.showPricingModel = |
1385 |
|
1386 |
|
1387 |
|
1388 | function (billedProduct) {
|
1389 | return billedProduct && [billing.BillingModel.Tiered, billing.BillingModel.Stairstep].includes(billedProduct.billingModel);
|
1390 | };
|
1391 | |
1392 |
|
1393 |
|
1394 |
|
1395 | VaHeaderContainerComponent.prototype.getPricingModelTooltips = |
1396 |
|
1397 |
|
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 |
|
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 |
|
1449 | VaHeaderContainerComponent.prototype.iconUrl;
|
1450 |
|
1451 | VaHeaderContainerComponent.prototype.title;
|
1452 |
|
1453 | VaHeaderContainerComponent.prototype.tagline;
|
1454 |
|
1455 | VaHeaderContainerComponent.prototype.prerequisite;
|
1456 |
|
1457 | VaHeaderContainerComponent.prototype.chipLabels;
|
1458 |
|
1459 | VaHeaderContainerComponent.prototype.pricing;
|
1460 |
|
1461 | VaHeaderContainerComponent.prototype.billedProduct;
|
1462 |
|
1463 | VaHeaderContainerComponent.prototype.loaded;
|
1464 |
|
1465 | VaHeaderContainerComponent.prototype.hasVerifiedContract;
|
1466 |
|
1467 | VaHeaderContainerComponent.prototype.pricingLabel;
|
1468 |
|
1469 | VaHeaderContainerComponent.prototype.primaryPricingActionLabel;
|
1470 |
|
1471 | VaHeaderContainerComponent.prototype.pricingActionLabel;
|
1472 |
|
1473 | VaHeaderContainerComponent.prototype.pricingActionEnabled;
|
1474 |
|
1475 | VaHeaderContainerComponent.prototype.actionEnabled;
|
1476 |
|
1477 | VaHeaderContainerComponent.prototype.actionLabel;
|
1478 |
|
1479 | VaHeaderContainerComponent.prototype.showAction;
|
1480 |
|
1481 | VaHeaderContainerComponent.prototype.showPricing;
|
1482 |
|
1483 | VaHeaderContainerComponent.prototype.showEnableAddon;
|
1484 |
|
1485 | VaHeaderContainerComponent.prototype.prerequisiteLabel;
|
1486 |
|
1487 | VaHeaderContainerComponent.prototype.prerequisiteSelected;
|
1488 |
|
1489 | VaHeaderContainerComponent.prototype.actionSelected;
|
1490 |
|
1491 | VaHeaderContainerComponent.prototype.primaryPricingActionSelected;
|
1492 |
|
1493 | VaHeaderContainerComponent.prototype.pricingActionSelected;
|
1494 | |
1495 |
|
1496 |
|
1497 |
|
1498 | VaHeaderContainerComponent.prototype.translateService;
|
1499 | }
|
1500 |
|
1501 | |
1502 |
|
1503 |
|
1504 |
|
1505 | var VaHeaderContainerModule = (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 |
|
1519 |
|
1520 |
|
1521 | function (currentLang) { return translateService.use(currentLang); }));
|
1522 | }
|
1523 | if (defaultLang$) {
|
1524 | defaultLang$.subscribe(( |
1525 |
|
1526 |
|
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 |
|
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 |
|
1558 |
|
1559 |
|
1560 | VaHeaderContainerModule.prototype.translateService;
|
1561 | }
|
1562 |
|
1563 | |
1564 |
|
1565 |
|
1566 |
|
1567 | var OrderFormSectionData = (function () {
|
1568 | function OrderFormSectionData() {
|
1569 | }
|
1570 | return OrderFormSectionData;
|
1571 | }());
|
1572 | if (false) {
|
1573 |
|
1574 | OrderFormSectionData.prototype.parentForm;
|
1575 |
|
1576 | OrderFormSectionData.prototype.titleText;
|
1577 |
|
1578 | OrderFormSectionData.prototype.subtitleText;
|
1579 |
|
1580 | OrderFormSectionData.prototype.descriptionText;
|
1581 |
|
1582 | OrderFormSectionData.prototype.iconUrl;
|
1583 |
|
1584 | OrderFormSectionData.prototype.primarySection;
|
1585 |
|
1586 | OrderFormSectionData.prototype.subsections;
|
1587 | }
|
1588 |
|
1589 | |
1590 |
|
1591 |
|
1592 |
|
1593 | var OrderFormSectionComponent = (function () {
|
1594 | function OrderFormSectionComponent() {
|
1595 | }
|
1596 | |
1597 |
|
1598 |
|
1599 | OrderFormSectionComponent.prototype.ngOnInit = |
1600 |
|
1601 |
|
1602 | function () {
|
1603 |
|
1604 |
|
1605 | var topSection = this.getTopSection();
|
1606 | if (topSection) {
|
1607 | topSection.startOpen = true;
|
1608 | }
|
1609 | };
|
1610 | |
1611 |
|
1612 |
|
1613 | OrderFormSectionComponent.prototype.getTopSection = |
1614 |
|
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 |
|
1636 | OrderFormSectionComponent.ctorParameters = function () { return []; };
|
1637 | OrderFormSectionComponent.propDecorators = {
|
1638 | data: [{ type: core.Input }]
|
1639 | };
|
1640 | return OrderFormSectionComponent;
|
1641 | }());
|
1642 | if (false) {
|
1643 |
|
1644 | OrderFormSectionComponent.prototype.data;
|
1645 | }
|
1646 |
|
1647 | |
1648 |
|
1649 |
|
1650 |
|
1651 | var DropDownFormSectionData = (function () {
|
1652 | function DropDownFormSectionData() {
|
1653 |
|
1654 | this.expandable = true;
|
1655 |
|
1656 | }
|
1657 | return DropDownFormSectionData;
|
1658 | }());
|
1659 | if (false) {
|
1660 |
|
1661 | DropDownFormSectionData.prototype.prepopulatedData;
|
1662 |
|
1663 | DropDownFormSectionData.prototype.startOpen;
|
1664 |
|
1665 | DropDownFormSectionData.prototype.parentForm;
|
1666 |
|
1667 | DropDownFormSectionData.prototype.displayAutoTitle;
|
1668 |
|
1669 | DropDownFormSectionData.prototype.titleText;
|
1670 |
|
1671 | DropDownFormSectionData.prototype.displayAutoDescription;
|
1672 |
|
1673 | DropDownFormSectionData.prototype.descriptionText;
|
1674 |
|
1675 | DropDownFormSectionData.prototype.fields;
|
1676 |
|
1677 | DropDownFormSectionData.prototype.editingHint;
|
1678 |
|
1679 | DropDownFormSectionData.prototype.expandable;
|
1680 | }
|
1681 |
|
1682 | |
1683 |
|
1684 |
|
1685 |
|
1686 | |
1687 |
|
1688 |
|
1689 | function OrderLabelsInterface() { }
|
1690 | if (false) {
|
1691 |
|
1692 | OrderLabelsInterface.prototype.commonForm;
|
1693 | }
|
1694 | |
1695 |
|
1696 |
|
1697 | function OrderFormInterface() { }
|
1698 | if (false) {
|
1699 |
|
1700 | OrderFormInterface.prototype.appId;
|
1701 |
|
1702 | OrderFormInterface.prototype.addonId;
|
1703 |
|
1704 | OrderFormInterface.prototype.commonForm;
|
1705 |
|
1706 | OrderFormInterface.prototype.commonFormRequiredFields;
|
1707 |
|
1708 | OrderFormInterface.prototype.customFields;
|
1709 | }
|
1710 | |
1711 |
|
1712 |
|
1713 | function IncludedCommonFormFieldsInterface() { }
|
1714 | if (false) {
|
1715 |
|
1716 | IncludedCommonFormFieldsInterface.prototype.businessName;
|
1717 |
|
1718 | IncludedCommonFormFieldsInterface.prototype.businessAddress;
|
1719 |
|
1720 | IncludedCommonFormFieldsInterface.prototype.businessPhoneNumber;
|
1721 |
|
1722 | IncludedCommonFormFieldsInterface.prototype.businessAccountGroupId;
|
1723 |
|
1724 | IncludedCommonFormFieldsInterface.prototype.businessWebsite;
|
1725 |
|
1726 | IncludedCommonFormFieldsInterface.prototype.salespersonName;
|
1727 |
|
1728 | IncludedCommonFormFieldsInterface.prototype.salespersonPhoneNumber;
|
1729 |
|
1730 | IncludedCommonFormFieldsInterface.prototype.salespersonEmail;
|
1731 |
|
1732 | IncludedCommonFormFieldsInterface.prototype.contactName;
|
1733 |
|
1734 | IncludedCommonFormFieldsInterface.prototype.contactPhoneNumber;
|
1735 |
|
1736 | IncludedCommonFormFieldsInterface.prototype.contactEmail;
|
1737 | }
|
1738 | |
1739 |
|
1740 |
|
1741 | function CommonFormSectionInterface() { }
|
1742 | if (false) {
|
1743 |
|
1744 | CommonFormSectionInterface.prototype.fields;
|
1745 |
|
1746 | CommonFormSectionInterface.prototype.sectionName;
|
1747 |
|
1748 | CommonFormSectionInterface.prototype.populatedData;
|
1749 | }
|
1750 | |
1751 |
|
1752 |
|
1753 | function AddonKeyInterface() { }
|
1754 | if (false) {
|
1755 |
|
1756 | AddonKeyInterface.prototype.addonId;
|
1757 |
|
1758 | AddonKeyInterface.prototype.appId;
|
1759 | }
|
1760 | |
1761 |
|
1762 |
|
1763 | function CommonFormFieldInterface() { }
|
1764 | if (false) {
|
1765 |
|
1766 | CommonFormFieldInterface.prototype.productIds;
|
1767 |
|
1768 | CommonFormFieldInterface.prototype.addonKeys;
|
1769 | }
|
1770 | |
1771 |
|
1772 |
|
1773 | function CommonFieldIdsInterface() { }
|
1774 | if (false) {
|
1775 |
|
1776 | CommonFieldIdsInterface.prototype.fieldId;
|
1777 |
|
1778 | CommonFieldIdsInterface.prototype.required;
|
1779 | }
|
1780 | |
1781 |
|
1782 |
|
1783 | function CommonFormData() { }
|
1784 | if (false) {
|
1785 |
|
1786 | CommonFormData.prototype.contact_email;
|
1787 |
|
1788 | CommonFormData.prototype.contact_name;
|
1789 |
|
1790 | CommonFormData.prototype.contact_phone_number;
|
1791 |
|
1792 | CommonFormData.prototype.business_account_group_id;
|
1793 |
|
1794 | CommonFormData.prototype.business_name;
|
1795 |
|
1796 | CommonFormData.prototype.business_address;
|
1797 |
|
1798 | CommonFormData.prototype.business_phone_number;
|
1799 |
|
1800 | CommonFormData.prototype.business_website;
|
1801 |
|
1802 | CommonFormData.prototype.salesperson_name;
|
1803 |
|
1804 | CommonFormData.prototype.salesperson_email;
|
1805 |
|
1806 | CommonFormData.prototype.salesperson_phone_number;
|
1807 | }
|
1808 | var ProductOrderFormSectionData = (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 |
|
1817 | ProductOrderFormSectionData.prototype.productId;
|
1818 |
|
1819 | ProductOrderFormSectionData.prototype.subsections;
|
1820 | }
|
1821 | var AddonDropDownFormSectionData = (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 |
|
1830 | AddonDropDownFormSectionData.prototype.productId;
|
1831 |
|
1832 | AddonDropDownFormSectionData.prototype.addonId;
|
1833 | }
|
1834 | |
1835 |
|
1836 |
|
1837 | function ProductInfoInterface() { }
|
1838 | if (false) {
|
1839 |
|
1840 | ProductInfoInterface.prototype.productId;
|
1841 |
|
1842 | ProductInfoInterface.prototype.name;
|
1843 |
|
1844 | ProductInfoInterface.prototype.tagline;
|
1845 |
|
1846 | ProductInfoInterface.prototype.icon;
|
1847 |
|
1848 | ProductInfoInterface.prototype.addonInfo;
|
1849 | }
|
1850 | |
1851 |
|
1852 |
|
1853 | function AddonInfoInterface() { }
|
1854 | if (false) {
|
1855 |
|
1856 | AddonInfoInterface.prototype.addonId;
|
1857 |
|
1858 | AddonInfoInterface.prototype.name;
|
1859 | }
|
1860 | |
1861 |
|
1862 |
|
1863 | function CustomFieldsAnswers() { }
|
1864 | if (false) {
|
1865 |
|
1866 | CustomFieldsAnswers.prototype.productID;
|
1867 |
|
1868 | CustomFieldsAnswers.prototype.addonKey;
|
1869 |
|
1870 | CustomFieldsAnswers.prototype.customFieldsAnswers;
|
1871 | }
|
1872 | |
1873 |
|
1874 |
|
1875 | function CustomFieldsAnswer() { }
|
1876 | if (false) {
|
1877 |
|
1878 | CustomFieldsAnswer.prototype.fieldId;
|
1879 |
|
1880 | CustomFieldsAnswer.prototype.answer;
|
1881 | }
|
1882 | |
1883 |
|
1884 |
|
1885 | function OrderFormOptionsInterface() { }
|
1886 | if (false) {
|
1887 |
|
1888 | OrderFormOptionsInterface.prototype.bypassRequiredQuestions;
|
1889 |
|
1890 | OrderFormOptionsInterface.prototype.readOnly;
|
1891 |
|
1892 | OrderFormOptionsInterface.prototype.showOfficeUseQuestions;
|
1893 | }
|
1894 |
|
1895 | |
1896 |
|
1897 |
|
1898 |
|
1899 | var OrderFormService = (function () {
|
1900 | function OrderFormService() {
|
1901 | }
|
1902 | |
1903 |
|
1904 |
|
1905 |
|
1906 |
|
1907 | OrderFormService.extractRequiredCommonFieldIds = |
1908 |
|
1909 |
|
1910 |
|
1911 |
|
1912 | function (orderForm) {
|
1913 | if (!orderForm || !orderForm.commonFormRequiredFields) {
|
1914 | return [];
|
1915 | }
|
1916 | return Object.keys(orderForm.commonFormRequiredFields).filter(( |
1917 |
|
1918 |
|
1919 |
|
1920 | function (k) { return orderForm.commonFormRequiredFields[k]; }));
|
1921 | };
|
1922 | |
1923 |
|
1924 |
|
1925 |
|
1926 |
|
1927 | OrderFormService.buildCommonFieldIds = |
1928 |
|
1929 |
|
1930 |
|
1931 |
|
1932 | function (orderForms) {
|
1933 | var _this = this;
|
1934 |
|
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 |
|
1946 |
|
1947 |
|
1948 | function (orderForm) {
|
1949 |
|
1950 | var requiredCommonFieldIds = _this.extractRequiredCommonFieldIds(orderForm);
|
1951 | requiredCommonFieldIds.map(( |
1952 |
|
1953 |
|
1954 |
|
1955 | function (fieldId) {
|
1956 |
|
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 |
|
1966 |
|
1967 |
|
1968 |
|
1969 |
|
1970 |
|
1971 |
|
1972 | OrderFormService.fillCommonFormSections = |
1973 |
|
1974 |
|
1975 |
|
1976 |
|
1977 |
|
1978 |
|
1979 |
|
1980 | function (fieldIds, commonData, labels, options) {
|
1981 |
|
1982 | var commonFormSections = OrderFormService.buildCommonOrderFormFields(fieldIds, labels, options);
|
1983 | return commonFormSections.map(( |
1984 |
|
1985 |
|
1986 |
|
1987 | function (section) { return (__assign({}, section, { populatedData: commonData })); }));
|
1988 | };
|
1989 | |
1990 |
|
1991 |
|
1992 |
|
1993 |
|
1994 |
|
1995 |
|
1996 | OrderFormService.buildCommonOrderFormFields = |
1997 |
|
1998 |
|
1999 |
|
2000 |
|
2001 |
|
2002 |
|
2003 | function (fieldIds, labels, options) {
|
2004 | var e_1, _a;
|
2005 |
|
2006 | var businessSection = {
|
2007 | sectionName: labels.commonForm.businessSectionTitle || 'Business',
|
2008 | fields: []
|
2009 | };
|
2010 |
|
2011 | var salespersonSection = {
|
2012 | sectionName: labels.commonForm.salespersonSectionTitle || 'Salesperson',
|
2013 | fields: []
|
2014 | };
|
2015 |
|
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 |
|
2024 | var fieldLabel = this.getLabelForFieldId(field.fieldId, labels);
|
2025 |
|
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 |
|
2059 |
|
2060 |
|
2061 | function (section) {
|
2062 | return section.fields ? section.fields.length > 0 : false;
|
2063 | }));
|
2064 | };
|
2065 | |
2066 |
|
2067 |
|
2068 |
|
2069 |
|
2070 |
|
2071 | OrderFormService.getLabelForFieldId = |
2072 |
|
2073 |
|
2074 |
|
2075 |
|
2076 |
|
2077 | function (fieldId, labels) {
|
2078 | return labels.commonForm[fieldId] || '';
|
2079 | };
|
2080 | |
2081 |
|
2082 |
|
2083 |
|
2084 |
|
2085 | OrderFormService.buildOrderFormSectionData = |
2086 |
|
2087 |
|
2088 |
|
2089 |
|
2090 | function (parentForm) {
|
2091 |
|
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 |
|
2101 |
|
2102 |
|
2103 |
|
2104 |
|
2105 |
|
2106 |
|
2107 |
|
2108 | OrderFormService.buildCustomOrderFormFields = |
2109 |
|
2110 |
|
2111 |
|
2112 |
|
2113 |
|
2114 |
|
2115 |
|
2116 |
|
2117 | function (customFields, fileUploadUrl, users, answers, options) {
|
2118 |
|
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 |
|
2131 |
|
2132 |
|
2133 | function (field) {
|
2134 | return fieldTypeMap[field.type];
|
2135 | }))
|
2136 | .map(( |
2137 |
|
2138 |
|
2139 |
|
2140 | function (field) {
|
2141 |
|
2142 | var fieldClass = fieldTypeMap[field.type];
|
2143 |
|
2144 | var result = (( |
2145 |
|
2146 |
|
2147 | function () {
|
2148 | switch (fieldClass) {
|
2149 | case VBCUserField:
|
2150 |
|
2151 | var fieldConfig = ( ({
|
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
|
2160 | }));
|
2161 | return new VBCUserField(fieldConfig);
|
2162 | case FileUploadGroupField:
|
2163 |
|
2164 | var uploadField = ( (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 |
|
2179 | var ca = answers.find(( |
2180 |
|
2181 |
|
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 |
|
2197 |
|
2198 |
|
2199 |
|
2200 |
|
2201 |
|
2202 | |
2203 |
|
2204 |
|
2205 |
|
2206 |
|
2207 | OrderFormService.encodeCustomFieldId =
|
2208 |
|
2209 |
|
2210 |
|
2211 | |
2212 |
|
2213 |
|
2214 |
|
2215 |
|
2216 | function (fieldId) {
|
2217 |
|
2218 | var id = uuid();
|
2219 | return id + "#" + fieldId;
|
2220 | };
|
2221 | |
2222 |
|
2223 |
|
2224 |
|
2225 |
|
2226 | OrderFormService.decodeCustomFieldId = |
2227 |
|
2228 |
|
2229 |
|
2230 |
|
2231 | function (fieldId) {
|
2232 | return fieldId.replace(new RegExp('(.*#)'), '');
|
2233 | };
|
2234 | |
2235 |
|
2236 |
|
2237 |
|
2238 |
|
2239 | OrderFormService.mapFieldType = |
2240 |
|
2241 |
|
2242 |
|
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 |
|
2264 |
|
2265 |
|
2266 |
|
2267 | OrderFormService.orderFieldToSalesOrderField = |
2268 |
|
2269 |
|
2270 |
|
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 |
|
2287 |
|
2288 |
|
2289 |
|
2290 | OrderFormService.productOrderFormToCustomFields = |
2291 |
|
2292 |
|
2293 |
|
2294 |
|
2295 | function (orderFormData) {
|
2296 | var _this = this;
|
2297 |
|
2298 | var primaryCustomField = new salesOrders.CustomField();
|
2299 | primaryCustomField.productId = orderFormData.productId;
|
2300 | primaryCustomField.fields = orderFormData.primarySection
|
2301 | ? orderFormData.primarySection.fields.map(( |
2302 |
|
2303 |
|
2304 |
|
2305 | function (field) { return _this.orderFieldToSalesOrderField(field); }))
|
2306 | : [];
|
2307 |
|
2308 | var secondaryCustomFields = orderFormData.subsections.map(( |
2309 |
|
2310 |
|
2311 |
|
2312 | function (subsection) {
|
2313 |
|
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 |
|
2326 |
|
2327 |
|
2328 | function (field) { return _this.orderFieldToSalesOrderField(field); }));
|
2329 | return customField;
|
2330 | }));
|
2331 | return [].concat(primaryCustomField, secondaryCustomFields);
|
2332 | };
|
2333 | |
2334 |
|
2335 |
|
2336 |
|
2337 |
|
2338 |
|
2339 |
|
2340 | OrderFormService.getCommonFormSections = |
2341 |
|
2342 |
|
2343 |
|
2344 |
|
2345 |
|
2346 |
|
2347 | function (orderForms, commonData, labels, options) {
|
2348 |
|
2349 | var fieldIds = OrderFormService.buildCommonFieldIds(orderForms);
|
2350 | return OrderFormService.fillCommonFormSections(fieldIds, commonData, labels, options);
|
2351 | };
|
2352 | |
2353 |
|
2354 |
|
2355 |
|
2356 |
|
2357 |
|
2358 |
|
2359 |
|
2360 |
|
2361 |
|
2362 | OrderFormService.getCustomFormSections = |
2363 |
|
2364 |
|
2365 |
|
2366 |
|
2367 |
|
2368 |
|
2369 |
|
2370 |
|
2371 |
|
2372 | function (orderForms, products, parentForm, fileUploadUrl, users, answers, options) {
|
2373 |
|
2374 | var formSections = products.map(( |
2375 |
|
2376 |
|
2377 |
|
2378 | function (product) {
|
2379 |
|
2380 | var subsections = [];
|
2381 | (product.addonInfo || []).map(( |
2382 |
|
2383 |
|
2384 |
|
2385 | function (addon) {
|
2386 |
|
2387 | var addonOrderForms = orderForms.filter(( |
2388 |
|
2389 |
|
2390 |
|
2391 | function (o) { return o.addonId === addon.addonId; }));
|
2392 |
|
2393 | var addonAnswers = (answers || []).filter(( |
2394 |
|
2395 |
|
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 |
|
2401 |
|
2402 |
|
2403 |
|
2404 | function (addonOrderForm, index) {
|
2405 | if (addonOrderForm && addonOrderForm.customFields && addonOrderForm.customFields.length > 0) {
|
2406 |
|
2407 | var addonSection = OrderFormService.buildOrderFormSectionData(parentForm);
|
2408 |
|
2409 | var addonAnswersForThisSpecificFormIndex = (addonAnswers.length > index) ? addonAnswers[index].customFieldsAnswers : [];
|
2410 |
|
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 |
|
2422 | var foundOrderForms = orderForms.reduce(( |
2423 |
|
2424 |
|
2425 |
|
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 |
|
2435 | var productHasOrderForm = primaryOrder && primaryOrder.customFields && primaryOrder.customFields.length > 0;
|
2436 | if (subsections.length > 0 || productHasOrderForm) {
|
2437 |
|
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 = '';
|
2444 | sectionData.iconUrl = product.icon;
|
2445 | if (productHasOrderForm) {
|
2446 |
|
2447 | var section_1 = OrderFormService.buildOrderFormSectionData(parentForm);
|
2448 | section_1.titleText = product.name;
|
2449 |
|
2450 | var productAnswers = [];
|
2451 | if (answers) {
|
2452 | productAnswers = answers.filter(( |
2453 |
|
2454 |
|
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 |
|
2463 |
|
2464 |
|
2465 |
|
2466 | function (_, index) {
|
2467 | |
2468 |
|
2469 |
|
2470 |
|
2471 |
|
2472 | var dupeSection = __assign({}, section_1);
|
2473 |
|
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 |
|
2485 |
|
2486 |
|
2487 | function (s) { return !!s; }));
|
2488 | return formSections;
|
2489 | };
|
2490 | |
2491 |
|
2492 |
|
2493 |
|
2494 |
|
2495 |
|
2496 |
|
2497 |
|
2498 |
|
2499 | OrderFormService.getExtraFieldsSection = |
2500 |
|
2501 |
|
2502 |
|
2503 |
|
2504 |
|
2505 |
|
2506 |
|
2507 |
|
2508 | function (extraFields, parentForm, fileUploadUrl, users, answers, options) {
|
2509 | if (!extraFields || extraFields.length < 1) {
|
2510 | return null;
|
2511 | }
|
2512 |
|
2513 | var section = OrderFormService.buildOrderFormSectionData(parentForm);
|
2514 | section.fields = OrderFormService.buildCustomOrderFormFields(extraFields, fileUploadUrl, users, answers, options);
|
2515 | return section;
|
2516 | };
|
2517 | |
2518 |
|
2519 |
|
2520 |
|
2521 | OrderFormService.getCustomFieldsData = |
2522 |
|
2523 |
|
2524 |
|
2525 | function (customFormSections) {
|
2526 |
|
2527 | var customFormData = customFormSections.reduce(( |
2528 |
|
2529 |
|
2530 |
|
2531 |
|
2532 | function (acc, orderFormData) {
|
2533 | acc = acc.concat(OrderFormService.productOrderFormToCustomFields(orderFormData));
|
2534 | return acc;
|
2535 | }), []);
|
2536 | return customFormData;
|
2537 | };
|
2538 | |
2539 |
|
2540 |
|
2541 |
|
2542 | OrderFormService.getCommonFieldsData = |
2543 |
|
2544 |
|
2545 |
|
2546 | function (commonFormSections) {
|
2547 |
|
2548 | var commonFields = [];
|
2549 | if (commonFormSections) {
|
2550 | commonFields = commonFormSections.reduce(( |
2551 |
|
2552 |
|
2553 |
|
2554 |
|
2555 | function (acc, group) {
|
2556 |
|
2557 | var fields = group.fields.map(( |
2558 |
|
2559 |
|
2560 |
|
2561 | function (singleField) {
|
2562 |
|
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 |
|
2579 |
|
2580 |
|
2581 | OrderFormService.getExtraFieldsData = |
2582 |
|
2583 |
|
2584 |
|
2585 | function (extraFieldsSection) {
|
2586 |
|
2587 | var extraFieldsData = [];
|
2588 | if (!!extraFieldsSection) {
|
2589 | extraFieldsData = extraFieldsSection.fields.map(( |
2590 |
|
2591 |
|
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 |
|
2614 | OrderFormService.ctorParameters = function () { return []; };
|
2615 | return OrderFormService;
|
2616 | }());
|
2617 | if (false) {
|
2618 |
|
2619 | OrderFormService.camelToSnakeCaseMap;
|
2620 | }
|
2621 |
|
2622 | |
2623 |
|
2624 |
|
2625 |
|
2626 | var OrderFormComponent = (function () {
|
2627 | function OrderFormComponent() {
|
2628 | this.dropdownOpen$$ = new rxjs.BehaviorSubject(false);
|
2629 | this.dropdownOpen$ = this.dropdownOpen$$.asObservable();
|
2630 | }
|
2631 | |
2632 |
|
2633 |
|
2634 | OrderFormComponent.prototype.ngOnInit = |
2635 |
|
2636 |
|
2637 | function () {
|
2638 |
|
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 |
|
2643 | this.extraFieldsSection = OrderFormService.getExtraFieldsSection(this.extraFields, this.parentForm, this.fileUploadUrl, this.users, this.extraFieldsAnswers, options);
|
2644 | };
|
2645 | |
2646 |
|
2647 |
|
2648 | |
2649 |
|
2650 |
|
2651 |
|
2652 | OrderFormComponent.prototype.getCommonFormData = |
2653 |
|
2654 |
|
2655 |
|
2656 | function () {
|
2657 | return OrderFormService.getCommonFieldsData(this.commonFormSections);
|
2658 | };
|
2659 | |
2660 |
|
2661 |
|
2662 | |
2663 |
|
2664 |
|
2665 |
|
2666 | OrderFormComponent.prototype.getCustomFormData = |
2667 |
|
2668 |
|
2669 |
|
2670 | function () {
|
2671 | return OrderFormService.getCustomFieldsData(this.customFormSections);
|
2672 | };
|
2673 | |
2674 |
|
2675 |
|
2676 | |
2677 |
|
2678 |
|
2679 |
|
2680 | OrderFormComponent.prototype.getExtraFieldsData = |
2681 |
|
2682 |
|
2683 |
|
2684 | function () {
|
2685 | return OrderFormService.getExtraFieldsData(this.extraFieldsSection);
|
2686 | };
|
2687 | |
2688 |
|
2689 |
|
2690 | |
2691 |
|
2692 |
|
2693 |
|
2694 |
|
2695 | OrderFormComponent.prototype.changeReadOnly = |
2696 |
|
2697 |
|
2698 |
|
2699 |
|
2700 | function (readOnly) {
|
2701 | this.orderFormOptions.readOnly = readOnly;
|
2702 | readOnly ? this.parentForm.disable() : this.parentForm.enable();
|
2703 | };
|
2704 | |
2705 |
|
2706 |
|
2707 | OrderFormComponent.prototype.openDropdown = |
2708 |
|
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 |
|
2738 | OrderFormComponent.prototype.commonData;
|
2739 |
|
2740 | OrderFormComponent.prototype.answers;
|
2741 |
|
2742 | OrderFormComponent.prototype.parentForm;
|
2743 |
|
2744 | OrderFormComponent.prototype.fileUploadUrl;
|
2745 |
|
2746 | OrderFormComponent.prototype.orderForms;
|
2747 |
|
2748 | OrderFormComponent.prototype.productInfo;
|
2749 |
|
2750 | OrderFormComponent.prototype.labels;
|
2751 |
|
2752 | OrderFormComponent.prototype.users;
|
2753 |
|
2754 | OrderFormComponent.prototype.extraFields;
|
2755 |
|
2756 | OrderFormComponent.prototype.extraFieldsAnswers;
|
2757 |
|
2758 | OrderFormComponent.prototype.orderFormOptions;
|
2759 |
|
2760 | OrderFormComponent.prototype.commonFormSections;
|
2761 |
|
2762 | OrderFormComponent.prototype.customFormSections;
|
2763 |
|
2764 | OrderFormComponent.prototype.extraFieldsSection;
|
2765 |
|
2766 | OrderFormComponent.prototype.dropdownOpen$$;
|
2767 |
|
2768 | OrderFormComponent.prototype.dropdownOpen$;
|
2769 | }
|
2770 | var OrderFormOptions = (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 |
|
2780 | OrderFormOptions.prototype.bypassRequiredQuestions;
|
2781 |
|
2782 | OrderFormOptions.prototype.readOnly;
|
2783 |
|
2784 | OrderFormOptions.prototype.showOfficeUseQuestions;
|
2785 | }
|
2786 |
|
2787 | |
2788 |
|
2789 |
|
2790 |
|
2791 |
|
2792 | var FILES = 'file';
|
2793 |
|
2794 | var DROP_DOWN = 'dropdown';
|
2795 |
|
2796 | var CHECK_BOX = 'checkbox';
|
2797 |
|
2798 | var TEXT_AREA = 'textarea';
|
2799 |
|
2800 | var TEXT_BOX = 'textbox';
|
2801 |
|
2802 | var BUSINESS_USER = 'vbcuser';
|
2803 | |
2804 |
|
2805 |
|
2806 | function FieldBaseOptions() { }
|
2807 | if (false) {
|
2808 |
|
2809 | FieldBaseOptions.prototype.id;
|
2810 |
|
2811 | FieldBaseOptions.prototype.label;
|
2812 |
|
2813 | FieldBaseOptions.prototype.required;
|
2814 |
|
2815 | FieldBaseOptions.prototype.description;
|
2816 |
|
2817 | FieldBaseOptions.prototype.type;
|
2818 |
|
2819 | FieldBaseOptions.prototype.prefix;
|
2820 |
|
2821 | FieldBaseOptions.prototype.suffix;
|
2822 |
|
2823 | FieldBaseOptions.prototype.regexValidator;
|
2824 |
|
2825 | FieldBaseOptions.prototype.regexErrorMessage;
|
2826 |
|
2827 | FieldBaseOptions.prototype.disabled;
|
2828 |
|
2829 | FieldBaseOptions.prototype.forOfficeUseOnly;
|
2830 |
|
2831 | FieldBaseOptions.prototype.hidden;
|
2832 |
|
2833 | FieldBaseOptions.prototype.displayOnly;
|
2834 | }
|
2835 | |
2836 |
|
2837 |
|
2838 |
|
2839 | var |
2840 |
|
2841 |
|
2842 |
|
2843 | FieldBase = (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 = ( (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 |
|
2863 |
|
2864 | FieldBase.prototype.getLabel = |
2865 |
|
2866 |
|
2867 | function () {
|
2868 |
|
2869 | var fieldLabel = this.label;
|
2870 | if (this.required) {
|
2871 | fieldLabel += ' *';
|
2872 | }
|
2873 | return fieldLabel;
|
2874 | };
|
2875 | |
2876 |
|
2877 |
|
2878 |
|
2879 | FieldBase.prototype.validatorBuilder = |
2880 |
|
2881 |
|
2882 |
|
2883 | function () {
|
2884 | return ( |
2885 |
|
2886 |
|
2887 |
|
2888 | function (control) {
|
2889 | return null;
|
2890 | });
|
2891 | };
|
2892 | return FieldBase;
|
2893 | }());
|
2894 | if (false) {
|
2895 |
|
2896 | FieldBase.prototype.value;
|
2897 |
|
2898 | FieldBase.prototype.id;
|
2899 |
|
2900 | FieldBase.prototype.label;
|
2901 |
|
2902 | FieldBase.prototype.required;
|
2903 |
|
2904 | FieldBase.prototype.order;
|
2905 |
|
2906 | FieldBase.prototype.description;
|
2907 |
|
2908 | FieldBase.prototype.controlType;
|
2909 |
|
2910 | FieldBase.prototype.prefix;
|
2911 |
|
2912 | FieldBase.prototype.suffix;
|
2913 |
|
2914 | FieldBase.prototype.regexValidator;
|
2915 |
|
2916 | FieldBase.prototype.regexErrorMessage;
|
2917 |
|
2918 | FieldBase.prototype.disabled;
|
2919 |
|
2920 | FieldBase.prototype.validator;
|
2921 |
|
2922 | FieldBase.prototype.forOfficeUseOnly;
|
2923 |
|
2924 | FieldBase.prototype.hidden;
|
2925 |
|
2926 | FieldBase.prototype.displayOnly;
|
2927 | }
|
2928 |
|
2929 | |
2930 |
|
2931 |
|
2932 |
|
2933 | var FieldBuilderComponent = (function () {
|
2934 | function FieldBuilderComponent() {
|
2935 | this.removeField = new core.EventEmitter(null);
|
2936 | }
|
2937 | |
2938 |
|
2939 |
|
2940 |
|
2941 |
|
2942 | FieldBuilderComponent.createDropDownOption = |
2943 |
|
2944 |
|
2945 |
|
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 |
|
2956 |
|
2957 |
|
2958 | FieldBuilderComponent.createDropDownOptions = |
2959 |
|
2960 |
|
2961 |
|
2962 | function (options) {
|
2963 | if (options === null || options === undefined) {
|
2964 | options = [];
|
2965 | }
|
2966 |
|
2967 | var orderFormFieldsGroupArray = options.map(( |
2968 |
|
2969 |
|
2970 |
|
2971 | function (option) { return FieldBuilderComponent.createDropDownOption(option, false); }));
|
2972 | return new forms.FormArray(orderFormFieldsGroupArray);
|
2973 | };
|
2974 | |
2975 |
|
2976 |
|
2977 |
|
2978 | FieldBuilderComponent.createOrderFormFieldGroup = |
2979 |
|
2980 |
|
2981 |
|
2982 | function (orderFormField) {
|
2983 |
|
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 |
|
3002 | var optionsArray = FieldBuilderComponent.createDropDownOptions(orderFormField.optionsWithLabels);
|
3003 | orderFormFieldGroup.addControl('optionsFormArray', optionsArray);
|
3004 | }
|
3005 | else if (orderFormField.options) {
|
3006 |
|
3007 | var optionsArray = FieldBuilderComponent.createDropDownOptions(orderFormField.options.map(( |
3008 |
|
3009 |
|
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 |
|
3021 |
|
3022 | FieldBuilderComponent.prototype.ngOnInit = |
3023 |
|
3024 |
|
3025 | function () {
|
3026 | if (!this.supportedFieldTypes || this.supportedFieldTypes.length < 1) {
|
3027 | this.supportedFieldTypes = FORM_FIELDS;
|
3028 | }
|
3029 | this.initForm();
|
3030 | };
|
3031 | |
3032 |
|
3033 |
|
3034 | FieldBuilderComponent.prototype.initForm = |
3035 |
|
3036 |
|
3037 | function () {
|
3038 |
|
3039 | if (!this.orderFormFieldGroup.get('labelControl')) {
|
3040 | this.orderFormFieldGroup =
|
3041 | FieldBuilderComponent.createOrderFormFieldGroup({});
|
3042 | }
|
3043 | };
|
3044 | |
3045 |
|
3046 |
|
3047 | FieldBuilderComponent.prototype.getOptionsArray = |
3048 |
|
3049 |
|
3050 | function () {
|
3051 | return ( (this.orderFormFieldGroup.get('optionsFormArray')));
|
3052 | };
|
3053 | |
3054 |
|
3055 |
|
3056 | FieldBuilderComponent.prototype.getCurrentFieldInterface = |
3057 |
|
3058 |
|
3059 | function () {
|
3060 |
|
3061 | var formFieldTypeInterface = (( (this.orderFormFieldGroup.get('typeControl').value)));
|
3062 | return formFieldTypeInterface ? formFieldTypeInterface.id : null;
|
3063 | };
|
3064 | |
3065 |
|
3066 |
|
3067 |
|
3068 | FieldBuilderComponent.prototype.removeOption = |
3069 |
|
3070 |
|
3071 |
|
3072 | function (index) {
|
3073 |
|
3074 | var formArray = this.getOptionsArray();
|
3075 | formArray.removeAt(index);
|
3076 | };
|
3077 | |
3078 |
|
3079 |
|
3080 | FieldBuilderComponent.prototype.addOption = |
3081 |
|
3082 |
|
3083 | function () {
|
3084 |
|
3085 | var fieldArray = this.getOptionsArray();
|
3086 | fieldArray.push(FieldBuilderComponent.createDropDownOption({ label: '' }, true));
|
3087 | };
|
3088 | |
3089 |
|
3090 |
|
3091 | FieldBuilderComponent.prototype.getFormValues = |
3092 |
|
3093 |
|
3094 | function () {
|
3095 |
|
3096 | var obj = {};
|
3097 | obj.label = this.orderFormFieldGroup.get('labelControl').value;
|
3098 | obj.id = this.orderFormFieldGroup.get('idControl').value;
|
3099 |
|
3100 | var formFieldType = (( (this.orderFormFieldGroup.get('typeControl').value)));
|
3101 | obj.type = formFieldType ? formFieldType.id : null;
|
3102 |
|
3103 |
|
3104 | var optionsArray = (( (this.orderFormFieldGroup.get('optionsFormArray'))));
|
3105 | if (optionsArray && optionsArray.value) {
|
3106 | obj.options = optionsArray.value.map(( |
3107 |
|
3108 |
|
3109 |
|
3110 | function (option) { return option.value || option.label; }));
|
3111 | obj.optionsWithLabels = optionsArray.value.map(( |
3112 |
|
3113 |
|
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 |
|
3147 | FieldBuilderComponent.prototype.orderFormFieldGroup;
|
3148 |
|
3149 | FieldBuilderComponent.prototype.supportedFieldTypes;
|
3150 |
|
3151 | FieldBuilderComponent.prototype.removeField;
|
3152 |
|
3153 | FieldBuilderComponent.prototype.showValidators;
|
3154 |
|
3155 | FieldBuilderComponent.prototype.showSuffixes;
|
3156 | }
|
3157 |
|
3158 | |
3159 |
|
3160 |
|
3161 | function regexValidator() {
|
3162 | return ( |
3163 |
|
3164 |
|
3165 |
|
3166 | function (control) {
|
3167 | try {
|
3168 |
|
3169 | var _ = new RegExp(control.value || '');
|
3170 | }
|
3171 | catch (e) {
|
3172 | return { 'regex': true };
|
3173 | }
|
3174 | return null;
|
3175 | });
|
3176 | }
|
3177 | |
3178 |
|
3179 |
|
3180 | function numberValidator() {
|
3181 | return ( |
3182 |
|
3183 |
|
3184 |
|
3185 | function (control) {
|
3186 |
|
3187 | var isNumber = /^\d+$/;
|
3188 | if (isNumber.test(control.value)) {
|
3189 | return null;
|
3190 | }
|
3191 | return { 'number': true };
|
3192 | });
|
3193 | }
|
3194 | |
3195 |
|
3196 |
|
3197 | function FormFieldInterface() { }
|
3198 | if (false) {
|
3199 |
|
3200 | FormFieldInterface.prototype.id;
|
3201 |
|
3202 | FormFieldInterface.prototype.name;
|
3203 | }
|
3204 |
|
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 |
|
3212 |
|
3213 |
|
3214 | function getFieldInterface(formFieldId) {
|
3215 | return getFormFieldInterfaceFromId((( (formFieldId))));
|
3216 | }
|
3217 | |
3218 |
|
3219 |
|
3220 |
|
3221 | function getFormFieldInterfaceFromId(id) {
|
3222 | return FORM_FIELDS.find(( |
3223 |
|
3224 |
|
3225 |
|
3226 | function (obj) { return obj.id === id; }));
|
3227 | }
|
3228 |
|
3229 | |
3230 |
|
3231 |
|
3232 |
|
3233 | var OrderItemListService = (function () {
|
3234 | function OrderItemListService() {
|
3235 | }
|
3236 | |
3237 |
|
3238 |
|
3239 |
|
3240 | OrderItemListService.getPriceSummary = |
3241 |
|
3242 |
|
3243 |
|
3244 | function (items) {
|
3245 | if (!items) {
|
3246 | return { items: [], includesUndefinedPricing: false };
|
3247 | }
|
3248 |
|
3249 | var includesUndefinedPricing = false;
|
3250 |
|
3251 | var summaryItems = items.reduce(( |
3252 |
|
3253 |
|
3254 |
|
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 |
|
3263 |
|
3264 |
|
3265 | function (price) {
|
3266 | if (!price || price.price < 0) {
|
3267 | includesUndefinedPricing = true;
|
3268 | return;
|
3269 | }
|
3270 |
|
3271 | var freq = price.billingFrequency;
|
3272 |
|
3273 | var cur = item.pricing.currency;
|
3274 |
|
3275 | var existingCurIndex = currentArray.findIndex(( |
3276 |
|
3277 |
|
3278 |
|
3279 | function (summaryItem) { return summaryItem.currency === cur; }));
|
3280 |
|
3281 | var pricing = {
|
3282 | currency: cur,
|
3283 | prices: []
|
3284 | };
|
3285 | if (existingCurIndex > -1) {
|
3286 | pricing = currentArray[existingCurIndex];
|
3287 | }
|
3288 |
|
3289 | var existingFreqIndex = pricing.prices.findIndex(( |
3290 |
|
3291 |
|
3292 |
|
3293 | function (summaryItem) { return summaryItem.billingFrequency === freq; }));
|
3294 |
|
3295 | var quantifiedPrice = price.price !== null ? price.price * item.quantity : null;
|
3296 |
|
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 |
|
3328 |
|
3329 |
|
3330 | var OrderItemListComponent = (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 |
|
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 |
|
3351 |
|
3352 |
|
3353 | OrderItemListComponent.prototype.calculateTotalPrice = |
3354 |
|
3355 |
|
3356 |
|
3357 | function (price) {
|
3358 | if (price.price === null) {
|
3359 | return null;
|
3360 | }
|
3361 |
|
3362 | var totalPrice = price.price - price.discountAmount;
|
3363 | if (!this.taxOptions) {
|
3364 | return totalPrice;
|
3365 | }
|
3366 |
|
3367 | var taxTotal = this.taxOptions.reduce(( |
3368 |
|
3369 |
|
3370 |
|
3371 |
|
3372 | function (all, tax) { return all + (tax.percentage * totalPrice); }), 0);
|
3373 | return totalPrice + taxTotal;
|
3374 | };
|
3375 | |
3376 |
|
3377 |
|
3378 |
|
3379 | OrderItemListComponent.prototype.buildTaxLabel = |
3380 |
|
3381 |
|
3382 |
|
3383 | function (tax) {
|
3384 |
|
3385 | var taxPercentage = Number(tax.percentage * 100).toFixed(2);
|
3386 | return tax.label + " (" + taxPercentage + "%)";
|
3387 | };
|
3388 | |
3389 |
|
3390 |
|
3391 | OrderItemListComponent.prototype.isFree = |
3392 |
|
3393 |
|
3394 | function () {
|
3395 |
|
3396 | var summaryTotal = this.summaryItems.reduce(( |
3397 |
|
3398 |
|
3399 |
|
3400 |
|
3401 | function (all, item) {
|
3402 |
|
3403 | var totalPrices = item.prices.reduce(( |
3404 |
|
3405 |
|
3406 |
|
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 |
|
3429 | OrderItemListComponent.prototype.items;
|
3430 |
|
3431 | OrderItemListComponent.prototype.summaryItems;
|
3432 |
|
3433 | OrderItemListComponent.prototype.includesUndefinedPricing;
|
3434 |
|
3435 | OrderItemListComponent.prototype.taxOptions;
|
3436 |
|
3437 | OrderItemListComponent.prototype.hidePricing;
|
3438 | }
|
3439 |
|
3440 | |
3441 |
|
3442 |
|
3443 |
|
3444 | var PricePipe = (function () {
|
3445 | function PricePipe() {
|
3446 | }
|
3447 | |
3448 |
|
3449 |
|
3450 |
|
3451 |
|
3452 |
|
3453 |
|
3454 |
|
3455 |
|
3456 | PricePipe.prototype.transform = |
3457 |
|
3458 |
|
3459 |
|
3460 |
|
3461 |
|
3462 |
|
3463 |
|
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 = (function () {
|
3477 | function FormatBillingFrequencyPipe() {
|
3478 | }
|
3479 | |
3480 |
|
3481 |
|
3482 |
|
3483 | FormatBillingFrequencyPipe.prototype.transform = |
3484 |
|
3485 |
|
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 |
|
3498 |
|
3499 |
|
3500 | var VaOrderFormModule = (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 |
|
3514 |
|
3515 |
|
3516 | function (currentLang) { return translateService.use(currentLang); }));
|
3517 | }
|
3518 | if (defaultLang$) {
|
3519 | defaultLang$.subscribe(( |
3520 |
|
3521 |
|
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 |
|
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 |
|
3586 |
|
3587 |
|
3588 | VaOrderFormModule.prototype.translateService;
|
3589 | }
|
3590 |
|
3591 | |
3592 |
|
3593 |
|
3594 |
|
3595 | var StoreService = (function () {
|
3596 | function StoreService() {
|
3597 | }
|
3598 | |
3599 |
|
3600 |
|
3601 |
|
3602 | StoreService.prototype.markFormsAsTouched = |
3603 |
|
3604 |
|
3605 |
|
3606 | function (formGroup) {
|
3607 | for (var key in formGroup.controls) {
|
3608 | if (formGroup.controls[key] instanceof forms.FormGroup) {
|
3609 | this.markFormsAsTouched(( (formGroup.controls[key])));
|
3610 | }
|
3611 | else {
|
3612 | (( (formGroup.controls[key]))).markAsTouched();
|
3613 | (( (formGroup.controls[key]))).updateValueAndValidity();
|
3614 | }
|
3615 | }
|
3616 | };
|
3617 | StoreService.decorators = [
|
3618 | { type: core.Injectable }
|
3619 | ];
|
3620 | return StoreService;
|
3621 | }());
|
3622 |
|
3623 | |
3624 |
|
3625 |
|
3626 |
|
3627 | var File = (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 |
|
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 |
|
3665 | File.prototype.url;
|
3666 | }
|
3667 |
|
3668 | |
3669 |
|
3670 |
|
3671 |
|
3672 | |
3673 |
|
3674 |
|
3675 | function Pricing() { }
|
3676 | if (false) {
|
3677 |
|
3678 | Pricing.prototype.currency;
|
3679 |
|
3680 | Pricing.prototype.prices;
|
3681 | }
|
3682 | |
3683 |
|
3684 |
|
3685 | function Price() { }
|
3686 | if (false) {
|
3687 |
|
3688 | Price.prototype.price;
|
3689 |
|
3690 | Price.prototype.frequency;
|
3691 |
|
3692 | Price.prototype.isStartingPrice;
|
3693 | }
|
3694 |
|
3695 | var CONTACT_SALES = -1;
|
3696 |
|
3697 | |
3698 |
|
3699 |
|
3700 |
|
3701 | var Sellable = (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 |
|
3711 |
|
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 |
|
3726 |
|
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 |
|
3736 |
|
3737 |
|
3738 | Sellable.getCapitalizeFirstLetter = |
3739 |
|
3740 |
|
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 |
|
3752 | var hasCurrencyAndIsNotUSD = this.pricing.currency && this.pricing.currency !== 'USD';
|
3753 |
|
3754 | var currencyStr_1 = hasCurrencyAndIsNotUSD ? this.pricing.currency : '';
|
3755 |
|
3756 | var currencySymbol_1 = Sellable.getCurrencySymbol(this.pricing.currency);
|
3757 | return this.pricing.prices.map(( |
3758 |
|
3759 |
|
3760 |
|
3761 | function (price) {
|
3762 |
|
3763 | var frequencyStr = price.frequency ? '/ ' + Sellable.getCapitalizeFirstLetter(price.frequency) : '';
|
3764 |
|
3765 | var roundedPrice = ((price.price || 0) / 100.0).toFixed(2);
|
3766 |
|
3767 | var startingAtPrefix = price.isStartingPrice ? 'Starting at ' : '';
|
3768 |
|
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 |
|
3808 |
|
3809 |
|
3810 | Sellable.getCurrencySymbol = |
3811 |
|
3812 |
|
3813 |
|
3814 | function (currency) {
|
3815 |
|
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 |
|
3870 | Sellable.prototype.pricing;
|
3871 | }
|
3872 |
|
3873 | |
3874 |
|
3875 |
|
3876 |
|
3877 |
|
3878 | var
|
3879 |
|
3880 | CaseTransform = (function () {
|
3881 | function CaseTransform() {
|
3882 | }
|
3883 | |
3884 |
|
3885 |
|
3886 |
|
3887 | CaseTransform.snakeToCamelCase = |
3888 |
|
3889 |
|
3890 |
|
3891 | function (value) {
|
3892 | return value ? value.replace(new RegExp(/_/g), ' ').replace(/\b\w/g, ( |
3893 |
|
3894 |
|
3895 |
|
3896 | function (l) { return l.toUpperCase(); }))
|
3897 | .replace(/\b\w/, ( |
3898 |
|
3899 |
|
3900 |
|
3901 | function (l) { return l.toLowerCase(); })).replace(/\s/g, '') : value;
|
3902 | };
|
3903 | |
3904 |
|
3905 |
|
3906 |
|
3907 | CaseTransform.lowerToTitleCase = |
3908 |
|
3909 |
|
3910 |
|
3911 | function (value) {
|
3912 |
|
3913 |
|
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 |
|
3917 |
|
3918 |
|
3919 |
|
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 |
|
3940 |
|
3941 |
|
3942 |
|
3943 | var COLOR_CODES = [
|
3944 | '#EF5350', '#42A5F5', '#66BB6A', '#FFA726', '#AB47BC', '#FFCA28', '#EC407A', '#26C6DA',
|
3945 | '#FF7B57'
|
3946 | ];
|
3947 |
|
3948 | var DEFAULT_COLOR = '#808080';
|
3949 | var Product = (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 |
|
3979 |
|
3980 |
|
3981 | function (url) { return new File(url); })) : null;
|
3982 | }
|
3983 | return _this;
|
3984 | }
|
3985 | |
3986 |
|
3987 |
|
3988 |
|
3989 | Product.fromApi = |
3990 |
|
3991 |
|
3992 |
|
3993 | function (data) {
|
3994 |
|
3995 | var newProduct = {};
|
3996 | data = data || {};
|
3997 | for (var key in data) {
|
3998 | if (data.hasOwnProperty(key)) {
|
3999 |
|
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 |
|
4022 | if (!this.name) {
|
4023 | return DEFAULT_COLOR;
|
4024 | }
|
4025 |
|
4026 | var nameSum = 0;
|
4027 | for (var i = 0; i < this.name.length; i++) {
|
4028 | nameSum += this.name[i].charCodeAt(0);
|
4029 | }
|
4030 |
|
4031 | var index = nameSum % COLOR_CODES.length;
|
4032 | return COLOR_CODES[index];
|
4033 | },
|
4034 | enumerable: true,
|
4035 | configurable: true
|
4036 | });
|
4037 | |
4038 |
|
4039 |
|
4040 | Product.prototype.getLmiCategoryNames = |
4041 |
|
4042 |
|
4043 | function () {
|
4044 |
|
4045 | var lmiCategories = this.lmiCategories || [];
|
4046 | return lmiCategories.map(( |
4047 |
|
4048 |
|
4049 |
|
4050 | function (lmiCategory) { return CaseTransform.lowerToTitleCase(lmiCategory.toLowerCase().replace(/_/g, ' ')); }));
|
4051 | };
|
4052 | return Product;
|
4053 | }(Sellable));
|
4054 | if (false) {
|
4055 |
|
4056 | Product.prototype.productId;
|
4057 |
|
4058 | Product.prototype.editionId;
|
4059 |
|
4060 | Product.prototype.editionName;
|
4061 |
|
4062 | Product.prototype.name;
|
4063 |
|
4064 | Product.prototype.description;
|
4065 |
|
4066 | Product.prototype.tagline;
|
4067 |
|
4068 | Product.prototype.iconUrl;
|
4069 |
|
4070 | Product.prototype.entryUrl;
|
4071 |
|
4072 | Product.prototype.screenshotUrls;
|
4073 |
|
4074 | Product.prototype.pdfUploadUrls;
|
4075 |
|
4076 | Product.prototype.lmiCategories;
|
4077 |
|
4078 | Product.prototype.keySellingPoints;
|
4079 |
|
4080 | Product.prototype.faqs;
|
4081 |
|
4082 | Product.prototype.wholesalePrice;
|
4083 |
|
4084 | Product.prototype.currency;
|
4085 |
|
4086 | Product.prototype.billingFrequency;
|
4087 |
|
4088 | Product.prototype.billingId;
|
4089 |
|
4090 | Product.prototype.isArchived;
|
4091 |
|
4092 | Product.prototype.addons;
|
4093 |
|
4094 | Product.prototype.files;
|
4095 |
|
4096 | Product.prototype.restrictions;
|
4097 |
|
4098 | Product.prototype.trialConfiguration;
|
4099 | }
|
4100 | var ProductWithParent = (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 |
|
4112 |
|
4113 |
|
4114 | ProductWithParent.fromApi = |
4115 |
|
4116 |
|
4117 |
|
4118 | function (data) {
|
4119 |
|
4120 | var newProduct = {};
|
4121 | data = data || {};
|
4122 | for (var key in data) {
|
4123 | if (data.hasOwnProperty(key)) {
|
4124 |
|
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 |
|
4135 | ProductWithParent.prototype.parentId;
|
4136 |
|
4137 | ProductWithParent.prototype.parentName;
|
4138 |
|
4139 | ProductWithParent.prototype.parentIconUrl;
|
4140 |
|
4141 | ProductWithParent.prototype.multipleActivations;
|
4142 | }
|
4143 | |
4144 |
|
4145 |
|
4146 | function TrialConfigurationInterface() { }
|
4147 | if (false) {
|
4148 |
|
4149 | TrialConfigurationInterface.prototype.trialEnabled;
|
4150 |
|
4151 | TrialConfigurationInterface.prototype.trialDuration;
|
4152 | }
|
4153 |
|
4154 | |
4155 |
|
4156 |
|
4157 |
|
4158 | var AddonDetailsComponent = (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 |
|
4170 |
|
4171 | AddonDetailsComponent.prototype.onPrerequisiteSelected = |
4172 |
|
4173 |
|
4174 | function () {
|
4175 | this.prerequisiteSelected.emit();
|
4176 | };
|
4177 | |
4178 |
|
4179 |
|
4180 | AddonDetailsComponent.prototype.onActionSelected = |
4181 |
|
4182 |
|
4183 | function () {
|
4184 | this.actionSelected.emit();
|
4185 | };
|
4186 | |
4187 |
|
4188 |
|
4189 |
|
4190 |
|
4191 | AddonDetailsComponent.prototype.getPricing = |
4192 |
|
4193 |
|
4194 |
|
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 |
|
4241 | AddonDetailsComponent.prototype.product;
|
4242 |
|
4243 | AddonDetailsComponent.prototype.addon;
|
4244 |
|
4245 | AddonDetailsComponent.prototype.reseller;
|
4246 |
|
4247 | AddonDetailsComponent.prototype.billedProduct;
|
4248 |
|
4249 | AddonDetailsComponent.prototype.hasVerifiedContract;
|
4250 |
|
4251 | AddonDetailsComponent.prototype.loaded;
|
4252 |
|
4253 | AddonDetailsComponent.prototype.showPricing;
|
4254 |
|
4255 | AddonDetailsComponent.prototype.showEnableAddon;
|
4256 |
|
4257 | AddonDetailsComponent.prototype.actionEnabled;
|
4258 |
|
4259 | AddonDetailsComponent.prototype.prerequisiteSelected;
|
4260 |
|
4261 | AddonDetailsComponent.prototype.actionSelected;
|
4262 | }
|
4263 |
|
4264 | |
4265 |
|
4266 |
|
4267 |
|
4268 | var VaFilesComponent = (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 |
|
4285 | VaFilesComponent.prototype.files;
|
4286 | }
|
4287 |
|
4288 | |
4289 |
|
4290 |
|
4291 |
|
4292 | var VaFilesModule = (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 |
|
4310 |
|
4311 |
|
4312 | var VaFaqsComponent = (function () {
|
4313 | function VaFaqsComponent() {
|
4314 | this.openFaqs = [];
|
4315 | }
|
4316 | |
4317 |
|
4318 |
|
4319 |
|
4320 | VaFaqsComponent.prototype.toggleFaq = |
4321 |
|
4322 |
|
4323 |
|
4324 | function (index) {
|
4325 | if (this.openFaqs.indexOf(index) >= 0) {
|
4326 | this.openFaqs.splice(this.openFaqs.indexOf(index), 1);
|
4327 | }
|
4328 | else {
|
4329 | this.openFaqs.push(index);
|
4330 | }
|
4331 | };
|
4332 | |
4333 |
|
4334 |
|
4335 |
|
4336 | VaFaqsComponent.prototype.isFaqOpen = |
4337 |
|
4338 |
|
4339 |
|
4340 | function (index) {
|
4341 | return this.openFaqs.indexOf(index) >= 0;
|
4342 | };
|
4343 | |
4344 |
|
4345 |
|
4346 |
|
4347 | VaFaqsComponent.prototype.faqIcon = |
4348 |
|
4349 |
|
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 |
|
4368 | VaFaqsComponent.prototype.faqs;
|
4369 |
|
4370 | VaFaqsComponent.prototype.openFaqs;
|
4371 | }
|
4372 |
|
4373 | |
4374 |
|
4375 |
|
4376 |
|
4377 | var VaFaqsModule = (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 |
|
4392 |
|
4393 |
|
4394 | var VaSellingInfoComponent = (function () {
|
4395 | function VaSellingInfoComponent() {
|
4396 | }
|
4397 | Object.defineProperty(VaSellingInfoComponent.prototype, "filterDescription", {
|
4398 | get: /**
|
4399 | * @return {?}
|
4400 | */
|
4401 | function () {
|
4402 |
|
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 |
|
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 |
|
4429 | VaSellingInfoComponent.prototype.description;
|
4430 |
|
4431 | VaSellingInfoComponent.prototype.keySellingPoints;
|
4432 | }
|
4433 |
|
4434 | |
4435 |
|
4436 |
|
4437 |
|
4438 | var VaSellingInfoModule = (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 |
|
4453 |
|
4454 |
|
4455 | var SupportedCountriesComponent = (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 |
|
4472 | SupportedCountriesComponent.prototype.countryCodes;
|
4473 | }
|
4474 |
|
4475 | |
4476 |
|
4477 |
|
4478 |
|
4479 | var RestrictionsModule = (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 |
|
4494 |
|
4495 |
|
4496 | var AddonModule = (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 |
|
4527 |
|
4528 |
|
4529 | var DetailsStencilComponent = (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 |
|
4544 |
|
4545 |
|
4546 | var CardStencilComponent = (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 |
|
4561 |
|
4562 |
|
4563 | var CardListStencilComponent = (function () {
|
4564 | function CardListStencilComponent() {
|
4565 | this.numCards = 3;
|
4566 | this.cards = [];
|
4567 | }
|
4568 | |
4569 |
|
4570 |
|
4571 | CardListStencilComponent.prototype.ngOnInit = |
4572 |
|
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 |
|
4593 | CardListStencilComponent.prototype.numCards;
|
4594 |
|
4595 | CardListStencilComponent.prototype.cards;
|
4596 | }
|
4597 |
|
4598 | |
4599 |
|
4600 |
|
4601 |
|
4602 | var SearchBarStencilComponent = (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 |
|
4617 |
|
4618 |
|
4619 | var ListStencilComponent = (function () {
|
4620 | function ListStencilComponent() {
|
4621 | this.showHeader = true;
|
4622 | this.numRows = 3;
|
4623 | this.rowHeight = '51px';
|
4624 |
|
4625 | this.sidePadding = '17px';
|
4626 |
|
4627 | this.rows = [];
|
4628 | }
|
4629 | |
4630 |
|
4631 |
|
4632 | ListStencilComponent.prototype.ngOnInit = |
4633 |
|
4634 |
|
4635 | function () {
|
4636 | for (var n = 0; n < this.numRows; n++) {
|
4637 | this.rows.push(n);
|
4638 | }
|
4639 |
|
4640 |
|
4641 |
|
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 |
|
4664 | ListStencilComponent.prototype.showHeader;
|
4665 |
|
4666 | ListStencilComponent.prototype.numRows;
|
4667 |
|
4668 | ListStencilComponent.prototype.rowHeight;
|
4669 |
|
4670 | ListStencilComponent.prototype.sidePadding;
|
4671 |
|
4672 | ListStencilComponent.prototype.rows;
|
4673 |
|
4674 | ListStencilComponent.prototype.listItemRowStyles;
|
4675 | }
|
4676 |
|
4677 | |
4678 |
|
4679 |
|
4680 |
|
4681 | var StencilsModule = (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 |
|
4696 |
|
4697 |
|
4698 | var VaAddonListComponent = (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 |
|
4748 |
|
4749 | VaAddonListComponent.prototype.ngOnInit = |
4750 |
|
4751 |
|
4752 | function () {
|
4753 | this.populateBilledProduct();
|
4754 | };
|
4755 | |
4756 |
|
4757 |
|
4758 | VaAddonListComponent.prototype.populateBilledProduct = |
4759 |
|
4760 |
|
4761 | function () {
|
4762 | var _this = this;
|
4763 | if (this.displayContractPricing()) {
|
4764 |
|
4765 | var billingIDs = this._addons.map(( |
4766 |
|
4767 |
|
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 |
|
4776 |
|
4777 |
|
4778 | function (pricing) {
|
4779 | _this._addons.forEach(( |
4780 |
|
4781 |
|
4782 |
|
4783 | function (addon) {
|
4784 |
|
4785 | var addonPricing = pricing[addon.billingId];
|
4786 | if (!addonPricing) {
|
4787 | return;
|
4788 | }
|
4789 |
|
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 |
|
4800 |
|
4801 |
|
4802 | VaAddonListComponent.prototype.onClick = |
4803 |
|
4804 |
|
4805 |
|
4806 | function (addonId) {
|
4807 | this.addonSelected.emit(addonId);
|
4808 | };
|
4809 | |
4810 |
|
4811 |
|
4812 |
|
4813 | VaAddonListComponent.prototype.instanceOfPricing = |
4814 |
|
4815 |
|
4816 |
|
4817 | function (object) {
|
4818 | if (typeof object === 'number') {
|
4819 | return false;
|
4820 | }
|
4821 | return object.currency !== undefined && object.prices !== undefined;
|
4822 | };
|
4823 | |
4824 |
|
4825 |
|
4826 |
|
4827 | VaAddonListComponent.prototype.getDisplayPricing = |
4828 |
|
4829 |
|
4830 |
|
4831 | function (addon) {
|
4832 |
|
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 |
|
4849 |
|
4850 | VaAddonListComponent.prototype.noData = |
4851 |
|
4852 |
|
4853 | function () {
|
4854 | return util.isNullOrUndefined(this._hasVerifiedContract) || util.isNullOrUndefined(this._canAccessContractPricing);
|
4855 | };
|
4856 | |
4857 |
|
4858 |
|
4859 | VaAddonListComponent.prototype.displayContractPricing = |
4860 |
|
4861 |
|
4862 | function () {
|
4863 | return this._canAccessContractPricing && this._hasVerifiedContract;
|
4864 | };
|
4865 | |
4866 |
|
4867 |
|
4868 |
|
4869 | VaAddonListComponent.prototype.isBilledProductLoaded = |
4870 |
|
4871 |
|
4872 |
|
4873 | function (addon) {
|
4874 | if (this.noData()) {
|
4875 | return false;
|
4876 | }
|
4877 | if (this.displayContractPricing()) {
|
4878 |
|
4879 | var value = this.billedProductLoaded.get(addon.addonId);
|
4880 | return value ? value : false;
|
4881 | }
|
4882 | return true;
|
4883 | };
|
4884 | |
4885 |
|
4886 |
|
4887 | VaAddonListComponent.prototype.ngOnDestroy = |
4888 |
|
4889 |
|
4890 | function () {
|
4891 | this.subscriptions.forEach(( |
4892 |
|
4893 |
|
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 |
|
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 |
|
4921 | VaAddonListComponent.prototype._addons;
|
4922 |
|
4923 | VaAddonListComponent.prototype.showPricing;
|
4924 |
|
4925 | VaAddonListComponent.prototype.partnerID;
|
4926 |
|
4927 | VaAddonListComponent.prototype._hasVerifiedContract;
|
4928 |
|
4929 | VaAddonListComponent.prototype._canAccessContractPricing;
|
4930 |
|
4931 | VaAddonListComponent.prototype.addonSelected;
|
4932 |
|
4933 | VaAddonListComponent.prototype.billedProductsMap;
|
4934 | |
4935 |
|
4936 |
|
4937 |
|
4938 | VaAddonListComponent.prototype.billedProductLoaded;
|
4939 | |
4940 |
|
4941 |
|
4942 |
|
4943 | VaAddonListComponent.prototype.subscriptions;
|
4944 | |
4945 |
|
4946 |
|
4947 |
|
4948 | VaAddonListComponent.prototype.billingService;
|
4949 | |
4950 |
|
4951 |
|
4952 |
|
4953 | VaAddonListComponent.prototype.cdr;
|
4954 | }
|
4955 |
|
4956 | |
4957 |
|
4958 |
|
4959 |
|
4960 | var VaAddonListModule = (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 |
|
4982 |
|
4983 |
|
4984 | |
4985 |
|
4986 |
|
4987 | function HeimdallServiceTokenInterface() { }
|
4988 | if (false) {
|
4989 | |
4990 |
|
4991 |
|
4992 |
|
4993 |
|
4994 |
|
4995 |
|
4996 |
|
4997 | HeimdallServiceTokenInterface.prototype.track = function (category, action, label, value, dimensions) { };
|
4998 | }
|
4999 |
|
5000 | var HeimdallServiceToken = new core.InjectionToken('HeimdallService');
|
5001 | var HeimdallClient = (function () {
|
5002 | function HeimdallClient(userEvents) {
|
5003 | this.userEvents = userEvents;
|
5004 | }
|
5005 | |
5006 |
|
5007 |
|
5008 |
|
5009 |
|
5010 |
|
5011 |
|
5012 |
|
5013 | HeimdallClient.prototype.track = |
5014 |
|
5015 |
|
5016 |
|
5017 |
|
5018 |
|
5019 |
|
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 |
|
5028 | HeimdallClient.ctorParameters = function () { return [
|
5029 | { type: undefined, decorators: [{ type: core.Inject, args: [HeimdallServiceToken,] }] }
|
5030 | ]; };
|
5031 | return HeimdallClient;
|
5032 | }());
|
5033 | if (false) {
|
5034 | |
5035 |
|
5036 |
|
5037 |
|
5038 | HeimdallClient.prototype.userEvents;
|
5039 | }
|
5040 | var HeimdallClientModule = (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 |
|
5053 |
|
5054 |
|
5055 |
|
5056 | var STOREFRONT_FILTER_NAME = 'Store Filters';
|
5057 | |
5058 |
|
5059 |
|
5060 | function StorefrontCategory() { }
|
5061 | if (false) {
|
5062 |
|
5063 | StorefrontCategory.prototype.id;
|
5064 |
|
5065 | StorefrontCategory.prototype.name;
|
5066 |
|
5067 | StorefrontCategory.prototype.packageIds;
|
5068 | }
|
5069 | var StorefrontComponent = (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 |
|
5115 |
|
5116 | StorefrontComponent.prototype.ngOnInit = |
5117 |
|
5118 |
|
5119 | function () {
|
5120 | var _this = this;
|
5121 |
|
5122 | var lmiCategoryCheckboxList = LMI_CATEGORIES.map(( |
5123 |
|
5124 |
|
5125 |
|
5126 | function (category) {
|
5127 | return new uikit.CheckboxFilterField({
|
5128 | name: category.name,
|
5129 | id: category.categoryId,
|
5130 | value: false,
|
5131 | condition: ( |
5132 |
|
5133 |
|
5134 |
|
5135 | function (item) {
|
5136 |
|
5137 | var lmiCategories = [];
|
5138 | if (item.lmiCategories) {
|
5139 | lmiCategories = item.lmiCategories.map(( |
5140 |
|
5141 |
|
5142 |
|
5143 | function (cat) {
|
5144 | return marketplacePackages.Categories[cat].toLowerCase();
|
5145 | }));
|
5146 | }
|
5147 | return lmiCategories.indexOf(category.categoryId) > -1;
|
5148 | })
|
5149 | });
|
5150 | }));
|
5151 |
|
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 |
|
5162 |
|
5163 |
|
5164 | function (categories) {
|
5165 |
|
5166 | var tabbedFilterField = new uikit.TabbedFilterField({
|
5167 | name: '',
|
5168 | value: null,
|
5169 | id: 'categorytab',
|
5170 | options: categories
|
5171 | });
|
5172 |
|
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 |
|
5186 |
|
5187 |
|
5188 | function (searchTerm) { return _this.userEvents.track('store', 'search-input', '', 1, { 'searchTerm': searchTerm }); }));
|
5189 |
|
5190 | var selectedLMIFilters$ = this.filterService.filters.fieldValuesObservable.pipe(operators.startWith([]), operators.map(( |
5191 |
|
5192 |
|
5193 | function () {
|
5194 | return _this.lmiCategoryFilter.fields.filter(( |
5195 |
|
5196 |
|
5197 |
|
5198 | function (item) { return item.value; }));
|
5199 | })));
|
5200 | this.showLMIFilter$ = selectedLMIFilters$.pipe(operators.filter(( |
5201 |
|
5202 |
|
5203 |
|
5204 | function (selectedLMIFilters) { return !!selectedLMIFilters; })), operators.take(1), operators.map(( |
5205 |
|
5206 |
|
5207 |
|
5208 | function (selectedLMIFilters) { return selectedLMIFilters.length > 0; })));
|
5209 | this.filteredItems$ = rxjs.combineLatest(this.packagesMap$$, this.searchTerm$$, this.selectedCateoryId$$, selectedLMIFilters$).pipe(operators.map(( |
5210 |
|
5211 |
|
5212 |
|
5213 | function (_a) {
|
5214 | var _b = __read(_a, 4), packages = _b[0], searchTerm = _b[1], selectedCategoryId = _b[2], selectedLMIFilters = _b[3];
|
5215 |
|
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 |
|
5223 |
|
5224 |
|
5225 | function (item) { return item.name.toLowerCase().indexOf(searchTerm.toLowerCase()) !== -1; })) : storeItems;
|
5226 | })));
|
5227 | };
|
5228 | |
5229 |
|
5230 |
|
5231 | StorefrontComponent.prototype.ngOnDestroy = |
5232 |
|
5233 |
|
5234 | function () {
|
5235 | this.searchTermSubscription.unsubscribe();
|
5236 | };
|
5237 | |
5238 |
|
5239 |
|
5240 |
|
5241 | StorefrontComponent.prototype.onSearchTermChanged = |
5242 |
|
5243 |
|
5244 |
|
5245 | function (term) {
|
5246 | this.searchTerm$$.next(term);
|
5247 | };
|
5248 | |
5249 |
|
5250 |
|
5251 |
|
5252 | StorefrontComponent.prototype.onFieldValueChanged = |
5253 |
|
5254 |
|
5255 |
|
5256 | function (filterField) {
|
5257 | if (!(filterField instanceof uikit.TabbedFilterField)) {
|
5258 | return;
|
5259 | }
|
5260 | this.selectedCateoryId$$.next(filterField.value.id);
|
5261 | this.categorySelected.emit(( (filterField.value)));
|
5262 |
|
5263 | var currentStoreItemsForSelectCategory = this.packagesMap$$.getValue().get(filterField.value.id);
|
5264 | if (!(currentStoreItemsForSelectCategory && currentStoreItemsForSelectCategory.length)) {
|
5265 | this.getDataForCategory.emit(( (filterField.value)));
|
5266 | }
|
5267 | };
|
5268 | |
5269 |
|
5270 |
|
5271 |
|
5272 | StorefrontComponent.prototype.storeItemClicked = |
5273 |
|
5274 |
|
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 |
|
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 |
|
5304 | StorefrontComponent.prototype.useCustomCase;
|
5305 |
|
5306 | StorefrontComponent.prototype.categorySelected;
|
5307 |
|
5308 | StorefrontComponent.prototype.packageIdSelected;
|
5309 |
|
5310 | StorefrontComponent.prototype.getDataForCategory;
|
5311 | |
5312 |
|
5313 |
|
5314 |
|
5315 | StorefrontComponent.prototype.categories$$;
|
5316 | |
5317 |
|
5318 |
|
5319 |
|
5320 | StorefrontComponent.prototype.packagesMap$$;
|
5321 | |
5322 |
|
5323 |
|
5324 |
|
5325 | StorefrontComponent.prototype.searchTerm$$;
|
5326 | |
5327 |
|
5328 |
|
5329 |
|
5330 | StorefrontComponent.prototype.selectedCateoryId$$;
|
5331 | |
5332 |
|
5333 |
|
5334 |
|
5335 | StorefrontComponent.prototype.lmiCategoryFilter;
|
5336 |
|
5337 | StorefrontComponent.prototype.filters$;
|
5338 |
|
5339 | StorefrontComponent.prototype.filteredItems$;
|
5340 |
|
5341 | StorefrontComponent.prototype.searchTermSubscription;
|
5342 |
|
5343 | StorefrontComponent.prototype.showLMIFilter$;
|
5344 | |
5345 |
|
5346 |
|
5347 |
|
5348 | StorefrontComponent.prototype.userEvents;
|
5349 | |
5350 |
|
5351 |
|
5352 |
|
5353 | StorefrontComponent.prototype.filterService;
|
5354 | |
5355 |
|
5356 |
|
5357 |
|
5358 | StorefrontComponent.prototype.translateService;
|
5359 | }
|
5360 |
|
5361 | |
5362 |
|
5363 |
|
5364 |
|
5365 | var StoreModule = (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 |
|
5379 |
|
5380 |
|
5381 | function (currentLang) { return translateService.use(currentLang); }));
|
5382 | }
|
5383 | if (defaultLang$) {
|
5384 | defaultLang$.subscribe(( |
5385 |
|
5386 |
|
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 |
|
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 |
|
5412 |
|
5413 |
|
5414 | StoreModule.prototype.translateService;
|
5415 | }
|
5416 |
|
5417 | |
5418 |
|
5419 |
|
5420 |
|
5421 | |
5422 |
|
5423 |
|
5424 | function LmiCategory() { }
|
5425 | if (false) {
|
5426 |
|
5427 | LmiCategory.prototype.name;
|
5428 |
|
5429 | LmiCategory.prototype.categoryId;
|
5430 | }
|
5431 |
|
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 |
|
5442 | var LMI_CATEGORY_MAP = LMI_CATEGORIES.reduce(( |
5443 |
|
5444 |
|
5445 |
|
5446 |
|
5447 | function (previous, current) {
|
5448 | previous[current.categoryId] = current;
|
5449 | return previous;
|
5450 | }), {});
|
5451 |
|
5452 | var LMI_CATEGORIES_BY_NAME = LMI_CATEGORIES.reduce(( |
5453 |
|
5454 |
|
5455 |
|
5456 |
|
5457 | function (previous, current) {
|
5458 | previous[current.name] = current;
|
5459 | return previous;
|
5460 | }), {});
|
5461 |
|
5462 | |
5463 |
|
5464 |
|
5465 |
|
5466 | var VaSalespersonDetailsComponent = (function () {
|
5467 | function VaSalespersonDetailsComponent() {
|
5468 | this.showGetItNow = true;
|
5469 | this.getItNow = new core.EventEmitter();
|
5470 | }
|
5471 | |
5472 |
|
5473 |
|
5474 | VaSalespersonDetailsComponent.prototype.onGetItNowSelected = |
5475 |
|
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 |
|
5554 | VaSalespersonDetailsComponent.prototype.salesperson;
|
5555 |
|
5556 | VaSalespersonDetailsComponent.prototype.packagePricing;
|
5557 |
|
5558 | VaSalespersonDetailsComponent.prototype.brandName;
|
5559 |
|
5560 | VaSalespersonDetailsComponent.prototype.showGetItNow;
|
5561 |
|
5562 | VaSalespersonDetailsComponent.prototype.getItNow;
|
5563 | }
|
5564 |
|
5565 | |
5566 |
|
5567 |
|
5568 |
|
5569 | var VaSalespersonDetailsModule = (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 |
|
5597 |
|
5598 |
|
5599 | var Package = (function (_super) {
|
5600 | __extends(Package, _super);
|
5601 | function Package() {
|
5602 | return _super !== null && _super.apply(this, arguments) || this;
|
5603 | }
|
5604 |
|
5605 | |
5606 |
|
5607 |
|
5608 |
|
5609 | Package.fromApi =
|
5610 |
|
5611 | |
5612 |
|
5613 |
|
5614 |
|
5615 | function (data) {
|
5616 |
|
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 |
|
5654 | Package.prototype.solution_id;
|
5655 |
|
5656 | Package.prototype.partner_id;
|
5657 |
|
5658 | Package.prototype.market_id;
|
5659 |
|
5660 | Package.prototype.name;
|
5661 |
|
5662 | Package.prototype.icon;
|
5663 |
|
5664 | Package.prototype.status;
|
5665 |
|
5666 | Package.prototype.tagline;
|
5667 |
|
5668 | Package.prototype.header_image_url;
|
5669 |
|
5670 | Package.prototype.content;
|
5671 |
|
5672 | Package.prototype.products;
|
5673 |
|
5674 | Package.prototype.addon_keys;
|
5675 |
|
5676 | Package.prototype.hide_product_icons_and_names;
|
5677 |
|
5678 | Package.prototype.hide_product_details;
|
5679 |
|
5680 | Package.prototype.createdDate;
|
5681 |
|
5682 | Package.prototype.updatedDate;
|
5683 |
|
5684 | Package.prototype.productOrder;
|
5685 | }
|
5686 |
|
5687 | |
5688 |
|
5689 |
|
5690 |
|
5691 | |
5692 |
|
5693 |
|
5694 |
|
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 |
|
5704 | var itemMap = (combined || []).reduce(( |
5705 |
|
5706 |
|
5707 |
|
5708 |
|
5709 | function (m, curr) {
|
5710 | m.set(getUniqueProductAddonId(curr), curr);
|
5711 | return m;
|
5712 | }), new Map());
|
5713 |
|
5714 | var combinedIdList = combined.map(getUniqueProductAddonId);
|
5715 |
|
5716 | var finalOrderedIds = combineProductOrderWithContainedProducts(order, combinedIdList);
|
5717 |
|
5718 | var orderedList = ( (finalOrderedIds.reduce(( |
5719 |
|
5720 |
|
5721 |
|
5722 |
|
5723 | function (items, id) {
|
5724 | items.push(itemMap.get(id));
|
5725 | return items;
|
5726 | }), [])));
|
5727 | return orderedList.filter(filterUniqueAndDefined);
|
5728 | }
|
5729 | |
5730 |
|
5731 |
|
5732 |
|
5733 |
|
5734 |
|
5735 | function filterUniqueAndDefined(elem, pos, arr) {
|
5736 | return elem && arr.indexOf(elem) === pos;
|
5737 | }
|
5738 | |
5739 |
|
5740 |
|
5741 |
|
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 |
|
5753 |
|
5754 |
|
5755 | function (elem) { return itemIds.indexOf(elem) >= 0; }))
|
5756 | .concat(itemIds)
|
5757 | .filter(filterUniqueAndDefined);
|
5758 | }
|
5759 | |
5760 |
|
5761 |
|
5762 |
|
5763 | function getUniqueProductAddonId(thing) {
|
5764 | return thing['addonId'] || thing['productId'];
|
5765 | }
|
5766 |
|
5767 | |
5768 |
|
5769 |
|
5770 |
|
5771 | var VaPackageDetailsComponent = (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 |
|
5784 |
|
5785 |
|
5786 |
|
5787 | function (products, addons) {
|
5788 | return ( ([].concat(products || []).concat(addons || [])));
|
5789 | }));
|
5790 | this.orderedItemsList$ = rxjs.combineLatest(this.combinedItemsList$, this.pkg$, ( |
5791 |
|
5792 |
|
5793 |
|
5794 |
|
5795 | function (combined, pkg) {
|
5796 | return orderProductsAndAddons(combined, pkg ? pkg.productOrder || [] : []);
|
5797 | }));
|
5798 |
|
5799 | var nonEmptyCombinedItemsList = this.combinedItemsList$.pipe(operators.skipWhile(( |
5800 |
|
5801 |
|
5802 |
|
5803 | function (items) { return !items || items.length === 0; })), operators.shareReplay(1));
|
5804 |
|
5805 |
|
5806 | var initialSelectedItem$ = nonEmptyCombinedItemsList.pipe(operators.map(( |
5807 |
|
5808 |
|
5809 |
|
5810 | function (_) { return 0; })), operators.take(1));
|
5811 |
|
5812 | var mergedSelection = rxjs.merge(initialSelectedItem$, this.itemSelectedEvent$);
|
5813 | this.selectedItem$ = rxjs.combineLatest(mergedSelection, this.orderedItemsList$).pipe(operators.map(( |
5814 |
|
5815 |
|
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 |
|
5823 |
|
5824 |
|
5825 | function (products) { return !products || products.length === 0; })), operators.map(( |
5826 |
|
5827 |
|
5828 |
|
5829 | function (products) {
|
5830 | return VaPackageDetailsComponent.getLmiCategories(products);
|
5831 | })));
|
5832 | this.productNameForSingleAddon$ = nonEmptyCombinedItemsList.pipe(operators.map(( |
5833 |
|
5834 |
|
5835 |
|
5836 | function (items) {
|
5837 | return VaPackageDetailsComponent.getProductNameForSingleAddon(items);
|
5838 | })));
|
5839 | this.displayTagName$ = rxjs.combineLatest(this.pkg$, this.combinedItemsList$).pipe(operators.map(( |
5840 |
|
5841 |
|
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 |
|
5894 |
|
5895 |
|
5896 | VaPackageDetailsComponent.getLmiCategories = |
5897 |
|
5898 |
|
5899 |
|
5900 | function (products) {
|
5901 |
|
5902 | var lmiCategories = [];
|
5903 | if (products) {
|
5904 | products.forEach(( |
5905 |
|
5906 |
|
5907 |
|
5908 | function (product) {
|
5909 | lmiCategories = lmiCategories.concat(product.getLmiCategoryNames());
|
5910 | }));
|
5911 | }
|
5912 | return new Set(lmiCategories);
|
5913 | };
|
5914 | |
5915 |
|
5916 |
|
5917 |
|
5918 |
|
5919 | VaPackageDetailsComponent.getDisplayTagline = |
5920 |
|
5921 |
|
5922 |
|
5923 |
|
5924 | function (pkg, items) {
|
5925 | if (pkg && pkg.tagline) {
|
5926 | return pkg.tagline;
|
5927 | }
|
5928 | else if (items && items.length === 1) {
|
5929 |
|
5930 | return items[0].tagline || '';
|
5931 | }
|
5932 | return '';
|
5933 | };
|
5934 | |
5935 |
|
5936 |
|
5937 |
|
5938 | VaPackageDetailsComponent.getProductNameForSingleAddon = |
5939 |
|
5940 |
|
5941 |
|
5942 | function (items) {
|
5943 | if (items && items.length === 1 && items[0] instanceof shared.Addon) {
|
5944 |
|
5945 | var addon = ( (items[0]));
|
5946 | return addon.productName;
|
5947 | }
|
5948 | };
|
5949 | |
5950 |
|
5951 |
|
5952 |
|
5953 | VaPackageDetailsComponent.prototype.selectItem = |
5954 |
|
5955 |
|
5956 |
|
5957 | function (i) {
|
5958 | this.itemSelectedEvent$.next(i);
|
5959 | };
|
5960 | |
5961 |
|
5962 |
|
5963 | VaPackageDetailsComponent.prototype.emitGetItNow = |
5964 |
|
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 |
|
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 |
|
5992 | VaPackageDetailsComponent.prototype.showActionButton;
|
5993 |
|
5994 | VaPackageDetailsComponent.prototype.showPricing;
|
5995 |
|
5996 | VaPackageDetailsComponent.prototype.actionLabel;
|
5997 |
|
5998 | VaPackageDetailsComponent.prototype.getItNow;
|
5999 |
|
6000 | VaPackageDetailsComponent.prototype.standAloneProducts$$;
|
6001 |
|
6002 | VaPackageDetailsComponent.prototype.products$;
|
6003 |
|
6004 | VaPackageDetailsComponent.prototype.addons$;
|
6005 |
|
6006 | VaPackageDetailsComponent.prototype.pkg$;
|
6007 |
|
6008 | VaPackageDetailsComponent.prototype.itemSelectedEvent$;
|
6009 |
|
6010 | VaPackageDetailsComponent.prototype.selectedItem$;
|
6011 |
|
6012 | VaPackageDetailsComponent.prototype.combinedItemsList$;
|
6013 |
|
6014 | VaPackageDetailsComponent.prototype.orderedItemsList$;
|
6015 |
|
6016 | VaPackageDetailsComponent.prototype.lmiCategories$;
|
6017 |
|
6018 | VaPackageDetailsComponent.prototype.productNameForSingleAddon$;
|
6019 |
|
6020 | VaPackageDetailsComponent.prototype.displayTagName$;
|
6021 | }
|
6022 |
|
6023 | |
6024 |
|
6025 |
|
6026 |
|
6027 | var VaProductsNavComponent = (function () {
|
6028 | function VaProductsNavComponent() {
|
6029 | this.itemSelected = new core.EventEmitter();
|
6030 | this.selectedIndex = 0;
|
6031 | this.pageMarker = 0;
|
6032 | }
|
6033 | |
6034 |
|
6035 |
|
6036 |
|
6037 | VaProductsNavComponent.prototype.onItemSelected = |
6038 |
|
6039 |
|
6040 |
|
6041 | function (index) {
|
6042 | this.selectedIndex = index;
|
6043 | this.itemSelected.emit(index);
|
6044 | };
|
6045 | |
6046 |
|
6047 |
|
6048 |
|
6049 | VaProductsNavComponent.prototype.moveSlides = |
6050 |
|
6051 |
|
6052 |
|
6053 | function (slides) {
|
6054 |
|
6055 | var sliderWidth = Math.round(slides.offsetWidth / slides.children[0].clientWidth);
|
6056 |
|
6057 | var numSlides = Math.ceil(slides.children.length / sliderWidth);
|
6058 | if (numSlides === 0) {
|
6059 | return;
|
6060 | }
|
6061 |
|
6062 | var pageWidth = slides.offsetWidth;
|
6063 |
|
6064 | var move = 0;
|
6065 | if (this.pageMarker === -1) {
|
6066 | this.pageMarker = numSlides - 1;
|
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;
|
6073 | }
|
6074 | else {
|
6075 | move = pageWidth * this.pageMarker;
|
6076 | slides.style.left = "-" + move + "px";
|
6077 | }
|
6078 | };
|
6079 | |
6080 |
|
6081 |
|
6082 |
|
6083 | VaProductsNavComponent.prototype.pageNext = |
6084 |
|
6085 |
|
6086 |
|
6087 | function (slides) {
|
6088 | this.pageMarker++;
|
6089 | this.moveSlides(slides);
|
6090 | };
|
6091 | |
6092 |
|
6093 |
|
6094 |
|
6095 | VaProductsNavComponent.prototype.pagePrev = |
6096 |
|
6097 |
|
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 |
|
6119 | VaProductsNavComponent.prototype.items;
|
6120 |
|
6121 | VaProductsNavComponent.prototype.hideItemsNav;
|
6122 |
|
6123 | VaProductsNavComponent.prototype.itemSelected;
|
6124 |
|
6125 | VaProductsNavComponent.prototype.selectedIndex;
|
6126 |
|
6127 | VaProductsNavComponent.prototype.pageMarker;
|
6128 | }
|
6129 |
|
6130 | |
6131 |
|
6132 |
|
6133 |
|
6134 | var ProductsNavV2Component = (function () {
|
6135 | function ProductsNavV2Component() {
|
6136 | this.itemSelected = new core.EventEmitter();
|
6137 | this.selected_id = '';
|
6138 | this.pageMarker = 0;
|
6139 | }
|
6140 | |
6141 |
|
6142 |
|
6143 |
|
6144 | ProductsNavV2Component.prototype.onItemSelected = |
6145 |
|
6146 |
|
6147 |
|
6148 | function (id) {
|
6149 | this.selected_id = id;
|
6150 | this.itemSelected.emit(id);
|
6151 | };
|
6152 | |
6153 |
|
6154 |
|
6155 |
|
6156 | ProductsNavV2Component.prototype.moveSlides = |
6157 |
|
6158 |
|
6159 |
|
6160 | function (slides) {
|
6161 |
|
6162 | var sliderWidth = Math.round(slides.offsetWidth / slides.children[0].clientWidth);
|
6163 |
|
6164 | var numSlides = Math.ceil(slides.children.length / sliderWidth);
|
6165 | if (numSlides === 0) {
|
6166 | return;
|
6167 | }
|
6168 |
|
6169 | var pageWidth = slides.offsetWidth;
|
6170 |
|
6171 | var move = 0;
|
6172 | if (this.pageMarker === -1) {
|
6173 | this.pageMarker = numSlides - 1;
|
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;
|
6180 | }
|
6181 | else {
|
6182 | move = pageWidth * this.pageMarker;
|
6183 | slides.style.left = "-" + move + "px";
|
6184 | }
|
6185 | };
|
6186 | |
6187 |
|
6188 |
|
6189 |
|
6190 | ProductsNavV2Component.prototype.pageNext = |
6191 |
|
6192 |
|
6193 |
|
6194 | function (slides) {
|
6195 | this.pageMarker++;
|
6196 | this.moveSlides(slides);
|
6197 | };
|
6198 | |
6199 |
|
6200 |
|
6201 |
|
6202 | ProductsNavV2Component.prototype.pagePrev = |
6203 |
|
6204 |
|
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 |
|
6226 | ProductsNavV2Component.prototype.items;
|
6227 |
|
6228 | ProductsNavV2Component.prototype.hideItemsNav;
|
6229 |
|
6230 | ProductsNavV2Component.prototype.itemSelected;
|
6231 |
|
6232 | ProductsNavV2Component.prototype.selected_id;
|
6233 |
|
6234 | ProductsNavV2Component.prototype.pageMarker;
|
6235 | }
|
6236 |
|
6237 | |
6238 |
|
6239 |
|
6240 |
|
6241 | var VaProductsNavModule = (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 |
|
6255 |
|
6256 |
|
6257 | function (currentLang) { return translateService.use(currentLang); }));
|
6258 | }
|
6259 | if (defaultLang$) {
|
6260 | defaultLang$.subscribe(( |
6261 |
|
6262 |
|
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 |
|
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 |
|
6291 |
|
6292 |
|
6293 | VaProductsNavModule.prototype.translateService;
|
6294 | }
|
6295 |
|
6296 | |
6297 |
|
6298 |
|
6299 |
|
6300 | var VaPackageDetailsModule = (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 |
|
6320 |
|
6321 |
|
6322 | var PackageDetails = (function () {
|
6323 | function PackageDetails() {
|
6324 | }
|
6325 | Object.defineProperty(PackageDetails.prototype, "isPackageFree", {
|
6326 | get: /**
|
6327 | * @return {?}
|
6328 | */
|
6329 | function () {
|
6330 |
|
6331 | var isFreeHelper = ( |
6332 |
|
6333 |
|
6334 |
|
6335 | function (prices) {
|
6336 | return prices ? prices.some(( |
6337 |
|
6338 |
|
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 |
|
6351 | PackageDetails.prototype.solution_id;
|
6352 |
|
6353 | PackageDetails.prototype.partner_id;
|
6354 |
|
6355 | PackageDetails.prototype.market_id;
|
6356 |
|
6357 | PackageDetails.prototype.name;
|
6358 |
|
6359 | PackageDetails.prototype.icon;
|
6360 |
|
6361 | PackageDetails.prototype.status;
|
6362 |
|
6363 | PackageDetails.prototype.tagline;
|
6364 |
|
6365 | PackageDetails.prototype.header_image_url;
|
6366 |
|
6367 | PackageDetails.prototype.content;
|
6368 |
|
6369 | PackageDetails.prototype.hide_product_icons_and_names;
|
6370 |
|
6371 | PackageDetails.prototype.hide_product_details;
|
6372 |
|
6373 | PackageDetails.prototype.createdDate;
|
6374 |
|
6375 | PackageDetails.prototype.updatedDate;
|
6376 |
|
6377 | PackageDetails.prototype.pricing;
|
6378 |
|
6379 | PackageDetails.prototype.line_items;
|
6380 |
|
6381 | PackageDetails.prototype.market_action;
|
6382 | }
|
6383 | |
6384 |
|
6385 |
|
6386 |
|
6387 |
|
6388 | function convertToPackageDetails(data, products) {
|
6389 | if (!data) {
|
6390 | return undefined;
|
6391 | }
|
6392 |
|
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 |
|
6424 |
|
6425 |
|
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 |
|
6433 |
|
6434 |
|
6435 | function (lineItem) {
|
6436 |
|
6437 | var product = products.find(( |
6438 |
|
6439 |
|
6440 |
|
6441 | function (p) { return p.productId === lineItem.id; }));
|
6442 |
|
6443 | var parent;
|
6444 | if (!!lineItem.parentId) {
|
6445 | parent = products.find(( |
6446 |
|
6447 |
|
6448 |
|
6449 | function (p) { return p.productId === lineItem.parentId; }));
|
6450 | }
|
6451 | return convertProtoLineItemToStoreLineItem(lineItem, product, parent);
|
6452 | }));
|
6453 | }
|
6454 | |
6455 |
|
6456 |
|
6457 |
|
6458 |
|
6459 |
|
6460 | function convertProtoLineItemToStoreLineItem(protoLineItem, product, parentProduct) {
|
6461 | if (!product || !protoLineItem) {
|
6462 | return undefined;
|
6463 | }
|
6464 |
|
6465 | var files = [];
|
6466 | if (product.pdfUploadUrls && product.pdfUploadUrls.length > 0) {
|
6467 | files = product.pdfUploadUrls.map(( |
6468 |
|
6469 |
|
6470 |
|
6471 | function (url) { return new File(url); }));
|
6472 | }
|
6473 |
|
6474 | var lineItem = ( ({
|
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 |
|
6505 |
|
6506 |
|
6507 | var VaPackageDetailsV2Component = (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 |
|
6528 |
|
6529 |
|
6530 | function (currentLang) { return _this.translateService.use(currentLang); }));
|
6531 | }
|
6532 | this.orderedLineItems$ = this.pkg$$.pipe(operators.map(( |
6533 |
|
6534 |
|
6535 |
|
6536 | function (pkg) { return pkg.line_items; })), operators.filter(( |
6537 |
|
6538 |
|
6539 |
|
6540 | function (items) { return !!items || items.length === 0; })), operators.shareReplay(1));
|
6541 | this.productNameForSingleAddon$ = this.orderedLineItems$.pipe(operators.map(( |
6542 |
|
6543 |
|
6544 |
|
6545 | function (items) { return _this.getParentsNameForItem(items); })));
|
6546 | this.selectedItem$ = rxjs.combineLatest([this.itemSelectedEvent$$, this.orderedLineItems$]).pipe(operators.map(( |
6547 |
|
6548 |
|
6549 |
|
6550 | function (_a) {
|
6551 | var _b = __read(_a, 2), id = _b[0], lineItems = _b[1];
|
6552 | return lineItems.find(( |
6553 |
|
6554 |
|
6555 |
|
6556 | function (lineItem) { return lineItem.item.id === id; }));
|
6557 | })));
|
6558 | this.lmiCategories$ = this.orderedLineItems$.pipe(operators.map(( |
6559 |
|
6560 |
|
6561 |
|
6562 | function (lis) {
|
6563 |
|
6564 | var lmiMap = (lis || []).reduce(( |
6565 |
|
6566 |
|
6567 |
|
6568 |
|
6569 | function (prev, li) {
|
6570 | if (li && li.item) {
|
6571 | (li.item.lmiCategories || []).forEach(( |
6572 |
|
6573 |
|
6574 |
|
6575 | function (lmi) { return prev.set(lmi, lmi); }));
|
6576 | }
|
6577 | return prev;
|
6578 | }), new Map());
|
6579 |
|
6580 | var lmiCats = [];
|
6581 | lmiMap.forEach(( |
6582 |
|
6583 |
|
6584 |
|
6585 |
|
6586 | function (v, k) {
|
6587 | lmiCats.push(k);
|
6588 | }));
|
6589 | return lmiCats;
|
6590 | })));
|
6591 |
|
6592 | this.orderedLineItems$.pipe(operators.map(( |
6593 |
|
6594 |
|
6595 |
|
6596 | function (lineItems) { return lineItems[0]; })), operators.tap(( |
6597 |
|
6598 |
|
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 |
|
6615 |
|
6616 |
|
6617 | VaPackageDetailsV2Component.prototype.selectItem = |
6618 |
|
6619 |
|
6620 |
|
6621 | function (id) {
|
6622 | this.itemSelectedEvent$$.next(id);
|
6623 | };
|
6624 | |
6625 |
|
6626 |
|
6627 | VaPackageDetailsV2Component.prototype.emitGetItNow = |
6628 |
|
6629 |
|
6630 | function () {
|
6631 | this.getItNow.emit();
|
6632 | };
|
6633 | |
6634 |
|
6635 |
|
6636 |
|
6637 | VaPackageDetailsV2Component.prototype.getParentsNameForItem = |
6638 |
|
6639 |
|
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 |
|
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 |
|
6669 | VaPackageDetailsV2Component.prototype.showActionButton;
|
6670 |
|
6671 | VaPackageDetailsV2Component.prototype.showPricing;
|
6672 |
|
6673 | VaPackageDetailsV2Component.prototype.actionLabel;
|
6674 |
|
6675 | VaPackageDetailsV2Component.prototype.getItNow;
|
6676 |
|
6677 | VaPackageDetailsV2Component.prototype.pkg$$;
|
6678 |
|
6679 | VaPackageDetailsV2Component.prototype.itemSelectedEvent$$;
|
6680 |
|
6681 | VaPackageDetailsV2Component.prototype.selectedItem$;
|
6682 |
|
6683 | VaPackageDetailsV2Component.prototype.orderedLineItems$;
|
6684 |
|
6685 | VaPackageDetailsV2Component.prototype.productNameForSingleAddon$;
|
6686 |
|
6687 | VaPackageDetailsV2Component.prototype.lmiCategories$;
|
6688 | |
6689 |
|
6690 |
|
6691 |
|
6692 | VaPackageDetailsV2Component.prototype.translateService;
|
6693 | }
|
6694 |
|
6695 | |
6696 |
|
6697 |
|
6698 |
|
6699 | var VaPackageDetailsV2Module = (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 |
|
6713 |
|
6714 |
|
6715 | function (currentLang) { return translateService.use(currentLang); }));
|
6716 | }
|
6717 | if (defaultLang$) {
|
6718 | defaultLang$.subscribe(( |
6719 |
|
6720 |
|
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 |
|
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 |
|
6759 |
|
6760 |
|
6761 | VaPackageDetailsV2Module.prototype.translateService;
|
6762 | }
|
6763 |
|
6764 | |
6765 |
|
6766 |
|
6767 |
|
6768 | |
6769 |
|
6770 |
|
6771 | function SalesPackage() { }
|
6772 | if (false) {
|
6773 |
|
6774 | SalesPackage.prototype.formattedPrices;
|
6775 |
|
6776 | SalesPackage.prototype.packageId;
|
6777 |
|
6778 | SalesPackage.prototype.name;
|
6779 |
|
6780 | SalesPackage.prototype.icon;
|
6781 |
|
6782 | SalesPackage.prototype.productIds;
|
6783 |
|
6784 | SalesPackage.prototype.products;
|
6785 |
|
6786 | SalesPackage.prototype.addonsWithNoParent;
|
6787 |
|
6788 | SalesPackage.prototype.totalAddons;
|
6789 |
|
6790 | SalesPackage.prototype.activationStatus;
|
6791 | }
|
6792 | |
6793 |
|
6794 |
|
6795 | function SalesProduct() { }
|
6796 | if (false) {
|
6797 |
|
6798 | SalesProduct.prototype.formattedPrices;
|
6799 |
|
6800 | SalesProduct.prototype.productId;
|
6801 |
|
6802 | SalesProduct.prototype.name;
|
6803 |
|
6804 | SalesProduct.prototype.icon;
|
6805 |
|
6806 | SalesProduct.prototype.tagline;
|
6807 |
|
6808 | SalesProduct.prototype.activationStatus;
|
6809 |
|
6810 | SalesProduct.prototype.editionId;
|
6811 |
|
6812 | SalesProduct.prototype.editionName;
|
6813 |
|
6814 | SalesProduct.prototype.addons;
|
6815 |
|
6816 | SalesProduct.prototype.parentInfo;
|
6817 | }
|
6818 | |
6819 |
|
6820 |
|
6821 | function ProductParentInfo() { }
|
6822 | if (false) {
|
6823 |
|
6824 | ProductParentInfo.prototype.parentId;
|
6825 |
|
6826 | ProductParentInfo.prototype.parentName;
|
6827 |
|
6828 | ProductParentInfo.prototype.parentIconUrl;
|
6829 |
|
6830 | ProductParentInfo.prototype.multipleActivations;
|
6831 | }
|
6832 | |
6833 |
|
6834 |
|
6835 | function SalesAddon() { }
|
6836 | if (false) {
|
6837 |
|
6838 | SalesAddon.prototype.parentId;
|
6839 |
|
6840 | SalesAddon.prototype.addonId;
|
6841 |
|
6842 | SalesAddon.prototype.name;
|
6843 |
|
6844 | SalesAddon.prototype.icon;
|
6845 |
|
6846 | SalesAddon.prototype.tagline;
|
6847 |
|
6848 | SalesAddon.prototype.parentName;
|
6849 |
|
6850 | SalesAddon.prototype.parentIcon;
|
6851 |
|
6852 | SalesAddon.prototype.multipleActivations;
|
6853 |
|
6854 | SalesAddon.prototype.activationStatus;
|
6855 | }
|
6856 | |
6857 |
|
6858 |
|
6859 | function PackageItemActivationStatus() { }
|
6860 | if (false) {
|
6861 |
|
6862 | PackageItemActivationStatus.prototype.packageItemId;
|
6863 |
|
6864 | PackageItemActivationStatus.prototype.status;
|
6865 | }
|
6866 |
|
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 |
|
6877 |
|
6878 | function StatusNotificationItem() { }
|
6879 | if (false) {
|
6880 |
|
6881 | StatusNotificationItem.prototype.icon;
|
6882 |
|
6883 | StatusNotificationItem.prototype.text;
|
6884 |
|
6885 | StatusNotificationItem.prototype.status;
|
6886 | }
|
6887 | |
6888 |
|
6889 |
|
6890 |
|
6891 |
|
6892 |
|
6893 | function buildSalesPackages(packages, products, addons) {
|
6894 | if (!packages || packages.length < 1) {
|
6895 | return [];
|
6896 | }
|
6897 | return packages.map(( |
6898 |
|
6899 |
|
6900 |
|
6901 | function (pkg) { return buildSalesPackageFromPackage(pkg, products, addons); }));
|
6902 | }
|
6903 | |
6904 |
|
6905 |
|
6906 |
|
6907 |
|
6908 |
|
6909 | function buildSalesPackageFromPackage(pkg, products, addons) {
|
6910 | if (!pkg) {
|
6911 | return null;
|
6912 | }
|
6913 |
|
6914 | var salesProducts = buildSalesProducts(pkg, products, addons);
|
6915 |
|
6916 |
|
6917 | var addonsWithNoParent = buildSalesAddonsWithNoParent(pkg, products, addons);
|
6918 | return createSalesPackage(pkg, salesProducts, addonsWithNoParent);
|
6919 | }
|
6920 | |
6921 |
|
6922 |
|
6923 |
|
6924 |
|
6925 |
|
6926 | function buildSalesProducts(pkg, products, addons) {
|
6927 | if (!(products && products.length && pkg.products && pkg.products.length)) {
|
6928 | return [];
|
6929 | }
|
6930 |
|
6931 | var productMap = new Map();
|
6932 | products.forEach(( |
6933 |
|
6934 |
|
6935 |
|
6936 | function (product) { return productMap.set(product.productId, product); }));
|
6937 | return pkg.products
|
6938 | .map(( |
6939 |
|
6940 |
|
6941 |
|
6942 | function (productId) {
|
6943 |
|
6944 | var productMatch = productMap.get(productId);
|
6945 |
|
6946 | var addonsInPackage = coerceAddonsForAddonKeys(addons, pkg.addon_keys);
|
6947 | return productMatch ? buildSalesProductFromProduct(productMatch, addonsInPackage) : null;
|
6948 | }))
|
6949 | .filter(( |
6950 |
|
6951 |
|
6952 |
|
6953 | function (productItem) { return productItem; }));
|
6954 | }
|
6955 | |
6956 |
|
6957 |
|
6958 |
|
6959 |
|
6960 | function coerceAddonsForAddonKeys(addons, addonKeys) {
|
6961 | if (!addons || addons.length === 0 || !addonKeys || addonKeys.length === 0) {
|
6962 | return [];
|
6963 | }
|
6964 | return addons.reduce(( |
6965 |
|
6966 |
|
6967 |
|
6968 |
|
6969 | function (addonsArray, addon) {
|
6970 |
|
6971 | var key = addonKeys.find(( |
6972 |
|
6973 |
|
6974 |
|
6975 | function (k) { return k.addonId === addon.addonId; }));
|
6976 | if (key) {
|
6977 |
|
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 |
|
6988 |
|
6989 |
|
6990 |
|
6991 |
|
6992 | function buildSalesAddonsWithNoParent(pkg, products, addons) {
|
6993 | if (!addons || addons.length < 1 || !pkg.addon_keys) {
|
6994 | return [];
|
6995 | }
|
6996 |
|
6997 | var productMap = new Map();
|
6998 | products.forEach(( |
6999 |
|
7000 |
|
7001 |
|
7002 | function (product) { return productMap.set(product.productId, product); }));
|
7003 |
|
7004 | var addonsMap = new Map();
|
7005 | addons.forEach(( |
7006 |
|
7007 |
|
7008 |
|
7009 | function (addon) { return addonsMap.set(addon.addonId, addon); }));
|
7010 |
|
7011 | var addonsWithNoParent = pkg.addon_keys.reduce(( |
7012 |
|
7013 |
|
7014 |
|
7015 |
|
7016 | function (addonArray, addonKey) {
|
7017 | if (pkg.products && pkg.products.some(( |
7018 |
|
7019 |
|
7020 |
|
7021 | function (productId) { return productId === addonKey.appId; }))) {
|
7022 | return addonArray || [];
|
7023 | }
|
7024 |
|
7025 | var parentProduct = productMap.get(addonKey.appId);
|
7026 |
|
7027 | var parentName = parentProduct ? parentProduct.name : null;
|
7028 |
|
7029 | var parentIcon = parentProduct ? parentProduct.iconUrl : null;
|
7030 |
|
7031 | var quantity = addonKey.quantity || 1;
|
7032 |
|
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 |
|
7043 |
|
7044 |
|
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 |
|
7054 | var productAddons = addons.filter(( |
7055 |
|
7056 |
|
7057 |
|
7058 | function (addon) { return addon.appId === product.productId; }));
|
7059 |
|
7060 | var salesAddons = createSalesAddons(productAddons);
|
7061 | return createSalesProduct(product, salesAddons);
|
7062 | }
|
7063 | |
7064 |
|
7065 |
|
7066 |
|
7067 |
|
7068 |
|
7069 | function createSalesPackage(pkg, salesProducts, addonsWithNoParent) {
|
7070 | var e_1, _a;
|
7071 |
|
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 |
|
7099 |
|
7100 |
|
7101 |
|
7102 | function createSalesProduct(product, salesAddons) {
|
7103 |
|
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 |
|
7127 |
|
7128 |
|
7129 | function createSalesAddons(addons) {
|
7130 | return addons.map(( |
7131 |
|
7132 |
|
7133 |
|
7134 | function (addon) { return createSalesAddon(addon); }));
|
7135 | }
|
7136 | |
7137 |
|
7138 |
|
7139 |
|
7140 |
|
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 |
|
7156 |
|
7157 |
|
7158 |
|
7159 |
|
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 |
|
7176 |
|
7177 |
|
7178 |
|
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 |
|
7196 |
|
7197 |
|
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 |
|
7214 |
|
7215 |
|
7216 |
|
7217 | function addStatusesToSalesPackages(salesPackages, statuses) {
|
7218 | if (!statuses || statuses.length === 0) {
|
7219 | return salesPackages;
|
7220 | }
|
7221 | return salesPackages.map(( |
7222 |
|
7223 |
|
7224 |
|
7225 | function (salesPackage) {
|
7226 |
|
7227 | var newProducts = salesPackage.products.map(( |
7228 |
|
7229 |
|
7230 |
|
7231 | function (product) { return addStatusesToSalesProduct(product, statuses); }));
|
7232 |
|
7233 | var newAddonsWithNoParent = salesPackage.addonsWithNoParent.map(( |
7234 |
|
7235 |
|
7236 |
|
7237 | function (addon) {
|
7238 |
|
7239 | var status = findStatus(statuses, addon.addonId);
|
7240 | return addStatusesToSalesAddon(addon, status);
|
7241 | }));
|
7242 |
|
7243 | var productStatuses = newProducts
|
7244 | .map(( |
7245 |
|
7246 |
|
7247 |
|
7248 | function (product) { return product.activationStatus.status; }));
|
7249 |
|
7250 | var addonStatuses = newProducts
|
7251 | .map(( |
7252 |
|
7253 |
|
7254 |
|
7255 | function (product) { return product.addons ? product.addons.map(( |
7256 |
|
7257 |
|
7258 |
|
7259 | function (addon) { return addon.activationStatus.status; })) : []; }))
|
7260 | .reduce(( |
7261 |
|
7262 |
|
7263 |
|
7264 |
|
7265 | function (statusList, reducedList) { return reducedList.concat(statusList); }), []);
|
7266 |
|
7267 | var addonsWithNoParentStatuses = newAddonsWithNoParent
|
7268 | .map(( |
7269 |
|
7270 |
|
7271 |
|
7272 | function (addon) { return addon.activationStatus ? addon.activationStatus.status : null; }));
|
7273 |
|
7274 | var allStatuses = __spread(productStatuses, addonStatuses, addonsWithNoParentStatuses);
|
7275 |
|
7276 | var packageStatus = convertNumberToActivationStatus(Math.max.apply(Math, __spread(allStatuses)));
|
7277 |
|
7278 | var statusNotification = createStatusNotificationItemForPackage(packageStatus);
|
7279 | return createSalesPackageWithStatus(salesPackage, newProducts, newAddonsWithNoParent, statusNotification);
|
7280 | }));
|
7281 | }
|
7282 | |
7283 |
|
7284 |
|
7285 |
|
7286 |
|
7287 | function addStatusesToSalesProduct(product, statuses) {
|
7288 | if (!statuses || statuses.length === 0) {
|
7289 | return product;
|
7290 | }
|
7291 |
|
7292 | var productStatus = findStatus(statuses, product.productId);
|
7293 |
|
7294 | var statusNotification = createStatusNotificationItemForPackageItem(productStatus);
|
7295 | if (!product.addons) {
|
7296 | return createSalesProductWithStatus(product, null, statusNotification);
|
7297 | }
|
7298 |
|
7299 | var newSalesAddons = product.addons.map(( |
7300 |
|
7301 |
|
7302 |
|
7303 | function (addon) {
|
7304 |
|
7305 | var addonStatus = findStatus(statuses, addon.addonId);
|
7306 | return addStatusesToSalesAddon(addon, addonStatus);
|
7307 | }));
|
7308 | return createSalesProductWithStatus(product, newSalesAddons, statusNotification);
|
7309 | }
|
7310 | |
7311 |
|
7312 |
|
7313 |
|
7314 |
|
7315 | function addStatusesToSalesAddon(addon, status) {
|
7316 |
|
7317 | var addonStatusNotification = createStatusNotificationItemForPackageItem(status);
|
7318 | return createSalesAddonWithStatus(addon, addonStatusNotification);
|
7319 | }
|
7320 | |
7321 |
|
7322 |
|
7323 |
|
7324 |
|
7325 | function findStatus(statuses, id) {
|
7326 | if (!statuses || statuses.length <= 0) {
|
7327 | return null;
|
7328 | }
|
7329 |
|
7330 | var statusIndex = statuses.findIndex(( |
7331 |
|
7332 |
|
7333 |
|
7334 | function (s) {
|
7335 | return s.packageItemId === id;
|
7336 | }));
|
7337 | if (statusIndex < 0) {
|
7338 | return null;
|
7339 | }
|
7340 |
|
7341 | var status = statuses[statusIndex].status;
|
7342 | statuses.splice(statusIndex, 1);
|
7343 | return status;
|
7344 | }
|
7345 | |
7346 |
|
7347 |
|
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 |
|
7361 |
|
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 |
|
7375 |
|
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 |
|
7390 |
|
7391 |
|
7392 |
|
7393 | var ListIndent = {
|
7394 | INDENT_ZERO: 'indent-zero',
|
7395 | INDENT_ONE: 'indent-one',
|
7396 | INDENT_TWO: 'indent-two',
|
7397 | };
|
7398 | var VaPackageDropdownItemComponent = (function () {
|
7399 | function VaPackageDropdownItemComponent() {
|
7400 | this.enableDropdown = false;
|
7401 | this.indent = ListIndent.INDENT_ZERO;
|
7402 | this.itemToggled = new core.EventEmitter();
|
7403 | }
|
7404 | |
7405 |
|
7406 |
|
7407 | VaPackageDropdownItemComponent.prototype.ngOnInit = |
7408 |
|
7409 |
|
7410 | function () {
|
7411 | };
|
7412 | |
7413 |
|
7414 |
|
7415 | VaPackageDropdownItemComponent.prototype.toggleItem = |
7416 |
|
7417 |
|
7418 | function () {
|
7419 | this.itemToggled.emit(null);
|
7420 | };
|
7421 | |
7422 |
|
7423 |
|
7424 |
|
7425 | VaPackageDropdownItemComponent.prototype.isActivatedStatus = |
7426 |
|
7427 |
|
7428 |
|
7429 | function (status) {
|
7430 | return status === ActivationStatus.SUCCESS;
|
7431 | };
|
7432 | |
7433 |
|
7434 |
|
7435 |
|
7436 | VaPackageDropdownItemComponent.prototype.isWarningStatus = |
7437 |
|
7438 |
|
7439 |
|
7440 | function (status) {
|
7441 | return status === ActivationStatus.WARNING;
|
7442 | };
|
7443 | |
7444 |
|
7445 |
|
7446 |
|
7447 | VaPackageDropdownItemComponent.prototype.isErrorStatus = |
7448 |
|
7449 |
|
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 |
|
7480 | VaPackageDropdownItemComponent.prototype.title;
|
7481 |
|
7482 | VaPackageDropdownItemComponent.prototype.titleBadge;
|
7483 |
|
7484 | VaPackageDropdownItemComponent.prototype.titleDescriptor;
|
7485 |
|
7486 | VaPackageDropdownItemComponent.prototype.iconUrl;
|
7487 |
|
7488 | VaPackageDropdownItemComponent.prototype.secondaryIconUrl;
|
7489 |
|
7490 | VaPackageDropdownItemComponent.prototype.secondaryIconName;
|
7491 |
|
7492 | VaPackageDropdownItemComponent.prototype.subtitle;
|
7493 |
|
7494 | VaPackageDropdownItemComponent.prototype.statusItem;
|
7495 |
|
7496 | VaPackageDropdownItemComponent.prototype.enableDropdown;
|
7497 |
|
7498 | VaPackageDropdownItemComponent.prototype.indent;
|
7499 |
|
7500 | VaPackageDropdownItemComponent.prototype.toggleValue;
|
7501 |
|
7502 | VaPackageDropdownItemComponent.prototype.description;
|
7503 |
|
7504 | VaPackageDropdownItemComponent.prototype.itemToggled;
|
7505 | }
|
7506 |
|
7507 | |
7508 |
|
7509 |
|
7510 |
|
7511 | |
7512 |
|
7513 |
|
7514 | function OrderLengthsForToggling() { }
|
7515 | if (false) {
|
7516 |
|
7517 | OrderLengthsForToggling.prototype.packages;
|
7518 |
|
7519 | OrderLengthsForToggling.prototype.products;
|
7520 | }
|
7521 | var VaPackageDropdownComponent = (function () {
|
7522 | function VaPackageDropdownComponent() {
|
7523 |
|
7524 | this.singularDropdown = false;
|
7525 |
|
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(( ({
|
7537 | packages: 0,
|
7538 | products: 0
|
7539 | })));
|
7540 | this.packageToggles = [];
|
7541 | this.productToggles = [];
|
7542 | }
|
7543 | Object.defineProperty(VaPackageDropdownComponent.prototype, "packages", {
|
7544 |
|
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 |
|
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 |
|
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 |
|
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 |
|
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 |
|
7615 |
|
7616 | VaPackageDropdownComponent.prototype.ngOnInit = |
7617 |
|
7618 |
|
7619 | function () {
|
7620 | var _this = this;
|
7621 |
|
7622 | var packages$ = this.packages$$.pipe(operators.filter(( |
7623 |
|
7624 |
|
7625 |
|
7626 | function (packages) { return packages !== null; })));
|
7627 |
|
7628 | var products$ = this.products$$.pipe(operators.filter(( |
7629 |
|
7630 |
|
7631 |
|
7632 | function (products) { return products !== null; })));
|
7633 |
|
7634 | var addons$ = this.addons$$.pipe(operators.filter(( |
7635 |
|
7636 |
|
7637 |
|
7638 | function (addons) { return addons !== null; })));
|
7639 |
|
7640 | var salesPackage$ = rxjs.zip(packages$, products$, addons$).pipe(operators.tap(( |
7641 |
|
7642 |
|
7643 |
|
7644 | function (_a) {
|
7645 | var _b = __read(_a, 3), packages = _b[0], products = _b[1], _ = _b[2];
|
7646 | _this.orderItemLengths$$.next(( ({
|
7647 | packages: packages.length,
|
7648 | products: products.length
|
7649 | })));
|
7650 | })), operators.map(( |
7651 |
|
7652 |
|
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 |
|
7660 |
|
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 |
|
7668 |
|
7669 |
|
7670 | function (_a) {
|
7671 | var _b = __read(_a, 2), products = _b[0], _ = _b[1];
|
7672 | return products !== null;
|
7673 | })), operators.map(( |
7674 |
|
7675 |
|
7676 |
|
7677 | function (_a) {
|
7678 | var _b = __read(_a, 2), products = _b[0], statuses = _b[1];
|
7679 | return products.map(( |
7680 |
|
7681 |
|
7682 |
|
7683 | function (p) {
|
7684 |
|
7685 | var addons = p.addons || null;
|
7686 |
|
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 |
|
7693 |
|
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 |
|
7702 |
|
7703 | VaPackageDropdownComponent.prototype.openAllDropdowns = |
7704 |
|
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 |
|
7716 |
|
7717 |
|
7718 | VaPackageDropdownComponent.prototype.togglePackage = |
7719 |
|
7720 |
|
7721 |
|
7722 | function (indexToToggle) {
|
7723 | if (this.singularDropdown) {
|
7724 |
|
7725 | var openedIndex = this.packageToggles.findIndex(( |
7726 |
|
7727 |
|
7728 |
|
7729 | function (value) { return value === true; }));
|
7730 | if (openedIndex !== indexToToggle) {
|
7731 | this.packageToggles[openedIndex] = false;
|
7732 | }
|
7733 |
|
7734 | var productOpenedIndex = this.productToggles.findIndex(( |
7735 |
|
7736 |
|
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 |
|
7747 |
|
7748 |
|
7749 | VaPackageDropdownComponent.prototype.toggleProduct = |
7750 |
|
7751 |
|
7752 |
|
7753 | function (indexToToggle) {
|
7754 | if (this.singularDropdown) {
|
7755 |
|
7756 | var openedIndex = this.productToggles.findIndex(( |
7757 |
|
7758 |
|
7759 |
|
7760 | function (value) { return value === true; }));
|
7761 | if (openedIndex !== indexToToggle) {
|
7762 | this.productToggles[openedIndex] = false;
|
7763 | }
|
7764 |
|
7765 | var packageOpenedIndex = this.packageToggles.findIndex(( |
7766 |
|
7767 |
|
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 |
|
7778 |
|
7779 |
|
7780 | VaPackageDropdownComponent.prototype.standAloneProductDescription = |
7781 |
|
7782 |
|
7783 |
|
7784 | function (product) {
|
7785 | if (product.addons && product.addons.length > 0) {
|
7786 |
|
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 |
|
7795 |
|
7796 |
|
7797 | VaPackageDropdownComponent.prototype.standAloneProductWithParentDescription = |
7798 |
|
7799 |
|
7800 |
|
7801 | function (product) {
|
7802 | if (!product.parentInfo) {
|
7803 | return '';
|
7804 | }
|
7805 | return "(Requires " + product.parentInfo.parentName + ")";
|
7806 | };
|
7807 | |
7808 |
|
7809 |
|
7810 |
|
7811 | VaPackageDropdownComponent.prototype.packageDescription = |
7812 |
|
7813 |
|
7814 |
|
7815 | function (pkg) {
|
7816 |
|
7817 | var hasProducts = pkg.products && pkg.products.length > 0;
|
7818 | if (!hasProducts && pkg.totalAddons === 0) {
|
7819 | return 'No Items in Package';
|
7820 | }
|
7821 |
|
7822 | var description = '';
|
7823 |
|
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 |
|
7866 | VaPackageDropdownComponent.prototype.singularDropdown;
|
7867 |
|
7868 | VaPackageDropdownComponent.prototype.hidePricing;
|
7869 |
|
7870 | VaPackageDropdownComponent.prototype.packageProductIndent;
|
7871 |
|
7872 | VaPackageDropdownComponent.prototype.packageAddonWithoutProductIndent;
|
7873 |
|
7874 | VaPackageDropdownComponent.prototype.packageAddonWithProductIndent;
|
7875 |
|
7876 | VaPackageDropdownComponent.prototype.productAddonIndent;
|
7877 |
|
7878 | VaPackageDropdownComponent.prototype.packages$$;
|
7879 |
|
7880 | VaPackageDropdownComponent.prototype.products$$;
|
7881 |
|
7882 | VaPackageDropdownComponent.prototype.standAloneProducts$$;
|
7883 |
|
7884 | VaPackageDropdownComponent.prototype.statuses$$;
|
7885 |
|
7886 | VaPackageDropdownComponent.prototype.addons$$;
|
7887 |
|
7888 | VaPackageDropdownComponent.prototype.orderItemLengths$$;
|
7889 |
|
7890 | VaPackageDropdownComponent.prototype.templateData$;
|
7891 |
|
7892 | VaPackageDropdownComponent.prototype.salesPackages$;
|
7893 |
|
7894 | VaPackageDropdownComponent.prototype.salesProducts$;
|
7895 |
|
7896 | VaPackageDropdownComponent.prototype.packageToggles;
|
7897 |
|
7898 | VaPackageDropdownComponent.prototype.productToggles;
|
7899 | }
|
7900 |
|
7901 | |
7902 |
|
7903 |
|
7904 |
|
7905 | var VaPackageDropdownModule = (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 |
|
7919 |
|
7920 |
|
7921 | function (currentLang) { return translateService.use(currentLang); }));
|
7922 | }
|
7923 | if (defaultLang$) {
|
7924 | defaultLang$.subscribe(( |
7925 |
|
7926 |
|
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 |
|
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 |
|
7959 |
|
7960 |
|
7961 | VaPackageDropdownModule.prototype.translateService;
|
7962 | }
|
7963 |
|
7964 | |
7965 |
|
7966 |
|
7967 |
|
7968 | var VaProductDetailsComponent = (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 |
|
7983 |
|
7984 | VaProductDetailsComponent.prototype.getAddons = |
7985 |
|
7986 |
|
7987 | function () {
|
7988 | if (!this._addons) {
|
7989 | this._addons = this.product.addons.map(( |
7990 |
|
7991 |
|
7992 |
|
7993 | function (addon) { return shared.Addon.fromApi(addon); }));
|
7994 | }
|
7995 | return this._addons;
|
7996 | };
|
7997 | |
7998 |
|
7999 |
|
8000 | VaProductDetailsComponent.prototype.getActionLabel = |
8001 |
|
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 |
|
8015 |
|
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 |
|
8033 |
|
8034 |
|
8035 | VaProductDetailsComponent.prototype.onAddonSelected = |
8036 |
|
8037 |
|
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 |
|
8070 | VaProductDetailsComponent.prototype.product;
|
8071 |
|
8072 | VaProductDetailsComponent.prototype.billedProduct;
|
8073 |
|
8074 | VaProductDetailsComponent.prototype.hasVerifiedContract;
|
8075 |
|
8076 | VaProductDetailsComponent.prototype.canAccessContractPricing;
|
8077 |
|
8078 | VaProductDetailsComponent.prototype.showActionButton;
|
8079 |
|
8080 | VaProductDetailsComponent.prototype.showPricing;
|
8081 |
|
8082 | VaProductDetailsComponent.prototype.primaryPricingActionLabel;
|
8083 |
|
8084 | VaProductDetailsComponent.prototype.pricingActionLabel;
|
8085 |
|
8086 | VaProductDetailsComponent.prototype.showPricingAction;
|
8087 |
|
8088 | VaProductDetailsComponent.prototype.loaded;
|
8089 |
|
8090 | VaProductDetailsComponent.prototype.partnerID;
|
8091 |
|
8092 | VaProductDetailsComponent.prototype.enableClicked;
|
8093 |
|
8094 | VaProductDetailsComponent.prototype.addonSelected;
|
8095 |
|
8096 | VaProductDetailsComponent.prototype.primaryPricingActionSelected;
|
8097 |
|
8098 | VaProductDetailsComponent.prototype.pricingActionSelected;
|
8099 | |
8100 |
|
8101 |
|
8102 |
|
8103 | VaProductDetailsComponent.prototype._addons;
|
8104 | }
|
8105 |
|
8106 | |
8107 |
|
8108 |
|
8109 |
|
8110 | var VaProductDetailsModule = (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 |
|
8132 |
|
8133 |
|
8134 | var ResellerItem = (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 |
|
8144 | ResellerItem.prototype.appId;
|
8145 |
|
8146 | ResellerItem.prototype.addonId;
|
8147 |
|
8148 | ResellerItem.prototype.name;
|
8149 |
|
8150 | ResellerItem.prototype.icon;
|
8151 |
|
8152 | ResellerItem.prototype.tagline;
|
8153 |
|
8154 | ResellerItem.prototype.headerImage;
|
8155 |
|
8156 | ResellerItem.prototype.currency;
|
8157 |
|
8158 | ResellerItem.prototype.price;
|
8159 |
|
8160 | ResellerItem.prototype.billingFrequency;
|
8161 |
|
8162 | ResellerItem.prototype.lmiCategories;
|
8163 |
|
8164 | ResellerItem.prototype.enabled;
|
8165 |
|
8166 | ResellerItem.prototype.isCustom;
|
8167 |
|
8168 | ResellerItem.prototype.orderForm;
|
8169 |
|
8170 | ResellerItem.prototype.quantity;
|
8171 |
|
8172 | ResellerItem.prototype.allowMultipleActivations;
|
8173 |
|
8174 | ResellerItem.prototype.usesCustomizationForm;
|
8175 |
|
8176 | ResellerItem.prototype.usesActivationSpecificEntryUrl;
|
8177 |
|
8178 | ResellerItem.prototype.entryUrl;
|
8179 |
|
8180 | ResellerItem.prototype.restrictions;
|
8181 |
|
8182 | ResellerItem.prototype.activationRequiresApproval;
|
8183 |
|
8184 | ResellerItem.prototype.billingId;
|
8185 |
|
8186 | ResellerItem.prototype.usesEditions;
|
8187 |
|
8188 | ResellerItem.prototype.editionIds;
|
8189 |
|
8190 | ResellerItem.prototype.suggestedRetailPrice;
|
8191 |
|
8192 | ResellerItem.prototype.editionId;
|
8193 |
|
8194 | ResellerItem.prototype.trialConfiguration;
|
8195 |
|
8196 | ResellerItem.prototype.integration;
|
8197 | }
|
8198 |
|
8199 | |
8200 |
|
8201 |
|
8202 |
|
8203 | var CheckboxField = (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 |
|
8214 | CheckboxField.prototype.controlType;
|
8215 | }
|
8216 |
|
8217 | |
8218 |
|
8219 |
|
8220 |
|
8221 | |
8222 |
|
8223 |
|
8224 | function Option() { }
|
8225 | if (false) {
|
8226 |
|
8227 | Option.prototype.value;
|
8228 |
|
8229 | Option.prototype.label;
|
8230 |
|
8231 | Option.prototype.disabled;
|
8232 | }
|
8233 | |
8234 |
|
8235 |
|
8236 | function DropDownFieldOptions() { }
|
8237 | if (false) {
|
8238 |
|
8239 | DropDownFieldOptions.prototype.options;
|
8240 |
|
8241 | DropDownFieldOptions.prototype.allowMultiples;
|
8242 |
|
8243 | DropDownFieldOptions.prototype.allowDuplicates;
|
8244 |
|
8245 | DropDownFieldOptions.prototype.maxChoices;
|
8246 | }
|
8247 | var DropdownField = (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 |
|
8255 |
|
8256 | if (typeof options.options[0] === 'string') {
|
8257 | if (options.allowMultiples) {
|
8258 |
|
8259 | _this.options = options.options.map(( |
8260 |
|
8261 |
|
8262 |
|
8263 | function (o) { return ({ value: o, name: o }); }));
|
8264 | }
|
8265 | else {
|
8266 |
|
8267 | _this.options = options.options.map(( |
8268 |
|
8269 |
|
8270 |
|
8271 | function (o) { return ({ value: o, label: o }); }));
|
8272 | }
|
8273 | }
|
8274 | else {
|
8275 | if (options.allowMultiples) {
|
8276 |
|
8277 | _this.options = options.options.map(( |
8278 |
|
8279 |
|
8280 |
|
8281 | function (o) { return ({ value: o.value, name: o.label }); }));
|
8282 | }
|
8283 | else {
|
8284 |
|
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 |
|
8297 |
|
8298 |
|
8299 | DropdownField.prototype.validatorBuilder = |
8300 |
|
8301 |
|
8302 |
|
8303 | function () {
|
8304 |
|
8305 | var maxChoices = this.maxChoices;
|
8306 | return ( |
8307 |
|
8308 |
|
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 |
|
8320 | DropdownField.prototype.controlType;
|
8321 |
|
8322 | DropdownField.prototype.options;
|
8323 |
|
8324 | DropdownField.prototype.allowMultiples;
|
8325 |
|
8326 | DropdownField.prototype.allowDuplicates;
|
8327 |
|
8328 | DropdownField.prototype.maxChoices;
|
8329 | }
|
8330 |
|
8331 | |
8332 |
|
8333 |
|
8334 |
|
8335 |
|
8336 | var DEFAULT_NUM_FILES = 5;
|
8337 | |
8338 |
|
8339 |
|
8340 | function FileUploadGroupFieldOptions() { }
|
8341 | if (false) {
|
8342 |
|
8343 | FileUploadGroupFieldOptions.prototype.fileType;
|
8344 |
|
8345 | FileUploadGroupFieldOptions.prototype.uploadUrl;
|
8346 |
|
8347 | FileUploadGroupFieldOptions.prototype.numFiles;
|
8348 | }
|
8349 | var FileUploadGroupField = (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 |
|
8367 | FileUploadGroupField.prototype.controlType;
|
8368 |
|
8369 | FileUploadGroupField.prototype.fileType;
|
8370 |
|
8371 | FileUploadGroupField.prototype.uploadUrl;
|
8372 |
|
8373 | FileUploadGroupField.prototype.numFiles;
|
8374 | }
|
8375 |
|
8376 | |
8377 |
|
8378 |
|
8379 |
|
8380 | var TextareaField = (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 |
|
8391 | TextareaField.prototype.controlType;
|
8392 | }
|
8393 |
|
8394 | |
8395 |
|
8396 |
|
8397 |
|
8398 | |
8399 |
|
8400 |
|
8401 | function TextBoxFieldOptions() { }
|
8402 | if (false) {
|
8403 |
|
8404 | TextBoxFieldOptions.prototype.textboxType;
|
8405 |
|
8406 | TextBoxFieldOptions.prototype.prefix;
|
8407 |
|
8408 | TextBoxFieldOptions.prototype.suffix;
|
8409 |
|
8410 | TextBoxFieldOptions.prototype.displayOnly;
|
8411 | }
|
8412 | var TextboxField = (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 |
|
8429 | TextboxField.prototype.controlType;
|
8430 |
|
8431 | TextboxField.prototype.textboxType;
|
8432 |
|
8433 | TextboxField.prototype.prefix;
|
8434 |
|
8435 | TextboxField.prototype.suffix;
|
8436 |
|
8437 | TextboxField.prototype.regexValidator;
|
8438 |
|
8439 | TextboxField.prototype.regexErrorMessage;
|
8440 |
|
8441 | TextboxField.prototype.displayOnly;
|
8442 | }
|
8443 |
|
8444 | |
8445 |
|
8446 |
|
8447 |
|
8448 | |
8449 |
|
8450 |
|
8451 | function User() { }
|
8452 | if (false) {
|
8453 |
|
8454 | User.prototype.userId;
|
8455 |
|
8456 | User.prototype.email;
|
8457 |
|
8458 | User.prototype.firstName;
|
8459 |
|
8460 | User.prototype.lastName;
|
8461 | }
|
8462 | |
8463 |
|
8464 |
|
8465 | function VBCUserFieldOptions() { }
|
8466 | if (false) {
|
8467 |
|
8468 | VBCUserFieldOptions.prototype.users;
|
8469 | }
|
8470 | var VBCUserField = (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 |
|
8489 | VBCUserField.prototype.controlType;
|
8490 | }
|
8491 | |
8492 |
|
8493 |
|
8494 |
|
8495 | function getOptions(vbcUsers) {
|
8496 | if (vbcUsers && vbcUsers.length > 0) {
|
8497 | vbcUsers.sort(compareUsersByEmail);
|
8498 | return vbcUsers.map(( |
8499 |
|
8500 |
|
8501 |
|
8502 | function (user) {
|
8503 |
|
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 |
|
8518 |
|
8519 |
|
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 |
|
8532 |
|
8533 |
|
8534 |
|
8535 |
|
8536 | function createLabelString(firstName, lastName, email) {
|
8537 |
|
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 |
|