ng-easycommerce 0.0.660-beta.1 → 0.0.661
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -58
- package/assets/ec-i18n/en.json +3 -1
- package/assets/ec-i18n/es.json +3 -1
- package/bundles/ng-easycommerce.umd.js +179 -512
- package/bundles/ng-easycommerce.umd.js.map +1 -1
- package/bundles/ng-easycommerce.umd.min.js +1 -1
- package/bundles/ng-easycommerce.umd.min.js.map +1 -1
- package/esm2015/lib/core.consts.js +6 -1
- package/esm2015/lib/ec-component/account-ec/order-ec/order-ec.component.js +5 -3
- package/esm2015/lib/ec-component/cart-ec/cart-ec.component.js +8 -5
- package/esm2015/lib/ec-component/checkout-ec/dataform-ec/dataform-ec.component.js +11 -5
- package/esm2015/lib/ec-component/collection-ec/collection-ec.component.js +14 -450
- package/esm2015/lib/ec-component/product-detail-ec/product-detail-ec.component.js +30 -3
- package/esm2015/lib/ec-component/product-ec/product-ec.component.js +1 -2
- package/esm2015/lib/ec-component/sidebar-ec/sidebar-ec.component.js +8 -5
- package/esm2015/lib/ec-component/widgets-ec/paypal-express-ec/paypal-express-ec.component.js +1 -3
- package/esm2015/lib/ec-component/widgets-ec/price-ec/price-ec.component.js +3 -3
- package/esm2015/lib/ec-pipe/ec-currency-symbol.pipe.js +2 -1
- package/esm2015/lib/services/cart.service.js +27 -12
- package/esm2015/lib/services/currency.service.js +43 -7
- package/esm5/lib/core.consts.js +6 -1
- package/esm5/lib/ec-component/account-ec/order-ec/order-ec.component.js +5 -3
- package/esm5/lib/ec-component/cart-ec/cart-ec.component.js +8 -5
- package/esm5/lib/ec-component/checkout-ec/dataform-ec/dataform-ec.component.js +11 -5
- package/esm5/lib/ec-component/collection-ec/collection-ec.component.js +13 -458
- package/esm5/lib/ec-component/product-detail-ec/product-detail-ec.component.js +48 -3
- package/esm5/lib/ec-component/product-ec/product-ec.component.js +1 -2
- package/esm5/lib/ec-component/sidebar-ec/sidebar-ec.component.js +8 -5
- package/esm5/lib/ec-component/widgets-ec/paypal-express-ec/paypal-express-ec.component.js +1 -3
- package/esm5/lib/ec-component/widgets-ec/price-ec/price-ec.component.js +3 -3
- package/esm5/lib/ec-pipe/ec-currency-symbol.pipe.js +2 -1
- package/esm5/lib/services/cart.service.js +27 -12
- package/esm5/lib/services/currency.service.js +43 -7
- package/fesm2015/ng-easycommerce.js +157 -499
- package/fesm2015/ng-easycommerce.js.map +1 -1
- package/fesm5/ng-easycommerce.js +180 -513
- package/fesm5/ng-easycommerce.js.map +1 -1
- package/lib/core.consts.d.ts +5 -0
- package/lib/ec-component/account-ec/order-ec/order-ec.component.d.ts +1 -0
- package/lib/ec-component/cart-ec/cart-ec.component.d.ts +1 -0
- package/lib/ec-component/collection-ec/collection-ec.component.d.ts +4 -34
- package/lib/ec-component/product-detail-ec/product-detail-ec.component.d.ts +3 -0
- package/lib/ec-component/sidebar-ec/sidebar-ec.component.d.ts +1 -0
- package/lib/services/cart.service.d.ts +2 -2
- package/lib/services/currency.service.d.ts +14 -2
- package/ng-easycommerce.metadata.json +1 -1
- package/package.json +1 -1
package/fesm5/ng-easycommerce.js
CHANGED
|
@@ -7,7 +7,7 @@ import { InfiniteScrollModule } from 'ngx-infinite-scroll';
|
|
|
7
7
|
import { ToastrService, ToastrModule } from 'ngx-toastr';
|
|
8
8
|
import { ReplaySubject, of, BehaviorSubject, forkJoin, combineLatest, Observable, throwError } from 'rxjs';
|
|
9
9
|
import 'rxjs/add/operator/map';
|
|
10
|
-
import { take, map, catchError, filter, mapTo, finalize, skipWhile, concatMap } from 'rxjs/operators';
|
|
10
|
+
import { take, map, catchError, filter, mapTo, finalize, startWith, skipWhile, concatMap } from 'rxjs/operators';
|
|
11
11
|
import 'rxjs/add/operator/catch';
|
|
12
12
|
import 'rxjs/add/observable/of';
|
|
13
13
|
import * as moment from 'moment';
|
|
@@ -513,6 +513,11 @@ var Constants = /** @class */ (function () {
|
|
|
513
513
|
* @example ['AR','ES','GB']
|
|
514
514
|
*/
|
|
515
515
|
this.countries = [];
|
|
516
|
+
/**
|
|
517
|
+
* @description contiene un arreglo de string cuyo contenido son los codigos de los paises a excluir.
|
|
518
|
+
* @example ['GB']
|
|
519
|
+
*/
|
|
520
|
+
this.excludedCountries = [];
|
|
516
521
|
/**
|
|
517
522
|
*
|
|
518
523
|
* @param countries debe contener los codigos de los paises que se quiere mostrar
|
|
@@ -4758,12 +4763,22 @@ var CartService = /** @class */ (function () {
|
|
|
4758
4763
|
_this.updateLocalCart();
|
|
4759
4764
|
_this.requestInProcess.next(false);
|
|
4760
4765
|
};
|
|
4761
|
-
this.updateCartItemQuantity = function (variant_id, quantity) {
|
|
4762
|
-
var
|
|
4766
|
+
this.updateCartItemQuantity = function (variant_id, quantity, comments) {
|
|
4767
|
+
var normalizedComments = comments !== undefined ? ((comments !== null && comments !== void 0 ? comments : '')).trim() : undefined;
|
|
4768
|
+
var newItems = _this.items.map(function (it) {
|
|
4769
|
+
if (it.variant_id !== variant_id)
|
|
4770
|
+
return it;
|
|
4771
|
+
var updated = __assign$a(__assign$a({}, it), { quantity: Number(quantity) });
|
|
4772
|
+
if (normalizedComments !== undefined) {
|
|
4773
|
+
updated.comments = normalizedComments;
|
|
4774
|
+
}
|
|
4775
|
+
return updated;
|
|
4776
|
+
});
|
|
4777
|
+
_this.items = newItems;
|
|
4763
4778
|
_this.cartItemsSubject.next(_this.items);
|
|
4764
4779
|
_this.requestInProcess.next(false);
|
|
4765
4780
|
_this.updateLocalCart();
|
|
4766
|
-
_this.toastrService.show('product-updated', { quantity:
|
|
4781
|
+
_this.toastrService.show('product-updated', { quantity: quantity });
|
|
4767
4782
|
};
|
|
4768
4783
|
this.appendToCart = function (cart) {
|
|
4769
4784
|
_this.updateCartObj(cart);
|
|
@@ -4785,11 +4800,11 @@ var CartService = /** @class */ (function () {
|
|
|
4785
4800
|
// this.googleAnalytics.removeFromCart(product);
|
|
4786
4801
|
_this.analyticsService.callEvent('remove_from_cart', __assign$a(__assign$a({}, product), { currency: _this.consts.currency.code }));
|
|
4787
4802
|
};
|
|
4788
|
-
this.addIfAllreadyExists = function (product, variant_id, quantityAdd) {
|
|
4803
|
+
this.addIfAllreadyExists = function (product, variant_id, quantityAdd, comments) {
|
|
4789
4804
|
if (quantityAdd === void 0) { quantityAdd = 1; }
|
|
4790
4805
|
return _this.items.find(function (item, index) {
|
|
4791
4806
|
if (item.product.id == product.id && item.variant_id == variant_id) {
|
|
4792
|
-
_this.updateItemQuantity(item, _this.findItem(product.id).quantity + quantityAdd);
|
|
4807
|
+
_this.updateItemQuantity(item, _this.findItem(product.id).quantity + quantityAdd, comments);
|
|
4793
4808
|
return true;
|
|
4794
4809
|
}
|
|
4795
4810
|
return false;
|
|
@@ -4843,7 +4858,7 @@ var CartService = /** @class */ (function () {
|
|
|
4843
4858
|
return;
|
|
4844
4859
|
}
|
|
4845
4860
|
_this.requestInProcess.next(true);
|
|
4846
|
-
var added = _this.addIfAllreadyExists(product, variant_id, quantity);
|
|
4861
|
+
var added = _this.addIfAllreadyExists(product, variant_id, quantity, comments);
|
|
4847
4862
|
if (!added) {
|
|
4848
4863
|
var payload = {
|
|
4849
4864
|
productCode: product.id,
|
|
@@ -4883,7 +4898,7 @@ var CartService = /** @class */ (function () {
|
|
|
4883
4898
|
!added && _this.connection.post(_this.addItemApi(), { productCode: product.id, quantity: quantity, variantCode: variant_id, id: id || '', order_item_id: order_item_id || '', lot_quantity: lot_quantity || '', unit_price: unit_price || '', unit_total: unit_total || '', ajustement_total: ajustement_total || '', total_lot: total_lot || '', lot_status: lot_status || '', date_request: date_request || '', notes: notes || '', shipping_address_id: shipping_address_id || '', shipping_address_name: shipping_address_name || '', action: action || 'newlot' })
|
|
4884
4899
|
.subscribe(function (res) { return _this.appendToCart(res); }, function (err) { return _this.handleError(err); });
|
|
4885
4900
|
};
|
|
4886
|
-
this.addToCartPromise = function (product, quantity, variant_id) { return __awaiter$5(_this, void 0, void 0, function () {
|
|
4901
|
+
this.addToCartPromise = function (product, quantity, variant_id, comments) { return __awaiter$5(_this, void 0, void 0, function () {
|
|
4887
4902
|
var added, result;
|
|
4888
4903
|
return __generator$5(this, function (_a) {
|
|
4889
4904
|
switch (_a.label) {
|
|
@@ -4893,7 +4908,7 @@ var CartService = /** @class */ (function () {
|
|
|
4893
4908
|
return [2 /*return*/];
|
|
4894
4909
|
}
|
|
4895
4910
|
this.requestInProcess.next(true);
|
|
4896
|
-
added = this.addIfAllreadyExists(product, variant_id, quantity);
|
|
4911
|
+
added = this.addIfAllreadyExists(product, variant_id, quantity, comments);
|
|
4897
4912
|
if (!!added) return [3 /*break*/, 2];
|
|
4898
4913
|
return [4 /*yield*/, (this.connection.post(this.addItemApi(), { productCode: product.id, quantity: quantity, variantCode: variant_id }).toPromise())];
|
|
4899
4914
|
case 1:
|
|
@@ -4939,13 +4954,18 @@ var CartService = /** @class */ (function () {
|
|
|
4939
4954
|
items = items.filter(function (itemParam) { return !_this.items.find(function (item) { return itemParam.variantCode == item.variant_id; }); });
|
|
4940
4955
|
return __spread$3(items, paramsMerge);
|
|
4941
4956
|
};
|
|
4942
|
-
this.updateItemQuantity = function (item, quantity) {
|
|
4957
|
+
this.updateItemQuantity = function (item, quantity, comments) {
|
|
4943
4958
|
if (_this.validateQuantity(item, quantity) && (_this.validatePriceAndCredits(item, quantity))) {
|
|
4944
4959
|
_this.requestInProcess.next(true);
|
|
4960
|
+
var payload = { quantity: Number(quantity) };
|
|
4961
|
+
if (comments !== undefined) {
|
|
4962
|
+
var cleaned = ((comments !== null && comments !== void 0 ? comments : '')).trim();
|
|
4963
|
+
payload.comments = cleaned;
|
|
4964
|
+
}
|
|
4945
4965
|
_this.connection
|
|
4946
|
-
.put(_this.updateItemQuantityApi(_this.findItemByIdVariant(item.variant_id)),
|
|
4966
|
+
.put(_this.updateItemQuantityApi(_this.findItemByIdVariant(item.variant_id)), payload)
|
|
4947
4967
|
.pipe(finalize(function () { return _this.requestInProcess.next(false); }))
|
|
4948
|
-
.subscribe(function (res) { return _this.updateCartObj(res) && _this.updateCartItemQuantity(item.variant_id, Number(quantity)); }, function (err) { return _this.handleError(err); });
|
|
4968
|
+
.subscribe(function (res) { return _this.updateCartObj(res) && _this.updateCartItemQuantity(item.variant_id, Number(quantity), comments); }, function (err) { return _this.handleError(err); });
|
|
4949
4969
|
}
|
|
4950
4970
|
};
|
|
4951
4971
|
this.validateQuantity = function (item, quantity) {
|
|
@@ -7508,6 +7528,7 @@ var CartEcComponent = /** @class */ (function (_super) {
|
|
|
7508
7528
|
_this.creditAccountShowPrices = null;
|
|
7509
7529
|
_this.showTaxLegend = false;
|
|
7510
7530
|
_this.cartLoading = false;
|
|
7531
|
+
_this.enableFieldNotesInArticleFile = false;
|
|
7511
7532
|
_this.toDecimal = function (amount) { return _this.consts.toDecimal(amount); };
|
|
7512
7533
|
_this.redirectRegister = function () { return _this.router.navigateByUrl("/auth/login"); };
|
|
7513
7534
|
_this.getVariants = function (product) {
|
|
@@ -7571,11 +7592,12 @@ var CartEcComponent = /** @class */ (function (_super) {
|
|
|
7571
7592
|
this.cartService.promotions.subscribe(function (promotions) { return _this.promotions = promotions; });
|
|
7572
7593
|
// console.log(this.cartService.getTaxes());
|
|
7573
7594
|
this.channelConfigService.channelConfig$.subscribe(function (channel) {
|
|
7574
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
7595
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
7575
7596
|
_this.hidePrices = (_b = (_a = channel) === null || _a === void 0 ? void 0 : _a.hidePrices, (_b !== null && _b !== void 0 ? _b : false));
|
|
7576
7597
|
_this.hideDiscounts = (_d = (_c = channel) === null || _c === void 0 ? void 0 : _c.hideDiscounts, (_d !== null && _d !== void 0 ? _d : false));
|
|
7577
7598
|
_this.hideTaxes = (_f = (_e = channel) === null || _e === void 0 ? void 0 : _e.hideTaxes, (_f !== null && _f !== void 0 ? _f : false));
|
|
7578
7599
|
_this.showTaxLegend = (_h = (_g = channel) === null || _g === void 0 ? void 0 : _g.showTaxLegend, (_h !== null && _h !== void 0 ? _h : false));
|
|
7600
|
+
_this.enableFieldNotesInArticleFile = (_k = (_j = channel) === null || _j === void 0 ? void 0 : _j.enableFieldNotesInArticleFile, (_k !== null && _k !== void 0 ? _k : false));
|
|
7579
7601
|
if (_this.hidePrices) {
|
|
7580
7602
|
_this.router.navigate(['/']);
|
|
7581
7603
|
}
|
|
@@ -7590,7 +7612,7 @@ var CartEcComponent = /** @class */ (function (_super) {
|
|
|
7590
7612
|
};
|
|
7591
7613
|
CartEcComponent.prototype.actualizarCantidad = function (item, cantidad, stock, id) {
|
|
7592
7614
|
var _this = this;
|
|
7593
|
-
var _a;
|
|
7615
|
+
var _a, _b, _c;
|
|
7594
7616
|
if (this.cartLoading) {
|
|
7595
7617
|
return;
|
|
7596
7618
|
}
|
|
@@ -7610,10 +7632,11 @@ var CartEcComponent = /** @class */ (function (_super) {
|
|
|
7610
7632
|
newQuantity = Math.round(newQuantity / step) * step;
|
|
7611
7633
|
}
|
|
7612
7634
|
}
|
|
7635
|
+
var keepSameComment = (_c = (_b = item) === null || _b === void 0 ? void 0 : _b.comments, (_c !== null && _c !== void 0 ? _c : undefined));
|
|
7613
7636
|
if (id) {
|
|
7614
7637
|
this.isDisabled = true; // Actualiza la propiedad vinculada a `[disabled]`
|
|
7615
7638
|
if (newQuantity > 0 && newQuantity <= stock) {
|
|
7616
|
-
this.cartService.updateItemQuantity(item, newQuantity);
|
|
7639
|
+
this.cartService.updateItemQuantity(item, newQuantity, keepSameComment);
|
|
7617
7640
|
}
|
|
7618
7641
|
else {
|
|
7619
7642
|
this.toastrService.show('out-of-stock-actually');
|
|
@@ -7624,7 +7647,7 @@ var CartEcComponent = /** @class */ (function (_super) {
|
|
|
7624
7647
|
}
|
|
7625
7648
|
else {
|
|
7626
7649
|
if (newQuantity > 0 && newQuantity <= stock) {
|
|
7627
|
-
this.cartService.updateItemQuantity(item, newQuantity);
|
|
7650
|
+
this.cartService.updateItemQuantity(item, newQuantity, keepSameComment);
|
|
7628
7651
|
}
|
|
7629
7652
|
else {
|
|
7630
7653
|
this.toastrService.show('out-of-stock-actually');
|
|
@@ -8189,18 +8212,24 @@ var DataFormEcComponent = /** @class */ (function (_super) {
|
|
|
8189
8212
|
* @returns un arreglo de countries.
|
|
8190
8213
|
*/
|
|
8191
8214
|
_this.filterCountryByCode = function (countries) {
|
|
8215
|
+
// 1. Si hay países EXCLUIDOS, quítalos siempre
|
|
8216
|
+
var filtered = countries;
|
|
8217
|
+
if (_this.consts.excludedCountries && _this.consts.excludedCountries.length > 0) {
|
|
8218
|
+
filtered = filtered.filter(function (elem) { return !_this.consts.excludedCountries.includes(elem.code); });
|
|
8219
|
+
}
|
|
8220
|
+
// 2. Si hay países INCLUIDOS, aplica el filtro de inclusión
|
|
8192
8221
|
if (_this.consts.getCountries().length > 0) {
|
|
8193
|
-
var countriesFiltered =
|
|
8222
|
+
var countriesFiltered = filtered.filter(function (elem) { return _this.consts.getCountries().includes(elem.code); });
|
|
8194
8223
|
if (countriesFiltered.length > 0) {
|
|
8195
8224
|
return countriesFiltered;
|
|
8196
8225
|
}
|
|
8197
8226
|
else {
|
|
8198
8227
|
console.error('El/los codigo/s ingresado/s no coinciden con los provistos desde el backend');
|
|
8199
|
-
return
|
|
8228
|
+
return filtered;
|
|
8200
8229
|
}
|
|
8201
8230
|
}
|
|
8202
8231
|
else {
|
|
8203
|
-
return
|
|
8232
|
+
return filtered;
|
|
8204
8233
|
}
|
|
8205
8234
|
};
|
|
8206
8235
|
_this.showFormFacturacion = function () {
|
|
@@ -8565,7 +8594,7 @@ var DataFormEcComponent = /** @class */ (function (_super) {
|
|
|
8565
8594
|
DataFormEcComponent = __decorate$Q([
|
|
8566
8595
|
Component({
|
|
8567
8596
|
selector: 'app-dataform-ec',
|
|
8568
|
-
template: "<ng-container *ngIf=\"this.channelConfig.channelType != 'b2b' || (this.channelConfig.channelType == 'b2b' && authService.isAuthenticated()); else pleaseLogin\">\r\n<ng-container *ngIf=\"this.addressingService.modeSelectAddress == 'LOAD_ADDRESS_AND_SELECTION' && this.authService.isAuthenticated() && this.addressBook != null\">\r\n <div class=\"container card p-4 mb-3\">\r\n <div class=\"row justify-content-center\">\r\n <div class=\"col-12 col-md-10 col-lg-8 text-center\">\r\n <div class=\"btn-group btn-group-toggle\" data-bs-toggle=\"buttons\">\r\n <label [class]=\"'btn btn-outline-secondary ' + (!getMode() ? 'active' : '')\">\r\n <input type=\"radio\" name=\"options\" id=\"option1\" autocomplete=\"off\" checked\r\n (change)=\"setMode('seleccion')\"> {{'select-address' | translate | titlecase}}\r\n </label>\r\n\r\n <label [class]=\"'btn btn-outline-secondary ' + (getMode() ? 'active' : '')\" *ngIf=\"!getParamByChannelAndLanguage('btn_new_address_')\">\r\n <input type=\"radio\" name=\"options\" id=\"option2\" autocomplete=\"off\" (change)=\"setMode('carga')\">\r\n {{ 'new-address' | translate | titlecase}}\r\n </label>\r\n\r\n <label [class]=\"'btn btn-outline-secondary ' + (selectAddress ? 'active' : '')\" *ngIf=\"getParamByChannelAndLanguage('btn_new_address_') as param\">\r\n <input type=\"radio\" name=\"options\" id=\"option2\" autocomplete=\"off\" (change)=\"setMode('carga')\">\r\n {{ param.value}}\r\n </label>\r\n\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</ng-container>\r\n\r\n<ng-container *ngIf=\"getMode(); else addressSelection\">\r\n <div *ngIf=\"!require_login; else requireLoginView\">\r\n\r\n <ng-container *ngIf=\"this.addressingService.modeSelectAddress == 'ONLY_LOAD_ADDRESS'\">\r\n <div class=\"checkout-title my-2\">\r\n <h3>{{'billing-details'|translate}}</h3>\r\n </div>\r\n </ng-container>\r\n\r\n <form (submit)=\"verifyValidate(false,this.cartService.items)\">\r\n <div class=\"row mt-df\"><!--Fila 1-->\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.firstName.enabled\">\r\n <label class=\"field-label\">{{'first-name'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.firstName.required\"\r\n class=\"required\">*</span></label>\r\n <input class=\"form-control\" type=\"text\" name=\"firstName\"\r\n [formControl]=\"checkoutForm.controls['firstName']\" value=\"\" placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.firstName.touched && checkoutForm.controls.firstName.errors?.required\">\r\n <span class=\"text-danger\">{{'first-name-help1'|translate}}</span>\r\n\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.firstName.touched && checkoutForm.controls.firstName.errors?.pattern\">\r\n <span class=\"text-danger\">\r\n {{'first-name-help2'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.lastName.enabled\">\r\n <label class=\"field-label\">{{'last-name'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.lastName.required\"\r\n class=\"required\">*</span></label>\r\n <input class=\"form-control\" type=\"text\" name=\"lastName\"\r\n [formControl]=\"checkoutForm.controls['lastName']\" value=\"\" placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.lastName.touched && checkoutForm.controls.lastName.errors?.required\">\r\n <span class=\"text-danger\">{{'last-name-help1'|translate}}</span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.lastName.touched && checkoutForm.controls.lastName.errors?.pattern\">\r\n <span class=\"text-danger\">{{'last-name-help2'|translate}}</span>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\"><!--Fila 2-->\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.phoneNumber.enabled\">\r\n <label class=\"field-label\">{{'phone'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.phoneNumber.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"phoneNumber\"\r\n [formControl]=\"checkoutForm.controls['phoneNumber']\" value=\"\" placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.phoneNumber.touched && checkoutForm.controls.phoneNumber.errors?.required\">\r\n <span class=\"text-danger\">\r\n\r\n {{'phone-help1'|translate}}\r\n </span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.phoneNumber.touched && checkoutForm.controls.phoneNumber.errors?.pattern\">\r\n <span class=\"text-danger\">\r\n {{'phone-help2'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.email.enabled\">\r\n <label class=\"field-label\">{{'email-address'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.email.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"email\" name=\"email\"\r\n [formControl]=\"checkoutForm.controls['email']\" value=\"\" placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.email.touched && checkoutForm.controls.email.errors?.required\">\r\n <span class=\"text-danger\">\r\n {{'email-address-help1'|translate}}\r\n </span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.email.touched && checkoutForm.controls.email.errors?.email\">\r\n <span class=\"text-danger\">\r\n {{'email-address-help2'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"row mt-df\"><!--Fila 3-->\r\n <ng-container *ngIf=\"this.addressingService.getTypeForm().viewForms.countryCode.enabled\">\r\n <div class=\"form-group col-12 col-md-4\" *ngIf=\"(countries$ | async) as countries\">\r\n <label class=\"field-label\">{{'country'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.countryCode.required\"\r\n class=\"required\">*</span></label>\r\n <select class=\"form-select\" name=\"countryCode\"\r\n [formControl]=\"checkoutForm.controls['countryCode']\"\r\n (change)=\"onCountrySelected($event.target.value)\">\r\n <!-- <option selected [value]=\"countries[0].code\">{{ 'choose-country' | translate }}</option> -->\r\n <option *ngFor=\"let country of countries\" [value]=\"country.code\">{{ country.name }}</option>\r\n </select>\r\n <div *ngIf=\"checkoutForm.controls.countryCode.touched && checkoutForm.controls.countryCode.errors?.required\"\r\n class=\"text text-danger\">\r\n {{'country-help'|translate}}\r\n </div>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngIf=\"this.addressingService.getTypeForm().viewForms.provinceCode.enabled\">\r\n <div class=\"form-group col-12 col-md-4\" *ngIf=\"(provinces$ | async) as provinces\">\r\n <label class=\"field-label\">{{'state'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.provinceCode.required\"\r\n class=\"required\">*</span></label>\r\n <select class=\"form-select\" name=\"provinceCode\"\r\n (change)=\"onProvincesSelected($event.target.value)\"\r\n [formControl]=\"checkoutForm.controls['provinceCode']\">\r\n<!-- <option selected [value]=\"null\">{{ 'choose-province' | translate }}</option>\r\n --> <option *ngFor=\"let province of provinces\" [value]=\"province.code\">{{ province.name }}\r\n </option>\r\n </select>\r\n <div *ngIf=\"checkoutForm.controls.provinceCode.touched && checkoutForm.controls.provinceCode.errors?.required\"\r\n class=\"text text-danger\">\r\n {{'state-help'|translate}}\r\n </div>\r\n </div>\r\n </ng-container>\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.city.enabled\">\r\n <label class=\"field-label\">{{'town-city'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.city.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"city\"\r\n [formControl]=\"checkoutForm.controls['city']\" value=\"\" placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.city.touched && checkoutForm.controls.city.errors?.required\">\r\n <span class=\"text-danger\">{{'town-city-help'|translate}}</span>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"row mt-df\"><!--Fila 4-->\r\n <div class=\"form-group col-12 col-md-8\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.street.enabled\">\r\n <label class=\"field-label\">{{'address'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.street.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"street\"\r\n [formControl]=\"checkoutForm.controls['street']\" value=\"\" placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.street.touched && checkoutForm.controls.street.errors?.required\">\r\n <span class=\"text-danger\">{{'address-help1'|translate}}</span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.street.touched && checkoutForm.controls.street.errors?.maxlength\">\r\n <span class=\"text-danger\">{{'address-help2'|translate}}</span>\r\n </div>\r\n </div>\r\n\r\n <!-- form direcci\u00F3n -->\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.postcode.enabled\">\r\n <label class=\"field-label\">{{'postal-code'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.postcode.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"postcode\"\r\n [formControl]=\"checkoutForm.controls['postcode']\" value=\"\" placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.postcode.touched && checkoutForm.controls.postcode.errors?.required\">\r\n <span class=\"text-danger\">{{'postal-code-help'|translate}}</span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.postcode.touched && checkoutForm.controls.postcode.errors?.pattern\">\r\n <span class=\"text-danger\"> {{postalCodeErrorMessage | translate}} </span>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"row mt-df\"><!--Fila 5-->\r\n <ng-container *ngIf=\"this.addressingService.getTypeForm().viewForms.documentType.enabled\">\r\n <div class=\"form-group col-12 col-md-4\" *ngIf=\"(documentTypes$ | async) as documentTypes\">\r\n <label class=\"field-label\">{{'document-type'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.documentType.required\"\r\n class=\"required\">*</span></label>\r\n <select name=\"documentType\" class=\"form-select\"\r\n (change)=\"onDocumentTypesSelected($event.target.value)\"\r\n [formControl]=\"checkoutForm.controls['documentType']\">\r\n<!-- <option [value]=\"''\" selected>{{'document-type'|translate}}</option>\r\n --> <option *ngFor=\"let item of documentTypes\" [value]=\"item.code\">{{item.name}}</option>\r\n </select>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.documentType.touched && checkoutForm.controls.documentType.errors?.required\">\r\n <span class=\"text-danger\">\r\n {{'type-document-help'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n </ng-container>\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.documentNumber.enabled\">\r\n <label class=\"field-label\">{{'document-number'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.documentNumber.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\"\r\n [type]=\"'text'\" name=\"documentNumber\"\r\n [formControl]=\"checkoutForm.controls['documentNumber']\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.documentNumber.touched && checkoutForm.controls.documentNumber.errors?.required\">\r\n <span class=\"text-danger\">{{ 'document-number-help' | translate }}</span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.documentNumber.touched && checkoutForm.controls.documentNumber.errors?.pattern\">\r\n <span class=\"text-danger\">{{ documentErrorMessage | translate }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"row mt-df\" *ngIf=\"this.consts.getChannel() != 'mdj-empresa-a'\"><!--Fila 6-->\r\n <div class=\"form-group col-12 col-md-12\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.enabled\">\r\n\r\n <label class=\"field-label\" *ngIf=\"!getLabelNotesParam()\">{{'notes'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.required\"\r\n class=\"required\">*</span></label>\r\n <label class=\"field-label\" *ngIf=\"getLabelNotesParam() as labelnotes\" [innerHTML]=\"labelnotes.value\"><span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.required\"\r\n class=\"required\">*</span></label>\r\n\r\n <!-- <label class=\"field-label\">{{'notes'|translate}}<span *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.required\" class=\"required\">*</span></label> -->\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"notes\"\r\n [formControl]=\"checkoutForm.controls['notes']\" value=\"\" placeholder=\"\" autocomplete=\"off\">\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\"><!--Fila 7-->\r\n <div class=\"form-group col-12 col-md-12\">\r\n <label for=\"formFact\"><b>{{ 'same-billing-address' | translate }}</b> <input type=\"checkbox\"\r\n class=\"ms-2\" [checked]=\"viewDataFacturacion\" (change)=\"showFormFacturacion()\"\r\n id=\"formFact\"></label>\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\">\r\n <div class=\"col-12\">\r\n <p>\r\n <!-- <span class=\"required\"></span> -->\r\n <label class=\"required text-underline\">* {{ 'required-fields' | translate }}</label>\r\n </p>\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\">\r\n <div class=\"form-group col-12 col-md-12\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.terms.enabled\">\r\n <span *ngIf=\"this.addressingService.getTypeForm().viewForms.terms.required\"\r\n class=\"required\">*</span>\r\n <label class=\"\" for=\"\"> {{ 'accept-terms' | translate }} <input class=\"ms-2\" name=\"terms\"\r\n [formControl]=\"checkoutForm.controls['terms']\" type=\"checkbox\" required\r\n (change)=\"onInputChange()\" /> </label><br />\r\n <a (click)=\"openModal(template)\" role=\"button\" class=\"ms-3 nota-input text-dark\">{{ 'whats-this' |\r\n translate }}</a>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.terms.touched && !checkoutForm.controls.terms.value\">\r\n <span class=\"text-danger\">{{ 'must-accept-terms' | translate }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"row\" *ngIf=\"viewDataFacturacion ; else datosFormFacturacion\"> </div>\r\n <div class=\"checkout-btn-unique text-end\">\r\n <button type=\"submit\" [disabled]=\"!validado\" class=\"btn valid-btn mt-2\">\r\n {{(isLastOne ? 'finish-checkout' : (allready_data ? 'update' :\r\n 'ready-form')) | translate}}</button>\r\n\r\n\r\n </div>\r\n <div *ngIf=\"loading\" class=\"d-flex flex-column jusitfy-content-center align-items-center\">\r\n <app-loading-full-ec></app-loading-full-ec>\r\n </div>\r\n </form>\r\n </div>\r\n</ng-container>\r\n\r\n<ng-template #addressSelection>\r\n\r\n <ng-container *ngIf=\"this.addressingService.modeSelectAddress == 'ONLY_ADDRESS_SELECTION'\">\r\n <div class=\"checkout-title my-2\">\r\n <h3>{{'address-selection'|translate}}</h3>\r\n </div>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"this.addressBook; else addressBookNotResult\">\r\n\r\n <ng-container *ngIf=\"this.addressBook?.length ;else addressBookLoading\">\r\n <div class=\"container\">\r\n <div class=\"row\">\r\n <div class=\"col-sm-6 col-12 my-3\" *ngFor=\"let item of addressBook; let i = index\">\r\n <div class=\"card p-3\">\r\n <input class=\"ms-1 mt-3 form-check-input input-size-lg\" type=\"radio\" [name]=\"'n-'+i\" [id]=\"i\"\r\n [checked]=\"item.selected\" (click)=\"setSelectAddress(item)\" (change)=\"onInputChange()\">\r\n <div class=\"ms-5\">\r\n <h4 class=\"card-title\">\r\n <strong>{{'address'|translate}}</strong><br>\r\n <span class=\"text-uppercase h3\">{{item.street}}</span>\r\n </h4>\r\n <div class=\"row\">\r\n <h5 class=\"card-subtitle mb-2 text-muted col-auto\">\r\n <strong>{{'country'|translate}}</strong> {{getCountry(item.countryCode)}}\r\n </h5>\r\n <h5 class=\"card-subtitle mb-2 text-muted col-auto\">\r\n <strong>{{'state'|translate}}</strong> {{getProvince(item.provinceCode)}}\r\n </h5>\r\n <h5 class=\"card-subtitle mb-2 text-muted col-auto\">\r\n <strong>{{'town-city'|translate}}</strong> {{item.city}}\r\n </h5>\r\n <h5 class=\"card-subtitle mb-2 text-muted col-auto\">\r\n <strong>{{'postal-code'|translate}}</strong> {{item.postcode}}\r\n </h5>\r\n </div>\r\n <div class=\"row px-3\">\r\n <div class=\"card p-2 bg-light w-100\">\r\n <div class=\"card-body\">\r\n <h5 class=\"card-title\">{{'address-contact'|translate}}</h5>\r\n <h6 class=\"card-subtitle mb-2 text-muted\">\r\n <strong>{{'first-name'|translate}}</strong>\r\n {{item.addressContact.firstName}}\r\n </h6>\r\n <h6 class=\"card-subtitle mb-2 text-muted\">\r\n <strong>{{'last-name'|translate}}</strong> {{item.addressContact.lastName}}\r\n </h6>\r\n <h6 class=\"card-subtitle mb-2 text-muted\">\r\n <strong>{{'document-type'|translate}}</strong>\r\n {{getDocumentType(item.addressContact.documentType)}}\r\n </h6>\r\n <h6 class=\"card-subtitle mb-2 text-muted\">\r\n <strong>{{'document-number'|translate}}</strong>\r\n {{item.addressContact.documentNumber}}\r\n </h6>\r\n <h6 class=\"card-subtitle mb-2 text-muted\">\r\n <strong>{{'email-address'|translate}}</strong> {{item.addressContact.email}}\r\n </h6>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n </div>\r\n<!-- Se hardcodea el canal de mundo del juguete empresa A ya que se necesita con urgencia, se sustituira por un campo que llegara de backend. -->\r\n <div class=\"w-100\" *ngIf=\"this.consts.getChannel() != 'mdj-empresa-a'\"> \r\n <ng-container *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.enabled\">\r\n <div class=\"row mt-df\">\r\n <div class=\"form-group col-12 col-md-12\">\r\n <label class=\"field-label\" *ngIf=\"!getLabelNotesParam()\">{{'notes'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.required\"\r\n class=\"required\">*</span></label>\r\n <label class=\"field-label\"\r\n *ngIf=\"getLabelNotesParam() as labelnotes\" [innerHTML]=\"labelnotes.value\"></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"notes\"\r\n [(ngModel)]=\"this.addressBookSelected.notes\" #ctrl=\"ngModel\" value=\"\" placeholder=\"\"\r\n autocomplete=\"off\"> \r\n <div class=\"invalid-feedback d-block\" *ngIf=\"\r\n addressingService.getTypeForm().viewForms.notes.required\r\n && (!addressBookSelected.notes || !addressBookSelected.notes.trim())\r\n \">\r\n {{ 'required-field' | translate }}\r\n </div>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </div>\r\n <div class=\"checkout-btn-unique text-end\">\r\n <button (click)=\"selectAddress(this.cartService.items)\" class=\"btn valid-btn mt-2\">\r\n {{(isLastOne ? 'finish-checkout' : (allready_data ? 'update' :\r\n 'ready-form')) | translate}}\r\n </button>\r\n </div>\r\n <div *ngIf=\"loading\" class=\"d-flex flex-column jusitfy-content-center align-items-center\">\r\n <app-loading-full-ec></app-loading-full-ec>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n\r\n</ng-template>\r\n\r\n\r\n<ng-template #requireLoginView>\r\n <div id=\"loginCheckout\">\r\n <div class=\"d-flex flex-column jusitfy-content-center align-items-center\" *ngIf=\"require_login\">\r\n <div class=\"col-12\">\r\n <app-login-form-ec (ready)=\"verifyValidate($event)\" [redirect]=\"false\" [title]=\"'need-login'\">\r\n </app-login-form-ec>\r\n </div>\r\n </div>\r\n </div>\r\n</ng-template>\r\n\r\n\r\n\r\n<ng-template #datosFormFacturacion>\r\n <div class=\"container-fluid px-0 px-md-2\">\r\n <div class=\"row\">\r\n <div class=\"col-12\">\r\n <div class=\"card \">\r\n <div class=\"card-header text-dark text-center\">\r\n <h3>{{'billing-data'|translate}}</h3>\r\n </div>\r\n <div class=\"card-body\">\r\n <form (submit)=\"verifyValidate()\">\r\n <div class=\"row mt-df\">\r\n <!--Fila 1-->\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.firstName.enabled\">\r\n <label class=\"field-label\">{{'first-name'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.firstName.required\"\r\n class=\"required\">*</span></label>\r\n <input class=\"form-control\" type=\"text\" name=\"firstName\"\r\n [formControl]=\"checkoutFormFacturacion.controls['firstName']\" value=\"\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.firstName.touched && checkoutFormFacturacion.controls.firstName.errors?.required\">\r\n <span class=\"text-danger\">{{'first-name-help1'|translate}}</span>\r\n\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.firstName.touched && checkoutFormFacturacion.controls.firstName.errors?.pattern\">\r\n <span class=\"text-danger\">\r\n {{'first-name-help2'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.lastName.enabled\">\r\n <label class=\"field-label\">{{'last-name'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.lastName.required\"\r\n class=\"required\">*</span></label>\r\n <input class=\"form-control\" type=\"text\" name=\"lastName\"\r\n [formControl]=\"checkoutFormFacturacion.controls['lastName']\" value=\"\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.lastName.touched && checkoutFormFacturacion.controls.lastName.errors?.required\">\r\n <span class=\"text-danger\">{{'last-name-help1'|translate}}</span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.lastName.touched && checkoutFormFacturacion.controls.lastName.errors?.pattern\">\r\n <span class=\"text-danger\">{{'last-name-help2'|translate}}</span>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\">\r\n <!--Fila 2-->\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.phoneNumber.enabled\">\r\n <label class=\"field-label\">{{'phone'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.phoneNumber.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\"\r\n name=\"phoneNumber\"\r\n [formControl]=\"checkoutFormFacturacion.controls['phoneNumber']\" value=\"\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.phoneNumber.touched && checkoutFormFacturacion.controls.phoneNumber.errors?.required\">\r\n <span class=\"text-danger\">\r\n {{'phone-help1'|translate}}\r\n </span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.phoneNumber.touched && checkoutFormFacturacion.controls.phoneNumber.errors?.pattern\">\r\n <span class=\"text-danger\">\r\n {{'phone-help2'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.email.enabled\">\r\n <label class=\"field-label\">{{'email-address'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.email.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"email\" name=\"email\"\r\n [formControl]=\"checkoutFormFacturacion.controls['email']\" value=\"\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.email.touched && checkoutFormFacturacion.controls.email.errors?.required\">\r\n <span class=\"text-danger\">\r\n {{'email-address-help1'|translate}}\r\n </span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.email.touched && checkoutFormFacturacion.controls.email.errors?.email\">\r\n <span class=\"text-danger\">\r\n {{'email-address-help2'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\">\r\n <!--Fila 3-->\r\n\r\n <ng-container\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.countryCode.enabled\">\r\n\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"(countriesFacturacion$ | async) as countries\">\r\n <label class=\"field-label\">{{'country'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.countryCode.required\"\r\n class=\"required\">*</span></label>\r\n <select class=\"form-select\" name=\"countryCode\"\r\n [formControl]=\"checkoutFormFacturacion.controls['countryCode']\"\r\n (change)=\"onCountrySelectedFacturacion($event.target.value)\">\r\n <!-- <option selected [value]=\"null\">{{ 'choose-country' | translate }}</option> -->\r\n <option *ngFor=\"let country of countries\" [value]=\"country.code\">\r\n {{ country.name }}</option>\r\n </select>\r\n <div *ngIf=\"checkoutFormFacturacion.controls.countryCode.touched && checkoutFormFacturacion.controls.countryCode.errors?.required\"\r\n class=\"text text-danger\">\r\n {{'country-help'|translate}}\r\n </div>\r\n </div>\r\n </ng-container>\r\n <ng-container\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.provinceCode.enabled\">\r\n\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"(provincesFacturacion$ | async) as provinces\">\r\n <label class=\"field-label\">{{'state'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.provinceCode.required\"\r\n class=\"required\">*</span></label>\r\n <select class=\"form-select\" name=\"provinceCode\"\r\n (change)=\"onProvincesSelectedFacturacion($event.target.value)\"\r\n [formControl]=\"checkoutFormFacturacion.controls['provinceCode']\">\r\n <!-- <option selected [value]=\"null\">{{ 'choose-province' | translate }}</option> -->\r\n <option *ngFor=\"let province of provinces\" [value]=\"province.code\">\r\n {{ province.name }}\r\n </option>\r\n </select>\r\n <div *ngIf=\"checkoutFormFacturacion.controls.provinceCode.touched && checkoutFormFacturacion.controls.provinceCode.errors?.required\"\r\n class=\"text text-danger\">\r\n {{'state-help'|translate}}\r\n </div>\r\n </div>\r\n </ng-container>\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.city.enabled\">\r\n <label class=\"field-label\">{{'town-city'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.city.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"city\"\r\n [formControl]=\"checkoutFormFacturacion.controls['city']\" value=\"\" placeholder=\"\"\r\n autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.city.touched && checkoutFormFacturacion.controls.city.errors?.required\">\r\n <span class=\"text-danger\">{{'town-city-help'|translate}}</span>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\">\r\n <!--Fila 4-->\r\n <div class=\"form-group col-12 col-md-8\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.street.enabled\">\r\n <label class=\"field-label\">{{'address'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.street.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"street\"\r\n [formControl]=\"checkoutFormFacturacion.controls['street']\" value=\"\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.street.touched && checkoutFormFacturacion.controls.street.errors?.required\">\r\n <span class=\"text-danger\">{{'address-help1'|translate}}</span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.street.touched && checkoutFormFacturacion.controls.street.errors?.maxlength\">\r\n <span class=\"text-danger\">{{'address-help2'|translate}}</span>\r\n </div>\r\n </div>\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.postcode.enabled\">\r\n <label class=\"field-label\">{{'postal-code'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.postcode.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"postcode\"\r\n [formControl]=\"checkoutFormFacturacion.controls['postcode']\" value=\"\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.postcode.touched && checkoutFormFacturacion.controls.postcode.errors?.required\">\r\n <span class=\"text-danger\">{{'postal-code-help'|translate}}</span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.postcode.touched && checkoutFormFacturacion.controls.postcode.errors?.pattern\">\r\n <span class=\"text-danger\">{{postalCodeErrorMessage |translate}}</span>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\">\r\n <!--Fila 5-->\r\n <ng-container *ngIf=\"this.addressingService.getTypeForm().viewForms.documentType.enabled\">\r\n <div class=\"form-group col-12 col-md-4\" *ngIf=\"(documentTypesFacturacion$ | async) as documentTypes\">\r\n <label class=\"field-label\">{{'document-type'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.documentType.required\"\r\n class=\"required\">*</span></label>\r\n <select name=\"documentType\" class=\"form-select\"\r\n [formControl]=\"checkoutFormFacturacion.controls['documentType']\"\r\n (change)=\"onDocumentTypesSelectedFacturacion($event.target.value)\">\r\n <!-- <option [value]=\"''\" selected>{{'document-type'|translate}}</option> -->\r\n <option\r\n *ngFor=\"let item of documentTypes\"\r\n [value]=\"item.code\">{{item.name}}</option>\r\n </select>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.documentType.touched && checkoutFormFacturacion.controls.documentType.errors?.required\">\r\n <span class=\"text-danger\">\r\n {{'type-document-help'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.documentNumber.enabled\">\r\n <label class=\"field-label\">{{'document-number'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.documentNumber.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\"\r\n [type]=\"'text'\" name=\"documentNumber\"\r\n [formControl]=\"checkoutFormFacturacion.controls['documentNumber']\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.documentNumber.touched && checkoutFormFacturacion.controls.documentNumber.errors?.required\">\r\n <span class=\"text-danger\">\r\n {{'document-number-help'|translate}}\r\n </span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.documentNumber.touched && checkoutFormFacturacion.controls.documentNumber.errors?.pattern\">\r\n <span class=\"text-danger\">{{ documentErrorMessage | translate }}</span>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </div>\r\n <div class=\"row mt-df\" *ngIf=\"this.consts.getChannel() != 'mdj-empresa-a'\">\r\n <div class=\"form-group col-12 col-md-12\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.enabled\">\r\n <label class=\"field-label\" *ngIf=\"!getLabelNotesParam()\">{{'notes'|translate}}aaa <span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.required\"\r\n class=\"required\">*</span></label>\r\n <label class=\"field-label\" *ngIf=\"getLabelNotesParam() as labelNotesHtml\">\r\n <div [innerHTML]=\"labelNotesHtml\"></div>\r\n <span *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.required\" class=\"required\">*</span>\r\n </label>\r\n\r\n <!-- <label class=\"field-label\">{{'notes'|translate}}<span *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.required\" class=\"required\">*</span></label> -->\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"notes\"\r\n [formControl]=\"checkoutFormFacturacion.controls['notes']\" value=\"\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n </div>\r\n </div>\r\n </form>\r\n </div>\r\n\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</ng-template>\r\n\r\n\r\n\r\n<ng-template #template>\r\n <div class=\"modal-content\">\r\n <div class=\"modal-header\">\r\n <button type=\"button\" class=\"btn-close float-end\" aria-label=\"Close\" (click)=\"modalRef.hide()\">\r\n </button>\r\n </div>\r\n </div>\r\n\r\n <div class=\"modal-body scrol-if\">\r\n <app-section-container-ec [name]=\"'terminos-y-condiciones'\"> </app-section-container-ec>\r\n </div>\r\n\r\n</ng-template>\r\n\r\n\r\n<ng-template #addressBookNotResult>\r\n <div class=\"container\">\r\n <div class=\"row\">\r\n <div class=\"col-12 text-center my-2\">\r\n <h4> {{'address-book-not-result' | translate }} </h4>\r\n </div>\r\n </div>\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #addressBookLoading>\r\n <div class=\"container\">\r\n <div class=\"row\">\r\n <div class=\"col-12 text-center my-2\">\r\n <div class=\"d-flex flex-column jusitfy-content-center align-items-center\">\r\n <app-loading-full-ec></app-loading-full-ec>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</ng-template>\r\n</ng-container>\r\n\r\n<ng-template #pleaseLogin>\r\n <div class=\"container\">\r\n <p>Por favor <a [routerLink]=\"['/auth/login']\" > Inicie Sesi\u00F3n</a></p>\r\n </div>\r\n</ng-template>",
|
|
8597
|
+
template: "<ng-container\r\n *ngIf=\"this.channelConfig.channelType != 'b2b' || (this.channelConfig.channelType == 'b2b' && authService.isAuthenticated()); else pleaseLogin\">\r\n <ng-container\r\n *ngIf=\"this.addressingService.modeSelectAddress == 'LOAD_ADDRESS_AND_SELECTION' && this.authService.isAuthenticated() && this.addressBook != null\">\r\n <div class=\"container card p-4 mb-3\">\r\n <div class=\"row justify-content-center\">\r\n <div class=\"col-12 col-md-10 col-lg-8 text-center\">\r\n <div class=\"btn-group btn-group-toggle\" data-bs-toggle=\"buttons\">\r\n <label [class]=\"'btn btn-outline-secondary ' + (!getMode() ? 'active' : '')\">\r\n <input type=\"radio\" name=\"options\" id=\"option1\" autocomplete=\"off\" checked\r\n (change)=\"setMode('seleccion')\"> {{'select-address' | translate | titlecase}}\r\n </label>\r\n\r\n <label [class]=\"'btn btn-outline-secondary ' + (getMode() ? 'active' : '')\"\r\n *ngIf=\"!getParamByChannelAndLanguage('btn_new_address_')\">\r\n <input type=\"radio\" name=\"options\" id=\"option2\" autocomplete=\"off\"\r\n (change)=\"setMode('carga')\">\r\n {{ 'new-address' | translate | titlecase}}\r\n </label>\r\n\r\n <label [class]=\"'btn btn-outline-secondary ' + (selectAddress ? 'active' : '')\"\r\n *ngIf=\"getParamByChannelAndLanguage('btn_new_address_') as param\">\r\n <input type=\"radio\" name=\"options\" id=\"option2\" autocomplete=\"off\"\r\n (change)=\"setMode('carga')\">\r\n {{ param.value}}\r\n </label>\r\n\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"getMode(); else addressSelection\">\r\n <div *ngIf=\"!require_login; else requireLoginView\">\r\n\r\n <ng-container *ngIf=\"this.addressingService.modeSelectAddress == 'ONLY_LOAD_ADDRESS'\">\r\n <div class=\"checkout-title my-2\">\r\n <h3>{{'billing-details'|translate}}</h3>\r\n </div>\r\n </ng-container>\r\n\r\n <form (submit)=\"verifyValidate(false,this.cartService.items)\">\r\n <div class=\"row mt-df\"><!--Fila 1-->\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.firstName.enabled\">\r\n <label class=\"field-label\">{{'first-name'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.firstName.required\"\r\n class=\"required\">*</span></label>\r\n <input class=\"form-control\" type=\"text\" name=\"firstName\"\r\n [formControl]=\"checkoutForm.controls['firstName']\" value=\"\" placeholder=\"\"\r\n autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.firstName.touched && checkoutForm.controls.firstName.errors?.required\">\r\n <span class=\"text-danger\">{{'first-name-help1'|translate}}</span>\r\n\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.firstName.touched && checkoutForm.controls.firstName.errors?.pattern\">\r\n <span class=\"text-danger\">\r\n {{'first-name-help2'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.lastName.enabled\">\r\n <label class=\"field-label\">{{'last-name'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.lastName.required\"\r\n class=\"required\">*</span></label>\r\n <input class=\"form-control\" type=\"text\" name=\"lastName\"\r\n [formControl]=\"checkoutForm.controls['lastName']\" value=\"\" placeholder=\"\"\r\n autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.lastName.touched && checkoutForm.controls.lastName.errors?.required\">\r\n <span class=\"text-danger\">{{'last-name-help1'|translate}}</span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.lastName.touched && checkoutForm.controls.lastName.errors?.pattern\">\r\n <span class=\"text-danger\">{{'last-name-help2'|translate}}</span>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\"><!--Fila 2-->\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.phoneNumber.enabled\">\r\n <label class=\"field-label\">{{'phone'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.phoneNumber.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"phoneNumber\"\r\n [formControl]=\"checkoutForm.controls['phoneNumber']\" value=\"\" placeholder=\"\"\r\n autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.phoneNumber.touched && checkoutForm.controls.phoneNumber.errors?.required\">\r\n <span class=\"text-danger\">\r\n\r\n {{'phone-help1'|translate}}\r\n </span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.phoneNumber.touched && checkoutForm.controls.phoneNumber.errors?.pattern\">\r\n <span class=\"text-danger\">\r\n {{'phone-help2'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.email.enabled\">\r\n <label class=\"field-label\">{{'email-address'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.email.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"email\" name=\"email\"\r\n [formControl]=\"checkoutForm.controls['email']\" value=\"\" placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.email.touched && checkoutForm.controls.email.errors?.required\">\r\n <span class=\"text-danger\">\r\n {{'email-address-help1'|translate}}\r\n </span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.email.touched && checkoutForm.controls.email.errors?.email\">\r\n <span class=\"text-danger\">\r\n {{'email-address-help2'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"row mt-df\"><!--Fila 3-->\r\n <ng-container *ngIf=\"this.addressingService.getTypeForm().viewForms.countryCode.enabled\">\r\n <div class=\"form-group col-12 col-md-4\" *ngIf=\"(countries$ | async) as countries\">\r\n <label class=\"field-label\">{{'country'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.countryCode.required\"\r\n class=\"required\">*</span></label>\r\n <select class=\"form-select\" name=\"countryCode\"\r\n [formControl]=\"checkoutForm.controls['countryCode']\"\r\n (change)=\"onCountrySelected($event.target.value)\">\r\n <!-- <option selected [value]=\"countries[0].code\">{{ 'choose-country' | translate }}</option> -->\r\n <option *ngFor=\"let country of countries\" [value]=\"country.code\">{{ country.name }}\r\n </option>\r\n </select>\r\n <div *ngIf=\"checkoutForm.controls.countryCode.touched && checkoutForm.controls.countryCode.errors?.required\"\r\n class=\"text text-danger\">\r\n {{'country-help'|translate}}\r\n </div>\r\n </div>\r\n </ng-container>\r\n <ng-container *ngIf=\"this.addressingService.getTypeForm().viewForms.provinceCode.enabled\">\r\n <div class=\"form-group col-12 col-md-4\" *ngIf=\"(provinces$ | async) as provinces\">\r\n <label class=\"field-label\">{{'state'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.provinceCode.required\"\r\n class=\"required\">*</span></label>\r\n <select class=\"form-select\" name=\"provinceCode\"\r\n (change)=\"onProvincesSelected($event.target.value)\"\r\n [formControl]=\"checkoutForm.controls['provinceCode']\">\r\n <!-- <option selected [value]=\"null\">{{ 'choose-province' | translate }}</option>\r\n -->\r\n <option *ngFor=\"let province of provinces\" [value]=\"province.code\">{{ province.name }}\r\n </option>\r\n </select>\r\n <div *ngIf=\"checkoutForm.controls.provinceCode.touched && checkoutForm.controls.provinceCode.errors?.required\"\r\n class=\"text text-danger\">\r\n {{'state-help'|translate}}\r\n </div>\r\n </div>\r\n </ng-container>\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.city.enabled\">\r\n <label class=\"field-label\">{{'town-city'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.city.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"city\"\r\n [formControl]=\"checkoutForm.controls['city']\" value=\"\" placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.city.touched && checkoutForm.controls.city.errors?.required\">\r\n <span class=\"text-danger\">{{'town-city-help'|translate}}</span>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"row mt-df\"><!--Fila 4-->\r\n <div class=\"form-group col-12 col-md-8\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.street.enabled\">\r\n <label class=\"field-label\">{{'address'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.street.required\"\r\n class=\"required\">*</span>\r\n <span class=\"char-count ms-2\" style=\"font-size: 0.9em; color: #888;\">\r\n {{ 50 - (checkoutForm.controls['street'].value?.length || 0) }} {{'remainingCharacters'|translate}}\r\n </span>\r\n </label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"street\"\r\n [formControl]=\"checkoutForm.controls['street']\" value=\"\" placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.street.touched && checkoutForm.controls.street.errors?.required\">\r\n <span class=\"text-danger\">{{'address-help1'|translate}}</span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.street.touched && checkoutForm.controls.street.errors?.maxlength\">\r\n <span class=\"text-danger\">{{'address-help2'|translate}}</span>\r\n </div>\r\n </div>\r\n\r\n <!-- form direcci\u00F3n -->\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.postcode.enabled\">\r\n <label class=\"field-label\">{{'postal-code'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.postcode.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"postcode\"\r\n [formControl]=\"checkoutForm.controls['postcode']\" value=\"\" placeholder=\"\"\r\n autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.postcode.touched && checkoutForm.controls.postcode.errors?.required\">\r\n <span class=\"text-danger\">{{'postal-code-help'|translate}}</span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.postcode.touched && checkoutForm.controls.postcode.errors?.pattern\">\r\n <span class=\"text-danger\"> {{postalCodeErrorMessage | translate}} </span>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"row mt-df\"><!--Fila 5-->\r\n <ng-container *ngIf=\"this.addressingService.getTypeForm().viewForms.documentType.enabled\">\r\n <div class=\"form-group col-12 col-md-4\" *ngIf=\"(documentTypes$ | async) as documentTypes\">\r\n <label class=\"field-label\">{{'document-type'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.documentType.required\"\r\n class=\"required\">*</span></label>\r\n <select name=\"documentType\" class=\"form-select\"\r\n (change)=\"onDocumentTypesSelected($event.target.value)\"\r\n [formControl]=\"checkoutForm.controls['documentType']\">\r\n <!-- <option [value]=\"''\" selected>{{'document-type'|translate}}</option>\r\n -->\r\n <option *ngFor=\"let item of documentTypes\" [value]=\"item.code\">{{item.name}}</option>\r\n </select>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.documentType.touched && checkoutForm.controls.documentType.errors?.required\">\r\n <span class=\"text-danger\">\r\n {{'type-document-help'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n </ng-container>\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.documentNumber.enabled\">\r\n <label class=\"field-label\">{{'document-number'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.documentNumber.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" [type]=\"'text'\" name=\"documentNumber\"\r\n [formControl]=\"checkoutForm.controls['documentNumber']\" placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.documentNumber.touched && checkoutForm.controls.documentNumber.errors?.required\">\r\n <span class=\"text-danger\">{{ 'document-number-help' | translate }}</span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.documentNumber.touched && checkoutForm.controls.documentNumber.errors?.pattern\">\r\n <span class=\"text-danger\">{{ documentErrorMessage | translate }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"row mt-df\" *ngIf=\"this.consts.getChannel() != 'mdj-empresa-a'\"><!--Fila 6-->\r\n <div class=\"form-group col-12 col-md-12\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.enabled\">\r\n\r\n <label class=\"field-label\" *ngIf=\"!getLabelNotesParam()\">{{'notes'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.required\"\r\n class=\"required\">*</span></label>\r\n <label class=\"field-label\" *ngIf=\"getLabelNotesParam() as labelnotes\"\r\n [innerHTML]=\"labelnotes.value\"><span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.required\"\r\n class=\"required\">*</span></label>\r\n\r\n <!-- <label class=\"field-label\">{{'notes'|translate}}<span *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.required\" class=\"required\">*</span></label> -->\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"notes\"\r\n [formControl]=\"checkoutForm.controls['notes']\" value=\"\" placeholder=\"\" autocomplete=\"off\">\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\"><!--Fila 7-->\r\n <div class=\"form-group col-12 col-md-12\">\r\n <label for=\"formFact\"><b>{{ 'same-billing-address' | translate }}</b> <input type=\"checkbox\"\r\n class=\"ms-2\" [checked]=\"viewDataFacturacion\" (change)=\"showFormFacturacion()\"\r\n id=\"formFact\"></label>\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\">\r\n <div class=\"col-12\">\r\n <p>\r\n <!-- <span class=\"required\"></span> -->\r\n <label class=\"required text-underline\">* {{ 'required-fields' | translate }}</label>\r\n </p>\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\">\r\n <div class=\"form-group col-12 col-md-12\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.terms.enabled\">\r\n <span *ngIf=\"this.addressingService.getTypeForm().viewForms.terms.required\"\r\n class=\"required\">*</span>\r\n <label class=\"\" for=\"\"> {{ 'accept-terms' | translate }} <input class=\"ms-2\" name=\"terms\"\r\n [formControl]=\"checkoutForm.controls['terms']\" type=\"checkbox\" required\r\n (change)=\"onInputChange()\" /> </label><br />\r\n <a (click)=\"openModal(template)\" role=\"button\" class=\"ms-3 nota-input text-dark\">{{ 'whats-this'\r\n |\r\n translate }}</a>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutForm.controls.terms.touched && !checkoutForm.controls.terms.value\">\r\n <span class=\"text-danger\">{{ 'must-accept-terms' | translate }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"row\" *ngIf=\"viewDataFacturacion ; else datosFormFacturacion\"> </div>\r\n <div class=\"checkout-btn-unique text-end\">\r\n <button type=\"submit\" [disabled]=\"!validado\" class=\"btn valid-btn mt-2\">\r\n {{(isLastOne ? 'finish-checkout' : (allready_data ? 'update' :\r\n 'ready-form')) | translate}}</button>\r\n\r\n\r\n </div>\r\n <div *ngIf=\"loading\" class=\"d-flex flex-column jusitfy-content-center align-items-center\">\r\n <app-loading-full-ec></app-loading-full-ec>\r\n </div>\r\n </form>\r\n </div>\r\n </ng-container>\r\n\r\n <ng-template #addressSelection>\r\n\r\n <ng-container *ngIf=\"this.addressingService.modeSelectAddress == 'ONLY_ADDRESS_SELECTION'\">\r\n <div class=\"checkout-title my-2\">\r\n <h3>{{'address-selection'|translate}}</h3>\r\n </div>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"this.addressBook; else addressBookNotResult\">\r\n\r\n <ng-container *ngIf=\"this.addressBook?.length ;else addressBookLoading\">\r\n <div class=\"container\">\r\n <div class=\"row\">\r\n <div class=\"col-sm-6 col-12 my-3\" *ngFor=\"let item of addressBook; let i = index\">\r\n <div class=\"card p-3\">\r\n <input class=\"ms-1 mt-3 form-check-input input-size-lg\" type=\"radio\" [name]=\"'n-'+i\"\r\n [id]=\"i\" [checked]=\"item.selected\" (click)=\"setSelectAddress(item)\"\r\n (change)=\"onInputChange()\">\r\n <div class=\"ms-5\">\r\n <h4 class=\"card-title\">\r\n <strong>{{'address'|translate}}</strong><br>\r\n <span class=\"text-uppercase h3\">{{item.street}}</span>\r\n </h4>\r\n <div class=\"row\">\r\n <h5 class=\"card-subtitle mb-2 text-muted col-auto\">\r\n <strong>{{'country'|translate}}</strong> {{getCountry(item.countryCode)}}\r\n </h5>\r\n <h5 class=\"card-subtitle mb-2 text-muted col-auto\">\r\n <strong>{{'state'|translate}}</strong> {{getProvince(item.provinceCode)}}\r\n </h5>\r\n <h5 class=\"card-subtitle mb-2 text-muted col-auto\">\r\n <strong>{{'town-city'|translate}}</strong> {{item.city}}\r\n </h5>\r\n <h5 class=\"card-subtitle mb-2 text-muted col-auto\">\r\n <strong>{{'postal-code'|translate}}</strong> {{item.postcode}}\r\n </h5>\r\n </div>\r\n <div class=\"row px-3\">\r\n <div class=\"card p-2 bg-light w-100\">\r\n <div class=\"card-body\">\r\n <h5 class=\"card-title\">{{'address-contact'|translate}}</h5>\r\n <h6 class=\"card-subtitle mb-2 text-muted\">\r\n <strong>{{'first-name'|translate}}</strong>\r\n {{item.addressContact.firstName}}\r\n </h6>\r\n <h6 class=\"card-subtitle mb-2 text-muted\">\r\n <strong>{{'last-name'|translate}}</strong>\r\n {{item.addressContact.lastName}}\r\n </h6>\r\n <h6 class=\"card-subtitle mb-2 text-muted\">\r\n <strong>{{'document-type'|translate}}</strong>\r\n {{getDocumentType(item.addressContact.documentType)}}\r\n </h6>\r\n <h6 class=\"card-subtitle mb-2 text-muted\">\r\n <strong>{{'document-number'|translate}}</strong>\r\n {{item.addressContact.documentNumber}}\r\n </h6>\r\n <h6 class=\"card-subtitle mb-2 text-muted\">\r\n <strong>{{'email-address'|translate}}</strong>\r\n {{item.addressContact.email}}\r\n </h6>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n </div>\r\n <!-- Se hardcodea el canal de mundo del juguete empresa A ya que se necesita con urgencia, se sustituira por un campo que llegara de backend. -->\r\n <div class=\"w-100\" *ngIf=\"this.consts.getChannel() != 'mdj-empresa-a'\">\r\n <ng-container *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.enabled\">\r\n <div class=\"row mt-df\">\r\n <div class=\"form-group col-12 col-md-12\">\r\n <label class=\"field-label\" *ngIf=\"!getLabelNotesParam()\">{{'notes'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.required\"\r\n class=\"required\">*</span></label>\r\n <label class=\"field-label\" *ngIf=\"getLabelNotesParam() as labelnotes\"\r\n [innerHTML]=\"labelnotes.value\"></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"notes\"\r\n [(ngModel)]=\"this.addressBookSelected.notes\" #ctrl=\"ngModel\" value=\"\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"invalid-feedback d-block\" *ngIf=\"\r\n addressingService.getTypeForm().viewForms.notes.required\r\n && (!addressBookSelected.notes || !addressBookSelected.notes.trim())\r\n \">\r\n {{ 'required-field' | translate }}\r\n </div>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </div>\r\n <div class=\"checkout-btn-unique text-end\">\r\n <button (click)=\"selectAddress(this.cartService.items)\" class=\"btn valid-btn mt-2\">\r\n {{(isLastOne ? 'finish-checkout' : (allready_data ? 'update' :\r\n 'ready-form')) | translate}}\r\n </button>\r\n </div>\r\n <div *ngIf=\"loading\" class=\"d-flex flex-column jusitfy-content-center align-items-center\">\r\n <app-loading-full-ec></app-loading-full-ec>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n\r\n </ng-template>\r\n\r\n\r\n <ng-template #requireLoginView>\r\n <div id=\"loginCheckout\">\r\n <div class=\"d-flex flex-column jusitfy-content-center align-items-center\" *ngIf=\"require_login\">\r\n <div class=\"col-12\">\r\n <app-login-form-ec (ready)=\"verifyValidate($event)\" [redirect]=\"false\" [title]=\"'need-login'\">\r\n </app-login-form-ec>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n\r\n\r\n\r\n <ng-template #datosFormFacturacion>\r\n <div class=\"container-fluid px-0 px-md-2\">\r\n <div class=\"row\">\r\n <div class=\"col-12\">\r\n <div class=\"card \">\r\n <div class=\"card-header text-dark text-center\">\r\n <h3>{{'billing-data'|translate}}</h3>\r\n </div>\r\n <div class=\"card-body\">\r\n <form (submit)=\"verifyValidate()\">\r\n <div class=\"row mt-df\">\r\n <!--Fila 1-->\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.firstName.enabled\">\r\n <label class=\"field-label\">{{'first-name'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.firstName.required\"\r\n class=\"required\">*</span></label>\r\n <input class=\"form-control\" type=\"text\" name=\"firstName\"\r\n [formControl]=\"checkoutFormFacturacion.controls['firstName']\" value=\"\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.firstName.touched && checkoutFormFacturacion.controls.firstName.errors?.required\">\r\n <span class=\"text-danger\">{{'first-name-help1'|translate}}</span>\r\n\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.firstName.touched && checkoutFormFacturacion.controls.firstName.errors?.pattern\">\r\n <span class=\"text-danger\">\r\n {{'first-name-help2'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.lastName.enabled\">\r\n <label class=\"field-label\">{{'last-name'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.lastName.required\"\r\n class=\"required\">*</span></label>\r\n <input class=\"form-control\" type=\"text\" name=\"lastName\"\r\n [formControl]=\"checkoutFormFacturacion.controls['lastName']\" value=\"\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.lastName.touched && checkoutFormFacturacion.controls.lastName.errors?.required\">\r\n <span class=\"text-danger\">{{'last-name-help1'|translate}}</span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.lastName.touched && checkoutFormFacturacion.controls.lastName.errors?.pattern\">\r\n <span class=\"text-danger\">{{'last-name-help2'|translate}}</span>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\">\r\n <!--Fila 2-->\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.phoneNumber.enabled\">\r\n <label class=\"field-label\">{{'phone'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.phoneNumber.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\"\r\n name=\"phoneNumber\"\r\n [formControl]=\"checkoutFormFacturacion.controls['phoneNumber']\" value=\"\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.phoneNumber.touched && checkoutFormFacturacion.controls.phoneNumber.errors?.required\">\r\n <span class=\"text-danger\">\r\n {{'phone-help1'|translate}}\r\n </span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.phoneNumber.touched && checkoutFormFacturacion.controls.phoneNumber.errors?.pattern\">\r\n <span class=\"text-danger\">\r\n {{'phone-help2'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n <div class=\"form-group col-12 col-md-6\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.email.enabled\">\r\n <label class=\"field-label\">{{'email-address'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.email.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"email\" name=\"email\"\r\n [formControl]=\"checkoutFormFacturacion.controls['email']\" value=\"\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.email.touched && checkoutFormFacturacion.controls.email.errors?.required\">\r\n <span class=\"text-danger\">\r\n {{'email-address-help1'|translate}}\r\n </span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.email.touched && checkoutFormFacturacion.controls.email.errors?.email\">\r\n <span class=\"text-danger\">\r\n {{'email-address-help2'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\">\r\n <!--Fila 3-->\r\n\r\n <ng-container\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.countryCode.enabled\">\r\n\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"(countriesFacturacion$ | async) as countries\">\r\n <label class=\"field-label\">{{'country'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.countryCode.required\"\r\n class=\"required\">*</span></label>\r\n <select class=\"form-select\" name=\"countryCode\"\r\n [formControl]=\"checkoutFormFacturacion.controls['countryCode']\"\r\n (change)=\"onCountrySelectedFacturacion($event.target.value)\">\r\n <!-- <option selected [value]=\"null\">{{ 'choose-country' | translate }}</option> -->\r\n <option *ngFor=\"let country of countries\" [value]=\"country.code\">\r\n {{ country.name }}</option>\r\n </select>\r\n <div *ngIf=\"checkoutFormFacturacion.controls.countryCode.touched && checkoutFormFacturacion.controls.countryCode.errors?.required\"\r\n class=\"text text-danger\">\r\n {{'country-help'|translate}}\r\n </div>\r\n </div>\r\n </ng-container>\r\n <ng-container\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.provinceCode.enabled\">\r\n\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"(provincesFacturacion$ | async) as provinces\">\r\n <label class=\"field-label\">{{'state'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.provinceCode.required\"\r\n class=\"required\">*</span></label>\r\n <select class=\"form-select\" name=\"provinceCode\"\r\n (change)=\"onProvincesSelectedFacturacion($event.target.value)\"\r\n [formControl]=\"checkoutFormFacturacion.controls['provinceCode']\">\r\n <!-- <option selected [value]=\"null\">{{ 'choose-province' | translate }}</option> -->\r\n <option *ngFor=\"let province of provinces\" [value]=\"province.code\">\r\n {{ province.name }}\r\n </option>\r\n </select>\r\n <div *ngIf=\"checkoutFormFacturacion.controls.provinceCode.touched && checkoutFormFacturacion.controls.provinceCode.errors?.required\"\r\n class=\"text text-danger\">\r\n {{'state-help'|translate}}\r\n </div>\r\n </div>\r\n </ng-container>\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.city.enabled\">\r\n <label class=\"field-label\">{{'town-city'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.city.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"city\"\r\n [formControl]=\"checkoutFormFacturacion.controls['city']\" value=\"\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.city.touched && checkoutFormFacturacion.controls.city.errors?.required\">\r\n <span class=\"text-danger\">{{'town-city-help'|translate}}</span>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\">\r\n <!--Fila 4-->\r\n <div class=\"form-group col-12 col-md-8\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.street.enabled\">\r\n <label class=\"field-label\">{{'address'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.street.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"street\"\r\n [formControl]=\"checkoutFormFacturacion.controls['street']\" value=\"\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.street.touched && checkoutFormFacturacion.controls.street.errors?.required\">\r\n <span class=\"text-danger\">{{'address-help1'|translate}}</span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.street.touched && checkoutFormFacturacion.controls.street.errors?.maxlength\">\r\n <span class=\"text-danger\">{{'address-help2'|translate}}</span>\r\n </div>\r\n </div>\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.postcode.enabled\">\r\n <label class=\"field-label\">{{'postal-code'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.postcode.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\"\r\n name=\"postcode\" [formControl]=\"checkoutFormFacturacion.controls['postcode']\"\r\n value=\"\" placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.postcode.touched && checkoutFormFacturacion.controls.postcode.errors?.required\">\r\n <span class=\"text-danger\">{{'postal-code-help'|translate}}</span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.postcode.touched && checkoutFormFacturacion.controls.postcode.errors?.pattern\">\r\n <span class=\"text-danger\">{{postalCodeErrorMessage |translate}}</span>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"row mt-df\">\r\n <!--Fila 5-->\r\n <ng-container\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.documentType.enabled\">\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"(documentTypesFacturacion$ | async) as documentTypes\">\r\n <label class=\"field-label\">{{'document-type'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.documentType.required\"\r\n class=\"required\">*</span></label>\r\n <select name=\"documentType\" class=\"form-select\"\r\n [formControl]=\"checkoutFormFacturacion.controls['documentType']\"\r\n (change)=\"onDocumentTypesSelectedFacturacion($event.target.value)\">\r\n <!-- <option [value]=\"''\" selected>{{'document-type'|translate}}</option> -->\r\n <option *ngFor=\"let item of documentTypes\" [value]=\"item.code\">\r\n {{item.name}}</option>\r\n </select>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.documentType.touched && checkoutFormFacturacion.controls.documentType.errors?.required\">\r\n <span class=\"text-danger\">\r\n {{'type-document-help'|translate}}\r\n </span>\r\n </div>\r\n </div>\r\n <div class=\"form-group col-12 col-md-4\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.documentNumber.enabled\">\r\n <label class=\"field-label\">{{'document-number'|translate}}<span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.documentNumber.required\"\r\n class=\"required\">*</span></label>\r\n <input (change)=\"onInputChange()\" class=\"form-control\" [type]=\"'text'\"\r\n name=\"documentNumber\"\r\n [formControl]=\"checkoutFormFacturacion.controls['documentNumber']\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.documentNumber.touched && checkoutFormFacturacion.controls.documentNumber.errors?.required\">\r\n <span class=\"text-danger\">\r\n {{'document-number-help'|translate}}\r\n </span>\r\n </div>\r\n <div class=\"text-danger-container\"\r\n *ngIf=\"checkoutFormFacturacion.controls.documentNumber.touched && checkoutFormFacturacion.controls.documentNumber.errors?.pattern\">\r\n <span class=\"text-danger\">{{ documentErrorMessage | translate }}</span>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </div>\r\n <div class=\"row mt-df\" *ngIf=\"this.consts.getChannel() != 'mdj-empresa-a'\">\r\n <div class=\"form-group col-12 col-md-12\"\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.enabled\">\r\n <label class=\"field-label\"\r\n *ngIf=\"!getLabelNotesParam()\">{{'notes'|translate}} <span\r\n *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.required\"\r\n class=\"required\">*</span></label>\r\n <label class=\"field-label\" *ngIf=\"getLabelNotesParam() as labelNotesHtml\">\r\n <div [innerHTML]=\"labelNotesHtml\"></div>\r\n <span *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.required\"\r\n class=\"required\">*</span>\r\n </label>\r\n\r\n <!-- <label class=\"field-label\">{{'notes'|translate}}<span *ngIf=\"this.addressingService.getTypeForm().viewForms.notes.required\" class=\"required\">*</span></label> -->\r\n <input (change)=\"onInputChange()\" class=\"form-control\" type=\"text\" name=\"notes\"\r\n [formControl]=\"checkoutFormFacturacion.controls['notes']\" value=\"\"\r\n placeholder=\"\" autocomplete=\"off\">\r\n </div>\r\n </div>\r\n </form>\r\n </div>\r\n\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n\r\n\r\n\r\n <ng-template #template>\r\n <div class=\"modal-content\">\r\n <div class=\"modal-header\">\r\n <button type=\"button\" class=\"btn-close float-end\" aria-label=\"Close\" (click)=\"modalRef.hide()\">\r\n </button>\r\n </div>\r\n </div>\r\n\r\n <div class=\"modal-body scrol-if\">\r\n <app-section-container-ec [name]=\"'terminos-y-condiciones'\"> </app-section-container-ec>\r\n </div>\r\n\r\n </ng-template>\r\n\r\n\r\n <ng-template #addressBookNotResult>\r\n <div class=\"container\">\r\n <div class=\"row\">\r\n <div class=\"col-12 text-center my-2\">\r\n <h4> {{'address-book-not-result' | translate }} </h4>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template #addressBookLoading>\r\n <div class=\"container\">\r\n <div class=\"row\">\r\n <div class=\"col-12 text-center my-2\">\r\n <div class=\"d-flex flex-column jusitfy-content-center align-items-center\">\r\n <app-loading-full-ec></app-loading-full-ec>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </ng-template>\r\n</ng-container>\r\n\r\n<ng-template #pleaseLogin>\r\n <div class=\"container\">\r\n <p>Por favor <a [routerLink]=\"['/auth/login']\"> Inicie Sesi\u00F3n</a></p>\r\n </div>\r\n</ng-template>",
|
|
8569
8598
|
providers: [BsModalService],
|
|
8570
8599
|
styles: [".mt-df{margin:10px auto 0}.btn.btn-outline-secondary.active,.btn.btn-outline-secondary:hover{color:#fff!important}.required{color:red}.field-label{color:#000}.btn.valid-btn{background-color:#000;color:#fff;margin-right:-3px;margin-bottom:10px}label{color:#000}.input-size-lg{width:1.8rem;height:1.8rem}"]
|
|
8571
8600
|
})
|
|
@@ -9207,9 +9236,6 @@ var __decorate$V = (this && this.__decorate) || function (decorators, target, ke
|
|
|
9207
9236
|
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;
|
|
9208
9237
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
9209
9238
|
};
|
|
9210
|
-
var __param$7 = (this && this.__param) || function (paramIndex, decorator) {
|
|
9211
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
9212
|
-
};
|
|
9213
9239
|
var __read$5 = (this && this.__read) || function (o, n) {
|
|
9214
9240
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
9215
9241
|
if (!m) return o;
|
|
@@ -9232,7 +9258,7 @@ var __spread$4 = (this && this.__spread) || function () {
|
|
|
9232
9258
|
};
|
|
9233
9259
|
var CollectionEcComponent = /** @class */ (function (_super) {
|
|
9234
9260
|
__extends$n(CollectionEcComponent, _super);
|
|
9235
|
-
function CollectionEcComponent(productsService, paramsSrv, activeRoute, optionsService, authService, analyticsService, cartService, consts, filtersService
|
|
9261
|
+
function CollectionEcComponent(productsService, paramsSrv, activeRoute, optionsService, authService, analyticsService, cartService, consts, filtersService) {
|
|
9236
9262
|
var _this = _super.call(this) || this;
|
|
9237
9263
|
_this.productsService = productsService;
|
|
9238
9264
|
_this.paramsSrv = paramsSrv;
|
|
@@ -9243,21 +9269,12 @@ var CollectionEcComponent = /** @class */ (function (_super) {
|
|
|
9243
9269
|
_this.cartService = cartService;
|
|
9244
9270
|
_this.consts = consts;
|
|
9245
9271
|
_this.filtersService = filtersService;
|
|
9246
|
-
_this.router = router;
|
|
9247
9272
|
_this.filters = [];
|
|
9248
9273
|
_this.filtersConfig = { filters: [] };
|
|
9249
9274
|
_this.finished = false;
|
|
9250
9275
|
_this.loading = true;
|
|
9251
9276
|
_this.breadcrumb = [];
|
|
9252
9277
|
_this.isCollection = true;
|
|
9253
|
-
_this.usingCachedProducts = false;
|
|
9254
|
-
_this.allCachedProducts = [];
|
|
9255
|
-
_this.subscriptionsConfigured = false;
|
|
9256
|
-
_this.isScrolling = false;
|
|
9257
|
-
_this.pendingScrollPosition = null;
|
|
9258
|
-
_this.expectedProductCount = 0;
|
|
9259
|
-
_this.filtersFromCache = false; // Flag para indicar si los filtros vienen del cache
|
|
9260
|
-
_this.isCategoryChange = false; // Flag para indicar si es un cambio de categoría
|
|
9261
9278
|
_this.productsWithUniqueVariant = false;
|
|
9262
9279
|
_this.optionsFilters = ['all'];
|
|
9263
9280
|
/**
|
|
@@ -9328,117 +9345,26 @@ var CollectionEcComponent = /** @class */ (function (_super) {
|
|
|
9328
9345
|
_this.getObjectWithVariant = function () {
|
|
9329
9346
|
return _this.consts.getParamsProductsWithUniqueVariant();
|
|
9330
9347
|
};
|
|
9331
|
-
// Método personalizado para manejar selección de filtros que invalidará cache
|
|
9332
|
-
_this.customSetFilterSelected = function (filter, filterElement) {
|
|
9333
|
-
// Invalidar cache completamente cuando se selecciona un filtro
|
|
9334
|
-
_this.usingCachedProducts = false;
|
|
9335
|
-
_this.allCachedProducts = [];
|
|
9336
|
-
_this.filtersFromCache = false; // Ya no usamos filtros del cache
|
|
9337
|
-
_this.isCategoryChange = true; // Marcar como cambio para reemplazar productos
|
|
9338
|
-
CollectionEcComponent_1.stateCache.delete(_this.stateKey);
|
|
9339
|
-
console.log('🔄 Filtro seleccionado, invalidando cache y recargando desde endpoint para:', _this.stateKey);
|
|
9340
|
-
// Solo limpiar productos, NO limpiar filtros para que no desaparezcan
|
|
9341
|
-
_this.products = [];
|
|
9342
|
-
_this.loading = true;
|
|
9343
|
-
// Llamar al método original del ProductsService que iniciará una carga completa
|
|
9344
|
-
var result = _this.productsService.setFilterSelected(filter, filterElement);
|
|
9345
|
-
// La suscripción principal automáticamente actualizará los filtros
|
|
9346
|
-
// porque filtersFromCache = false y usingCachedProducts = false
|
|
9347
|
-
return result;
|
|
9348
|
-
};
|
|
9349
9348
|
_this.paramsSrv.parameters.subscribe(function (param) { return _this.params = param; });
|
|
9350
9349
|
_this.defaultFilters = _this.consts.getDefaultFilters();
|
|
9351
9350
|
_this.filtersConfig.filters = _this.consts.getFilterConfig();
|
|
9352
9351
|
_this.productsService.filtersInView$.subscribe(function (res) { return _this.filterInView = res; });
|
|
9353
|
-
// Inicializar propiedades de scroll y cache
|
|
9354
|
-
_this.platformId = platformId;
|
|
9355
|
-
_this.isRestoringState = false;
|
|
9356
|
-
_this.usingCachedProducts = false;
|
|
9357
|
-
_this.allCachedProducts = [];
|
|
9358
|
-
_this.subscriptionsConfigured = false;
|
|
9359
|
-
_this.isScrolling = false;
|
|
9360
|
-
_this.pendingScrollPosition = null;
|
|
9361
|
-
_this.expectedProductCount = 0;
|
|
9362
|
-
_this.filtersFromCache = false;
|
|
9363
9352
|
_this.ecOnConstruct();
|
|
9364
9353
|
return _this;
|
|
9365
9354
|
}
|
|
9366
|
-
CollectionEcComponent_1 = CollectionEcComponent;
|
|
9367
9355
|
CollectionEcComponent.prototype.ngOnInit = function () {
|
|
9368
|
-
|
|
9369
|
-
|
|
9370
|
-
|
|
9371
|
-
|
|
9372
|
-
// NO llamar window.scroll(0, 0) para preservar posición
|
|
9373
|
-
this.products = [];
|
|
9374
|
-
this.ecOnInit();
|
|
9375
|
-
this.getProductsAndSubscribe(); // Llamar directamente
|
|
9376
|
-
}
|
|
9377
|
-
else {
|
|
9378
|
-
// Comportamiento normal con scroll al inicio
|
|
9379
|
-
window.scroll(0, 0);
|
|
9380
|
-
this.products = [];
|
|
9381
|
-
this.ecOnInit();
|
|
9382
|
-
this.getProductsAndSubscribe();
|
|
9383
|
-
}
|
|
9384
|
-
// Configurar manejo de estado
|
|
9385
|
-
this.setupBeforeUnloadHandler();
|
|
9356
|
+
window.scroll(0, 0);
|
|
9357
|
+
this.products = [];
|
|
9358
|
+
this.ecOnInit();
|
|
9359
|
+
this.getProductsAndSubscribe();
|
|
9386
9360
|
};
|
|
9387
9361
|
CollectionEcComponent.prototype.getProductsAndSubscribe = function () {
|
|
9388
|
-
// Verificar PRIMERO si hay estado guardado
|
|
9389
|
-
var savedState = CollectionEcComponent_1.stateCache.get(this.stateKey);
|
|
9390
|
-
if (savedState && savedState.products.length > 0) {
|
|
9391
|
-
console.log('📦 Restaurando desde cache:', savedState.products.length, 'productos');
|
|
9392
|
-
// Configurar modo cache ANTES de restaurar
|
|
9393
|
-
this.usingCachedProducts = true;
|
|
9394
|
-
this.allCachedProducts = __spread$4(savedState.products);
|
|
9395
|
-
this.isRestoringState = true;
|
|
9396
|
-
// Restaurar productos inmediatamente
|
|
9397
|
-
this.products = __spread$4(savedState.products);
|
|
9398
|
-
this.finished = savedState.finished;
|
|
9399
|
-
this.loading = false;
|
|
9400
|
-
// Restaurar filtros si están disponibles
|
|
9401
|
-
if (savedState.filters) {
|
|
9402
|
-
this.filters = __spread$4(savedState.filters);
|
|
9403
|
-
this.filtersFromCache = true; // Marcar que estos filtros vienen del cache
|
|
9404
|
-
console.log('📦 Filtros restaurados desde cache:', this.filters.length);
|
|
9405
|
-
}
|
|
9406
|
-
if (savedState.filters_top) {
|
|
9407
|
-
this.filters_top = __spread$4(savedState.filters_top);
|
|
9408
|
-
console.log('📦 Filtros top restaurados desde cache:', this.filters_top.length);
|
|
9409
|
-
}
|
|
9410
|
-
if (savedState.breadcrumb) {
|
|
9411
|
-
this.breadcrumb = __spread$4(savedState.breadcrumb);
|
|
9412
|
-
console.log('📦 Breadcrumb restaurado desde cache:', this.breadcrumb);
|
|
9413
|
-
}
|
|
9414
|
-
// IMPORTANTE: Configurar TODAS las suscripciones del padre (filtros, breadcrumb, etc.)
|
|
9415
|
-
// pero SIN resetear productos ni hacer petición inicial
|
|
9416
|
-
this.setupParentSubscriptionsOnly();
|
|
9417
|
-
// Configurar suscripción personalizada para detectar cambios de categoría
|
|
9418
|
-
this.setupCustomSubscription();
|
|
9419
|
-
this.subscriptionsConfigured = true;
|
|
9420
|
-
// Restaurar scroll después de que los productos se rendericen
|
|
9421
|
-
this.waitForProductRendering(savedState.scrollPosition);
|
|
9422
|
-
return;
|
|
9423
|
-
}
|
|
9424
|
-
console.log('🔄 No hay cache, carga normal');
|
|
9425
|
-
// Si no hay estado guardado, comportamiento normal
|
|
9426
|
-
this.usingCachedProducts = false;
|
|
9427
|
-
this.allCachedProducts = [];
|
|
9428
|
-
this.filtersFromCache = false; // No hay filtros del cache
|
|
9429
|
-
// Llamar al comportamiento original
|
|
9430
|
-
this.originalGetProductsAndSubscribe();
|
|
9431
|
-
this.subscriptionsConfigured = true;
|
|
9432
|
-
};
|
|
9433
|
-
CollectionEcComponent.prototype.originalGetProductsAndSubscribe = function () {
|
|
9434
9362
|
var _this = this;
|
|
9435
9363
|
combineLatest([this.activeRoute.params, this.optionsService.ready, this.activeRoute.queryParams]).subscribe(function (_a) {
|
|
9436
9364
|
var _b = __read$5(_a, 3), params = _b[0], ready = _b[1], queryParams = _b[2];
|
|
9437
9365
|
if (ready.readyAll) {
|
|
9438
9366
|
var cambio_1 = false;
|
|
9439
9367
|
_this.products = [];
|
|
9440
|
-
// Marcar como cambio de categoría para la carga inicial
|
|
9441
|
-
_this.isCategoryChange = true;
|
|
9442
9368
|
if (!params['type'] || !params['value']) {
|
|
9443
9369
|
_this.productsService.getProductsForFilter({ latest: true, limit: 10 }, _this.optionsFilters, queryParams.search, _this.defaultFilters);
|
|
9444
9370
|
}
|
|
@@ -9469,16 +9395,7 @@ var CollectionEcComponent = /** @class */ (function (_super) {
|
|
|
9469
9395
|
}
|
|
9470
9396
|
else {
|
|
9471
9397
|
res = _this.productsService.getProductsWithUniqueVariant(res, _this.getObjectWithVariant());
|
|
9472
|
-
|
|
9473
|
-
var existingIds_1 = new Set(_this.products.map(function (p) { return p.id; }));
|
|
9474
|
-
var uniqueProducts = res.filter(function (p) { return !existingIds_1.has(p.id); });
|
|
9475
|
-
if (uniqueProducts.length > 0) {
|
|
9476
|
-
console.log('➕ CollectionEC (variants): Agregando', uniqueProducts.length, 'de', res.length, 'productos únicos');
|
|
9477
|
-
(_a = _this.products).push.apply(_a, __spread$4(uniqueProducts));
|
|
9478
|
-
}
|
|
9479
|
-
else {
|
|
9480
|
-
console.log('⚠️ CollectionEC (variants): Todos los productos ya existen - ignorando', res.length, 'productos');
|
|
9481
|
-
}
|
|
9398
|
+
(_a = _this.products).push.apply(_a, __spread$4(res));
|
|
9482
9399
|
_this.applyFiltersInView();
|
|
9483
9400
|
}
|
|
9484
9401
|
;
|
|
@@ -9490,16 +9407,7 @@ var CollectionEcComponent = /** @class */ (function (_super) {
|
|
|
9490
9407
|
cambio_1 = false;
|
|
9491
9408
|
}
|
|
9492
9409
|
else {
|
|
9493
|
-
|
|
9494
|
-
var existingIds_2 = new Set(_this.products.map(function (p) { return p.id; }));
|
|
9495
|
-
var uniqueProducts = res.filter(function (p) { return !existingIds_2.has(p.id); });
|
|
9496
|
-
if (uniqueProducts.length > 0) {
|
|
9497
|
-
console.log('➕ CollectionEC: Agregando', uniqueProducts.length, 'de', res.length, 'productos únicos');
|
|
9498
|
-
(_b = _this.products).push.apply(_b, __spread$4(uniqueProducts));
|
|
9499
|
-
}
|
|
9500
|
-
else {
|
|
9501
|
-
console.log('⚠️ CollectionEC: Todos los productos ya existen - ignorando', res.length, 'productos');
|
|
9502
|
-
}
|
|
9410
|
+
(_b = _this.products).push.apply(_b, __spread$4(res));
|
|
9503
9411
|
_this.applyFiltersInView();
|
|
9504
9412
|
}
|
|
9505
9413
|
}
|
|
@@ -9516,145 +9424,6 @@ var CollectionEcComponent = /** @class */ (function (_super) {
|
|
|
9516
9424
|
}
|
|
9517
9425
|
});
|
|
9518
9426
|
};
|
|
9519
|
-
CollectionEcComponent.prototype.setupParentSubscriptionsOnly = function () {
|
|
9520
|
-
var _this = this;
|
|
9521
|
-
var _a;
|
|
9522
|
-
// Desuscribir cualquier suscripción anterior
|
|
9523
|
-
try {
|
|
9524
|
-
(_a = this.suscripcion) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
9525
|
-
}
|
|
9526
|
-
catch (e) { }
|
|
9527
|
-
// IMPORTANTE: Configurar suscripción a productos para navegación posterior
|
|
9528
|
-
this.suscripcion = this.productsService.products$.subscribe(function (res) {
|
|
9529
|
-
var _a, _b;
|
|
9530
|
-
var _c;
|
|
9531
|
-
console.log('📦 Suscripción products$ (desde cache):', (_c = res) === null || _c === void 0 ? void 0 : _c.length, 'productos');
|
|
9532
|
-
_this.loading = false;
|
|
9533
|
-
if (res && res.length > 0) {
|
|
9534
|
-
// Si estamos usando cache, agregar solo productos nuevos únicos
|
|
9535
|
-
if (_this.usingCachedProducts) {
|
|
9536
|
-
var existingIds_3 = new Set(_this.products.map(function (p) { return p.id; }));
|
|
9537
|
-
var uniqueProducts = res.filter(function (p) { return !existingIds_3.has(p.id); });
|
|
9538
|
-
if (uniqueProducts.length > 0) {
|
|
9539
|
-
console.log('➕ Cache: Agregando', uniqueProducts.length, 'productos adicionales');
|
|
9540
|
-
(_a = _this.products).push.apply(_a, __spread$4(uniqueProducts));
|
|
9541
|
-
_this.usingCachedProducts = false; // Ya no solo cache
|
|
9542
|
-
}
|
|
9543
|
-
}
|
|
9544
|
-
else {
|
|
9545
|
-
// Determinar si es cambio de categoría o scroll infinito
|
|
9546
|
-
if (_this.isCategoryChange) {
|
|
9547
|
-
// Cambio de categoría: reemplazar completamente
|
|
9548
|
-
console.log('🔄 Cambio de categoría: Reemplazando productos completamente');
|
|
9549
|
-
if (_this.productsWithUniqueVariant) {
|
|
9550
|
-
_this.products = _this.productsService.getProductsWithUniqueVariant(res, _this.getObjectWithVariant());
|
|
9551
|
-
}
|
|
9552
|
-
else {
|
|
9553
|
-
_this.products = res;
|
|
9554
|
-
}
|
|
9555
|
-
_this.applyFiltersInView();
|
|
9556
|
-
_this.isCategoryChange = false; // Resetear bandera
|
|
9557
|
-
}
|
|
9558
|
-
else {
|
|
9559
|
-
// Scroll infinito: agregar productos únicos
|
|
9560
|
-
console.log('📜 Scroll infinito: Agregando productos únicos');
|
|
9561
|
-
var existingIds_4 = new Set(_this.products.map(function (p) { return p.id; }));
|
|
9562
|
-
var newProducts = res;
|
|
9563
|
-
if (_this.productsWithUniqueVariant) {
|
|
9564
|
-
newProducts = _this.productsService.getProductsWithUniqueVariant(res, _this.getObjectWithVariant());
|
|
9565
|
-
}
|
|
9566
|
-
var uniqueProducts = newProducts.filter(function (p) { return !existingIds_4.has(p.id); });
|
|
9567
|
-
if (uniqueProducts.length > 0) {
|
|
9568
|
-
console.log('➕ Agregando', uniqueProducts.length, 'productos únicos por scroll');
|
|
9569
|
-
(_b = _this.products).push.apply(_b, __spread$4(uniqueProducts));
|
|
9570
|
-
}
|
|
9571
|
-
else {
|
|
9572
|
-
console.log('⚠️ Todos los productos del scroll ya existen');
|
|
9573
|
-
}
|
|
9574
|
-
_this.applyFiltersInView();
|
|
9575
|
-
}
|
|
9576
|
-
}
|
|
9577
|
-
}
|
|
9578
|
-
else if (res && res.length === 0) {
|
|
9579
|
-
// Si recibimos array vacío y no estamos usando cache, limpiar productos
|
|
9580
|
-
if (!_this.usingCachedProducts) {
|
|
9581
|
-
_this.products = [];
|
|
9582
|
-
}
|
|
9583
|
-
}
|
|
9584
|
-
_this.finished = _this.productsService.isFinished();
|
|
9585
|
-
_this.analyticsService.callEvent('view_item_list', { products: _this.products, item_list_name: 'Collection', item_list_id: 0 });
|
|
9586
|
-
});
|
|
9587
|
-
// Configurar suscripciones de filtros
|
|
9588
|
-
this.productsService.filters$.subscribe(function (res) {
|
|
9589
|
-
// IMPORTANTE: Solo actualizar filtros si NO vienen del cache
|
|
9590
|
-
if (!_this.filtersFromCache) {
|
|
9591
|
-
console.log('🔄 Actualizando filtros desde server');
|
|
9592
|
-
_this.breadcrumb = _this.optionsService.getBreadcrumbByFilters(res);
|
|
9593
|
-
_this.filters = _this.getSpecificFilters(res, _this.filtersConfig.filters);
|
|
9594
|
-
_this.filters_top = _this.getSpecificFilters(res, ['sort']);
|
|
9595
|
-
}
|
|
9596
|
-
else {
|
|
9597
|
-
console.log('🚫 Saltando actualización de filtros (usando cache)');
|
|
9598
|
-
// Una vez que han sido utilizados, resetear el flag
|
|
9599
|
-
_this.filtersFromCache = false;
|
|
9600
|
-
}
|
|
9601
|
-
});
|
|
9602
|
-
this.productsService.finished().subscribe(function (res) { return _this.finished = res; });
|
|
9603
|
-
};
|
|
9604
|
-
CollectionEcComponent.prototype.setupCustomSubscription = function () {
|
|
9605
|
-
var _this = this;
|
|
9606
|
-
// Suscripción personalizada para detectar cambios de categoría/búsqueda
|
|
9607
|
-
combineLatest([this.activeRoute.params, this.optionsService.ready, this.activeRoute.queryParams]).subscribe(function (_a) {
|
|
9608
|
-
var _b = __read$5(_a, 3), params = _b[0], ready = _b[1], queryParams = _b[2];
|
|
9609
|
-
if (ready.readyAll && _this.subscriptionsConfigured) {
|
|
9610
|
-
var currentKey = _this.generateStateKey();
|
|
9611
|
-
// Si la clave cambió, significa que navegamos a una categoría diferente
|
|
9612
|
-
if (currentKey !== _this.stateKey) {
|
|
9613
|
-
console.log('🔄 Cambio de categoría detectado, invalidando cache y recargando');
|
|
9614
|
-
_this.stateKey = currentKey;
|
|
9615
|
-
// Limpiar cache y recargar normalmente
|
|
9616
|
-
_this.invalidateCache();
|
|
9617
|
-
_this.usingCachedProducts = false;
|
|
9618
|
-
_this.allCachedProducts = [];
|
|
9619
|
-
_this.filtersFromCache = false;
|
|
9620
|
-
// IMPORTANTE: Marcar que es cambio de categoría y resetear estado
|
|
9621
|
-
_this.isCategoryChange = true;
|
|
9622
|
-
_this.loading = true;
|
|
9623
|
-
_this.products = [];
|
|
9624
|
-
// Recargar normalmente - pero solo la petición, no reconfigurar suscripciones
|
|
9625
|
-
_this.loadNewCategory(params, queryParams);
|
|
9626
|
-
}
|
|
9627
|
-
}
|
|
9628
|
-
});
|
|
9629
|
-
};
|
|
9630
|
-
CollectionEcComponent.prototype.loadNewCategory = function (params, queryParams) {
|
|
9631
|
-
// Hacer solo la petición de productos sin reconfigurar todas las suscripciones
|
|
9632
|
-
var cambio = false;
|
|
9633
|
-
if (!params['type'] || !params['value']) {
|
|
9634
|
-
this.productsService.getProductsForFilter({ latest: true, limit: 10 }, this.optionsFilters, queryParams.search, this.defaultFilters);
|
|
9635
|
-
}
|
|
9636
|
-
else {
|
|
9637
|
-
this.productsService.getProductsForFilter({ type: params.type, value: params.value }, this.optionsFilters, queryParams.search, this.defaultFilters);
|
|
9638
|
-
cambio = true;
|
|
9639
|
-
this.type = params['type'];
|
|
9640
|
-
this.value = params['value'];
|
|
9641
|
-
}
|
|
9642
|
-
console.log('🔄 Nueva petición enviada para categoría:', params.type, params.value);
|
|
9643
|
-
};
|
|
9644
|
-
CollectionEcComponent.prototype.generateStateKey = function () {
|
|
9645
|
-
// Incluir ruta y parámetros para generar clave única
|
|
9646
|
-
var route = this.router.url.split('?')[0]; // Sin query params
|
|
9647
|
-
var params = this.activeRoute.snapshot.params;
|
|
9648
|
-
return route + "_" + JSON.stringify(params);
|
|
9649
|
-
};
|
|
9650
|
-
CollectionEcComponent.prototype.invalidateCache = function () {
|
|
9651
|
-
// Limpiar cache específico y sessionStorage
|
|
9652
|
-
console.log('🗑️ Invalidando cache para:', this.stateKey);
|
|
9653
|
-
CollectionEcComponent_1.stateCache.delete(this.stateKey);
|
|
9654
|
-
if (isPlatformBrowser(this.platformId)) {
|
|
9655
|
-
sessionStorage.removeItem("collection_scroll_" + this.stateKey);
|
|
9656
|
-
}
|
|
9657
|
-
};
|
|
9658
9427
|
CollectionEcComponent.prototype.onScroll = function () {
|
|
9659
9428
|
this.loading = true;
|
|
9660
9429
|
if (!this.productsService.isWaiting() && !this.productsService.getNext()) {
|
|
@@ -9662,187 +9431,6 @@ var CollectionEcComponent = /** @class */ (function (_super) {
|
|
|
9662
9431
|
this.loading = false;
|
|
9663
9432
|
}
|
|
9664
9433
|
};
|
|
9665
|
-
// Métodos de ciclo de vida requeridos
|
|
9666
|
-
CollectionEcComponent.prototype.ngAfterViewChecked = function () {
|
|
9667
|
-
var _this = this;
|
|
9668
|
-
// Solo verificar si hay un scroll pendiente
|
|
9669
|
-
if (this.pendingScrollPosition !== null && isPlatformBrowser(this.platformId)) {
|
|
9670
|
-
var productElements = document.querySelectorAll('.col-lg-3, .col-md-4, .col-6, [class*="product"], .product-item, .card');
|
|
9671
|
-
var currentProductCount = productElements.length;
|
|
9672
|
-
// Verificar si se han renderizado suficientes productos
|
|
9673
|
-
if (currentProductCount >= Math.min(this.expectedProductCount, 10)) {
|
|
9674
|
-
var targetPosition_1 = this.pendingScrollPosition;
|
|
9675
|
-
this.pendingScrollPosition = null; // Limpiar para evitar loops
|
|
9676
|
-
// Usar requestAnimationFrame para asegurar que el rendering esté completo
|
|
9677
|
-
requestAnimationFrame(function () {
|
|
9678
|
-
requestAnimationFrame(function () {
|
|
9679
|
-
_this.restoreScrollWithRetries(targetPosition_1);
|
|
9680
|
-
_this.isRestoringState = false;
|
|
9681
|
-
});
|
|
9682
|
-
});
|
|
9683
|
-
}
|
|
9684
|
-
}
|
|
9685
|
-
};
|
|
9686
|
-
CollectionEcComponent.prototype.ngOnDestroy = function () {
|
|
9687
|
-
var _a;
|
|
9688
|
-
(_a = this.routerSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
9689
|
-
this.saveCurrentState();
|
|
9690
|
-
// Limpiar scroll pendiente
|
|
9691
|
-
this.pendingScrollPosition = null;
|
|
9692
|
-
// Limpiar event listeners
|
|
9693
|
-
if (this.clickHandler) {
|
|
9694
|
-
document.removeEventListener('click', this.clickHandler);
|
|
9695
|
-
}
|
|
9696
|
-
};
|
|
9697
|
-
// Métodos de manejo de scroll y cache
|
|
9698
|
-
CollectionEcComponent.prototype.setupBeforeUnloadHandler = function () {
|
|
9699
|
-
var _this = this;
|
|
9700
|
-
if (isPlatformBrowser(this.platformId)) {
|
|
9701
|
-
// Interceptar clics en productos para guardar estado
|
|
9702
|
-
this.clickHandler = function (event) {
|
|
9703
|
-
var target = event.target;
|
|
9704
|
-
// Buscar si el clic es en un enlace a producto
|
|
9705
|
-
var link = target.closest('a[href*="/product/"]');
|
|
9706
|
-
if (link && _this.router.url.includes('/collection/')) {
|
|
9707
|
-
console.log('🎯 Clic en producto detectado, guardando estado');
|
|
9708
|
-
_this.saveCurrentState();
|
|
9709
|
-
}
|
|
9710
|
-
};
|
|
9711
|
-
document.addEventListener('click', this.clickHandler);
|
|
9712
|
-
// Guardar durante scroll en la página de colección
|
|
9713
|
-
var scrollTimer_1;
|
|
9714
|
-
window.addEventListener('scroll', function () {
|
|
9715
|
-
// Solo guardar si estamos en una página de colección
|
|
9716
|
-
if (_this.router.url.includes('/collection/')) {
|
|
9717
|
-
clearTimeout(scrollTimer_1);
|
|
9718
|
-
scrollTimer_1 = setTimeout(function () { return _this.saveCurrentState(); }, 300);
|
|
9719
|
-
}
|
|
9720
|
-
});
|
|
9721
|
-
// Guardar antes de que el usuario salga de la página
|
|
9722
|
-
window.addEventListener('beforeunload', function () {
|
|
9723
|
-
if (_this.router.url.includes('/collection/')) {
|
|
9724
|
-
_this.saveCurrentState();
|
|
9725
|
-
}
|
|
9726
|
-
});
|
|
9727
|
-
}
|
|
9728
|
-
};
|
|
9729
|
-
CollectionEcComponent.prototype.saveCurrentState = function () {
|
|
9730
|
-
if (isPlatformBrowser(this.platformId) && this.products && this.products.length > 0) {
|
|
9731
|
-
// Obtener posición de scroll de múltiples fuentes
|
|
9732
|
-
var scrollPos = Math.max(window.pageYOffset || 0, document.documentElement.scrollTop || 0, document.body.scrollTop || 0);
|
|
9733
|
-
// Solo guardar si tenemos una posición significativa o productos suficientes
|
|
9734
|
-
if (scrollPos > 10 || this.products.length > 10) {
|
|
9735
|
-
var state = {
|
|
9736
|
-
products: __spread$4(this.products),
|
|
9737
|
-
scrollPosition: scrollPos,
|
|
9738
|
-
finished: this.finished,
|
|
9739
|
-
loading: this.loading,
|
|
9740
|
-
page: Math.ceil(this.products.length / 10),
|
|
9741
|
-
allCachedProducts: this.usingCachedProducts ? __spread$4(this.allCachedProducts) : __spread$4(this.products),
|
|
9742
|
-
filters: this.filters ? __spread$4(this.filters) : undefined,
|
|
9743
|
-
filters_top: this.filters_top ? __spread$4(this.filters_top) : undefined,
|
|
9744
|
-
breadcrumb: this.breadcrumb ? __spread$4(this.breadcrumb) : undefined
|
|
9745
|
-
};
|
|
9746
|
-
CollectionEcComponent_1.stateCache.set(this.stateKey, state);
|
|
9747
|
-
// También guardar en sessionStorage como backup
|
|
9748
|
-
try {
|
|
9749
|
-
sessionStorage.setItem("collection_scroll_" + this.stateKey, scrollPos.toString());
|
|
9750
|
-
sessionStorage.setItem("collection_products_" + this.stateKey, this.products.length.toString());
|
|
9751
|
-
}
|
|
9752
|
-
catch (e) { }
|
|
9753
|
-
}
|
|
9754
|
-
}
|
|
9755
|
-
};
|
|
9756
|
-
CollectionEcComponent.prototype.restoreScrollWithRetries = function (targetPosition) {
|
|
9757
|
-
var _this = this;
|
|
9758
|
-
if (this.isScrolling) {
|
|
9759
|
-
return;
|
|
9760
|
-
}
|
|
9761
|
-
// Verificar si el target es mayor que la altura del documento
|
|
9762
|
-
var documentHeight = document.documentElement.scrollHeight;
|
|
9763
|
-
if (targetPosition > documentHeight) {
|
|
9764
|
-
targetPosition = Math.max(0, documentHeight - window.innerHeight);
|
|
9765
|
-
}
|
|
9766
|
-
// Solo verificar si el usuario ha hecho scroll muy lejos
|
|
9767
|
-
var currentPos = window.pageYOffset || document.documentElement.scrollTop;
|
|
9768
|
-
if (currentPos > 500 && Math.abs(currentPos - targetPosition) > 1000) {
|
|
9769
|
-
return;
|
|
9770
|
-
}
|
|
9771
|
-
this.isScrolling = true;
|
|
9772
|
-
// Intentar encontrar una posición más precisa basada en elementos del DOM
|
|
9773
|
-
var improvedPosition = this.tryScrollToProductByIndex(targetPosition);
|
|
9774
|
-
if (improvedPosition !== targetPosition) {
|
|
9775
|
-
targetPosition = improvedPosition;
|
|
9776
|
-
}
|
|
9777
|
-
var attempts = 0;
|
|
9778
|
-
var maxAttempts = 15;
|
|
9779
|
-
var tryScroll = function () {
|
|
9780
|
-
attempts++;
|
|
9781
|
-
// Usar scroll más agresivo si es necesario
|
|
9782
|
-
if (attempts < 3) {
|
|
9783
|
-
// Primeros intentos con smooth
|
|
9784
|
-
window.scrollTo({
|
|
9785
|
-
top: targetPosition,
|
|
9786
|
-
behavior: 'smooth'
|
|
9787
|
-
});
|
|
9788
|
-
}
|
|
9789
|
-
else {
|
|
9790
|
-
// Intentos posteriores más directos
|
|
9791
|
-
window.scrollTo(0, targetPosition);
|
|
9792
|
-
document.documentElement.scrollTop = targetPosition;
|
|
9793
|
-
document.body.scrollTop = targetPosition;
|
|
9794
|
-
}
|
|
9795
|
-
// Verificar después de un momento
|
|
9796
|
-
setTimeout(function () {
|
|
9797
|
-
var currentPos = window.pageYOffset || document.documentElement.scrollTop;
|
|
9798
|
-
var difference = Math.abs(currentPos - targetPosition);
|
|
9799
|
-
if (difference > 50 && attempts < maxAttempts) {
|
|
9800
|
-
var delay = attempts < 5 ? 100 : attempts < 10 ? 200 : 300;
|
|
9801
|
-
setTimeout(tryScroll, delay);
|
|
9802
|
-
}
|
|
9803
|
-
else {
|
|
9804
|
-
_this.isScrolling = false; // Liberar flag cuando termine
|
|
9805
|
-
}
|
|
9806
|
-
}, 100);
|
|
9807
|
-
};
|
|
9808
|
-
// Intentar solo una vez inicialmente
|
|
9809
|
-
tryScroll();
|
|
9810
|
-
};
|
|
9811
|
-
CollectionEcComponent.prototype.tryScrollToProductByIndex = function (targetPosition) {
|
|
9812
|
-
// Intentar calcular a qué producto corresponde la posición
|
|
9813
|
-
var approximateIndex = Math.floor(targetPosition / 400); // Asumiendo ~400px por producto
|
|
9814
|
-
// Buscar elementos de producto
|
|
9815
|
-
var productElements = document.querySelectorAll('.col-lg-3, .col-md-4, .col-6, [class*="product"], .product-item, .card');
|
|
9816
|
-
if (productElements.length > approximateIndex && approximateIndex >= 0) {
|
|
9817
|
-
var targetElement = productElements[approximateIndex];
|
|
9818
|
-
var elementPosition = targetElement.offsetTop;
|
|
9819
|
-
// Usar la posición del elemento si es razonable
|
|
9820
|
-
if (Math.abs(elementPosition - targetPosition) < 800) {
|
|
9821
|
-
return elementPosition;
|
|
9822
|
-
}
|
|
9823
|
-
}
|
|
9824
|
-
return targetPosition; // Usar posición original si no encuentra elemento adecuado
|
|
9825
|
-
};
|
|
9826
|
-
CollectionEcComponent.prototype.waitForProductRendering = function (targetPosition) {
|
|
9827
|
-
var _this = this;
|
|
9828
|
-
var _a;
|
|
9829
|
-
// Configurar el scroll pendiente para que ngAfterViewChecked lo maneje
|
|
9830
|
-
this.pendingScrollPosition = targetPosition;
|
|
9831
|
-
this.expectedProductCount = ((_a = this.products) === null || _a === void 0 ? void 0 : _a.length) || 0;
|
|
9832
|
-
// Timeout de seguridad en caso de que ngAfterViewChecked no se ejecute
|
|
9833
|
-
setTimeout(function () {
|
|
9834
|
-
if (_this.pendingScrollPosition !== null) {
|
|
9835
|
-
var targetPos = _this.pendingScrollPosition;
|
|
9836
|
-
_this.pendingScrollPosition = null;
|
|
9837
|
-
_this.restoreScrollWithRetries(targetPos);
|
|
9838
|
-
_this.isRestoringState = false;
|
|
9839
|
-
}
|
|
9840
|
-
}, 2000);
|
|
9841
|
-
};
|
|
9842
|
-
var CollectionEcComponent_1;
|
|
9843
|
-
// Propiedades para scroll y cache
|
|
9844
|
-
CollectionEcComponent.stateCache = new Map();
|
|
9845
|
-
CollectionEcComponent.maxCacheSize = 10;
|
|
9846
9434
|
CollectionEcComponent.ctorParameters = function () { return [
|
|
9847
9435
|
{ type: ProductsService },
|
|
9848
9436
|
{ type: ParametersService },
|
|
@@ -9852,9 +9440,7 @@ var CollectionEcComponent = /** @class */ (function (_super) {
|
|
|
9852
9440
|
{ type: AnalyticsService },
|
|
9853
9441
|
{ type: CartService },
|
|
9854
9442
|
{ type: Constants },
|
|
9855
|
-
{ type: FiltersService }
|
|
9856
|
-
{ type: Router },
|
|
9857
|
-
{ type: Object, decorators: [{ type: Inject, args: [PLATFORM_ID,] }] }
|
|
9443
|
+
{ type: FiltersService }
|
|
9858
9444
|
]; };
|
|
9859
9445
|
__decorate$V([
|
|
9860
9446
|
Input()
|
|
@@ -9868,13 +9454,12 @@ var CollectionEcComponent = /** @class */ (function (_super) {
|
|
|
9868
9454
|
__decorate$V([
|
|
9869
9455
|
Input()
|
|
9870
9456
|
], CollectionEcComponent.prototype, "optionsFilters", void 0);
|
|
9871
|
-
CollectionEcComponent =
|
|
9457
|
+
CollectionEcComponent = __decorate$V([
|
|
9872
9458
|
Component({
|
|
9873
9459
|
selector: 'app-collection-ec',
|
|
9874
9460
|
template: "\r\n<div>\r\n <div class=\"collection\">\r\n <ng-content select=\"[collection]\"> </ng-content>\r\n </div>\r\n\r\n <div class=\"all\">\r\n <ng-content select=\"[all]\"> </ng-content>\r\n </div>\r\n</div>\r\n\r\n<app-blocks-ec [section]=\"'collection'\"></app-blocks-ec>",
|
|
9875
9461
|
styles: [".h1-custom{color:#00f}"]
|
|
9876
|
-
})
|
|
9877
|
-
__param$7(10, Inject(PLATFORM_ID))
|
|
9462
|
+
})
|
|
9878
9463
|
], CollectionEcComponent);
|
|
9879
9464
|
return CollectionEcComponent;
|
|
9880
9465
|
}(ComponentHelper));
|
|
@@ -10025,7 +9610,7 @@ var __decorate$Y = (this && this.__decorate) || function (decorators, target, ke
|
|
|
10025
9610
|
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;
|
|
10026
9611
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
10027
9612
|
};
|
|
10028
|
-
var __param$
|
|
9613
|
+
var __param$7 = (this && this.__param) || function (paramIndex, decorator) {
|
|
10029
9614
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
10030
9615
|
};
|
|
10031
9616
|
/** @dynamic */
|
|
@@ -10226,7 +9811,7 @@ var FiltersEcComponent = /** @class */ (function (_super) {
|
|
|
10226
9811
|
template: "",
|
|
10227
9812
|
styles: [""]
|
|
10228
9813
|
}),
|
|
10229
|
-
__param$
|
|
9814
|
+
__param$7(1, Inject(DOCUMENT))
|
|
10230
9815
|
], FiltersEcComponent);
|
|
10231
9816
|
return FiltersEcComponent;
|
|
10232
9817
|
}(ComponentHelper));
|
|
@@ -10250,7 +9835,7 @@ var __decorate$Z = (this && this.__decorate) || function (decorators, target, ke
|
|
|
10250
9835
|
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;
|
|
10251
9836
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
10252
9837
|
};
|
|
10253
|
-
var __param$
|
|
9838
|
+
var __param$8 = (this && this.__param) || function (paramIndex, decorator) {
|
|
10254
9839
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
10255
9840
|
};
|
|
10256
9841
|
/** @dynamic */
|
|
@@ -10339,7 +9924,7 @@ var FiltersTopEcComponent = /** @class */ (function (_super) {
|
|
|
10339
9924
|
template: "",
|
|
10340
9925
|
styles: [".min-width-large{min-width:150px}"]
|
|
10341
9926
|
}),
|
|
10342
|
-
__param$
|
|
9927
|
+
__param$8(1, Inject(DOCUMENT))
|
|
10343
9928
|
], FiltersTopEcComponent);
|
|
10344
9929
|
return FiltersTopEcComponent;
|
|
10345
9930
|
}(ComponentHelper));
|
|
@@ -10916,11 +10501,28 @@ var CurrencyService = /** @class */ (function () {
|
|
|
10916
10501
|
this.getCurrencyListApi = function () { return 'shop-api/currencies'; };
|
|
10917
10502
|
this.getConvertibilityApi = function (baseCurrency, targetCurrency) { return 'shop-api/currencies?baseCurrency=' + baseCurrency + '&targetCurrency=' + targetCurrency; };
|
|
10918
10503
|
/**
|
|
10919
|
-
* @description Se carga la moneda por defecto.
|
|
10504
|
+
* @description Se carga la moneda por defecto con metadatos (símbolo, posición, decimales).
|
|
10920
10505
|
*/
|
|
10921
|
-
this.loadDefaultCurrency = function (
|
|
10922
|
-
|
|
10923
|
-
_this.
|
|
10506
|
+
this.loadDefaultCurrency = function (currencyCode) {
|
|
10507
|
+
// Trae la lista igual para tener la configuración completa
|
|
10508
|
+
_this.connection.get(_this.getCurrencyListApi()).toPromise().then(function (list) {
|
|
10509
|
+
var _a;
|
|
10510
|
+
_this.currencyListSubject.next(list);
|
|
10511
|
+
_this.consts.setCurrencyTypeConfig(list);
|
|
10512
|
+
var cfg = (_a = list) === null || _a === void 0 ? void 0 : _a.find(function (c) { return c.code === currencyCode; });
|
|
10513
|
+
if (cfg) {
|
|
10514
|
+
// Setea moneda activa con su configuración completa
|
|
10515
|
+
_this.consts.setCurrency(cfg.code, cfg);
|
|
10516
|
+
}
|
|
10517
|
+
else {
|
|
10518
|
+
_this.consts.setCurrency(currencyCode);
|
|
10519
|
+
}
|
|
10520
|
+
_this.load();
|
|
10521
|
+
}).catch(function () {
|
|
10522
|
+
// En caso de error, al menos fijá el código para no romper el flujo
|
|
10523
|
+
_this.consts.setCurrency(currencyCode);
|
|
10524
|
+
_this.load();
|
|
10525
|
+
});
|
|
10924
10526
|
};
|
|
10925
10527
|
/**
|
|
10926
10528
|
* @description calcula la convetibilidad del precio pasado por paramentro segun esta formula:
|
|
@@ -10942,12 +10544,32 @@ var CurrencyService = /** @class */ (function () {
|
|
|
10942
10544
|
});
|
|
10943
10545
|
}); };
|
|
10944
10546
|
/**
|
|
10945
|
-
*
|
|
10547
|
+
* Carga la lista de monedas desde la API y registra la configuración completa en `Constants`.
|
|
10548
|
+
*
|
|
10549
|
+
* Si no existe una moneda activa guardada en `localStorage`, inicializa la moneda activa
|
|
10550
|
+
* tomando la moneda base del canal (`ChannelConfigService.baseCurrency`) y sus metadatos
|
|
10551
|
+
* obtenidos de la lista (símbolo, posición, decimales). Si no se encuentra la base en la
|
|
10552
|
+
* lista, usa la primera disponible.
|
|
10553
|
+
*
|
|
10554
|
+
* Finalmente, llama a `load()` para propagar la configuración a los observables y (si aplica)
|
|
10555
|
+
* actualizar `localStorage`.
|
|
10556
|
+
*
|
|
10557
|
+
* @sideEffect Actualiza `currencyList$`, `Constants.setCurrencyTypeConfig` y potencialmente
|
|
10558
|
+
* `Constants.setCurrency`.
|
|
10559
|
+
* @returns void
|
|
10946
10560
|
*/
|
|
10947
10561
|
this.loadCurrencyList = function () {
|
|
10948
10562
|
_this.connection.get(_this.getCurrencyListApi()).toPromise().then(function (res) {
|
|
10563
|
+
var _a, _b, _c, _d;
|
|
10949
10564
|
_this.currencyListSubject.next(res);
|
|
10950
10565
|
_this.consts.setCurrencyTypeConfig(res);
|
|
10566
|
+
var stored = localStorage.getItem('currency');
|
|
10567
|
+
if (!stored) {
|
|
10568
|
+
var base_1 = (_a = _this.injector.get(ChannelConfigService).getActiveChannel()) === null || _a === void 0 ? void 0 : _a.baseCurrency;
|
|
10569
|
+
var cfg = (_c = (_b = res) === null || _b === void 0 ? void 0 : _b.find(function (c) { return c.code === base_1; }), (_c !== null && _c !== void 0 ? _c : (_d = res) === null || _d === void 0 ? void 0 : _d[0]));
|
|
10570
|
+
if (cfg)
|
|
10571
|
+
_this.consts.setCurrency(cfg.code, cfg);
|
|
10572
|
+
}
|
|
10951
10573
|
_this.load();
|
|
10952
10574
|
});
|
|
10953
10575
|
};
|
|
@@ -11033,7 +10655,6 @@ var CurrencyService = /** @class */ (function () {
|
|
|
11033
10655
|
}
|
|
11034
10656
|
};
|
|
11035
10657
|
this.injector.get(ChannelConfigService).channelConfig$.subscribe(function (channel) {
|
|
11036
|
-
console.log(channel);
|
|
11037
10658
|
channel.applyCurrencyExchange ? _this.loadCurrencyList() : _this.loadDefaultCurrency(channel.baseCurrency);
|
|
11038
10659
|
console.log(_this.enableApplyCurrencyExchange);
|
|
11039
10660
|
});
|
|
@@ -11601,6 +11222,22 @@ var __decorate$14 = (this && this.__decorate) || function (decorators, target, k
|
|
|
11601
11222
|
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;
|
|
11602
11223
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
11603
11224
|
};
|
|
11225
|
+
var __read$7 = (this && this.__read) || function (o, n) {
|
|
11226
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
11227
|
+
if (!m) return o;
|
|
11228
|
+
var i = m.call(o), r, ar = [], e;
|
|
11229
|
+
try {
|
|
11230
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
11231
|
+
}
|
|
11232
|
+
catch (error) { e = { error: error }; }
|
|
11233
|
+
finally {
|
|
11234
|
+
try {
|
|
11235
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
11236
|
+
}
|
|
11237
|
+
finally { if (e) throw e.error; }
|
|
11238
|
+
}
|
|
11239
|
+
return ar;
|
|
11240
|
+
};
|
|
11604
11241
|
var ProductDetailEcComponent = /** @class */ (function (_super) {
|
|
11605
11242
|
__extends$w(ProductDetailEcComponent, _super);
|
|
11606
11243
|
function ProductDetailEcComponent(productService, consts, activedRoute, cartService, optionsService, productsService, analyticsService, router, toastrService, meta, injector) {
|
|
@@ -11626,9 +11263,11 @@ var ProductDetailEcComponent = /** @class */ (function (_super) {
|
|
|
11626
11263
|
_this.showReviews = false;
|
|
11627
11264
|
_this.hidePrices = false;
|
|
11628
11265
|
_this.creditAccountShowPrices = null;
|
|
11266
|
+
_this.enableFieldNotesInArticleFile = false;
|
|
11629
11267
|
_this.addToCart = function () {
|
|
11630
11268
|
var _a;
|
|
11631
|
-
|
|
11269
|
+
var note = ((_a = _this.comments) === null || _a === void 0 ? void 0 : _a.trim()) || null;
|
|
11270
|
+
_this.quantity > 0 && _this.productService.addToCart(_this.quantity, undefined, note);
|
|
11632
11271
|
};
|
|
11633
11272
|
_this.addAllProductosToCart = function () {
|
|
11634
11273
|
var _a, _b;
|
|
@@ -11734,9 +11373,10 @@ var ProductDetailEcComponent = /** @class */ (function (_super) {
|
|
|
11734
11373
|
_this.changeImgFocus(productParam.picturesdefault[0]);
|
|
11735
11374
|
});
|
|
11736
11375
|
_this.injector.get(ChannelConfigService).channelConfig$.subscribe(function (channel) {
|
|
11737
|
-
var _a, _b;
|
|
11376
|
+
var _a, _b, _c, _d;
|
|
11738
11377
|
_this.showReviews = channel.showReviews;
|
|
11739
11378
|
_this.hidePrices = (_b = (_a = channel) === null || _a === void 0 ? void 0 : _a.hidePrices, (_b !== null && _b !== void 0 ? _b : false));
|
|
11379
|
+
_this.enableFieldNotesInArticleFile = (_d = (_c = channel) === null || _c === void 0 ? void 0 : _c.enableFieldNotesInArticleFile, (_d !== null && _d !== void 0 ? _d : false));
|
|
11740
11380
|
});
|
|
11741
11381
|
_this.cartService.showPrice$.subscribe(function (showPrice) {
|
|
11742
11382
|
_this.creditAccountShowPrices = showPrice;
|
|
@@ -11751,7 +11391,31 @@ var ProductDetailEcComponent = /** @class */ (function (_super) {
|
|
|
11751
11391
|
return cadena.replace(expresionRegular, '');
|
|
11752
11392
|
};
|
|
11753
11393
|
ProductDetailEcComponent.prototype.ngOnInit = function () {
|
|
11394
|
+
var _this = this;
|
|
11754
11395
|
this.ecOnInit();
|
|
11396
|
+
// Prellenar comentarios cuando:
|
|
11397
|
+
// - cargue el producto
|
|
11398
|
+
// - cambie la variante seleccionada (asociatedData$)
|
|
11399
|
+
// - cambien los ítems del carrito
|
|
11400
|
+
this.prefillSub = combineLatest([
|
|
11401
|
+
this.productService.product$.pipe(filter(function (p) { return !!p && !!p.id; })),
|
|
11402
|
+
this.productService.asociatedData$.pipe(startWith(null)),
|
|
11403
|
+
this.cartService.cartItems.pipe(startWith([])),
|
|
11404
|
+
]).subscribe(function (_a) {
|
|
11405
|
+
var _b = __read$7(_a, 3), product = _b[0], data = _b[1], items = _b[2];
|
|
11406
|
+
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
11407
|
+
var variantId = (_k = (_f = (_d = (_c = data) === null || _c === void 0 ? void 0 : _c.variantCode, (_d !== null && _d !== void 0 ? _d : (_e = data) === null || _e === void 0 ? void 0 : _e.variant_id)), (_f !== null && _f !== void 0 ? _f : (_j = (_h = (_g = product) === null || _g === void 0 ? void 0 : _g.variants) === null || _h === void 0 ? void 0 : _h[0]) === null || _j === void 0 ? void 0 : _j.code)), (_k !== null && _k !== void 0 ? _k : null));
|
|
11408
|
+
var match = (_l = items) === null || _l === void 0 ? void 0 : _l.find(function (it) {
|
|
11409
|
+
var _a, _b, _c, _d;
|
|
11410
|
+
return ((_b = (_a = it) === null || _a === void 0 ? void 0 : _a.product) === null || _b === void 0 ? void 0 : _b.id) === ((_c = product) === null || _c === void 0 ? void 0 : _c.id) &&
|
|
11411
|
+
(variantId ? ((_d = it) === null || _d === void 0 ? void 0 : _d.variant_id) === variantId : true);
|
|
11412
|
+
});
|
|
11413
|
+
_this.comments = (_o = (_m = match) === null || _m === void 0 ? void 0 : _m.comments, (_o !== null && _o !== void 0 ? _o : ''));
|
|
11414
|
+
});
|
|
11415
|
+
};
|
|
11416
|
+
ProductDetailEcComponent.prototype.ngOnDestroy = function () {
|
|
11417
|
+
var _a;
|
|
11418
|
+
(_a = this.prefillSub) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
11755
11419
|
};
|
|
11756
11420
|
ProductDetailEcComponent.prototype.scroll = function () {
|
|
11757
11421
|
var el = this.contact.nativeElement;
|
|
@@ -11900,7 +11564,6 @@ var ProductEcComponent = /** @class */ (function (_super) {
|
|
|
11900
11564
|
ProductEcComponent.prototype.ngOnChanges = function () {
|
|
11901
11565
|
};
|
|
11902
11566
|
ProductEcComponent.prototype.selectItem = function (product) {
|
|
11903
|
-
console.log('entro');
|
|
11904
11567
|
this.analyticsService.callEvent('select_item', product);
|
|
11905
11568
|
};
|
|
11906
11569
|
ProductEcComponent.ctorParameters = function () { return [
|
|
@@ -12421,7 +12084,7 @@ var __decorate$1a = (this && this.__decorate) || function (decorators, target, k
|
|
|
12421
12084
|
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;
|
|
12422
12085
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
12423
12086
|
};
|
|
12424
|
-
var __param$
|
|
12087
|
+
var __param$9 = (this && this.__param) || function (paramIndex, decorator) {
|
|
12425
12088
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12426
12089
|
};
|
|
12427
12090
|
var SellerDashboardContainerEcComponent = /** @class */ (function (_super) {
|
|
@@ -12538,7 +12201,7 @@ var SellerDashboardContainerEcComponent = /** @class */ (function (_super) {
|
|
|
12538
12201
|
template: "<section *ngIf=\"user\" id=\"seller-dashboard\">\r\n <div class=\"section-content mt-5 mb-2 tablaVendedores\">\r\n <div class=\"container-xl\">\r\n <div class=\"row\">\r\n <main class=\"col-md-12\">\r\n\r\n <ul *ngIf=\"hasHeader()\" class=\"nav nav-tabs\">\r\n <li class=\"nav-item col-12 col-lg-2\">\r\n <a *ngIf=\"hasUIComponent('HEADER_TAB')\" class=\"nav-link active cursor-pointer px-4\"\r\n aria-current=\"page\">\r\n {{ 'my-clients' | translate }}\r\n </a>\r\n </li>\r\n <li class=\"ms-auto row\">\r\n <div\r\n class=\"d-flex justify-content-end justify-content-lg-end justify-content-xl-end col-12 col-md-12 col-lg-auto\">\r\n <ng-container *ngIf=\"hasUIComponent('GENERATE_BUDGET_BTN') \">\r\n <a *ngIf=\"authService.getCustomer()?.id; else withoutCustomer\"\r\n [routerLink]=\"'/collection'\"\r\n class=\"btn btn-seller-primary text-white btnGestionar d-flex align-items-center\"><i\r\n class=\"bi bi-file-earmark me-2 mr-2\"></i>{{ 'generate-budget' | translate }}\r\n </a>\r\n <ng-template #withoutCustomer>\r\n <a class=\"btn btn-seller-primary text-white btnGestionar d-flex align-items-center\"\r\n (click)=\"toastrService.show('must-select-customer')\">\r\n <i class=\"bi bi-file-earmark me-2 mr-2\"></i>{{ 'generate-budget' | translate\r\n }}\r\n </a>\r\n </ng-template>\r\n </ng-container>\r\n <a *ngIf=\"hasUIComponent('MANAGE_ORDERS_BTN')\"\r\n (click)=\"navigateExternal(constants.getUrlBase())\"\r\n class=\"btn btn-seller-primary text-white btnGestionar d-flex align-items-center me- me-lg-4 mr- mr-lg-4\"><i\r\n class=\"bi bi-archive-fill me-2 mr-2\"></i>{{ 'manage-orders' | translate }}</a>\r\n </div>\r\n <div class=\"d-flex camposVendedores col-12 col-md-12 col-lg-auto justify-content-end\">\r\n <select *ngIf=\"hasUIComponent('SORT_SELECT')\" id=\"customerSort\" name=\"customerSort\"\r\n (change)=\"sortCustomers($event.target.value)\" class=\"mb-1 ordenarVendedores form-select\">\r\n <option selected hidden disabled>{{ 'order-by' | translate }}</option>\r\n <option value='asc_firstName'>{{ 'client' | translate }} (A-Z)</option>\r\n <option value='desc_firstName'>{{ 'client' | translate }} (Z-A)</option>\r\n <option value='asc_id'>Menor a Mayor c\u00F3digo</option>\r\n <option value='desc_id'>Mayor a Menor c\u00F3digo</option>\r\n </select>\r\n <form *ngIf=\"hasUIComponent('SEARCH_FORM')\"\r\n class=\"col-lg-auto mb-lg-0 d-flex ms-3 ml-3 d-flex buscadorVendedores\">\r\n <input type=\"text\" name=\"searchInput\" class=\"form-control\"\r\n placeholder=\"{{ 'search' | translate }}\" [(ngModel)]=\"searchInput\"\r\n (keyup.enter)=\"updateCustomers()\">\r\n <button class=\"btn btn-primary ms-1 ml-1 bg-white border-dark btnSearch\"><i\r\n class=\"bi bi-search text-dark\" (click)=\"updateCustomers()\"></i></button>\r\n </form>\r\n </div>\r\n </li>\r\n </ul>\r\n\r\n <ng-container *ngIf=\"user.customers?.length; else noCustomers\">\r\n\r\n <article class=\"card card-body mb-1 carritoProductoHeader m-0 py-0 mt-4\">\r\n <div class=\"row align-items-center font-bold border-bottom\">\r\n <div class=\"col-3 col-md-2 text-left\">\r\n <small>{{ 'code' | translate | uppercase }}</small>\r\n </div>\r\n <div class=\"col-5 col-md-3 mb-md-0\">\r\n <small>{{ 'client' | translate | uppercase }}</small>\r\n </div>\r\n <div class=\"col-4 col-md-3 text-left d-none d-md-block\">\r\n <small>{{ 'user' | translate | uppercase }}</small>\r\n </div>\r\n <div class=\"col-4 col-md-2 text-left\">\r\n <small>{{ 'new-orders' | translate | uppercase }}</small>\r\n </div>\r\n <div class=\"col-2 col-md-2 text-left d-none d-md-block\">\r\n <small></small>\r\n </div>\r\n\r\n </div>\r\n </article>\r\n\r\n <article *ngFor=\"let customer of filteredCustomers\" [class]=\"'card card-body mb-3 cadaVendedor ' + (isActive(customer) ? 'activo':'')\">\r\n <div class=\"row d-flex align-items-center\">\r\n <div class=\"col-3 col-md-2 text-left ps-2 pl-2\">\r\n <div class=\"price h6 pb-0 mb-0 ps-3 pl-1\">\r\n {{ customer.managementSystemInternalCode || 'n/a' }}\r\n </div>\r\n </div>\r\n <div class=\"col-5 col-md-3 text-left\">\r\n <div class=\"price h6 fw-normal ps-2 pl-2 pb-0 mb-0\">\r\n {{ customer.firstName }} {{ customer.lastName }}\r\n <p class=\"d-block d-md-none fs-6 mt-1 mb-0 p-0 userMobile\">\r\n {{ customer.email }}\r\n </p>\r\n </div>\r\n </div>\r\n <div class=\"col-4 col-md-3 text-left d-none d-md-block\">\r\n <div class=\"price h6 fw-normal pb-0 mb-0 ps-2 pl-2\">\r\n {{ customer.email }}\r\n </div>\r\n </div>\r\n <div class=\"col-4 col-md-2 text-left ps-2 pl-2\">\r\n <div *ngIf=\"true\" class=\"contNumero\">\r\n {{ customer.ordersNotApproved }}\r\n </div>\r\n </div>\r\n <div class=\"col-12 col-md-2 btnIngresar\">\r\n\r\n <ng-container\r\n *ngIf=\"authService.getCustomer()?.id == customer.id; else noActiveCustomer\">\r\n <a (click)=\"changeCustomer(null)\"\r\n class=\"btn btn-seller-primary justify-content-center\">\r\n <i class=\"bi bi-box-arrow-left me-2 mr-2\"></i>\r\n <small class=\"me-2 mr-2 d-none d-md-block\">\r\n {{ 'exit' | translate | uppercase }}\r\n </small>\r\n </a>\r\n </ng-container>\r\n <ng-template #noActiveCustomer>\r\n <a (click)=\"changeCustomer(customer)\"\r\n class=\"btn btn-seller-primary justify-content-center\">\r\n <i class=\"bi bi-box-arrow-in-right me-2 mr-2\"></i>\r\n <small class=\"me-2 mr-2 d-none d-md-block\">\r\n {{ 'operate-as' | translate | uppercase }}\r\n </small>\r\n </a>\r\n </ng-template>\r\n\r\n </div>\r\n </div>\r\n </article>\r\n\r\n </ng-container>\r\n\r\n </main>\r\n </div>\r\n </div>\r\n </div>\r\n</section>\r\n\r\n<ng-template #noCustomers>\r\n <h4 class=\"text-center p-5\">{{ 'no-customers' | translate }}</h4>\r\n</ng-template>",
|
|
12539
12202
|
styles: ["#seller-dashboard{--seller-dashboard-primary-color:0,0,0}.btn-seller-primary{color:#fff!important;background-color:rgba(var(--seller-dashboard-primary-color),1)!important;border-color:rgba(var(--seller-dashboard-primary-color),1)!important}.btn-seller-primary:hover{background-color:rgba(var(--seller-dashboard-primary-color),.9)!important}.btn-seller-primary:active{background-color:rgba(var(--seller-dashboard-primary-color),.8)!important}.btnGestionar{padding:6px 12px!important;height:36px;display:flex;align-items:center;justify-content:center;margin-left:10px}.ordenarVendedores{width:150px!important;color:#8b8b8b!important;background-color:#fff;border:1px solid #b6b6b6!important;border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;-o-border-radius:4px}.buscadorVendedores{margin-bottom:4px!important}.buscadorVendedores input{border:1px solid #b6b6b6!important;width:200px}.buscadorVendedores .btnSearch{border:1px solid #b6b6b6!important;padding:.375rem .75rem;font-size:1rem}.buscadorVendedores .btnSearch:focus{background-color:#fff!important}.carritoProductoHeader{border:none!important}.carritoProductoHeader small{font-size:13px}.cadaVendedor{padding:5px 0;margin-bottom:0!important;border:none!important;border-bottom:1px solid #ccc!important;border-radius:0!important;-webkit-border-radius:0}.cadaVendedor .btnIngresar a{padding:10px!important;border-width:1px!important;border-style:solid!important;display:flex;align-items:center;width:100%!important;margin-left:auto;color:#fff}.cadaVendedor .btnIngresar .contNumero{background-color:#eee;width:20px;height:20px;color:#000;font-size:13px;display:flex;align-items:center;justify-content:center;font-weight:600;border-radius:20px;-webkit-border-radius:20px;-moz-border-radius:20px;-ms-border-radius:20px;-o-border-radius:20px}.userMobile{font-size:14px!important;font-style:italic!important}.cadaVendedor .btnIngresar a:hover{background-color:rgba(var(--seller-dashboard-primary-color),.85)}.cadaVendedor .btnIngresar a:active{background-color:rgba(var(--seller-dashboard-primary-color),.8)}.cursor-pointer{cursor:pointer}.font-bold{font-weight:700}.border-bottom{border-bottom:1px solid #000!important}@media screen and (max-width:1200px){.btnGestionar{font-size:12px}}@media screen and (max-width:992px){.camposVendedores{justify-content:flex-end;margin-top:8px;margin-bottom:4px}}@media all and (max-width:768px){.ordenarVendedores{width:140px!important}.buscadorVendedores input{width:140px}.cadaVendedor .btnIngresar a{width:70px!important}}@media all and (max-width:576px){.tablaVendedores .nav-tabs .nav-link{font-size:13px;padding:6px!important}.btnGestionar{padding:6px 8px!important;font-size:13px;height:36px;display:flex;align-items:center;justify-content:center;margin-top:3px;margin-left:10px}.buscadorVendedores input,.ordenarVendedores{font-size:13px}}.fs-6{font-size:1rem!important}.cadaVendedor.activo{background-color:#eee}"]
|
|
12540
12203
|
}),
|
|
12541
|
-
__param$
|
|
12204
|
+
__param$9(3, Inject('env'))
|
|
12542
12205
|
], SellerDashboardContainerEcComponent);
|
|
12543
12206
|
return SellerDashboardContainerEcComponent;
|
|
12544
12207
|
}(ComponentHelper));
|
|
@@ -13145,8 +12808,8 @@ var PriceEcComponent = /** @class */ (function (_super) {
|
|
|
13145
12808
|
PriceEcComponent = __decorate$1f([
|
|
13146
12809
|
Component({
|
|
13147
12810
|
selector: 'app-price-ec',
|
|
13148
|
-
template: "<!-- Si hay templates personalizados, se proyectan -->\r\n<ng-container *ngIf=\"customSalePriceTemplate || customPriceTemplate; else defaultPriceBlock\">\r\n <ng-container *ngTemplateOutlet=\"customPriceTemplate || defaultPriceBlock\"></ng-container>\r\n</ng-container>\r\n\r\n<ng-template #defaultPriceBlock>\r\n <div *ngIf=\"saleprice; else onlyprice\" class=\"line-height-custom\">\r\n <div [class]=\"(priceSize ? 'price-sm' : 'price')\"\r\n *ngIf=\"price && price.split(' - ').length > 1; else simplePriceDel\">\r\n <del class=\"tachado\">\r\n {{ price.split(' - ')[0] | ecCurrencySymbol }}\r\n {{ price.split(' - ')[1] | ecCurrencySymbol }}\r\n </del>\r\n </div>\r\n <div [class]=\"(priceSize ? 'price-sm' : 'price')\"\r\n *ngIf=\"saleprice && saleprice.split(' - ').length > 1; else simpleSalePrice\">\r\n {{ saleprice.split(' - ')[0] | ecCurrencySymbol }}\r\n {{ saleprice.split(' - ')[1] | ecCurrencySymbol }}\r\n </div>\r\n </div>\r\n\r\n <ng-template #onlyprice>\r\n <div [class]=\"(priceSize ? 'price-sm' : 'price')\"\r\n *ngIf=\"price && price.split(' - ').length > 1; else simplePrice\">\r\n {{ price.split(' - ')[0] | ecCurrencySymbol }} -\r\n {{ price.split(' - ')[1] | ecCurrencySymbol }}\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template #simplePrice>\r\n <ng-container *ngIf=\"customSimplePriceTemplate; else fallbackSimplePrice\">\r\n <ng-container *ngTemplateOutlet=\"customSimplePriceTemplate\"></ng-container>\r\n </ng-container>\r\n </ng-template>\r\n\r\n <ng-template #fallbackSimplePrice>\r\n <div [class]=\"'uno line-height-custom ' + (priceSize ? 'price-sm' : 'price')\">\r\n {{ price | ecCurrencySymbol }}\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template #simplePriceDel>\r\n <div [class]=\"'dos line-height-custom ' + (priceSize ? 'price-sm' : 'price')\">\r\n <span class=\"lnth\">{{ price | ecCurrencySymbol }}</span>\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template #simpleSalePrice>\r\n <ng-container *ngIf=\"customSimpleSalePriceTemplate; else fallbackSimpleSalePrice\">\r\n <ng-container *ngTemplateOutlet=\"customSimpleSalePriceTemplate\"></ng-container>\r\n </ng-container>\r\n </ng-template>\r\n\r\n <ng-template #fallbackSimpleSalePrice>\r\n <div [class]=\"'tres line-height-custom ' + (priceSize ? 'price-sm' : 'price')\">\r\n {{ saleprice | ecCurrencySymbol }}\r\n </div>\r\n </ng-template>\r\n</ng-template>\r\n\r\n<!-- Secci\u00F3n de impuestos -->\r\n<ng-container *ngIf=\"shouldShowTaxes\">\r\n <ng-container *ngIf=\"showTaxLegendOnly; else detailedTaxBlock\">\r\n <ng-container *ngIf=\"customOnlyTaxLabelTemplate; else defaultOnlyTaxLabelBlock\">\r\n <ng-container *ngTemplateOutlet=\"customOnlyTaxLabelTemplate\"></ng-container>\r\n </ng-container>\r\n <ng-template #defaultOnlyTaxLabelBlock>\r\n <p class=\"taxes-title\">{{'price-without-national-taxes' | translate }}: {{ basePrice | ecCurrencySymbol }}
|
|
13149
|
-
styles: [".price-sm{font-size:13px}.price{font-size:18px}.lnth{text-decoration:line-through;color:gray}.taxes-section{margin-top:.5rem;border-radius:.5rem;font-size:.95rem;color:#333;line-height:1.4;max-width:400px}.taxes-title{font-weight:500;margin-bottom:.2rem;font-size:.7rem;color:#222}.taxes-list{list-style-type:none;padding-left:0;margin:0}.taxes-list li{margin-bottom:.05rem;font-size:.65rem;display:flex;justify-content:space-between}"]
|
|
12811
|
+
template: "<!-- Si hay templates personalizados, se proyectan -->\r\n<ng-container *ngIf=\"customSalePriceTemplate || customPriceTemplate; else defaultPriceBlock\">\r\n <ng-container *ngTemplateOutlet=\"customPriceTemplate || defaultPriceBlock\"></ng-container>\r\n</ng-container>\r\n\r\n<ng-template #defaultPriceBlock>\r\n <div *ngIf=\"saleprice; else onlyprice\" class=\"line-height-custom\">\r\n <div [class]=\"(priceSize ? 'price-sm' : 'price')\"\r\n *ngIf=\"price && price.split(' - ').length > 1; else simplePriceDel\">\r\n <del class=\"tachado\">\r\n {{ price.split(' - ')[0] | ecCurrencySymbol }}\r\n {{ price.split(' - ')[1] | ecCurrencySymbol }}\r\n </del>\r\n </div>\r\n <div [class]=\"(priceSize ? 'price-sm' : 'price')\"\r\n *ngIf=\"saleprice && saleprice.split(' - ').length > 1; else simpleSalePrice\">\r\n {{ saleprice.split(' - ')[0] | ecCurrencySymbol }}\r\n {{ saleprice.split(' - ')[1] | ecCurrencySymbol }}\r\n </div>\r\n </div>\r\n\r\n <ng-template #onlyprice>\r\n <div [class]=\"(priceSize ? 'price-sm' : 'price')\"\r\n *ngIf=\"price && price.split(' - ').length > 1; else simplePrice\">\r\n {{ price.split(' - ')[0] | ecCurrencySymbol }} -\r\n {{ price.split(' - ')[1] | ecCurrencySymbol }}\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template #simplePrice>\r\n <ng-container *ngIf=\"customSimplePriceTemplate; else fallbackSimplePrice\">\r\n <ng-container *ngTemplateOutlet=\"customSimplePriceTemplate\"></ng-container>\r\n </ng-container>\r\n </ng-template>\r\n\r\n <ng-template #fallbackSimplePrice>\r\n <div [class]=\"'uno line-height-custom ' + (priceSize ? 'price-sm' : 'price')\">\r\n {{ price | ecCurrencySymbol }}\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template #simplePriceDel>\r\n <div [class]=\"'dos line-height-custom ' + (priceSize ? 'price-sm' : 'price')\">\r\n <span class=\"lnth\">{{ price | ecCurrencySymbol }}</span>\r\n </div>\r\n </ng-template>\r\n\r\n <ng-template #simpleSalePrice>\r\n <ng-container *ngIf=\"customSimpleSalePriceTemplate; else fallbackSimpleSalePrice\">\r\n <ng-container *ngTemplateOutlet=\"customSimpleSalePriceTemplate\"></ng-container>\r\n </ng-container>\r\n </ng-template>\r\n\r\n <ng-template #fallbackSimpleSalePrice>\r\n <div [class]=\"'tres line-height-custom ' + (priceSize ? 'price-sm' : 'price')\">\r\n {{ saleprice | ecCurrencySymbol }}\r\n </div>\r\n </ng-template>\r\n</ng-template>\r\n\r\n<!-- Secci\u00F3n de impuestos -->\r\n<ng-container *ngIf=\"shouldShowTaxes\">\r\n <ng-container *ngIf=\"showTaxLegendOnly; else detailedTaxBlock\">\r\n <ng-container *ngIf=\"customOnlyTaxLabelTemplate; else defaultOnlyTaxLabelBlock\">\r\n <ng-container *ngTemplateOutlet=\"customOnlyTaxLabelTemplate\"></ng-container>\r\n </ng-container>\r\n <ng-template #defaultOnlyTaxLabelBlock>\r\n <p class=\"taxes-title\">{{'price-without-national-taxes' | translate }}: <span class=\"nowrap-price\">{{ basePrice | ecCurrencySymbol }}</span>\r\n </p>\r\n </ng-template>\r\n </ng-container>\r\n\r\n <ng-template #detailedTaxBlock>\r\n <ng-container *ngIf=\"customTaxTemplate; else defaultTaxBlock\">\r\n <ng-container *ngTemplateOutlet=\"customTaxTemplate\"></ng-container>\r\n </ng-container>\r\n </ng-template>\r\n</ng-container>\r\n\r\n<ng-template #defaultTaxBlock>\r\n <div class=\"taxes-section\">\r\n <p class=\"taxes-title\">{{'price-without-national-taxes' | translate }}: <span class=\"nowrap-price\">{{ basePrice | ecCurrencySymbol }}</span></p>\r\n <ul class=\"taxes-list\">\r\n <li>\r\n {{ taxes.Name }}: {{ taxeAmount | ecCurrencySymbol }}\r\n </li>\r\n </ul>\r\n </div>\r\n</ng-template>",
|
|
12812
|
+
styles: [".price-sm{font-size:13px}.price{font-size:18px}.lnth{text-decoration:line-through;color:gray}.taxes-section{margin-top:.5rem;border-radius:.5rem;font-size:.95rem;color:#333;line-height:1.4;max-width:400px}.taxes-title{font-weight:500;margin-bottom:.2rem;font-size:.7rem;color:#222}.taxes-list{list-style-type:none;padding-left:0;margin:0}.taxes-list li{margin-bottom:.05rem;font-size:.65rem;display:flex;justify-content:space-between}.nowrap-price{white-space:nowrap}"]
|
|
13150
12813
|
})
|
|
13151
12814
|
], PriceEcComponent);
|
|
13152
12815
|
return PriceEcComponent;
|
|
@@ -13171,7 +12834,7 @@ var __decorate$1g = (this && this.__decorate) || function (decorators, target, k
|
|
|
13171
12834
|
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;
|
|
13172
12835
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
13173
12836
|
};
|
|
13174
|
-
var __read$
|
|
12837
|
+
var __read$8 = (this && this.__read) || function (o, n) {
|
|
13175
12838
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
13176
12839
|
if (!m) return o;
|
|
13177
12840
|
var i = m.call(o), r, ar = [], e;
|
|
@@ -13215,7 +12878,7 @@ var RedsysCatchEcComponent = /** @class */ (function (_super) {
|
|
|
13215
12878
|
var _this = this;
|
|
13216
12879
|
var state;
|
|
13217
12880
|
combineLatest([this.activedRoute.params, this.activedRoute.queryParams]).subscribe(function (_a) {
|
|
13218
|
-
var _b = __read$
|
|
12881
|
+
var _b = __read$8(_a, 2), queryRouter = _b[0], queryParams = _b[1];
|
|
13219
12882
|
state = queryRouter.state;
|
|
13220
12883
|
state && state == 'statuspayment' && (state = queryParams.status);
|
|
13221
12884
|
console.log('PARAMETROS STATE -> ', state);
|
|
@@ -13298,7 +12961,7 @@ var __decorate$1h = (this && this.__decorate) || function (decorators, target, k
|
|
|
13298
12961
|
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;
|
|
13299
12962
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
13300
12963
|
};
|
|
13301
|
-
var __param$
|
|
12964
|
+
var __param$a = (this && this.__param) || function (paramIndex, decorator) {
|
|
13302
12965
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13303
12966
|
};
|
|
13304
12967
|
/** @dynamic */
|
|
@@ -13423,7 +13086,7 @@ var RedSysProEcComponent = /** @class */ (function (_super) {
|
|
|
13423
13086
|
providers: [BsModalService],
|
|
13424
13087
|
styles: [".half-width{width:49%!important}.ml-1{margin-left:1%}#card-form{height:450px}.iframeStyle{height:800px;width:100%;max-height:800px}"]
|
|
13425
13088
|
}),
|
|
13426
|
-
__param$
|
|
13089
|
+
__param$a(6, Inject(DOCUMENT))
|
|
13427
13090
|
], RedSysProEcComponent);
|
|
13428
13091
|
return RedSysProEcComponent;
|
|
13429
13092
|
}(ComponentHelper));
|
|
@@ -13976,6 +13639,7 @@ var OrderEcComponent = /** @class */ (function (_super) {
|
|
|
13976
13639
|
_this.hidePrices = false;
|
|
13977
13640
|
_this.hideDiscounts = false;
|
|
13978
13641
|
_this.hideTaxes = false;
|
|
13642
|
+
_this.enableFieldNotesInArticleFile = false;
|
|
13979
13643
|
_this.toDate = function (date, format) { return moment(date).format(!format && 'DD/MM/YYYY, h:mm:ss a' || format); };
|
|
13980
13644
|
_this.callError = function () {
|
|
13981
13645
|
_this.error = '?';
|
|
@@ -14018,7 +13682,7 @@ var OrderEcComponent = /** @class */ (function (_super) {
|
|
|
14018
13682
|
_this.callError();
|
|
14019
13683
|
};
|
|
14020
13684
|
this.channelConfigService.channelConfig$.subscribe(function (config) {
|
|
14021
|
-
var _a, _b, _c, _d, _e, _f;
|
|
13685
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
14022
13686
|
if (config && config.allowRepeatOrders !== undefined) {
|
|
14023
13687
|
_this.allowRepeatOrders = config.allowRepeatOrders;
|
|
14024
13688
|
}
|
|
@@ -14028,6 +13692,7 @@ var OrderEcComponent = /** @class */ (function (_super) {
|
|
|
14028
13692
|
_this.hidePrices = (_b = (_a = config) === null || _a === void 0 ? void 0 : _a.hidePrices, (_b !== null && _b !== void 0 ? _b : false));
|
|
14029
13693
|
_this.hideDiscounts = (_d = (_c = config) === null || _c === void 0 ? void 0 : _c.hideDiscounts, (_d !== null && _d !== void 0 ? _d : false));
|
|
14030
13694
|
_this.hideTaxes = (_f = (_e = config) === null || _e === void 0 ? void 0 : _e.hideTaxes, (_f !== null && _f !== void 0 ? _f : false));
|
|
13695
|
+
_this.enableFieldNotesInArticleFile = (_h = (_g = config) === null || _g === void 0 ? void 0 : _g.enableFieldNotesInArticleFile, (_h !== null && _h !== void 0 ? _h : false));
|
|
14031
13696
|
});
|
|
14032
13697
|
this.cartService.showPrice$.subscribe(function (showPrice) {
|
|
14033
13698
|
_this.creditAccountShowPrices = showPrice;
|
|
@@ -14053,7 +13718,7 @@ var OrderEcComponent = /** @class */ (function (_super) {
|
|
|
14053
13718
|
OrderEcComponent = __decorate$1l([
|
|
14054
13719
|
Component({
|
|
14055
13720
|
selector: 'app-order-ec',
|
|
14056
|
-
template: "<main class=\"py-5\" id=\"orderEcComponent\">\r\n <div class=\"container\">\r\n <div class=\"wrap\" *ngIf=\"!loading; else loadingView\">\r\n <div *ngIf=\"order; else noOrder\">\r\n\r\n <div class=\"row justify-content-between \">\r\n <div class=\"col-sm-auto col-12 font-brandon\">\r\n <h4 class=\"tit1 fw-bold\">{{ ('order' | translate) + ': ' + order.number }}</h4>\r\n </div>\r\n <ng-container *ngIf=\"order?.invoice\">\r\n <div class=\"col-sm col-12 font-brandon\">\r\n <a target=\"_blank\" [href]=\"consts.getUrlBase().slice(0, -1) + order.invoice\"\r\n class=\"btn btn-link btn-invoice\">\r\n <i class=\"fas fa-file-download me-1\"></i>\r\n {{ 'download' | translate }} {{ 'invoices' | translate | titlecase }}\r\n </a>\r\n </div>\r\n </ng-container>\r\n <a (click)=\"volver()\" class=\"col-auto text-end\">\r\n <button class=\"btn btvolver bg-gray text-white\">{{ 'back-to-orders' | translate }}</button>\r\n </a>\r\n </div>\r\n\r\n <section id=\"orders\">\r\n <div class=\"row pt-2\">\r\n <div class=\"col-md-2 col-12\">\r\n <p class=\"st\">{{ 'payment-state' | translate }}:</p>\r\n <p class=\"\">\r\n {{ order.payments[0].state | translate }}\r\n </p>\r\n </div>\r\n <div class=\"col-md-2 col-12 font-brandon\">\r\n <p class=\"st\">{{ 'shipment-state' | translate }}:</p>\r\n <p class=\"\">\r\n {{ order.shipments[0].state | translate }}\r\n </p>\r\n </div>\r\n <div class=\"col-md-2 col-12 font-brandon\">\r\n <p class=\"st\">{{ 'payment-method' | translate }}:</p>\r\n <p class=\"\">\r\n {{ order.payments[0]?.method?.name | translate }}\r\n </p>\r\n </div>\r\n <div class=\"col-md-2 col-12 font-brandon\">\r\n <p class=\"st\">{{ 'shipment-method' | translate }}:</p>\r\n <p class=\"\">\r\n {{ order.shipments[0].method.name }}\r\n </p>\r\n <!-- ACA DEBERIA IR EL LINK DE SEGUIMIENTO -->\r\n <a *ngIf=\"order.tracking\" [href]=\"order.tracking\"\r\n class=\"btn btn-outline-dark btnLogout px-3 py-1 font-size-10 w-auto btn-sm\">Ver\r\n seguimiento</a>\r\n </div>\r\n <div class=\"col-md-2 col-12 font-brandon\">\r\n <p class=\"st\">{{ 'date' | translate }}:</p>\r\n <p class=\"\">\r\n {{ toDate(order.checkoutCompletedAt, 'DD/MM/YYYY') | translate }}<br>\r\n {{ toDate(order.checkoutCompletedAt, 'h:mm:ss a') | translate }}\r\n </p>\r\n </div>\r\n <div class=\"col-md-2 col-12 font-brandon\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n <p class=\"st\">{{ 'total' | translate }}:</p>\r\n <h5 class=\"fw-bold\">\r\n {{ (order.totals.total) | ecCurrencySymbol:'alwaysShowDecimals'}}\r\n\r\n </h5>\r\n </div>\r\n </div>\r\n </section>\r\n\r\n <div class=\"text-end mt-3\" *ngIf=\"!hidePrices && allowRepeatOrders\">\r\n <button class=\"btn btn-primary mb-2\" (click)=\"repeatOrder()\">\r\n {{ 'repeat-order' | translate }}\r\n </button>\r\n </div>\r\n\r\n <div class=\"container py-3 border-top border-bottom\">\r\n <div *ngIf=\"order.items.length; else noProducts\" class=\"row\">\r\n <div class=\"col-2 font-sm font-brandon d-none d-md-block\">\r\n {{ 'product' | translate | uppercase }}\r\n </div>\r\n <div class=\"col-4 font-sm font-brandon d-none d-md-block\">\r\n {{ 'description' | translate | uppercase }}\r\n </div>\r\n <div id=\"colLots\" *ngIf=\"ordersService.channelConfig.applyOrderLot\"\r\n class=\"col-1 font-sm font-brandon d-none d-md-block\">\r\n <!-- {{ 'description' | translate | uppercase }} -->\r\n {{ 'lots' | translate | uppercase }}\r\n </div>\r\n <div class=\"col-2 text-center font-sm font-brandon d-none d-md-block\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n {{ 'unit-price' | translate | uppercase }}\r\n </div>\r\n <div class=\"col-1 text-center font-sm font-brandon d-none d-md-block\">\r\n {{ 'quantity' | translate | uppercase }}\r\n </div>\r\n <div class=\"col-2 text-end font-sm font-brandon d-none d-md-block\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n {{ 'total' | translate | uppercase }}\r\n </div>\r\n </div>\r\n <ng-container *ngFor=\"let item of order.items; let i = index\">\r\n <div class=\"row cart-items\">\r\n <div class=\"col-5 col-md-2 py-2\">\r\n <ng-container *ngIf=\"item.product.variants[0]?.images?.length ; else defaultpicture\">\r\n <img class=\"smc maxwidth img-fluid rounded-custom \"\r\n [src]=\"consts.mediaUrl() + item.product.variants[0].images[0]\" alt=\"\">\r\n </ng-container>\r\n <ng-template #defaultpicture>\r\n <img *ngIf=\"item.product.picturesdefault\"\r\n class=\"smc maxwidth img-fluid rounded-custom\"\r\n [src]=\"consts.mediaUrl() + item.product.picturesdefault[0]\" alt=\"\">\r\n </ng-template>\r\n </div> \r\n <div\r\n class=\"col-md-4 col-7 d-flex flex-column justify-content-center\">\r\n <p class=\"font-brandon d-flex w-100 mb-0\">\r\n {{ item.product.name }} (Cod:{{ item.product.variants[0].code }})\r\n </p>\r\n <p *ngIf=\"item.comments\" class=\"comment-truncated fst-italic small text-muted mt-1\">\r\n \"{{ item.comments }}\"\r\n </p>\r\n </div>\r\n <div class=\"col-md-1 col-1 flex-column flex-md-row justify-content-start d-flex align-items-center\"\r\n *ngIf=\"ordersService.channelConfig.applyOrderLot\">\r\n <input type=\"button\" class=\"btn btn-primary btnSeguir m-0 text-center\" type=\"button\"\r\n [attr.data-bs-toggle]=\"'collapse'\" [attr.data-bs-target]=\"'#collapseExample'+i\"\r\n aria-expanded=\"false\" [attr.aria-controls]=\"'collapseExample'+i\"\r\n value=\"{{ 'see' | translate | uppercase }}\">\r\n </div>\r\n <div class=\"container d-md-none\">\r\n <div class=\"row\">\r\n <div class=\"col-4\">\r\n <p class=\"text-center w-100 m-0\"> {{ item.quantity }}</p>\r\n </div>\r\n <div class=\"col-4 font-xl\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n <p class=\"text-center w-100 m-0\"> {{ (item.product.variants[0].saleprice ?\r\n item.product.variants[0].saleprice : item.product.variants[0].price) |\r\n ecCurrencySymbol:'alwaysShowDecimals'}}</p>\r\n </div>\r\n <div class=\"col-4 font-xl\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n <p class=\"text-center w-100 m-0\"> {{ ((item.product.variants[0].saleprice ?\r\n item.product.variants[0].saleprice : item.product.variants[0].price) *\r\n item.quantity) | ecCurrencySymbol:'alwaysShowDecimals'}}</p>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"col-2 d-none d-md-flex align-items-center\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n <p class=\"text-center w-100 m-0\">\r\n {{ (item.product.variants[0].saleprice ? item.product.variants[0].saleprice :\r\n item.product.variants[0].price) | ecCurrencySymbol:'alwaysShowDecimals'}}\r\n </p>\r\n </div>\r\n <div class=\"col-1 d-none d-md-flex align-items-center\">\r\n <p class=\"text-center w-100 m-0\"> {{ item.quantity }}</p>\r\n </div>\r\n <div class=\"col-2 d-none d-md-flex align-items-center\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n <p class=\"text-end w-100 m-0\">\r\n {{ ((item.product.variants[0].saleprice ? item.product.variants[0].saleprice :\r\n item.product.variants[0].price) * item.quantity) | ecCurrencySymbol:'alwaysShowDecimals'}}</p>\r\n </div>\r\n <div class=\"collapse\" [attr.id]=\"'collapseExample'+i\">\r\n <div class=\"card card-body\">\r\n <table class=\"table table-striped\">\r\n <thead>\r\n <tr>\r\n <th scope=\"col\">#</th>\r\n <th scope=\"col\">Estado</th>\r\n <th scope=\"col\">Cantidad</th>\r\n <th scope=\"col\">Fecha Solicitada</th>\r\n <th scope=\"col\">Fecha Estimada</th>\r\n <th scope=\"col\">Sede</th>\r\n <th scope=\"col\">Nota</th>\r\n <th scope=\"col\">Total Lote</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <ng-container *ngFor=\"let lot of item.orderItemLot\">\r\n <tr>\r\n <th scope=\"row\">{{lot.id}}</th>\r\n <td>{{lot.lot_status}}</td>\r\n <td>{{lot.quantity}}</td>\r\n <td>{{ toDate(lot.date_request, 'DD/MM/YYYY') | translate }}</td>\r\n <td *ngIf=\"lot.date_deliver; else sinFechaEstimada\">{{\r\n toDate(lot.date_deliver, 'DD/MM/YYYY') | translate }}</td>\r\n <ng-template #sinFechaEstimada>\r\n <td>Pendiente</td>\r\n </ng-template>\r\n <td>{{lot.shipping_address_name}}</td>\r\n <td>{{lot.notes}}</td>\r\n <td>{{lot.total_lot | ecCurrencySymbol:'alwaysShowDecimals'}}</td>\r\n </tr>\r\n </ng-container>\r\n </tbody>\r\n </table>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n </ng-container>\r\n </div>\r\n\r\n <div class=\"container\">\r\n <div class=\"row\">\r\n <div class=\"col-12 col-md-6\"></div>\r\n <div class=\"col-12 col-md-6\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n <div class=\"row py-4\">\r\n <div class=\"col-6 font-brandon font-md text-gray border-bottom \">{{ 'total-products' |\r\n translate }}</div>\r\n <div class=\"col-6 font-brandon font-md text-gray border-bottom text-end\">\r\n {{ (order.totals.subtotal) | ecCurrencySymbol:'alwaysShowDecimals' }}\r\n </div>\r\n\r\n <div class=\"col-6 font-brandon font-md text-gray border-bottom \">{{ 'shipment' |\r\n translate }}</div>\r\n <div class=\"col-6 font-brandon font-md text-gray border-bottom text-end\">\r\n {{ (order.totals.shipping || '0') | ecCurrencySymbol:'alwaysShowDecimals' }}\r\n\r\n </div>\r\n\r\n <div *ngIf=\"!hideDiscounts && order.totals.promotion && order.totals.promotion != 0\"\r\n class=\"col-6 font-brandon font-md text-gray border-bottom \">{{ 'discount' |\r\n translate }}</div>\r\n <div *ngIf=\"!hideDiscounts && order.totals.promotion && order.totals.promotion != 0\"\r\n class=\"col-6 font-brandon font-md text-gray border-bottom text-end text-end\">\r\n {{ (order.totals.promotion) | ecCurrencySymbol:'alwaysShowDecimals' }}</div>\r\n\r\n <div *ngIf=\"!hideTaxes && order.totals.taxes && order.totals.taxes != 0 \"\r\n class=\"col-6 font-brandon font-md text-gray border-bottom \">\r\n {{ 'taxes' | translate }}</div>\r\n <div *ngIf=\"!hideTaxes && order.totals.taxes && order.totals.taxes != 0\"\r\n class=\"col-6 font-brandon font-md text-gray border-bottom text-end\">\r\n {{ (order.totals.taxes) | ecCurrencySymbol:'alwaysShowDecimals' }}</div>\r\n\r\n <div class=\"col-6 font-brandon font-md\">{{ 'total' | translate | uppercase }}</div>\r\n <div class=\"col-6 font-brandon font-md text-end\">\r\n {{ (order.totals.total) | ecCurrencySymbol:'alwaysShowDecimals' }}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n</main>\r\n\r\n<ng-template #noOrder>\r\n <div class=\"w-100 h-50\">\r\n <div class=\"d-flex flex-row justify-content-center align-items-center text-center\">\r\n <h5>{{ 'no-orders' | translate }}</h5>\r\n </div>\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #loadingView>\r\n <div class=\"w-100 h-50 py-5\">\r\n <div class=\"d-flex flex-row justify-content-center align-items-center text-center\">\r\n <app-loading-full-ec></app-loading-full-ec>\r\n </div>\r\n </div>\r\n</ng-template>",
|
|
13721
|
+
template: "<main class=\"py-5\" id=\"orderEcComponent\">\r\n <div class=\"container\">\r\n <div class=\"wrap\" *ngIf=\"!loading; else loadingView\">\r\n <div *ngIf=\"order; else noOrder\">\r\n\r\n <div class=\"row justify-content-between \">\r\n <div class=\"col-sm-auto col-12 font-brandon\">\r\n <h4 class=\"tit1 fw-bold\">{{ ('order' | translate) + ': ' + order.number }}</h4>\r\n </div>\r\n <ng-container *ngIf=\"order?.invoice\">\r\n <div class=\"col-sm col-12 font-brandon\" *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n <a target=\"_blank\" [href]=\"consts.getUrlBase().slice(0, -1) + order.invoice\"\r\n class=\"btn btn-link btn-invoice\">\r\n <i class=\"fas fa-file-download me-1\"></i>\r\n {{ 'download' | translate }} {{ 'invoices' | translate | titlecase }}\r\n </a>\r\n </div>\r\n </ng-container>\r\n <a (click)=\"volver()\" class=\"col-auto text-end\">\r\n <button class=\"btn btvolver bg-gray text-white\">{{ 'back-to-orders' | translate }}</button>\r\n </a>\r\n </div>\r\n\r\n <section id=\"orders\">\r\n <div class=\"row pt-2\">\r\n <div class=\"col-md-2 col-12\">\r\n <p class=\"st\">{{ 'payment-state' | translate }}:</p>\r\n <p class=\"\">\r\n {{ order.payments[0].state | translate }}\r\n </p>\r\n </div>\r\n <div class=\"col-md-2 col-12 font-brandon\">\r\n <p class=\"st\">{{ 'shipment-state' | translate }}:</p>\r\n <p class=\"\">\r\n {{ order.shipments[0].state | translate }}\r\n </p>\r\n </div>\r\n <div class=\"col-md-2 col-12 font-brandon\">\r\n <p class=\"st\">{{ 'payment-method' | translate }}:</p>\r\n <p class=\"\">\r\n {{ order.payments[0]?.method?.name | translate }}\r\n </p>\r\n </div>\r\n <div class=\"col-md-2 col-12 font-brandon\">\r\n <p class=\"st\">{{ 'shipment-method' | translate }}:</p>\r\n <p class=\"\">\r\n {{ order.shipments[0].method.name }}\r\n </p>\r\n <!-- ACA DEBERIA IR EL LINK DE SEGUIMIENTO -->\r\n <a *ngIf=\"order.tracking\" [href]=\"order.tracking\"\r\n class=\"btn btn-outline-dark btnLogout px-3 py-1 font-size-10 w-auto btn-sm\">Ver\r\n seguimiento</a>\r\n </div>\r\n <div class=\"col-md-2 col-12 font-brandon\">\r\n <p class=\"st\">{{ 'date' | translate }}:</p>\r\n <p class=\"\">\r\n {{ toDate(order.checkoutCompletedAt, 'DD/MM/YYYY') | translate }}<br>\r\n {{ toDate(order.checkoutCompletedAt, 'h:mm:ss a') | translate }}\r\n </p>\r\n </div>\r\n <div class=\"col-md-2 col-12 font-brandon\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n <p class=\"st\">{{ 'total' | translate }}:</p>\r\n <h5 class=\"fw-bold\">\r\n {{ (order.totals.total) | ecCurrencySymbol:'alwaysShowDecimals'}}\r\n\r\n </h5>\r\n </div>\r\n </div>\r\n </section>\r\n\r\n <div class=\"text-end mt-3\" *ngIf=\"!hidePrices && allowRepeatOrders\">\r\n <button class=\"btn btn-primary mb-2\" (click)=\"repeatOrder()\">\r\n {{ 'repeat-order' | translate }}\r\n </button>\r\n </div>\r\n\r\n <div class=\"container py-3 border-top border-bottom\">\r\n <div *ngIf=\"order.items.length; else noProducts\" class=\"row\">\r\n <div class=\"col-2 font-sm font-brandon d-none d-md-block\">\r\n {{ 'product' | translate | uppercase }}\r\n </div>\r\n <div class=\"col-4 font-sm font-brandon d-none d-md-block\">\r\n {{ 'description' | translate | uppercase }}\r\n </div>\r\n <div id=\"colLots\" *ngIf=\"ordersService.channelConfig.applyOrderLot\"\r\n class=\"col-1 font-sm font-brandon d-none d-md-block\">\r\n <!-- {{ 'description' | translate | uppercase }} -->\r\n {{ 'lots' | translate | uppercase }}\r\n </div>\r\n <div class=\"col-2 text-center font-sm font-brandon d-none d-md-block\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n {{ 'unit-price' | translate | uppercase }}\r\n </div>\r\n <div class=\"col-1 text-center font-sm font-brandon d-none d-md-block\">\r\n {{ 'quantity' | translate | uppercase }}\r\n </div>\r\n <div class=\"col-2 text-end font-sm font-brandon d-none d-md-block\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n {{ 'total' | translate | uppercase }}\r\n </div>\r\n </div>\r\n <ng-container *ngFor=\"let item of order.items; let i = index\">\r\n <div class=\"row cart-items\">\r\n <div class=\"col-5 col-md-2 py-2\">\r\n <ng-container *ngIf=\"item.product.variants[0]?.images?.length ; else defaultpicture\">\r\n <img class=\"smc maxwidth img-fluid rounded-custom \"\r\n [src]=\"consts.mediaUrl() + item.product.variants[0].images[0]\" alt=\"\">\r\n </ng-container>\r\n <ng-template #defaultpicture>\r\n <img *ngIf=\"item.product.picturesdefault\"\r\n class=\"smc maxwidth img-fluid rounded-custom\"\r\n [src]=\"consts.mediaUrl() + item.product.picturesdefault[0]\" alt=\"\">\r\n </ng-template>\r\n </div> \r\n <div\r\n class=\"col-md-4 col-7 d-flex flex-column justify-content-center\">\r\n <p class=\"font-brandon d-flex w-100 mb-0\">\r\n {{ item.product.name }} (Cod:{{ item.product.variants[0].code }})\r\n </p>\r\n <p *ngIf=\"enableFieldNotesInArticleFile && item.comments\" class=\"comment-truncated fst-italic small text-muted mt-1\">\r\n \"{{ item.comments }}\"\r\n </p>\r\n </div>\r\n <div class=\"col-md-1 col-1 flex-column flex-md-row justify-content-start d-flex align-items-center\"\r\n *ngIf=\"ordersService.channelConfig.applyOrderLot\">\r\n <input type=\"button\" class=\"btn btn-primary btnSeguir m-0 text-center\" type=\"button\"\r\n [attr.data-bs-toggle]=\"'collapse'\" [attr.data-bs-target]=\"'#collapseExample'+i\"\r\n aria-expanded=\"false\" [attr.aria-controls]=\"'collapseExample'+i\"\r\n value=\"{{ 'see' | translate | uppercase }}\">\r\n </div>\r\n <div class=\"container d-md-none\">\r\n <div class=\"row\">\r\n <div class=\"col-4\">\r\n <p class=\"text-center w-100 m-0\"> {{ item.quantity }}</p>\r\n </div>\r\n <div class=\"col-4 font-xl\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n <p class=\"text-center w-100 m-0\"> {{ (item.product.variants[0].saleprice ?\r\n item.product.variants[0].saleprice : item.product.variants[0].price) |\r\n ecCurrencySymbol:'alwaysShowDecimals'}}</p>\r\n </div>\r\n <div class=\"col-4 font-xl\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n <p class=\"text-center w-100 m-0\"> {{ ((item.product.variants[0].saleprice ?\r\n item.product.variants[0].saleprice : item.product.variants[0].price) *\r\n item.quantity) | ecCurrencySymbol:'alwaysShowDecimals'}}</p>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"col-2 d-none d-md-flex align-items-center\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n <p class=\"text-center w-100 m-0\">\r\n {{ (item.product.variants[0].saleprice ? item.product.variants[0].saleprice :\r\n item.product.variants[0].price) | ecCurrencySymbol:'alwaysShowDecimals'}}\r\n </p>\r\n </div>\r\n <div class=\"col-1 d-none d-md-flex align-items-center\">\r\n <p class=\"text-center w-100 m-0\"> {{ item.quantity }}</p>\r\n </div>\r\n <div class=\"col-2 d-none d-md-flex align-items-center\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n <p class=\"text-end w-100 m-0\">\r\n {{ ((item.product.variants[0].saleprice ? item.product.variants[0].saleprice :\r\n item.product.variants[0].price) * item.quantity) | ecCurrencySymbol:'alwaysShowDecimals'}}</p>\r\n </div>\r\n <div class=\"collapse\" [attr.id]=\"'collapseExample'+i\">\r\n <div class=\"card card-body\">\r\n <table class=\"table table-striped\">\r\n <thead>\r\n <tr>\r\n <th scope=\"col\">#</th>\r\n <th scope=\"col\">Estado</th>\r\n <th scope=\"col\">Cantidad</th>\r\n <th scope=\"col\">Fecha Solicitada</th>\r\n <th scope=\"col\">Fecha Estimada</th>\r\n <th scope=\"col\">Sede</th>\r\n <th scope=\"col\">Nota</th>\r\n <th scope=\"col\">Total Lote</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <ng-container *ngFor=\"let lot of item.orderItemLot\">\r\n <tr>\r\n <th scope=\"row\">{{lot.id}}</th>\r\n <td>{{lot.lot_status}}</td>\r\n <td>{{lot.quantity}}</td>\r\n <td>{{ toDate(lot.date_request, 'DD/MM/YYYY') | translate }}</td>\r\n <td *ngIf=\"lot.date_deliver; else sinFechaEstimada\">{{\r\n toDate(lot.date_deliver, 'DD/MM/YYYY') | translate }}</td>\r\n <ng-template #sinFechaEstimada>\r\n <td>Pendiente</td>\r\n </ng-template>\r\n <td>{{lot.shipping_address_name}}</td>\r\n <td>{{lot.notes}}</td>\r\n <td>{{lot.total_lot | ecCurrencySymbol:'alwaysShowDecimals'}}</td>\r\n </tr>\r\n </ng-container>\r\n </tbody>\r\n </table>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n </ng-container>\r\n </div>\r\n\r\n <div class=\"container\">\r\n <div class=\"row\">\r\n <div class=\"col-12 col-md-6\"></div>\r\n <div class=\"col-12 col-md-6\"\r\n *ngIf=\"(creditAccountShowPrices !== null ? creditAccountShowPrices : true)\">\r\n <div class=\"row py-4\">\r\n <div class=\"col-6 font-brandon font-md text-gray border-bottom \">{{ 'total-products' |\r\n translate }}</div>\r\n <div class=\"col-6 font-brandon font-md text-gray border-bottom text-end\">\r\n {{ (order.totals.subtotal) | ecCurrencySymbol:'alwaysShowDecimals' }}\r\n </div>\r\n\r\n <div class=\"col-6 font-brandon font-md text-gray border-bottom \">{{ 'shipment' |\r\n translate }}</div>\r\n <div class=\"col-6 font-brandon font-md text-gray border-bottom text-end\">\r\n {{ (order.totals.shipping || '0') | ecCurrencySymbol:'alwaysShowDecimals' }}\r\n\r\n </div>\r\n\r\n <div *ngIf=\"!hideDiscounts && order.totals.promotion && order.totals.promotion != 0\"\r\n class=\"col-6 font-brandon font-md text-gray border-bottom \">{{ 'discount' |\r\n translate }}</div>\r\n <div *ngIf=\"!hideDiscounts && order.totals.promotion && order.totals.promotion != 0\"\r\n class=\"col-6 font-brandon font-md text-gray border-bottom text-end text-end\">\r\n {{ (order.totals.promotion) | ecCurrencySymbol:'alwaysShowDecimals' }}</div>\r\n\r\n <div *ngIf=\"!hideTaxes && order.totals.taxes && order.totals.taxes != 0 \"\r\n class=\"col-6 font-brandon font-md text-gray border-bottom \">\r\n {{ 'taxes' | translate }}</div>\r\n <div *ngIf=\"!hideTaxes && order.totals.taxes && order.totals.taxes != 0\"\r\n class=\"col-6 font-brandon font-md text-gray border-bottom text-end\">\r\n {{ (order.totals.taxes) | ecCurrencySymbol:'alwaysShowDecimals' }}</div>\r\n\r\n <div class=\"col-6 font-brandon font-md\">{{ 'total' | translate | uppercase }}</div>\r\n <div class=\"col-6 font-brandon font-md text-end\">\r\n {{ (order.totals.total) | ecCurrencySymbol:'alwaysShowDecimals' }}\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n</main>\r\n\r\n<ng-template #noOrder>\r\n <div class=\"w-100 h-50\">\r\n <div class=\"d-flex flex-row justify-content-center align-items-center text-center\">\r\n <h5>{{ 'no-orders' | translate }}</h5>\r\n </div>\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #loadingView>\r\n <div class=\"w-100 h-50 py-5\">\r\n <div class=\"d-flex flex-row justify-content-center align-items-center text-center\">\r\n <app-loading-full-ec></app-loading-full-ec>\r\n </div>\r\n </div>\r\n</ng-template>",
|
|
14057
13722
|
styles: [".maxwidth{max-width:100px}.comment-truncated{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;text-overflow:ellipsis;white-space:normal;max-height:3em}"]
|
|
14058
13723
|
})
|
|
14059
13724
|
], OrderEcComponent);
|
|
@@ -15836,12 +15501,10 @@ var PaypalExpressEcComponent = /** @class */ (function (_super) {
|
|
|
15836
15501
|
_this.loading = false;
|
|
15837
15502
|
}
|
|
15838
15503
|
else {
|
|
15839
|
-
/* console.log('Entro al else'); */
|
|
15840
15504
|
_this.renderPayPal();
|
|
15841
15505
|
}
|
|
15842
15506
|
}
|
|
15843
15507
|
catch (error) {
|
|
15844
|
-
/* console.log('Entro al catch'); */
|
|
15845
15508
|
_this.renderPayPal();
|
|
15846
15509
|
}
|
|
15847
15510
|
}, 1000);
|
|
@@ -16514,7 +16177,7 @@ var __decorate$1D = (this && this.__decorate) || function (decorators, target, k
|
|
|
16514
16177
|
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;
|
|
16515
16178
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
16516
16179
|
};
|
|
16517
|
-
var __read$
|
|
16180
|
+
var __read$9 = (this && this.__read) || function (o, n) {
|
|
16518
16181
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
16519
16182
|
if (!m) return o;
|
|
16520
16183
|
var i = m.call(o), r, ar = [], e;
|
|
@@ -16546,7 +16209,7 @@ var CartLoadEcComponent = /** @class */ (function (_super) {
|
|
|
16546
16209
|
var _this = this;
|
|
16547
16210
|
var token;
|
|
16548
16211
|
combineLatest([this.activedRoute.params, this.activedRoute.queryParams]).subscribe(function (_a) {
|
|
16549
|
-
var _b = __read$
|
|
16212
|
+
var _b = __read$9(_a, 2), queryRouter = _b[0], queryParams = _b[1];
|
|
16550
16213
|
token = queryRouter.token;
|
|
16551
16214
|
console.log('PARAMETROS token -> ', token);
|
|
16552
16215
|
_this.cartService.loadCartByToken(token).then(function (res) {
|
|
@@ -19628,6 +19291,7 @@ var SidebarEcComponent = /** @class */ (function () {
|
|
|
19628
19291
|
this.creditAccountShowPrices = null;
|
|
19629
19292
|
this.showTaxLegend = false;
|
|
19630
19293
|
this.cartLoading = false;
|
|
19294
|
+
this.enableFieldNotesInArticleFile = false;
|
|
19631
19295
|
this.getVariants = function (product) {
|
|
19632
19296
|
var item = product.product;
|
|
19633
19297
|
if (item.variants && item.variants.length && item.variants[0].options && item.variants[0].options.length) {
|
|
@@ -19677,10 +19341,11 @@ var SidebarEcComponent = /** @class */ (function () {
|
|
|
19677
19341
|
_this.user = u;
|
|
19678
19342
|
});
|
|
19679
19343
|
this.channelConfigService.channelConfig$.subscribe(function (channel) {
|
|
19680
|
-
var _a, _b, _c, _d, _e, _f;
|
|
19344
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
19681
19345
|
_this.hideDiscounts = (_b = (_a = channel) === null || _a === void 0 ? void 0 : _a.hideDiscounts, (_b !== null && _b !== void 0 ? _b : false));
|
|
19682
19346
|
_this.hideTaxes = (_d = (_c = channel) === null || _c === void 0 ? void 0 : _c.hideTaxes, (_d !== null && _d !== void 0 ? _d : false));
|
|
19683
19347
|
_this.showTaxLegend = (_f = (_e = channel) === null || _e === void 0 ? void 0 : _e.showTaxLegend, (_f !== null && _f !== void 0 ? _f : false));
|
|
19348
|
+
_this.enableFieldNotesInArticleFile = (_h = (_g = channel) === null || _g === void 0 ? void 0 : _g.enableFieldNotesInArticleFile, (_h !== null && _h !== void 0 ? _h : false));
|
|
19684
19349
|
});
|
|
19685
19350
|
this.cartService.showPrice$.subscribe(function (showPrice) {
|
|
19686
19351
|
_this.creditAccountShowPrices = showPrice;
|
|
@@ -19690,7 +19355,7 @@ var SidebarEcComponent = /** @class */ (function () {
|
|
|
19690
19355
|
});
|
|
19691
19356
|
};
|
|
19692
19357
|
SidebarEcComponent.prototype.actualizarCantidad = function (item, cantidad, stock, id) {
|
|
19693
|
-
var _a;
|
|
19358
|
+
var _a, _b, _c;
|
|
19694
19359
|
if (this.cartLoading) {
|
|
19695
19360
|
return;
|
|
19696
19361
|
}
|
|
@@ -19710,13 +19375,14 @@ var SidebarEcComponent = /** @class */ (function () {
|
|
|
19710
19375
|
newQuantity = Math.round(newQuantity / step) * step;
|
|
19711
19376
|
}
|
|
19712
19377
|
}
|
|
19378
|
+
var keepSameComment = (_c = (_b = item) === null || _b === void 0 ? void 0 : _b.comments, (_c !== null && _c !== void 0 ? _c : undefined));
|
|
19713
19379
|
if (id) {
|
|
19714
19380
|
var elem_1 = document.getElementById(id);
|
|
19715
19381
|
if (elem_1) {
|
|
19716
19382
|
elem_1.disabled = true;
|
|
19717
19383
|
}
|
|
19718
19384
|
if (newQuantity > 0 && newQuantity <= stock) {
|
|
19719
|
-
this.cartService.updateItemQuantity(item, newQuantity);
|
|
19385
|
+
this.cartService.updateItemQuantity(item, newQuantity, keepSameComment);
|
|
19720
19386
|
}
|
|
19721
19387
|
else {
|
|
19722
19388
|
this.toastrService.show('out-of-stock-actually');
|
|
@@ -19729,7 +19395,7 @@ var SidebarEcComponent = /** @class */ (function () {
|
|
|
19729
19395
|
}
|
|
19730
19396
|
else {
|
|
19731
19397
|
if (newQuantity > 0 && newQuantity <= stock) {
|
|
19732
|
-
this.cartService.updateItemQuantity(item, newQuantity);
|
|
19398
|
+
this.cartService.updateItemQuantity(item, newQuantity, keepSameComment);
|
|
19733
19399
|
}
|
|
19734
19400
|
}
|
|
19735
19401
|
};
|
|
@@ -20018,7 +19684,7 @@ var __decorate$21 = (this && this.__decorate) || function (decorators, target, k
|
|
|
20018
19684
|
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;
|
|
20019
19685
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
20020
19686
|
};
|
|
20021
|
-
var __param$
|
|
19687
|
+
var __param$b = (this && this.__param) || function (paramIndex, decorator) {
|
|
20022
19688
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
20023
19689
|
};
|
|
20024
19690
|
var ParamsContext = /** @class */ (function () {
|
|
@@ -20105,7 +19771,7 @@ var AddActionRedirectDirective = /** @class */ (function () {
|
|
|
20105
19771
|
Directive({
|
|
20106
19772
|
selector: "[ecAddActionRedirect]",
|
|
20107
19773
|
}),
|
|
20108
|
-
__param$
|
|
19774
|
+
__param$b(0, Inject(DOCUMENT))
|
|
20109
19775
|
], AddActionRedirectDirective);
|
|
20110
19776
|
return AddActionRedirectDirective;
|
|
20111
19777
|
}());
|
|
@@ -20195,7 +19861,7 @@ var __decorate$23 = (this && this.__decorate) || function (decorators, target, k
|
|
|
20195
19861
|
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;
|
|
20196
19862
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
20197
19863
|
};
|
|
20198
|
-
var __param$
|
|
19864
|
+
var __param$c = (this && this.__param) || function (paramIndex, decorator) {
|
|
20199
19865
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
20200
19866
|
};
|
|
20201
19867
|
var ParamsContext$1 = /** @class */ (function () {
|
|
@@ -20343,7 +20009,7 @@ var ProductOffDirective = /** @class */ (function () {
|
|
|
20343
20009
|
Directive({
|
|
20344
20010
|
selector: "[ecProductOff]",
|
|
20345
20011
|
}),
|
|
20346
|
-
__param$
|
|
20012
|
+
__param$c(0, Inject(DOCUMENT))
|
|
20347
20013
|
], ProductOffDirective);
|
|
20348
20014
|
return ProductOffDirective;
|
|
20349
20015
|
}());
|
|
@@ -20528,7 +20194,7 @@ var __decorate$27 = (this && this.__decorate) || function (decorators, target, k
|
|
|
20528
20194
|
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;
|
|
20529
20195
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
20530
20196
|
};
|
|
20531
|
-
var __read$
|
|
20197
|
+
var __read$a = (this && this.__read) || function (o, n) {
|
|
20532
20198
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
20533
20199
|
if (!m) return o;
|
|
20534
20200
|
var i = m.call(o), r, ar = [], e;
|
|
@@ -20594,7 +20260,7 @@ var ecCurrencySymbolPipe = /** @class */ (function () {
|
|
|
20594
20260
|
var forceShow = mode === 'alwaysShowDecimals';
|
|
20595
20261
|
var forceHide = mode === 'alwaysHideDecimals';
|
|
20596
20262
|
var showDecimals = forceShow ? true : forceHide ? false : !withoutDecimalGlobal;
|
|
20597
|
-
var _b = __read$
|
|
20263
|
+
var _b = __read$a((value || '').split(','), 2), ent = _b[0], _c = _b[1], dec = _c === void 0 ? '00' : _c;
|
|
20598
20264
|
if (showDecimals) {
|
|
20599
20265
|
if (dec.length > 2)
|
|
20600
20266
|
dec = dec.slice(0, 2);
|
|
@@ -20614,6 +20280,7 @@ var ecCurrencySymbolPipe = /** @class */ (function () {
|
|
|
20614
20280
|
ecCurrencySymbolPipe = __decorate$27([
|
|
20615
20281
|
Pipe({
|
|
20616
20282
|
name: 'ecCurrencySymbol',
|
|
20283
|
+
pure: false
|
|
20617
20284
|
})
|
|
20618
20285
|
], ecCurrencySymbolPipe);
|
|
20619
20286
|
return ecCurrencySymbolPipe;
|
|
@@ -20925,7 +20592,7 @@ var __decorate$2d = (this && this.__decorate) || function (decorators, target, k
|
|
|
20925
20592
|
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;
|
|
20926
20593
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
20927
20594
|
};
|
|
20928
|
-
var __param$
|
|
20595
|
+
var __param$d = (this && this.__param) || function (paramIndex, decorator) {
|
|
20929
20596
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
20930
20597
|
};
|
|
20931
20598
|
var StandardReuseStrategy = /** @class */ (function () {
|
|
@@ -20956,7 +20623,7 @@ var StandardReuseStrategy = /** @class */ (function () {
|
|
|
20956
20623
|
]; };
|
|
20957
20624
|
StandardReuseStrategy = __decorate$2d([
|
|
20958
20625
|
Injectable(),
|
|
20959
|
-
__param$
|
|
20626
|
+
__param$d(0, Inject('env'))
|
|
20960
20627
|
], StandardReuseStrategy);
|
|
20961
20628
|
return StandardReuseStrategy;
|
|
20962
20629
|
}());
|