@ikas/storefront 0.0.94 → 0.0.95
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/build/__generated__/global-types.d.ts +7 -1
- package/build/api/cart/__generated__/getCart.d.ts +4 -0
- package/build/api/cart/__generated__/saveItemToCart.d.ts +4 -0
- package/build/api/checkout/__generated__/checkStocks.d.ts +3 -3
- package/build/api/checkout/index.d.ts +1 -1
- package/build/api/country/__generated__/getAvailableShippingCountries.d.ts +3 -0
- package/build/api/country/index.d.ts +1 -1
- package/build/api/index.d.ts +0 -2
- package/build/components/checkout/index.d.ts +3 -0
- package/build/components/checkout/model.d.ts +4 -3
- package/build/index.es.js +402 -409
- package/build/index.js +403 -412
- package/build/models/data/cart/index.d.ts +9 -0
- package/build/models/data/storefront/{storefront-domain → domain}/index.d.ts +1 -0
- package/build/models/data/storefront/index.d.ts +19 -6
- package/build/models/data/storefront/localization/index.d.ts +7 -0
- package/build/models/data/storefront/routing/index.d.ts +9 -0
- package/build/models/data/storefront/theme/index.d.ts +13 -0
- package/build/models/data/storefront/theme-localization/index.d.ts +11 -0
- package/build/models/ui/product-list/index.d.ts +1 -1
- package/build/pages/checkout/[id].d.ts +3 -0
- package/build/storefront/index.d.ts +5 -0
- package/build/utils/settings.d.ts +80 -0
- package/package.json +1 -1
- package/build/api/product-stock-location/__generated__/listProductStockLocation.d.ts +0 -13
- package/build/api/product-stock-location/index.d.ts +0 -4
- package/build/api/storefront/__generated__/getStorefront.d.ts +0 -23
- package/build/api/storefront/index.d.ts +0 -4
- package/build/api/theme/index.d.ts +0 -4
- package/build/models/data/storefront/stockfront-location/index.d.ts +0 -5
- package/build/models/data/storefront/stockfront-route/index.d.ts +0 -5
- package/build/models/data/storefront/storefront-region/index.d.ts +0 -18
package/build/index.js
CHANGED
|
@@ -3,24 +3,24 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var mobx = require('mobx');
|
|
6
|
-
var fs = require('fs');
|
|
7
|
-
var getConfig = require('next/config');
|
|
8
6
|
var React = require('react');
|
|
7
|
+
var getConfig = require('next/config');
|
|
9
8
|
var mobxReactLite = require('mobx-react-lite');
|
|
10
9
|
var router = require('next/router');
|
|
11
10
|
var Image$1 = require('next/image');
|
|
12
11
|
var Link = require('next/link');
|
|
13
12
|
var Head = require('next/head');
|
|
13
|
+
var fs = require('fs');
|
|
14
14
|
var dynamic = require('next/dynamic');
|
|
15
15
|
|
|
16
16
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
17
17
|
|
|
18
|
-
var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);
|
|
19
|
-
var getConfig__default = /*#__PURE__*/_interopDefaultLegacy(getConfig);
|
|
20
18
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
19
|
+
var getConfig__default = /*#__PURE__*/_interopDefaultLegacy(getConfig);
|
|
21
20
|
var Image__default = /*#__PURE__*/_interopDefaultLegacy(Image$1);
|
|
22
21
|
var Link__default = /*#__PURE__*/_interopDefaultLegacy(Link);
|
|
23
22
|
var Head__default = /*#__PURE__*/_interopDefaultLegacy(Head);
|
|
23
|
+
var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);
|
|
24
24
|
var dynamic__default = /*#__PURE__*/_interopDefaultLegacy(dynamic);
|
|
25
25
|
|
|
26
26
|
/*! *****************************************************************************
|
|
@@ -11017,6 +11017,7 @@ var IkasProductDetailPropValueProvider = /** @class */ (function () {
|
|
|
11017
11017
|
return [2 /*return*/, null];
|
|
11018
11018
|
return [4 /*yield*/, IkasProductSearchAPI.searchProducts({
|
|
11019
11019
|
productIdList: [this.productDetailPropValue.productId],
|
|
11020
|
+
priceListId: IkasStorefrontConfig.priceListId,
|
|
11020
11021
|
})];
|
|
11021
11022
|
case 1:
|
|
11022
11023
|
productSearchResponse = _b.sent();
|
|
@@ -12046,6 +12047,7 @@ var IkasPageDataProvider = /** @class */ (function () {
|
|
|
12046
12047
|
return [2 /*return*/];
|
|
12047
12048
|
return [4 /*yield*/, IkasProductSearchAPI.searchProducts({
|
|
12048
12049
|
productIdList: [metaDataResponse.metaData.targetId],
|
|
12050
|
+
priceListId: IkasStorefrontConfig.priceListId,
|
|
12049
12051
|
})];
|
|
12050
12052
|
case 2:
|
|
12051
12053
|
productsResponse = _b.sent();
|
|
@@ -12803,6 +12805,10 @@ var IkasCart = /** @class */ (function () {
|
|
|
12803
12805
|
: [];
|
|
12804
12806
|
this.merchantId = data.merchantId || "";
|
|
12805
12807
|
this.totalPrice = data.totalPrice || 0;
|
|
12808
|
+
this.salesChannelId = data.salesChannelId || "";
|
|
12809
|
+
this.storefrontId = data.storefrontId || null;
|
|
12810
|
+
this.storefrontRoutingId = data.storefrontRoutingId || null;
|
|
12811
|
+
this.storefrontThemeId = data.storefrontThemeId || null;
|
|
12806
12812
|
mobx.makeAutoObservable(this);
|
|
12807
12813
|
}
|
|
12808
12814
|
Object.defineProperty(IkasCart.prototype, "totalTax", {
|
|
@@ -15822,7 +15828,7 @@ var MAX_CVC_LENGTH = 4;
|
|
|
15822
15828
|
var USE_DIFFERENT_ADDRESS_KEY = "sAddr";
|
|
15823
15829
|
var isServer$1 = typeof localStorage === "undefined";
|
|
15824
15830
|
var CheckoutViewModel = /** @class */ (function () {
|
|
15825
|
-
function CheckoutViewModel(checkout, queryParams, router) {
|
|
15831
|
+
function CheckoutViewModel(checkout, queryParams, router, returnPolicy, privacyPolicy, termsOfService) {
|
|
15826
15832
|
var _this = this;
|
|
15827
15833
|
this.checkout = new IkasCheckout();
|
|
15828
15834
|
this.storefront = null;
|
|
@@ -15928,7 +15934,7 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
15928
15934
|
variantId: i.variant.id,
|
|
15929
15935
|
productId: i.variant.productId,
|
|
15930
15936
|
}); });
|
|
15931
|
-
return [4 /*yield*/, IkasCheckoutAPI.checkStocks(lines)];
|
|
15937
|
+
return [4 /*yield*/, IkasCheckoutAPI.checkStocks(lines, [])];
|
|
15932
15938
|
case 1:
|
|
15933
15939
|
result = _b.sent();
|
|
15934
15940
|
if (!result) {
|
|
@@ -15941,7 +15947,7 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
15941
15947
|
data = unavailableItems.map(function (item) { return ({
|
|
15942
15948
|
variant: _this.cart.items.find(function (i) { return i.variant.id === item.variantId; })
|
|
15943
15949
|
.variant,
|
|
15944
|
-
availableQuantity: item.
|
|
15950
|
+
availableQuantity: item.stockCount,
|
|
15945
15951
|
}); });
|
|
15946
15952
|
throw {
|
|
15947
15953
|
type: ErrorType.STOCK_ERROR,
|
|
@@ -15958,7 +15964,7 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
15958
15964
|
switch (_b.label) {
|
|
15959
15965
|
case 0:
|
|
15960
15966
|
_a = this;
|
|
15961
|
-
return [4 /*yield*/, IkasCountryAPI.listShippingCountries()];
|
|
15967
|
+
return [4 /*yield*/, IkasCountryAPI.listShippingCountries(IkasStorefrontConfig.storefrontId)];
|
|
15962
15968
|
case 1:
|
|
15963
15969
|
_a.shippingCountryIds = _b.sent();
|
|
15964
15970
|
return [2 /*return*/];
|
|
@@ -16034,30 +16040,6 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
16034
16040
|
}
|
|
16035
16041
|
});
|
|
16036
16042
|
}); };
|
|
16037
|
-
this.getStorefront = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
16038
|
-
var storefront;
|
|
16039
|
-
return __generator(this, function (_a) {
|
|
16040
|
-
switch (_a.label) {
|
|
16041
|
-
case 0:
|
|
16042
|
-
if (!IkasStorefrontConfig.config.storefrontId || !!this.storefront)
|
|
16043
|
-
return [2 /*return*/];
|
|
16044
|
-
_a.label = 1;
|
|
16045
|
-
case 1:
|
|
16046
|
-
_a.trys.push([1, 3, , 4]);
|
|
16047
|
-
return [4 /*yield*/, IkasStorefrontAPI.getStorefront(IkasStorefrontConfig.config.storefrontId)];
|
|
16048
|
-
case 2:
|
|
16049
|
-
storefront = _a.sent();
|
|
16050
|
-
if (storefront) {
|
|
16051
|
-
this.storefront = storefront;
|
|
16052
|
-
}
|
|
16053
|
-
return [3 /*break*/, 4];
|
|
16054
|
-
case 3:
|
|
16055
|
-
_a.sent();
|
|
16056
|
-
return [3 /*break*/, 4];
|
|
16057
|
-
case 4: return [2 /*return*/];
|
|
16058
|
-
}
|
|
16059
|
-
});
|
|
16060
|
-
}); };
|
|
16061
16043
|
this.createCustomer = function () {
|
|
16062
16044
|
if (_this.customerStore.customer) {
|
|
16063
16045
|
_this.checkout.customer = _this.customerStore.customer;
|
|
@@ -16189,7 +16171,7 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
16189
16171
|
_this.router.push("/");
|
|
16190
16172
|
};
|
|
16191
16173
|
this.onProceedToShippingClick = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
16192
|
-
var newAddress, customer,
|
|
16174
|
+
var newAddress, customer, err_2;
|
|
16193
16175
|
return __generator(this, function (_a) {
|
|
16194
16176
|
switch (_a.label) {
|
|
16195
16177
|
case 0:
|
|
@@ -16219,12 +16201,12 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
16219
16201
|
this.changeStep(CheckoutStep.SHIPPING);
|
|
16220
16202
|
return [3 /*break*/, 7];
|
|
16221
16203
|
case 6:
|
|
16222
|
-
|
|
16223
|
-
if (
|
|
16224
|
-
this.error =
|
|
16204
|
+
err_2 = _a.sent();
|
|
16205
|
+
if (err_2.type) {
|
|
16206
|
+
this.error = err_2;
|
|
16225
16207
|
}
|
|
16226
16208
|
else {
|
|
16227
|
-
console.log(
|
|
16209
|
+
console.log(err_2);
|
|
16228
16210
|
this.error = {
|
|
16229
16211
|
type: ErrorType.UNKNOWN,
|
|
16230
16212
|
};
|
|
@@ -16236,7 +16218,7 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
16236
16218
|
});
|
|
16237
16219
|
}); };
|
|
16238
16220
|
this.onProceedToPaymentClick = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
16239
|
-
var
|
|
16221
|
+
var err_3;
|
|
16240
16222
|
return __generator(this, function (_a) {
|
|
16241
16223
|
switch (_a.label) {
|
|
16242
16224
|
case 0:
|
|
@@ -16256,12 +16238,12 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
16256
16238
|
this.changeStep(CheckoutStep.PAYMENT);
|
|
16257
16239
|
return [3 /*break*/, 4];
|
|
16258
16240
|
case 3:
|
|
16259
|
-
|
|
16260
|
-
if (
|
|
16261
|
-
this.error =
|
|
16241
|
+
err_3 = _a.sent();
|
|
16242
|
+
if (err_3.type) {
|
|
16243
|
+
this.error = err_3;
|
|
16262
16244
|
}
|
|
16263
16245
|
else {
|
|
16264
|
-
console.log(
|
|
16246
|
+
console.log(err_3);
|
|
16265
16247
|
this.error = {
|
|
16266
16248
|
type: ErrorType.UNKNOWN,
|
|
16267
16249
|
};
|
|
@@ -16273,7 +16255,7 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
16273
16255
|
});
|
|
16274
16256
|
}); };
|
|
16275
16257
|
this.performPayment = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
16276
|
-
var response, transactionStatus,
|
|
16258
|
+
var response, transactionStatus, err_4;
|
|
16277
16259
|
return __generator(this, function (_a) {
|
|
16278
16260
|
switch (_a.label) {
|
|
16279
16261
|
case 0:
|
|
@@ -16319,10 +16301,10 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
16319
16301
|
}
|
|
16320
16302
|
return [3 /*break*/, 6];
|
|
16321
16303
|
case 5:
|
|
16322
|
-
|
|
16323
|
-
if (
|
|
16324
|
-
console.log(
|
|
16325
|
-
this.error =
|
|
16304
|
+
err_4 = _a.sent();
|
|
16305
|
+
if (err_4.type) {
|
|
16306
|
+
console.log(err_4);
|
|
16307
|
+
this.error = err_4;
|
|
16326
16308
|
}
|
|
16327
16309
|
else {
|
|
16328
16310
|
this.error = {
|
|
@@ -16401,6 +16383,9 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
16401
16383
|
}); };
|
|
16402
16384
|
this.checkout = checkout;
|
|
16403
16385
|
this.router = router;
|
|
16386
|
+
this.returnPolicy = returnPolicy;
|
|
16387
|
+
this.privacyPolicy = privacyPolicy;
|
|
16388
|
+
this.termsOfService = termsOfService;
|
|
16404
16389
|
this.init(queryParams);
|
|
16405
16390
|
mobx.makeAutoObservable(this);
|
|
16406
16391
|
}
|
|
@@ -16411,15 +16396,6 @@ var CheckoutViewModel = /** @class */ (function () {
|
|
|
16411
16396
|
enumerable: false,
|
|
16412
16397
|
configurable: true
|
|
16413
16398
|
});
|
|
16414
|
-
Object.defineProperty(CheckoutViewModel.prototype, "storefrontRegion", {
|
|
16415
|
-
get: function () {
|
|
16416
|
-
var _a;
|
|
16417
|
-
return ((_a = this.storefront) === null || _a === void 0 ? void 0 : _a.regions.length) ? this.storefront.regions[0]
|
|
16418
|
-
: undefined;
|
|
16419
|
-
},
|
|
16420
|
-
enumerable: false,
|
|
16421
|
-
configurable: true
|
|
16422
|
-
});
|
|
16423
16399
|
Object.defineProperty(CheckoutViewModel.prototype, "selectedPaymentGatewayIndex", {
|
|
16424
16400
|
get: function () {
|
|
16425
16401
|
var _this = this;
|
|
@@ -17083,6 +17059,7 @@ var IkasCustomerStore = /** @class */ (function () {
|
|
|
17083
17059
|
return [2 /*return*/, []];
|
|
17084
17060
|
return [4 /*yield*/, IkasProductSearchAPI.searchProducts({
|
|
17085
17061
|
productIdList: favoriteProductsResult.map(function (fP) { return fP.productId; }),
|
|
17062
|
+
priceListId: IkasStorefrontConfig.priceListId,
|
|
17086
17063
|
})];
|
|
17087
17064
|
case 2:
|
|
17088
17065
|
productsResult = _b.sent();
|
|
@@ -21917,7 +21894,10 @@ var IkasProductList = /** @class */ (function () {
|
|
|
21917
21894
|
Object.defineProperty(IkasProductList.prototype, "isFiltered", {
|
|
21918
21895
|
get: function () {
|
|
21919
21896
|
var _a;
|
|
21920
|
-
return (((_a = this.filters) === null || _a === void 0 ? void 0 : _a.some(function (f) { return !!f.valueList.length; })) ||
|
|
21897
|
+
return (((_a = this.filters) === null || _a === void 0 ? void 0 : _a.some(function (f) { return !!f.valueList.length; })) ||
|
|
21898
|
+
!!this._searchKeyword ||
|
|
21899
|
+
(this._pageType !== exports.IkasThemePageType.CATEGORY &&
|
|
21900
|
+
!!this._filterCategoryId));
|
|
21921
21901
|
},
|
|
21922
21902
|
enumerable: false,
|
|
21923
21903
|
configurable: true
|
|
@@ -21980,13 +21960,20 @@ var IkasProductList = /** @class */ (function () {
|
|
|
21980
21960
|
});
|
|
21981
21961
|
Object.defineProperty(IkasProductList.prototype, "filterQueryParams", {
|
|
21982
21962
|
get: function () {
|
|
21983
|
-
var
|
|
21963
|
+
var _this = this;
|
|
21964
|
+
var _a, _b, _c;
|
|
21984
21965
|
var queryParams = {};
|
|
21985
21966
|
(_a = this.filters) === null || _a === void 0 ? void 0 : _a.forEach(function (f) {
|
|
21986
21967
|
queryParams[f.key] = f.keyList;
|
|
21987
21968
|
});
|
|
21988
21969
|
if (this._searchKeyword)
|
|
21989
21970
|
queryParams.s = this._searchKeyword;
|
|
21971
|
+
if (this._pageType !== exports.IkasThemePageType.CATEGORY &&
|
|
21972
|
+
this._filterCategoryId) {
|
|
21973
|
+
var slug = (_c = (_b = this.filterCategories) === null || _b === void 0 ? void 0 : _b.find(function (fc) { return fc.id === _this._filterCategoryId; })) === null || _c === void 0 ? void 0 : _c.slug;
|
|
21974
|
+
if (slug)
|
|
21975
|
+
queryParams.c = slug;
|
|
21976
|
+
}
|
|
21990
21977
|
return queryString.stringify(queryParams, { arrayFormat: "comma" });
|
|
21991
21978
|
},
|
|
21992
21979
|
enumerable: false,
|
|
@@ -22041,6 +22028,7 @@ var IkasProductList = /** @class */ (function () {
|
|
|
22041
22028
|
categoryIdList: this._filterCategoryId
|
|
22042
22029
|
? [this._filterCategoryId]
|
|
22043
22030
|
: undefined,
|
|
22031
|
+
priceListId: IkasStorefrontConfig.priceListId,
|
|
22044
22032
|
query: this._searchKeyword,
|
|
22045
22033
|
})];
|
|
22046
22034
|
case 1: return [2 /*return*/, _c.sent()];
|
|
@@ -22068,6 +22056,7 @@ var IkasProductList = /** @class */ (function () {
|
|
|
22068
22056
|
};
|
|
22069
22057
|
IkasProductList.prototype.applyQueryParamFilters = function (queryParams) {
|
|
22070
22058
|
var _this = this;
|
|
22059
|
+
var _a;
|
|
22071
22060
|
try {
|
|
22072
22061
|
queryParams === null || queryParams === void 0 ? void 0 : queryParams.forEach(function (value, key) {
|
|
22073
22062
|
var _a;
|
|
@@ -22079,6 +22068,15 @@ var IkasProductList = /** @class */ (function () {
|
|
|
22079
22068
|
var querySearch = queryParams === null || queryParams === void 0 ? void 0 : queryParams.get("s");
|
|
22080
22069
|
if (querySearch)
|
|
22081
22070
|
this._searchKeyword = querySearch;
|
|
22071
|
+
if (this._pageType !== exports.IkasThemePageType.CATEGORY) {
|
|
22072
|
+
var queryCategory_1 = queryParams === null || queryParams === void 0 ? void 0 : queryParams.get("c");
|
|
22073
|
+
if (queryCategory_1) {
|
|
22074
|
+
var filterCategory = (_a = this.filterCategories) === null || _a === void 0 ? void 0 : _a.find(function (fc) { return fc.slug === queryCategory_1; });
|
|
22075
|
+
if (filterCategory) {
|
|
22076
|
+
this._filterCategoryId = filterCategory.id;
|
|
22077
|
+
}
|
|
22078
|
+
}
|
|
22079
|
+
}
|
|
22082
22080
|
}
|
|
22083
22081
|
catch (err) {
|
|
22084
22082
|
console.log(err);
|
|
@@ -22125,12 +22123,32 @@ var IkasProductList = /** @class */ (function () {
|
|
|
22125
22123
|
var _a;
|
|
22126
22124
|
(_a = this.filters) === null || _a === void 0 ? void 0 : _a.forEach(function (filter) { return filter.clear(); });
|
|
22127
22125
|
this._searchKeyword = "";
|
|
22126
|
+
if (this._pageType !== exports.IkasThemePageType.CATEGORY) {
|
|
22127
|
+
this._filterCategoryId = undefined;
|
|
22128
|
+
}
|
|
22128
22129
|
this.applyFilters();
|
|
22129
22130
|
};
|
|
22130
|
-
IkasProductList.prototype.onFilterCategoryClick = function (filterCategory) {
|
|
22131
|
+
IkasProductList.prototype.onFilterCategoryClick = function (filterCategory, disableRoute) {
|
|
22131
22132
|
var _a;
|
|
22132
|
-
(
|
|
22133
|
-
|
|
22133
|
+
if (disableRoute === void 0) { disableRoute = false; }
|
|
22134
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
22135
|
+
return __generator(this, function (_b) {
|
|
22136
|
+
switch (_b.label) {
|
|
22137
|
+
case 0:
|
|
22138
|
+
if (!disableRoute) return [3 /*break*/, 2];
|
|
22139
|
+
this._filterCategoryId = filterCategory.id;
|
|
22140
|
+
return [4 /*yield*/, this.applyFilters()];
|
|
22141
|
+
case 1:
|
|
22142
|
+
_b.sent();
|
|
22143
|
+
return [3 /*break*/, 3];
|
|
22144
|
+
case 2:
|
|
22145
|
+
(_a = this.router) === null || _a === void 0 ? void 0 : _a.push(filterCategory.href +
|
|
22146
|
+
(this.filterQueryParams ? "?" + this.filterQueryParams : ""));
|
|
22147
|
+
_b.label = 3;
|
|
22148
|
+
case 3: return [2 /*return*/];
|
|
22149
|
+
}
|
|
22150
|
+
});
|
|
22151
|
+
});
|
|
22134
22152
|
};
|
|
22135
22153
|
IkasProductList.prototype.toJSON = function () {
|
|
22136
22154
|
return {
|
|
@@ -24215,7 +24233,7 @@ var IkasCartAPI = /** @class */ (function () {
|
|
|
24215
24233
|
return __generator(this, function (_b) {
|
|
24216
24234
|
switch (_b.label) {
|
|
24217
24235
|
case 0:
|
|
24218
|
-
MUTATION = src(templateObject_1$1 || (templateObject_1$1 = __makeTemplateObject(["\n mutation saveItemToCart($input: SaveItemToCartInput!) {\n saveItemToCart(input: $input) {\n id\n createdAt\n updatedAt\n dueDate\n currencyCode\n customerId\n merchantId\n itemCount\n totalPrice\n items {\n createdAt\n currencyCode\n deleted\n discount {\n amount\n amountType\n reason\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n id\n name\n sku\n slug\n barcodeList\n mainImageId\n productId\n variantValues {\n order\n variantTypeId\n variantTypeName\n variantValueId\n variantValueName\n }\n }\n }\n }\n }\n "], ["\n mutation saveItemToCart($input: SaveItemToCartInput!) {\n saveItemToCart(input: $input) {\n id\n createdAt\n updatedAt\n dueDate\n currencyCode\n customerId\n merchantId\n itemCount\n totalPrice\n items {\n createdAt\n currencyCode\n deleted\n discount {\n amount\n amountType\n reason\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n id\n name\n sku\n slug\n barcodeList\n mainImageId\n productId\n variantValues {\n order\n variantTypeId\n variantTypeName\n variantValueId\n variantValueName\n }\n }\n }\n }\n }\n "])));
|
|
24236
|
+
MUTATION = src(templateObject_1$1 || (templateObject_1$1 = __makeTemplateObject(["\n mutation saveItemToCart($input: SaveItemToCartInput!) {\n saveItemToCart(input: $input) {\n id\n createdAt\n updatedAt\n dueDate\n currencyCode\n customerId\n merchantId\n itemCount\n totalPrice\n salesChannelId\n storefrontId\n storefrontRoutingId\n storefrontThemeId\n items {\n createdAt\n currencyCode\n deleted\n discount {\n amount\n amountType\n reason\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n id\n name\n sku\n slug\n barcodeList\n mainImageId\n productId\n variantValues {\n order\n variantTypeId\n variantTypeName\n variantValueId\n variantValueName\n }\n }\n }\n }\n }\n "], ["\n mutation saveItemToCart($input: SaveItemToCartInput!) {\n saveItemToCart(input: $input) {\n id\n createdAt\n updatedAt\n dueDate\n currencyCode\n customerId\n merchantId\n itemCount\n totalPrice\n salesChannelId\n storefrontId\n storefrontRoutingId\n storefrontThemeId\n items {\n createdAt\n currencyCode\n deleted\n discount {\n amount\n amountType\n reason\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n id\n name\n sku\n slug\n barcodeList\n mainImageId\n productId\n variantValues {\n order\n variantTypeId\n variantTypeName\n variantValueId\n variantValueName\n }\n }\n }\n }\n }\n "])));
|
|
24219
24237
|
_b.label = 1;
|
|
24220
24238
|
case 1:
|
|
24221
24239
|
_b.trys.push([1, 3, , 4]);
|
|
@@ -24250,7 +24268,7 @@ var IkasCartAPI = /** @class */ (function () {
|
|
|
24250
24268
|
return __generator(this, function (_b) {
|
|
24251
24269
|
switch (_b.label) {
|
|
24252
24270
|
case 0:
|
|
24253
|
-
QUERY = src(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n query getCart($cartId: String, $customerId: String) {\n getCart(id: $cartId, customerId: $customerId) {\n createdAt\n currencyCode\n customerId\n dueDate\n id\n itemCount\n items {\n createdAt\n currencyCode\n discount {\n amount\n amountType\n reason\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n deleted\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n slug\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n order\n variantTypeId\n variantTypeName\n variantValueId\n variantValueName\n }\n }\n }\n merchantId\n status\n totalPrice\n updatedAt\n }\n }\n "], ["\n query getCart($cartId: String, $customerId: String) {\n getCart(id: $cartId, customerId: $customerId) {\n createdAt\n currencyCode\n customerId\n dueDate\n id\n itemCount\n items {\n createdAt\n currencyCode\n discount {\n amount\n amountType\n reason\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n deleted\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n slug\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n order\n variantTypeId\n variantTypeName\n variantValueId\n variantValueName\n }\n }\n }\n merchantId\n status\n totalPrice\n updatedAt\n }\n }\n "])));
|
|
24271
|
+
QUERY = src(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n query getCart($cartId: String, $customerId: String) {\n getCart(id: $cartId, customerId: $customerId) {\n createdAt\n currencyCode\n customerId\n dueDate\n id\n itemCount\n salesChannelId\n storefrontId\n storefrontRoutingId\n storefrontThemeId\n items {\n createdAt\n currencyCode\n discount {\n amount\n amountType\n reason\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n deleted\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n slug\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n order\n variantTypeId\n variantTypeName\n variantValueId\n variantValueName\n }\n }\n }\n merchantId\n status\n totalPrice\n updatedAt\n }\n }\n "], ["\n query getCart($cartId: String, $customerId: String) {\n getCart(id: $cartId, customerId: $customerId) {\n createdAt\n currencyCode\n customerId\n dueDate\n id\n itemCount\n salesChannelId\n storefrontId\n storefrontRoutingId\n storefrontThemeId\n items {\n createdAt\n currencyCode\n discount {\n amount\n amountType\n reason\n }\n discountPrice\n finalPrice\n id\n originalOrderLineItemId\n price\n quantity\n status\n deleted\n statusUpdatedAt\n stockLocationId\n taxValue\n updatedAt\n variant {\n slug\n barcodeList\n id\n mainImageId\n name\n productId\n sku\n variantValues {\n order\n variantTypeId\n variantTypeName\n variantValueId\n variantValueName\n }\n }\n }\n merchantId\n status\n totalPrice\n updatedAt\n }\n }\n "])));
|
|
24254
24272
|
_b.label = 1;
|
|
24255
24273
|
case 1:
|
|
24256
24274
|
_b.trys.push([1, 3, , 4]);
|
|
@@ -24722,13 +24740,13 @@ var IkasCheckoutAPI = /** @class */ (function () {
|
|
|
24722
24740
|
});
|
|
24723
24741
|
});
|
|
24724
24742
|
};
|
|
24725
|
-
IkasCheckoutAPI.checkStocks = function (lines) {
|
|
24743
|
+
IkasCheckoutAPI.checkStocks = function (lines, stockLocationIdList) {
|
|
24726
24744
|
return __awaiter(this, void 0, void 0, function () {
|
|
24727
24745
|
var QUERY, _a, data, errors, err_7;
|
|
24728
24746
|
return __generator(this, function (_b) {
|
|
24729
24747
|
switch (_b.label) {
|
|
24730
24748
|
case 0:
|
|
24731
|
-
QUERY = src(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n query checkStocks($lines: [CheckStocksLineInput!]!) {\n checkStocks(lines: $lines) {\n lines {\n
|
|
24749
|
+
QUERY = src(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n query checkStocks(\n $lines: [CheckStocksLineInput!]!\n $stockLocationIdList: [String!]\n ) {\n checkStocks(lines: $lines, stockLocationIdList: $stockLocationIdList) {\n lines {\n stockCount\n isAvailable\n variantId\n }\n }\n }\n "], ["\n query checkStocks(\n $lines: [CheckStocksLineInput!]!\n $stockLocationIdList: [String!]\n ) {\n checkStocks(lines: $lines, stockLocationIdList: $stockLocationIdList) {\n lines {\n stockCount\n isAvailable\n variantId\n }\n }\n }\n "])));
|
|
24732
24750
|
_b.label = 1;
|
|
24733
24751
|
case 1:
|
|
24734
24752
|
_b.trys.push([1, 3, , 4]);
|
|
@@ -24738,6 +24756,7 @@ var IkasCheckoutAPI = /** @class */ (function () {
|
|
|
24738
24756
|
query: QUERY,
|
|
24739
24757
|
variables: {
|
|
24740
24758
|
lines: lines,
|
|
24759
|
+
stockLocationIdList: stockLocationIdList,
|
|
24741
24760
|
},
|
|
24742
24761
|
})];
|
|
24743
24762
|
case 2:
|
|
@@ -24849,13 +24868,13 @@ var IkasCountryAPI = /** @class */ (function () {
|
|
|
24849
24868
|
});
|
|
24850
24869
|
});
|
|
24851
24870
|
};
|
|
24852
|
-
IkasCountryAPI.listShippingCountries = function () {
|
|
24871
|
+
IkasCountryAPI.listShippingCountries = function (storefrontId) {
|
|
24853
24872
|
return __awaiter(this, void 0, void 0, function () {
|
|
24854
24873
|
var QUERY, _a, data, errors, err_2;
|
|
24855
24874
|
return __generator(this, function (_b) {
|
|
24856
24875
|
switch (_b.label) {
|
|
24857
24876
|
case 0:
|
|
24858
|
-
QUERY = src(templateObject_2$3 || (templateObject_2$3 = __makeTemplateObject(["\n query getAvailableShippingCountries {\n getAvailableShippingCountries\n }\n "], ["\n query getAvailableShippingCountries {\n getAvailableShippingCountries\n }\n "])));
|
|
24877
|
+
QUERY = src(templateObject_2$3 || (templateObject_2$3 = __makeTemplateObject(["\n query getAvailableShippingCountries($storefrontId: String!) {\n getAvailableShippingCountries(storefrontId: $storefrontId)\n }\n "], ["\n query getAvailableShippingCountries($storefrontId: String!) {\n getAvailableShippingCountries(storefrontId: $storefrontId)\n }\n "])));
|
|
24859
24878
|
_b.label = 1;
|
|
24860
24879
|
case 1:
|
|
24861
24880
|
_b.trys.push([1, 3, , 4]);
|
|
@@ -24863,6 +24882,9 @@ var IkasCountryAPI = /** @class */ (function () {
|
|
|
24863
24882
|
.getClient()
|
|
24864
24883
|
.query({
|
|
24865
24884
|
query: QUERY,
|
|
24885
|
+
variables: {
|
|
24886
|
+
storefrontId: storefrontId,
|
|
24887
|
+
},
|
|
24866
24888
|
})];
|
|
24867
24889
|
case 2:
|
|
24868
24890
|
_a = _b.sent(), data = _a.data, errors = _a.errors;
|
|
@@ -25856,150 +25878,6 @@ var IkasStateAPI = /** @class */ (function () {
|
|
|
25856
25878
|
}());
|
|
25857
25879
|
var templateObject_1$e;
|
|
25858
25880
|
|
|
25859
|
-
var IkasStorefrontDomain = /** @class */ (function () {
|
|
25860
|
-
function IkasStorefrontDomain(data) {
|
|
25861
|
-
if (data === void 0) { data = {}; }
|
|
25862
|
-
this.id = data.id || "";
|
|
25863
|
-
this.merchantDomainId = data.merchantDomainId || "";
|
|
25864
|
-
this.name = data.name || "";
|
|
25865
|
-
this.redirectDomainName = data.redirectDomainName || null;
|
|
25866
|
-
mobx.makeAutoObservable(this);
|
|
25867
|
-
}
|
|
25868
|
-
return IkasStorefrontDomain;
|
|
25869
|
-
}());
|
|
25870
|
-
|
|
25871
|
-
var IkasStorefrontLocation = /** @class */ (function () {
|
|
25872
|
-
function IkasStorefrontLocation(data) {
|
|
25873
|
-
if (data === void 0) { data = {}; }
|
|
25874
|
-
this.countryId = data.countryId || "";
|
|
25875
|
-
this.stateId = data.stateId || null;
|
|
25876
|
-
mobx.makeAutoObservable(this);
|
|
25877
|
-
}
|
|
25878
|
-
return IkasStorefrontLocation;
|
|
25879
|
-
}());
|
|
25880
|
-
|
|
25881
|
-
var IkasStorefrontRoute = /** @class */ (function () {
|
|
25882
|
-
function IkasStorefrontRoute(data) {
|
|
25883
|
-
if (data === void 0) { data = {}; }
|
|
25884
|
-
this.domainId = data.domainId || "";
|
|
25885
|
-
this.useSubPath = data.useSubPath || false;
|
|
25886
|
-
mobx.makeAutoObservable(this);
|
|
25887
|
-
}
|
|
25888
|
-
return IkasStorefrontRoute;
|
|
25889
|
-
}());
|
|
25890
|
-
|
|
25891
|
-
var IkasStorefrontRegion = /** @class */ (function () {
|
|
25892
|
-
function IkasStorefrontRegion(data) {
|
|
25893
|
-
if (data === void 0) { data = {}; }
|
|
25894
|
-
// Extra
|
|
25895
|
-
this.theme = new IkasTheme();
|
|
25896
|
-
this.id = data.id || "";
|
|
25897
|
-
this.locale = data.locale || "";
|
|
25898
|
-
this.themeJSON = data.themeJSON || "";
|
|
25899
|
-
this.shipping = data.shipping || null;
|
|
25900
|
-
this.paymentSettingsId = data.paymentSettingsId || null;
|
|
25901
|
-
this.priceListId = data.priceListId || null;
|
|
25902
|
-
this.locations = data.locations
|
|
25903
|
-
? data.locations.map(function (o) { return new IkasStorefrontLocation(o); })
|
|
25904
|
-
: [];
|
|
25905
|
-
this.routes = data.routes
|
|
25906
|
-
? data.routes.map(function (o) { return new IkasStorefrontRoute(o); })
|
|
25907
|
-
: null;
|
|
25908
|
-
this.termsOfService = data.termsOfService || "";
|
|
25909
|
-
this.privacyPolicy = data.privacyPolicy || "";
|
|
25910
|
-
this.returnPolicy = data.returnPolicy || "";
|
|
25911
|
-
try {
|
|
25912
|
-
this.theme = this.themeJSON
|
|
25913
|
-
? new IkasTheme(JSON.parse(this.themeJSON))
|
|
25914
|
-
: new IkasTheme();
|
|
25915
|
-
}
|
|
25916
|
-
catch (err) { }
|
|
25917
|
-
mobx.makeAutoObservable(this);
|
|
25918
|
-
}
|
|
25919
|
-
return IkasStorefrontRegion;
|
|
25920
|
-
}());
|
|
25921
|
-
|
|
25922
|
-
var IkasStorefront = /** @class */ (function () {
|
|
25923
|
-
function IkasStorefront(data) {
|
|
25924
|
-
if (data === void 0) { data = {}; }
|
|
25925
|
-
this.id = data.id || "";
|
|
25926
|
-
this.name = data.name || "";
|
|
25927
|
-
this.themeId = data.themeId || "";
|
|
25928
|
-
this.themeVersionId = data.themeVersionId || "";
|
|
25929
|
-
this.userId = data.userId || "";
|
|
25930
|
-
this.domains = data.domains
|
|
25931
|
-
? data.domains.map(function (o) { return new IkasStorefrontDomain(o); })
|
|
25932
|
-
: [];
|
|
25933
|
-
this.regions = data.regions
|
|
25934
|
-
? data.regions.map(function (o) { return new IkasStorefrontRegion(o); })
|
|
25935
|
-
: [];
|
|
25936
|
-
mobx.makeAutoObservable(this);
|
|
25937
|
-
}
|
|
25938
|
-
return IkasStorefront;
|
|
25939
|
-
}());
|
|
25940
|
-
|
|
25941
|
-
var IkasStorefrontAPI = /** @class */ (function () {
|
|
25942
|
-
function IkasStorefrontAPI() {
|
|
25943
|
-
}
|
|
25944
|
-
IkasStorefrontAPI.getStorefront = function (storefrontId) {
|
|
25945
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
25946
|
-
var QUERY, _a, data, errors;
|
|
25947
|
-
return __generator(this, function (_b) {
|
|
25948
|
-
switch (_b.label) {
|
|
25949
|
-
case 0:
|
|
25950
|
-
QUERY = src(templateObject_1$f || (templateObject_1$f = __makeTemplateObject(["\n query getStorefront($storefrontId: String!) {\n getStorefront(id: $storefrontId) {\n id\n name\n themeId\n themeVersionId\n userId\n # domains {\n # id\n # merchantDomainId\n # name\n # redirectDomainName\n # }\n regions {\n id\n locale\n # themeJSON\n privacyPolicy\n returnPolicy\n termsOfService\n }\n }\n }\n "], ["\n query getStorefront($storefrontId: String!) {\n getStorefront(id: $storefrontId) {\n id\n name\n themeId\n themeVersionId\n userId\n # domains {\n # id\n # merchantDomainId\n # name\n # redirectDomainName\n # }\n regions {\n id\n locale\n # themeJSON\n privacyPolicy\n returnPolicy\n termsOfService\n }\n }\n }\n "])));
|
|
25951
|
-
_b.label = 1;
|
|
25952
|
-
case 1:
|
|
25953
|
-
_b.trys.push([1, 3, , 4]);
|
|
25954
|
-
return [4 /*yield*/, apollo
|
|
25955
|
-
.getClient()
|
|
25956
|
-
.query({
|
|
25957
|
-
query: QUERY,
|
|
25958
|
-
variables: {
|
|
25959
|
-
storefrontId: storefrontId,
|
|
25960
|
-
},
|
|
25961
|
-
})];
|
|
25962
|
-
case 2:
|
|
25963
|
-
_a = _b.sent(), data = _a.data, errors = _a.errors;
|
|
25964
|
-
if (errors && errors.length) {
|
|
25965
|
-
console.log(errors);
|
|
25966
|
-
}
|
|
25967
|
-
if (data)
|
|
25968
|
-
return [2 /*return*/, new IkasStorefront(data.getStorefront)];
|
|
25969
|
-
return [3 /*break*/, 4];
|
|
25970
|
-
case 3:
|
|
25971
|
-
_b.sent();
|
|
25972
|
-
return [3 /*break*/, 4];
|
|
25973
|
-
case 4: return [2 /*return*/, new IkasStorefront()];
|
|
25974
|
-
}
|
|
25975
|
-
});
|
|
25976
|
-
});
|
|
25977
|
-
};
|
|
25978
|
-
return IkasStorefrontAPI;
|
|
25979
|
-
}());
|
|
25980
|
-
var templateObject_1$f;
|
|
25981
|
-
|
|
25982
|
-
var IkasThemeAPI = /** @class */ (function () {
|
|
25983
|
-
function IkasThemeAPI() {
|
|
25984
|
-
}
|
|
25985
|
-
IkasThemeAPI.fetchTheme = function () {
|
|
25986
|
-
return new Promise(function (resolve, reject) {
|
|
25987
|
-
var serverRuntimeConfig = getConfig__default['default']().serverRuntimeConfig;
|
|
25988
|
-
var themeJSONPath = serverRuntimeConfig.THEME_JSON_PATH || "./src/theme.json";
|
|
25989
|
-
fs__default['default'].readFile(themeJSONPath, {
|
|
25990
|
-
flag: "a+",
|
|
25991
|
-
}, function (err, file) {
|
|
25992
|
-
if (err) {
|
|
25993
|
-
return reject(err);
|
|
25994
|
-
}
|
|
25995
|
-
var result = file.length ? JSON.parse(file.toString()) : {};
|
|
25996
|
-
resolve(new IkasTheme(result));
|
|
25997
|
-
});
|
|
25998
|
-
});
|
|
25999
|
-
};
|
|
26000
|
-
return IkasThemeAPI;
|
|
26001
|
-
}());
|
|
26002
|
-
|
|
26003
25881
|
var IkasVariantTypeAPI = /** @class */ (function () {
|
|
26004
25882
|
function IkasVariantTypeAPI() {
|
|
26005
25883
|
}
|
|
@@ -26009,7 +25887,7 @@ var IkasVariantTypeAPI = /** @class */ (function () {
|
|
|
26009
25887
|
return __generator(this, function (_b) {
|
|
26010
25888
|
switch (_b.label) {
|
|
26011
25889
|
case 0:
|
|
26012
|
-
LIST_VARIANT_TYPE = src(templateObject_1$
|
|
25890
|
+
LIST_VARIANT_TYPE = src(templateObject_1$f || (templateObject_1$f = __makeTemplateObject(["\n query listVariantType($id: StringFilterInput!) {\n listVariantType(id: $id) {\n id\n createdAt\n updatedAt\n deleted\n name\n selectionType\n values {\n id\n createdAt\n updatedAt\n deleted\n name\n thumbnailImageId\n colorCode\n }\n }\n }\n "], ["\n query listVariantType($id: StringFilterInput!) {\n listVariantType(id: $id) {\n id\n createdAt\n updatedAt\n deleted\n name\n selectionType\n values {\n id\n createdAt\n updatedAt\n deleted\n name\n thumbnailImageId\n colorCode\n }\n }\n }\n "])));
|
|
26013
25891
|
_b.label = 1;
|
|
26014
25892
|
case 1:
|
|
26015
25893
|
_b.trys.push([1, 3, , 4]);
|
|
@@ -26055,7 +25933,7 @@ var IkasVariantTypeAPI = /** @class */ (function () {
|
|
|
26055
25933
|
};
|
|
26056
25934
|
return IkasVariantTypeAPI;
|
|
26057
25935
|
}());
|
|
26058
|
-
var templateObject_1$
|
|
25936
|
+
var templateObject_1$f;
|
|
26059
25937
|
|
|
26060
25938
|
function styleInject(css, ref) {
|
|
26061
25939
|
if ( ref === void 0 ) ref = {};
|
|
@@ -27245,6 +27123,11 @@ var IkasCartStore = /** @class */ (function () {
|
|
|
27245
27123
|
name: product.name,
|
|
27246
27124
|
},
|
|
27247
27125
|
},
|
|
27126
|
+
priceListId: IkasStorefrontConfig.priceListId || null,
|
|
27127
|
+
salesChannelId: IkasStorefrontConfig.salesChannelId,
|
|
27128
|
+
storefrontId: IkasStorefrontConfig.storefrontId,
|
|
27129
|
+
storefrontRoutingId: IkasStorefrontConfig.storefrontRoutingId,
|
|
27130
|
+
storefrontThemeId: IkasStorefrontConfig.storefrontThemeId,
|
|
27248
27131
|
};
|
|
27249
27132
|
return [4 /*yield*/, IkasCartAPI.saveItemToCart(input)];
|
|
27250
27133
|
case 1:
|
|
@@ -27285,6 +27168,11 @@ var IkasCartStore = /** @class */ (function () {
|
|
|
27285
27168
|
name: item.variant.name,
|
|
27286
27169
|
},
|
|
27287
27170
|
},
|
|
27171
|
+
priceListId: IkasStorefrontConfig.priceListId || null,
|
|
27172
|
+
salesChannelId: IkasStorefrontConfig.salesChannelId,
|
|
27173
|
+
storefrontId: IkasStorefrontConfig.storefrontId,
|
|
27174
|
+
storefrontRoutingId: IkasStorefrontConfig.storefrontRoutingId,
|
|
27175
|
+
storefrontThemeId: IkasStorefrontConfig.storefrontThemeId,
|
|
27288
27176
|
};
|
|
27289
27177
|
return [4 /*yield*/, IkasCartAPI.saveItemToCart(input)];
|
|
27290
27178
|
case 1:
|
|
@@ -27647,9 +27535,11 @@ function createCategoryBreadcrumbSchema(pageSpecificDataStr) {
|
|
|
27647
27535
|
|
|
27648
27536
|
var IkasCheckoutPage = mobxReactLite.observer(function (_a) {
|
|
27649
27537
|
var _b, _c, _d;
|
|
27650
|
-
var checkout = _a.checkout, queryParams = _a.queryParams;
|
|
27538
|
+
var checkout = _a.checkout, returnPolicy = _a.returnPolicy, privacyPolicy = _a.privacyPolicy, termsOfService = _a.termsOfService, queryParams = _a.queryParams;
|
|
27651
27539
|
var router$1 = router.useRouter();
|
|
27652
|
-
var vm = React.useState(function () {
|
|
27540
|
+
var vm = React.useState(function () {
|
|
27541
|
+
return new CheckoutViewModel(checkout, queryParams, router$1, returnPolicy, privacyPolicy, termsOfService);
|
|
27542
|
+
})[0];
|
|
27653
27543
|
React.useEffect(function () {
|
|
27654
27544
|
Analytics.beginCheckout(vm.checkout);
|
|
27655
27545
|
Analytics.checkoutStep(vm.checkout, vm.step);
|
|
@@ -27674,46 +27564,18 @@ var IkasCheckoutPage = mobxReactLite.observer(function (_a) {
|
|
|
27674
27564
|
var onPolicyModalClose = function () {
|
|
27675
27565
|
setPolicyModalText("");
|
|
27676
27566
|
};
|
|
27677
|
-
var onReturnPolicyClick = function () {
|
|
27678
|
-
|
|
27679
|
-
|
|
27680
|
-
|
|
27681
|
-
|
|
27682
|
-
|
|
27683
|
-
|
|
27684
|
-
|
|
27685
|
-
|
|
27686
|
-
|
|
27687
|
-
|
|
27688
|
-
|
|
27689
|
-
});
|
|
27690
|
-
}); };
|
|
27691
|
-
var onPrivacyPolicyClick = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
27692
|
-
var _a;
|
|
27693
|
-
return __generator(this, function (_b) {
|
|
27694
|
-
switch (_b.label) {
|
|
27695
|
-
case 0: return [4 /*yield*/, vm.getStorefront()];
|
|
27696
|
-
case 1:
|
|
27697
|
-
_b.sent();
|
|
27698
|
-
setPolicyModalTitle("Gizlilik Politikası");
|
|
27699
|
-
setPolicyModalText(((_a = vm.storefrontRegion) === null || _a === void 0 ? void 0 : _a.privacyPolicy) || "");
|
|
27700
|
-
return [2 /*return*/];
|
|
27701
|
-
}
|
|
27702
|
-
});
|
|
27703
|
-
}); };
|
|
27704
|
-
var onTermsOfServiceClick = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
27705
|
-
var _a;
|
|
27706
|
-
return __generator(this, function (_b) {
|
|
27707
|
-
switch (_b.label) {
|
|
27708
|
-
case 0: return [4 /*yield*/, vm.getStorefront()];
|
|
27709
|
-
case 1:
|
|
27710
|
-
_b.sent();
|
|
27711
|
-
setPolicyModalTitle("Hizmet Şartları");
|
|
27712
|
-
setPolicyModalText(((_a = vm.storefrontRegion) === null || _a === void 0 ? void 0 : _a.termsOfService) || "");
|
|
27713
|
-
return [2 /*return*/];
|
|
27714
|
-
}
|
|
27715
|
-
});
|
|
27716
|
-
}); };
|
|
27567
|
+
var onReturnPolicyClick = function () {
|
|
27568
|
+
setPolicyModalTitle("Para İade Politikası");
|
|
27569
|
+
setPolicyModalText(vm.returnPolicy);
|
|
27570
|
+
};
|
|
27571
|
+
var onPrivacyPolicyClick = function () {
|
|
27572
|
+
setPolicyModalTitle("Gizlilik Politikası");
|
|
27573
|
+
setPolicyModalText(vm.privacyPolicy);
|
|
27574
|
+
};
|
|
27575
|
+
var onTermsOfServiceClick = function () {
|
|
27576
|
+
setPolicyModalTitle("Hizmet Şartları");
|
|
27577
|
+
setPolicyModalText(vm.termsOfService);
|
|
27578
|
+
};
|
|
27717
27579
|
var onErrorClose = function () {
|
|
27718
27580
|
vm.error = undefined;
|
|
27719
27581
|
};
|
|
@@ -28333,6 +28195,206 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
28333
28195
|
Image: Image
|
|
28334
28196
|
});
|
|
28335
28197
|
|
|
28198
|
+
var IkasStorefrontLocalization = /** @class */ (function () {
|
|
28199
|
+
function IkasStorefrontLocalization(data) {
|
|
28200
|
+
this.id = data.id || "";
|
|
28201
|
+
this.isDefault = data.isDefault || false;
|
|
28202
|
+
this.locale = data.locale || "";
|
|
28203
|
+
this.name = data.name || "";
|
|
28204
|
+
}
|
|
28205
|
+
return IkasStorefrontLocalization;
|
|
28206
|
+
}());
|
|
28207
|
+
|
|
28208
|
+
var IkasStorefrontDomain = /** @class */ (function () {
|
|
28209
|
+
function IkasStorefrontDomain(data) {
|
|
28210
|
+
if (data === void 0) { data = {}; }
|
|
28211
|
+
this.id = data.id || "";
|
|
28212
|
+
this.merchantDomainId = data.merchantDomainId || "";
|
|
28213
|
+
this.name = data.name || "";
|
|
28214
|
+
this.redirectDomainName = data.redirectDomainName || null;
|
|
28215
|
+
this.isDefault = data.isDefault || false;
|
|
28216
|
+
mobx.makeAutoObservable(this);
|
|
28217
|
+
}
|
|
28218
|
+
return IkasStorefrontDomain;
|
|
28219
|
+
}());
|
|
28220
|
+
|
|
28221
|
+
var IkasStorefrontRouting = /** @class */ (function () {
|
|
28222
|
+
function IkasStorefrontRouting(data) {
|
|
28223
|
+
this.id = data.id || "";
|
|
28224
|
+
this.countryCodes = data.countryCodes || null;
|
|
28225
|
+
this.domain = data.domain || null;
|
|
28226
|
+
this.locale = data.locale || "";
|
|
28227
|
+
this.path = data.path || null;
|
|
28228
|
+
this.priceListId = data.priceListId || null;
|
|
28229
|
+
}
|
|
28230
|
+
return IkasStorefrontRouting;
|
|
28231
|
+
}());
|
|
28232
|
+
|
|
28233
|
+
var IkasStorefrontThemeStatus;
|
|
28234
|
+
(function (IkasStorefrontThemeStatus) {
|
|
28235
|
+
IkasStorefrontThemeStatus["WAITING"] = "WAITING";
|
|
28236
|
+
IkasStorefrontThemeStatus["READY"] = "READY";
|
|
28237
|
+
})(IkasStorefrontThemeStatus || (IkasStorefrontThemeStatus = {}));
|
|
28238
|
+
var IkasStorefrontTheme = /** @class */ (function () {
|
|
28239
|
+
function IkasStorefrontTheme(data) {
|
|
28240
|
+
this.id = data.id || "";
|
|
28241
|
+
this.isMainTheme = data.isMainTheme || false;
|
|
28242
|
+
this.name = data.name || "";
|
|
28243
|
+
this.status = data.status || IkasStorefrontThemeStatus.WAITING;
|
|
28244
|
+
this.themeId = data.themeId || "";
|
|
28245
|
+
this.themeVersionId = data.themeVersionId || "";
|
|
28246
|
+
}
|
|
28247
|
+
return IkasStorefrontTheme;
|
|
28248
|
+
}());
|
|
28249
|
+
|
|
28250
|
+
var IkasStorefrontThemeLocalization = /** @class */ (function () {
|
|
28251
|
+
function IkasStorefrontThemeLocalization(data) {
|
|
28252
|
+
this.id = data.id || "";
|
|
28253
|
+
this.locale = data.locale || "";
|
|
28254
|
+
this.storefrontId = data.storefrontId || "";
|
|
28255
|
+
this.storefrontThemeId = data.storefrontThemeId || "";
|
|
28256
|
+
this.themeJson = data.themeJson || "";
|
|
28257
|
+
this.privacyPolicy = data.privacyPolicy || null;
|
|
28258
|
+
this.returnPolicy = data.returnPolicy || null;
|
|
28259
|
+
this.termsOfService = data.termsOfService || null;
|
|
28260
|
+
}
|
|
28261
|
+
return IkasStorefrontThemeLocalization;
|
|
28262
|
+
}());
|
|
28263
|
+
|
|
28264
|
+
var StorefrontStatus;
|
|
28265
|
+
(function (StorefrontStatus) {
|
|
28266
|
+
StorefrontStatus["WAITING"] = "WAITING";
|
|
28267
|
+
StorefrontStatus["READY"] = "READY";
|
|
28268
|
+
})(StorefrontStatus || (StorefrontStatus = {}));
|
|
28269
|
+
var IkasStorefront = /** @class */ (function () {
|
|
28270
|
+
function IkasStorefront(data) {
|
|
28271
|
+
if (data === void 0) { data = {}; }
|
|
28272
|
+
this.id = data.id || "";
|
|
28273
|
+
this.name = data.name || "";
|
|
28274
|
+
this.status = data.status || StorefrontStatus.WAITING;
|
|
28275
|
+
this.mainStorefrontThemeId = data.mainStorefrontThemeId || null;
|
|
28276
|
+
this.emailSettingsId = data.emailSettingsId || null;
|
|
28277
|
+
this.salesChannelId = data.salesChannelId || null;
|
|
28278
|
+
this.gtmId = data.gtmId || null;
|
|
28279
|
+
this.fbpId = data.fbpId || null;
|
|
28280
|
+
// Sub Models
|
|
28281
|
+
this.localizations = data.localizations
|
|
28282
|
+
? data.localizations.map(function (l) { return new IkasStorefrontLocalization(l); })
|
|
28283
|
+
: [];
|
|
28284
|
+
this.routings = data.routings
|
|
28285
|
+
? data.routings.map(function (r) { return new IkasStorefrontRouting(r); })
|
|
28286
|
+
: [];
|
|
28287
|
+
this.domains = data.domains
|
|
28288
|
+
? data.domains.map(function (o) { return new IkasStorefrontDomain(o); })
|
|
28289
|
+
: [];
|
|
28290
|
+
this.themes = data.themes
|
|
28291
|
+
? data.themes.map(function (t) { return new IkasStorefrontTheme(t); })
|
|
28292
|
+
: [];
|
|
28293
|
+
this.regions = data.regions
|
|
28294
|
+
? data.regions.map(function (r) { return new IkasStorefrontThemeLocalization(r); })
|
|
28295
|
+
: [];
|
|
28296
|
+
}
|
|
28297
|
+
return IkasStorefront;
|
|
28298
|
+
}());
|
|
28299
|
+
|
|
28300
|
+
var SettingsHelper = /** @class */ (function () {
|
|
28301
|
+
function SettingsHelper() {
|
|
28302
|
+
}
|
|
28303
|
+
SettingsHelper.getSettings = function (locale) {
|
|
28304
|
+
return new Promise(function (resolve) {
|
|
28305
|
+
var serverRuntimeConfig = getConfig__default['default']().serverRuntimeConfig;
|
|
28306
|
+
var settings = serverRuntimeConfig.SETTINGS;
|
|
28307
|
+
var storefront = new IkasStorefront(settings.storefront);
|
|
28308
|
+
var localizationMap = settings.localizationMap;
|
|
28309
|
+
var themeJSONPath = localizationMap[locale];
|
|
28310
|
+
var routing = storefront.routings.find(function (r) { return r.id === locale || r.path === locale; });
|
|
28311
|
+
if (!themeJSONPath || !routing) {
|
|
28312
|
+
return resolve(null);
|
|
28313
|
+
}
|
|
28314
|
+
fs__default['default'].readFile(themeJSONPath, {
|
|
28315
|
+
flag: "a+",
|
|
28316
|
+
}, function (err, file) {
|
|
28317
|
+
if (err) {
|
|
28318
|
+
return resolve(null);
|
|
28319
|
+
}
|
|
28320
|
+
var result = file.length ? JSON.parse(file.toString()) : {};
|
|
28321
|
+
resolve({
|
|
28322
|
+
storefront: storefront,
|
|
28323
|
+
theme: new IkasTheme(result),
|
|
28324
|
+
routing: routing,
|
|
28325
|
+
});
|
|
28326
|
+
});
|
|
28327
|
+
});
|
|
28328
|
+
};
|
|
28329
|
+
SettingsHelper.getPageData = function (context, isServer, pageType) {
|
|
28330
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
28331
|
+
var locale, settings, storefront, theme, routing, provider;
|
|
28332
|
+
return __generator(this, function (_a) {
|
|
28333
|
+
switch (_a.label) {
|
|
28334
|
+
case 0:
|
|
28335
|
+
locale = context.locale || context.defaultLocale || "en";
|
|
28336
|
+
return [4 /*yield*/, SettingsHelper.getSettings(locale)];
|
|
28337
|
+
case 1:
|
|
28338
|
+
settings = _a.sent();
|
|
28339
|
+
if (!settings ||
|
|
28340
|
+
!settings.storefront.mainStorefrontThemeId ||
|
|
28341
|
+
!settings.storefront.salesChannelId ||
|
|
28342
|
+
!settings.routing.priceListId) {
|
|
28343
|
+
return [2 /*return*/, {
|
|
28344
|
+
props: {},
|
|
28345
|
+
notFound: true,
|
|
28346
|
+
}];
|
|
28347
|
+
}
|
|
28348
|
+
storefront = settings.storefront, theme = settings.theme, routing = settings.routing;
|
|
28349
|
+
IkasStorefrontConfig.storefrontId = storefront.id;
|
|
28350
|
+
IkasStorefrontConfig.storefrontRoutingId = routing.id;
|
|
28351
|
+
IkasStorefrontConfig.storefrontThemeId = storefront.mainStorefrontThemeId;
|
|
28352
|
+
IkasStorefrontConfig.salesChannelId = storefront.salesChannelId;
|
|
28353
|
+
IkasStorefrontConfig.priceListId = routing.priceListId;
|
|
28354
|
+
provider = new IkasPageDataProvider(theme, context.params, pageType);
|
|
28355
|
+
return [4 /*yield*/, provider.getPageData()];
|
|
28356
|
+
case 2:
|
|
28357
|
+
_a.sent();
|
|
28358
|
+
if (!provider.page) {
|
|
28359
|
+
return [2 /*return*/, {
|
|
28360
|
+
props: {},
|
|
28361
|
+
notFound: true,
|
|
28362
|
+
}];
|
|
28363
|
+
}
|
|
28364
|
+
if (isServer)
|
|
28365
|
+
return [2 /*return*/, provider.nextPageData];
|
|
28366
|
+
else
|
|
28367
|
+
return [2 /*return*/, {
|
|
28368
|
+
props: __assign(__assign({}, provider.nextPageData.props), { pageSpecificDataStr: JSON.stringify(provider.pageSpecificData || {}) }),
|
|
28369
|
+
revalidate: 60,
|
|
28370
|
+
}];
|
|
28371
|
+
}
|
|
28372
|
+
});
|
|
28373
|
+
});
|
|
28374
|
+
};
|
|
28375
|
+
SettingsHelper.getStaticProps = function (context, pageType) {
|
|
28376
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
28377
|
+
return __generator(this, function (_a) {
|
|
28378
|
+
switch (_a.label) {
|
|
28379
|
+
case 0: return [4 /*yield*/, SettingsHelper.getPageData(context, false, pageType)];
|
|
28380
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
28381
|
+
}
|
|
28382
|
+
});
|
|
28383
|
+
});
|
|
28384
|
+
};
|
|
28385
|
+
SettingsHelper.getServerSideProps = function (context, pageType) {
|
|
28386
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
28387
|
+
return __generator(this, function (_a) {
|
|
28388
|
+
switch (_a.label) {
|
|
28389
|
+
case 0: return [4 /*yield*/, SettingsHelper.getPageData(context, false, pageType)];
|
|
28390
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
28391
|
+
}
|
|
28392
|
+
});
|
|
28393
|
+
});
|
|
28394
|
+
};
|
|
28395
|
+
return SettingsHelper;
|
|
28396
|
+
}());
|
|
28397
|
+
|
|
28336
28398
|
var Page = function (_a) {
|
|
28337
28399
|
var page = _a.page, propValuesStr = _a.propValuesStr, settingsStr = _a.settingsStr, merchantSettings = _a.merchantSettings;
|
|
28338
28400
|
var router$1 = router.useRouter();
|
|
@@ -28340,17 +28402,10 @@ var Page = function (_a) {
|
|
|
28340
28402
|
return (React.createElement(IkasPage, { merchantSettings: merchantSettings, settingsStr: settingsStr, page: page, propValues: propValues, addOgpMetas: true }));
|
|
28341
28403
|
};
|
|
28342
28404
|
var getStaticProps = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
28343
|
-
var theme, provider;
|
|
28344
28405
|
return __generator(this, function (_a) {
|
|
28345
28406
|
switch (_a.label) {
|
|
28346
|
-
case 0: return [4 /*yield*/,
|
|
28347
|
-
case 1:
|
|
28348
|
-
theme = _a.sent();
|
|
28349
|
-
provider = new IkasPageDataProvider(theme, context.params, exports.IkasThemePageType.INDEX);
|
|
28350
|
-
return [4 /*yield*/, provider.getPageData()];
|
|
28351
|
-
case 2:
|
|
28352
|
-
_a.sent();
|
|
28353
|
-
return [2 /*return*/, __assign(__assign({}, provider.nextPageData), { revalidate: 60 })];
|
|
28407
|
+
case 0: return [4 /*yield*/, SettingsHelper.getStaticProps(context, exports.IkasThemePageType.INDEX)];
|
|
28408
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
28354
28409
|
}
|
|
28355
28410
|
});
|
|
28356
28411
|
}); };
|
|
@@ -28392,6 +28447,7 @@ var getStaticPaths = function (context) { return __awaiter(void 0, void 0, void
|
|
|
28392
28447
|
productMetaData = metaData.filter(function (m) { return m.targetType && m.targetType === exports.IkasHTMLMetaDataTargetType.PRODUCT; });
|
|
28393
28448
|
return [4 /*yield*/, IkasProductSearchAPI.searchProducts({
|
|
28394
28449
|
productIdList: productMetaData.map(function (p) { return p.targetId; }),
|
|
28450
|
+
priceListId: IkasStorefrontConfig.priceListId,
|
|
28395
28451
|
})];
|
|
28396
28452
|
case 2:
|
|
28397
28453
|
productsResponse = _b.sent();
|
|
@@ -28438,25 +28494,10 @@ var getStaticPaths = function (context) { return __awaiter(void 0, void 0, void
|
|
|
28438
28494
|
});
|
|
28439
28495
|
}); };
|
|
28440
28496
|
var getStaticProps$1 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
28441
|
-
var theme, provider;
|
|
28442
28497
|
return __generator(this, function (_a) {
|
|
28443
28498
|
switch (_a.label) {
|
|
28444
|
-
case 0: return [4 /*yield*/,
|
|
28445
|
-
case 1:
|
|
28446
|
-
theme = _a.sent();
|
|
28447
|
-
provider = new IkasPageDataProvider(theme, context.params, undefined);
|
|
28448
|
-
return [4 /*yield*/, provider.getPageData()];
|
|
28449
|
-
case 2:
|
|
28450
|
-
_a.sent();
|
|
28451
|
-
if (!provider.page) {
|
|
28452
|
-
return [2 /*return*/, {
|
|
28453
|
-
notFound: true,
|
|
28454
|
-
}];
|
|
28455
|
-
}
|
|
28456
|
-
return [2 /*return*/, {
|
|
28457
|
-
props: __assign(__assign({}, provider.nextPageData.props), { pageSpecificDataStr: JSON.stringify(provider.pageSpecificData || {}) }),
|
|
28458
|
-
revalidate: 60,
|
|
28459
|
-
}];
|
|
28499
|
+
case 0: return [4 /*yield*/, SettingsHelper.getStaticProps(context)];
|
|
28500
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
28460
28501
|
}
|
|
28461
28502
|
});
|
|
28462
28503
|
}); };
|
|
@@ -28501,19 +28542,38 @@ var Page$2 = function (_a) {
|
|
|
28501
28542
|
return (React.createElement(IkasPage, { page: page, settingsStr: settingsStr, propValues: propValues }));
|
|
28502
28543
|
};
|
|
28503
28544
|
var getStaticPaths$1 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
28504
|
-
var
|
|
28545
|
+
var allSettings, customPagePaths;
|
|
28505
28546
|
return __generator(this, function (_a) {
|
|
28506
28547
|
switch (_a.label) {
|
|
28507
|
-
case 0:
|
|
28548
|
+
case 0:
|
|
28549
|
+
if (!context.locales)
|
|
28550
|
+
return [2 /*return*/, {
|
|
28551
|
+
paths: [],
|
|
28552
|
+
fallback: "blocking",
|
|
28553
|
+
}];
|
|
28554
|
+
return [4 /*yield*/, Promise.all(context.locales.map(function (locale) { return SettingsHelper.getSettings(locale); }))];
|
|
28508
28555
|
case 1:
|
|
28509
|
-
|
|
28510
|
-
|
|
28511
|
-
|
|
28512
|
-
|
|
28513
|
-
|
|
28556
|
+
allSettings = (_a.sent());
|
|
28557
|
+
customPagePaths = [];
|
|
28558
|
+
allSettings.forEach(function (_a) {
|
|
28559
|
+
var theme = _a.theme, routing = _a.routing;
|
|
28560
|
+
if (!theme)
|
|
28561
|
+
return;
|
|
28562
|
+
var customPages = theme.pages.filter(function (p) { return p.type === exports.IkasThemePageType.CUSTOM; });
|
|
28563
|
+
customPages.forEach(function (customPage) {
|
|
28564
|
+
if (customPage.slug &&
|
|
28565
|
+
!customPagePaths.some(function (p) { return p.params.slug === customPage.slug; })) {
|
|
28566
|
+
customPagePaths.push({
|
|
28567
|
+
params: { slug: customPage.slug },
|
|
28568
|
+
locale: routing.locale,
|
|
28569
|
+
});
|
|
28570
|
+
}
|
|
28571
|
+
});
|
|
28572
|
+
});
|
|
28514
28573
|
return [2 /*return*/, {
|
|
28515
28574
|
paths: customPagePaths.map(function (p) { return ({
|
|
28516
|
-
params: p,
|
|
28575
|
+
params: p.params,
|
|
28576
|
+
locale: p.locale,
|
|
28517
28577
|
}); }),
|
|
28518
28578
|
fallback: "blocking",
|
|
28519
28579
|
}];
|
|
@@ -28521,17 +28581,10 @@ var getStaticPaths$1 = function (context) { return __awaiter(void 0, void 0, voi
|
|
|
28521
28581
|
});
|
|
28522
28582
|
}); };
|
|
28523
28583
|
var getStaticProps$2 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
28524
|
-
var theme, provider;
|
|
28525
28584
|
return __generator(this, function (_a) {
|
|
28526
28585
|
switch (_a.label) {
|
|
28527
|
-
case 0: return [4 /*yield*/,
|
|
28528
|
-
case 1:
|
|
28529
|
-
theme = _a.sent();
|
|
28530
|
-
provider = new IkasPageDataProvider(theme, context.params, exports.IkasThemePageType.CUSTOM);
|
|
28531
|
-
return [4 /*yield*/, provider.getPageData()];
|
|
28532
|
-
case 2:
|
|
28533
|
-
_a.sent();
|
|
28534
|
-
return [2 /*return*/, __assign(__assign({}, provider.nextPageData), { revalidate: 60 })];
|
|
28586
|
+
case 0: return [4 /*yield*/, SettingsHelper.getStaticProps(context, exports.IkasThemePageType.CUSTOM)];
|
|
28587
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
28535
28588
|
}
|
|
28536
28589
|
});
|
|
28537
28590
|
}); };
|
|
@@ -28544,18 +28597,38 @@ var _slug_ = /*#__PURE__*/Object.freeze({
|
|
|
28544
28597
|
});
|
|
28545
28598
|
|
|
28546
28599
|
var CheckoutPage = function (_a) {
|
|
28547
|
-
var checkoutStr = _a.checkoutStr,
|
|
28600
|
+
var checkoutStr = _a.checkoutStr, others = __rest(_a, ["checkoutStr"]);
|
|
28548
28601
|
Analytics.disableHTML();
|
|
28549
28602
|
var checkout = new IkasCheckout(JSON.parse(checkoutStr));
|
|
28550
|
-
return React.createElement(IkasCheckoutPage, { checkout: checkout,
|
|
28603
|
+
return React.createElement(IkasCheckoutPage, __assign({ checkout: checkout }, others));
|
|
28551
28604
|
};
|
|
28552
28605
|
var _id_ = mobxReactLite.observer(CheckoutPage);
|
|
28553
28606
|
var getServerSideProps = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
28554
|
-
var id, redirect, checkout;
|
|
28607
|
+
var id, locale, settings, storefront, routing, redirect, checkout, region;
|
|
28555
28608
|
return __generator(this, function (_a) {
|
|
28556
28609
|
switch (_a.label) {
|
|
28557
28610
|
case 0:
|
|
28558
28611
|
id = context.query.id;
|
|
28612
|
+
locale = context.locale || context.defaultLocale || "en";
|
|
28613
|
+
return [4 /*yield*/, SettingsHelper.getSettings(locale)];
|
|
28614
|
+
case 1:
|
|
28615
|
+
settings = _a.sent();
|
|
28616
|
+
// TODO maybe remove this and convert this page to static
|
|
28617
|
+
if (!settings ||
|
|
28618
|
+
!settings.storefront.mainStorefrontThemeId ||
|
|
28619
|
+
!settings.storefront.salesChannelId ||
|
|
28620
|
+
!settings.routing.priceListId) {
|
|
28621
|
+
return [2 /*return*/, {
|
|
28622
|
+
props: {},
|
|
28623
|
+
notFound: true,
|
|
28624
|
+
}];
|
|
28625
|
+
}
|
|
28626
|
+
storefront = settings.storefront, routing = settings.routing;
|
|
28627
|
+
IkasStorefrontConfig.storefrontId = storefront.id;
|
|
28628
|
+
IkasStorefrontConfig.storefrontRoutingId = routing.id;
|
|
28629
|
+
IkasStorefrontConfig.storefrontThemeId = storefront.mainStorefrontThemeId;
|
|
28630
|
+
IkasStorefrontConfig.salesChannelId = storefront.salesChannelId;
|
|
28631
|
+
IkasStorefrontConfig.priceListId = routing.priceListId;
|
|
28559
28632
|
redirect = function () {
|
|
28560
28633
|
context.res.writeHead(302, { Location: "/" });
|
|
28561
28634
|
context.res.end();
|
|
@@ -28565,12 +28638,16 @@ var getServerSideProps = function (context) { return __awaiter(void 0, void 0, v
|
|
|
28565
28638
|
return [2 /*return*/, redirect()];
|
|
28566
28639
|
}
|
|
28567
28640
|
return [4 /*yield*/, IkasCheckoutAPI.getCheckoutById(id)];
|
|
28568
|
-
case
|
|
28641
|
+
case 2:
|
|
28569
28642
|
checkout = _a.sent();
|
|
28570
28643
|
if (checkout) {
|
|
28644
|
+
region = settings.storefront.regions.find(function (r) { return r.id === storefront.mainStorefrontThemeId; });
|
|
28571
28645
|
return [2 /*return*/, {
|
|
28572
28646
|
props: {
|
|
28573
28647
|
checkoutStr: JSON.stringify(checkout),
|
|
28648
|
+
returnPolicy: (region === null || region === void 0 ? void 0 : region.returnPolicy) || "",
|
|
28649
|
+
privacyPolicy: (region === null || region === void 0 ? void 0 : region.privacyPolicy) || "",
|
|
28650
|
+
termsOfService: (region === null || region === void 0 ? void 0 : region.termsOfService) || "",
|
|
28574
28651
|
queryParams: context.query,
|
|
28575
28652
|
},
|
|
28576
28653
|
}];
|
|
@@ -28595,17 +28672,10 @@ var Page$3 = function (_a) {
|
|
|
28595
28672
|
return (React.createElement(IkasPage, { settingsStr: settingsStr, page: page, propValues: propValues }));
|
|
28596
28673
|
};
|
|
28597
28674
|
var getStaticProps$3 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
28598
|
-
var theme, provider;
|
|
28599
28675
|
return __generator(this, function (_a) {
|
|
28600
28676
|
switch (_a.label) {
|
|
28601
|
-
case 0: return [4 /*yield*/,
|
|
28602
|
-
case 1:
|
|
28603
|
-
theme = _a.sent();
|
|
28604
|
-
provider = new IkasPageDataProvider(theme, context.params, exports.IkasThemePageType.ACCOUNT);
|
|
28605
|
-
return [4 /*yield*/, provider.getPageData()];
|
|
28606
|
-
case 2:
|
|
28607
|
-
_a.sent();
|
|
28608
|
-
return [2 /*return*/, __assign(__assign({}, provider.nextPageData), { revalidate: 60 })];
|
|
28677
|
+
case 0: return [4 /*yield*/, SettingsHelper.getStaticProps(context, exports.IkasThemePageType.ACCOUNT)];
|
|
28678
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
28609
28679
|
}
|
|
28610
28680
|
});
|
|
28611
28681
|
}); };
|
|
@@ -28623,17 +28693,10 @@ var Page$4 = function (_a) {
|
|
|
28623
28693
|
return (React.createElement(IkasPage, { settingsStr: settingsStr, page: page, propValues: propValues }));
|
|
28624
28694
|
};
|
|
28625
28695
|
var getStaticProps$4 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
28626
|
-
var theme, provider;
|
|
28627
28696
|
return __generator(this, function (_a) {
|
|
28628
28697
|
switch (_a.label) {
|
|
28629
|
-
case 0: return [4 /*yield*/,
|
|
28630
|
-
case 1:
|
|
28631
|
-
theme = _a.sent();
|
|
28632
|
-
provider = new IkasPageDataProvider(theme, context.params, exports.IkasThemePageType.ADDRESSES);
|
|
28633
|
-
return [4 /*yield*/, provider.getPageData()];
|
|
28634
|
-
case 2:
|
|
28635
|
-
_a.sent();
|
|
28636
|
-
return [2 /*return*/, __assign(__assign({}, provider.nextPageData), { revalidate: 60 })];
|
|
28698
|
+
case 0: return [4 /*yield*/, SettingsHelper.getStaticProps(context, exports.IkasThemePageType.ADDRESSES)];
|
|
28699
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
28637
28700
|
}
|
|
28638
28701
|
});
|
|
28639
28702
|
}); };
|
|
@@ -28651,17 +28714,10 @@ var Page$5 = function (_a) {
|
|
|
28651
28714
|
return (React.createElement(IkasPage, { settingsStr: settingsStr, page: page, propValues: propValues }));
|
|
28652
28715
|
};
|
|
28653
28716
|
var getStaticProps$5 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
28654
|
-
var theme, provider;
|
|
28655
28717
|
return __generator(this, function (_a) {
|
|
28656
28718
|
switch (_a.label) {
|
|
28657
|
-
case 0: return [4 /*yield*/,
|
|
28658
|
-
case 1:
|
|
28659
|
-
theme = _a.sent();
|
|
28660
|
-
provider = new IkasPageDataProvider(theme, context.params, exports.IkasThemePageType.ORDERS);
|
|
28661
|
-
return [4 /*yield*/, provider.getPageData()];
|
|
28662
|
-
case 2:
|
|
28663
|
-
_a.sent();
|
|
28664
|
-
return [2 /*return*/, __assign(__assign({}, provider.nextPageData), { revalidate: 60 })];
|
|
28719
|
+
case 0: return [4 /*yield*/, SettingsHelper.getStaticProps(context, exports.IkasThemePageType.ORDERS)];
|
|
28720
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
28665
28721
|
}
|
|
28666
28722
|
});
|
|
28667
28723
|
}); };
|
|
@@ -28679,17 +28735,10 @@ var Page$6 = function (_a) {
|
|
|
28679
28735
|
return (React.createElement(IkasPage, { settingsStr: settingsStr, page: page, propValues: propValues }));
|
|
28680
28736
|
};
|
|
28681
28737
|
var getServerSideProps$1 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
28682
|
-
var theme, provider;
|
|
28683
28738
|
return __generator(this, function (_a) {
|
|
28684
28739
|
switch (_a.label) {
|
|
28685
|
-
case 0: return [4 /*yield*/,
|
|
28686
|
-
case 1:
|
|
28687
|
-
theme = _a.sent();
|
|
28688
|
-
provider = new IkasPageDataProvider(theme, context.params, exports.IkasThemePageType.ORDER_DETAIL);
|
|
28689
|
-
return [4 /*yield*/, provider.getPageData()];
|
|
28690
|
-
case 2:
|
|
28691
|
-
_a.sent();
|
|
28692
|
-
return [2 /*return*/, provider.nextPageData];
|
|
28740
|
+
case 0: return [4 /*yield*/, SettingsHelper.getServerSideProps(context, exports.IkasThemePageType.ORDER_DETAIL)];
|
|
28741
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
28693
28742
|
}
|
|
28694
28743
|
});
|
|
28695
28744
|
}); };
|
|
@@ -28707,17 +28756,10 @@ var Page$7 = function (_a) {
|
|
|
28707
28756
|
return (React.createElement(IkasPage, { merchantSettings: merchantSettings, settingsStr: settingsStr, page: page, propValues: propValues }));
|
|
28708
28757
|
};
|
|
28709
28758
|
var getStaticProps$6 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
28710
|
-
var theme, provider;
|
|
28711
28759
|
return __generator(this, function (_a) {
|
|
28712
28760
|
switch (_a.label) {
|
|
28713
|
-
case 0: return [4 /*yield*/,
|
|
28714
|
-
case 1:
|
|
28715
|
-
theme = _a.sent();
|
|
28716
|
-
provider = new IkasPageDataProvider(theme, context.params, exports.IkasThemePageType.LOGIN);
|
|
28717
|
-
return [4 /*yield*/, provider.getPageData()];
|
|
28718
|
-
case 2:
|
|
28719
|
-
_a.sent();
|
|
28720
|
-
return [2 /*return*/, __assign(__assign({}, provider.nextPageData), { revalidate: 60 })];
|
|
28761
|
+
case 0: return [4 /*yield*/, SettingsHelper.getStaticProps(context, exports.IkasThemePageType.LOGIN)];
|
|
28762
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
28721
28763
|
}
|
|
28722
28764
|
});
|
|
28723
28765
|
}); };
|
|
@@ -28735,17 +28777,10 @@ var Page$8 = function (_a) {
|
|
|
28735
28777
|
return (React.createElement(IkasPage, { merchantSettings: merchantSettings, settingsStr: settingsStr, page: page, propValues: propValues }));
|
|
28736
28778
|
};
|
|
28737
28779
|
var getStaticProps$7 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
28738
|
-
var theme, provider;
|
|
28739
28780
|
return __generator(this, function (_a) {
|
|
28740
28781
|
switch (_a.label) {
|
|
28741
|
-
case 0: return [4 /*yield*/,
|
|
28742
|
-
case 1:
|
|
28743
|
-
theme = _a.sent();
|
|
28744
|
-
provider = new IkasPageDataProvider(theme, context.params, exports.IkasThemePageType.REGISTER);
|
|
28745
|
-
return [4 /*yield*/, provider.getPageData()];
|
|
28746
|
-
case 2:
|
|
28747
|
-
_a.sent();
|
|
28748
|
-
return [2 /*return*/, __assign(__assign({}, provider.nextPageData), { revalidate: 60 })];
|
|
28782
|
+
case 0: return [4 /*yield*/, SettingsHelper.getStaticProps(context, exports.IkasThemePageType.REGISTER)];
|
|
28783
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
28749
28784
|
}
|
|
28750
28785
|
});
|
|
28751
28786
|
}); };
|
|
@@ -28763,17 +28798,10 @@ var Page$9 = function (_a) {
|
|
|
28763
28798
|
return (React.createElement(IkasPage, { merchantSettings: merchantSettings, settingsStr: settingsStr, page: page, propValues: propValues }));
|
|
28764
28799
|
};
|
|
28765
28800
|
var getStaticProps$8 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
28766
|
-
var theme, provider;
|
|
28767
28801
|
return __generator(this, function (_a) {
|
|
28768
28802
|
switch (_a.label) {
|
|
28769
|
-
case 0: return [4 /*yield*/,
|
|
28770
|
-
case 1:
|
|
28771
|
-
theme = _a.sent();
|
|
28772
|
-
provider = new IkasPageDataProvider(theme, context.params, exports.IkasThemePageType.FORGOT_PASSWORD);
|
|
28773
|
-
return [4 /*yield*/, provider.getPageData()];
|
|
28774
|
-
case 2:
|
|
28775
|
-
_a.sent();
|
|
28776
|
-
return [2 /*return*/, __assign(__assign({}, provider.nextPageData), { revalidate: 60 })];
|
|
28803
|
+
case 0: return [4 /*yield*/, SettingsHelper.getStaticProps(context, exports.IkasThemePageType.FORGOT_PASSWORD)];
|
|
28804
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
28777
28805
|
}
|
|
28778
28806
|
});
|
|
28779
28807
|
}); };
|
|
@@ -28791,17 +28819,10 @@ var Page$a = function (_a) {
|
|
|
28791
28819
|
return (React.createElement(IkasPage, { merchantSettings: merchantSettings, settingsStr: settingsStr, page: page, propValues: propValues }));
|
|
28792
28820
|
};
|
|
28793
28821
|
var getStaticProps$9 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
28794
|
-
var theme, provider;
|
|
28795
28822
|
return __generator(this, function (_a) {
|
|
28796
28823
|
switch (_a.label) {
|
|
28797
|
-
case 0: return [4 /*yield*/,
|
|
28798
|
-
case 1:
|
|
28799
|
-
theme = _a.sent();
|
|
28800
|
-
provider = new IkasPageDataProvider(theme, context.params, exports.IkasThemePageType.RECOVER_PASSWORD);
|
|
28801
|
-
return [4 /*yield*/, provider.getPageData()];
|
|
28802
|
-
case 2:
|
|
28803
|
-
_a.sent();
|
|
28804
|
-
return [2 /*return*/, __assign(__assign({}, provider.nextPageData), { revalidate: 60 })];
|
|
28824
|
+
case 0: return [4 /*yield*/, SettingsHelper.getStaticProps(context, exports.IkasThemePageType.RECOVER_PASSWORD)];
|
|
28825
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
28805
28826
|
}
|
|
28806
28827
|
});
|
|
28807
28828
|
}); };
|
|
@@ -28823,17 +28844,10 @@ var Page$b = function (_a) {
|
|
|
28823
28844
|
return (React.createElement(IkasPage, { settingsStr: settingsStr, page: page, propValues: propValues }));
|
|
28824
28845
|
};
|
|
28825
28846
|
var getStaticProps$a = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
28826
|
-
var theme, provider;
|
|
28827
28847
|
return __generator(this, function (_a) {
|
|
28828
28848
|
switch (_a.label) {
|
|
28829
|
-
case 0: return [4 /*yield*/,
|
|
28830
|
-
case 1:
|
|
28831
|
-
theme = _a.sent();
|
|
28832
|
-
provider = new IkasPageDataProvider(theme, context.params, exports.IkasThemePageType.CART);
|
|
28833
|
-
return [4 /*yield*/, provider.getPageData()];
|
|
28834
|
-
case 2:
|
|
28835
|
-
_a.sent();
|
|
28836
|
-
return [2 /*return*/, __assign(__assign({}, provider.nextPageData), { revalidate: 60 })];
|
|
28849
|
+
case 0: return [4 /*yield*/, SettingsHelper.getStaticProps(context, exports.IkasThemePageType.CART)];
|
|
28850
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
28837
28851
|
}
|
|
28838
28852
|
});
|
|
28839
28853
|
}); };
|
|
@@ -28862,17 +28876,10 @@ var Page$d = function (_a) {
|
|
|
28862
28876
|
return (React.createElement(IkasPage, { settingsStr: settingsStr, page: page, propValues: propValues }));
|
|
28863
28877
|
};
|
|
28864
28878
|
var getStaticProps$b = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
28865
|
-
var theme, provider;
|
|
28866
28879
|
return __generator(this, function (_a) {
|
|
28867
28880
|
switch (_a.label) {
|
|
28868
|
-
case 0: return [4 /*yield*/,
|
|
28869
|
-
case 1:
|
|
28870
|
-
theme = _a.sent();
|
|
28871
|
-
provider = new IkasPageDataProvider(theme, context.params, exports.IkasThemePageType.FAVORITE_PRODUCTS);
|
|
28872
|
-
return [4 /*yield*/, provider.getPageData()];
|
|
28873
|
-
case 2:
|
|
28874
|
-
_a.sent();
|
|
28875
|
-
return [2 /*return*/, __assign(__assign({}, provider.nextPageData), { revalidate: 60 })];
|
|
28881
|
+
case 0: return [4 /*yield*/, SettingsHelper.getStaticProps(context, exports.IkasThemePageType.FAVORITE_PRODUCTS)];
|
|
28882
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
28876
28883
|
}
|
|
28877
28884
|
});
|
|
28878
28885
|
}); };
|
|
@@ -28898,17 +28905,10 @@ var Page$e = function (_a) {
|
|
|
28898
28905
|
return (React.createElement(IkasPage, { merchantSettings: merchantSettings, settingsStr: settingsStr, page: page, propValues: propValues, addOgpMetas: true }));
|
|
28899
28906
|
};
|
|
28900
28907
|
var getStaticProps$c = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
28901
|
-
var theme, provider;
|
|
28902
28908
|
return __generator(this, function (_a) {
|
|
28903
28909
|
switch (_a.label) {
|
|
28904
|
-
case 0: return [4 /*yield*/,
|
|
28905
|
-
case 1:
|
|
28906
|
-
theme = _a.sent();
|
|
28907
|
-
provider = new IkasPageDataProvider(theme, context.params, exports.IkasThemePageType.SEARCH);
|
|
28908
|
-
return [4 /*yield*/, provider.getPageData()];
|
|
28909
|
-
case 2:
|
|
28910
|
-
_a.sent();
|
|
28911
|
-
return [2 /*return*/, __assign(__assign({}, provider.nextPageData), { revalidate: 60 })];
|
|
28910
|
+
case 0: return [4 /*yield*/, SettingsHelper.getStaticProps(context, exports.IkasThemePageType.SEARCH)];
|
|
28911
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
28912
28912
|
}
|
|
28913
28913
|
});
|
|
28914
28914
|
}); };
|
|
@@ -28926,17 +28926,10 @@ var Page$f = function (_a) {
|
|
|
28926
28926
|
return (React.createElement(IkasPage, { merchantSettings: merchantSettings, settingsStr: settingsStr, page: page, propValues: propValues }));
|
|
28927
28927
|
};
|
|
28928
28928
|
var getStaticProps$d = function (context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
28929
|
-
var theme, provider;
|
|
28930
28929
|
return __generator(this, function (_a) {
|
|
28931
28930
|
switch (_a.label) {
|
|
28932
|
-
case 0: return [4 /*yield*/,
|
|
28933
|
-
case 1:
|
|
28934
|
-
theme = _a.sent();
|
|
28935
|
-
provider = new IkasPageDataProvider(theme, context.params, exports.IkasThemePageType.NOT_FOUND);
|
|
28936
|
-
return [4 /*yield*/, provider.getPageData()];
|
|
28937
|
-
case 2:
|
|
28938
|
-
_a.sent();
|
|
28939
|
-
return [2 /*return*/, __assign(__assign({}, provider.nextPageData), { revalidate: 60 })];
|
|
28931
|
+
case 0: return [4 /*yield*/, SettingsHelper.getStaticProps(context, exports.IkasThemePageType.NOT_FOUND)];
|
|
28932
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
28940
28933
|
}
|
|
28941
28934
|
});
|
|
28942
28935
|
}); };
|
|
@@ -29036,10 +29029,8 @@ exports.IkasProductSearchAPI = IkasProductSearchAPI;
|
|
|
29036
29029
|
exports.IkasProductVariant = IkasProductVariant;
|
|
29037
29030
|
exports.IkasProductVariantType = IkasProductVariantType;
|
|
29038
29031
|
exports.IkasStateAPI = IkasStateAPI;
|
|
29039
|
-
exports.IkasStorefrontAPI = IkasStorefrontAPI;
|
|
29040
29032
|
exports.IkasStorefrontConfig = IkasStorefrontConfig;
|
|
29041
29033
|
exports.IkasTheme = IkasTheme;
|
|
29042
|
-
exports.IkasThemeAPI = IkasThemeAPI;
|
|
29043
29034
|
exports.IkasThemeComponent = IkasThemeComponent;
|
|
29044
29035
|
exports.IkasThemeComponentProp = IkasThemeComponentProp;
|
|
29045
29036
|
exports.IkasThemeCustomData = IkasThemeCustomData;
|