@ikas/storefront 0.0.93 → 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.
Files changed (36) hide show
  1. package/build/__generated__/global-types.d.ts +7 -1
  2. package/build/analytics/analytics.d.ts +1 -0
  3. package/build/analytics/facebookPixel.d.ts +1 -0
  4. package/build/api/cart/__generated__/getCart.d.ts +4 -0
  5. package/build/api/cart/__generated__/saveItemToCart.d.ts +4 -0
  6. package/build/api/checkout/__generated__/checkStocks.d.ts +3 -3
  7. package/build/api/checkout/index.d.ts +1 -1
  8. package/build/api/country/__generated__/getAvailableShippingCountries.d.ts +3 -0
  9. package/build/api/country/index.d.ts +1 -1
  10. package/build/api/index.d.ts +0 -2
  11. package/build/components/checkout/index.d.ts +3 -0
  12. package/build/components/checkout/model.d.ts +4 -3
  13. package/build/index.es.js +474 -438
  14. package/build/index.js +475 -441
  15. package/build/models/data/cart/index.d.ts +9 -0
  16. package/build/models/data/product/index.d.ts +2 -0
  17. package/build/models/data/product-tag/index.d.ts +5 -0
  18. package/build/models/data/storefront/{storefront-domain → domain}/index.d.ts +1 -0
  19. package/build/models/data/storefront/index.d.ts +19 -6
  20. package/build/models/data/storefront/localization/index.d.ts +7 -0
  21. package/build/models/data/storefront/routing/index.d.ts +9 -0
  22. package/build/models/data/storefront/theme/index.d.ts +13 -0
  23. package/build/models/data/storefront/theme-localization/index.d.ts +11 -0
  24. package/build/models/ui/product-list/index.d.ts +1 -1
  25. package/build/pages/checkout/[id].d.ts +3 -0
  26. package/build/storefront/index.d.ts +5 -0
  27. package/build/utils/settings.d.ts +80 -0
  28. package/package.json +1 -1
  29. package/build/api/product-stock-location/__generated__/listProductStockLocation.d.ts +0 -13
  30. package/build/api/product-stock-location/index.d.ts +0 -4
  31. package/build/api/storefront/__generated__/getStorefront.d.ts +0 -23
  32. package/build/api/storefront/index.d.ts +0 -4
  33. package/build/api/theme/index.d.ts +0 -4
  34. package/build/models/data/storefront/stockfront-location/index.d.ts +0 -5
  35. package/build/models/data/storefront/stockfront-route/index.d.ts +0 -5
  36. 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", {
@@ -13199,6 +13205,17 @@ var FacebookPixel = /** @class */ (function () {
13199
13205
  console.error(err);
13200
13206
  }
13201
13207
  };
13208
+ FacebookPixel.contactForm = function () {
13209
+ try {
13210
+ !isServer &&
13211
+ window.fbq &&
13212
+ window.fbq("track", "ContactForm", {});
13213
+ return;
13214
+ }
13215
+ catch (err) {
13216
+ console.error(err);
13217
+ }
13218
+ };
13202
13219
  return FacebookPixel;
13203
13220
  }());
13204
13221
  function productToFBPItem(productDetail, quantity) {
@@ -15811,7 +15828,7 @@ var MAX_CVC_LENGTH = 4;
15811
15828
  var USE_DIFFERENT_ADDRESS_KEY = "sAddr";
15812
15829
  var isServer$1 = typeof localStorage === "undefined";
15813
15830
  var CheckoutViewModel = /** @class */ (function () {
15814
- function CheckoutViewModel(checkout, queryParams, router) {
15831
+ function CheckoutViewModel(checkout, queryParams, router, returnPolicy, privacyPolicy, termsOfService) {
15815
15832
  var _this = this;
15816
15833
  this.checkout = new IkasCheckout();
15817
15834
  this.storefront = null;
@@ -15917,7 +15934,7 @@ var CheckoutViewModel = /** @class */ (function () {
15917
15934
  variantId: i.variant.id,
15918
15935
  productId: i.variant.productId,
15919
15936
  }); });
15920
- return [4 /*yield*/, IkasCheckoutAPI.checkStocks(lines)];
15937
+ return [4 /*yield*/, IkasCheckoutAPI.checkStocks(lines, [])];
15921
15938
  case 1:
15922
15939
  result = _b.sent();
15923
15940
  if (!result) {
@@ -15930,7 +15947,7 @@ var CheckoutViewModel = /** @class */ (function () {
15930
15947
  data = unavailableItems.map(function (item) { return ({
15931
15948
  variant: _this.cart.items.find(function (i) { return i.variant.id === item.variantId; })
15932
15949
  .variant,
15933
- availableQuantity: item.availableQuantity,
15950
+ availableQuantity: item.stockCount,
15934
15951
  }); });
15935
15952
  throw {
15936
15953
  type: ErrorType.STOCK_ERROR,
@@ -15947,7 +15964,7 @@ var CheckoutViewModel = /** @class */ (function () {
15947
15964
  switch (_b.label) {
15948
15965
  case 0:
15949
15966
  _a = this;
15950
- return [4 /*yield*/, IkasCountryAPI.listShippingCountries()];
15967
+ return [4 /*yield*/, IkasCountryAPI.listShippingCountries(IkasStorefrontConfig.storefrontId)];
15951
15968
  case 1:
15952
15969
  _a.shippingCountryIds = _b.sent();
15953
15970
  return [2 /*return*/];
@@ -16023,30 +16040,6 @@ var CheckoutViewModel = /** @class */ (function () {
16023
16040
  }
16024
16041
  });
16025
16042
  }); };
16026
- this.getStorefront = function () { return __awaiter(_this, void 0, void 0, function () {
16027
- var storefront;
16028
- return __generator(this, function (_a) {
16029
- switch (_a.label) {
16030
- case 0:
16031
- if (!IkasStorefrontConfig.config.storefrontId || !!this.storefront)
16032
- return [2 /*return*/];
16033
- _a.label = 1;
16034
- case 1:
16035
- _a.trys.push([1, 3, , 4]);
16036
- return [4 /*yield*/, IkasStorefrontAPI.getStorefront(IkasStorefrontConfig.config.storefrontId)];
16037
- case 2:
16038
- storefront = _a.sent();
16039
- if (storefront) {
16040
- this.storefront = storefront;
16041
- }
16042
- return [3 /*break*/, 4];
16043
- case 3:
16044
- _a.sent();
16045
- return [3 /*break*/, 4];
16046
- case 4: return [2 /*return*/];
16047
- }
16048
- });
16049
- }); };
16050
16043
  this.createCustomer = function () {
16051
16044
  if (_this.customerStore.customer) {
16052
16045
  _this.checkout.customer = _this.customerStore.customer;
@@ -16178,7 +16171,7 @@ var CheckoutViewModel = /** @class */ (function () {
16178
16171
  _this.router.push("/");
16179
16172
  };
16180
16173
  this.onProceedToShippingClick = function () { return __awaiter(_this, void 0, void 0, function () {
16181
- var newAddress, customer, err_3;
16174
+ var newAddress, customer, err_2;
16182
16175
  return __generator(this, function (_a) {
16183
16176
  switch (_a.label) {
16184
16177
  case 0:
@@ -16208,12 +16201,12 @@ var CheckoutViewModel = /** @class */ (function () {
16208
16201
  this.changeStep(CheckoutStep.SHIPPING);
16209
16202
  return [3 /*break*/, 7];
16210
16203
  case 6:
16211
- err_3 = _a.sent();
16212
- if (err_3.type) {
16213
- this.error = err_3;
16204
+ err_2 = _a.sent();
16205
+ if (err_2.type) {
16206
+ this.error = err_2;
16214
16207
  }
16215
16208
  else {
16216
- console.log(err_3);
16209
+ console.log(err_2);
16217
16210
  this.error = {
16218
16211
  type: ErrorType.UNKNOWN,
16219
16212
  };
@@ -16225,7 +16218,7 @@ var CheckoutViewModel = /** @class */ (function () {
16225
16218
  });
16226
16219
  }); };
16227
16220
  this.onProceedToPaymentClick = function () { return __awaiter(_this, void 0, void 0, function () {
16228
- var err_4;
16221
+ var err_3;
16229
16222
  return __generator(this, function (_a) {
16230
16223
  switch (_a.label) {
16231
16224
  case 0:
@@ -16245,12 +16238,12 @@ var CheckoutViewModel = /** @class */ (function () {
16245
16238
  this.changeStep(CheckoutStep.PAYMENT);
16246
16239
  return [3 /*break*/, 4];
16247
16240
  case 3:
16248
- err_4 = _a.sent();
16249
- if (err_4.type) {
16250
- this.error = err_4;
16241
+ err_3 = _a.sent();
16242
+ if (err_3.type) {
16243
+ this.error = err_3;
16251
16244
  }
16252
16245
  else {
16253
- console.log(err_4);
16246
+ console.log(err_3);
16254
16247
  this.error = {
16255
16248
  type: ErrorType.UNKNOWN,
16256
16249
  };
@@ -16262,7 +16255,7 @@ var CheckoutViewModel = /** @class */ (function () {
16262
16255
  });
16263
16256
  }); };
16264
16257
  this.performPayment = function () { return __awaiter(_this, void 0, void 0, function () {
16265
- var response, transactionStatus, err_5;
16258
+ var response, transactionStatus, err_4;
16266
16259
  return __generator(this, function (_a) {
16267
16260
  switch (_a.label) {
16268
16261
  case 0:
@@ -16308,10 +16301,10 @@ var CheckoutViewModel = /** @class */ (function () {
16308
16301
  }
16309
16302
  return [3 /*break*/, 6];
16310
16303
  case 5:
16311
- err_5 = _a.sent();
16312
- if (err_5.type) {
16313
- console.log(err_5);
16314
- this.error = err_5;
16304
+ err_4 = _a.sent();
16305
+ if (err_4.type) {
16306
+ console.log(err_4);
16307
+ this.error = err_4;
16315
16308
  }
16316
16309
  else {
16317
16310
  this.error = {
@@ -16390,6 +16383,9 @@ var CheckoutViewModel = /** @class */ (function () {
16390
16383
  }); };
16391
16384
  this.checkout = checkout;
16392
16385
  this.router = router;
16386
+ this.returnPolicy = returnPolicy;
16387
+ this.privacyPolicy = privacyPolicy;
16388
+ this.termsOfService = termsOfService;
16393
16389
  this.init(queryParams);
16394
16390
  mobx.makeAutoObservable(this);
16395
16391
  }
@@ -16400,15 +16396,6 @@ var CheckoutViewModel = /** @class */ (function () {
16400
16396
  enumerable: false,
16401
16397
  configurable: true
16402
16398
  });
16403
- Object.defineProperty(CheckoutViewModel.prototype, "storefrontRegion", {
16404
- get: function () {
16405
- var _a;
16406
- return ((_a = this.storefront) === null || _a === void 0 ? void 0 : _a.regions.length) ? this.storefront.regions[0]
16407
- : undefined;
16408
- },
16409
- enumerable: false,
16410
- configurable: true
16411
- });
16412
16399
  Object.defineProperty(CheckoutViewModel.prototype, "selectedPaymentGatewayIndex", {
16413
16400
  get: function () {
16414
16401
  var _this = this;
@@ -16861,6 +16848,14 @@ var Analytics = /** @class */ (function () {
16861
16848
  console.error(err);
16862
16849
  }
16863
16850
  };
16851
+ Analytics.contactForm = function () {
16852
+ try {
16853
+ FacebookPixel.contactForm();
16854
+ }
16855
+ catch (err) {
16856
+ console.error(err);
16857
+ }
16858
+ };
16864
16859
  return Analytics;
16865
16860
  }());
16866
16861
 
@@ -16946,7 +16941,9 @@ var IkasCustomerStore = /** @class */ (function () {
16946
16941
  this.saveContactForm = function (input) { return __awaiter(_this, void 0, void 0, function () {
16947
16942
  return __generator(this, function (_a) {
16948
16943
  switch (_a.label) {
16949
- case 0: return [4 /*yield*/, IkasContactFormAPI.sendContactFormToMerchant(input)];
16944
+ case 0:
16945
+ Analytics.contactForm();
16946
+ return [4 /*yield*/, IkasContactFormAPI.sendContactFormToMerchant(input)];
16950
16947
  case 1: return [2 /*return*/, _a.sent()];
16951
16948
  }
16952
16949
  });
@@ -17062,6 +17059,7 @@ var IkasCustomerStore = /** @class */ (function () {
17062
17059
  return [2 /*return*/, []];
17063
17060
  return [4 /*yield*/, IkasProductSearchAPI.searchProducts({
17064
17061
  productIdList: favoriteProductsResult.map(function (fP) { return fP.productId; }),
17062
+ priceListId: IkasStorefrontConfig.priceListId,
17065
17063
  })];
17066
17064
  case 2:
17067
17065
  productsResult = _b.sent();
@@ -17602,6 +17600,15 @@ var IkasProductVariantType = /** @class */ (function () {
17602
17600
  return IkasProductVariantType;
17603
17601
  }());
17604
17602
 
17603
+ var IkasProductTag = /** @class */ (function () {
17604
+ function IkasProductTag(data) {
17605
+ this.id = data.id || "";
17606
+ this.name = data.name || "";
17607
+ mobx.makeAutoObservable(this);
17608
+ }
17609
+ return IkasProductTag;
17610
+ }());
17611
+
17605
17612
  var IkasProduct = /** @class */ (function () {
17606
17613
  function IkasProduct(data) {
17607
17614
  if (data === void 0) { data = {}; }
@@ -17617,6 +17624,9 @@ var IkasProduct = /** @class */ (function () {
17617
17624
  this.categories = data.categories
17618
17625
  ? data.categories.map(function (c) { return new IkasCategory(c); })
17619
17626
  : [];
17627
+ this.tags = data.tags
17628
+ ? data.tags.map(function (tag) { return new IkasProductTag(tag); })
17629
+ : [];
17620
17630
  this.variants = data.variants
17621
17631
  ? data.variants.map(function (v) { return new IkasProductVariant(v); })
17622
17632
  : [];
@@ -21884,7 +21894,10 @@ var IkasProductList = /** @class */ (function () {
21884
21894
  Object.defineProperty(IkasProductList.prototype, "isFiltered", {
21885
21895
  get: function () {
21886
21896
  var _a;
21887
- return (((_a = this.filters) === null || _a === void 0 ? void 0 : _a.some(function (f) { return !!f.valueList.length; })) || !!this._searchKeyword);
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));
21888
21901
  },
21889
21902
  enumerable: false,
21890
21903
  configurable: true
@@ -21947,13 +21960,20 @@ var IkasProductList = /** @class */ (function () {
21947
21960
  });
21948
21961
  Object.defineProperty(IkasProductList.prototype, "filterQueryParams", {
21949
21962
  get: function () {
21950
- var _a;
21963
+ var _this = this;
21964
+ var _a, _b, _c;
21951
21965
  var queryParams = {};
21952
21966
  (_a = this.filters) === null || _a === void 0 ? void 0 : _a.forEach(function (f) {
21953
21967
  queryParams[f.key] = f.keyList;
21954
21968
  });
21955
21969
  if (this._searchKeyword)
21956
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
+ }
21957
21977
  return queryString.stringify(queryParams, { arrayFormat: "comma" });
21958
21978
  },
21959
21979
  enumerable: false,
@@ -22008,6 +22028,7 @@ var IkasProductList = /** @class */ (function () {
22008
22028
  categoryIdList: this._filterCategoryId
22009
22029
  ? [this._filterCategoryId]
22010
22030
  : undefined,
22031
+ priceListId: IkasStorefrontConfig.priceListId,
22011
22032
  query: this._searchKeyword,
22012
22033
  })];
22013
22034
  case 1: return [2 /*return*/, _c.sent()];
@@ -22035,6 +22056,7 @@ var IkasProductList = /** @class */ (function () {
22035
22056
  };
22036
22057
  IkasProductList.prototype.applyQueryParamFilters = function (queryParams) {
22037
22058
  var _this = this;
22059
+ var _a;
22038
22060
  try {
22039
22061
  queryParams === null || queryParams === void 0 ? void 0 : queryParams.forEach(function (value, key) {
22040
22062
  var _a;
@@ -22046,6 +22068,15 @@ var IkasProductList = /** @class */ (function () {
22046
22068
  var querySearch = queryParams === null || queryParams === void 0 ? void 0 : queryParams.get("s");
22047
22069
  if (querySearch)
22048
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
+ }
22049
22080
  }
22050
22081
  catch (err) {
22051
22082
  console.log(err);
@@ -22092,12 +22123,32 @@ var IkasProductList = /** @class */ (function () {
22092
22123
  var _a;
22093
22124
  (_a = this.filters) === null || _a === void 0 ? void 0 : _a.forEach(function (filter) { return filter.clear(); });
22094
22125
  this._searchKeyword = "";
22126
+ if (this._pageType !== exports.IkasThemePageType.CATEGORY) {
22127
+ this._filterCategoryId = undefined;
22128
+ }
22095
22129
  this.applyFilters();
22096
22130
  };
22097
- IkasProductList.prototype.onFilterCategoryClick = function (filterCategory) {
22131
+ IkasProductList.prototype.onFilterCategoryClick = function (filterCategory, disableRoute) {
22098
22132
  var _a;
22099
- (_a = this.router) === null || _a === void 0 ? void 0 : _a.push(filterCategory.href +
22100
- (this.filterQueryParams ? "?" + this.filterQueryParams : ""));
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
+ });
22101
22152
  };
22102
22153
  IkasProductList.prototype.toJSON = function () {
22103
22154
  return {
@@ -24182,7 +24233,7 @@ var IkasCartAPI = /** @class */ (function () {
24182
24233
  return __generator(this, function (_b) {
24183
24234
  switch (_b.label) {
24184
24235
  case 0:
24185
- 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 "])));
24186
24237
  _b.label = 1;
24187
24238
  case 1:
24188
24239
  _b.trys.push([1, 3, , 4]);
@@ -24217,7 +24268,7 @@ var IkasCartAPI = /** @class */ (function () {
24217
24268
  return __generator(this, function (_b) {
24218
24269
  switch (_b.label) {
24219
24270
  case 0:
24220
- 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 "])));
24221
24272
  _b.label = 1;
24222
24273
  case 1:
24223
24274
  _b.trys.push([1, 3, , 4]);
@@ -24689,13 +24740,13 @@ var IkasCheckoutAPI = /** @class */ (function () {
24689
24740
  });
24690
24741
  });
24691
24742
  };
24692
- IkasCheckoutAPI.checkStocks = function (lines) {
24743
+ IkasCheckoutAPI.checkStocks = function (lines, stockLocationIdList) {
24693
24744
  return __awaiter(this, void 0, void 0, function () {
24694
24745
  var QUERY, _a, data, errors, err_7;
24695
24746
  return __generator(this, function (_b) {
24696
24747
  switch (_b.label) {
24697
24748
  case 0:
24698
- QUERY = src(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n query checkStocks($lines: [CheckStocksLineInput!]!) {\n checkStocks(lines: $lines) {\n lines {\n availableQuantity\n isAvailable\n stockLocationId\n variantId\n }\n }\n }\n "], ["\n query checkStocks($lines: [CheckStocksLineInput!]!) {\n checkStocks(lines: $lines) {\n lines {\n availableQuantity\n isAvailable\n stockLocationId\n variantId\n }\n }\n }\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 "])));
24699
24750
  _b.label = 1;
24700
24751
  case 1:
24701
24752
  _b.trys.push([1, 3, , 4]);
@@ -24705,6 +24756,7 @@ var IkasCheckoutAPI = /** @class */ (function () {
24705
24756
  query: QUERY,
24706
24757
  variables: {
24707
24758
  lines: lines,
24759
+ stockLocationIdList: stockLocationIdList,
24708
24760
  },
24709
24761
  })];
24710
24762
  case 2:
@@ -24816,13 +24868,13 @@ var IkasCountryAPI = /** @class */ (function () {
24816
24868
  });
24817
24869
  });
24818
24870
  };
24819
- IkasCountryAPI.listShippingCountries = function () {
24871
+ IkasCountryAPI.listShippingCountries = function (storefrontId) {
24820
24872
  return __awaiter(this, void 0, void 0, function () {
24821
24873
  var QUERY, _a, data, errors, err_2;
24822
24874
  return __generator(this, function (_b) {
24823
24875
  switch (_b.label) {
24824
24876
  case 0:
24825
- 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 "])));
24826
24878
  _b.label = 1;
24827
24879
  case 1:
24828
24880
  _b.trys.push([1, 3, , 4]);
@@ -24830,6 +24882,9 @@ var IkasCountryAPI = /** @class */ (function () {
24830
24882
  .getClient()
24831
24883
  .query({
24832
24884
  query: QUERY,
24885
+ variables: {
24886
+ storefrontId: storefrontId,
24887
+ },
24833
24888
  })];
24834
24889
  case 2:
24835
24890
  _a = _b.sent(), data = _a.data, errors = _a.errors;
@@ -25486,7 +25541,7 @@ var IkasProductSearchAPI = /** @class */ (function () {
25486
25541
  return IkasProductSearchAPI;
25487
25542
  }());
25488
25543
  function simpleToProduct(simple) {
25489
- var _a, _b, _c, _d, _e;
25544
+ var _a, _b, _c, _d, _e, _f;
25490
25545
  return new IkasProduct({
25491
25546
  id: simple.id,
25492
25547
  attributes: (_a = simple.attributes) === null || _a === void 0 ? void 0 : _a.map(function (a) {
@@ -25520,6 +25575,12 @@ function simpleToProduct(simple) {
25520
25575
  }),
25521
25576
  });
25522
25577
  }),
25578
+ tags: (_f = simple.tags) === null || _f === void 0 ? void 0 : _f.map(function (tag) {
25579
+ return new IkasProductTag({
25580
+ id: tag.id,
25581
+ name: tag.name,
25582
+ });
25583
+ }),
25523
25584
  description: simple.description || undefined,
25524
25585
  metaData: new IkasHTMLMetaData(simple.metaData || undefined),
25525
25586
  name: simple.name,
@@ -25817,150 +25878,6 @@ var IkasStateAPI = /** @class */ (function () {
25817
25878
  }());
25818
25879
  var templateObject_1$e;
25819
25880
 
25820
- var IkasStorefrontDomain = /** @class */ (function () {
25821
- function IkasStorefrontDomain(data) {
25822
- if (data === void 0) { data = {}; }
25823
- this.id = data.id || "";
25824
- this.merchantDomainId = data.merchantDomainId || "";
25825
- this.name = data.name || "";
25826
- this.redirectDomainName = data.redirectDomainName || null;
25827
- mobx.makeAutoObservable(this);
25828
- }
25829
- return IkasStorefrontDomain;
25830
- }());
25831
-
25832
- var IkasStorefrontLocation = /** @class */ (function () {
25833
- function IkasStorefrontLocation(data) {
25834
- if (data === void 0) { data = {}; }
25835
- this.countryId = data.countryId || "";
25836
- this.stateId = data.stateId || null;
25837
- mobx.makeAutoObservable(this);
25838
- }
25839
- return IkasStorefrontLocation;
25840
- }());
25841
-
25842
- var IkasStorefrontRoute = /** @class */ (function () {
25843
- function IkasStorefrontRoute(data) {
25844
- if (data === void 0) { data = {}; }
25845
- this.domainId = data.domainId || "";
25846
- this.useSubPath = data.useSubPath || false;
25847
- mobx.makeAutoObservable(this);
25848
- }
25849
- return IkasStorefrontRoute;
25850
- }());
25851
-
25852
- var IkasStorefrontRegion = /** @class */ (function () {
25853
- function IkasStorefrontRegion(data) {
25854
- if (data === void 0) { data = {}; }
25855
- // Extra
25856
- this.theme = new IkasTheme();
25857
- this.id = data.id || "";
25858
- this.locale = data.locale || "";
25859
- this.themeJSON = data.themeJSON || "";
25860
- this.shipping = data.shipping || null;
25861
- this.paymentSettingsId = data.paymentSettingsId || null;
25862
- this.priceListId = data.priceListId || null;
25863
- this.locations = data.locations
25864
- ? data.locations.map(function (o) { return new IkasStorefrontLocation(o); })
25865
- : [];
25866
- this.routes = data.routes
25867
- ? data.routes.map(function (o) { return new IkasStorefrontRoute(o); })
25868
- : null;
25869
- this.termsOfService = data.termsOfService || "";
25870
- this.privacyPolicy = data.privacyPolicy || "";
25871
- this.returnPolicy = data.returnPolicy || "";
25872
- try {
25873
- this.theme = this.themeJSON
25874
- ? new IkasTheme(JSON.parse(this.themeJSON))
25875
- : new IkasTheme();
25876
- }
25877
- catch (err) { }
25878
- mobx.makeAutoObservable(this);
25879
- }
25880
- return IkasStorefrontRegion;
25881
- }());
25882
-
25883
- var IkasStorefront = /** @class */ (function () {
25884
- function IkasStorefront(data) {
25885
- if (data === void 0) { data = {}; }
25886
- this.id = data.id || "";
25887
- this.name = data.name || "";
25888
- this.themeId = data.themeId || "";
25889
- this.themeVersionId = data.themeVersionId || "";
25890
- this.userId = data.userId || "";
25891
- this.domains = data.domains
25892
- ? data.domains.map(function (o) { return new IkasStorefrontDomain(o); })
25893
- : [];
25894
- this.regions = data.regions
25895
- ? data.regions.map(function (o) { return new IkasStorefrontRegion(o); })
25896
- : [];
25897
- mobx.makeAutoObservable(this);
25898
- }
25899
- return IkasStorefront;
25900
- }());
25901
-
25902
- var IkasStorefrontAPI = /** @class */ (function () {
25903
- function IkasStorefrontAPI() {
25904
- }
25905
- IkasStorefrontAPI.getStorefront = function (storefrontId) {
25906
- return __awaiter(this, void 0, void 0, function () {
25907
- var QUERY, _a, data, errors;
25908
- return __generator(this, function (_b) {
25909
- switch (_b.label) {
25910
- case 0:
25911
- 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 "])));
25912
- _b.label = 1;
25913
- case 1:
25914
- _b.trys.push([1, 3, , 4]);
25915
- return [4 /*yield*/, apollo
25916
- .getClient()
25917
- .query({
25918
- query: QUERY,
25919
- variables: {
25920
- storefrontId: storefrontId,
25921
- },
25922
- })];
25923
- case 2:
25924
- _a = _b.sent(), data = _a.data, errors = _a.errors;
25925
- if (errors && errors.length) {
25926
- console.log(errors);
25927
- }
25928
- if (data)
25929
- return [2 /*return*/, new IkasStorefront(data.getStorefront)];
25930
- return [3 /*break*/, 4];
25931
- case 3:
25932
- _b.sent();
25933
- return [3 /*break*/, 4];
25934
- case 4: return [2 /*return*/, new IkasStorefront()];
25935
- }
25936
- });
25937
- });
25938
- };
25939
- return IkasStorefrontAPI;
25940
- }());
25941
- var templateObject_1$f;
25942
-
25943
- var IkasThemeAPI = /** @class */ (function () {
25944
- function IkasThemeAPI() {
25945
- }
25946
- IkasThemeAPI.fetchTheme = function () {
25947
- return new Promise(function (resolve, reject) {
25948
- var serverRuntimeConfig = getConfig__default['default']().serverRuntimeConfig;
25949
- var themeJSONPath = serverRuntimeConfig.THEME_JSON_PATH || "./src/theme.json";
25950
- fs__default['default'].readFile(themeJSONPath, {
25951
- flag: "a+",
25952
- }, function (err, file) {
25953
- if (err) {
25954
- return reject(err);
25955
- }
25956
- var result = file.length ? JSON.parse(file.toString()) : {};
25957
- resolve(new IkasTheme(result));
25958
- });
25959
- });
25960
- };
25961
- return IkasThemeAPI;
25962
- }());
25963
-
25964
25881
  var IkasVariantTypeAPI = /** @class */ (function () {
25965
25882
  function IkasVariantTypeAPI() {
25966
25883
  }
@@ -25970,7 +25887,7 @@ var IkasVariantTypeAPI = /** @class */ (function () {
25970
25887
  return __generator(this, function (_b) {
25971
25888
  switch (_b.label) {
25972
25889
  case 0:
25973
- LIST_VARIANT_TYPE = src(templateObject_1$g || (templateObject_1$g = __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 "])));
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 "])));
25974
25891
  _b.label = 1;
25975
25892
  case 1:
25976
25893
  _b.trys.push([1, 3, , 4]);
@@ -26016,7 +25933,7 @@ var IkasVariantTypeAPI = /** @class */ (function () {
26016
25933
  };
26017
25934
  return IkasVariantTypeAPI;
26018
25935
  }());
26019
- var templateObject_1$g;
25936
+ var templateObject_1$f;
26020
25937
 
26021
25938
  function styleInject(css, ref) {
26022
25939
  if ( ref === void 0 ) ref = {};
@@ -27206,6 +27123,11 @@ var IkasCartStore = /** @class */ (function () {
27206
27123
  name: product.name,
27207
27124
  },
27208
27125
  },
27126
+ priceListId: IkasStorefrontConfig.priceListId || null,
27127
+ salesChannelId: IkasStorefrontConfig.salesChannelId,
27128
+ storefrontId: IkasStorefrontConfig.storefrontId,
27129
+ storefrontRoutingId: IkasStorefrontConfig.storefrontRoutingId,
27130
+ storefrontThemeId: IkasStorefrontConfig.storefrontThemeId,
27209
27131
  };
27210
27132
  return [4 /*yield*/, IkasCartAPI.saveItemToCart(input)];
27211
27133
  case 1:
@@ -27246,6 +27168,11 @@ var IkasCartStore = /** @class */ (function () {
27246
27168
  name: item.variant.name,
27247
27169
  },
27248
27170
  },
27171
+ priceListId: IkasStorefrontConfig.priceListId || null,
27172
+ salesChannelId: IkasStorefrontConfig.salesChannelId,
27173
+ storefrontId: IkasStorefrontConfig.storefrontId,
27174
+ storefrontRoutingId: IkasStorefrontConfig.storefrontRoutingId,
27175
+ storefrontThemeId: IkasStorefrontConfig.storefrontThemeId,
27249
27176
  };
27250
27177
  return [4 /*yield*/, IkasCartAPI.saveItemToCart(input)];
27251
27178
  case 1:
@@ -27479,11 +27406,9 @@ var IkasPageHead = mobxReactLite.observer(function (_a) {
27479
27406
  var categorySchema = createCategorySchema(pageSpecificDataStr);
27480
27407
  if (categorySchema)
27481
27408
  schemas.push(categorySchema);
27482
- // TODO
27483
- // const categoryBreadcrumbSchema = createCategoryBreadcrumbSchema(
27484
- // pageSpecificDataStr
27485
- // );
27486
- // if (categoryBreadcrumbSchema) schemas.push(categoryBreadcrumbSchema);
27409
+ var categoryBreadcrumbSchema = createCategoryBreadcrumbSchema(pageSpecificDataStr);
27410
+ if (categoryBreadcrumbSchema)
27411
+ schemas.push(categoryBreadcrumbSchema);
27487
27412
  }
27488
27413
  return (React.createElement(Head__default['default'], null,
27489
27414
  React.createElement("title", null, pageTitle || ""),
@@ -27536,12 +27461,16 @@ function createProductSchema(productDetail) {
27536
27461
  }
27537
27462
  }
27538
27463
  }
27464
+ var productUrl = isBrowser
27465
+ ? "https://" + window.location.hostname + productDetail.href
27466
+ : "";
27539
27467
  return {
27540
27468
  "@context": "https://schema.org/",
27541
27469
  "@type": "Product",
27542
27470
  name: productDetail.product.name,
27543
27471
  description: (_a = productDetail.product.metaData) === null || _a === void 0 ? void 0 : _a.description,
27544
27472
  image: productDetail.selectedVariant.images.map(function (i) { return i.src; }),
27473
+ productId: productDetail.selectedVariant.id,
27545
27474
  sku: productDetail.selectedVariant.sku,
27546
27475
  mpn: productDetail.selectedVariant.barcodeList.length
27547
27476
  ? productDetail.selectedVariant.barcodeList[0]
@@ -27552,7 +27481,7 @@ function createProductSchema(productDetail) {
27552
27481
  },
27553
27482
  offers: {
27554
27483
  "@type": "Offer",
27555
- url: "https://" + window.location.hostname + productDetail.href,
27484
+ url: productUrl,
27556
27485
  priceCurrency: productDetail.selectedVariant.price.currency || "TRY",
27557
27486
  price: productDetail.selectedVariant.price.finalPrice,
27558
27487
  priceValidUntil: "",
@@ -27570,10 +27499,13 @@ function createCategorySchema(pageSpecificDataStr) {
27570
27499
  try {
27571
27500
  var categoryParsed = JSON.parse(pageSpecificDataStr);
27572
27501
  var category = new IkasCategory(categoryParsed);
27502
+ var categoryUrl = typeof window !== undefined
27503
+ ? "https://" + window.location.hostname + category.href
27504
+ : "";
27573
27505
  return {
27574
27506
  "@context": "http://schema.org",
27575
27507
  "@type": "CollectionPage",
27576
- url: "https://" + window.location.hostname + category.href,
27508
+ url: categoryUrl,
27577
27509
  name: (_a = category.metaData) === null || _a === void 0 ? void 0 : _a.pageTitle,
27578
27510
  description: (_b = category.metaData) === null || _b === void 0 ? void 0 : _b.description,
27579
27511
  image: (_c = category.image) === null || _c === void 0 ? void 0 : _c.src,
@@ -27581,32 +27513,33 @@ function createCategorySchema(pageSpecificDataStr) {
27581
27513
  }
27582
27514
  catch (_d) { }
27583
27515
  }
27584
- // TODO - Waiting for CategoryParentTree feature
27585
- // https://app.clubhouse.io/ikas/story/256/schema-org-json-lar%C4%B1n%C4%B1n-t%C3%BCm-kategori-sayfalar%C4%B1na-yerle%C5%9Ftirilmesini-istiyorum
27586
- // function createCategoryBreadcrumbSchema(pageSpecificDataStr: string) {
27587
- // try {
27588
- // const categoryParsed = JSON.parse(pageSpecificDataStr) as IkasCategory;
27589
- // const category = new IkasCategory(categoryParsed);
27590
- // return {
27591
- // "@context": "http://schema.org",
27592
- // "@type": "BreadcrumbList",
27593
- // "itemListElement": [
27594
- // {
27595
- // "@type": "ListItem",
27596
- // "position": 1,
27597
- // "name": "category.name",
27598
- // "item": "https://" + window.location.hostname + "category.href"
27599
- // }
27600
- // ]
27601
- // };
27602
- // } catch {}
27603
- // }
27516
+ function createCategoryBreadcrumbSchema(pageSpecificDataStr) {
27517
+ try {
27518
+ var categoryParsed = JSON.parse(pageSpecificDataStr);
27519
+ var category = new IkasCategory(categoryParsed);
27520
+ return {
27521
+ "@context": "http://schema.org",
27522
+ "@type": "BreadcrumbList",
27523
+ itemListElement: category.path.map(function (categoryPath, index) { return ({
27524
+ "@type": "ListItem",
27525
+ position: index + 1,
27526
+ name: categoryPath.name,
27527
+ item: typeof window !== undefined
27528
+ ? "https://" + window.location.hostname + categoryPath.href
27529
+ : "",
27530
+ }); }),
27531
+ };
27532
+ }
27533
+ catch (_a) { }
27534
+ }
27604
27535
 
27605
27536
  var IkasCheckoutPage = mobxReactLite.observer(function (_a) {
27606
27537
  var _b, _c, _d;
27607
- var checkout = _a.checkout, queryParams = _a.queryParams;
27538
+ var checkout = _a.checkout, returnPolicy = _a.returnPolicy, privacyPolicy = _a.privacyPolicy, termsOfService = _a.termsOfService, queryParams = _a.queryParams;
27608
27539
  var router$1 = router.useRouter();
27609
- var vm = React.useState(function () { return new CheckoutViewModel(checkout, queryParams, router$1); })[0];
27540
+ var vm = React.useState(function () {
27541
+ return new CheckoutViewModel(checkout, queryParams, router$1, returnPolicy, privacyPolicy, termsOfService);
27542
+ })[0];
27610
27543
  React.useEffect(function () {
27611
27544
  Analytics.beginCheckout(vm.checkout);
27612
27545
  Analytics.checkoutStep(vm.checkout, vm.step);
@@ -27631,46 +27564,18 @@ var IkasCheckoutPage = mobxReactLite.observer(function (_a) {
27631
27564
  var onPolicyModalClose = function () {
27632
27565
  setPolicyModalText("");
27633
27566
  };
27634
- var onReturnPolicyClick = function () { return __awaiter(void 0, void 0, void 0, function () {
27635
- var _a, _b;
27636
- return __generator(this, function (_c) {
27637
- switch (_c.label) {
27638
- case 0: return [4 /*yield*/, vm.getStorefront()];
27639
- case 1:
27640
- _c.sent();
27641
- console.log((_a = vm.storefrontRegion) === null || _a === void 0 ? void 0 : _a.returnPolicy);
27642
- setPolicyModalTitle("Para İade Politikası");
27643
- setPolicyModalText(((_b = vm.storefrontRegion) === null || _b === void 0 ? void 0 : _b.returnPolicy) || "");
27644
- return [2 /*return*/];
27645
- }
27646
- });
27647
- }); };
27648
- var onPrivacyPolicyClick = function () { return __awaiter(void 0, void 0, void 0, function () {
27649
- var _a;
27650
- return __generator(this, function (_b) {
27651
- switch (_b.label) {
27652
- case 0: return [4 /*yield*/, vm.getStorefront()];
27653
- case 1:
27654
- _b.sent();
27655
- setPolicyModalTitle("Gizlilik Politikası");
27656
- setPolicyModalText(((_a = vm.storefrontRegion) === null || _a === void 0 ? void 0 : _a.privacyPolicy) || "");
27657
- return [2 /*return*/];
27658
- }
27659
- });
27660
- }); };
27661
- var onTermsOfServiceClick = function () { return __awaiter(void 0, void 0, void 0, function () {
27662
- var _a;
27663
- return __generator(this, function (_b) {
27664
- switch (_b.label) {
27665
- case 0: return [4 /*yield*/, vm.getStorefront()];
27666
- case 1:
27667
- _b.sent();
27668
- setPolicyModalTitle("Hizmet Şartları");
27669
- setPolicyModalText(((_a = vm.storefrontRegion) === null || _a === void 0 ? void 0 : _a.termsOfService) || "");
27670
- return [2 /*return*/];
27671
- }
27672
- });
27673
- }); };
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
+ };
27674
27579
  var onErrorClose = function () {
27675
27580
  vm.error = undefined;
27676
27581
  };
@@ -28290,6 +28195,206 @@ var index = /*#__PURE__*/Object.freeze({
28290
28195
  Image: Image
28291
28196
  });
28292
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
+
28293
28398
  var Page = function (_a) {
28294
28399
  var page = _a.page, propValuesStr = _a.propValuesStr, settingsStr = _a.settingsStr, merchantSettings = _a.merchantSettings;
28295
28400
  var router$1 = router.useRouter();
@@ -28297,17 +28402,10 @@ var Page = function (_a) {
28297
28402
  return (React.createElement(IkasPage, { merchantSettings: merchantSettings, settingsStr: settingsStr, page: page, propValues: propValues, addOgpMetas: true }));
28298
28403
  };
28299
28404
  var getStaticProps = function (context) { return __awaiter(void 0, void 0, void 0, function () {
28300
- var theme, provider;
28301
28405
  return __generator(this, function (_a) {
28302
28406
  switch (_a.label) {
28303
- case 0: return [4 /*yield*/, IkasThemeAPI.fetchTheme()];
28304
- case 1:
28305
- theme = _a.sent();
28306
- provider = new IkasPageDataProvider(theme, context.params, exports.IkasThemePageType.INDEX);
28307
- return [4 /*yield*/, provider.getPageData()];
28308
- case 2:
28309
- _a.sent();
28310
- 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()];
28311
28409
  }
28312
28410
  });
28313
28411
  }); };
@@ -28349,6 +28447,7 @@ var getStaticPaths = function (context) { return __awaiter(void 0, void 0, void
28349
28447
  productMetaData = metaData.filter(function (m) { return m.targetType && m.targetType === exports.IkasHTMLMetaDataTargetType.PRODUCT; });
28350
28448
  return [4 /*yield*/, IkasProductSearchAPI.searchProducts({
28351
28449
  productIdList: productMetaData.map(function (p) { return p.targetId; }),
28450
+ priceListId: IkasStorefrontConfig.priceListId,
28352
28451
  })];
28353
28452
  case 2:
28354
28453
  productsResponse = _b.sent();
@@ -28395,25 +28494,10 @@ var getStaticPaths = function (context) { return __awaiter(void 0, void 0, void
28395
28494
  });
28396
28495
  }); };
28397
28496
  var getStaticProps$1 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
28398
- var theme, provider;
28399
28497
  return __generator(this, function (_a) {
28400
28498
  switch (_a.label) {
28401
- case 0: return [4 /*yield*/, IkasThemeAPI.fetchTheme()];
28402
- case 1:
28403
- theme = _a.sent();
28404
- provider = new IkasPageDataProvider(theme, context.params, undefined);
28405
- return [4 /*yield*/, provider.getPageData()];
28406
- case 2:
28407
- _a.sent();
28408
- if (!provider.page) {
28409
- return [2 /*return*/, {
28410
- notFound: true,
28411
- }];
28412
- }
28413
- return [2 /*return*/, {
28414
- props: __assign(__assign({}, provider.nextPageData.props), { pageSpecificDataStr: JSON.stringify(provider.pageSpecificData || {}) }),
28415
- revalidate: 60,
28416
- }];
28499
+ case 0: return [4 /*yield*/, SettingsHelper.getStaticProps(context)];
28500
+ case 1: return [2 /*return*/, _a.sent()];
28417
28501
  }
28418
28502
  });
28419
28503
  }); };
@@ -28458,19 +28542,38 @@ var Page$2 = function (_a) {
28458
28542
  return (React.createElement(IkasPage, { page: page, settingsStr: settingsStr, propValues: propValues }));
28459
28543
  };
28460
28544
  var getStaticPaths$1 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
28461
- var theme, customPages, customPagePaths;
28545
+ var allSettings, customPagePaths;
28462
28546
  return __generator(this, function (_a) {
28463
28547
  switch (_a.label) {
28464
- case 0: return [4 /*yield*/, IkasThemeAPI.fetchTheme()];
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); }))];
28465
28555
  case 1:
28466
- theme = _a.sent();
28467
- customPages = theme.pages.filter(function (p) { return p.type === exports.IkasThemePageType.CUSTOM; });
28468
- customPagePaths = customPages.map(function (p) { return ({
28469
- slug: p.slug,
28470
- }); });
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
+ });
28471
28573
  return [2 /*return*/, {
28472
28574
  paths: customPagePaths.map(function (p) { return ({
28473
- params: p,
28575
+ params: p.params,
28576
+ locale: p.locale,
28474
28577
  }); }),
28475
28578
  fallback: "blocking",
28476
28579
  }];
@@ -28478,17 +28581,10 @@ var getStaticPaths$1 = function (context) { return __awaiter(void 0, void 0, voi
28478
28581
  });
28479
28582
  }); };
28480
28583
  var getStaticProps$2 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
28481
- var theme, provider;
28482
28584
  return __generator(this, function (_a) {
28483
28585
  switch (_a.label) {
28484
- case 0: return [4 /*yield*/, IkasThemeAPI.fetchTheme()];
28485
- case 1:
28486
- theme = _a.sent();
28487
- provider = new IkasPageDataProvider(theme, context.params, exports.IkasThemePageType.CUSTOM);
28488
- return [4 /*yield*/, provider.getPageData()];
28489
- case 2:
28490
- _a.sent();
28491
- 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()];
28492
28588
  }
28493
28589
  });
28494
28590
  }); };
@@ -28501,18 +28597,38 @@ var _slug_ = /*#__PURE__*/Object.freeze({
28501
28597
  });
28502
28598
 
28503
28599
  var CheckoutPage = function (_a) {
28504
- var checkoutStr = _a.checkoutStr, queryParams = _a.queryParams;
28600
+ var checkoutStr = _a.checkoutStr, others = __rest(_a, ["checkoutStr"]);
28505
28601
  Analytics.disableHTML();
28506
28602
  var checkout = new IkasCheckout(JSON.parse(checkoutStr));
28507
- return React.createElement(IkasCheckoutPage, { checkout: checkout, queryParams: queryParams });
28603
+ return React.createElement(IkasCheckoutPage, __assign({ checkout: checkout }, others));
28508
28604
  };
28509
28605
  var _id_ = mobxReactLite.observer(CheckoutPage);
28510
28606
  var getServerSideProps = function (context) { return __awaiter(void 0, void 0, void 0, function () {
28511
- var id, redirect, checkout;
28607
+ var id, locale, settings, storefront, routing, redirect, checkout, region;
28512
28608
  return __generator(this, function (_a) {
28513
28609
  switch (_a.label) {
28514
28610
  case 0:
28515
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;
28516
28632
  redirect = function () {
28517
28633
  context.res.writeHead(302, { Location: "/" });
28518
28634
  context.res.end();
@@ -28522,12 +28638,16 @@ var getServerSideProps = function (context) { return __awaiter(void 0, void 0, v
28522
28638
  return [2 /*return*/, redirect()];
28523
28639
  }
28524
28640
  return [4 /*yield*/, IkasCheckoutAPI.getCheckoutById(id)];
28525
- case 1:
28641
+ case 2:
28526
28642
  checkout = _a.sent();
28527
28643
  if (checkout) {
28644
+ region = settings.storefront.regions.find(function (r) { return r.id === storefront.mainStorefrontThemeId; });
28528
28645
  return [2 /*return*/, {
28529
28646
  props: {
28530
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) || "",
28531
28651
  queryParams: context.query,
28532
28652
  },
28533
28653
  }];
@@ -28552,17 +28672,10 @@ var Page$3 = function (_a) {
28552
28672
  return (React.createElement(IkasPage, { settingsStr: settingsStr, page: page, propValues: propValues }));
28553
28673
  };
28554
28674
  var getStaticProps$3 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
28555
- var theme, provider;
28556
28675
  return __generator(this, function (_a) {
28557
28676
  switch (_a.label) {
28558
- case 0: return [4 /*yield*/, IkasThemeAPI.fetchTheme()];
28559
- case 1:
28560
- theme = _a.sent();
28561
- provider = new IkasPageDataProvider(theme, context.params, exports.IkasThemePageType.ACCOUNT);
28562
- return [4 /*yield*/, provider.getPageData()];
28563
- case 2:
28564
- _a.sent();
28565
- 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()];
28566
28679
  }
28567
28680
  });
28568
28681
  }); };
@@ -28580,17 +28693,10 @@ var Page$4 = function (_a) {
28580
28693
  return (React.createElement(IkasPage, { settingsStr: settingsStr, page: page, propValues: propValues }));
28581
28694
  };
28582
28695
  var getStaticProps$4 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
28583
- var theme, provider;
28584
28696
  return __generator(this, function (_a) {
28585
28697
  switch (_a.label) {
28586
- case 0: return [4 /*yield*/, IkasThemeAPI.fetchTheme()];
28587
- case 1:
28588
- theme = _a.sent();
28589
- provider = new IkasPageDataProvider(theme, context.params, exports.IkasThemePageType.ADDRESSES);
28590
- return [4 /*yield*/, provider.getPageData()];
28591
- case 2:
28592
- _a.sent();
28593
- 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()];
28594
28700
  }
28595
28701
  });
28596
28702
  }); };
@@ -28608,17 +28714,10 @@ var Page$5 = function (_a) {
28608
28714
  return (React.createElement(IkasPage, { settingsStr: settingsStr, page: page, propValues: propValues }));
28609
28715
  };
28610
28716
  var getStaticProps$5 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
28611
- var theme, provider;
28612
28717
  return __generator(this, function (_a) {
28613
28718
  switch (_a.label) {
28614
- case 0: return [4 /*yield*/, IkasThemeAPI.fetchTheme()];
28615
- case 1:
28616
- theme = _a.sent();
28617
- provider = new IkasPageDataProvider(theme, context.params, exports.IkasThemePageType.ORDERS);
28618
- return [4 /*yield*/, provider.getPageData()];
28619
- case 2:
28620
- _a.sent();
28621
- 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()];
28622
28721
  }
28623
28722
  });
28624
28723
  }); };
@@ -28636,17 +28735,10 @@ var Page$6 = function (_a) {
28636
28735
  return (React.createElement(IkasPage, { settingsStr: settingsStr, page: page, propValues: propValues }));
28637
28736
  };
28638
28737
  var getServerSideProps$1 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
28639
- var theme, provider;
28640
28738
  return __generator(this, function (_a) {
28641
28739
  switch (_a.label) {
28642
- case 0: return [4 /*yield*/, IkasThemeAPI.fetchTheme()];
28643
- case 1:
28644
- theme = _a.sent();
28645
- provider = new IkasPageDataProvider(theme, context.params, exports.IkasThemePageType.ORDER_DETAIL);
28646
- return [4 /*yield*/, provider.getPageData()];
28647
- case 2:
28648
- _a.sent();
28649
- 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()];
28650
28742
  }
28651
28743
  });
28652
28744
  }); };
@@ -28664,17 +28756,10 @@ var Page$7 = function (_a) {
28664
28756
  return (React.createElement(IkasPage, { merchantSettings: merchantSettings, settingsStr: settingsStr, page: page, propValues: propValues }));
28665
28757
  };
28666
28758
  var getStaticProps$6 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
28667
- var theme, provider;
28668
28759
  return __generator(this, function (_a) {
28669
28760
  switch (_a.label) {
28670
- case 0: return [4 /*yield*/, IkasThemeAPI.fetchTheme()];
28671
- case 1:
28672
- theme = _a.sent();
28673
- provider = new IkasPageDataProvider(theme, context.params, exports.IkasThemePageType.LOGIN);
28674
- return [4 /*yield*/, provider.getPageData()];
28675
- case 2:
28676
- _a.sent();
28677
- 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()];
28678
28763
  }
28679
28764
  });
28680
28765
  }); };
@@ -28692,17 +28777,10 @@ var Page$8 = function (_a) {
28692
28777
  return (React.createElement(IkasPage, { merchantSettings: merchantSettings, settingsStr: settingsStr, page: page, propValues: propValues }));
28693
28778
  };
28694
28779
  var getStaticProps$7 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
28695
- var theme, provider;
28696
28780
  return __generator(this, function (_a) {
28697
28781
  switch (_a.label) {
28698
- case 0: return [4 /*yield*/, IkasThemeAPI.fetchTheme()];
28699
- case 1:
28700
- theme = _a.sent();
28701
- provider = new IkasPageDataProvider(theme, context.params, exports.IkasThemePageType.REGISTER);
28702
- return [4 /*yield*/, provider.getPageData()];
28703
- case 2:
28704
- _a.sent();
28705
- 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()];
28706
28784
  }
28707
28785
  });
28708
28786
  }); };
@@ -28720,17 +28798,10 @@ var Page$9 = function (_a) {
28720
28798
  return (React.createElement(IkasPage, { merchantSettings: merchantSettings, settingsStr: settingsStr, page: page, propValues: propValues }));
28721
28799
  };
28722
28800
  var getStaticProps$8 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
28723
- var theme, provider;
28724
28801
  return __generator(this, function (_a) {
28725
28802
  switch (_a.label) {
28726
- case 0: return [4 /*yield*/, IkasThemeAPI.fetchTheme()];
28727
- case 1:
28728
- theme = _a.sent();
28729
- provider = new IkasPageDataProvider(theme, context.params, exports.IkasThemePageType.FORGOT_PASSWORD);
28730
- return [4 /*yield*/, provider.getPageData()];
28731
- case 2:
28732
- _a.sent();
28733
- 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()];
28734
28805
  }
28735
28806
  });
28736
28807
  }); };
@@ -28748,17 +28819,10 @@ var Page$a = function (_a) {
28748
28819
  return (React.createElement(IkasPage, { merchantSettings: merchantSettings, settingsStr: settingsStr, page: page, propValues: propValues }));
28749
28820
  };
28750
28821
  var getStaticProps$9 = function (context) { return __awaiter(void 0, void 0, void 0, function () {
28751
- var theme, provider;
28752
28822
  return __generator(this, function (_a) {
28753
28823
  switch (_a.label) {
28754
- case 0: return [4 /*yield*/, IkasThemeAPI.fetchTheme()];
28755
- case 1:
28756
- theme = _a.sent();
28757
- provider = new IkasPageDataProvider(theme, context.params, exports.IkasThemePageType.RECOVER_PASSWORD);
28758
- return [4 /*yield*/, provider.getPageData()];
28759
- case 2:
28760
- _a.sent();
28761
- 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()];
28762
28826
  }
28763
28827
  });
28764
28828
  }); };
@@ -28780,17 +28844,10 @@ var Page$b = function (_a) {
28780
28844
  return (React.createElement(IkasPage, { settingsStr: settingsStr, page: page, propValues: propValues }));
28781
28845
  };
28782
28846
  var getStaticProps$a = function (context) { return __awaiter(void 0, void 0, void 0, function () {
28783
- var theme, provider;
28784
28847
  return __generator(this, function (_a) {
28785
28848
  switch (_a.label) {
28786
- case 0: return [4 /*yield*/, IkasThemeAPI.fetchTheme()];
28787
- case 1:
28788
- theme = _a.sent();
28789
- provider = new IkasPageDataProvider(theme, context.params, exports.IkasThemePageType.CART);
28790
- return [4 /*yield*/, provider.getPageData()];
28791
- case 2:
28792
- _a.sent();
28793
- 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()];
28794
28851
  }
28795
28852
  });
28796
28853
  }); };
@@ -28819,17 +28876,10 @@ var Page$d = function (_a) {
28819
28876
  return (React.createElement(IkasPage, { settingsStr: settingsStr, page: page, propValues: propValues }));
28820
28877
  };
28821
28878
  var getStaticProps$b = function (context) { return __awaiter(void 0, void 0, void 0, function () {
28822
- var theme, provider;
28823
28879
  return __generator(this, function (_a) {
28824
28880
  switch (_a.label) {
28825
- case 0: return [4 /*yield*/, IkasThemeAPI.fetchTheme()];
28826
- case 1:
28827
- theme = _a.sent();
28828
- provider = new IkasPageDataProvider(theme, context.params, exports.IkasThemePageType.FAVORITE_PRODUCTS);
28829
- return [4 /*yield*/, provider.getPageData()];
28830
- case 2:
28831
- _a.sent();
28832
- 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()];
28833
28883
  }
28834
28884
  });
28835
28885
  }); };
@@ -28855,17 +28905,10 @@ var Page$e = function (_a) {
28855
28905
  return (React.createElement(IkasPage, { merchantSettings: merchantSettings, settingsStr: settingsStr, page: page, propValues: propValues, addOgpMetas: true }));
28856
28906
  };
28857
28907
  var getStaticProps$c = function (context) { return __awaiter(void 0, void 0, void 0, function () {
28858
- var theme, provider;
28859
28908
  return __generator(this, function (_a) {
28860
28909
  switch (_a.label) {
28861
- case 0: return [4 /*yield*/, IkasThemeAPI.fetchTheme()];
28862
- case 1:
28863
- theme = _a.sent();
28864
- provider = new IkasPageDataProvider(theme, context.params, exports.IkasThemePageType.SEARCH);
28865
- return [4 /*yield*/, provider.getPageData()];
28866
- case 2:
28867
- _a.sent();
28868
- 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()];
28869
28912
  }
28870
28913
  });
28871
28914
  }); };
@@ -28883,17 +28926,10 @@ var Page$f = function (_a) {
28883
28926
  return (React.createElement(IkasPage, { merchantSettings: merchantSettings, settingsStr: settingsStr, page: page, propValues: propValues }));
28884
28927
  };
28885
28928
  var getStaticProps$d = function (context) { return __awaiter(void 0, void 0, void 0, function () {
28886
- var theme, provider;
28887
28929
  return __generator(this, function (_a) {
28888
28930
  switch (_a.label) {
28889
- case 0: return [4 /*yield*/, IkasThemeAPI.fetchTheme()];
28890
- case 1:
28891
- theme = _a.sent();
28892
- provider = new IkasPageDataProvider(theme, context.params, exports.IkasThemePageType.NOT_FOUND);
28893
- return [4 /*yield*/, provider.getPageData()];
28894
- case 2:
28895
- _a.sent();
28896
- 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()];
28897
28933
  }
28898
28934
  });
28899
28935
  }); };
@@ -28993,10 +29029,8 @@ exports.IkasProductSearchAPI = IkasProductSearchAPI;
28993
29029
  exports.IkasProductVariant = IkasProductVariant;
28994
29030
  exports.IkasProductVariantType = IkasProductVariantType;
28995
29031
  exports.IkasStateAPI = IkasStateAPI;
28996
- exports.IkasStorefrontAPI = IkasStorefrontAPI;
28997
29032
  exports.IkasStorefrontConfig = IkasStorefrontConfig;
28998
29033
  exports.IkasTheme = IkasTheme;
28999
- exports.IkasThemeAPI = IkasThemeAPI;
29000
29034
  exports.IkasThemeComponent = IkasThemeComponent;
29001
29035
  exports.IkasThemeComponentProp = IkasThemeComponentProp;
29002
29036
  exports.IkasThemeCustomData = IkasThemeCustomData;