@ikas/storefront 0.0.107 → 0.0.109

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/index.js CHANGED
@@ -4,24 +4,24 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var mobx = require('mobx');
6
6
  var React = require('react');
7
- var getConfig = require('next/config');
8
7
  var mobxReactLite = require('mobx-react-lite');
9
8
  var router = require('next/router');
10
9
  var Image$1 = require('next/image');
11
10
  var Link = require('next/link');
12
11
  var Head = require('next/head');
13
12
  var fs = require('fs');
13
+ var getConfig = require('next/config');
14
14
  var dynamic = require('next/dynamic');
15
15
  var Error$1 = require('next/error');
16
16
 
17
17
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
18
18
 
19
19
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
20
- 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);
24
23
  var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);
24
+ var getConfig__default = /*#__PURE__*/_interopDefaultLegacy(getConfig);
25
25
  var dynamic__default = /*#__PURE__*/_interopDefaultLegacy(dynamic);
26
26
  var Error__default = /*#__PURE__*/_interopDefaultLegacy(Error$1);
27
27
 
@@ -10912,6 +10912,8 @@ var IkasStorefrontConfig = /** @class */ (function () {
10912
10912
  priceListId: IkasStorefrontConfig.priceListId || null,
10913
10913
  stockLocationIds: IkasStorefrontConfig.stockLocationIds || null,
10914
10914
  routings: JSON.parse(JSON.stringify(IkasStorefrontConfig.routings)) || null,
10915
+ gtmId: IkasStorefrontConfig.gtmId || null,
10916
+ fbpId: IkasStorefrontConfig.fbpId || null,
10915
10917
  };
10916
10918
  };
10917
10919
  IkasStorefrontConfig.components = {};
@@ -12574,6 +12576,32 @@ var IkasFilterCategory = /** @class */ (function () {
12574
12576
  return IkasFilterCategory;
12575
12577
  }());
12576
12578
 
12579
+ var IkasCheckoutSettings = /** @class */ (function () {
12580
+ function IkasCheckoutSettings(data) {
12581
+ if (data === void 0) { data = {}; }
12582
+ this.id = data.id || "";
12583
+ this.createdAt = data.createdAt || 0;
12584
+ this.updatedAt = data.updatedAt || 0;
12585
+ this.phoneRequirement =
12586
+ data.phoneRequirement || IkasCheckoutRequirementEnum.OPTIONAL;
12587
+ this.identityNumberRequirement =
12588
+ data.identityNumberRequirement || IkasCheckoutRequirementEnum.INVISIBLE;
12589
+ this.isAccountRequired = data.isAccountRequired || false;
12590
+ this.isTermsAndConditionsDefaultChecked =
12591
+ data.isTermsAndConditionsDefaultChecked || false;
12592
+ this.showTermsAndConditionsCheckbox =
12593
+ data.showTermsAndConditionsCheckbox || false;
12594
+ this.storefrontId = data.storefrontId || "";
12595
+ }
12596
+ return IkasCheckoutSettings;
12597
+ }());
12598
+ var IkasCheckoutRequirementEnum;
12599
+ (function (IkasCheckoutRequirementEnum) {
12600
+ IkasCheckoutRequirementEnum["INVISIBLE"] = "INVISIBLE";
12601
+ IkasCheckoutRequirementEnum["MANDATORY"] = "MANDATORY";
12602
+ IkasCheckoutRequirementEnum["OPTIONAL"] = "OPTIONAL";
12603
+ })(IkasCheckoutRequirementEnum || (IkasCheckoutRequirementEnum = {}));
12604
+
12577
12605
  var IkasOrderAddress = /** @class */ (function () {
12578
12606
  function IkasOrderAddress(data) {
12579
12607
  if (data === void 0) { data = {}; }
@@ -12633,6 +12661,10 @@ var IkasOrderAddress = /** @class */ (function () {
12633
12661
  });
12634
12662
  Object.defineProperty(IkasOrderAddress.prototype, "validationResult", {
12635
12663
  get: function () {
12664
+ var _a, _b, _c, _d;
12665
+ var isValidPhone = !!this.phone &&
12666
+ this.phone.length >= 10 &&
12667
+ validatePhoneNumber(this.phone);
12636
12668
  var results = {
12637
12669
  firstName: !!this.firstName,
12638
12670
  lastName: !!this.lastName,
@@ -12641,8 +12673,19 @@ var IkasOrderAddress = /** @class */ (function () {
12641
12673
  country: !!this.country,
12642
12674
  state: !!this.state,
12643
12675
  city: !!this.city,
12644
- phone: this.phone
12645
- ? this.phone.length >= 10 && validatePhoneNumber(this.phone)
12676
+ phone: ((_a = this.checkoutSettings) === null || _a === void 0 ? void 0 : _a.phoneRequirement) ===
12677
+ IkasCheckoutRequirementEnum.MANDATORY ||
12678
+ (((_b = this.checkoutSettings) === null || _b === void 0 ? void 0 : _b.phoneRequirement) ===
12679
+ IkasCheckoutRequirementEnum.OPTIONAL &&
12680
+ this.phone)
12681
+ ? isValidPhone
12682
+ : true,
12683
+ identityNumber: ((_c = this.checkoutSettings) === null || _c === void 0 ? void 0 : _c.identityNumberRequirement) ===
12684
+ IkasCheckoutRequirementEnum.MANDATORY ||
12685
+ (((_d = this.checkoutSettings) === null || _d === void 0 ? void 0 : _d.identityNumberRequirement) ===
12686
+ IkasCheckoutRequirementEnum.OPTIONAL &&
12687
+ this.phone)
12688
+ ? !!this.identityNumber
12646
12689
  : true,
12647
12690
  };
12648
12691
  return results;
@@ -12657,6 +12700,11 @@ var IkasOrderAddress = /** @class */ (function () {
12657
12700
  enumerable: false,
12658
12701
  configurable: true
12659
12702
  });
12703
+ IkasOrderAddress.prototype.toJSON = function () {
12704
+ var obj = __assign({}, this);
12705
+ delete obj.checkoutSettings;
12706
+ return obj;
12707
+ };
12660
12708
  return IkasOrderAddress;
12661
12709
  }());
12662
12710
 
@@ -15861,14 +15909,16 @@ var MAX_CVC_LENGTH = 4;
15861
15909
  var USE_DIFFERENT_ADDRESS_KEY = "sAddr";
15862
15910
  var isServer$1 = typeof localStorage === "undefined";
15863
15911
  var CheckoutViewModel = /** @class */ (function () {
15864
- function CheckoutViewModel(checkout, queryParams, router, returnPolicy, privacyPolicy, termsOfService) {
15912
+ function CheckoutViewModel(checkout, checkoutSettings, queryParams, router, returnPolicy, privacyPolicy, termsOfService) {
15865
15913
  var _this = this;
15866
15914
  this.checkout = new IkasCheckout();
15915
+ this.checkoutSettings = new IkasCheckoutSettings();
15867
15916
  this.storefront = null;
15868
15917
  this.customerStore = new IkasCustomerStore();
15869
15918
  this.isCheckoutLoaded = false;
15870
15919
  this.isErrorsVisible = false;
15871
15920
  this.isStepLoading = false;
15921
+ this.isTermsAndConditionsChecked = false;
15872
15922
  this.step = CheckoutStep.INFO;
15873
15923
  this.cardData = null;
15874
15924
  this.paymentGatewayId = null;
@@ -15880,6 +15930,8 @@ var CheckoutViewModel = /** @class */ (function () {
15880
15930
  this.shippingCountryIds = null;
15881
15931
  this.selectedShippingAddressId = "-1";
15882
15932
  this.selectedBillingAddressId = "-1";
15933
+ this.policyModalTitle = "";
15934
+ this.policyModalText = "";
15883
15935
  this.error = null;
15884
15936
  this.init = function (queryParams) { return __awaiter(_this, void 0, void 0, function () {
15885
15937
  var merchantId, _a;
@@ -15997,7 +16049,7 @@ var CheckoutViewModel = /** @class */ (function () {
15997
16049
  switch (_b.label) {
15998
16050
  case 0:
15999
16051
  _a = this;
16000
- return [4 /*yield*/, IkasCountryAPI.listShippingCountries(IkasStorefrontConfig.storefrontId)];
16052
+ return [4 /*yield*/, IkasCountryAPI.listShippingCountries(IkasStorefrontConfig.salesChannelId)];
16001
16053
  case 1:
16002
16054
  _a.shippingCountryIds = _b.sent();
16003
16055
  return [2 /*return*/];
@@ -16083,6 +16135,7 @@ var CheckoutViewModel = /** @class */ (function () {
16083
16135
  this.createShippingAddress = function () {
16084
16136
  if (!_this.checkout.shippingAddress)
16085
16137
  _this.checkout.shippingAddress = new IkasOrderAddress();
16138
+ _this.checkout.shippingAddress.checkoutSettings = _this.checkoutSettings;
16086
16139
  };
16087
16140
  this.createBillingAddress = function () {
16088
16141
  if (typeof localStorage !== "undefined") {
@@ -16145,6 +16198,9 @@ var CheckoutViewModel = /** @class */ (function () {
16145
16198
  _this.checkout.billingAddress = new IkasOrderAddress(address);
16146
16199
  }
16147
16200
  };
16201
+ this.onTermsAndConditionsCheckedChange = function (value) {
16202
+ _this.isTermsAndConditionsChecked = value;
16203
+ };
16148
16204
  // CREDIT CARD START
16149
16205
  this.onCardNumberChange = function (value) {
16150
16206
  if (!_this.cardData)
@@ -16416,10 +16472,12 @@ var CheckoutViewModel = /** @class */ (function () {
16416
16472
  });
16417
16473
  }); };
16418
16474
  this.checkout = checkout;
16475
+ this.checkoutSettings = checkoutSettings;
16419
16476
  this.router = router;
16420
16477
  this.returnPolicy = returnPolicy;
16421
16478
  this.privacyPolicy = privacyPolicy;
16422
16479
  this.termsOfService = termsOfService;
16480
+ this.isTermsAndConditionsChecked = this.checkoutSettings.isTermsAndConditionsDefaultChecked;
16423
16481
  this.init(queryParams);
16424
16482
  mobx.makeAutoObservable(this);
16425
16483
  }
@@ -16438,6 +16496,14 @@ var CheckoutViewModel = /** @class */ (function () {
16438
16496
  enumerable: false,
16439
16497
  configurable: true
16440
16498
  });
16499
+ Object.defineProperty(CheckoutViewModel.prototype, "selectedPaymentGateway", {
16500
+ get: function () {
16501
+ var _this = this;
16502
+ return this.paymentGateways.find(function (pg) { return pg.id === _this.paymentGatewayId; });
16503
+ },
16504
+ enumerable: false,
16505
+ configurable: true
16506
+ });
16441
16507
  Object.defineProperty(CheckoutViewModel.prototype, "selectedInstallmentIndex", {
16442
16508
  get: function () {
16443
16509
  var _this = this;
@@ -16511,10 +16577,15 @@ var CheckoutViewModel = /** @class */ (function () {
16511
16577
  });
16512
16578
  Object.defineProperty(CheckoutViewModel.prototype, "canPerformPayment", {
16513
16579
  get: function () {
16514
- var _a, _b;
16580
+ var _a, _b, _c;
16581
+ if (this.checkoutSettings.showTermsAndConditionsCheckbox &&
16582
+ !this.isTermsAndConditionsChecked)
16583
+ return false;
16515
16584
  return (this.canProceedToShipping &&
16516
16585
  !!((_a = this.checkout.billingAddress) === null || _a === void 0 ? void 0 : _a.isValid) &&
16517
- (!!this.cardData ? (_b = this.cardData) === null || _b === void 0 ? void 0 : _b.isValid : true));
16586
+ (((_b = this.selectedPaymentGateway) === null || _b === void 0 ? void 0 : _b.paymentMethodType) ===
16587
+ IkasPaymentMethodType.CREDIT_CARD
16588
+ ? (_c = this.cardData) === null || _c === void 0 ? void 0 : _c.isValid : true));
16518
16589
  },
16519
16590
  enumerable: false,
16520
16591
  configurable: true
@@ -16895,9 +16966,8 @@ var Analytics = /** @class */ (function () {
16895
16966
 
16896
16967
  var AnalyticsHead = function (_a) {
16897
16968
  var blockHTML = _a.blockHTML;
16898
- var serverRuntimeConfig = getConfig__default['default']().serverRuntimeConfig;
16899
- var gtmId = serverRuntimeConfig.GTM_ID;
16900
- var fbpId = serverRuntimeConfig.FBP_ID;
16969
+ var gtmId = IkasStorefrontConfig.gtmId;
16970
+ var fbpId = IkasStorefrontConfig.fbpId;
16901
16971
  return (React.createElement(React.Fragment, null,
16902
16972
  blockHTML && (React.createElement("script", { dangerouslySetInnerHTML: {
16903
16973
  __html: "dataLayer = [{'gtm.blocklist': ['html']}];",
@@ -16910,9 +16980,8 @@ var AnalyticsHead = function (_a) {
16910
16980
  } }))));
16911
16981
  };
16912
16982
  var AnalyticsBody = function () {
16913
- var serverRuntimeConfig = getConfig__default['default']().serverRuntimeConfig;
16914
- var gtmId = serverRuntimeConfig.GTM_ID;
16915
- var fbpId = serverRuntimeConfig.FBP_ID;
16983
+ var gtmId = IkasStorefrontConfig.gtmId;
16984
+ var fbpId = IkasStorefrontConfig.fbpId;
16916
16985
  return (React.createElement(React.Fragment, null,
16917
16986
  gtmId && (React.createElement("noscript", { dangerouslySetInnerHTML: {
16918
16987
  __html: "<iframe src=\"https://www.googletagmanager.com/ns.html?id=" + gtmId + "\" height=\"0\" width=\"0\" style=\"display:none;visibility:hidden\"></iframe>",
@@ -24617,6 +24686,7 @@ var IkasCheckoutAPI = /** @class */ (function () {
24617
24686
  taxNumber: checkout.billingAddress.taxNumber || null,
24618
24687
  taxOffice: checkout.billingAddress.taxOffice || null,
24619
24688
  isDefault: checkout.billingAddress.isDefault || false,
24689
+ identityNumber: checkout.billingAddress.identityNumber || null,
24620
24690
  }
24621
24691
  : null,
24622
24692
  shippingAddress: checkout.shippingAddress &&
@@ -24636,6 +24706,7 @@ var IkasCheckoutAPI = /** @class */ (function () {
24636
24706
  taxNumber: checkout.shippingAddress.taxNumber || null,
24637
24707
  taxOffice: checkout.shippingAddress.taxOffice || null,
24638
24708
  isDefault: checkout.shippingAddress.isDefault || false,
24709
+ identityNumber: checkout.shippingAddress.identityNumber || null,
24639
24710
  }
24640
24711
  : null,
24641
24712
  couponCode: checkout.couponCode || null,
@@ -24810,9 +24881,44 @@ var IkasCheckoutAPI = /** @class */ (function () {
24810
24881
  });
24811
24882
  });
24812
24883
  };
24884
+ IkasCheckoutAPI.listCheckoutSettings = function () {
24885
+ return __awaiter(this, void 0, void 0, function () {
24886
+ var QUERY, _a, data, errors, err_8;
24887
+ return __generator(this, function (_b) {
24888
+ switch (_b.label) {
24889
+ case 0:
24890
+ QUERY = src(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n query listCheckoutSettings($storefrontId: StringFilterInput!) {\n listCheckoutSettings(storefrontId: $storefrontId) {\n createdAt\n id\n identityNumberRequirement\n isAccountRequired\n isTermsAndConditionsDefaultChecked\n options {\n name\n required\n }\n phoneRequirement\n showTermsAndConditionsCheckbox\n storefrontId\n updatedAt\n }\n }\n "], ["\n query listCheckoutSettings($storefrontId: StringFilterInput!) {\n listCheckoutSettings(storefrontId: $storefrontId) {\n createdAt\n id\n identityNumberRequirement\n isAccountRequired\n isTermsAndConditionsDefaultChecked\n options {\n name\n required\n }\n phoneRequirement\n showTermsAndConditionsCheckbox\n storefrontId\n updatedAt\n }\n }\n "])));
24891
+ _b.label = 1;
24892
+ case 1:
24893
+ _b.trys.push([1, 3, , 4]);
24894
+ return [4 /*yield*/, apollo
24895
+ .getClient()
24896
+ .query({
24897
+ query: QUERY,
24898
+ variables: {
24899
+ storefrontId: { eq: IkasStorefrontConfig.storefrontId },
24900
+ },
24901
+ })];
24902
+ case 2:
24903
+ _a = _b.sent(), data = _a.data, errors = _a.errors;
24904
+ if (errors && errors.length) {
24905
+ console.log(errors);
24906
+ }
24907
+ if (data)
24908
+ return [2 /*return*/, data.listCheckoutSettings.map(function (cs) { return new IkasCheckoutSettings(cs); })];
24909
+ return [3 /*break*/, 4];
24910
+ case 3:
24911
+ err_8 = _b.sent();
24912
+ console.log(err_8);
24913
+ return [3 /*break*/, 4];
24914
+ case 4: return [2 /*return*/];
24915
+ }
24916
+ });
24917
+ });
24918
+ };
24813
24919
  return IkasCheckoutAPI;
24814
24920
  }());
24815
- var templateObject_1$3, templateObject_2$2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7;
24921
+ var templateObject_1$3, templateObject_2$2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8;
24816
24922
 
24817
24923
  var IkasCityAPI = /** @class */ (function () {
24818
24924
  function IkasCityAPI() {
@@ -24904,13 +25010,13 @@ var IkasCountryAPI = /** @class */ (function () {
24904
25010
  });
24905
25011
  });
24906
25012
  };
24907
- IkasCountryAPI.listShippingCountries = function (storefrontId) {
25013
+ IkasCountryAPI.listShippingCountries = function (salesChannelId) {
24908
25014
  return __awaiter(this, void 0, void 0, function () {
24909
25015
  var QUERY, _a, data, errors, err_2;
24910
25016
  return __generator(this, function (_b) {
24911
25017
  switch (_b.label) {
24912
25018
  case 0:
24913
- 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 "])));
25019
+ QUERY = src(templateObject_2$3 || (templateObject_2$3 = __makeTemplateObject(["\n query getAvailableShippingCountries($salesChannelId: String!) {\n getAvailableShippingCountries(salesChannelId: $salesChannelId)\n }\n "], ["\n query getAvailableShippingCountries($salesChannelId: String!) {\n getAvailableShippingCountries(salesChannelId: $salesChannelId)\n }\n "])));
24914
25020
  _b.label = 1;
24915
25021
  case 1:
24916
25022
  _b.trys.push([1, 3, , 4]);
@@ -24919,7 +25025,7 @@ var IkasCountryAPI = /** @class */ (function () {
24919
25025
  .query({
24920
25026
  query: QUERY,
24921
25027
  variables: {
24922
- storefrontId: storefrontId,
25028
+ salesChannelId: salesChannelId,
24923
25029
  },
24924
25030
  })];
24925
25031
  case 2:
@@ -25221,7 +25327,7 @@ var IkasCustomerAPI = /** @class */ (function () {
25221
25327
  return __generator(this, function (_b) {
25222
25328
  switch (_b.label) {
25223
25329
  case 0:
25224
- MUTATION = src(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n mutation saveMyCustomer($input: SaveMyCustomerInput!) {\n saveMyCustomer(input: $input) {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n phone\n }\n phone\n accountStatus\n email\n firstName\n }\n }\n "], ["\n mutation saveMyCustomer($input: SaveMyCustomerInput!) {\n saveMyCustomer(input: $input) {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n phone\n }\n phone\n accountStatus\n email\n firstName\n }\n }\n "])));
25330
+ MUTATION = src(templateObject_8$1 || (templateObject_8$1 = __makeTemplateObject(["\n mutation saveMyCustomer($input: SaveMyCustomerInput!) {\n saveMyCustomer(input: $input) {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n phone\n }\n phone\n accountStatus\n email\n firstName\n }\n }\n "], ["\n mutation saveMyCustomer($input: SaveMyCustomerInput!) {\n saveMyCustomer(input: $input) {\n id\n isEmailVerified\n isPhoneVerified\n lastName\n addresses {\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n code\n id\n name\n }\n district {\n id\n name\n code\n }\n id\n firstName\n isDefault\n lastName\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n title\n phone\n }\n phone\n accountStatus\n email\n firstName\n }\n }\n "])));
25225
25331
  _b.label = 1;
25226
25332
  case 1:
25227
25333
  _b.trys.push([1, 3, , 4]);
@@ -25367,7 +25473,7 @@ var IkasCustomerAPI = /** @class */ (function () {
25367
25473
  };
25368
25474
  return IkasCustomerAPI;
25369
25475
  }());
25370
- var templateObject_1$6, templateObject_2$4, templateObject_3$2, templateObject_4$1, templateObject_5$1, templateObject_6$1, templateObject_7$1, templateObject_8, templateObject_9, templateObject_10, templateObject_11;
25476
+ var templateObject_1$6, templateObject_2$4, templateObject_3$2, templateObject_4$1, templateObject_5$1, templateObject_6$1, templateObject_7$1, templateObject_8$1, templateObject_9, templateObject_10, templateObject_11;
25371
25477
 
25372
25478
  var IkasDistrictAPI = /** @class */ (function () {
25373
25479
  function IkasDistrictAPI() {
@@ -26332,6 +26438,9 @@ var AddressFormViewModel = /** @class */ (function () {
26332
26438
  this.onPhoneChange = function (value) {
26333
26439
  _this.address.phone = value;
26334
26440
  };
26441
+ this.onIdentityNumberChange = function (value) {
26442
+ _this.address.identityNumber = value;
26443
+ };
26335
26444
  this.onAddressLine1Change = function (value) {
26336
26445
  _this.address.addressLine1 = value;
26337
26446
  };
@@ -26436,6 +26545,13 @@ var AddressFormViewModel = /** @class */ (function () {
26436
26545
  enumerable: false,
26437
26546
  configurable: true
26438
26547
  });
26548
+ Object.defineProperty(AddressFormViewModel.prototype, "identityNumber", {
26549
+ get: function () {
26550
+ return this.address.identityNumber;
26551
+ },
26552
+ enumerable: false,
26553
+ configurable: true
26554
+ });
26439
26555
  Object.defineProperty(AddressFormViewModel.prototype, "country", {
26440
26556
  get: function () {
26441
26557
  return this.address.country;
@@ -26511,12 +26627,12 @@ var css_248z$2 = ".common-module_FormSectionTitle___Mykh {\n width: 100%;\n di
26511
26627
  var commonStyles = {"FormSectionTitle":"common-module_FormSectionTitle___Mykh","Title":"common-module_Title__3JTHt","WithSubTitle":"common-module_WithSubTitle__1VHWv","SubTitle":"common-module_SubTitle__1H4kH","Grid":"common-module_Grid__2CuvH","Grid2":"common-module_Grid2__9CCag","Grid3":"common-module_Grid3__3p0jJ","FormContainer":"common-module_FormContainer__2I_Lj","mtFormRow":"common-module_mtFormRow__2tsDn","mt1":"common-module_mt1__3tpC1","mt2":"common-module_mt2__2bl5q","fadeInFromRight":"common-module_fadeInFromRight__3RYk5"};
26512
26628
  styleInject(css_248z$2);
26513
26629
 
26514
- var css_248z$3 = ".style-module_CheckoutPage__A_f2V {\n font-family: -apple-system, system-ui, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif;\n font-size: 16px;\n width: 100%;\n height: 100vh;\n overflow: auto;\n overflow-x: hidden;\n display: flex; }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 {\n width: 50%;\n flex: 0 0 auto;\n display: flex;\n justify-content: flex-end;\n padding-left: 20px;\n padding-right: 40px; }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_LeftContent__1Tyb7 {\n width: 100%;\n min-width: 400px;\n max-width: 600px;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n min-height: 100vh; }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_LeftContent__1Tyb7 .style-module_Space__1e2de {\n width: 100%;\n height: 100px; }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_LeftContent__1Tyb7 .style-module_Footer__ebdyg {\n flex: 0 0 auto;\n height: 50px;\n background-color: white;\n width: calc(100% - 1em);\n display: flex;\n align-items: center;\n border-top: 1px solid #d9d9d9; }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_LeftContent__1Tyb7 .style-module_Footer__ebdyg .style-module_FooterItem__1ofBc {\n font-size: 0.7em;\n margin-right: 1.4em;\n color: #737373;\n cursor: pointer;\n user-select: none; }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_LeftContent__1Tyb7 .style-module_Footer__ebdyg .style-module_FooterItem__1ofBc:hover {\n color: #111111; }\n @media only screen and (max-width: 1000px) {\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_LeftContent__1Tyb7 .style-module_Footer__ebdyg {\n width: 100%;\n padding-left: 0.7em; } }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_Header__1vfF1 {\n width: 100%;\n height: 96px;\n display: flex;\n align-items: center;\n font-weight: 500;\n font-size: 1.5em;\n padding-left: 0.4em; }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_Header__1vfF1 a {\n width: 100%; }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_Header__1vfF1 .style-module_Logo__2E8Do {\n width: 100%;\n height: 64px;\n position: relative;\n user-select: none;\n cursor: pointer; }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_Header__1vfF1 .style-module_Logo__2E8Do img {\n object-fit: contain;\n object-position: left;\n pointer-events: none; }\n @media only screen and (min-width: 1000px) {\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_MobileCartSummary__3NrcP {\n display: none; } }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_RowPB__3M7Tz {\n padding-bottom: 0.7em; }\n @media only screen and (max-width: 1000px) {\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 {\n width: 100%;\n justify-content: center;\n padding-right: 0px;\n padding-left: 0px; }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_LeftContent__1Tyb7 {\n width: 100%;\n min-width: auto;\n max-width: 100%; } }\n .style-module_CheckoutPage__A_f2V .style-module_Right__3AN4f {\n width: 50%;\n min-height: 100%;\n flex: 0 0 auto;\n background-color: #FAFAFA;\n border-left: 1px solid #d9d9d9;\n display: flex;\n padding-left: 40px;\n padding-right: 20px;\n position: sticky;\n top: 0;\n overflow-y: auto; }\n .style-module_CheckoutPage__A_f2V .style-module_Right__3AN4f .style-module_RightContent__1TcO5 {\n width: 100%;\n max-width: 600px;\n padding-top: 80px; }\n @media only screen and (max-width: 1000px) {\n .style-module_CheckoutPage__A_f2V .style-module_Right__3AN4f {\n display: none; } }\n";
26630
+ var css_248z$3 = ".style-module_CheckoutPage__A_f2V {\n font-family: -apple-system, system-ui, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif;\n font-size: 16px;\n width: 100%;\n height: 100vh;\n overflow: auto;\n overflow-x: hidden;\n display: flex; }\n .style-module_CheckoutPage__A_f2V * {\n box-sizing: border-box !important; }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 {\n width: 50%;\n flex: 0 0 auto;\n display: flex;\n justify-content: flex-end;\n padding-left: 20px;\n padding-right: 40px; }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_LeftContent__1Tyb7 {\n width: 100%;\n min-width: 400px;\n max-width: 600px;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n min-height: 100vh; }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_LeftContent__1Tyb7 .style-module_Space__1e2de {\n width: 100%;\n height: 100px; }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_LeftContent__1Tyb7 .style-module_Footer__ebdyg {\n flex: 0 0 auto;\n height: 50px;\n background-color: white;\n width: calc(100% - 1em);\n display: flex;\n align-items: center;\n border-top: 1px solid #d9d9d9; }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_LeftContent__1Tyb7 .style-module_Footer__ebdyg .style-module_FooterItem__1ofBc {\n font-size: 0.7em;\n margin-right: 1.4em;\n color: #737373;\n cursor: pointer;\n user-select: none; }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_LeftContent__1Tyb7 .style-module_Footer__ebdyg .style-module_FooterItem__1ofBc:hover {\n color: #111111; }\n @media only screen and (max-width: 1000px) {\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_LeftContent__1Tyb7 .style-module_Footer__ebdyg {\n width: 100%;\n padding-left: 0.7em; } }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_Header__1vfF1 {\n width: 100%;\n height: 96px;\n display: flex;\n align-items: center;\n font-weight: 500;\n font-size: 1.5em;\n padding-left: 0.4em; }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_Header__1vfF1 a {\n width: 100%; }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_Header__1vfF1 .style-module_Logo__2E8Do {\n width: 100%;\n height: 64px;\n position: relative;\n user-select: none;\n cursor: pointer; }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_Header__1vfF1 .style-module_Logo__2E8Do img {\n object-fit: contain;\n object-position: left;\n pointer-events: none; }\n @media only screen and (min-width: 1000px) {\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_MobileCartSummary__3NrcP {\n display: none; } }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_RowPB__3M7Tz {\n padding-bottom: 0.7em; }\n @media only screen and (max-width: 1000px) {\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 {\n width: 100%;\n justify-content: center;\n padding-right: 0px;\n padding-left: 0px; }\n .style-module_CheckoutPage__A_f2V .style-module_Left__2dWz6 .style-module_LeftContent__1Tyb7 {\n width: 100%;\n min-width: auto;\n max-width: 100%; } }\n .style-module_CheckoutPage__A_f2V .style-module_Right__3AN4f {\n width: 50%;\n min-height: 100%;\n flex: 0 0 auto;\n background-color: #FAFAFA;\n border-left: 1px solid #d9d9d9;\n display: flex;\n padding-left: 40px;\n padding-right: 20px;\n position: sticky;\n top: 0;\n overflow-y: auto; }\n .style-module_CheckoutPage__A_f2V .style-module_Right__3AN4f .style-module_RightContent__1TcO5 {\n width: 100%;\n max-width: 600px;\n padding-top: 80px; }\n @media only screen and (max-width: 1000px) {\n .style-module_CheckoutPage__A_f2V .style-module_Right__3AN4f {\n display: none; } }\n";
26515
26631
  var styles$2 = {"CheckoutPage":"style-module_CheckoutPage__A_f2V","Left":"style-module_Left__2dWz6","LeftContent":"style-module_LeftContent__1Tyb7","Space":"style-module_Space__1e2de","Footer":"style-module_Footer__ebdyg","FooterItem":"style-module_FooterItem__1ofBc","Header":"style-module_Header__1vfF1","Logo":"style-module_Logo__2E8Do","MobileCartSummary":"style-module_MobileCartSummary__3NrcP","RowPB":"style-module_RowPB__3M7Tz","Right":"style-module_Right__3AN4f","RightContent":"style-module_RightContent__1TcO5"};
26516
26632
  styleInject(css_248z$3);
26517
26633
 
26518
26634
  var AddressForm$1 = mobxReactLite.observer(function (_a) {
26519
- var _b, _c, _d, _e, _f;
26635
+ var _b, _c, _d, _e, _f, _g, _h;
26520
26636
  var isErrorsVisible = _a.isErrorsVisible, validationResult = _a.validationResult, props = __rest(_a, ["isErrorsVisible", "validationResult"]);
26521
26637
  var vm = React.useState(function () { return new AddressFormViewModel(props); })[0];
26522
26638
  React.useEffect(function () {
@@ -26544,9 +26660,10 @@ var AddressForm$1 = mobxReactLite.observer(function (_a) {
26544
26660
  vm.hasState && (React.createElement(FormItem, { type: FormItemType.SELECT, label: "Eyalet", value: ((_c = vm.state) === null || _c === void 0 ? void 0 : _c.id) || "", onChange: vm.onStateChange, options: vm.stateOptions, hasError: isErrorsVisible && !(validationResult === null || validationResult === void 0 ? void 0 : validationResult.state), errorText: "Eyalet seçin" })),
26545
26661
  React.createElement(FormItem, { type: FormItemType.SELECT, label: "\u0130l", value: ((_d = vm.city) === null || _d === void 0 ? void 0 : _d.id) || "", onChange: vm.onCityChange, options: vm.cityOptions, hasError: isErrorsVisible && !(validationResult === null || validationResult === void 0 ? void 0 : validationResult.city), errorText: "Şehir seçin" }),
26546
26662
  vm.districtOptions.length ? (React.createElement(FormItem, { type: FormItemType.SELECT, label: "\u0130l\u00E7e", value: ((_e = vm.district) === null || _e === void 0 ? void 0 : _e.id) || "", onChange: vm.onDistrictChange, options: vm.districtOptions, errorText: "İlçe seçin" })) : (React.createElement(FormItem, { type: FormItemType.TEXT, label: "\u0130l\u00E7e", value: ((_f = vm.district) === null || _f === void 0 ? void 0 : _f.name) || "", onChange: vm.onDistrictInputChange })),
26547
- !vm.hasState && (React.createElement(FormItem, { type: FormItemType.TEXT, label: "Telefon", autocomplete: "tel", value: vm.phone || "", onChange: vm.onPhoneChange, hasError: isErrorsVisible && !(validationResult === null || validationResult === void 0 ? void 0 : validationResult.phone), errorText: "Geçerli bir telefon girin" }))),
26548
- vm.hasState && (React.createElement("div", { className: [styles$2.RowPB, commonStyles.mtFormRow].join(" ") },
26549
- React.createElement(FormItem, { type: FormItemType.TEXT, label: "Telefon", autocomplete: "tel", value: vm.phone || "", onChange: vm.onPhoneChange, hasError: isErrorsVisible && (validationResult === null || validationResult === void 0 ? void 0 : validationResult.phone), errorText: "Geçerli bir telefon girin" })))));
26663
+ ((_g = vm.address.checkoutSettings) === null || _g === void 0 ? void 0 : _g.phoneRequirement) !==
26664
+ IkasCheckoutRequirementEnum.INVISIBLE && (React.createElement(FormItem, { type: FormItemType.TEXT, label: "Telefon", autocomplete: "tel", value: vm.phone || "", onChange: vm.onPhoneChange, hasError: isErrorsVisible && !(validationResult === null || validationResult === void 0 ? void 0 : validationResult.phone), errorText: "Geçerli bir telefon girin" })),
26665
+ ((_h = vm.address.checkoutSettings) === null || _h === void 0 ? void 0 : _h.identityNumberRequirement) !==
26666
+ IkasCheckoutRequirementEnum.INVISIBLE && (React.createElement(FormItem, { type: FormItemType.TEXT, label: "TC Kimlik No", value: vm.identityNumber || "", onChange: vm.onIdentityNumberChange, hasError: isErrorsVisible && !(validationResult === null || validationResult === void 0 ? void 0 : validationResult.identityNumber), errorText: "TC kimlik no girin" })))));
26550
26667
  });
26551
26668
 
26552
26669
  var css_248z$4 = ".style-module_Button__1UPMN {\n cursor: pointer;\n border: 1px transparent solid;\n border-radius: 6px;\n font-weight: 500;\n text-align: center;\n position: relative;\n transition: all .2s;\n display: flex;\n justify-content: center;\n align-items: center; }\n .style-module_Button__1UPMN.style-module_Large__2wPlw {\n height: 64px;\n padding: 0 1.7em; }\n .style-module_Button__1UPMN.style-module_Dark__1Z_hs {\n background-color: #111111;\n color: white; }\n .style-module_Button__1UPMN.style-module_Disabled__3HYF_ {\n background-color: #c8c8c8;\n color: #545454;\n pointer-events: none; }\n @media only screen and (max-width: 1000px) {\n .style-module_Button__1UPMN.style-module_FullWidthMobile__3MTFv {\n width: 100%; } }\n .style-module_Button__1UPMN .style-module_loader__3v6kq,\n .style-module_Button__1UPMN .style-module_loader__3v6kq:after {\n border-radius: 50%;\n width: 5em;\n height: 5em; }\n .style-module_Button__1UPMN .style-module_loader__3v6kq {\n font-size: 6px;\n position: relative;\n text-indent: -9999em;\n border-top: 0.5em solid rgba(255, 255, 255, 0.2);\n border-right: 0.5em solid rgba(255, 255, 255, 0.2);\n border-bottom: 0.5em solid rgba(255, 255, 255, 0.2);\n border-left: 0.5em solid #ffffff;\n -webkit-transform: translateZ(0);\n -ms-transform: translateZ(0);\n transform: translateZ(0);\n -webkit-animation: style-module_load8__2z7nj 1.1s infinite linear;\n animation: style-module_load8__2z7nj 1.1s infinite linear; }\n\n@-webkit-keyframes style-module_load8__2z7nj {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg); }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg); } }\n\n@keyframes style-module_load8__2z7nj {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg); }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg); } }\n";
@@ -26860,16 +26977,25 @@ var BillingAddress = mobxReactLite.observer(function (_a) {
26860
26977
  React.createElement(ExpandableList, { options: expandableListOptionsBilling.get(), selectedIndex: selectedBillingRowIndex, onRowSelect: onSelectedBillingRowIndexChange })));
26861
26978
  });
26862
26979
 
26863
- var css_248z$e = ".style-module_StepPayment__3STxe {\n margin-top: 1em; }\n";
26864
- var styles$d = {"StepPayment":"style-module_StepPayment__3STxe"};
26980
+ var css_248z$e = ".style-module_StepPayment__3STxe {\n margin-top: 1em; }\n .style-module_StepPayment__3STxe .style-module_TermsLabelSpan__35xVC {\n text-decoration: underline; }\n";
26981
+ var styles$d = {"StepPayment":"style-module_StepPayment__3STxe","TermsLabelSpan":"style-module_TermsLabelSpan__35xVC"};
26865
26982
  styleInject(css_248z$e);
26866
26983
 
26867
26984
  var CheckoutStepPayment = mobxReactLite.observer(function (_a) {
26868
26985
  var vm = _a.vm;
26986
+ var onShowTermsClick = function (e) {
26987
+ e.stopPropagation();
26988
+ vm.policyModalText = vm.termsOfService;
26989
+ };
26869
26990
  return (React.createElement("div", { className: [styles$d.StepPayment, commonStyles.FormContainer].join(" ") },
26870
26991
  React.createElement(InfoBox, { vm: vm, showShipping: true }),
26871
26992
  React.createElement(PaymentGateways, { vm: vm }),
26872
26993
  React.createElement(BillingAddress, { vm: vm }),
26994
+ React.createElement("div", { style: { marginTop: "12px" } },
26995
+ React.createElement(Checkbox, { value: vm.isTermsAndConditionsChecked, label: React.createElement(React.Fragment, null,
26996
+ React.createElement("span", { className: styles$d.TermsLabelSpan, onClick: onShowTermsClick }, "Mesafeli sat\u0131\u015F s\u00F6zle\u015Fmesini"),
26997
+ " ",
26998
+ "okudum ve onayl\u0131yorum"), onChange: vm.onTermsAndConditionsCheckedChange })),
26873
26999
  React.createElement(StepActionButtons, { mainBtnText: "Şimdi öde", mainBtnOnClick: vm.performPayment, backBtnText: "Kargoya Geri Dön", backBtnOnClick: vm.onBackToShippingClick, isLoading: vm.isStepLoading })));
26874
27000
  });
26875
27001
 
@@ -27600,17 +27726,18 @@ function createCategoryBreadcrumbSchema(pageSpecificDataStr) {
27600
27726
 
27601
27727
  var IkasCheckoutPage = mobxReactLite.observer(function (_a) {
27602
27728
  var _b, _c, _d;
27603
- var checkout = _a.checkout, returnPolicy = _a.returnPolicy, privacyPolicy = _a.privacyPolicy, termsOfService = _a.termsOfService, queryParams = _a.queryParams;
27729
+ var checkout = _a.checkout, checkoutSettings = _a.checkoutSettings, returnPolicy = _a.returnPolicy, privacyPolicy = _a.privacyPolicy, termsOfService = _a.termsOfService, queryParams = _a.queryParams;
27604
27730
  var router$1 = router.useRouter();
27605
27731
  var vm = React.useState(function () {
27606
- return new CheckoutViewModel(checkout, queryParams, router$1, returnPolicy, privacyPolicy, termsOfService);
27732
+ return new CheckoutViewModel(checkout, checkoutSettings, queryParams, router$1, returnPolicy, privacyPolicy, termsOfService);
27607
27733
  })[0];
27608
27734
  React.useEffect(function () {
27735
+ if (vm.checkoutSettings.isAccountRequired && !vm.checkout.hasCustomer) {
27736
+ router$1.push("/account/login?redirect=" + encodeURIComponent(vm.checkoutUrl));
27737
+ }
27609
27738
  Analytics.beginCheckout(vm.checkout);
27610
27739
  Analytics.checkoutStep(vm.checkout, vm.step);
27611
27740
  }, []);
27612
- var _e = React.useState(""), policyModalTitle = _e[0], setPolicyModalTitle = _e[1];
27613
- var _f = React.useState(""), policyModalText = _f[0], setPolicyModalText = _f[1];
27614
27741
  var step;
27615
27742
  switch (vm.step) {
27616
27743
  case CheckoutStep.INFO:
@@ -27627,19 +27754,19 @@ var IkasCheckoutPage = mobxReactLite.observer(function (_a) {
27627
27754
  break;
27628
27755
  }
27629
27756
  var onPolicyModalClose = function () {
27630
- setPolicyModalText("");
27757
+ vm.policyModalText = "";
27631
27758
  };
27632
27759
  var onReturnPolicyClick = function () {
27633
- setPolicyModalTitle("Para İade Politikası");
27634
- setPolicyModalText(vm.returnPolicy);
27760
+ vm.policyModalTitle = "Para İade Politikası";
27761
+ vm.policyModalText = vm.returnPolicy;
27635
27762
  };
27636
27763
  var onPrivacyPolicyClick = function () {
27637
- setPolicyModalTitle("Gizlilik Politikası");
27638
- setPolicyModalText(vm.privacyPolicy);
27764
+ vm.policyModalTitle = "Gizlilik Politikası";
27765
+ vm.policyModalText = vm.returnPolicy;
27639
27766
  };
27640
27767
  var onTermsOfServiceClick = function () {
27641
- setPolicyModalTitle("Hizmet Şartları");
27642
- setPolicyModalText(vm.termsOfService);
27768
+ vm.policyModalTitle = "Hizmet Şartları";
27769
+ vm.policyModalText = vm.returnPolicy;
27643
27770
  };
27644
27771
  var onErrorClose = function () {
27645
27772
  vm.error = undefined;
@@ -27696,7 +27823,7 @@ var IkasCheckoutPage = mobxReactLite.observer(function (_a) {
27696
27823
  React.createElement("div", { className: styles$2.Right },
27697
27824
  React.createElement("div", { className: styles$2.RightContent },
27698
27825
  React.createElement(CartSummary, { vm: vm }))),
27699
- !!policyModalText && (React.createElement(PolicyModal, { title: policyModalTitle, modalContent: policyModalText, onClose: onPolicyModalClose })))));
27826
+ !!vm.policyModalText && (React.createElement(PolicyModal, { title: vm.policyModalTitle, modalContent: vm.policyModalText, onClose: onPolicyModalClose })))));
27700
27827
  });
27701
27828
 
27702
27829
  function ErrorComponent(_a) {
@@ -28535,11 +28662,12 @@ var SettingsHelper = /** @class */ (function () {
28535
28662
  SettingsHelper.getPageData = function (context, isServer, pageType) {
28536
28663
  var _a;
28537
28664
  return __awaiter(this, void 0, void 0, function () {
28538
- var locale, settings, storefront, themeLocalization, salesChannel, routing, provider;
28665
+ var isLocal, locale, settings, storefront, themeLocalization, salesChannel, routing, provider;
28539
28666
  return __generator(this, function (_b) {
28540
28667
  switch (_b.label) {
28541
28668
  case 0:
28542
- locale = context.locale;
28669
+ isLocal = process.env.NEXT_PUBLIC_ENV === "local";
28670
+ locale = isLocal ? "en" : context.locale;
28543
28671
  if (!locale) {
28544
28672
  return [2 /*return*/, {
28545
28673
  props: {},
@@ -28565,6 +28693,8 @@ var SettingsHelper = /** @class */ (function () {
28565
28693
  IkasStorefrontConfig.priceListId = routing.priceListId || undefined;
28566
28694
  IkasStorefrontConfig.stockLocationIds = (_a = salesChannel.stockLocations) === null || _a === void 0 ? void 0 : _a.map(function (sl) { return sl.id; });
28567
28695
  IkasStorefrontConfig.routings = storefront.routings;
28696
+ IkasStorefrontConfig.gtmId = storefront.gtmId || undefined;
28697
+ IkasStorefrontConfig.fbpId = storefront.fbpId || undefined;
28568
28698
  provider = new IkasPageDataProvider(themeLocalization.themeJson, context.params, pageType);
28569
28699
  return [4 /*yield*/, provider.getPageData()];
28570
28700
  case 2:
@@ -28821,15 +28951,18 @@ var _slug_ = /*#__PURE__*/Object.freeze({
28821
28951
  });
28822
28952
 
28823
28953
  var CheckoutPage = function (_a) {
28824
- var checkoutStr = _a.checkoutStr, configJson = _a.configJson, others = __rest(_a, ["checkoutStr", "configJson"]);
28954
+ var checkoutStr = _a.checkoutStr, checkoutSettingsStr = _a.checkoutSettingsStr, configJson = _a.configJson, others = __rest(_a, ["checkoutStr", "checkoutSettingsStr", "configJson"]);
28825
28955
  IkasStorefrontConfig.initWithJson(configJson);
28826
28956
  Analytics.disableHTML();
28827
28957
  var checkout = new IkasCheckout(JSON.parse(checkoutStr));
28828
- return React.createElement(IkasCheckoutPage, __assign({ checkout: checkout }, others));
28958
+ var checkoutSettings = checkoutSettingsStr
28959
+ ? new IkasCheckoutSettings(JSON.parse(checkoutSettingsStr))
28960
+ : new IkasCheckoutSettings();
28961
+ return (React.createElement(IkasCheckoutPage, __assign({ checkout: checkout, checkoutSettings: checkoutSettings }, others)));
28829
28962
  };
28830
28963
  var _id_ = mobxReactLite.observer(CheckoutPage);
28831
28964
  var getServerSideProps = function (context) { return __awaiter(void 0, void 0, void 0, function () {
28832
- var id, locale, settings, storefront, themeLocalization, routing, redirect, checkout;
28965
+ var id, locale, settings, storefront, themeLocalization, routing, redirect, checkout, checkoutSettings;
28833
28966
  return __generator(this, function (_a) {
28834
28967
  switch (_a.label) {
28835
28968
  case 0:
@@ -28863,20 +28996,23 @@ var getServerSideProps = function (context) { return __awaiter(void 0, void 0, v
28863
28996
  return [4 /*yield*/, IkasCheckoutAPI.getCheckoutById(id)];
28864
28997
  case 2:
28865
28998
  checkout = _a.sent();
28866
- if (checkout) {
28867
- return [2 /*return*/, {
28868
- props: {
28869
- checkoutStr: JSON.stringify(checkout),
28870
- returnPolicy: themeLocalization.returnPolicy || "",
28871
- privacyPolicy: themeLocalization.privacyPolicy || "",
28872
- termsOfService: themeLocalization.termsOfService || "",
28873
- queryParams: context.query,
28874
- },
28875
- }];
28876
- }
28877
- else {
28878
- return [2 /*return*/, redirect()];
28879
- }
28999
+ if (!checkout) return [3 /*break*/, 4];
29000
+ return [4 /*yield*/, IkasCheckoutAPI.listCheckoutSettings()];
29001
+ case 3:
29002
+ checkoutSettings = _a.sent();
29003
+ return [2 /*return*/, {
29004
+ props: {
29005
+ checkoutStr: JSON.stringify(checkout),
29006
+ checkoutSettingsStr: (checkoutSettings === null || checkoutSettings === void 0 ? void 0 : checkoutSettings.length) ? JSON.stringify(checkoutSettings[0])
29007
+ : null,
29008
+ configJson: IkasStorefrontConfig.getJson(),
29009
+ returnPolicy: themeLocalization.returnPolicy || "",
29010
+ privacyPolicy: themeLocalization.privacyPolicy || "",
29011
+ termsOfService: themeLocalization.termsOfService || "",
29012
+ queryParams: context.query,
29013
+ },
29014
+ }];
29015
+ case 4: return [2 /*return*/, redirect()];
28880
29016
  }
28881
29017
  });
28882
29018
  }); };
@@ -0,0 +1,17 @@
1
+ export declare class IkasCheckoutSettings {
2
+ id: string;
3
+ createdAt: number;
4
+ updatedAt: number;
5
+ phoneRequirement: IkasCheckoutRequirementEnum | null;
6
+ identityNumberRequirement: IkasCheckoutRequirementEnum | null;
7
+ isAccountRequired: boolean;
8
+ isTermsAndConditionsDefaultChecked: boolean;
9
+ showTermsAndConditionsCheckbox: boolean;
10
+ storefrontId: string;
11
+ constructor(data?: Partial<IkasCheckoutSettings>);
12
+ }
13
+ export declare enum IkasCheckoutRequirementEnum {
14
+ INVISIBLE = "INVISIBLE",
15
+ MANDATORY = "MANDATORY",
16
+ OPTIONAL = "OPTIONAL"
17
+ }
@@ -1,3 +1,4 @@
1
+ import { IkasCheckoutSettings } from "../../checkout-settings/index";
1
2
  export declare class IkasOrderAddress {
2
3
  addressLine1?: string | null;
3
4
  addressLine2?: string | null;
@@ -14,10 +15,12 @@ export declare class IkasOrderAddress {
14
15
  identityNumber?: string | null;
15
16
  taxNumber?: string | null;
16
17
  taxOffice?: string | null;
18
+ checkoutSettings?: IkasCheckoutSettings;
17
19
  constructor(data?: Partial<IkasOrderAddress>);
18
20
  get addressText(): string;
19
21
  get validationResult(): IkasAddressValidationResult;
20
22
  get isValid(): boolean;
23
+ toJSON(): this;
21
24
  }
22
25
  declare type IkasOrderAddressLocation = {
23
26
  id?: string;
@@ -37,5 +40,6 @@ export declare type IkasAddressValidationResult = {
37
40
  state: boolean;
38
41
  city: boolean;
39
42
  phone: boolean;
43
+ identityNumber: boolean;
40
44
  };
41
45
  export {};