ng-easycommerce 0.0.658-beta.1 → 0.0.660-beta.1
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 +58 -22
- package/assets/ec-i18n/en.json +1 -3
- package/assets/ec-i18n/es.json +1 -3
- package/bundles/ng-easycommerce.umd.js +515 -181
- 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 +1 -6
- package/esm2015/lib/ec-component/account-ec/order-ec/order-ec.component.js +3 -5
- package/esm2015/lib/ec-component/cart-ec/cart-ec.component.js +5 -8
- package/esm2015/lib/ec-component/checkout-ec/dataform-ec/dataform-ec.component.js +8 -13
- package/esm2015/lib/ec-component/collection-ec/collection-ec.component.js +450 -14
- package/esm2015/lib/ec-component/product-detail-ec/product-detail-ec.component.js +3 -30
- package/esm2015/lib/ec-component/product-ec/product-ec.component.js +2 -1
- package/esm2015/lib/ec-component/sidebar-ec/sidebar-ec.component.js +5 -8
- package/esm2015/lib/ec-component/widgets-ec/paypal-express-ec/paypal-express-ec.component.js +3 -1
- 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 +1 -2
- package/esm2015/lib/services/cart.service.js +12 -27
- package/esm2015/lib/services/currency.service.js +7 -43
- package/esm5/lib/core.consts.js +1 -6
- package/esm5/lib/ec-component/account-ec/order-ec/order-ec.component.js +3 -5
- package/esm5/lib/ec-component/cart-ec/cart-ec.component.js +5 -8
- package/esm5/lib/ec-component/checkout-ec/dataform-ec/dataform-ec.component.js +8 -13
- package/esm5/lib/ec-component/collection-ec/collection-ec.component.js +458 -13
- package/esm5/lib/ec-component/product-detail-ec/product-detail-ec.component.js +3 -48
- package/esm5/lib/ec-component/product-ec/product-ec.component.js +2 -1
- package/esm5/lib/ec-component/sidebar-ec/sidebar-ec.component.js +5 -8
- package/esm5/lib/ec-component/widgets-ec/paypal-express-ec/paypal-express-ec.component.js +3 -1
- 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 +1 -2
- package/esm5/lib/services/cart.service.js +12 -27
- package/esm5/lib/services/currency.service.js +7 -43
- package/fesm2015/ng-easycommerce.js +502 -159
- package/fesm2015/ng-easycommerce.js.map +1 -1
- package/fesm5/ng-easycommerce.js +516 -182
- package/fesm5/ng-easycommerce.js.map +1 -1
- package/lib/core.consts.d.ts +0 -5
- package/lib/ec-component/account-ec/order-ec/order-ec.component.d.ts +0 -1
- package/lib/ec-component/cart-ec/cart-ec.component.d.ts +0 -1
- package/lib/ec-component/checkout-ec/dataform-ec/dataform-ec.component.d.ts +1 -1
- package/lib/ec-component/collection-ec/collection-ec.component.d.ts +34 -4
- package/lib/ec-component/product-detail-ec/product-detail-ec.component.d.ts +0 -3
- package/lib/ec-component/sidebar-ec/sidebar-ec.component.d.ts +0 -1
- package/lib/services/cart.service.d.ts +2 -2
- package/lib/services/currency.service.d.ts +2 -14
- 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,
|
|
10
|
+
import { take, map, catchError, filter, mapTo, finalize, 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,11 +513,6 @@ 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 = [];
|
|
521
516
|
/**
|
|
522
517
|
*
|
|
523
518
|
* @param countries debe contener los codigos de los paises que se quiere mostrar
|
|
@@ -4763,22 +4758,12 @@ var CartService = /** @class */ (function () {
|
|
|
4763
4758
|
_this.updateLocalCart();
|
|
4764
4759
|
_this.requestInProcess.next(false);
|
|
4765
4760
|
};
|
|
4766
|
-
this.updateCartItemQuantity = function (variant_id, quantity
|
|
4767
|
-
var
|
|
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;
|
|
4761
|
+
this.updateCartItemQuantity = function (variant_id, quantity) {
|
|
4762
|
+
var newQuantity = _this.items.find(function (item) { return item.variant_id == variant_id; }).quantity = quantity;
|
|
4778
4763
|
_this.cartItemsSubject.next(_this.items);
|
|
4779
4764
|
_this.requestInProcess.next(false);
|
|
4780
4765
|
_this.updateLocalCart();
|
|
4781
|
-
_this.toastrService.show('product-updated', { quantity:
|
|
4766
|
+
_this.toastrService.show('product-updated', { quantity: newQuantity });
|
|
4782
4767
|
};
|
|
4783
4768
|
this.appendToCart = function (cart) {
|
|
4784
4769
|
_this.updateCartObj(cart);
|
|
@@ -4800,11 +4785,11 @@ var CartService = /** @class */ (function () {
|
|
|
4800
4785
|
// this.googleAnalytics.removeFromCart(product);
|
|
4801
4786
|
_this.analyticsService.callEvent('remove_from_cart', __assign$a(__assign$a({}, product), { currency: _this.consts.currency.code }));
|
|
4802
4787
|
};
|
|
4803
|
-
this.addIfAllreadyExists = function (product, variant_id, quantityAdd
|
|
4788
|
+
this.addIfAllreadyExists = function (product, variant_id, quantityAdd) {
|
|
4804
4789
|
if (quantityAdd === void 0) { quantityAdd = 1; }
|
|
4805
4790
|
return _this.items.find(function (item, index) {
|
|
4806
4791
|
if (item.product.id == product.id && item.variant_id == variant_id) {
|
|
4807
|
-
_this.updateItemQuantity(item, _this.findItem(product.id).quantity + quantityAdd
|
|
4792
|
+
_this.updateItemQuantity(item, _this.findItem(product.id).quantity + quantityAdd);
|
|
4808
4793
|
return true;
|
|
4809
4794
|
}
|
|
4810
4795
|
return false;
|
|
@@ -4858,7 +4843,7 @@ var CartService = /** @class */ (function () {
|
|
|
4858
4843
|
return;
|
|
4859
4844
|
}
|
|
4860
4845
|
_this.requestInProcess.next(true);
|
|
4861
|
-
var added = _this.addIfAllreadyExists(product, variant_id, quantity
|
|
4846
|
+
var added = _this.addIfAllreadyExists(product, variant_id, quantity);
|
|
4862
4847
|
if (!added) {
|
|
4863
4848
|
var payload = {
|
|
4864
4849
|
productCode: product.id,
|
|
@@ -4898,7 +4883,7 @@ var CartService = /** @class */ (function () {
|
|
|
4898
4883
|
!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' })
|
|
4899
4884
|
.subscribe(function (res) { return _this.appendToCart(res); }, function (err) { return _this.handleError(err); });
|
|
4900
4885
|
};
|
|
4901
|
-
this.addToCartPromise = function (product, quantity, variant_id
|
|
4886
|
+
this.addToCartPromise = function (product, quantity, variant_id) { return __awaiter$5(_this, void 0, void 0, function () {
|
|
4902
4887
|
var added, result;
|
|
4903
4888
|
return __generator$5(this, function (_a) {
|
|
4904
4889
|
switch (_a.label) {
|
|
@@ -4908,7 +4893,7 @@ var CartService = /** @class */ (function () {
|
|
|
4908
4893
|
return [2 /*return*/];
|
|
4909
4894
|
}
|
|
4910
4895
|
this.requestInProcess.next(true);
|
|
4911
|
-
added = this.addIfAllreadyExists(product, variant_id, quantity
|
|
4896
|
+
added = this.addIfAllreadyExists(product, variant_id, quantity);
|
|
4912
4897
|
if (!!added) return [3 /*break*/, 2];
|
|
4913
4898
|
return [4 /*yield*/, (this.connection.post(this.addItemApi(), { productCode: product.id, quantity: quantity, variantCode: variant_id }).toPromise())];
|
|
4914
4899
|
case 1:
|
|
@@ -4954,18 +4939,13 @@ var CartService = /** @class */ (function () {
|
|
|
4954
4939
|
items = items.filter(function (itemParam) { return !_this.items.find(function (item) { return itemParam.variantCode == item.variant_id; }); });
|
|
4955
4940
|
return __spread$3(items, paramsMerge);
|
|
4956
4941
|
};
|
|
4957
|
-
this.updateItemQuantity = function (item, quantity
|
|
4942
|
+
this.updateItemQuantity = function (item, quantity) {
|
|
4958
4943
|
if (_this.validateQuantity(item, quantity) && (_this.validatePriceAndCredits(item, quantity))) {
|
|
4959
4944
|
_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
|
-
}
|
|
4965
4945
|
_this.connection
|
|
4966
|
-
.put(_this.updateItemQuantityApi(_this.findItemByIdVariant(item.variant_id)),
|
|
4946
|
+
.put(_this.updateItemQuantityApi(_this.findItemByIdVariant(item.variant_id)), { 'quantity': Number(quantity) })
|
|
4967
4947
|
.pipe(finalize(function () { return _this.requestInProcess.next(false); }))
|
|
4968
|
-
.subscribe(function (res) { return _this.updateCartObj(res) && _this.updateCartItemQuantity(item.variant_id, Number(quantity)
|
|
4948
|
+
.subscribe(function (res) { return _this.updateCartObj(res) && _this.updateCartItemQuantity(item.variant_id, Number(quantity)); }, function (err) { return _this.handleError(err); });
|
|
4969
4949
|
}
|
|
4970
4950
|
};
|
|
4971
4951
|
this.validateQuantity = function (item, quantity) {
|
|
@@ -7528,7 +7508,6 @@ var CartEcComponent = /** @class */ (function (_super) {
|
|
|
7528
7508
|
_this.creditAccountShowPrices = null;
|
|
7529
7509
|
_this.showTaxLegend = false;
|
|
7530
7510
|
_this.cartLoading = false;
|
|
7531
|
-
_this.enableFieldNotesInArticleFile = false;
|
|
7532
7511
|
_this.toDecimal = function (amount) { return _this.consts.toDecimal(amount); };
|
|
7533
7512
|
_this.redirectRegister = function () { return _this.router.navigateByUrl("/auth/login"); };
|
|
7534
7513
|
_this.getVariants = function (product) {
|
|
@@ -7592,12 +7571,11 @@ var CartEcComponent = /** @class */ (function (_super) {
|
|
|
7592
7571
|
this.cartService.promotions.subscribe(function (promotions) { return _this.promotions = promotions; });
|
|
7593
7572
|
// console.log(this.cartService.getTaxes());
|
|
7594
7573
|
this.channelConfigService.channelConfig$.subscribe(function (channel) {
|
|
7595
|
-
var _a, _b, _c, _d, _e, _f, _g, _h
|
|
7574
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
7596
7575
|
_this.hidePrices = (_b = (_a = channel) === null || _a === void 0 ? void 0 : _a.hidePrices, (_b !== null && _b !== void 0 ? _b : false));
|
|
7597
7576
|
_this.hideDiscounts = (_d = (_c = channel) === null || _c === void 0 ? void 0 : _c.hideDiscounts, (_d !== null && _d !== void 0 ? _d : false));
|
|
7598
7577
|
_this.hideTaxes = (_f = (_e = channel) === null || _e === void 0 ? void 0 : _e.hideTaxes, (_f !== null && _f !== void 0 ? _f : false));
|
|
7599
7578
|
_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));
|
|
7601
7579
|
if (_this.hidePrices) {
|
|
7602
7580
|
_this.router.navigate(['/']);
|
|
7603
7581
|
}
|
|
@@ -7612,7 +7590,7 @@ var CartEcComponent = /** @class */ (function (_super) {
|
|
|
7612
7590
|
};
|
|
7613
7591
|
CartEcComponent.prototype.actualizarCantidad = function (item, cantidad, stock, id) {
|
|
7614
7592
|
var _this = this;
|
|
7615
|
-
var _a
|
|
7593
|
+
var _a;
|
|
7616
7594
|
if (this.cartLoading) {
|
|
7617
7595
|
return;
|
|
7618
7596
|
}
|
|
@@ -7632,11 +7610,10 @@ var CartEcComponent = /** @class */ (function (_super) {
|
|
|
7632
7610
|
newQuantity = Math.round(newQuantity / step) * step;
|
|
7633
7611
|
}
|
|
7634
7612
|
}
|
|
7635
|
-
var keepSameComment = (_c = (_b = item) === null || _b === void 0 ? void 0 : _b.comments, (_c !== null && _c !== void 0 ? _c : undefined));
|
|
7636
7613
|
if (id) {
|
|
7637
7614
|
this.isDisabled = true; // Actualiza la propiedad vinculada a `[disabled]`
|
|
7638
7615
|
if (newQuantity > 0 && newQuantity <= stock) {
|
|
7639
|
-
this.cartService.updateItemQuantity(item, newQuantity
|
|
7616
|
+
this.cartService.updateItemQuantity(item, newQuantity);
|
|
7640
7617
|
}
|
|
7641
7618
|
else {
|
|
7642
7619
|
this.toastrService.show('out-of-stock-actually');
|
|
@@ -7647,7 +7624,7 @@ var CartEcComponent = /** @class */ (function (_super) {
|
|
|
7647
7624
|
}
|
|
7648
7625
|
else {
|
|
7649
7626
|
if (newQuantity > 0 && newQuantity <= stock) {
|
|
7650
|
-
this.cartService.updateItemQuantity(item, newQuantity
|
|
7627
|
+
this.cartService.updateItemQuantity(item, newQuantity);
|
|
7651
7628
|
}
|
|
7652
7629
|
else {
|
|
7653
7630
|
this.toastrService.show('out-of-stock-actually');
|
|
@@ -8203,7 +8180,6 @@ var DataFormEcComponent = /** @class */ (function (_super) {
|
|
|
8203
8180
|
_this.postalCodeErrorMessageFacturacion = "";
|
|
8204
8181
|
_this.documentErrorMessage = "";
|
|
8205
8182
|
_this.documentErrorMessageFacturacion = "";
|
|
8206
|
-
_this.customerHasCustomerTaxRate = false;
|
|
8207
8183
|
/**
|
|
8208
8184
|
* @description filtra los paises de acuerdo al a los codigos retornados en la funcion getCountries.
|
|
8209
8185
|
* Casos de usos: Si getCountries es vacio, retorna el arreglo que ingresa por parametro.
|
|
@@ -8213,24 +8189,18 @@ var DataFormEcComponent = /** @class */ (function (_super) {
|
|
|
8213
8189
|
* @returns un arreglo de countries.
|
|
8214
8190
|
*/
|
|
8215
8191
|
_this.filterCountryByCode = function (countries) {
|
|
8216
|
-
// 1. Si hay países EXCLUIDOS, quítalos siempre
|
|
8217
|
-
var filtered = countries;
|
|
8218
|
-
if (_this.consts.excludedCountries && _this.consts.excludedCountries.length > 0) {
|
|
8219
|
-
filtered = filtered.filter(function (elem) { return !_this.consts.excludedCountries.includes(elem.code); });
|
|
8220
|
-
}
|
|
8221
|
-
// 2. Si hay países INCLUIDOS, aplica el filtro de inclusión
|
|
8222
8192
|
if (_this.consts.getCountries().length > 0) {
|
|
8223
|
-
var countriesFiltered =
|
|
8193
|
+
var countriesFiltered = countries.filter(function (elem) { return _this.consts.getCountries().includes(elem.code); });
|
|
8224
8194
|
if (countriesFiltered.length > 0) {
|
|
8225
8195
|
return countriesFiltered;
|
|
8226
8196
|
}
|
|
8227
8197
|
else {
|
|
8228
8198
|
console.error('El/los codigo/s ingresado/s no coinciden con los provistos desde el backend');
|
|
8229
|
-
return
|
|
8199
|
+
return countries;
|
|
8230
8200
|
}
|
|
8231
8201
|
}
|
|
8232
8202
|
else {
|
|
8233
|
-
return
|
|
8203
|
+
return countries;
|
|
8234
8204
|
}
|
|
8235
8205
|
};
|
|
8236
8206
|
_this.showFormFacturacion = function () {
|
|
@@ -8489,7 +8459,6 @@ var DataFormEcComponent = /** @class */ (function (_super) {
|
|
|
8489
8459
|
this.paramsService.parameters.subscribe(function (res) { return _this.params = res; });
|
|
8490
8460
|
this.addressingService.initialize(this.step_id);
|
|
8491
8461
|
var localEmail = localStorage.getItem('mail');
|
|
8492
|
-
this.cartService.cart.subscribe(function (cart) { var _a; return _this.customerHasCustomerTaxRate = (_a = cart) === null || _a === void 0 ? void 0 : _a.customerHasCustomerTaxRate; });
|
|
8493
8462
|
this.authService.isAuthenticated() && this.checkoutForm.controls['email'].setValue(((_a = this.authService.getCustomer()) === null || _a === void 0 ? void 0 : _a.email) || localEmail);
|
|
8494
8463
|
this.authService.isAuthenticated() && this.checkoutForm.get('email').disable({ onlySelf: true });
|
|
8495
8464
|
this.addressingService.getAddressingData().then(function (res) {
|
|
@@ -8570,6 +8539,9 @@ var DataFormEcComponent = /** @class */ (function (_super) {
|
|
|
8570
8539
|
DataFormEcComponent.prototype.updateDocumentValidationFacturacion = function (selectedDocumentType) {
|
|
8571
8540
|
this.updateValidation(selectedDocumentType, 'documentNumber', this.checkoutFormFacturacion, 'documentErrorMessageFacturacion', 'isNumeric', 'document-pattern-error');
|
|
8572
8541
|
};
|
|
8542
|
+
DataFormEcComponent.prototype.prueba = function (x) {
|
|
8543
|
+
console.log(x);
|
|
8544
|
+
};
|
|
8573
8545
|
DataFormEcComponent.ctorParameters = function () { return [
|
|
8574
8546
|
{ type: AuthService },
|
|
8575
8547
|
{ type: FormBuilder },
|
|
@@ -8593,7 +8565,7 @@ var DataFormEcComponent = /** @class */ (function (_super) {
|
|
|
8593
8565
|
DataFormEcComponent = __decorate$Q([
|
|
8594
8566
|
Component({
|
|
8595
8567
|
selector: 'app-dataform-ec',
|
|
8596
|
-
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_') && customerHasCustomerTaxRate\">\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}}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\"\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>",
|
|
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
8569
|
providers: [BsModalService],
|
|
8598
8570
|
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}"]
|
|
8599
8571
|
})
|
|
@@ -9235,6 +9207,9 @@ var __decorate$V = (this && this.__decorate) || function (decorators, target, ke
|
|
|
9235
9207
|
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;
|
|
9236
9208
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
9237
9209
|
};
|
|
9210
|
+
var __param$7 = (this && this.__param) || function (paramIndex, decorator) {
|
|
9211
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
9212
|
+
};
|
|
9238
9213
|
var __read$5 = (this && this.__read) || function (o, n) {
|
|
9239
9214
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
9240
9215
|
if (!m) return o;
|
|
@@ -9257,7 +9232,7 @@ var __spread$4 = (this && this.__spread) || function () {
|
|
|
9257
9232
|
};
|
|
9258
9233
|
var CollectionEcComponent = /** @class */ (function (_super) {
|
|
9259
9234
|
__extends$n(CollectionEcComponent, _super);
|
|
9260
|
-
function CollectionEcComponent(productsService, paramsSrv, activeRoute, optionsService, authService, analyticsService, cartService, consts, filtersService) {
|
|
9235
|
+
function CollectionEcComponent(productsService, paramsSrv, activeRoute, optionsService, authService, analyticsService, cartService, consts, filtersService, router, platformId) {
|
|
9261
9236
|
var _this = _super.call(this) || this;
|
|
9262
9237
|
_this.productsService = productsService;
|
|
9263
9238
|
_this.paramsSrv = paramsSrv;
|
|
@@ -9268,12 +9243,21 @@ var CollectionEcComponent = /** @class */ (function (_super) {
|
|
|
9268
9243
|
_this.cartService = cartService;
|
|
9269
9244
|
_this.consts = consts;
|
|
9270
9245
|
_this.filtersService = filtersService;
|
|
9246
|
+
_this.router = router;
|
|
9271
9247
|
_this.filters = [];
|
|
9272
9248
|
_this.filtersConfig = { filters: [] };
|
|
9273
9249
|
_this.finished = false;
|
|
9274
9250
|
_this.loading = true;
|
|
9275
9251
|
_this.breadcrumb = [];
|
|
9276
9252
|
_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
|
|
9277
9261
|
_this.productsWithUniqueVariant = false;
|
|
9278
9262
|
_this.optionsFilters = ['all'];
|
|
9279
9263
|
/**
|
|
@@ -9344,26 +9328,117 @@ var CollectionEcComponent = /** @class */ (function (_super) {
|
|
|
9344
9328
|
_this.getObjectWithVariant = function () {
|
|
9345
9329
|
return _this.consts.getParamsProductsWithUniqueVariant();
|
|
9346
9330
|
};
|
|
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
|
+
};
|
|
9347
9349
|
_this.paramsSrv.parameters.subscribe(function (param) { return _this.params = param; });
|
|
9348
9350
|
_this.defaultFilters = _this.consts.getDefaultFilters();
|
|
9349
9351
|
_this.filtersConfig.filters = _this.consts.getFilterConfig();
|
|
9350
9352
|
_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;
|
|
9351
9363
|
_this.ecOnConstruct();
|
|
9352
9364
|
return _this;
|
|
9353
9365
|
}
|
|
9366
|
+
CollectionEcComponent_1 = CollectionEcComponent;
|
|
9354
9367
|
CollectionEcComponent.prototype.ngOnInit = function () {
|
|
9355
|
-
|
|
9356
|
-
|
|
9357
|
-
this.
|
|
9358
|
-
|
|
9368
|
+
this.stateKey = this.router.url.split('?')[0];
|
|
9369
|
+
// Verificar si hay estado guardado ANTES de scroll(0,0)
|
|
9370
|
+
var savedState = CollectionEcComponent_1.stateCache.get(this.stateKey);
|
|
9371
|
+
if (savedState && savedState.products.length > 0) {
|
|
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();
|
|
9359
9386
|
};
|
|
9360
9387
|
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 () {
|
|
9361
9434
|
var _this = this;
|
|
9362
9435
|
combineLatest([this.activeRoute.params, this.optionsService.ready, this.activeRoute.queryParams]).subscribe(function (_a) {
|
|
9363
9436
|
var _b = __read$5(_a, 3), params = _b[0], ready = _b[1], queryParams = _b[2];
|
|
9364
9437
|
if (ready.readyAll) {
|
|
9365
9438
|
var cambio_1 = false;
|
|
9366
9439
|
_this.products = [];
|
|
9440
|
+
// Marcar como cambio de categoría para la carga inicial
|
|
9441
|
+
_this.isCategoryChange = true;
|
|
9367
9442
|
if (!params['type'] || !params['value']) {
|
|
9368
9443
|
_this.productsService.getProductsForFilter({ latest: true, limit: 10 }, _this.optionsFilters, queryParams.search, _this.defaultFilters);
|
|
9369
9444
|
}
|
|
@@ -9394,7 +9469,16 @@ var CollectionEcComponent = /** @class */ (function (_super) {
|
|
|
9394
9469
|
}
|
|
9395
9470
|
else {
|
|
9396
9471
|
res = _this.productsService.getProductsWithUniqueVariant(res, _this.getObjectWithVariant());
|
|
9397
|
-
|
|
9472
|
+
// Filtrar productos duplicados antes de agregar
|
|
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
9482
|
_this.applyFiltersInView();
|
|
9399
9483
|
}
|
|
9400
9484
|
;
|
|
@@ -9406,7 +9490,16 @@ var CollectionEcComponent = /** @class */ (function (_super) {
|
|
|
9406
9490
|
cambio_1 = false;
|
|
9407
9491
|
}
|
|
9408
9492
|
else {
|
|
9409
|
-
|
|
9493
|
+
// Filtrar productos duplicados antes de agregar
|
|
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
9503
|
_this.applyFiltersInView();
|
|
9411
9504
|
}
|
|
9412
9505
|
}
|
|
@@ -9423,6 +9516,145 @@ var CollectionEcComponent = /** @class */ (function (_super) {
|
|
|
9423
9516
|
}
|
|
9424
9517
|
});
|
|
9425
9518
|
};
|
|
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
|
+
};
|
|
9426
9658
|
CollectionEcComponent.prototype.onScroll = function () {
|
|
9427
9659
|
this.loading = true;
|
|
9428
9660
|
if (!this.productsService.isWaiting() && !this.productsService.getNext()) {
|
|
@@ -9430,6 +9662,187 @@ var CollectionEcComponent = /** @class */ (function (_super) {
|
|
|
9430
9662
|
this.loading = false;
|
|
9431
9663
|
}
|
|
9432
9664
|
};
|
|
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;
|
|
9433
9846
|
CollectionEcComponent.ctorParameters = function () { return [
|
|
9434
9847
|
{ type: ProductsService },
|
|
9435
9848
|
{ type: ParametersService },
|
|
@@ -9439,7 +9852,9 @@ var CollectionEcComponent = /** @class */ (function (_super) {
|
|
|
9439
9852
|
{ type: AnalyticsService },
|
|
9440
9853
|
{ type: CartService },
|
|
9441
9854
|
{ type: Constants },
|
|
9442
|
-
{ type: FiltersService }
|
|
9855
|
+
{ type: FiltersService },
|
|
9856
|
+
{ type: Router },
|
|
9857
|
+
{ type: Object, decorators: [{ type: Inject, args: [PLATFORM_ID,] }] }
|
|
9443
9858
|
]; };
|
|
9444
9859
|
__decorate$V([
|
|
9445
9860
|
Input()
|
|
@@ -9453,12 +9868,13 @@ var CollectionEcComponent = /** @class */ (function (_super) {
|
|
|
9453
9868
|
__decorate$V([
|
|
9454
9869
|
Input()
|
|
9455
9870
|
], CollectionEcComponent.prototype, "optionsFilters", void 0);
|
|
9456
|
-
CollectionEcComponent = __decorate$V([
|
|
9871
|
+
CollectionEcComponent = CollectionEcComponent_1 = __decorate$V([
|
|
9457
9872
|
Component({
|
|
9458
9873
|
selector: 'app-collection-ec',
|
|
9459
9874
|
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>",
|
|
9460
9875
|
styles: [".h1-custom{color:#00f}"]
|
|
9461
|
-
})
|
|
9876
|
+
}),
|
|
9877
|
+
__param$7(10, Inject(PLATFORM_ID))
|
|
9462
9878
|
], CollectionEcComponent);
|
|
9463
9879
|
return CollectionEcComponent;
|
|
9464
9880
|
}(ComponentHelper));
|
|
@@ -9609,7 +10025,7 @@ var __decorate$Y = (this && this.__decorate) || function (decorators, target, ke
|
|
|
9609
10025
|
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;
|
|
9610
10026
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
9611
10027
|
};
|
|
9612
|
-
var __param$
|
|
10028
|
+
var __param$8 = (this && this.__param) || function (paramIndex, decorator) {
|
|
9613
10029
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
9614
10030
|
};
|
|
9615
10031
|
/** @dynamic */
|
|
@@ -9810,7 +10226,7 @@ var FiltersEcComponent = /** @class */ (function (_super) {
|
|
|
9810
10226
|
template: "",
|
|
9811
10227
|
styles: [""]
|
|
9812
10228
|
}),
|
|
9813
|
-
__param$
|
|
10229
|
+
__param$8(1, Inject(DOCUMENT))
|
|
9814
10230
|
], FiltersEcComponent);
|
|
9815
10231
|
return FiltersEcComponent;
|
|
9816
10232
|
}(ComponentHelper));
|
|
@@ -9834,7 +10250,7 @@ var __decorate$Z = (this && this.__decorate) || function (decorators, target, ke
|
|
|
9834
10250
|
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;
|
|
9835
10251
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
9836
10252
|
};
|
|
9837
|
-
var __param$
|
|
10253
|
+
var __param$9 = (this && this.__param) || function (paramIndex, decorator) {
|
|
9838
10254
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
9839
10255
|
};
|
|
9840
10256
|
/** @dynamic */
|
|
@@ -9923,7 +10339,7 @@ var FiltersTopEcComponent = /** @class */ (function (_super) {
|
|
|
9923
10339
|
template: "",
|
|
9924
10340
|
styles: [".min-width-large{min-width:150px}"]
|
|
9925
10341
|
}),
|
|
9926
|
-
__param$
|
|
10342
|
+
__param$9(1, Inject(DOCUMENT))
|
|
9927
10343
|
], FiltersTopEcComponent);
|
|
9928
10344
|
return FiltersTopEcComponent;
|
|
9929
10345
|
}(ComponentHelper));
|
|
@@ -10500,28 +10916,11 @@ var CurrencyService = /** @class */ (function () {
|
|
|
10500
10916
|
this.getCurrencyListApi = function () { return 'shop-api/currencies'; };
|
|
10501
10917
|
this.getConvertibilityApi = function (baseCurrency, targetCurrency) { return 'shop-api/currencies?baseCurrency=' + baseCurrency + '&targetCurrency=' + targetCurrency; };
|
|
10502
10918
|
/**
|
|
10503
|
-
* @description Se carga la moneda por defecto
|
|
10919
|
+
* @description Se carga la moneda por defecto.
|
|
10504
10920
|
*/
|
|
10505
|
-
this.loadDefaultCurrency = function (
|
|
10506
|
-
|
|
10507
|
-
_this.
|
|
10508
|
-
var _a;
|
|
10509
|
-
_this.currencyListSubject.next(list);
|
|
10510
|
-
_this.consts.setCurrencyTypeConfig(list);
|
|
10511
|
-
var cfg = (_a = list) === null || _a === void 0 ? void 0 : _a.find(function (c) { return c.code === currencyCode; });
|
|
10512
|
-
if (cfg) {
|
|
10513
|
-
// Setea moneda activa con su configuración completa
|
|
10514
|
-
_this.consts.setCurrency(cfg.code, cfg);
|
|
10515
|
-
}
|
|
10516
|
-
else {
|
|
10517
|
-
_this.consts.setCurrency(currencyCode);
|
|
10518
|
-
}
|
|
10519
|
-
_this.load();
|
|
10520
|
-
}).catch(function () {
|
|
10521
|
-
// En caso de error, al menos fijá el código para no romper el flujo
|
|
10522
|
-
_this.consts.setCurrency(currencyCode);
|
|
10523
|
-
_this.load();
|
|
10524
|
-
});
|
|
10921
|
+
this.loadDefaultCurrency = function (currency) {
|
|
10922
|
+
_this.consts.setCurrency(currency);
|
|
10923
|
+
_this.load();
|
|
10525
10924
|
};
|
|
10526
10925
|
/**
|
|
10527
10926
|
* @description calcula la convetibilidad del precio pasado por paramentro segun esta formula:
|
|
@@ -10543,32 +10942,12 @@ var CurrencyService = /** @class */ (function () {
|
|
|
10543
10942
|
});
|
|
10544
10943
|
}); };
|
|
10545
10944
|
/**
|
|
10546
|
-
* Carga la lista de monedas
|
|
10547
|
-
*
|
|
10548
|
-
* Si no existe una moneda activa guardada en `localStorage`, inicializa la moneda activa
|
|
10549
|
-
* tomando la moneda base del canal (`ChannelConfigService.baseCurrency`) y sus metadatos
|
|
10550
|
-
* obtenidos de la lista (símbolo, posición, decimales). Si no se encuentra la base en la
|
|
10551
|
-
* lista, usa la primera disponible.
|
|
10552
|
-
*
|
|
10553
|
-
* Finalmente, llama a `load()` para propagar la configuración a los observables y (si aplica)
|
|
10554
|
-
* actualizar `localStorage`.
|
|
10555
|
-
*
|
|
10556
|
-
* @sideEffect Actualiza `currencyList$`, `Constants.setCurrencyTypeConfig` y potencialmente
|
|
10557
|
-
* `Constants.setCurrency`.
|
|
10558
|
-
* @returns void
|
|
10945
|
+
* @description Carga la lista de monedas/currencies.
|
|
10559
10946
|
*/
|
|
10560
10947
|
this.loadCurrencyList = function () {
|
|
10561
10948
|
_this.connection.get(_this.getCurrencyListApi()).toPromise().then(function (res) {
|
|
10562
|
-
var _a, _b, _c, _d;
|
|
10563
10949
|
_this.currencyListSubject.next(res);
|
|
10564
10950
|
_this.consts.setCurrencyTypeConfig(res);
|
|
10565
|
-
var stored = localStorage.getItem('currency');
|
|
10566
|
-
if (!stored) {
|
|
10567
|
-
var base_1 = (_a = _this.injector.get(ChannelConfigService).getActiveChannel()) === null || _a === void 0 ? void 0 : _a.baseCurrency;
|
|
10568
|
-
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]));
|
|
10569
|
-
if (cfg)
|
|
10570
|
-
_this.consts.setCurrency(cfg.code, cfg);
|
|
10571
|
-
}
|
|
10572
10951
|
_this.load();
|
|
10573
10952
|
});
|
|
10574
10953
|
};
|
|
@@ -10654,6 +11033,7 @@ var CurrencyService = /** @class */ (function () {
|
|
|
10654
11033
|
}
|
|
10655
11034
|
};
|
|
10656
11035
|
this.injector.get(ChannelConfigService).channelConfig$.subscribe(function (channel) {
|
|
11036
|
+
console.log(channel);
|
|
10657
11037
|
channel.applyCurrencyExchange ? _this.loadCurrencyList() : _this.loadDefaultCurrency(channel.baseCurrency);
|
|
10658
11038
|
console.log(_this.enableApplyCurrencyExchange);
|
|
10659
11039
|
});
|
|
@@ -11221,22 +11601,6 @@ var __decorate$14 = (this && this.__decorate) || function (decorators, target, k
|
|
|
11221
11601
|
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;
|
|
11222
11602
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
11223
11603
|
};
|
|
11224
|
-
var __read$7 = (this && this.__read) || function (o, n) {
|
|
11225
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
11226
|
-
if (!m) return o;
|
|
11227
|
-
var i = m.call(o), r, ar = [], e;
|
|
11228
|
-
try {
|
|
11229
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
11230
|
-
}
|
|
11231
|
-
catch (error) { e = { error: error }; }
|
|
11232
|
-
finally {
|
|
11233
|
-
try {
|
|
11234
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
11235
|
-
}
|
|
11236
|
-
finally { if (e) throw e.error; }
|
|
11237
|
-
}
|
|
11238
|
-
return ar;
|
|
11239
|
-
};
|
|
11240
11604
|
var ProductDetailEcComponent = /** @class */ (function (_super) {
|
|
11241
11605
|
__extends$w(ProductDetailEcComponent, _super);
|
|
11242
11606
|
function ProductDetailEcComponent(productService, consts, activedRoute, cartService, optionsService, productsService, analyticsService, router, toastrService, meta, injector) {
|
|
@@ -11262,11 +11626,9 @@ var ProductDetailEcComponent = /** @class */ (function (_super) {
|
|
|
11262
11626
|
_this.showReviews = false;
|
|
11263
11627
|
_this.hidePrices = false;
|
|
11264
11628
|
_this.creditAccountShowPrices = null;
|
|
11265
|
-
_this.enableFieldNotesInArticleFile = false;
|
|
11266
11629
|
_this.addToCart = function () {
|
|
11267
11630
|
var _a;
|
|
11268
|
-
|
|
11269
|
-
_this.quantity > 0 && _this.productService.addToCart(_this.quantity, undefined, note);
|
|
11631
|
+
_this.quantity > 0 && _this.productService.addToCart(_this.quantity, undefined, ((_a = _this.comments) === null || _a === void 0 ? void 0 : _a.trim()) || null);
|
|
11270
11632
|
};
|
|
11271
11633
|
_this.addAllProductosToCart = function () {
|
|
11272
11634
|
var _a, _b;
|
|
@@ -11372,10 +11734,9 @@ var ProductDetailEcComponent = /** @class */ (function (_super) {
|
|
|
11372
11734
|
_this.changeImgFocus(productParam.picturesdefault[0]);
|
|
11373
11735
|
});
|
|
11374
11736
|
_this.injector.get(ChannelConfigService).channelConfig$.subscribe(function (channel) {
|
|
11375
|
-
var _a, _b
|
|
11737
|
+
var _a, _b;
|
|
11376
11738
|
_this.showReviews = channel.showReviews;
|
|
11377
11739
|
_this.hidePrices = (_b = (_a = channel) === null || _a === void 0 ? void 0 : _a.hidePrices, (_b !== null && _b !== void 0 ? _b : false));
|
|
11378
|
-
_this.enableFieldNotesInArticleFile = (_d = (_c = channel) === null || _c === void 0 ? void 0 : _c.enableFieldNotesInArticleFile, (_d !== null && _d !== void 0 ? _d : false));
|
|
11379
11740
|
});
|
|
11380
11741
|
_this.cartService.showPrice$.subscribe(function (showPrice) {
|
|
11381
11742
|
_this.creditAccountShowPrices = showPrice;
|
|
@@ -11390,31 +11751,7 @@ var ProductDetailEcComponent = /** @class */ (function (_super) {
|
|
|
11390
11751
|
return cadena.replace(expresionRegular, '');
|
|
11391
11752
|
};
|
|
11392
11753
|
ProductDetailEcComponent.prototype.ngOnInit = function () {
|
|
11393
|
-
var _this = this;
|
|
11394
11754
|
this.ecOnInit();
|
|
11395
|
-
// Prellenar comentarios cuando:
|
|
11396
|
-
// - cargue el producto
|
|
11397
|
-
// - cambie la variante seleccionada (asociatedData$)
|
|
11398
|
-
// - cambien los ítems del carrito
|
|
11399
|
-
this.prefillSub = combineLatest([
|
|
11400
|
-
this.productService.product$.pipe(filter(function (p) { return !!p && !!p.id; })),
|
|
11401
|
-
this.productService.asociatedData$.pipe(startWith(null)),
|
|
11402
|
-
this.cartService.cartItems.pipe(startWith([])),
|
|
11403
|
-
]).subscribe(function (_a) {
|
|
11404
|
-
var _b = __read$7(_a, 3), product = _b[0], data = _b[1], items = _b[2];
|
|
11405
|
-
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
11406
|
-
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));
|
|
11407
|
-
var match = (_l = items) === null || _l === void 0 ? void 0 : _l.find(function (it) {
|
|
11408
|
-
var _a, _b, _c, _d;
|
|
11409
|
-
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) &&
|
|
11410
|
-
(variantId ? ((_d = it) === null || _d === void 0 ? void 0 : _d.variant_id) === variantId : true);
|
|
11411
|
-
});
|
|
11412
|
-
_this.comments = (_o = (_m = match) === null || _m === void 0 ? void 0 : _m.comments, (_o !== null && _o !== void 0 ? _o : ''));
|
|
11413
|
-
});
|
|
11414
|
-
};
|
|
11415
|
-
ProductDetailEcComponent.prototype.ngOnDestroy = function () {
|
|
11416
|
-
var _a;
|
|
11417
|
-
(_a = this.prefillSub) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
11418
11755
|
};
|
|
11419
11756
|
ProductDetailEcComponent.prototype.scroll = function () {
|
|
11420
11757
|
var el = this.contact.nativeElement;
|
|
@@ -11563,6 +11900,7 @@ var ProductEcComponent = /** @class */ (function (_super) {
|
|
|
11563
11900
|
ProductEcComponent.prototype.ngOnChanges = function () {
|
|
11564
11901
|
};
|
|
11565
11902
|
ProductEcComponent.prototype.selectItem = function (product) {
|
|
11903
|
+
console.log('entro');
|
|
11566
11904
|
this.analyticsService.callEvent('select_item', product);
|
|
11567
11905
|
};
|
|
11568
11906
|
ProductEcComponent.ctorParameters = function () { return [
|
|
@@ -12083,7 +12421,7 @@ var __decorate$1a = (this && this.__decorate) || function (decorators, target, k
|
|
|
12083
12421
|
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;
|
|
12084
12422
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
12085
12423
|
};
|
|
12086
|
-
var __param$
|
|
12424
|
+
var __param$a = (this && this.__param) || function (paramIndex, decorator) {
|
|
12087
12425
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12088
12426
|
};
|
|
12089
12427
|
var SellerDashboardContainerEcComponent = /** @class */ (function (_super) {
|
|
@@ -12200,7 +12538,7 @@ var SellerDashboardContainerEcComponent = /** @class */ (function (_super) {
|
|
|
12200
12538
|
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>",
|
|
12201
12539
|
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}"]
|
|
12202
12540
|
}),
|
|
12203
|
-
__param$
|
|
12541
|
+
__param$a(3, Inject('env'))
|
|
12204
12542
|
], SellerDashboardContainerEcComponent);
|
|
12205
12543
|
return SellerDashboardContainerEcComponent;
|
|
12206
12544
|
}(ComponentHelper));
|
|
@@ -12807,8 +13145,8 @@ var PriceEcComponent = /** @class */ (function (_super) {
|
|
|
12807
13145
|
PriceEcComponent = __decorate$1f([
|
|
12808
13146
|
Component({
|
|
12809
13147
|
selector: 'app-price-ec',
|
|
12810
|
-
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 }}:
|
|
12811
|
-
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}
|
|
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 }}\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 }}: {{ basePrice | ecCurrencySymbol }}</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>",
|
|
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}"]
|
|
12812
13150
|
})
|
|
12813
13151
|
], PriceEcComponent);
|
|
12814
13152
|
return PriceEcComponent;
|
|
@@ -12833,7 +13171,7 @@ var __decorate$1g = (this && this.__decorate) || function (decorators, target, k
|
|
|
12833
13171
|
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;
|
|
12834
13172
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
12835
13173
|
};
|
|
12836
|
-
var __read$
|
|
13174
|
+
var __read$7 = (this && this.__read) || function (o, n) {
|
|
12837
13175
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
12838
13176
|
if (!m) return o;
|
|
12839
13177
|
var i = m.call(o), r, ar = [], e;
|
|
@@ -12877,7 +13215,7 @@ var RedsysCatchEcComponent = /** @class */ (function (_super) {
|
|
|
12877
13215
|
var _this = this;
|
|
12878
13216
|
var state;
|
|
12879
13217
|
combineLatest([this.activedRoute.params, this.activedRoute.queryParams]).subscribe(function (_a) {
|
|
12880
|
-
var _b = __read$
|
|
13218
|
+
var _b = __read$7(_a, 2), queryRouter = _b[0], queryParams = _b[1];
|
|
12881
13219
|
state = queryRouter.state;
|
|
12882
13220
|
state && state == 'statuspayment' && (state = queryParams.status);
|
|
12883
13221
|
console.log('PARAMETROS STATE -> ', state);
|
|
@@ -12960,7 +13298,7 @@ var __decorate$1h = (this && this.__decorate) || function (decorators, target, k
|
|
|
12960
13298
|
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;
|
|
12961
13299
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
12962
13300
|
};
|
|
12963
|
-
var __param$
|
|
13301
|
+
var __param$b = (this && this.__param) || function (paramIndex, decorator) {
|
|
12964
13302
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12965
13303
|
};
|
|
12966
13304
|
/** @dynamic */
|
|
@@ -13085,7 +13423,7 @@ var RedSysProEcComponent = /** @class */ (function (_super) {
|
|
|
13085
13423
|
providers: [BsModalService],
|
|
13086
13424
|
styles: [".half-width{width:49%!important}.ml-1{margin-left:1%}#card-form{height:450px}.iframeStyle{height:800px;width:100%;max-height:800px}"]
|
|
13087
13425
|
}),
|
|
13088
|
-
__param$
|
|
13426
|
+
__param$b(6, Inject(DOCUMENT))
|
|
13089
13427
|
], RedSysProEcComponent);
|
|
13090
13428
|
return RedSysProEcComponent;
|
|
13091
13429
|
}(ComponentHelper));
|
|
@@ -13638,7 +13976,6 @@ var OrderEcComponent = /** @class */ (function (_super) {
|
|
|
13638
13976
|
_this.hidePrices = false;
|
|
13639
13977
|
_this.hideDiscounts = false;
|
|
13640
13978
|
_this.hideTaxes = false;
|
|
13641
|
-
_this.enableFieldNotesInArticleFile = false;
|
|
13642
13979
|
_this.toDate = function (date, format) { return moment(date).format(!format && 'DD/MM/YYYY, h:mm:ss a' || format); };
|
|
13643
13980
|
_this.callError = function () {
|
|
13644
13981
|
_this.error = '?';
|
|
@@ -13681,7 +14018,7 @@ var OrderEcComponent = /** @class */ (function (_super) {
|
|
|
13681
14018
|
_this.callError();
|
|
13682
14019
|
};
|
|
13683
14020
|
this.channelConfigService.channelConfig$.subscribe(function (config) {
|
|
13684
|
-
var _a, _b, _c, _d, _e, _f
|
|
14021
|
+
var _a, _b, _c, _d, _e, _f;
|
|
13685
14022
|
if (config && config.allowRepeatOrders !== undefined) {
|
|
13686
14023
|
_this.allowRepeatOrders = config.allowRepeatOrders;
|
|
13687
14024
|
}
|
|
@@ -13691,7 +14028,6 @@ var OrderEcComponent = /** @class */ (function (_super) {
|
|
|
13691
14028
|
_this.hidePrices = (_b = (_a = config) === null || _a === void 0 ? void 0 : _a.hidePrices, (_b !== null && _b !== void 0 ? _b : false));
|
|
13692
14029
|
_this.hideDiscounts = (_d = (_c = config) === null || _c === void 0 ? void 0 : _c.hideDiscounts, (_d !== null && _d !== void 0 ? _d : false));
|
|
13693
14030
|
_this.hideTaxes = (_f = (_e = config) === null || _e === void 0 ? void 0 : _e.hideTaxes, (_f !== null && _f !== void 0 ? _f : false));
|
|
13694
|
-
_this.enableFieldNotesInArticleFile = (_h = (_g = config) === null || _g === void 0 ? void 0 : _g.enableFieldNotesInArticleFile, (_h !== null && _h !== void 0 ? _h : false));
|
|
13695
14031
|
});
|
|
13696
14032
|
this.cartService.showPrice$.subscribe(function (showPrice) {
|
|
13697
14033
|
_this.creditAccountShowPrices = showPrice;
|
|
@@ -13717,7 +14053,7 @@ var OrderEcComponent = /** @class */ (function (_super) {
|
|
|
13717
14053
|
OrderEcComponent = __decorate$1l([
|
|
13718
14054
|
Component({
|
|
13719
14055
|
selector: 'app-order-ec',
|
|
13720
|
-
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>",
|
|
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
14057
|
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}"]
|
|
13722
14058
|
})
|
|
13723
14059
|
], OrderEcComponent);
|
|
@@ -15500,10 +15836,12 @@ var PaypalExpressEcComponent = /** @class */ (function (_super) {
|
|
|
15500
15836
|
_this.loading = false;
|
|
15501
15837
|
}
|
|
15502
15838
|
else {
|
|
15839
|
+
/* console.log('Entro al else'); */
|
|
15503
15840
|
_this.renderPayPal();
|
|
15504
15841
|
}
|
|
15505
15842
|
}
|
|
15506
15843
|
catch (error) {
|
|
15844
|
+
/* console.log('Entro al catch'); */
|
|
15507
15845
|
_this.renderPayPal();
|
|
15508
15846
|
}
|
|
15509
15847
|
}, 1000);
|
|
@@ -16176,7 +16514,7 @@ var __decorate$1D = (this && this.__decorate) || function (decorators, target, k
|
|
|
16176
16514
|
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;
|
|
16177
16515
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
16178
16516
|
};
|
|
16179
|
-
var __read$
|
|
16517
|
+
var __read$8 = (this && this.__read) || function (o, n) {
|
|
16180
16518
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
16181
16519
|
if (!m) return o;
|
|
16182
16520
|
var i = m.call(o), r, ar = [], e;
|
|
@@ -16208,7 +16546,7 @@ var CartLoadEcComponent = /** @class */ (function (_super) {
|
|
|
16208
16546
|
var _this = this;
|
|
16209
16547
|
var token;
|
|
16210
16548
|
combineLatest([this.activedRoute.params, this.activedRoute.queryParams]).subscribe(function (_a) {
|
|
16211
|
-
var _b = __read$
|
|
16549
|
+
var _b = __read$8(_a, 2), queryRouter = _b[0], queryParams = _b[1];
|
|
16212
16550
|
token = queryRouter.token;
|
|
16213
16551
|
console.log('PARAMETROS token -> ', token);
|
|
16214
16552
|
_this.cartService.loadCartByToken(token).then(function (res) {
|
|
@@ -19290,7 +19628,6 @@ var SidebarEcComponent = /** @class */ (function () {
|
|
|
19290
19628
|
this.creditAccountShowPrices = null;
|
|
19291
19629
|
this.showTaxLegend = false;
|
|
19292
19630
|
this.cartLoading = false;
|
|
19293
|
-
this.enableFieldNotesInArticleFile = false;
|
|
19294
19631
|
this.getVariants = function (product) {
|
|
19295
19632
|
var item = product.product;
|
|
19296
19633
|
if (item.variants && item.variants.length && item.variants[0].options && item.variants[0].options.length) {
|
|
@@ -19340,11 +19677,10 @@ var SidebarEcComponent = /** @class */ (function () {
|
|
|
19340
19677
|
_this.user = u;
|
|
19341
19678
|
});
|
|
19342
19679
|
this.channelConfigService.channelConfig$.subscribe(function (channel) {
|
|
19343
|
-
var _a, _b, _c, _d, _e, _f
|
|
19680
|
+
var _a, _b, _c, _d, _e, _f;
|
|
19344
19681
|
_this.hideDiscounts = (_b = (_a = channel) === null || _a === void 0 ? void 0 : _a.hideDiscounts, (_b !== null && _b !== void 0 ? _b : false));
|
|
19345
19682
|
_this.hideTaxes = (_d = (_c = channel) === null || _c === void 0 ? void 0 : _c.hideTaxes, (_d !== null && _d !== void 0 ? _d : false));
|
|
19346
19683
|
_this.showTaxLegend = (_f = (_e = channel) === null || _e === void 0 ? void 0 : _e.showTaxLegend, (_f !== null && _f !== void 0 ? _f : false));
|
|
19347
|
-
_this.enableFieldNotesInArticleFile = (_h = (_g = channel) === null || _g === void 0 ? void 0 : _g.enableFieldNotesInArticleFile, (_h !== null && _h !== void 0 ? _h : false));
|
|
19348
19684
|
});
|
|
19349
19685
|
this.cartService.showPrice$.subscribe(function (showPrice) {
|
|
19350
19686
|
_this.creditAccountShowPrices = showPrice;
|
|
@@ -19354,7 +19690,7 @@ var SidebarEcComponent = /** @class */ (function () {
|
|
|
19354
19690
|
});
|
|
19355
19691
|
};
|
|
19356
19692
|
SidebarEcComponent.prototype.actualizarCantidad = function (item, cantidad, stock, id) {
|
|
19357
|
-
var _a
|
|
19693
|
+
var _a;
|
|
19358
19694
|
if (this.cartLoading) {
|
|
19359
19695
|
return;
|
|
19360
19696
|
}
|
|
@@ -19374,14 +19710,13 @@ var SidebarEcComponent = /** @class */ (function () {
|
|
|
19374
19710
|
newQuantity = Math.round(newQuantity / step) * step;
|
|
19375
19711
|
}
|
|
19376
19712
|
}
|
|
19377
|
-
var keepSameComment = (_c = (_b = item) === null || _b === void 0 ? void 0 : _b.comments, (_c !== null && _c !== void 0 ? _c : undefined));
|
|
19378
19713
|
if (id) {
|
|
19379
19714
|
var elem_1 = document.getElementById(id);
|
|
19380
19715
|
if (elem_1) {
|
|
19381
19716
|
elem_1.disabled = true;
|
|
19382
19717
|
}
|
|
19383
19718
|
if (newQuantity > 0 && newQuantity <= stock) {
|
|
19384
|
-
this.cartService.updateItemQuantity(item, newQuantity
|
|
19719
|
+
this.cartService.updateItemQuantity(item, newQuantity);
|
|
19385
19720
|
}
|
|
19386
19721
|
else {
|
|
19387
19722
|
this.toastrService.show('out-of-stock-actually');
|
|
@@ -19394,7 +19729,7 @@ var SidebarEcComponent = /** @class */ (function () {
|
|
|
19394
19729
|
}
|
|
19395
19730
|
else {
|
|
19396
19731
|
if (newQuantity > 0 && newQuantity <= stock) {
|
|
19397
|
-
this.cartService.updateItemQuantity(item, newQuantity
|
|
19732
|
+
this.cartService.updateItemQuantity(item, newQuantity);
|
|
19398
19733
|
}
|
|
19399
19734
|
}
|
|
19400
19735
|
};
|
|
@@ -19683,7 +20018,7 @@ var __decorate$21 = (this && this.__decorate) || function (decorators, target, k
|
|
|
19683
20018
|
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;
|
|
19684
20019
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
19685
20020
|
};
|
|
19686
|
-
var __param$
|
|
20021
|
+
var __param$c = (this && this.__param) || function (paramIndex, decorator) {
|
|
19687
20022
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
19688
20023
|
};
|
|
19689
20024
|
var ParamsContext = /** @class */ (function () {
|
|
@@ -19770,7 +20105,7 @@ var AddActionRedirectDirective = /** @class */ (function () {
|
|
|
19770
20105
|
Directive({
|
|
19771
20106
|
selector: "[ecAddActionRedirect]",
|
|
19772
20107
|
}),
|
|
19773
|
-
__param$
|
|
20108
|
+
__param$c(0, Inject(DOCUMENT))
|
|
19774
20109
|
], AddActionRedirectDirective);
|
|
19775
20110
|
return AddActionRedirectDirective;
|
|
19776
20111
|
}());
|
|
@@ -19860,7 +20195,7 @@ var __decorate$23 = (this && this.__decorate) || function (decorators, target, k
|
|
|
19860
20195
|
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;
|
|
19861
20196
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
19862
20197
|
};
|
|
19863
|
-
var __param$
|
|
20198
|
+
var __param$d = (this && this.__param) || function (paramIndex, decorator) {
|
|
19864
20199
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
19865
20200
|
};
|
|
19866
20201
|
var ParamsContext$1 = /** @class */ (function () {
|
|
@@ -20008,7 +20343,7 @@ var ProductOffDirective = /** @class */ (function () {
|
|
|
20008
20343
|
Directive({
|
|
20009
20344
|
selector: "[ecProductOff]",
|
|
20010
20345
|
}),
|
|
20011
|
-
__param$
|
|
20346
|
+
__param$d(0, Inject(DOCUMENT))
|
|
20012
20347
|
], ProductOffDirective);
|
|
20013
20348
|
return ProductOffDirective;
|
|
20014
20349
|
}());
|
|
@@ -20193,7 +20528,7 @@ var __decorate$27 = (this && this.__decorate) || function (decorators, target, k
|
|
|
20193
20528
|
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;
|
|
20194
20529
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
20195
20530
|
};
|
|
20196
|
-
var __read$
|
|
20531
|
+
var __read$9 = (this && this.__read) || function (o, n) {
|
|
20197
20532
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
20198
20533
|
if (!m) return o;
|
|
20199
20534
|
var i = m.call(o), r, ar = [], e;
|
|
@@ -20259,7 +20594,7 @@ var ecCurrencySymbolPipe = /** @class */ (function () {
|
|
|
20259
20594
|
var forceShow = mode === 'alwaysShowDecimals';
|
|
20260
20595
|
var forceHide = mode === 'alwaysHideDecimals';
|
|
20261
20596
|
var showDecimals = forceShow ? true : forceHide ? false : !withoutDecimalGlobal;
|
|
20262
|
-
var _b = __read$
|
|
20597
|
+
var _b = __read$9((value || '').split(','), 2), ent = _b[0], _c = _b[1], dec = _c === void 0 ? '00' : _c;
|
|
20263
20598
|
if (showDecimals) {
|
|
20264
20599
|
if (dec.length > 2)
|
|
20265
20600
|
dec = dec.slice(0, 2);
|
|
@@ -20279,7 +20614,6 @@ var ecCurrencySymbolPipe = /** @class */ (function () {
|
|
|
20279
20614
|
ecCurrencySymbolPipe = __decorate$27([
|
|
20280
20615
|
Pipe({
|
|
20281
20616
|
name: 'ecCurrencySymbol',
|
|
20282
|
-
pure: false
|
|
20283
20617
|
})
|
|
20284
20618
|
], ecCurrencySymbolPipe);
|
|
20285
20619
|
return ecCurrencySymbolPipe;
|
|
@@ -20591,7 +20925,7 @@ var __decorate$2d = (this && this.__decorate) || function (decorators, target, k
|
|
|
20591
20925
|
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;
|
|
20592
20926
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
20593
20927
|
};
|
|
20594
|
-
var __param$
|
|
20928
|
+
var __param$e = (this && this.__param) || function (paramIndex, decorator) {
|
|
20595
20929
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
20596
20930
|
};
|
|
20597
20931
|
var StandardReuseStrategy = /** @class */ (function () {
|
|
@@ -20622,7 +20956,7 @@ var StandardReuseStrategy = /** @class */ (function () {
|
|
|
20622
20956
|
]; };
|
|
20623
20957
|
StandardReuseStrategy = __decorate$2d([
|
|
20624
20958
|
Injectable(),
|
|
20625
|
-
__param$
|
|
20959
|
+
__param$e(0, Inject('env'))
|
|
20626
20960
|
], StandardReuseStrategy);
|
|
20627
20961
|
return StandardReuseStrategy;
|
|
20628
20962
|
}());
|