@ikas/storefront 0.1.12 → 0.1.14

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 (35) hide show
  1. package/build/__generated__/global-types.d.ts +1 -0
  2. package/build/api/cart/__generated__/getCart.d.ts +2 -2
  3. package/build/api/cart/__generated__/saveItemToCart.d.ts +2 -2
  4. package/build/api/checkout/__generated__/getCheckoutById.d.ts +10 -2
  5. package/build/api/checkout/__generated__/getOrder.d.ts +2 -2
  6. package/build/api/customer/__generated__/createOrderRefundRequest.d.ts +2 -2
  7. package/build/api/customer/__generated__/getCustomerOrders.d.ts +2 -2
  8. package/build/components/checkout/components/cart-summary/cart-item/index.d.ts +2 -0
  9. package/build/components/checkout/components/{cart-summary → svg}/arrow-down.d.ts +0 -0
  10. package/build/components/checkout/components/{arrow-left.d.ts → svg/arrow-left.d.ts} +0 -0
  11. package/build/components/checkout/components/{cart-summary → svg}/arrow-right.d.ts +0 -0
  12. package/build/components/checkout/components/{cart-summary → svg}/cross.d.ts +0 -0
  13. package/build/components/checkout/components/{cross.d.ts → svg/discount.d.ts} +2 -2
  14. package/build/components/checkout/components/{external.d.ts → svg/external.d.ts} +0 -0
  15. package/build/components/checkout/components/{cart-summary → svg}/gift.d.ts +0 -0
  16. package/build/components/checkout/components/{ikas.d.ts → svg/ikas.d.ts} +0 -0
  17. package/build/components/checkout/components/{lock.d.ts → svg/lock.d.ts} +0 -0
  18. package/build/components/checkout/components/{cart-summary → svg}/shopping-cart.d.ts +0 -0
  19. package/build/components/checkout/components/{success-circle.d.ts → svg/success-circle.d.ts} +0 -0
  20. package/build/components/checkout/components/{cart-summary → svg}/tag.d.ts +0 -0
  21. package/build/components/checkout/components/{warning.d.ts → svg/warning.d.ts} +0 -0
  22. package/build/components/checkout/model.d.ts +0 -1
  23. package/build/index.css +22 -0
  24. package/build/index.es.css +22 -0
  25. package/build/index.es.js +214 -2291
  26. package/build/index.js +214 -2299
  27. package/build/models/data/checkout/index.d.ts +4 -2
  28. package/build/models/data/order/index.d.ts +6 -0
  29. package/build/pages/index.d.ts +1 -11
  30. package/package.json +3 -9
  31. package/build/pages/api/getComponentDirs.d.ts +0 -3
  32. package/build/pages/api/getTheme.d.ts +0 -3
  33. package/build/pages/api/middleware.d.ts +0 -3
  34. package/build/pages/api/updateTheme.d.ts +0 -9
  35. package/build/pages/api/uploadTheme.d.ts +0 -3
package/build/index.es.js CHANGED
@@ -11,14 +11,6 @@ import NextImage from 'next/image';
11
11
  import Link from 'next/link';
12
12
  import dynamic from 'next/dynamic';
13
13
  import Error$1 from 'next/error';
14
- import Cors from 'cors';
15
- import archiver from 'archiver';
16
- import Stream from 'stream';
17
- import http from 'http';
18
- import Url from 'url';
19
- import https from 'https';
20
- import zlib from 'zlib';
21
- import axios from 'axios';
22
14
 
23
15
  /*! *****************************************************************************
24
16
  Copyright (c) Microsoft Corporation.
@@ -19962,7 +19954,9 @@ var IkasCheckout = /** @class */ (function () {
19962
19954
  this.shippingSettingsId = data.shippingSettingsId;
19963
19955
  this.shippingZoneRateId = data.shippingZoneRateId;
19964
19956
  this.availableShippingMethods = data.availableShippingMethods || [];
19965
- this.customer = data.customer;
19957
+ this.customer = data.customer
19958
+ ? new IkasCheckoutCustomer(data.customer)
19959
+ : null;
19966
19960
  this.billingAddress = data.billingAddress
19967
19961
  ? new IkasOrderAddress(data.billingAddress)
19968
19962
  : null;
@@ -19995,19 +19989,6 @@ var IkasCheckout = /** @class */ (function () {
19995
19989
  get: function () {
19996
19990
  var _a;
19997
19991
  return ((_a = this.cart) === null || _a === void 0 ? void 0 : _a.totalTax) || 0;
19998
- // const cartTotalTax =
19999
- // this.cart?.items.reduce((total, current) => total + current.tax, 0) || 0;
20000
- // const shippingTotalTax =
20001
- // this.shippingLines?.reduce(
20002
- // (total, current) => total + (current.taxValue || 0),
20003
- // 0
20004
- // ) || 0;
20005
- // const giftTotalTax =
20006
- // this.giftPackageLines?.reduce(
20007
- // (total, current) => total + (current.taxValue || 0),
20008
- // 0
20009
- // ) || 0;
20010
- // return cartTotalTax;
20011
19992
  },
20012
19993
  enumerable: false,
20013
19994
  configurable: true
@@ -20057,7 +20038,6 @@ var IkasCheckout = /** @class */ (function () {
20057
20038
  var newDate = new Date();
20058
20039
  newDate.setTime(parseFloat(this.updatedAt));
20059
20040
  return formatDate(newDate);
20060
- // return newDate.toLocaleString("en-GB");
20061
20041
  },
20062
20042
  enumerable: false,
20063
20043
  configurable: true
@@ -20096,6 +20076,17 @@ var IkasCheckout = /** @class */ (function () {
20096
20076
  });
20097
20077
  return IkasCheckout;
20098
20078
  }());
20079
+ var IkasCheckoutCustomer = /** @class */ (function () {
20080
+ function IkasCheckoutCustomer(data) {
20081
+ this.id = data.id || "";
20082
+ this.email = data.email || "";
20083
+ this.firstName = data.firstName || "";
20084
+ this.lastName = data.lastName || "";
20085
+ this.notificationsAccepted = data.notificationsAccepted || false;
20086
+ makeAutoObservable(this);
20087
+ }
20088
+ return IkasCheckoutCustomer;
20089
+ }());
20099
20090
  var IkasShippingMethod;
20100
20091
  (function (IkasShippingMethod) {
20101
20092
  IkasShippingMethod["CLICK_AND_COLLECT"] = "CLICK_AND_COLLECT";
@@ -23480,7 +23471,6 @@ var CheckoutViewModel = /** @class */ (function () {
23480
23471
  this.policyModalTitle = "";
23481
23472
  this.policyModalText = "";
23482
23473
  this.error = null;
23483
- this.customerConsentGranted = false;
23484
23474
  this.init = function () { return __awaiter(_this, void 0, void 0, function () {
23485
23475
  return __generator(this, function (_a) {
23486
23476
  switch (_a.label) {
@@ -23796,10 +23786,10 @@ var CheckoutViewModel = /** @class */ (function () {
23796
23786
  this.createCustomer = function () {
23797
23787
  if (_this.store.customerStore.customer) {
23798
23788
  _this.store.customerStore.customer.addresses.forEach(function (address) { return (address.checkoutSettings = _this.checkoutSettings); });
23799
- _this.checkout.customer = _this.store.customerStore.customer;
23789
+ _this.checkout.customer = new IkasCheckoutCustomer(_this.store.customerStore.customer);
23800
23790
  }
23801
23791
  else if (!_this.checkout.customer)
23802
- _this.checkout.customer = new IkasCustomer({});
23792
+ _this.checkout.customer = new IkasCheckoutCustomer({});
23803
23793
  };
23804
23794
  this.createShippingAddress = function () {
23805
23795
  var _a;
@@ -23920,7 +23910,9 @@ var CheckoutViewModel = /** @class */ (function () {
23920
23910
  var originalValue = value.split(" ").join("");
23921
23911
  if (originalValue.length > MAX_CARD_NUMBER_LENGTH)
23922
23912
  return;
23923
- if (oldOriginalValue.length < 6 && originalValue.length >= 6) {
23913
+ if (oldOriginalValue.length < 6 &&
23914
+ originalValue.length >= 6 &&
23915
+ !_this.installmentInfo) {
23924
23916
  _this.retrieveInstallmentInfo({
23925
23917
  binNumber: originalValue.slice(0, 6),
23926
23918
  paymentGatewayId: _this.checkout.selectedPaymentGateway.id,
@@ -24204,16 +24196,16 @@ var CheckoutViewModel = /** @class */ (function () {
24204
24196
  });
24205
24197
  }); };
24206
24198
  this.onCheckoutTransactionSuccess = function () { return __awaiter(_this, void 0, void 0, function () {
24207
- var _a;
24208
- return __generator(this, function (_b) {
24209
- switch (_b.label) {
24199
+ var _a, _b;
24200
+ return __generator(this, function (_c) {
24201
+ switch (_c.label) {
24210
24202
  case 0:
24211
24203
  localStorage.removeItem(USE_DIFFERENT_ADDRESS_KEY);
24212
- if (!(!this.checkout.hasCustomer && ((_a = this.checkout.customer) === null || _a === void 0 ? void 0 : _a.email))) return [3 /*break*/, 2];
24213
- return [4 /*yield*/, this.store.customerStore.createEmailSubscription(this.checkout.customer.email)];
24204
+ if (!((_a = this.checkout.customer) === null || _a === void 0 ? void 0 : _a.notificationsAccepted)) return [3 /*break*/, 2];
24205
+ return [4 /*yield*/, this.store.customerStore.createEmailSubscription(((_b = this.checkout.customer) === null || _b === void 0 ? void 0 : _b.email) || "")];
24214
24206
  case 1:
24215
- _b.sent();
24216
- _b.label = 2;
24207
+ _c.sent();
24208
+ _c.label = 2;
24217
24209
  case 2:
24218
24210
  this.changeStep(CheckoutStep.SUCCESS);
24219
24211
  return [2 /*return*/];
@@ -24227,7 +24219,8 @@ var CheckoutViewModel = /** @class */ (function () {
24227
24219
  _this.changeStep(CheckoutStep.SHIPPING);
24228
24220
  };
24229
24221
  this.setCustomerConsentGranted = function (value) {
24230
- _this.customerConsentGranted = value;
24222
+ if (_this.checkout.customer)
24223
+ _this.checkout.customer.notificationsAccepted = value;
24231
24224
  };
24232
24225
  this.setUseDifferentAddress = function (value) {
24233
24226
  _this.useDifferentAddress = value;
@@ -33720,9 +33713,6 @@ var IkasCustomerStore = /** @class */ (function () {
33720
33713
  orders = _a.sent();
33721
33714
  if (!Array.isArray(orders) || !orders.length)
33722
33715
  return [2 /*return*/, null];
33723
- return [4 /*yield*/, this.getOrderRefundSettings()];
33724
- case 2:
33725
- _a.sent();
33726
33716
  order = orders[0];
33727
33717
  //@ts-ignore
33728
33718
  order._refundSettings = this._refundSettings;
@@ -33934,6 +33924,9 @@ var IkasCustomerStore = /** @class */ (function () {
33934
33924
  _a.sent();
33935
33925
  return [4 /*yield*/, this.getCustomer()];
33936
33926
  case 2:
33927
+ _a.sent();
33928
+ return [4 /*yield*/, this.getOrderRefundSettings()];
33929
+ case 3:
33937
33930
  _a.sent();
33938
33931
  this._initialized = true;
33939
33932
  if (this.customer)
@@ -34227,7 +34220,8 @@ var IkasOrder = /** @class */ (function () {
34227
34220
  Object.defineProperty(IkasOrder.prototype, "refundableItems", {
34228
34221
  get: function () {
34229
34222
  var _this = this;
34230
- if (this._refundSettings && !this._refundSettings.isActiveRefundSection)
34223
+ if (!this._refundSettings ||
34224
+ (this._refundSettings && !this._refundSettings.isActiveRefundSection))
34231
34225
  return [];
34232
34226
  return this.orderLineItems.filter(function (item) {
34233
34227
  var _a;
@@ -41323,7 +41317,7 @@ var IkasCheckoutAPI = /** @class */ (function () {
41323
41317
  return __generator(this, function (_b) {
41324
41318
  switch (_b.label) {
41325
41319
  case 0:
41326
- QUERY = src(templateObject_2$3 || (templateObject_2$3 = __makeTemplateObject(["\n query getCheckoutById($id: String!) {\n getCheckoutById(id: $id) {\n totalFinalPrice\n note\n availableShippingMethods {\n price\n rateName\n shippingMethod\n shippingSettingsId\n shippingZoneRateId\n }\n billingAddress {\n id\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 code\n id\n name\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n code\n id\n name\n }\n taxNumber\n taxOffice\n }\n cartId\n couponCode\n createdAt\n customer {\n email\n firstName\n id\n lastName\n }\n deleted\n id\n merchantId\n orderId\n orderNumber\n recoverEmailStatus\n recoveryStatus\n shippingAddress {\n id\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n id\n code\n name\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n shippingLines {\n title\n taxValue\n price\n shippingSettingsId\n shippingZoneRateId\n }\n shippingMethod\n shippingSettingsId\n shippingZoneRateId\n status\n updatedAt\n cart {\n createdAt\n currencyCode\n customerId\n dueDate\n id\n itemCount\n taxLines {\n price\n rate\n }\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 barcodeList\n id\n mainImageId\n name\n productId\n sku\n slug\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 adjustments {\n amount\n amountType\n name\n order\n type\n couponId\n }\n giftPackageLines {\n price\n taxValue\n }\n isGiftPackage\n giftPackageNote\n }\n }\n "], ["\n query getCheckoutById($id: String!) {\n getCheckoutById(id: $id) {\n totalFinalPrice\n note\n availableShippingMethods {\n price\n rateName\n shippingMethod\n shippingSettingsId\n shippingZoneRateId\n }\n billingAddress {\n id\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 code\n id\n name\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n code\n id\n name\n }\n taxNumber\n taxOffice\n }\n cartId\n couponCode\n createdAt\n customer {\n email\n firstName\n id\n lastName\n }\n deleted\n id\n merchantId\n orderId\n orderNumber\n recoverEmailStatus\n recoveryStatus\n shippingAddress {\n id\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n id\n code\n name\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n shippingLines {\n title\n taxValue\n price\n shippingSettingsId\n shippingZoneRateId\n }\n shippingMethod\n shippingSettingsId\n shippingZoneRateId\n status\n updatedAt\n cart {\n createdAt\n currencyCode\n customerId\n dueDate\n id\n itemCount\n taxLines {\n price\n rate\n }\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 barcodeList\n id\n mainImageId\n name\n productId\n sku\n slug\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 adjustments {\n amount\n amountType\n name\n order\n type\n couponId\n }\n giftPackageLines {\n price\n taxValue\n }\n isGiftPackage\n giftPackageNote\n }\n }\n "])));
41320
+ QUERY = src(templateObject_2$3 || (templateObject_2$3 = __makeTemplateObject(["\n query getCheckoutById($id: String!) {\n getCheckoutById(id: $id) {\n totalFinalPrice\n note\n availableShippingMethods {\n price\n rateName\n shippingMethod\n shippingSettingsId\n shippingZoneRateId\n }\n billingAddress {\n id\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 code\n id\n name\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n code\n id\n name\n }\n taxNumber\n taxOffice\n }\n cartId\n couponCode\n createdAt\n customer {\n email\n firstName\n id\n lastName\n notificationsAccepted\n }\n deleted\n id\n merchantId\n orderId\n orderNumber\n recoverEmailStatus\n recoveryStatus\n shippingAddress {\n id\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n id\n code\n name\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n shippingLines {\n title\n taxValue\n price\n shippingSettingsId\n shippingZoneRateId\n }\n shippingMethod\n shippingSettingsId\n shippingZoneRateId\n status\n updatedAt\n cart {\n createdAt\n currencyCode\n customerId\n dueDate\n id\n itemCount\n taxLines {\n price\n rate\n }\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 barcodeList\n id\n mainImageId\n name\n productId\n sku\n slug\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 adjustments {\n amount\n amountType\n name\n order\n type\n couponId\n appliedOrderLines {\n amount\n appliedQuantity\n orderLineId\n }\n }\n giftPackageLines {\n price\n taxValue\n }\n isGiftPackage\n giftPackageNote\n }\n }\n "], ["\n query getCheckoutById($id: String!) {\n getCheckoutById(id: $id) {\n totalFinalPrice\n note\n availableShippingMethods {\n price\n rateName\n shippingMethod\n shippingSettingsId\n shippingZoneRateId\n }\n billingAddress {\n id\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 code\n id\n name\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n code\n id\n name\n }\n taxNumber\n taxOffice\n }\n cartId\n couponCode\n createdAt\n customer {\n email\n firstName\n id\n lastName\n notificationsAccepted\n }\n deleted\n id\n merchantId\n orderId\n orderNumber\n recoverEmailStatus\n recoveryStatus\n shippingAddress {\n id\n addressLine1\n addressLine2\n city {\n code\n id\n name\n }\n company\n country {\n id\n code\n name\n }\n district {\n name\n id\n code\n }\n firstName\n identityNumber\n isDefault\n lastName\n phone\n postalCode\n state {\n name\n id\n code\n }\n taxNumber\n taxOffice\n }\n shippingLines {\n title\n taxValue\n price\n shippingSettingsId\n shippingZoneRateId\n }\n shippingMethod\n shippingSettingsId\n shippingZoneRateId\n status\n updatedAt\n cart {\n createdAt\n currencyCode\n customerId\n dueDate\n id\n itemCount\n taxLines {\n price\n rate\n }\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 barcodeList\n id\n mainImageId\n name\n productId\n sku\n slug\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 adjustments {\n amount\n amountType\n name\n order\n type\n couponId\n appliedOrderLines {\n amount\n appliedQuantity\n orderLineId\n }\n }\n giftPackageLines {\n price\n taxValue\n }\n isGiftPackage\n giftPackageNote\n }\n }\n "])));
41327
41321
  _b.label = 1;
41328
41322
  case 1:
41329
41323
  _b.trys.push([1, 3, , 4]);
@@ -41453,6 +41447,7 @@ var IkasCheckoutAPI = /** @class */ (function () {
41453
41447
  email: (_b = checkout.customer) === null || _b === void 0 ? void 0 : _b.email,
41454
41448
  firstName: (_c = checkout.customer) === null || _c === void 0 ? void 0 : _c.firstName,
41455
41449
  lastName: (_d = checkout.customer) === null || _d === void 0 ? void 0 : _d.lastName,
41450
+ notificationsAccepted: checkout.customer.notificationsAccepted || false,
41456
41451
  }
41457
41452
  : null,
41458
41453
  note: checkout.note,
@@ -68827,6 +68822,8 @@ var AddressFormViewModel = /** @class */ (function () {
68827
68822
  _a.districts = _d.sent();
68828
68823
  if (this.districts.length)
68829
68824
  this.address.isDistrictRequired = true;
68825
+ else
68826
+ this.address.isDistrictRequired = false;
68830
68827
  return [3 /*break*/, 4];
68831
68828
  case 3:
68832
68829
  _d.sent();
@@ -69410,7 +69407,7 @@ var SaveAddressCheckboxAndTitle = observer(function (_a) {
69410
69407
  });
69411
69408
 
69412
69409
  var CheckoutStepInfo = function (_a) {
69413
- var _b, _c;
69410
+ var _b, _c, _d;
69414
69411
  var vm = _a.vm;
69415
69412
  var t = useTranslation().t;
69416
69413
  var onEmailChange = useCallback(function (value) {
@@ -69425,7 +69422,7 @@ var CheckoutStepInfo = function (_a) {
69425
69422
  createElement("div", { className: commonStyles.FormSectionTitle },
69426
69423
  createElement("div", { className: commonStyles.Title }, t("checkout-page:contactInfo"))),
69427
69424
  createElement(FormItem, { type: FormItemType.TEXT, inputType: FormItemInputType.EMAIL, label: t("checkout-page:email"), autocomplete: "email", value: ((_b = vm.checkout.customer) === null || _b === void 0 ? void 0 : _b.email) || "", onChange: onEmailChange, hasError: vm.isErrorsVisible && !((_c = vm.checkout.customer) === null || _c === void 0 ? void 0 : _c.email), errorText: t("checkout-page:emailError"), tooltipText: t("checkout-page:guestEmailTooltip") }),
69428
- createElement(Checkbox, { value: vm.customerConsentGranted, label: t("checkout-page:customerConsentCta"), onChange: vm.setCustomerConsentGranted }))),
69425
+ createElement(Checkbox, { value: ((_d = vm.checkout.customer) === null || _d === void 0 ? void 0 : _d.notificationsAccepted) || false, label: t("checkout-page:customerConsentCta"), onChange: vm.setCustomerConsentGranted }))),
69429
69426
  createElement(CustomerAddresses$1, { vm: customerAddressesViewModel }),
69430
69427
  !customerAddressesViewModel.editingCustomerAddress && (createElement(Button, { style: {
69431
69428
  width: "100%",
@@ -69717,15 +69714,28 @@ var InputWithButton = function (_a) {
69717
69714
  };
69718
69715
  var InputWithButton$1 = observer(InputWithButton);
69719
69716
 
69720
- var styles$e = {"CheckoutItem":"style-module_CheckoutItem__2JjSt","ImageContainer":"style-module_ImageContainer__2K2RG","Image":"style-module_Image__w2Q_P","Right":"style-module_Right__2HN2l","Name":"style-module_Name__nPgw1","LightText":"style-module_LightText__2P69D","Price":"style-module_Price__1Vw31","GrayPrice":"style-module_GrayPrice__2wDyJ"};
69717
+ var styles$e = {"CheckoutItem":"style-module_CheckoutItem__2JjSt","ImageContainer":"style-module_ImageContainer__2K2RG","Image":"style-module_Image__w2Q_P","Right":"style-module_Right__2HN2l","Name":"style-module_Name__nPgw1","LightText":"style-module_LightText__2P69D","Price":"style-module_Price__1Vw31","GrayPrice":"style-module_GrayPrice__2wDyJ","DiscountIcon":"style-module_DiscountIcon__39hOP","DiscountTooltip":"style-module_DiscountTooltip__2hO7z","DiscountAdjustment":"style-module_DiscountAdjustment__3QUlC"};
69718
+
69719
+ var SVGDiscount = function (_a) {
69720
+ var className = _a.className;
69721
+ return (createElement("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: className },
69722
+ createElement("circle", { cx: "8", cy: "8", r: "8", fill: "#CFCED3" }),
69723
+ createElement("path", { d: "M10.9167 5.08301L5.08334 10.9163", stroke: "white", "stroke-linecap": "square", "stroke-linejoin": "round" }),
69724
+ createElement("path", { d: "M5.70832 6.75033C6.28362 6.75033 6.74999 6.28396 6.74999 5.70866C6.74999 5.13336 6.28362 4.66699 5.70832 4.66699C5.13303 4.66699 4.66666 5.13336 4.66666 5.70866C4.66666 6.28396 5.13303 6.75033 5.70832 6.75033Z", fill: "white" }),
69725
+ createElement("path", { d: "M10.2917 11.3333C10.867 11.3333 11.3333 10.867 11.3333 10.2917C11.3333 9.71637 10.867 9.25 10.2917 9.25C9.71637 9.25 9.25 9.71637 9.25 10.2917C9.25 10.867 9.71637 11.3333 10.2917 11.3333Z", fill: "white" })));
69726
+ };
69721
69727
 
69722
69728
  var CartItem = observer(function (_a) {
69723
- var _b;
69724
- var currencyCode = _a.currencyCode, cartItem = _a.cartItem;
69729
+ var _b, _c;
69730
+ var vm = _a.vm, currencyCode = _a.currencyCode, cartItem = _a.cartItem;
69725
69731
  var t = useTranslation().t;
69732
+ var adjustments = (_b = vm.checkout.adjustments) === null || _b === void 0 ? void 0 : _b.filter(function (a) {
69733
+ return a.appliedOrderLines &&
69734
+ a.appliedOrderLines.some(function (aol) { return aol.orderLineId === cartItem.id; });
69735
+ });
69726
69736
  return (createElement("div", { className: styles$e.CheckoutItem },
69727
69737
  createElement("div", { className: styles$e.ImageContainer },
69728
- createElement("img", { className: styles$e.Image, src: (_b = cartItem.variant.mainImage) === null || _b === void 0 ? void 0 : _b.thumbnailSrc })),
69738
+ createElement("img", { className: styles$e.Image, src: (_c = cartItem.variant.mainImage) === null || _c === void 0 ? void 0 : _c.thumbnailSrc })),
69729
69739
  createElement("div", { className: styles$e.Right },
69730
69740
  createElement("div", { className: styles$e.Name }, cartItem.variant.name),
69731
69741
  createElement("div", { className: styles$e.LightText }, t("checkout-page:quantity") + ": " + cartItem.quantity),
@@ -69734,7 +69744,10 @@ var CartItem = observer(function (_a) {
69734
69744
  .join(" / ")),
69735
69745
  createElement("div", { className: styles$e.Price },
69736
69746
  !!cartItem.overridenPriceWithQuantity && (createElement("span", { className: styles$e.GrayPrice }, formatMoney(cartItem.overridenPriceWithQuantity, currencyCode))),
69737
- formatMoney(cartItem.finalPriceWithQuantity, currencyCode)))));
69747
+ formatMoney(cartItem.finalPriceWithQuantity, currencyCode),
69748
+ !!(adjustments === null || adjustments === void 0 ? void 0 : adjustments.length) && (createElement("div", { className: styles$e.DiscountIcon, tabIndex: Date.now() },
69749
+ createElement(SVGDiscount, null),
69750
+ createElement("div", { className: styles$e.DiscountTooltip }, adjustments === null || adjustments === void 0 ? void 0 : adjustments.map(function (adjustment, index) { return (createElement("div", { key: index }, adjustment.name + " (-" + formatMoney(adjustment.amount, currencyCode) + ")")); }))))))));
69738
69751
  });
69739
69752
 
69740
69753
  var styles$f = {"TooltipContainer":"style-module_TooltipContainer__1IW8v","Tooltip":"style-module_Tooltip__1Pxw6","TooltipArrow":"style-module_TooltipArrow__1l6q_","Top":"style-module_Top__1_7C6","Bottom":"style-module_Bottom__2qCpQ","Left":"style-module_Left__1T6gj","Right":"style-module_Right__uCMMF"};
@@ -69834,7 +69847,7 @@ var CartSummary = observer(function (_a) {
69834
69847
  createElement("div", { className: styles$g.DetailsContainer, style: detailsContainerStyle },
69835
69848
  createElement("div", { className: styles$g.Details, ref: setDetailsContainer }, cart === null || cart === void 0 ? void 0 :
69836
69849
  cart.items.map(function (item, index) { return (createElement("div", { key: index },
69837
- createElement(CartItem, { cartItem: item, currencyCode: cart.currencyCode }))); }),
69850
+ createElement(CartItem, { vm: vm, cartItem: item, currencyCode: cart.currencyCode }))); }),
69838
69851
  createElement("div", { className: styles$g.Divider }),
69839
69852
  createElement("div", { className: styles$g.SubTotalInfo },
69840
69853
  hasCouponError && (createElement("div", { className: styles$g.NotificationContainer },
@@ -70023,13 +70036,6 @@ var ExpandableSection = function (_a) {
70023
70036
  };
70024
70037
  var ExpandableSection$1 = observer(ExpandableSection);
70025
70038
 
70026
- var SVGCross$1 = function (_a) {
70027
- var className = _a.className;
70028
- return (createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", width: "24", height: "24", className: className },
70029
- createElement("path", { fill: "none", d: "M0 0h24v24H0z" }),
70030
- createElement("path", { fill: "currentColor", d: "M12 10.586l4.95-4.95 1.414 1.414-4.95 4.95 4.95 4.95-1.414 1.414-4.95-4.95-4.95 4.95-1.414-1.414 4.95-4.95-4.95-4.95L7.05 5.636z" })));
70031
- };
70032
-
70033
70039
  var styles$j = {"ModalContainer":"style-module_ModalContainer__3JCG6","Modal":"style-module_Modal__s3oha","ModalHeader":"style-module_ModalHeader__vEeDs","CloseButton":"style-module_CloseButton__3VdYY","ModalContent":"style-module_ModalContent__2jGi3"};
70034
70040
 
70035
70041
  var Modal = observer(function (_a) {
@@ -70050,7 +70056,7 @@ var Modal = observer(function (_a) {
70050
70056
  createElement("div", { className: styles$j.ModalHeader },
70051
70057
  createElement("div", null, title),
70052
70058
  createElement("div", { className: styles$j.CloseButton, onClick: onClose },
70053
- createElement(SVGCross$1, null))),
70059
+ createElement(SVGCross, null))),
70054
70060
  typeof modalContent === "string" ? (createElement("div", { className: styles$j.ModalContent, dangerouslySetInnerHTML: { __html: modalContent } })) : (createElement("div", { className: styles$j.ModalContent }, modalContent)))));
70055
70061
  });
70056
70062
 
@@ -70392,7 +70398,7 @@ var StockError = observer(function (_a) {
70392
70398
  data.map(function (item, index) {
70393
70399
  var _a;
70394
70400
  return (createElement("div", { key: index },
70395
- createElement(CartItem, { cartItem: item, currencyCode: ((_a = vm.checkout.cart) === null || _a === void 0 ? void 0 : _a.currencyCode) || "" })));
70401
+ createElement(CartItem, { vm: vm, cartItem: item, currencyCode: ((_a = vm.checkout.cart) === null || _a === void 0 ? void 0 : _a.currencyCode) || "" })));
70396
70402
  }),
70397
70403
  createElement("div", { className: styles$l.Actions },
70398
70404
  createElement(Button, { style: {
@@ -71581,1797 +71587,170 @@ var _slug_$3 = /*#__PURE__*/Object.freeze({
71581
71587
  getStaticProps: getStaticProps$h
71582
71588
  });
71583
71589
 
71584
- var cors = Cors();
71585
- function runMiddleware(req, res, fn) {
71586
- return new Promise(function (resolve, reject) {
71587
- fn(req, res, function (result) {
71588
- if (result instanceof Error) {
71589
- return reject(result);
71590
- }
71591
- return resolve(result);
71592
- });
71593
- });
71594
- }
71595
- function corsMiddleware(req, res) {
71596
- return runMiddleware(req, res, cors);
71597
- }
71598
-
71599
- var serverRuntimeConfig = getConfig().serverRuntimeConfig;
71600
- var componentsPath = path$1.join(serverRuntimeConfig.PROJECT_ROOT, "src", "components");
71601
- var getComponentDirs = function (req, res) { return __awaiter(void 0, void 0, void 0, function () {
71602
- var componentDirNames;
71603
- return __generator(this, function (_a) {
71604
- switch (_a.label) {
71605
- case 0: return [4 /*yield*/, corsMiddleware(req, res)];
71606
- case 1:
71607
- _a.sent();
71608
- return [4 /*yield*/, getComponentDirNames()];
71609
- case 2:
71610
- componentDirNames = _a.sent();
71611
- res.statusCode = 200;
71612
- res.setHeader("Content-Type", "application/json");
71613
- res.json({
71614
- componentDirNames: componentDirNames.filter(function (name) { return name !== "__generated__"; }),
71615
- });
71616
- return [2 /*return*/];
71617
- }
71618
- });
71619
- }); };
71620
- var config = {};
71621
- function getComponentDirNames() {
71622
- return new Promise(function (resolve, reject) {
71623
- fs.readdir(componentsPath, function (err, files) {
71624
- if (err) {
71625
- return reject(err);
71626
- }
71627
- resolve(files.filter(function (file) {
71628
- return fs.lstatSync(path$1.join(componentsPath, file)).isDirectory();
71629
- }));
71630
- });
71631
- });
71632
- }
71633
-
71634
- var GetComponentDirs = /*#__PURE__*/Object.freeze({
71635
- __proto__: null,
71636
- getComponentDirs: getComponentDirs,
71637
- config: config
71638
- });
71639
-
71640
- var getTheme = function (req, res) { return __awaiter(void 0, void 0, void 0, function () {
71641
- var theme;
71642
- return __generator(this, function (_a) {
71643
- switch (_a.label) {
71644
- case 0: return [4 /*yield*/, corsMiddleware(req, res)];
71645
- case 1:
71646
- _a.sent();
71647
- return [4 /*yield*/, _getTheme()];
71648
- case 2:
71649
- theme = _a.sent();
71650
- res.statusCode = 200;
71651
- res.setHeader("Content-Type", "application/json");
71652
- res.json({
71653
- theme: theme,
71654
- });
71655
- return [2 /*return*/];
71656
- }
71657
- });
71658
- }); };
71659
- var config$1 = {};
71660
- function _getTheme() {
71661
- return new Promise(function (resolve, reject) {
71662
- var serverRuntimeConfig = getConfig().serverRuntimeConfig;
71663
- var themePath = path$1.join(serverRuntimeConfig.PROJECT_ROOT, "src", "theme.json");
71664
- fs.readFile(themePath, {
71665
- flag: "a+",
71666
- }, function (err, file) {
71667
- if (err) {
71668
- return reject(err);
71669
- }
71670
- var result = file.length ? JSON.parse(file.toString()) : {};
71671
- resolve(result);
71672
- });
71673
- });
71674
- }
71675
-
71676
- var GetTheme = /*#__PURE__*/Object.freeze({
71677
- __proto__: null,
71678
- getTheme: getTheme,
71679
- config: config$1
71680
- });
71681
-
71682
- var serverRuntimeConfig$1 = getConfig().serverRuntimeConfig;
71683
- var updateTheme = function (req, res) { return __awaiter(void 0, void 0, void 0, function () {
71684
- var theme;
71685
- return __generator(this, function (_a) {
71686
- switch (_a.label) {
71687
- case 0: return [4 /*yield*/, corsMiddleware(req, res)];
71688
- case 1:
71689
- _a.sent();
71690
- theme = req.body;
71691
- fs.writeFileSync(path$1.join(serverRuntimeConfig$1.PROJECT_ROOT, "src", "theme.json"), JSON.stringify(theme, null, 2));
71692
- saveCssFile(theme);
71693
- saveComponentsFile(theme);
71694
- res.statusCode = 200;
71695
- res.setHeader("Content-Type", "application/json");
71696
- res.end();
71697
- return [2 /*return*/];
71698
- }
71699
- });
71700
- }); };
71701
- var config$2 = {
71702
- api: {
71703
- bodyParser: {
71704
- sizeLimit: "50mb",
71705
- },
71706
- },
71707
- };
71708
- function saveCssFile(theme) {
71709
- var themeCss = ":root { \r\n";
71710
- theme.settings.colors.map(function (sc) { return (themeCss += sc.key + ": " + sc.color + "; \r\n"); });
71711
- themeCss += " }";
71712
- var generatedFolderPath = path$1.join(serverRuntimeConfig$1.PROJECT_ROOT, "src/styles");
71713
- if (!fs.existsSync(generatedFolderPath)) {
71714
- fs.mkdirSync(generatedFolderPath);
71715
- }
71716
- fs.writeFileSync(path$1.join(generatedFolderPath, "ikas-styles.css"), themeCss);
71717
- }
71718
- function saveComponentsFile(theme) {
71719
- var fileStr = "";
71720
- fileStr += "\r\n";
71721
- var components = theme.components.filter(function (tc) { return tc.id !== "checkout"; });
71722
- // Component imports
71723
- components
71724
- .filter(function (c) { return c.id !== "checkout"; })
71725
- .forEach(function (component, index) {
71726
- fileStr += "import Component" + index + " from \"../" + component.dir + "\" \r\n";
71727
- });
71728
- fileStr += "\r\n";
71729
- fileStr += "\nconst Components = {\n " + components.map(function (component, index) { return "\"" + component.id + "\": Component" + index; }) + "\n};\n ";
71730
- fileStr += "\r\n";
71731
- fileStr += "\r\n";
71732
- fileStr += "export default Components;";
71733
- var generatedFolderPath = path$1.join(serverRuntimeConfig$1.PROJECT_ROOT, "src", "components", "__generated__");
71734
- if (!fs.existsSync(generatedFolderPath)) {
71735
- fs.mkdirSync(generatedFolderPath);
71736
- }
71737
- fs.writeFileSync(path$1.join(generatedFolderPath, "index.js"), fileStr);
71738
- }
71739
-
71740
- var UpdateTheme = /*#__PURE__*/Object.freeze({
71741
- __proto__: null,
71742
- updateTheme: updateTheme,
71743
- config: config$2
71744
- });
71745
-
71746
- // Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js
71747
-
71748
- // fix for "Readable" isn't a named export issue
71749
- const Readable = Stream.Readable;
71750
-
71751
- const BUFFER = Symbol('buffer');
71752
- const TYPE = Symbol('type');
71753
-
71754
- class Blob {
71755
- constructor() {
71756
- this[TYPE] = '';
71757
-
71758
- const blobParts = arguments[0];
71759
- const options = arguments[1];
71760
-
71761
- const buffers = [];
71762
- let size = 0;
71763
-
71764
- if (blobParts) {
71765
- const a = blobParts;
71766
- const length = Number(a.length);
71767
- for (let i = 0; i < length; i++) {
71768
- const element = a[i];
71769
- let buffer;
71770
- if (element instanceof Buffer) {
71771
- buffer = element;
71772
- } else if (ArrayBuffer.isView(element)) {
71773
- buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength);
71774
- } else if (element instanceof ArrayBuffer) {
71775
- buffer = Buffer.from(element);
71776
- } else if (element instanceof Blob) {
71777
- buffer = element[BUFFER];
71778
- } else {
71779
- buffer = Buffer.from(typeof element === 'string' ? element : String(element));
71780
- }
71781
- size += buffer.length;
71782
- buffers.push(buffer);
71783
- }
71784
- }
71785
-
71786
- this[BUFFER] = Buffer.concat(buffers);
71787
-
71788
- let type = options && options.type !== undefined && String(options.type).toLowerCase();
71789
- if (type && !/[^\u0020-\u007E]/.test(type)) {
71790
- this[TYPE] = type;
71791
- }
71792
- }
71793
- get size() {
71794
- return this[BUFFER].length;
71795
- }
71796
- get type() {
71797
- return this[TYPE];
71798
- }
71799
- text() {
71800
- return Promise.resolve(this[BUFFER].toString());
71801
- }
71802
- arrayBuffer() {
71803
- const buf = this[BUFFER];
71804
- const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
71805
- return Promise.resolve(ab);
71806
- }
71807
- stream() {
71808
- const readable = new Readable();
71809
- readable._read = function () {};
71810
- readable.push(this[BUFFER]);
71811
- readable.push(null);
71812
- return readable;
71813
- }
71814
- toString() {
71815
- return '[object Blob]';
71816
- }
71817
- slice() {
71818
- const size = this.size;
71819
-
71820
- const start = arguments[0];
71821
- const end = arguments[1];
71822
- let relativeStart, relativeEnd;
71823
- if (start === undefined) {
71824
- relativeStart = 0;
71825
- } else if (start < 0) {
71826
- relativeStart = Math.max(size + start, 0);
71827
- } else {
71828
- relativeStart = Math.min(start, size);
71829
- }
71830
- if (end === undefined) {
71831
- relativeEnd = size;
71832
- } else if (end < 0) {
71833
- relativeEnd = Math.max(size + end, 0);
71834
- } else {
71835
- relativeEnd = Math.min(end, size);
71836
- }
71837
- const span = Math.max(relativeEnd - relativeStart, 0);
71838
-
71839
- const buffer = this[BUFFER];
71840
- const slicedBuffer = buffer.slice(relativeStart, relativeStart + span);
71841
- const blob = new Blob([], { type: arguments[2] });
71842
- blob[BUFFER] = slicedBuffer;
71843
- return blob;
71844
- }
71845
- }
71846
-
71847
- Object.defineProperties(Blob.prototype, {
71848
- size: { enumerable: true },
71849
- type: { enumerable: true },
71850
- slice: { enumerable: true }
71851
- });
71852
-
71853
- Object.defineProperty(Blob.prototype, Symbol.toStringTag, {
71854
- value: 'Blob',
71855
- writable: false,
71856
- enumerable: false,
71857
- configurable: true
71858
- });
71859
-
71860
- /**
71861
- * fetch-error.js
71862
- *
71863
- * FetchError interface for operational errors
71864
- */
71865
-
71866
- /**
71867
- * Create FetchError instance
71868
- *
71869
- * @param String message Error message for human
71870
- * @param String type Error type for machine
71871
- * @param String systemError For Node.js system error
71872
- * @return FetchError
71873
- */
71874
- function FetchError(message, type, systemError) {
71875
- Error.call(this, message);
71876
-
71877
- this.message = message;
71878
- this.type = type;
71879
-
71880
- // when err.type is `system`, err.code contains system error code
71881
- if (systemError) {
71882
- this.code = this.errno = systemError.code;
71883
- }
71884
-
71885
- // hide custom error implementation details from end-users
71886
- Error.captureStackTrace(this, this.constructor);
71887
- }
71888
-
71889
- FetchError.prototype = Object.create(Error.prototype);
71890
- FetchError.prototype.constructor = FetchError;
71891
- FetchError.prototype.name = 'FetchError';
71892
-
71893
- let convert;
71894
- try {
71895
- convert = require('encoding').convert;
71896
- } catch (e) {}
71897
-
71898
- const INTERNALS = Symbol('Body internals');
71899
-
71900
- // fix an issue where "PassThrough" isn't a named export for node <10
71901
- const PassThrough = Stream.PassThrough;
71902
-
71903
- /**
71904
- * Body mixin
71905
- *
71906
- * Ref: https://fetch.spec.whatwg.org/#body
71907
- *
71908
- * @param Stream body Readable stream
71909
- * @param Object opts Response options
71910
- * @return Void
71911
- */
71912
- function Body(body) {
71913
- var _this = this;
71914
-
71915
- var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
71916
- _ref$size = _ref.size;
71917
-
71918
- let size = _ref$size === undefined ? 0 : _ref$size;
71919
- var _ref$timeout = _ref.timeout;
71920
- let timeout = _ref$timeout === undefined ? 0 : _ref$timeout;
71921
-
71922
- if (body == null) {
71923
- // body is undefined or null
71924
- body = null;
71925
- } else if (isURLSearchParams(body)) {
71926
- // body is a URLSearchParams
71927
- body = Buffer.from(body.toString());
71928
- } else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
71929
- // body is ArrayBuffer
71930
- body = Buffer.from(body);
71931
- } else if (ArrayBuffer.isView(body)) {
71932
- // body is ArrayBufferView
71933
- body = Buffer.from(body.buffer, body.byteOffset, body.byteLength);
71934
- } else if (body instanceof Stream) ; else {
71935
- // none of the above
71936
- // coerce to string then buffer
71937
- body = Buffer.from(String(body));
71938
- }
71939
- this[INTERNALS] = {
71940
- body,
71941
- disturbed: false,
71942
- error: null
71943
- };
71944
- this.size = size;
71945
- this.timeout = timeout;
71946
-
71947
- if (body instanceof Stream) {
71948
- body.on('error', function (err) {
71949
- const error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err);
71950
- _this[INTERNALS].error = error;
71951
- });
71952
- }
71953
- }
71954
-
71955
- Body.prototype = {
71956
- get body() {
71957
- return this[INTERNALS].body;
71958
- },
71959
-
71960
- get bodyUsed() {
71961
- return this[INTERNALS].disturbed;
71962
- },
71963
-
71964
- /**
71965
- * Decode response as ArrayBuffer
71966
- *
71967
- * @return Promise
71968
- */
71969
- arrayBuffer() {
71970
- return consumeBody.call(this).then(function (buf) {
71971
- return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
71972
- });
71973
- },
71974
-
71975
- /**
71976
- * Return raw response as Blob
71977
- *
71978
- * @return Promise
71979
- */
71980
- blob() {
71981
- let ct = this.headers && this.headers.get('content-type') || '';
71982
- return consumeBody.call(this).then(function (buf) {
71983
- return Object.assign(
71984
- // Prevent copying
71985
- new Blob([], {
71986
- type: ct.toLowerCase()
71987
- }), {
71988
- [BUFFER]: buf
71989
- });
71990
- });
71991
- },
71992
-
71993
- /**
71994
- * Decode response as json
71995
- *
71996
- * @return Promise
71997
- */
71998
- json() {
71999
- var _this2 = this;
72000
-
72001
- return consumeBody.call(this).then(function (buffer) {
72002
- try {
72003
- return JSON.parse(buffer.toString());
72004
- } catch (err) {
72005
- return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));
72006
- }
72007
- });
72008
- },
72009
-
72010
- /**
72011
- * Decode response as text
72012
- *
72013
- * @return Promise
72014
- */
72015
- text() {
72016
- return consumeBody.call(this).then(function (buffer) {
72017
- return buffer.toString();
72018
- });
72019
- },
72020
-
72021
- /**
72022
- * Decode response as buffer (non-spec api)
72023
- *
72024
- * @return Promise
72025
- */
72026
- buffer() {
72027
- return consumeBody.call(this);
72028
- },
72029
-
72030
- /**
72031
- * Decode response as text, while automatically detecting the encoding and
72032
- * trying to decode to UTF-8 (non-spec api)
72033
- *
72034
- * @return Promise
72035
- */
72036
- textConverted() {
72037
- var _this3 = this;
72038
-
72039
- return consumeBody.call(this).then(function (buffer) {
72040
- return convertBody(buffer, _this3.headers);
72041
- });
72042
- }
72043
- };
72044
-
72045
- // In browsers, all properties are enumerable.
72046
- Object.defineProperties(Body.prototype, {
72047
- body: { enumerable: true },
72048
- bodyUsed: { enumerable: true },
72049
- arrayBuffer: { enumerable: true },
72050
- blob: { enumerable: true },
72051
- json: { enumerable: true },
72052
- text: { enumerable: true }
72053
- });
72054
-
72055
- Body.mixIn = function (proto) {
72056
- for (const name of Object.getOwnPropertyNames(Body.prototype)) {
72057
- // istanbul ignore else: future proof
72058
- if (!(name in proto)) {
72059
- const desc = Object.getOwnPropertyDescriptor(Body.prototype, name);
72060
- Object.defineProperty(proto, name, desc);
72061
- }
72062
- }
72063
- };
72064
-
72065
- /**
72066
- * Consume and convert an entire Body to a Buffer.
72067
- *
72068
- * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body
72069
- *
72070
- * @return Promise
72071
- */
72072
- function consumeBody() {
72073
- var _this4 = this;
72074
-
72075
- if (this[INTERNALS].disturbed) {
72076
- return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`));
72077
- }
72078
-
72079
- this[INTERNALS].disturbed = true;
72080
-
72081
- if (this[INTERNALS].error) {
72082
- return Body.Promise.reject(this[INTERNALS].error);
72083
- }
72084
-
72085
- let body = this.body;
72086
-
72087
- // body is null
72088
- if (body === null) {
72089
- return Body.Promise.resolve(Buffer.alloc(0));
72090
- }
72091
-
72092
- // body is blob
72093
- if (isBlob(body)) {
72094
- body = body.stream();
72095
- }
72096
-
72097
- // body is buffer
72098
- if (Buffer.isBuffer(body)) {
72099
- return Body.Promise.resolve(body);
72100
- }
72101
-
72102
- // istanbul ignore if: should never happen
72103
- if (!(body instanceof Stream)) {
72104
- return Body.Promise.resolve(Buffer.alloc(0));
72105
- }
72106
-
72107
- // body is stream
72108
- // get ready to actually consume the body
72109
- let accum = [];
72110
- let accumBytes = 0;
72111
- let abort = false;
72112
-
72113
- return new Body.Promise(function (resolve, reject) {
72114
- let resTimeout;
72115
-
72116
- // allow timeout on slow response body
72117
- if (_this4.timeout) {
72118
- resTimeout = setTimeout(function () {
72119
- abort = true;
72120
- reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout'));
72121
- }, _this4.timeout);
72122
- }
72123
-
72124
- // handle stream errors
72125
- body.on('error', function (err) {
72126
- if (err.name === 'AbortError') {
72127
- // if the request was aborted, reject with this Error
72128
- abort = true;
72129
- reject(err);
72130
- } else {
72131
- // other errors, such as incorrect content-encoding
72132
- reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err));
72133
- }
72134
- });
72135
-
72136
- body.on('data', function (chunk) {
72137
- if (abort || chunk === null) {
72138
- return;
72139
- }
72140
-
72141
- if (_this4.size && accumBytes + chunk.length > _this4.size) {
72142
- abort = true;
72143
- reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size'));
72144
- return;
72145
- }
72146
-
72147
- accumBytes += chunk.length;
72148
- accum.push(chunk);
72149
- });
72150
-
72151
- body.on('end', function () {
72152
- if (abort) {
72153
- return;
72154
- }
72155
-
72156
- clearTimeout(resTimeout);
72157
-
72158
- try {
72159
- resolve(Buffer.concat(accum, accumBytes));
72160
- } catch (err) {
72161
- // handle streams that have accumulated too much data (issue #414)
72162
- reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err));
72163
- }
72164
- });
72165
- });
72166
- }
72167
-
72168
- /**
72169
- * Detect buffer encoding and convert to target encoding
72170
- * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding
72171
- *
72172
- * @param Buffer buffer Incoming buffer
72173
- * @param String encoding Target encoding
72174
- * @return String
72175
- */
72176
- function convertBody(buffer, headers) {
72177
- if (typeof convert !== 'function') {
72178
- throw new Error('The package `encoding` must be installed to use the textConverted() function');
72179
- }
72180
-
72181
- const ct = headers.get('content-type');
72182
- let charset = 'utf-8';
72183
- let res, str;
72184
-
72185
- // header
72186
- if (ct) {
72187
- res = /charset=([^;]*)/i.exec(ct);
72188
- }
72189
-
72190
- // no charset in content type, peek at response body for at most 1024 bytes
72191
- str = buffer.slice(0, 1024).toString();
72192
-
72193
- // html5
72194
- if (!res && str) {
72195
- res = /<meta.+?charset=(['"])(.+?)\1/i.exec(str);
72196
- }
72197
-
72198
- // html4
72199
- if (!res && str) {
72200
- res = /<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(str);
72201
- if (!res) {
72202
- res = /<meta[\s]+?content=(['"])(.+?)\1[\s]+?http-equiv=(['"])content-type\3/i.exec(str);
72203
- if (res) {
72204
- res.pop(); // drop last quote
72205
- }
72206
- }
72207
-
72208
- if (res) {
72209
- res = /charset=(.*)/i.exec(res.pop());
72210
- }
72211
- }
72212
-
72213
- // xml
72214
- if (!res && str) {
72215
- res = /<\?xml.+?encoding=(['"])(.+?)\1/i.exec(str);
72216
- }
72217
-
72218
- // found charset
72219
- if (res) {
72220
- charset = res.pop();
72221
-
72222
- // prevent decode issues when sites use incorrect encoding
72223
- // ref: https://hsivonen.fi/encoding-menu/
72224
- if (charset === 'gb2312' || charset === 'gbk') {
72225
- charset = 'gb18030';
72226
- }
72227
- }
72228
-
72229
- // turn raw buffers into a single utf-8 buffer
72230
- return convert(buffer, 'UTF-8', charset).toString();
72231
- }
72232
-
72233
- /**
72234
- * Detect a URLSearchParams object
72235
- * ref: https://github.com/bitinn/node-fetch/issues/296#issuecomment-307598143
72236
- *
72237
- * @param Object obj Object to detect by type or brand
72238
- * @return String
72239
- */
72240
- function isURLSearchParams(obj) {
72241
- // Duck-typing as a necessary condition.
72242
- if (typeof obj !== 'object' || typeof obj.append !== 'function' || typeof obj.delete !== 'function' || typeof obj.get !== 'function' || typeof obj.getAll !== 'function' || typeof obj.has !== 'function' || typeof obj.set !== 'function') {
72243
- return false;
72244
- }
72245
-
72246
- // Brand-checking and more duck-typing as optional condition.
72247
- return obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';
72248
- }
72249
-
72250
- /**
72251
- * Check if `obj` is a W3C `Blob` object (which `File` inherits from)
72252
- * @param {*} obj
72253
- * @return {boolean}
72254
- */
72255
- function isBlob(obj) {
72256
- return typeof obj === 'object' && typeof obj.arrayBuffer === 'function' && typeof obj.type === 'string' && typeof obj.stream === 'function' && typeof obj.constructor === 'function' && typeof obj.constructor.name === 'string' && /^(Blob|File)$/.test(obj.constructor.name) && /^(Blob|File)$/.test(obj[Symbol.toStringTag]);
72257
- }
72258
-
72259
- /**
72260
- * Clone body given Res/Req instance
72261
- *
72262
- * @param Mixed instance Response or Request instance
72263
- * @return Mixed
72264
- */
72265
- function clone(instance) {
72266
- let p1, p2;
72267
- let body = instance.body;
72268
-
72269
- // don't allow cloning a used body
72270
- if (instance.bodyUsed) {
72271
- throw new Error('cannot clone body after it is used');
72272
- }
72273
-
72274
- // check that body is a stream and not form-data object
72275
- // note: we can't clone the form-data object without having it as a dependency
72276
- if (body instanceof Stream && typeof body.getBoundary !== 'function') {
72277
- // tee instance body
72278
- p1 = new PassThrough();
72279
- p2 = new PassThrough();
72280
- body.pipe(p1);
72281
- body.pipe(p2);
72282
- // set instance body to teed body and return the other teed body
72283
- instance[INTERNALS].body = p1;
72284
- body = p2;
72285
- }
72286
-
72287
- return body;
72288
- }
72289
-
72290
- /**
72291
- * Performs the operation "extract a `Content-Type` value from |object|" as
72292
- * specified in the specification:
72293
- * https://fetch.spec.whatwg.org/#concept-bodyinit-extract
72294
- *
72295
- * This function assumes that instance.body is present.
72296
- *
72297
- * @param Mixed instance Any options.body input
72298
- */
72299
- function extractContentType(body) {
72300
- if (body === null) {
72301
- // body is null
72302
- return null;
72303
- } else if (typeof body === 'string') {
72304
- // body is string
72305
- return 'text/plain;charset=UTF-8';
72306
- } else if (isURLSearchParams(body)) {
72307
- // body is a URLSearchParams
72308
- return 'application/x-www-form-urlencoded;charset=UTF-8';
72309
- } else if (isBlob(body)) {
72310
- // body is blob
72311
- return body.type || null;
72312
- } else if (Buffer.isBuffer(body)) {
72313
- // body is buffer
72314
- return null;
72315
- } else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
72316
- // body is ArrayBuffer
72317
- return null;
72318
- } else if (ArrayBuffer.isView(body)) {
72319
- // body is ArrayBufferView
72320
- return null;
72321
- } else if (typeof body.getBoundary === 'function') {
72322
- // detect form data input from form-data module
72323
- return `multipart/form-data;boundary=${body.getBoundary()}`;
72324
- } else if (body instanceof Stream) {
72325
- // body is stream
72326
- // can't really do much about this
72327
- return null;
72328
- } else {
72329
- // Body constructor defaults other things to string
72330
- return 'text/plain;charset=UTF-8';
72331
- }
72332
- }
72333
-
72334
- /**
72335
- * The Fetch Standard treats this as if "total bytes" is a property on the body.
72336
- * For us, we have to explicitly get it with a function.
72337
- *
72338
- * ref: https://fetch.spec.whatwg.org/#concept-body-total-bytes
72339
- *
72340
- * @param Body instance Instance of Body
72341
- * @return Number? Number of bytes, or null if not possible
72342
- */
72343
- function getTotalBytes(instance) {
72344
- const body = instance.body;
72345
-
72346
-
72347
- if (body === null) {
72348
- // body is null
72349
- return 0;
72350
- } else if (isBlob(body)) {
72351
- return body.size;
72352
- } else if (Buffer.isBuffer(body)) {
72353
- // body is buffer
72354
- return body.length;
72355
- } else if (body && typeof body.getLengthSync === 'function') {
72356
- // detect form data input from form-data module
72357
- if (body._lengthRetrievers && body._lengthRetrievers.length == 0 || // 1.x
72358
- body.hasKnownLength && body.hasKnownLength()) {
72359
- // 2.x
72360
- return body.getLengthSync();
72361
- }
72362
- return null;
72363
- } else {
72364
- // body is stream
72365
- return null;
72366
- }
72367
- }
72368
-
72369
- /**
72370
- * Write a Body to a Node.js WritableStream (e.g. http.Request) object.
72371
- *
72372
- * @param Body instance Instance of Body
72373
- * @return Void
72374
- */
72375
- function writeToStream(dest, instance) {
72376
- const body = instance.body;
72377
-
72378
-
72379
- if (body === null) {
72380
- // body is null
72381
- dest.end();
72382
- } else if (isBlob(body)) {
72383
- body.stream().pipe(dest);
72384
- } else if (Buffer.isBuffer(body)) {
72385
- // body is buffer
72386
- dest.write(body);
72387
- dest.end();
72388
- } else {
72389
- // body is stream
72390
- body.pipe(dest);
72391
- }
72392
- }
72393
-
72394
- // expose Promise
72395
- Body.Promise = global.Promise;
72396
-
72397
- /**
72398
- * headers.js
72399
- *
72400
- * Headers class offers convenient helpers
72401
- */
72402
-
72403
- const invalidTokenRegex = /[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/;
72404
- const invalidHeaderCharRegex = /[^\t\x20-\x7e\x80-\xff]/;
72405
-
72406
- function validateName(name) {
72407
- name = `${name}`;
72408
- if (invalidTokenRegex.test(name) || name === '') {
72409
- throw new TypeError(`${name} is not a legal HTTP header name`);
72410
- }
72411
- }
72412
-
72413
- function validateValue(value) {
72414
- value = `${value}`;
72415
- if (invalidHeaderCharRegex.test(value)) {
72416
- throw new TypeError(`${value} is not a legal HTTP header value`);
72417
- }
72418
- }
72419
-
72420
- /**
72421
- * Find the key in the map object given a header name.
72422
- *
72423
- * Returns undefined if not found.
72424
- *
72425
- * @param String name Header name
72426
- * @return String|Undefined
72427
- */
72428
- function find(map, name) {
72429
- name = name.toLowerCase();
72430
- for (const key in map) {
72431
- if (key.toLowerCase() === name) {
72432
- return key;
72433
- }
72434
- }
72435
- return undefined;
72436
- }
72437
-
72438
- const MAP = Symbol('map');
72439
- class Headers {
72440
- /**
72441
- * Headers class
72442
- *
72443
- * @param Object headers Response headers
72444
- * @return Void
72445
- */
72446
- constructor() {
72447
- let init = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
72448
-
72449
- this[MAP] = Object.create(null);
72450
-
72451
- if (init instanceof Headers) {
72452
- const rawHeaders = init.raw();
72453
- const headerNames = Object.keys(rawHeaders);
72454
-
72455
- for (const headerName of headerNames) {
72456
- for (const value of rawHeaders[headerName]) {
72457
- this.append(headerName, value);
72458
- }
72459
- }
72460
-
72461
- return;
72462
- }
72463
-
72464
- // We don't worry about converting prop to ByteString here as append()
72465
- // will handle it.
72466
- if (init == null) ; else if (typeof init === 'object') {
72467
- const method = init[Symbol.iterator];
72468
- if (method != null) {
72469
- if (typeof method !== 'function') {
72470
- throw new TypeError('Header pairs must be iterable');
72471
- }
72472
-
72473
- // sequence<sequence<ByteString>>
72474
- // Note: per spec we have to first exhaust the lists then process them
72475
- const pairs = [];
72476
- for (const pair of init) {
72477
- if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') {
72478
- throw new TypeError('Each header pair must be iterable');
72479
- }
72480
- pairs.push(Array.from(pair));
72481
- }
72482
-
72483
- for (const pair of pairs) {
72484
- if (pair.length !== 2) {
72485
- throw new TypeError('Each header pair must be a name/value tuple');
72486
- }
72487
- this.append(pair[0], pair[1]);
72488
- }
72489
- } else {
72490
- // record<ByteString, ByteString>
72491
- for (const key of Object.keys(init)) {
72492
- const value = init[key];
72493
- this.append(key, value);
72494
- }
72495
- }
72496
- } else {
72497
- throw new TypeError('Provided initializer must be an object');
72498
- }
72499
- }
72500
-
72501
- /**
72502
- * Return combined header value given name
72503
- *
72504
- * @param String name Header name
72505
- * @return Mixed
72506
- */
72507
- get(name) {
72508
- name = `${name}`;
72509
- validateName(name);
72510
- const key = find(this[MAP], name);
72511
- if (key === undefined) {
72512
- return null;
72513
- }
72514
-
72515
- return this[MAP][key].join(', ');
72516
- }
72517
-
72518
- /**
72519
- * Iterate over all headers
72520
- *
72521
- * @param Function callback Executed for each item with parameters (value, name, thisArg)
72522
- * @param Boolean thisArg `this` context for callback function
72523
- * @return Void
72524
- */
72525
- forEach(callback) {
72526
- let thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
72527
-
72528
- let pairs = getHeaders(this);
72529
- let i = 0;
72530
- while (i < pairs.length) {
72531
- var _pairs$i = pairs[i];
72532
- const name = _pairs$i[0],
72533
- value = _pairs$i[1];
72534
-
72535
- callback.call(thisArg, value, name, this);
72536
- pairs = getHeaders(this);
72537
- i++;
72538
- }
72539
- }
72540
-
72541
- /**
72542
- * Overwrite header values given name
72543
- *
72544
- * @param String name Header name
72545
- * @param String value Header value
72546
- * @return Void
72547
- */
72548
- set(name, value) {
72549
- name = `${name}`;
72550
- value = `${value}`;
72551
- validateName(name);
72552
- validateValue(value);
72553
- const key = find(this[MAP], name);
72554
- this[MAP][key !== undefined ? key : name] = [value];
72555
- }
72556
-
72557
- /**
72558
- * Append a value onto existing header
72559
- *
72560
- * @param String name Header name
72561
- * @param String value Header value
72562
- * @return Void
72563
- */
72564
- append(name, value) {
72565
- name = `${name}`;
72566
- value = `${value}`;
72567
- validateName(name);
72568
- validateValue(value);
72569
- const key = find(this[MAP], name);
72570
- if (key !== undefined) {
72571
- this[MAP][key].push(value);
72572
- } else {
72573
- this[MAP][name] = [value];
72574
- }
72575
- }
72576
-
72577
- /**
72578
- * Check for header name existence
72579
- *
72580
- * @param String name Header name
72581
- * @return Boolean
72582
- */
72583
- has(name) {
72584
- name = `${name}`;
72585
- validateName(name);
72586
- return find(this[MAP], name) !== undefined;
72587
- }
72588
-
72589
- /**
72590
- * Delete all header values given name
72591
- *
72592
- * @param String name Header name
72593
- * @return Void
72594
- */
72595
- delete(name) {
72596
- name = `${name}`;
72597
- validateName(name);
72598
- const key = find(this[MAP], name);
72599
- if (key !== undefined) {
72600
- delete this[MAP][key];
72601
- }
72602
- }
72603
-
72604
- /**
72605
- * Return raw headers (non-spec api)
72606
- *
72607
- * @return Object
72608
- */
72609
- raw() {
72610
- return this[MAP];
72611
- }
72612
-
72613
- /**
72614
- * Get an iterator on keys.
72615
- *
72616
- * @return Iterator
72617
- */
72618
- keys() {
72619
- return createHeadersIterator(this, 'key');
72620
- }
72621
-
72622
- /**
72623
- * Get an iterator on values.
72624
- *
72625
- * @return Iterator
72626
- */
72627
- values() {
72628
- return createHeadersIterator(this, 'value');
72629
- }
72630
-
72631
- /**
72632
- * Get an iterator on entries.
72633
- *
72634
- * This is the default iterator of the Headers object.
72635
- *
72636
- * @return Iterator
72637
- */
72638
- [Symbol.iterator]() {
72639
- return createHeadersIterator(this, 'key+value');
72640
- }
72641
- }
72642
- Headers.prototype.entries = Headers.prototype[Symbol.iterator];
72643
-
72644
- Object.defineProperty(Headers.prototype, Symbol.toStringTag, {
72645
- value: 'Headers',
72646
- writable: false,
72647
- enumerable: false,
72648
- configurable: true
72649
- });
72650
-
72651
- Object.defineProperties(Headers.prototype, {
72652
- get: { enumerable: true },
72653
- forEach: { enumerable: true },
72654
- set: { enumerable: true },
72655
- append: { enumerable: true },
72656
- has: { enumerable: true },
72657
- delete: { enumerable: true },
72658
- keys: { enumerable: true },
72659
- values: { enumerable: true },
72660
- entries: { enumerable: true }
72661
- });
72662
-
72663
- function getHeaders(headers) {
72664
- let kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value';
72665
-
72666
- const keys = Object.keys(headers[MAP]).sort();
72667
- return keys.map(kind === 'key' ? function (k) {
72668
- return k.toLowerCase();
72669
- } : kind === 'value' ? function (k) {
72670
- return headers[MAP][k].join(', ');
72671
- } : function (k) {
72672
- return [k.toLowerCase(), headers[MAP][k].join(', ')];
72673
- });
72674
- }
72675
-
72676
- const INTERNAL = Symbol('internal');
72677
-
72678
- function createHeadersIterator(target, kind) {
72679
- const iterator = Object.create(HeadersIteratorPrototype);
72680
- iterator[INTERNAL] = {
72681
- target,
72682
- kind,
72683
- index: 0
72684
- };
72685
- return iterator;
72686
- }
72687
-
72688
- const HeadersIteratorPrototype = Object.setPrototypeOf({
72689
- next() {
72690
- // istanbul ignore if
72691
- if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) {
72692
- throw new TypeError('Value of `this` is not a HeadersIterator');
72693
- }
72694
-
72695
- var _INTERNAL = this[INTERNAL];
72696
- const target = _INTERNAL.target,
72697
- kind = _INTERNAL.kind,
72698
- index = _INTERNAL.index;
72699
-
72700
- const values = getHeaders(target, kind);
72701
- const len = values.length;
72702
- if (index >= len) {
72703
- return {
72704
- value: undefined,
72705
- done: true
72706
- };
72707
- }
72708
-
72709
- this[INTERNAL].index = index + 1;
72710
-
72711
- return {
72712
- value: values[index],
72713
- done: false
72714
- };
72715
- }
72716
- }, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));
72717
-
72718
- Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, {
72719
- value: 'HeadersIterator',
72720
- writable: false,
72721
- enumerable: false,
72722
- configurable: true
72723
- });
72724
-
72725
- /**
72726
- * Export the Headers object in a form that Node.js can consume.
72727
- *
72728
- * @param Headers headers
72729
- * @return Object
72730
- */
72731
- function exportNodeCompatibleHeaders(headers) {
72732
- const obj = Object.assign({ __proto__: null }, headers[MAP]);
72733
-
72734
- // http.request() only supports string as Host header. This hack makes
72735
- // specifying custom Host header possible.
72736
- const hostHeaderKey = find(headers[MAP], 'Host');
72737
- if (hostHeaderKey !== undefined) {
72738
- obj[hostHeaderKey] = obj[hostHeaderKey][0];
72739
- }
72740
-
72741
- return obj;
72742
- }
72743
-
72744
- /**
72745
- * Create a Headers object from an object of headers, ignoring those that do
72746
- * not conform to HTTP grammar productions.
72747
- *
72748
- * @param Object obj Object of headers
72749
- * @return Headers
72750
- */
72751
- function createHeadersLenient(obj) {
72752
- const headers = new Headers();
72753
- for (const name of Object.keys(obj)) {
72754
- if (invalidTokenRegex.test(name)) {
72755
- continue;
72756
- }
72757
- if (Array.isArray(obj[name])) {
72758
- for (const val of obj[name]) {
72759
- if (invalidHeaderCharRegex.test(val)) {
72760
- continue;
72761
- }
72762
- if (headers[MAP][name] === undefined) {
72763
- headers[MAP][name] = [val];
72764
- } else {
72765
- headers[MAP][name].push(val);
72766
- }
72767
- }
72768
- } else if (!invalidHeaderCharRegex.test(obj[name])) {
72769
- headers[MAP][name] = [obj[name]];
72770
- }
72771
- }
72772
- return headers;
72773
- }
72774
-
72775
- const INTERNALS$1 = Symbol('Response internals');
72776
-
72777
- // fix an issue where "STATUS_CODES" aren't a named export for node <10
72778
- const STATUS_CODES = http.STATUS_CODES;
72779
-
72780
- /**
72781
- * Response class
72782
- *
72783
- * @param Stream body Readable stream
72784
- * @param Object opts Response options
72785
- * @return Void
72786
- */
72787
- class Response {
72788
- constructor() {
72789
- let body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
72790
- let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
72791
-
72792
- Body.call(this, body, opts);
72793
-
72794
- const status = opts.status || 200;
72795
- const headers = new Headers(opts.headers);
72796
-
72797
- if (body != null && !headers.has('Content-Type')) {
72798
- const contentType = extractContentType(body);
72799
- if (contentType) {
72800
- headers.append('Content-Type', contentType);
72801
- }
72802
- }
72803
-
72804
- this[INTERNALS$1] = {
72805
- url: opts.url,
72806
- status,
72807
- statusText: opts.statusText || STATUS_CODES[status],
72808
- headers,
72809
- counter: opts.counter
72810
- };
72811
- }
72812
-
72813
- get url() {
72814
- return this[INTERNALS$1].url || '';
72815
- }
72816
-
72817
- get status() {
72818
- return this[INTERNALS$1].status;
72819
- }
72820
-
72821
- /**
72822
- * Convenience property representing if the request ended normally
72823
- */
72824
- get ok() {
72825
- return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;
72826
- }
72827
-
72828
- get redirected() {
72829
- return this[INTERNALS$1].counter > 0;
72830
- }
72831
-
72832
- get statusText() {
72833
- return this[INTERNALS$1].statusText;
72834
- }
72835
-
72836
- get headers() {
72837
- return this[INTERNALS$1].headers;
72838
- }
72839
-
72840
- /**
72841
- * Clone this response
72842
- *
72843
- * @return Response
72844
- */
72845
- clone() {
72846
- return new Response(clone(this), {
72847
- url: this.url,
72848
- status: this.status,
72849
- statusText: this.statusText,
72850
- headers: this.headers,
72851
- ok: this.ok,
72852
- redirected: this.redirected
72853
- });
72854
- }
72855
- }
72856
-
72857
- Body.mixIn(Response.prototype);
72858
-
72859
- Object.defineProperties(Response.prototype, {
72860
- url: { enumerable: true },
72861
- status: { enumerable: true },
72862
- ok: { enumerable: true },
72863
- redirected: { enumerable: true },
72864
- statusText: { enumerable: true },
72865
- headers: { enumerable: true },
72866
- clone: { enumerable: true }
72867
- });
72868
-
72869
- Object.defineProperty(Response.prototype, Symbol.toStringTag, {
72870
- value: 'Response',
72871
- writable: false,
72872
- enumerable: false,
72873
- configurable: true
72874
- });
72875
-
72876
- const INTERNALS$2 = Symbol('Request internals');
72877
-
72878
- // fix an issue where "format", "parse" aren't a named export for node <10
72879
- const parse_url = Url.parse;
72880
- const format_url = Url.format;
72881
-
72882
- const streamDestructionSupported = 'destroy' in Stream.Readable.prototype;
72883
-
72884
- /**
72885
- * Check if a value is an instance of Request.
72886
- *
72887
- * @param Mixed input
72888
- * @return Boolean
72889
- */
72890
- function isRequest(input) {
72891
- return typeof input === 'object' && typeof input[INTERNALS$2] === 'object';
72892
- }
72893
-
72894
- function isAbortSignal(signal) {
72895
- const proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal);
72896
- return !!(proto && proto.constructor.name === 'AbortSignal');
72897
- }
72898
-
72899
- /**
72900
- * Request class
72901
- *
72902
- * @param Mixed input Url or Request instance
72903
- * @param Object init Custom options
72904
- * @return Void
72905
- */
72906
- class Request {
72907
- constructor(input) {
72908
- let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
72909
-
72910
- let parsedURL;
72911
-
72912
- // normalize input
72913
- if (!isRequest(input)) {
72914
- if (input && input.href) {
72915
- // in order to support Node.js' Url objects; though WHATWG's URL objects
72916
- // will fall into this branch also (since their `toString()` will return
72917
- // `href` property anyway)
72918
- parsedURL = parse_url(input.href);
72919
- } else {
72920
- // coerce input to a string before attempting to parse
72921
- parsedURL = parse_url(`${input}`);
72922
- }
72923
- input = {};
72924
- } else {
72925
- parsedURL = parse_url(input.url);
72926
- }
72927
-
72928
- let method = init.method || input.method || 'GET';
72929
- method = method.toUpperCase();
72930
-
72931
- if ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) {
72932
- throw new TypeError('Request with GET/HEAD method cannot have body');
72933
- }
72934
-
72935
- let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null;
72936
-
72937
- Body.call(this, inputBody, {
72938
- timeout: init.timeout || input.timeout || 0,
72939
- size: init.size || input.size || 0
72940
- });
72941
-
72942
- const headers = new Headers(init.headers || input.headers || {});
72943
-
72944
- if (inputBody != null && !headers.has('Content-Type')) {
72945
- const contentType = extractContentType(inputBody);
72946
- if (contentType) {
72947
- headers.append('Content-Type', contentType);
72948
- }
72949
- }
72950
-
72951
- let signal = isRequest(input) ? input.signal : null;
72952
- if ('signal' in init) signal = init.signal;
72953
-
72954
- if (signal != null && !isAbortSignal(signal)) {
72955
- throw new TypeError('Expected signal to be an instanceof AbortSignal');
72956
- }
72957
-
72958
- this[INTERNALS$2] = {
72959
- method,
72960
- redirect: init.redirect || input.redirect || 'follow',
72961
- headers,
72962
- parsedURL,
72963
- signal
72964
- };
72965
-
72966
- // node-fetch-only options
72967
- this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20;
72968
- this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true;
72969
- this.counter = init.counter || input.counter || 0;
72970
- this.agent = init.agent || input.agent;
72971
- }
72972
-
72973
- get method() {
72974
- return this[INTERNALS$2].method;
72975
- }
72976
-
72977
- get url() {
72978
- return format_url(this[INTERNALS$2].parsedURL);
72979
- }
72980
-
72981
- get headers() {
72982
- return this[INTERNALS$2].headers;
72983
- }
72984
-
72985
- get redirect() {
72986
- return this[INTERNALS$2].redirect;
72987
- }
72988
-
72989
- get signal() {
72990
- return this[INTERNALS$2].signal;
72991
- }
72992
-
72993
- /**
72994
- * Clone this request
72995
- *
72996
- * @return Request
72997
- */
72998
- clone() {
72999
- return new Request(this);
73000
- }
73001
- }
73002
-
73003
- Body.mixIn(Request.prototype);
73004
-
73005
- Object.defineProperty(Request.prototype, Symbol.toStringTag, {
73006
- value: 'Request',
73007
- writable: false,
73008
- enumerable: false,
73009
- configurable: true
73010
- });
73011
-
73012
- Object.defineProperties(Request.prototype, {
73013
- method: { enumerable: true },
73014
- url: { enumerable: true },
73015
- headers: { enumerable: true },
73016
- redirect: { enumerable: true },
73017
- clone: { enumerable: true },
73018
- signal: { enumerable: true }
73019
- });
73020
-
73021
- /**
73022
- * Convert a Request to Node.js http request options.
73023
- *
73024
- * @param Request A Request instance
73025
- * @return Object The options object to be passed to http.request
73026
- */
73027
- function getNodeRequestOptions(request) {
73028
- const parsedURL = request[INTERNALS$2].parsedURL;
73029
- const headers = new Headers(request[INTERNALS$2].headers);
73030
-
73031
- // fetch step 1.3
73032
- if (!headers.has('Accept')) {
73033
- headers.set('Accept', '*/*');
73034
- }
73035
-
73036
- // Basic fetch
73037
- if (!parsedURL.protocol || !parsedURL.hostname) {
73038
- throw new TypeError('Only absolute URLs are supported');
73039
- }
73040
-
73041
- if (!/^https?:$/.test(parsedURL.protocol)) {
73042
- throw new TypeError('Only HTTP(S) protocols are supported');
73043
- }
73044
-
73045
- if (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) {
73046
- throw new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8');
73047
- }
73048
-
73049
- // HTTP-network-or-cache fetch steps 2.4-2.7
73050
- let contentLengthValue = null;
73051
- if (request.body == null && /^(POST|PUT)$/i.test(request.method)) {
73052
- contentLengthValue = '0';
73053
- }
73054
- if (request.body != null) {
73055
- const totalBytes = getTotalBytes(request);
73056
- if (typeof totalBytes === 'number') {
73057
- contentLengthValue = String(totalBytes);
73058
- }
73059
- }
73060
- if (contentLengthValue) {
73061
- headers.set('Content-Length', contentLengthValue);
73062
- }
73063
-
73064
- // HTTP-network-or-cache fetch step 2.11
73065
- if (!headers.has('User-Agent')) {
73066
- headers.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)');
73067
- }
73068
-
73069
- // HTTP-network-or-cache fetch step 2.15
73070
- if (request.compress && !headers.has('Accept-Encoding')) {
73071
- headers.set('Accept-Encoding', 'gzip,deflate');
73072
- }
73073
-
73074
- let agent = request.agent;
73075
- if (typeof agent === 'function') {
73076
- agent = agent(parsedURL);
73077
- }
73078
-
73079
- if (!headers.has('Connection') && !agent) {
73080
- headers.set('Connection', 'close');
73081
- }
73082
-
73083
- // HTTP-network fetch step 4.2
73084
- // chunked encoding is handled by Node.js
73085
-
73086
- return Object.assign({}, parsedURL, {
73087
- method: request.method,
73088
- headers: exportNodeCompatibleHeaders(headers),
73089
- agent
73090
- });
73091
- }
73092
-
73093
- /**
73094
- * abort-error.js
73095
- *
73096
- * AbortError interface for cancelled requests
73097
- */
73098
-
73099
- /**
73100
- * Create AbortError instance
73101
- *
73102
- * @param String message Error message for human
73103
- * @return AbortError
73104
- */
73105
- function AbortError(message) {
73106
- Error.call(this, message);
73107
-
73108
- this.type = 'aborted';
73109
- this.message = message;
73110
-
73111
- // hide custom error implementation details from end-users
73112
- Error.captureStackTrace(this, this.constructor);
73113
- }
73114
-
73115
- AbortError.prototype = Object.create(Error.prototype);
73116
- AbortError.prototype.constructor = AbortError;
73117
- AbortError.prototype.name = 'AbortError';
73118
-
73119
- // fix an issue where "PassThrough", "resolve" aren't a named export for node <10
73120
- const PassThrough$1 = Stream.PassThrough;
73121
- const resolve_url = Url.resolve;
73122
-
73123
- /**
73124
- * Fetch function
73125
- *
73126
- * @param Mixed url Absolute url or Request instance
73127
- * @param Object opts Fetch options
73128
- * @return Promise
73129
- */
73130
- function fetch$1(url, opts) {
73131
-
73132
- // allow custom promise
73133
- if (!fetch$1.Promise) {
73134
- throw new Error('native promise missing, set fetch.Promise to your favorite alternative');
73135
- }
73136
-
73137
- Body.Promise = fetch$1.Promise;
73138
-
73139
- // wrap http.request into fetch
73140
- return new fetch$1.Promise(function (resolve, reject) {
73141
- // build request object
73142
- const request = new Request(url, opts);
73143
- const options = getNodeRequestOptions(request);
73144
-
73145
- const send = (options.protocol === 'https:' ? https : http).request;
73146
- const signal = request.signal;
73147
-
73148
- let response = null;
73149
-
73150
- const abort = function abort() {
73151
- let error = new AbortError('The user aborted a request.');
73152
- reject(error);
73153
- if (request.body && request.body instanceof Stream.Readable) {
73154
- request.body.destroy(error);
73155
- }
73156
- if (!response || !response.body) return;
73157
- response.body.emit('error', error);
73158
- };
73159
-
73160
- if (signal && signal.aborted) {
73161
- abort();
73162
- return;
73163
- }
73164
-
73165
- const abortAndFinalize = function abortAndFinalize() {
73166
- abort();
73167
- finalize();
73168
- };
73169
-
73170
- // send request
73171
- const req = send(options);
73172
- let reqTimeout;
73173
-
73174
- if (signal) {
73175
- signal.addEventListener('abort', abortAndFinalize);
73176
- }
71590
+ var tr = {
71591
+ actions: {
71592
+ login: "Giriş Yap",
71593
+ edit: "Düzenle",
71594
+ apply: "Uygula",
71595
+ close: "Kapat",
71596
+ cancel: "Vazgeç",
71597
+ save: "Kaydet",
71598
+ continue: "Devam Et",
71599
+ show: "Göster",
71600
+ hide: "Gizle",
71601
+ sendMessage: "Mesajı Gönder",
71602
+ continueWithShipping: "Kargo ile Devam Et",
71603
+ continueWithPayment: "Ödeme ile Devam Et",
71604
+ completeOrder: "Siparişi Tamamla",
71605
+ backToShopping: "Alışverişe Dön",
71606
+ backToCart: "Sepete Dön",
71607
+ },
71608
+ securePayment: "Güvenli Ödeme",
71609
+ alreadyHaveAnAccount: "Zaten hesabınız var mı?",
73177
71610
 
73178
- function finalize() {
73179
- req.abort();
73180
- if (signal) signal.removeEventListener('abort', abortAndFinalize);
73181
- clearTimeout(reqTimeout);
73182
- }
71611
+ address: "Adres",
71612
+ addressError: "Adres girin",
71613
+ missingAddressFields: "Adres bilgilerinde bazı zorunlu alanlar eksik.",
71614
+ editAddress: "Adres Düzenle",
71615
+ deleteAddress: "Adresi Sil",
71616
+ saveAddressCta: "Bir sonraki işlem için bu adresi kaydet",
71617
+ firstName: "Ad",
71618
+ firstNameError: "Ad girin",
71619
+ lastName: "Soyad",
71620
+ lastNameError: "Soyad girin",
71621
+ identityNumber: "TC Kimlik No",
71622
+ identityNumberError: "TC kimlik no girin",
71623
+ addressTitle: "Adres Başlığı",
71624
+ adressTitleError: "Adres başlığı girin",
71625
+ addressLine2: "Apartman, daire, vb.",
71626
+ postalCode: "Posta Kodu",
71627
+ postalCodeError: "Posta kodu girin",
71628
+ country: "Ülke",
71629
+ countryError: "Ülke seçin",
71630
+ state: "Eyalet",
71631
+ stateError: "Eyalet seçin",
71632
+ city: "İl",
71633
+ cityError: "İl seçin",
71634
+ district: "İlçe",
71635
+ districtError: "İlçe seçin",
71636
+ phone: "Telefon",
71637
+ phoneError: "Geçerli bir telefon girin",
71638
+ companyName: "Firma Adı",
71639
+ taxOffice: "Vergi Dairesi",
71640
+ taxNumber: "Vergi Numarası",
73183
71641
 
73184
- if (request.timeout) {
73185
- req.once('socket', function (socket) {
73186
- reqTimeout = setTimeout(function () {
73187
- reject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout'));
73188
- finalize();
73189
- }, request.timeout);
73190
- });
73191
- }
71642
+ shipping: "Kargo",
71643
+ payment: "Ödeme",
71644
+ summary: "Özet",
73192
71645
 
73193
- req.on('error', function (err) {
73194
- reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));
73195
- finalize();
73196
- });
71646
+ free: "Ücretsiz",
71647
+ standartShipping: "Standart Kargo",
71648
+ returnPolicy: "Para İade Politikası",
71649
+ privacyPolicy: "Gizlilik Politikası",
71650
+ termsOfService: "Hizmet Şartları",
71651
+ newAddress: "Yeni Adres",
71652
+ billingAddress: "Fatura Adresi",
71653
+ shippingAddress: "Teslimat Adresi",
71654
+ corporateInvoice: "Kurumsal fatura",
71655
+ contactInfo: "İletişim Bilgileri",
71656
+ email: "E-Posta",
71657
+ emailError: "Geçerli bir e-posta girin",
71658
+ guestEmailTooltip: "Sipariş bilgileri bu e-posta adresine gönderilecektir",
71659
+ customerConsentCta: "Beni haberlerden ve özel tekliflerden haberdar et",
71660
+ useShippingForBilling: "Fatura adresim teslimat adresimle aynı",
71661
+ installmentOptions: "Taksit Seçenekleri",
71662
+ singleInstallment: "Tek Çekim",
71663
+ installments: "Taksit",
71664
+ creditCard: "Kredi Kartı",
73197
71665
 
73198
- req.on('response', function (res) {
73199
- clearTimeout(reqTimeout);
73200
-
73201
- const headers = createHeadersLenient(res.headers);
73202
-
73203
- // HTTP fetch step 5
73204
- if (fetch$1.isRedirect(res.statusCode)) {
73205
- // HTTP fetch step 5.2
73206
- const location = headers.get('Location');
73207
-
73208
- // HTTP fetch step 5.3
73209
- const locationURL = location === null ? null : resolve_url(request.url, location);
73210
-
73211
- // HTTP fetch step 5.5
73212
- switch (request.redirect) {
73213
- case 'error':
73214
- reject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, 'no-redirect'));
73215
- finalize();
73216
- return;
73217
- case 'manual':
73218
- // node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL.
73219
- if (locationURL !== null) {
73220
- // handle corrupted header
73221
- try {
73222
- headers.set('Location', locationURL);
73223
- } catch (err) {
73224
- // istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request
73225
- reject(err);
73226
- }
73227
- }
73228
- break;
73229
- case 'follow':
73230
- // HTTP-redirect fetch step 2
73231
- if (locationURL === null) {
73232
- break;
73233
- }
73234
-
73235
- // HTTP-redirect fetch step 5
73236
- if (request.counter >= request.follow) {
73237
- reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));
73238
- finalize();
73239
- return;
73240
- }
73241
-
73242
- // HTTP-redirect fetch step 6 (counter increment)
73243
- // Create a new Request object.
73244
- const requestOpts = {
73245
- headers: new Headers(request.headers),
73246
- follow: request.follow,
73247
- counter: request.counter + 1,
73248
- agent: request.agent,
73249
- compress: request.compress,
73250
- method: request.method,
73251
- body: request.body,
73252
- signal: request.signal,
73253
- timeout: request.timeout,
73254
- size: request.size
73255
- };
73256
-
73257
- // HTTP-redirect fetch step 9
73258
- if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {
73259
- reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));
73260
- finalize();
73261
- return;
73262
- }
73263
-
73264
- // HTTP-redirect fetch step 11
73265
- if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') {
73266
- requestOpts.method = 'GET';
73267
- requestOpts.body = undefined;
73268
- requestOpts.headers.delete('content-length');
73269
- }
73270
-
73271
- // HTTP-redirect fetch step 15
73272
- resolve(fetch$1(new Request(locationURL, requestOpts)));
73273
- finalize();
73274
- return;
73275
- }
73276
- }
71666
+ ackPrivacyPolicy: "Gizlilik Sözleşmesini",
71667
+ ackTermsOfService: "Satış Sözleşmesini",
71668
+ ackPoliciesSentence:
71669
+ "{{ ackPrivacyPolicy }} ve {{ ackTermsOfService }} okudum, onaylıyorum.",
73277
71670
 
73278
- // prepare response
73279
- res.once('end', function () {
73280
- if (signal) signal.removeEventListener('abort', abortAndFinalize);
73281
- });
73282
- let body = res.pipe(new PassThrough$1());
73283
-
73284
- const response_options = {
73285
- url: request.url,
73286
- status: res.statusCode,
73287
- statusText: res.statusMessage,
73288
- headers: headers,
73289
- size: request.size,
73290
- timeout: request.timeout,
73291
- counter: request.counter
73292
- };
71671
+ securePaymentTooltip: "Ödemeler güvenli ve şifrelidir",
71672
+ giftPackage: "Hediye Paketi",
71673
+ giftPackageCta: "Hediye paketi istiyorum",
71674
+ giftPackageCtaPlaceholder: "Hediye mesajınızı giriniz",
73293
71675
 
73294
- // HTTP-network fetch step 12.1.1.3
73295
- const codings = headers.get('Content-Encoding');
73296
-
73297
- // HTTP-network fetch step 12.1.1.4: handle content codings
73298
-
73299
- // in following scenarios we ignore compression support
73300
- // 1. compression support is disabled
73301
- // 2. HEAD request
73302
- // 3. no Content-Encoding header
73303
- // 4. no content response (204)
73304
- // 5. content not modified response (304)
73305
- if (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) {
73306
- response = new Response(body, response_options);
73307
- resolve(response);
73308
- return;
73309
- }
71676
+ paymentMethod: "Ödeme Yöntemi",
71677
+ paymentMethodDiscount: "İndirim",
71678
+ paymentMethodAdditionalPrice: "İşlem Bedeli",
73310
71679
 
73311
- // For Node v6+
73312
- // Be less strict when decoding compressed responses, since sometimes
73313
- // servers send slightly invalid responses that are still accepted
73314
- // by common browsers.
73315
- // Always using Z_SYNC_FLUSH is what cURL does.
73316
- const zlibOptions = {
73317
- flush: zlib.Z_SYNC_FLUSH,
73318
- finishFlush: zlib.Z_SYNC_FLUSH
73319
- };
71680
+ orderSuccessTitle: "Siparişiniz için teşekkür ederiz!",
71681
+ orderSuccessDescription:
71682
+ "Sevgili {{ customerName }}, siparişiniz bize ulaşmıştır. Siparişiniz kargoya verildiğinde sizi e-posta ile bilgilendireceğiz.",
71683
+ orderNoAndDate: "Sipariş No / Tarih",
71684
+ paymentSummary: "Ödeme Özeti",
71685
+ shippingSummary: "Teslimat Özeti",
71686
+ helpCtaQuestion: "Yardıma mı ihtiyacınız var?",
71687
+ helpCta: "Bizimle iletişime geçin",
73320
71688
 
73321
- // for gzip
73322
- if (codings == 'gzip' || codings == 'x-gzip') {
73323
- body = body.pipe(zlib.createGunzip(zlibOptions));
73324
- response = new Response(body, response_options);
73325
- resolve(response);
73326
- return;
73327
- }
71689
+ contactForm: "İletişim Formu",
71690
+ contactFormSent: "Mesaj başarıyla gönderildi",
71691
+ contactFormDescription:
71692
+ "Mesajınızla ilgili olarak size en kısa zamanda e-posta veya telefon aracılığıyla geri dönüş yapılacaktır.",
71693
+ contactFormCta: "Mesajınızı yazın",
73328
71694
 
73329
- // for deflate
73330
- if (codings == 'deflate' || codings == 'x-deflate') {
73331
- // handle the infamous raw deflate response from old servers
73332
- // a hack for old IIS and Apache servers
73333
- const raw = res.pipe(new PassThrough$1());
73334
- raw.once('data', function (chunk) {
73335
- // see http://stackoverflow.com/questions/37519828
73336
- if ((chunk[0] & 0x0F) === 0x08) {
73337
- body = body.pipe(zlib.createInflate());
73338
- } else {
73339
- body = body.pipe(zlib.createInflateRaw());
73340
- }
73341
- response = new Response(body, response_options);
73342
- resolve(response);
73343
- });
73344
- return;
73345
- }
71695
+ orderPackageStatus: {
71696
+ unfulfilled: "Oluşturuldu",
71697
+ readyForShipment: "Kargoya Hazır",
71698
+ fulfilled: "Gönderildi",
71699
+ partiallyFulfilled: "Kısmi Gönderildi",
71700
+ delivered: "Teslim Edildi",
71701
+ unableToDeliver: "Teslim Edilemedi",
71702
+ cancelled: "İptal Edildi",
71703
+ cancelRejected: "İptal Talebi Reddedildi",
71704
+ cancelRequested: "İptal İstendi",
71705
+ refunded: "İade Edildi",
71706
+ refundRequestAccepted: "İade Talebi Onaylandı",
71707
+ refundRejected: "İade Talebi Reddedildi",
71708
+ refundRequested: "İade Talep Edildi",
71709
+ },
73346
71710
 
73347
- // for br
73348
- if (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') {
73349
- body = body.pipe(zlib.createBrotliDecompress());
73350
- response = new Response(body, response_options);
73351
- resolve(response);
73352
- return;
73353
- }
71711
+ quantity: "Adet",
71712
+ cartItemProduct: "ürün",
71713
+ giftCodeErrorTitle: "İndirim Kodu Hatası",
71714
+ giftCodeErrorDescription:
71715
+ "İndirim kodunuz geçersiz veya sepetinizdeki ürünlere uygulanabilir değil. Lütfen kodunuzu kontrol edip tekrar deneyin.",
71716
+ subtotal: "Ara Toplam",
71717
+ total: "Toplam",
71718
+ subtotalTooltip:
71719
+ "Ara toplam, tüm geçerli indirimlerden önce siparişinizin toplam fiyatını yansıtır. kargo ücretini içermez.",
71720
+ cartShippingTitle: "Teslimat / Kargo",
71721
+ cartTaxTitle: "Vergi",
71722
+ cartInterest: "Vade Farkı",
71723
+ couponCode: "İndirim Kodu",
71724
+ addCouponCode: "İndirim kodu ekle",
71725
+ addOrderNote: "Sipariş notu ekle",
71726
+ editOrderNote: "Sipariş notu düzenle",
71727
+ orderNote: "Sipariş Notu",
71728
+ enterPhoneNumber: "Telefon numarası girin",
73354
71729
 
73355
- // otherwise, use response as-is
73356
- response = new Response(body, response_options);
73357
- resolve(response);
73358
- });
71730
+ cardNumber: "Kart Numarası",
71731
+ cardNumberError: "Geçerli bir kart numarası girin",
71732
+ cardHolderName: "Kart Üzerindeki İsim",
71733
+ cardHolderError: "Ad soyad girin",
71734
+ cardExpiry: "Ay / Yıl",
71735
+ cardExpiryError: "Geçerli bir tarih girin",
71736
+ cardCVC: "CVC",
71737
+ cardCVCError: "Geçerli bir güvenlik kodu girin",
71738
+ cardCVCTooltip: "Kartınızın arkasındaki 3 haneli güvenlik kodu",
73359
71739
 
73360
- writeToStream(req, request);
73361
- });
73362
- }
73363
- /**
73364
- * Redirect code matching
73365
- *
73366
- * @param Number code Status code
73367
- * @return Boolean
73368
- */
73369
- fetch$1.isRedirect = function (code) {
73370
- return code === 301 || code === 302 || code === 303 || code === 307 || code === 308;
71740
+ errorCustomerRequired:
71741
+ "Bu e-posta adresine ait kayıtlı bir hesap bulunuyor. Lütfen hesabınıza giriş yapınız.",
71742
+ errorNoShipping: "Bulunduğunuz konuma gönderim yapılmamaktadır.",
71743
+ errorPayment:
71744
+ "Ödemeniz alınamadı. Lütfen bilgilerinizi kontrol edip tekrar deneyin.",
71745
+ errorStockTitle: "Stoklar Güncellendi!",
71746
+ errorStockDescription:
71747
+ "Sepetinizdeki bazı ürünlerin stoğu tükenmiştir. Bu ürünleri sepetinizden çıkararak devam etmek ister misiniz?",
71748
+ errorUnknown: "Beklenmedik bir hata oluştu. Lütfen tekrar deneyin.",
73371
71749
  };
73372
71750
 
73373
- // expose Promise
73374
- fetch$1.Promise = global.Promise;
71751
+ var tr$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.assign(/*#__PURE__*/Object.create(null), tr, {
71752
+ 'default': tr
71753
+ }));
73375
71754
 
73376
71755
  var en = {
73377
71756
  actions: {
@@ -73539,460 +71918,4 @@ var en$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.assign(/*#__PURE__*/Ob
73539
71918
  'default': en
73540
71919
  }));
73541
71920
 
73542
- var tr = {
73543
- actions: {
73544
- login: "Giriş Yap",
73545
- edit: "Düzenle",
73546
- apply: "Uygula",
73547
- close: "Kapat",
73548
- cancel: "Vazgeç",
73549
- save: "Kaydet",
73550
- continue: "Devam Et",
73551
- show: "Göster",
73552
- hide: "Gizle",
73553
- sendMessage: "Mesajı Gönder",
73554
- continueWithShipping: "Kargo ile Devam Et",
73555
- continueWithPayment: "Ödeme ile Devam Et",
73556
- completeOrder: "Siparişi Tamamla",
73557
- backToShopping: "Alışverişe Dön",
73558
- backToCart: "Sepete Dön",
73559
- },
73560
- securePayment: "Güvenli Ödeme",
73561
- alreadyHaveAnAccount: "Zaten hesabınız var mı?",
73562
-
73563
- address: "Adres",
73564
- addressError: "Adres girin",
73565
- missingAddressFields: "Adres bilgilerinde bazı zorunlu alanlar eksik.",
73566
- editAddress: "Adres Düzenle",
73567
- deleteAddress: "Adresi Sil",
73568
- saveAddressCta: "Bir sonraki işlem için bu adresi kaydet",
73569
- firstName: "Ad",
73570
- firstNameError: "Ad girin",
73571
- lastName: "Soyad",
73572
- lastNameError: "Soyad girin",
73573
- identityNumber: "TC Kimlik No",
73574
- identityNumberError: "TC kimlik no girin",
73575
- addressTitle: "Adres Başlığı",
73576
- adressTitleError: "Adres başlığı girin",
73577
- addressLine2: "Apartman, daire, vb.",
73578
- postalCode: "Posta Kodu",
73579
- postalCodeError: "Posta kodu girin",
73580
- country: "Ülke",
73581
- countryError: "Ülke seçin",
73582
- state: "Eyalet",
73583
- stateError: "Eyalet seçin",
73584
- city: "İl",
73585
- cityError: "İl seçin",
73586
- district: "İlçe",
73587
- districtError: "İlçe seçin",
73588
- phone: "Telefon",
73589
- phoneError: "Geçerli bir telefon girin",
73590
- companyName: "Firma Adı",
73591
- taxOffice: "Vergi Dairesi",
73592
- taxNumber: "Vergi Numarası",
73593
-
73594
- shipping: "Kargo",
73595
- payment: "Ödeme",
73596
- summary: "Özet",
73597
-
73598
- free: "Ücretsiz",
73599
- standartShipping: "Standart Kargo",
73600
- returnPolicy: "Para İade Politikası",
73601
- privacyPolicy: "Gizlilik Politikası",
73602
- termsOfService: "Hizmet Şartları",
73603
- newAddress: "Yeni Adres",
73604
- billingAddress: "Fatura Adresi",
73605
- shippingAddress: "Teslimat Adresi",
73606
- corporateInvoice: "Kurumsal fatura",
73607
- contactInfo: "İletişim Bilgileri",
73608
- email: "E-Posta",
73609
- emailError: "Geçerli bir e-posta girin",
73610
- guestEmailTooltip: "Sipariş bilgileri bu e-posta adresine gönderilecektir",
73611
- customerConsentCta: "Beni haberlerden ve özel tekliflerden haberdar et",
73612
- useShippingForBilling: "Fatura adresim teslimat adresimle aynı",
73613
- installmentOptions: "Taksit Seçenekleri",
73614
- singleInstallment: "Tek Çekim",
73615
- installments: "Taksit",
73616
- creditCard: "Kredi Kartı",
73617
-
73618
- ackPrivacyPolicy: "Gizlilik Sözleşmesini",
73619
- ackTermsOfService: "Satış Sözleşmesini",
73620
- ackPoliciesSentence:
73621
- "{{ ackPrivacyPolicy }} ve {{ ackTermsOfService }} okudum, onaylıyorum.",
73622
-
73623
- securePaymentTooltip: "Ödemeler güvenli ve şifrelidir",
73624
- giftPackage: "Hediye Paketi",
73625
- giftPackageCta: "Hediye paketi istiyorum",
73626
- giftPackageCtaPlaceholder: "Hediye mesajınızı giriniz",
73627
-
73628
- paymentMethod: "Ödeme Yöntemi",
73629
- paymentMethodDiscount: "İndirim",
73630
- paymentMethodAdditionalPrice: "İşlem Bedeli",
73631
-
73632
- orderSuccessTitle: "Siparişiniz için teşekkür ederiz!",
73633
- orderSuccessDescription:
73634
- "Sevgili {{ customerName }}, siparişiniz bize ulaşmıştır. Siparişiniz kargoya verildiğinde sizi e-posta ile bilgilendireceğiz.",
73635
- orderNoAndDate: "Sipariş No / Tarih",
73636
- paymentSummary: "Ödeme Özeti",
73637
- shippingSummary: "Teslimat Özeti",
73638
- helpCtaQuestion: "Yardıma mı ihtiyacınız var?",
73639
- helpCta: "Bizimle iletişime geçin",
73640
-
73641
- contactForm: "İletişim Formu",
73642
- contactFormSent: "Mesaj başarıyla gönderildi",
73643
- contactFormDescription:
73644
- "Mesajınızla ilgili olarak size en kısa zamanda e-posta veya telefon aracılığıyla geri dönüş yapılacaktır.",
73645
- contactFormCta: "Mesajınızı yazın",
73646
-
73647
- orderPackageStatus: {
73648
- unfulfilled: "Oluşturuldu",
73649
- readyForShipment: "Kargoya Hazır",
73650
- fulfilled: "Gönderildi",
73651
- partiallyFulfilled: "Kısmi Gönderildi",
73652
- delivered: "Teslim Edildi",
73653
- unableToDeliver: "Teslim Edilemedi",
73654
- cancelled: "İptal Edildi",
73655
- cancelRejected: "İptal Talebi Reddedildi",
73656
- cancelRequested: "İptal İstendi",
73657
- refunded: "İade Edildi",
73658
- refundRequestAccepted: "İade Talebi Onaylandı",
73659
- refundRejected: "İade Talebi Reddedildi",
73660
- refundRequested: "İade Talep Edildi",
73661
- },
73662
-
73663
- quantity: "Adet",
73664
- cartItemProduct: "ürün",
73665
- giftCodeErrorTitle: "İndirim Kodu Hatası",
73666
- giftCodeErrorDescription:
73667
- "İndirim kodunuz geçersiz veya sepetinizdeki ürünlere uygulanabilir değil. Lütfen kodunuzu kontrol edip tekrar deneyin.",
73668
- subtotal: "Ara Toplam",
73669
- total: "Toplam",
73670
- subtotalTooltip:
73671
- "Ara toplam, tüm geçerli indirimlerden önce siparişinizin toplam fiyatını yansıtır. kargo ücretini içermez.",
73672
- cartShippingTitle: "Teslimat / Kargo",
73673
- cartTaxTitle: "Vergi",
73674
- cartInterest: "Vade Farkı",
73675
- couponCode: "İndirim Kodu",
73676
- addCouponCode: "İndirim kodu ekle",
73677
- addOrderNote: "Sipariş notu ekle",
73678
- editOrderNote: "Sipariş notu düzenle",
73679
- orderNote: "Sipariş Notu",
73680
- enterPhoneNumber: "Telefon numarası girin",
73681
-
73682
- cardNumber: "Kart Numarası",
73683
- cardNumberError: "Geçerli bir kart numarası girin",
73684
- cardHolderName: "Kart Üzerindeki İsim",
73685
- cardHolderError: "Ad soyad girin",
73686
- cardExpiry: "Ay / Yıl",
73687
- cardExpiryError: "Geçerli bir tarih girin",
73688
- cardCVC: "CVC",
73689
- cardCVCError: "Geçerli bir güvenlik kodu girin",
73690
- cardCVCTooltip: "Kartınızın arkasındaki 3 haneli güvenlik kodu",
73691
-
73692
- errorCustomerRequired:
73693
- "Bu e-posta adresine ait kayıtlı bir hesap bulunuyor. Lütfen hesabınıza giriş yapınız.",
73694
- errorNoShipping: "Bulunduğunuz konuma gönderim yapılmamaktadır.",
73695
- errorPayment:
73696
- "Ödemeniz alınamadı. Lütfen bilgilerinizi kontrol edip tekrar deneyin.",
73697
- errorStockTitle: "Stoklar Güncellendi!",
73698
- errorStockDescription:
73699
- "Sepetinizdeki bazı ürünlerin stoğu tükenmiştir. Bu ürünleri sepetinizden çıkararak devam etmek ister misiniz?",
73700
- errorUnknown: "Beklenmedik bir hata oluştu. Lütfen tekrar deneyin.",
73701
- };
73702
-
73703
- var tr$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.assign(/*#__PURE__*/Object.create(null), tr, {
73704
- 'default': tr
73705
- }));
73706
-
73707
- var serverRuntimeConfig$2 = getConfig().serverRuntimeConfig;
73708
- var themePath = path$1.join(serverRuntimeConfig$2.PROJECT_ROOT);
73709
- var uploadTheme = function (req, res) { return __awaiter(void 0, void 0, void 0, function () {
73710
- var theme, localization, uploadUrl, zipDir, stat, success, err_1;
73711
- return __generator(this, function (_a) {
73712
- switch (_a.label) {
73713
- case 0: return [4 /*yield*/, corsMiddleware(req, res)];
73714
- case 1:
73715
- _a.sent();
73716
- _a.label = 2;
73717
- case 2:
73718
- _a.trys.push([2, 9, , 10]);
73719
- return [4 /*yield*/, getTheme$1()];
73720
- case 3:
73721
- theme = _a.sent();
73722
- return [4 /*yield*/, readLocalizationFiles()];
73723
- case 4:
73724
- localization = _a.sent();
73725
- return [4 /*yield*/, saveTheme(theme, localization)];
73726
- case 5:
73727
- uploadUrl = _a.sent();
73728
- if (!(typeof uploadUrl === "string")) return [3 /*break*/, 8];
73729
- return [4 /*yield*/, archiveThemeCode()];
73730
- case 6:
73731
- zipDir = _a.sent();
73732
- stat = fs.statSync(zipDir);
73733
- return [4 /*yield*/, _uploadTheme(uploadUrl, fs.readFileSync(zipDir), stat.size)];
73734
- case 7:
73735
- success = _a.sent();
73736
- console.log(success);
73737
- if (success) {
73738
- buildTheme();
73739
- }
73740
- deleteThemeZip(zipDir);
73741
- _a.label = 8;
73742
- case 8:
73743
- res.statusCode = 200;
73744
- res.setHeader("Content-Type", "application/json");
73745
- res.json({ status: "ok" });
73746
- return [3 /*break*/, 10];
73747
- case 9:
73748
- err_1 = _a.sent();
73749
- console.log(err_1);
73750
- res.statusCode = 400;
73751
- res.setHeader("Content-Type", "application/json");
73752
- res.json({ status: "failed" });
73753
- return [3 /*break*/, 10];
73754
- case 10: return [2 /*return*/];
73755
- }
73756
- });
73757
- }); };
73758
- var config$3 = {};
73759
- function archiveThemeCode() {
73760
- return __awaiter(this, void 0, void 0, function () {
73761
- var filename, dirname, output, archive, excludedDirs, files;
73762
- return __generator(this, function (_a) {
73763
- switch (_a.label) {
73764
- case 0:
73765
- filename = "theme.zip";
73766
- dirname = path$1.join(serverRuntimeConfig$2.PROJECT_ROOT, filename);
73767
- output = fs.createWriteStream(dirname);
73768
- archive = archiver("zip", {
73769
- zlib: {
73770
- level: 9,
73771
- },
73772
- });
73773
- archive.on("warning", function (err) {
73774
- if (err.code !== "ENOENT") {
73775
- throw err;
73776
- }
73777
- });
73778
- archive.on("error", function (err) {
73779
- throw err;
73780
- });
73781
- archive.pipe(output);
73782
- excludedDirs = ["node_modules", ".next", "out", ".git"];
73783
- files = fs.readdirSync(themePath);
73784
- files.forEach(function (file) {
73785
- var filePath = path$1.join(themePath, file);
73786
- var stat = fs.lstatSync(filePath);
73787
- if (stat.isDirectory()) {
73788
- if (excludedDirs.includes(file))
73789
- return;
73790
- archive.directory(filePath, file);
73791
- }
73792
- else {
73793
- archive.file(filePath, { name: file });
73794
- }
73795
- });
73796
- return [4 /*yield*/, archive.finalize()];
73797
- case 1:
73798
- _a.sent();
73799
- return [2 /*return*/, new Promise(function (resolve) {
73800
- setTimeout(function () {
73801
- resolve(dirname);
73802
- }, 2000);
73803
- })];
73804
- }
73805
- });
73806
- });
73807
- }
73808
- function saveTheme(theme, localization) {
73809
- return __awaiter(this, void 0, void 0, function () {
73810
- var locales, defaultLocale_1, response, responseJSON, err_2;
73811
- return __generator(this, function (_a) {
73812
- switch (_a.label) {
73813
- case 0:
73814
- _a.trys.push([0, 3, , 4]);
73815
- locales = Object.keys(localization);
73816
- defaultLocale_1 = locales.some(function (l) { return l === "en"; }) ? "en" : locales[0];
73817
- return [4 /*yield*/, fetch$1(process.env.NEXT_PUBLIC_UPLOAD_GQL_URL, {
73818
- method: "POST",
73819
- body: JSON.stringify({
73820
- query: /* GraphQL */ "\n mutation saveTheme($saveThemeInput: SaveThemeInput!) {\n saveTheme(input: $saveThemeInput) {\n themeVersionId\n uploadUrl\n }\n }\n ",
73821
- variables: {
73822
- saveThemeInput: {
73823
- id: IkasStorefrontConfig.config.themeId,
73824
- themeJson: JSON.stringify(theme),
73825
- locales: Object.entries(localization).map(function (_a) {
73826
- var locale = _a[0], localeTranslations = _a[1];
73827
- return ({
73828
- isDefaultLocale: locale === defaultLocale_1,
73829
- locale: locale,
73830
- localeJson: JSON.stringify(localeTranslations),
73831
- });
73832
- }),
73833
- },
73834
- },
73835
- }),
73836
- headers: {
73837
- "x-api-key": IkasStorefrontConfig.config.apiKey,
73838
- "Content-Type": "application/json",
73839
- },
73840
- })];
73841
- case 1:
73842
- response = _a.sent();
73843
- return [4 /*yield*/, response.json()];
73844
- case 2:
73845
- responseJSON = _a.sent();
73846
- if (responseJSON.data && responseJSON.data.saveTheme) {
73847
- return [2 /*return*/, responseJSON.data.saveTheme.uploadUrl];
73848
- }
73849
- return [3 /*break*/, 4];
73850
- case 3:
73851
- err_2 = _a.sent();
73852
- console.log(err_2);
73853
- return [3 /*break*/, 4];
73854
- case 4: return [2 /*return*/];
73855
- }
73856
- });
73857
- });
73858
- }
73859
- function _uploadTheme(uploadUrl, file, size) {
73860
- return __awaiter(this, void 0, void 0, function () {
73861
- var config, res, err_3;
73862
- return __generator(this, function (_a) {
73863
- switch (_a.label) {
73864
- case 0:
73865
- config = {
73866
- headers: {
73867
- "Content-Type": "application/zip",
73868
- "Content-Length": size + "",
73869
- },
73870
- };
73871
- _a.label = 1;
73872
- case 1:
73873
- _a.trys.push([1, 3, , 4]);
73874
- return [4 /*yield*/, axios.put(uploadUrl, file, config)];
73875
- case 2:
73876
- res = _a.sent();
73877
- return [2 /*return*/, res.status === 200];
73878
- case 3:
73879
- err_3 = _a.sent();
73880
- console.log(err_3);
73881
- return [2 /*return*/, false];
73882
- case 4: return [2 /*return*/];
73883
- }
73884
- });
73885
- });
73886
- }
73887
- function buildTheme() {
73888
- return __awaiter(this, void 0, void 0, function () {
73889
- var response, responseJSON, err_4;
73890
- return __generator(this, function (_a) {
73891
- switch (_a.label) {
73892
- case 0:
73893
- _a.trys.push([0, 3, , 4]);
73894
- return [4 /*yield*/, fetch$1(process.env.NEXT_PUBLIC_UPLOAD_GQL_URL, {
73895
- method: "POST",
73896
- body: JSON.stringify({
73897
- query: /* GraphQL */ "\n mutation buildTheme($buildThemeThemeId: String!) {\n buildTheme(themeId: $buildThemeThemeId)\n }\n ",
73898
- variables: {
73899
- buildThemeThemeId: IkasStorefrontConfig.config.themeId,
73900
- },
73901
- }),
73902
- headers: {
73903
- "x-api-key": IkasStorefrontConfig.config.apiKey,
73904
- "Content-Type": "application/json",
73905
- },
73906
- })];
73907
- case 1:
73908
- response = _a.sent();
73909
- return [4 /*yield*/, response.json()];
73910
- case 2:
73911
- responseJSON = _a.sent();
73912
- console.log(responseJSON);
73913
- return [3 /*break*/, 4];
73914
- case 3:
73915
- err_4 = _a.sent();
73916
- console.log(err_4);
73917
- return [3 /*break*/, 4];
73918
- case 4: return [2 /*return*/];
73919
- }
73920
- });
73921
- });
73922
- }
73923
- function getTheme$1() {
73924
- return new Promise(function (resolve, reject) {
73925
- var serverRuntimeConfig = getConfig().serverRuntimeConfig;
73926
- var themePath = path$1.join(serverRuntimeConfig.PROJECT_ROOT, "src", "theme.json");
73927
- fs.readFile(themePath, function (err, file) {
73928
- if (err) {
73929
- return reject(err);
73930
- }
73931
- resolve(JSON.parse(file.toString()));
73932
- });
73933
- });
73934
- }
73935
- function deleteThemeZip(zipDir) {
73936
- fs.unlinkSync(zipDir);
73937
- }
73938
- function readLocalizationFiles() {
73939
- return new Promise(function (resolve, reject) {
73940
- var serverRuntimeConfig = getConfig().serverRuntimeConfig;
73941
- var localesPath = path$1.join(serverRuntimeConfig.PROJECT_ROOT, "public", "locales");
73942
- var stripExtension = function (path) {
73943
- return path.length ? path.split(".")[0] : path;
73944
- };
73945
- fs.readdir(localesPath, function (err, files) {
73946
- if (err) {
73947
- return reject(err);
73948
- }
73949
- var localeDirs = files.filter(function (file) {
73950
- return fs.lstatSync(path$1.join(localesPath, file)).isDirectory();
73951
- });
73952
- var locales = {};
73953
- var hasError = false;
73954
- localeDirs.forEach(function (locale) {
73955
- var localeDirPath = path$1.join(serverRuntimeConfig.PROJECT_ROOT, "public", "locales", locale);
73956
- locales[locale] = {};
73957
- try {
73958
- var localeFiles = fs.readdirSync(localeDirPath);
73959
- localeFiles.forEach(function (localeFile) {
73960
- var file = fs.readFileSync(path$1.join(serverRuntimeConfig.PROJECT_ROOT, "public", "locales", locale, localeFile));
73961
- var strippedLocale = stripExtension(locale).toLowerCase();
73962
- var namespace = stripExtension(localeFile).toLowerCase();
73963
- locales[strippedLocale][namespace] = JSON.parse(file.toString());
73964
- if (strippedLocale === "tr") {
73965
- locales[strippedLocale]["checkout-page"] = tr;
73966
- }
73967
- else {
73968
- locales[strippedLocale]["checkout-page"] = en;
73969
- }
73970
- });
73971
- }
73972
- catch (err) {
73973
- console.error(err);
73974
- hasError = true;
73975
- }
73976
- });
73977
- if (hasError)
73978
- reject(null);
73979
- else
73980
- resolve(locales);
73981
- });
73982
- });
73983
- }
73984
-
73985
- var UploadTheme = /*#__PURE__*/Object.freeze({
73986
- __proto__: null,
73987
- uploadTheme: uploadTheme,
73988
- config: config$3
73989
- });
73990
-
73991
- var IkasLocalThemeAPI = {
73992
- GetComponentDirs: GetComponentDirs,
73993
- GetTheme: GetTheme,
73994
- UpdateTheme: UpdateTheme,
73995
- UploadTheme: UploadTheme,
73996
- };
73997
-
73998
- export { AccountInfoForm, index$4 as AccountPage, AddressForm, addresses$1 as AddressesPage, Analytics, AnalyticsBody, AnalyticsHead, index$8 as BlogPage, _slug_$3 as BlogSlugPage, cart$1 as CartPage, checkout$1 as CheckoutPage, ContactForm, _slug_$1 as CustomPage, editor$1 as EditorPage, EmailRule, EqualsRule, favoriteProducts$1 as FavoriteProductsPage, ForgotPasswordForm, forgotPassword$1 as ForgotPasswordPage, IkasAmountTypeEnum$1 as IkasAmountTypeEnum, IkasApplicableProductFilterValue, IkasAttributeDetail, IkasAttributeList, IkasBaseStore, IkasBlog, IkasBlogAPI, IkasBlogCategory, IkasBlogCategoryList, IkasBlogCategoryListPropValue, IkasBlogCategoryListType, IkasBlogCategoryPropValue, IkasBlogContent, IkasBlogList, IkasBlogListPropValue, IkasBlogListType, IkasBlogMetaData, IkasBlogMetadataTargetType, IkasBlogPropValue, IkasBlogTag, IkasBlogWriter, IkasBrand, IkasBrandAPI, IkasBrandList, IkasBrandListPropValue, IkasBrandListSortType, IkasBrandListType, IkasBrandPropValue, IkasCardAssociation, IkasCardType, IkasCartAPI, IkasCategory, IkasCategoryAPI, IkasCategoryList, IkasCategoryListPropValue, IkasCategoryListSortType, IkasCategoryListType, IkasCategoryPropValue, IkasCheckout, IkasCheckoutAPI, IkasCheckoutRecoveryEmailStatus, IkasCheckoutRecoveryStatus, IkasCheckoutStatus, IkasCityAPI, IkasComponentRenderer, IkasContactForm, IkasContactFormAPI, IkasCountryAPI, IkasCustomer, IkasCustomerAPI, IkasCustomerAddress, IkasDistrictAPI, IkasFavoriteProduct, IkasFavoriteProductAPI, IkasHTMLMetaData, IkasHTMLMetaDataAPI, IkasHTMLMetaDataTargetType, IkasImage, IkasLinkPropValue, IkasLinkType, IkasLocalThemeAPI, IkasMerchantAPI, IkasMerchantSettings, IkasNavigationLink, IkasOrder, IkasOrderCancelledReason, IkasOrderLineItem, IkasOrderPackageFulfillStatus, IkasOrderPackageStatus, IkasOrderPaymentStatus, IkasOrderRefundSettings, IkasOrderShippingMethod, IkasOrderStatus, IkasOrderTransaction, IkasPage, IkasPageEditor, IkasPageHead, IkasPaymentMethod, IkasProduct, IkasProductAttribute, IkasProductAttributeAPI, IkasProductAttributeType, IkasProductAttributeValue, IkasProductDetail, IkasProductDetailPropValue, IkasProductFilter, IkasProductFilterDisplayType, IkasProductFilterSettings, IkasProductFilterSortType, IkasProductFilterType, IkasProductFilterValue, IkasProductList, IkasProductListPropValue, IkasProductListSortType, IkasProductListType, IkasProductPrice, IkasProductSearchAPI, IkasProductType, IkasProductVariant, IkasProductVariantType, IkasShippingMethod, IkasShippingMethodEnum, IkasStateAPI, IkasStorefrontConfig, IkasTheme, IkasThemeComponent, IkasThemeComponentProp, IkasThemeComponentPropType, IkasThemeCustomData, IkasThemePage, IkasThemePageComponent, IkasThemePageType, IkasThemeSettings, IkasTransactionStatusEnum, IkasTransactionTypeEnum, IkasVariantSelectionType, IkasVariantType, IkasVariantTypeAPI, IkasVariantValue, Image, home$1 as IndexPage, LessThanRule, LoginForm, login$1 as LoginPage, MaxRule, MinRule, _404 as NotFoundPage, _id_$1 as OrderDetailPage, OrderLineItemStatusEnum$1 as OrderLineItemStatusEnum, index$6 as OrdersPage, PhoneRule, RangeValue, RecoverPasswordForm, recoverPassword$1 as RecoverPasswordPage, RegisterForm, register$1 as RegisterPage, RequiredRule, search$1 as SearchPage, index$2 as SlugPage, ValidationRule, Validator, ValidatorErrorType, apollo, createTranslationInputData, decodeBase64, findAllIndexes, formatDate, formatMoney, parseRangeStr, pascalCase, stringSorter, stringToSlug, tryForEach, useTranslation, validatePhoneNumber };
71921
+ export { AccountInfoForm, index$4 as AccountPage, AddressForm, addresses$1 as AddressesPage, Analytics, AnalyticsBody, AnalyticsHead, index$8 as BlogPage, _slug_$3 as BlogSlugPage, cart$1 as CartPage, checkout$1 as CheckoutPage, ContactForm, _slug_$1 as CustomPage, editor$1 as EditorPage, EmailRule, EqualsRule, favoriteProducts$1 as FavoriteProductsPage, ForgotPasswordForm, forgotPassword$1 as ForgotPasswordPage, IkasAmountTypeEnum$1 as IkasAmountTypeEnum, IkasApplicableProductFilterValue, IkasAttributeDetail, IkasAttributeList, IkasBaseStore, IkasBlog, IkasBlogAPI, IkasBlogCategory, IkasBlogCategoryList, IkasBlogCategoryListPropValue, IkasBlogCategoryListType, IkasBlogCategoryPropValue, IkasBlogContent, IkasBlogList, IkasBlogListPropValue, IkasBlogListType, IkasBlogMetaData, IkasBlogMetadataTargetType, IkasBlogPropValue, IkasBlogTag, IkasBlogWriter, IkasBrand, IkasBrandAPI, IkasBrandList, IkasBrandListPropValue, IkasBrandListSortType, IkasBrandListType, IkasBrandPropValue, IkasCardAssociation, IkasCardType, IkasCartAPI, IkasCategory, IkasCategoryAPI, IkasCategoryList, IkasCategoryListPropValue, IkasCategoryListSortType, IkasCategoryListType, IkasCategoryPropValue, IkasCheckout, IkasCheckoutAPI, IkasCheckoutCustomer, IkasCheckoutRecoveryEmailStatus, IkasCheckoutRecoveryStatus, IkasCheckoutStatus, IkasCityAPI, IkasComponentRenderer, IkasContactForm, IkasContactFormAPI, IkasCountryAPI, IkasCustomer, IkasCustomerAPI, IkasCustomerAddress, IkasDistrictAPI, IkasFavoriteProduct, IkasFavoriteProductAPI, IkasHTMLMetaData, IkasHTMLMetaDataAPI, IkasHTMLMetaDataTargetType, IkasImage, IkasLinkPropValue, IkasLinkType, IkasMerchantAPI, IkasMerchantSettings, IkasNavigationLink, IkasOrder, IkasOrderCancelledReason, IkasOrderLineItem, IkasOrderPackageFulfillStatus, IkasOrderPackageStatus, IkasOrderPaymentStatus, IkasOrderRefundSettings, IkasOrderShippingMethod, IkasOrderStatus, IkasOrderTransaction, IkasPage, IkasPageEditor, IkasPageHead, IkasPaymentMethod, IkasProduct, IkasProductAttribute, IkasProductAttributeAPI, IkasProductAttributeType, IkasProductAttributeValue, IkasProductDetail, IkasProductDetailPropValue, IkasProductFilter, IkasProductFilterDisplayType, IkasProductFilterSettings, IkasProductFilterSortType, IkasProductFilterType, IkasProductFilterValue, IkasProductList, IkasProductListPropValue, IkasProductListSortType, IkasProductListType, IkasProductPrice, IkasProductSearchAPI, IkasProductType, IkasProductVariant, IkasProductVariantType, IkasShippingMethod, IkasShippingMethodEnum, IkasStateAPI, IkasStorefrontConfig, IkasTheme, IkasThemeComponent, IkasThemeComponentProp, IkasThemeComponentPropType, IkasThemeCustomData, IkasThemePage, IkasThemePageComponent, IkasThemePageType, IkasThemeSettings, IkasTransactionStatusEnum, IkasTransactionTypeEnum, IkasVariantSelectionType, IkasVariantType, IkasVariantTypeAPI, IkasVariantValue, Image, home$1 as IndexPage, LessThanRule, LoginForm, login$1 as LoginPage, MaxRule, MinRule, _404 as NotFoundPage, _id_$1 as OrderDetailPage, OrderLineItemStatusEnum$1 as OrderLineItemStatusEnum, index$6 as OrdersPage, PhoneRule, RangeValue, RecoverPasswordForm, recoverPassword$1 as RecoverPasswordPage, RegisterForm, register$1 as RegisterPage, RequiredRule, search$1 as SearchPage, index$2 as SlugPage, ValidationRule, Validator, ValidatorErrorType, apollo, createTranslationInputData, decodeBase64, findAllIndexes, formatDate, formatMoney, parseRangeStr, pascalCase, stringSorter, stringToSlug, tryForEach, useTranslation, validatePhoneNumber };