zakeke-configurator-react 0.1.377 → 0.1.378

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -26694,128 +26694,118 @@ var ZakekeEnvironment = /*#__PURE__*/function () {
26694
26694
  }());
26695
26695
  _defineProperty(this, "getMessagesByProductCode", /*#__PURE__*/function () {
26696
26696
  var _ref86 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee83(productCode) {
26697
- var query, response, _yield$axiosApi$post$, _yield$axiosApi$post, _yield$axiosApi$post$2, _yield$axiosApi$post2, result, _response, _response$data, _ref87, _response2, _response2$data;
26697
+ var restPath, messages, _yield$axiosApi$get$d, _yield$axiosApi$get5, _yield$axiosApi$get$d2, _yield$axiosApi$get6, result;
26698
26698
  return _regeneratorRuntime().wrap(function _callee83$(_context85) {
26699
26699
  while (1) switch (_context85.prev = _context85.next) {
26700
26700
  case 0:
26701
- query = {
26702
- name: 'messagesByProduct',
26703
- query: "query getEventMessagesByProduct($productGlobalCode: String!){\n\t\t\t\t\t\t\tmessagesByProduct(productGlobalCode: $productGlobalCode){\n\t\t\t\t\t\t\t\tid\n\t\t\t\t\t\t\t\teventGlobalID\n\t\t\t\t\t\t\t\tmessageId\n\t\t\t\t\t\t\t\tmessageText\n\t\t\t\t\t\t\t\teventName\n\t\t\t\t\t\t\t\teventId\n\t\t\t\t\t\t\t\tcloseable\n\t\t\t\t\t\t\t\tvisible\n\t\t\t\t\t\t\t\taddToCartDisabledValue\n\t\t\t\t\t\t\t\tenableCheckForSellerImagesValue\n\t\t\t\t\t\t\t\tenableAdditionalMessage\n\t\t\t\t\t\t\t\tadditionalMessage\n\t\t\t\t\t\t\t\teventMessageId\n\t\t\t\t\t\t\t\ttitle\n\t\t\t\t\t\t\t\ttitleSingleMessage\n\t\t\t\t\t\t\t\tinfoLink\n\t\t\t\t\t\t\t\tdefaultMessage\n\t\t\t\t\t\t\t\tvisibleOnlyOnApi\n\t\t\t\t\t\t\t\taddToCartLabel\n\t\t\t\t\t\t\t\tvisibleLowQualityInfoText\n\t\t\t\t\t\t\t\tdefaultAdditionalMessageText\n\t\t\t\t\t\t\t\twarningText\n\t\t\t\t\t\t\t\tonDeleteWarningText\n\t\t\t\t\t\t\t\tisDefault\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}",
26704
- variables: {
26705
- productGlobalCode: 'guid://Zakeke/Model/' + productCode
26706
- }
26707
- };
26708
- response = null;
26701
+ // REST replacement of the legacy GraphQL `messagesByProduct` query.
26702
+ // Frontend hits the stable REST endpoint to avoid breakage from backoffice GraphQL changes.
26703
+ restPath = "messages/by-product?modelCode=".concat(encodeURIComponent(productCode));
26704
+ messages = null;
26709
26705
  _context85.prev = 2;
26710
- if (!(typeof Zakeke.config.cloudFlareApiUrl !== 'undefined' && Zakeke.config.cloudFlareApiUrl)) {
26711
- _context85.next = 25;
26712
- break;
26713
- }
26714
- _context85.next = 6;
26715
- return _api__WEBPACK_IMPORTED_MODULE_4__.axiosApi.post(Zakeke.config.cloudFlareApiUrl + 'graphql', query);
26716
- case 6:
26717
- _context85.t2 = _yield$axiosApi$post = _context85.sent;
26706
+ _context85.next = 5;
26707
+ return _api__WEBPACK_IMPORTED_MODULE_4__.axiosApi.get(restPath);
26708
+ case 5:
26709
+ _context85.t2 = _yield$axiosApi$get5 = _context85.sent;
26718
26710
  _context85.t1 = _context85.t2 === null;
26719
26711
  if (_context85.t1) {
26720
- _context85.next = 10;
26712
+ _context85.next = 9;
26721
26713
  break;
26722
26714
  }
26723
- _context85.t1 = _yield$axiosApi$post === void 0;
26724
- case 10:
26715
+ _context85.t1 = _yield$axiosApi$get5 === void 0;
26716
+ case 9:
26725
26717
  if (!_context85.t1) {
26726
- _context85.next = 14;
26718
+ _context85.next = 13;
26727
26719
  break;
26728
26720
  }
26729
26721
  _context85.t3 = void 0;
26730
- _context85.next = 15;
26722
+ _context85.next = 14;
26731
26723
  break;
26724
+ case 13:
26725
+ _context85.t3 = _yield$axiosApi$get5.data;
26732
26726
  case 14:
26733
- _context85.t3 = _yield$axiosApi$post.data;
26734
- case 15:
26735
- _context85.t4 = _yield$axiosApi$post$ = _context85.t3;
26727
+ _context85.t4 = _yield$axiosApi$get$d = _context85.t3;
26736
26728
  _context85.t0 = _context85.t4 !== null;
26737
26729
  if (!_context85.t0) {
26738
- _context85.next = 19;
26730
+ _context85.next = 18;
26739
26731
  break;
26740
26732
  }
26741
- _context85.t0 = _yield$axiosApi$post$ !== void 0;
26742
- case 19:
26733
+ _context85.t0 = _yield$axiosApi$get$d !== void 0;
26734
+ case 18:
26743
26735
  if (!_context85.t0) {
26744
- _context85.next = 23;
26736
+ _context85.next = 22;
26745
26737
  break;
26746
26738
  }
26747
- _context85.t5 = _yield$axiosApi$post$;
26748
- _context85.next = 24;
26739
+ _context85.t5 = _yield$axiosApi$get$d;
26740
+ _context85.next = 23;
26749
26741
  break;
26750
- case 23:
26742
+ case 22:
26751
26743
  _context85.t5 = null;
26752
- case 24:
26753
- response = _context85.t5;
26754
- case 25:
26755
- _context85.next = 30;
26744
+ case 23:
26745
+ messages = _context85.t5;
26746
+ _context85.next = 29;
26756
26747
  break;
26757
- case 27:
26758
- _context85.prev = 27;
26748
+ case 26:
26749
+ _context85.prev = 26;
26759
26750
  _context85.t6 = _context85["catch"](2);
26760
- console.error('Error in CloudFlare API', _context85.t6);
26761
- case 30:
26762
- _context85.prev = 30;
26763
- if (!(response === null)) {
26764
- _context85.next = 53;
26751
+ console.error('Error in messages/by-product (primary)', _context85.t6);
26752
+ case 29:
26753
+ if (!(messages === null)) {
26754
+ _context85.next = 57;
26765
26755
  break;
26766
26756
  }
26767
- _context85.next = 34;
26768
- return _api__WEBPACK_IMPORTED_MODULE_4__.axiosApi.post(Zakeke.config.graphqlUrl + 'graphql', query);
26769
- case 34:
26770
- _context85.t9 = _yield$axiosApi$post2 = _context85.sent;
26757
+ _context85.prev = 30;
26758
+ _context85.next = 33;
26759
+ return _api__WEBPACK_IMPORTED_MODULE_4__.axiosApi.get(Zakeke.config.baseApiUrl + restPath);
26760
+ case 33:
26761
+ _context85.t9 = _yield$axiosApi$get6 = _context85.sent;
26771
26762
  _context85.t8 = _context85.t9 === null;
26772
26763
  if (_context85.t8) {
26773
- _context85.next = 38;
26764
+ _context85.next = 37;
26774
26765
  break;
26775
26766
  }
26776
- _context85.t8 = _yield$axiosApi$post2 === void 0;
26777
- case 38:
26767
+ _context85.t8 = _yield$axiosApi$get6 === void 0;
26768
+ case 37:
26778
26769
  if (!_context85.t8) {
26779
- _context85.next = 42;
26770
+ _context85.next = 41;
26780
26771
  break;
26781
26772
  }
26782
26773
  _context85.t10 = void 0;
26783
- _context85.next = 43;
26774
+ _context85.next = 42;
26784
26775
  break;
26776
+ case 41:
26777
+ _context85.t10 = _yield$axiosApi$get6.data;
26785
26778
  case 42:
26786
- _context85.t10 = _yield$axiosApi$post2.data;
26787
- case 43:
26788
- _context85.t11 = _yield$axiosApi$post$2 = _context85.t10;
26779
+ _context85.t11 = _yield$axiosApi$get$d2 = _context85.t10;
26789
26780
  _context85.t7 = _context85.t11 !== null;
26790
26781
  if (!_context85.t7) {
26791
- _context85.next = 47;
26782
+ _context85.next = 46;
26792
26783
  break;
26793
26784
  }
26794
- _context85.t7 = _yield$axiosApi$post$2 !== void 0;
26795
- case 47:
26785
+ _context85.t7 = _yield$axiosApi$get$d2 !== void 0;
26786
+ case 46:
26796
26787
  if (!_context85.t7) {
26797
- _context85.next = 51;
26788
+ _context85.next = 50;
26798
26789
  break;
26799
26790
  }
26800
- _context85.t12 = _yield$axiosApi$post$2;
26801
- _context85.next = 52;
26791
+ _context85.t12 = _yield$axiosApi$get$d2;
26792
+ _context85.next = 51;
26802
26793
  break;
26803
- case 51:
26794
+ case 50:
26804
26795
  _context85.t12 = null;
26805
- case 52:
26806
- response = _context85.t12;
26807
- case 53:
26808
- _context85.next = 58;
26796
+ case 51:
26797
+ messages = _context85.t12;
26798
+ _context85.next = 57;
26809
26799
  break;
26810
- case 55:
26811
- _context85.prev = 55;
26800
+ case 54:
26801
+ _context85.prev = 54;
26812
26802
  _context85.t13 = _context85["catch"](30);
26813
- console.error('Error in GraphQL API', _context85.t13);
26814
- case 58:
26803
+ console.error('Error in messages/by-product (baseApi fallback)', _context85.t13);
26804
+ case 57:
26815
26805
  result = null;
26816
26806
  try {
26817
- if ((_response = response) !== null && _response !== void 0 && (_response$data = _response.data) !== null && _response$data !== void 0 && _response$data.messagesByProduct) {
26818
- result = (_ref87 = (_response2 = response) === null || _response2 === void 0 ? void 0 : (_response2$data = _response2.data) === null || _response2$data === void 0 ? void 0 : _response2$data.messagesByProduct.map(function (message) {
26807
+ if (messages) {
26808
+ result = messages.map(function (message) {
26819
26809
  return {
26820
26810
  eventID: message.eventId,
26821
26811
  description: message.messageText,
@@ -26828,17 +26818,17 @@ var ZakekeEnvironment = /*#__PURE__*/function () {
26828
26818
  };
26829
26819
  }).map(function (message) {
26830
26820
  return ___WEBPACK_IMPORTED_MODULE_2__.EventMessage.fromMessage(message);
26831
- })) !== null && _ref87 !== void 0 ? _ref87 : [];
26821
+ });
26832
26822
  }
26833
26823
  } catch (error) {
26834
26824
  console.error('Error in mapping welcome messages response', error);
26835
26825
  }
26836
26826
  return _context85.abrupt("return", result);
26837
- case 61:
26827
+ case 60:
26838
26828
  case "end":
26839
26829
  return _context85.stop();
26840
26830
  }
26841
- }, _callee83, null, [[2, 27], [30, 55]]);
26831
+ }, _callee83, null, [[2, 26], [30, 54]]);
26842
26832
  }));
26843
26833
  return function (_x85) {
26844
26834
  return _ref86.apply(this, arguments);
@@ -26952,7 +26942,7 @@ var ZakekeEnvironment = /*#__PURE__*/function () {
26952
26942
  }, _callee85, null, [[1, 27]]);
26953
26943
  })));
26954
26944
  _defineProperty(this, "tryOnCountView", /*#__PURE__*/function () {
26955
- var _ref90 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee86(sellerID, providerID, modeChosen) {
26945
+ var _ref89 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee86(sellerID, providerID, modeChosen) {
26956
26946
  return _regeneratorRuntime().wrap(function _callee86$(_context88) {
26957
26947
  while (1) switch (_context88.prev = _context88.next) {
26958
26948
  case 0:
@@ -26977,7 +26967,7 @@ var ZakekeEnvironment = /*#__PURE__*/function () {
26977
26967
  }, _callee86, null, [[0, 5]]);
26978
26968
  }));
26979
26969
  return function (_x86, _x87, _x88) {
26980
- return _ref90.apply(this, arguments);
26970
+ return _ref89.apply(this, arguments);
26981
26971
  };
26982
26972
  }());
26983
26973
  /**
@@ -27099,7 +27089,7 @@ var ZakekeEnvironment = /*#__PURE__*/function () {
27099
27089
  return _this._aiPresetPresetsPromise;
27100
27090
  });
27101
27091
  _defineProperty(this, "getAIPresetCategories", /*#__PURE__*/function () {
27102
- var _ref92 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee88(presetType) {
27092
+ var _ref91 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee88(presetType) {
27103
27093
  var allCategories, categories, hasValidCategories;
27104
27094
  return _regeneratorRuntime().wrap(function _callee88$(_context90) {
27105
27095
  while (1) switch (_context90.prev = _context90.next) {
@@ -27129,11 +27119,11 @@ var ZakekeEnvironment = /*#__PURE__*/function () {
27129
27119
  }, _callee88, null, [[0, 9]]);
27130
27120
  }));
27131
27121
  return function (_x89) {
27132
- return _ref92.apply(this, arguments);
27122
+ return _ref91.apply(this, arguments);
27133
27123
  };
27134
27124
  }());
27135
27125
  _defineProperty(this, "getAIPresetPresets", /*#__PURE__*/function () {
27136
- var _ref93 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee89(presetType) {
27126
+ var _ref92 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee89(presetType) {
27137
27127
  var allPresets;
27138
27128
  return _regeneratorRuntime().wrap(function _callee89$(_context91) {
27139
27129
  while (1) switch (_context91.prev = _context91.next) {
@@ -27158,11 +27148,11 @@ var ZakekeEnvironment = /*#__PURE__*/function () {
27158
27148
  }, _callee89, null, [[0, 7]]);
27159
27149
  }));
27160
27150
  return function (_x90) {
27161
- return _ref93.apply(this, arguments);
27151
+ return _ref92.apply(this, arguments);
27162
27152
  };
27163
27153
  }());
27164
27154
  _defineProperty(this, "getApplicableAIStagingRules", /*#__PURE__*/function () {
27165
- var _ref94 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee90(options) {
27155
+ var _ref93 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee90(options) {
27166
27156
  var productID, printTypeID, queryParams;
27167
27157
  return _regeneratorRuntime().wrap(function _callee90$(_context92) {
27168
27158
  while (1) switch (_context92.prev = _context92.next) {
@@ -27194,11 +27184,11 @@ var ZakekeEnvironment = /*#__PURE__*/function () {
27194
27184
  }, _callee90, null, [[3, 12]]);
27195
27185
  }));
27196
27186
  return function (_x91) {
27197
- return _ref94.apply(this, arguments);
27187
+ return _ref93.apply(this, arguments);
27198
27188
  };
27199
27189
  }());
27200
27190
  _defineProperty(this, "getApplicableAIVirtualModelRules", /*#__PURE__*/function () {
27201
- var _ref95 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee91(options) {
27191
+ var _ref94 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee91(options) {
27202
27192
  var productID, printTypeID, queryParams, url, result;
27203
27193
  return _regeneratorRuntime().wrap(function _callee91$(_context93) {
27204
27194
  while (1) switch (_context93.prev = _context93.next) {
@@ -27234,11 +27224,11 @@ var ZakekeEnvironment = /*#__PURE__*/function () {
27234
27224
  }, _callee91, null, [[3, 16]]);
27235
27225
  }));
27236
27226
  return function (_x92) {
27237
- return _ref95.apply(this, arguments);
27227
+ return _ref94.apply(this, arguments);
27238
27228
  };
27239
27229
  }());
27240
27230
  _defineProperty(this, "fetchServicesAvailability", /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee92() {
27241
- var _ref97, _data$gENERATIVE_AI_D, _ref98, _data$gENERATIVE_AI_I, _ref99, _data$gENERATIVE_AI_P, _ref100, _data$gENERATIVE_AI_V, _ref101, _data$vECTORIZE, url, response, data, result;
27231
+ var _ref96, _data$gENERATIVE_AI_D, _ref97, _data$gENERATIVE_AI_I, _ref98, _data$gENERATIVE_AI_P, _ref99, _data$gENERATIVE_AI_V, _ref100, _data$vECTORIZE, url, response, data, result;
27242
27232
  return _regeneratorRuntime().wrap(function _callee92$(_context94) {
27243
27233
  while (1) switch (_context94.prev = _context94.next) {
27244
27234
  case 0:
@@ -27257,11 +27247,11 @@ var ZakekeEnvironment = /*#__PURE__*/function () {
27257
27247
  // So GENERATIVE_AI_VTO → gENERATIVE_AI_VTO, VECTORIZE → vECTORIZE.
27258
27248
  // We normalize here to keep the interface clean.
27259
27249
  result = {
27260
- GENERATIVE_AI_DESIGN: (_ref97 = (_data$gENERATIVE_AI_D = data.gENERATIVE_AI_DESIGN) !== null && _data$gENERATIVE_AI_D !== void 0 ? _data$gENERATIVE_AI_D : data.GENERATIVE_AI_DESIGN) !== null && _ref97 !== void 0 ? _ref97 : false,
27261
- GENERATIVE_AI_IMAGE_GENERATOR: (_ref98 = (_data$gENERATIVE_AI_I = data.gENERATIVE_AI_IMAGE_GENERATOR) !== null && _data$gENERATIVE_AI_I !== void 0 ? _data$gENERATIVE_AI_I : data.GENERATIVE_AI_IMAGE_GENERATOR) !== null && _ref98 !== void 0 ? _ref98 : false,
27262
- GENERATIVE_AI_PRODUCT_STAGING: (_ref99 = (_data$gENERATIVE_AI_P = data.gENERATIVE_AI_PRODUCT_STAGING) !== null && _data$gENERATIVE_AI_P !== void 0 ? _data$gENERATIVE_AI_P : data.GENERATIVE_AI_PRODUCT_STAGING) !== null && _ref99 !== void 0 ? _ref99 : false,
27263
- GENERATIVE_AI_VTO: (_ref100 = (_data$gENERATIVE_AI_V = data.gENERATIVE_AI_VTO) !== null && _data$gENERATIVE_AI_V !== void 0 ? _data$gENERATIVE_AI_V : data.GENERATIVE_AI_VTO) !== null && _ref100 !== void 0 ? _ref100 : false,
27264
- VECTORIZE: (_ref101 = (_data$vECTORIZE = data.vECTORIZE) !== null && _data$vECTORIZE !== void 0 ? _data$vECTORIZE : data.VECTORIZE) !== null && _ref101 !== void 0 ? _ref101 : false
27250
+ GENERATIVE_AI_DESIGN: (_ref96 = (_data$gENERATIVE_AI_D = data.gENERATIVE_AI_DESIGN) !== null && _data$gENERATIVE_AI_D !== void 0 ? _data$gENERATIVE_AI_D : data.GENERATIVE_AI_DESIGN) !== null && _ref96 !== void 0 ? _ref96 : false,
27251
+ GENERATIVE_AI_IMAGE_GENERATOR: (_ref97 = (_data$gENERATIVE_AI_I = data.gENERATIVE_AI_IMAGE_GENERATOR) !== null && _data$gENERATIVE_AI_I !== void 0 ? _data$gENERATIVE_AI_I : data.GENERATIVE_AI_IMAGE_GENERATOR) !== null && _ref97 !== void 0 ? _ref97 : false,
27252
+ GENERATIVE_AI_PRODUCT_STAGING: (_ref98 = (_data$gENERATIVE_AI_P = data.gENERATIVE_AI_PRODUCT_STAGING) !== null && _data$gENERATIVE_AI_P !== void 0 ? _data$gENERATIVE_AI_P : data.GENERATIVE_AI_PRODUCT_STAGING) !== null && _ref98 !== void 0 ? _ref98 : false,
27253
+ GENERATIVE_AI_VTO: (_ref99 = (_data$gENERATIVE_AI_V = data.gENERATIVE_AI_VTO) !== null && _data$gENERATIVE_AI_V !== void 0 ? _data$gENERATIVE_AI_V : data.GENERATIVE_AI_VTO) !== null && _ref99 !== void 0 ? _ref99 : false,
27254
+ VECTORIZE: (_ref100 = (_data$vECTORIZE = data.vECTORIZE) !== null && _data$vECTORIZE !== void 0 ? _data$vECTORIZE : data.VECTORIZE) !== null && _ref100 !== void 0 ? _ref100 : false
27265
27255
  };
27266
27256
  console.log('[AI-Studio] Services availability normalized:', result);
27267
27257
  return _context94.abrupt("return", result);
@@ -27283,7 +27273,7 @@ var ZakekeEnvironment = /*#__PURE__*/function () {
27283
27273
  }, _callee92, null, [[0, 13]]);
27284
27274
  })));
27285
27275
  _defineProperty(this, "createAIProductStagingTask", /*#__PURE__*/function () {
27286
- var _ref102 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee93(options) {
27276
+ var _ref101 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee93(options) {
27287
27277
  var _options$backgroundTy;
27288
27278
  var payload, _data$taskId, url, response, json, rule, data;
27289
27279
  return _regeneratorRuntime().wrap(function _callee93$(_context95) {
@@ -27374,11 +27364,11 @@ var ZakekeEnvironment = /*#__PURE__*/function () {
27374
27364
  }, _callee93, null, [[2, 24]]);
27375
27365
  }));
27376
27366
  return function (_x93) {
27377
- return _ref102.apply(this, arguments);
27367
+ return _ref101.apply(this, arguments);
27378
27368
  };
27379
27369
  }());
27380
27370
  _defineProperty(this, "pollAIProductStagingTask", /*#__PURE__*/function () {
27381
- var _ref103 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee94(taskId, progress) {
27371
+ var _ref102 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee94(taskId, progress) {
27382
27372
  var times, emptyResponse, url, fetchResponse, response, _response$errorMessag, _response$errorMessag2;
27383
27373
  return _regeneratorRuntime().wrap(function _callee94$(_context96) {
27384
27374
  while (1) switch (_context96.prev = _context96.next) {
@@ -27485,11 +27475,11 @@ var ZakekeEnvironment = /*#__PURE__*/function () {
27485
27475
  }, _callee94, null, [[3, 32]]);
27486
27476
  }));
27487
27477
  return function (_x94, _x95) {
27488
- return _ref103.apply(this, arguments);
27478
+ return _ref102.apply(this, arguments);
27489
27479
  };
27490
27480
  }());
27491
27481
  _defineProperty(this, "generateAIProductStaging", /*#__PURE__*/function () {
27492
- var _ref104 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee95(options) {
27482
+ var _ref103 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee95(options) {
27493
27483
  var taskId, _yield$_this$pollAIPr, result, message;
27494
27484
  return _regeneratorRuntime().wrap(function _callee95$(_context97) {
27495
27485
  while (1) switch (_context97.prev = _context97.next) {
@@ -27536,11 +27526,11 @@ var ZakekeEnvironment = /*#__PURE__*/function () {
27536
27526
  }, _callee95);
27537
27527
  }));
27538
27528
  return function (_x96) {
27539
- return _ref104.apply(this, arguments);
27529
+ return _ref103.apply(this, arguments);
27540
27530
  };
27541
27531
  }());
27542
27532
  _defineProperty(this, "createAIVirtualTryonTask", /*#__PURE__*/function () {
27543
- var _ref105 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee96(options) {
27533
+ var _ref104 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee96(options) {
27544
27534
  var payload, _data$taskId2, url, response, json, rule, data;
27545
27535
  return _regeneratorRuntime().wrap(function _callee96$(_context98) {
27546
27536
  while (1) switch (_context98.prev = _context98.next) {
@@ -27626,11 +27616,11 @@ var ZakekeEnvironment = /*#__PURE__*/function () {
27626
27616
  }, _callee96, null, [[1, 21]]);
27627
27617
  }));
27628
27618
  return function (_x97) {
27629
- return _ref105.apply(this, arguments);
27619
+ return _ref104.apply(this, arguments);
27630
27620
  };
27631
27621
  }());
27632
27622
  _defineProperty(this, "pollAIVirtualTryonTask", /*#__PURE__*/function () {
27633
- var _ref106 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee97(taskId, progress) {
27623
+ var _ref105 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee97(taskId, progress) {
27634
27624
  var times, emptyResponse, url, fetchResponse, response, _response$errorMessag3;
27635
27625
  return _regeneratorRuntime().wrap(function _callee97$(_context99) {
27636
27626
  while (1) switch (_context99.prev = _context99.next) {
@@ -27724,11 +27714,11 @@ var ZakekeEnvironment = /*#__PURE__*/function () {
27724
27714
  }, _callee97, null, [[3, 27]]);
27725
27715
  }));
27726
27716
  return function (_x98, _x99) {
27727
- return _ref106.apply(this, arguments);
27717
+ return _ref105.apply(this, arguments);
27728
27718
  };
27729
27719
  }());
27730
27720
  _defineProperty(this, "generateAIVirtualTryon", /*#__PURE__*/function () {
27731
- var _ref107 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee98(options) {
27721
+ var _ref106 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee98(options) {
27732
27722
  var taskId, _yield$_this$pollAIVi, result, message;
27733
27723
  return _regeneratorRuntime().wrap(function _callee98$(_context100) {
27734
27724
  while (1) switch (_context100.prev = _context100.next) {
@@ -27765,7 +27755,7 @@ var ZakekeEnvironment = /*#__PURE__*/function () {
27765
27755
  }, _callee98);
27766
27756
  }));
27767
27757
  return function (_x100) {
27768
- return _ref107.apply(this, arguments);
27758
+ return _ref106.apply(this, arguments);
27769
27759
  };
27770
27760
  }());
27771
27761
  if (_helpers__WEBPACK_IMPORTED_MODULE_8__.IS_IOS) {
@@ -31958,13 +31948,13 @@ function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArra
31958
31948
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
31959
31949
  function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
31960
31950
  function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
31951
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
31961
31952
  function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
31962
31953
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
31963
31954
  function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
31964
31955
  function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
31965
31956
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
31966
31957
  function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
31967
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
31968
31958
  function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
31969
31959
  function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
31970
31960
  function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
@@ -32038,26 +32028,26 @@ var DesignPriceCalculatorRuleFactory = /*#__PURE__*/_createClass(function Design
32038
32028
  _classCallCheck(this, DesignPriceCalculatorRuleFactory);
32039
32029
  });
32040
32030
  _defineProperty(DesignPriceCalculatorRuleFactory, "create", /*#__PURE__*/function () {
32041
- var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(product, apiUrl, token, isOwin, cloudFlareApiUrl, clientLang) {
32031
+ var _ref5 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(product, apiUrl, token, isOwin, cloudFlareApiUrl, clientLang) {
32042
32032
  var calculator;
32043
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
32044
- while (1) switch (_context2.prev = _context2.next) {
32033
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
32034
+ while (1) switch (_context3.prev = _context3.next) {
32045
32035
  case 0:
32046
32036
  calculator = new DesignPriceCalculatorRuleBased(apiUrl, token, isOwin, cloudFlareApiUrl, clientLang);
32047
- _context2.next = 3;
32037
+ _context3.next = 3;
32048
32038
  return calculator.init(product)["catch"](function (e) {
32049
32039
  return console.error(e);
32050
32040
  });
32051
32041
  case 3:
32052
- return _context2.abrupt("return", calculator);
32042
+ return _context3.abrupt("return", calculator);
32053
32043
  case 4:
32054
32044
  case "end":
32055
- return _context2.stop();
32045
+ return _context3.stop();
32056
32046
  }
32057
- }, _callee2);
32047
+ }, _callee3);
32058
32048
  }));
32059
- return function (_x3, _x4, _x5, _x6, _x7, _x8) {
32060
- return _ref4.apply(this, arguments);
32049
+ return function (_x4, _x5, _x6, _x7, _x8, _x9) {
32050
+ return _ref5.apply(this, arguments);
32061
32051
  };
32062
32052
  }());
32063
32053
  var DesignPriceCalculatorRuleBased = /*#__PURE__*/_createClass(function DesignPriceCalculatorRuleBased(apiUrl, token, isOwin, cloudFlareApiUrl, clientLang) {
@@ -32066,7 +32056,8 @@ var DesignPriceCalculatorRuleBased = /*#__PURE__*/_createClass(function DesignPr
32066
32056
  _defineProperty(this, "colorID", -1);
32067
32057
  _defineProperty(this, "config", {
32068
32058
  isOwin: true,
32069
- apiUrl: 'https://test-api.zakeke.com/api/graphql',
32059
+ // REST API base (no 'graphql' suffix). REST endpoints are appended at call sites.
32060
+ apiUrl: 'https://test-api.zakeke.com/api/',
32070
32061
  cloudFlareApiUrl: null,
32071
32062
  token: 'Gw6IL2Q7e66r3osC16_T6XSlsrnuUAHmw59Y3-qJv2LaPPV-nuzDkC0eOGAU8ef_i94HLlu8vDVXpk9MAWBtwrXWN7_XizPAeIfKXArfol19Ek7wmZMR3zRQWwHChqPmYDJMrI3WeCIQGRJxsR7q8hh5xywTqdOwVi6LT7_8-qP9jkc_tdBUPiMUrT6HI1i1ygnEGEk6Eoa97zvbVGRE3NRt-W5nXKGv4_INB_VBdpOihHVXIzl7PtchqPyBr7AaW5Hdrbh_KoFwEhLTcTixXpxfzOcjecbyqFHw20fNFlg2ny6Cb375i7hpnFWD7Q4lj9xI3R6jbkpFHsQEFfBK-UF1f9vli0liCWQ3WdAYGQEmUYx7QjCy240GuR_cK6c28JHoabSGQdW91K7KEAug4o19nokKfzbWoZM7WD4T4RVXNB_ob_gjeYKsK7EJIt6qGiPpnJEbSeFCjz1EhE31Jw6MO-oawNSASxgYk1D6Z3XkLw1G',
32072
32063
  clientLang: null
@@ -32086,28 +32077,20 @@ var DesignPriceCalculatorRuleBased = /*#__PURE__*/_createClass(function DesignPr
32086
32077
  });
32087
32078
  });
32088
32079
  _defineProperty(this, "getPricings", /*#__PURE__*/function () {
32089
- var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(product, callback) {
32090
- var query, axiosConfig, requestData, responseCF, response;
32091
- return _regeneratorRuntime().wrap(function _callee$(_context) {
32092
- while (1) switch (_context.prev = _context.next) {
32080
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(product, callback) {
32081
+ var axiosConfig, languageCulture, detailedQuery, fetchFromBase, _yield$fetchFromBase, pricings, properties, _yield$fetchFromBase2, _pricings, _properties;
32082
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
32083
+ while (1) switch (_context2.prev = _context2.next) {
32093
32084
  case 0:
32094
32085
  if (!_this.pricings) {
32095
- _context.next = 4;
32086
+ _context2.next = 3;
32096
32087
  break;
32097
32088
  }
32098
32089
  callback(_this.pricings, _this.properties);
32099
- _context.next = 31;
32100
- break;
32101
- case 4:
32102
- query = {
32103
- name: 'pricingsConfigurationQuery',
32104
- query: "query pricingsQuery($first: Int!, $productID: Long!, $languageCulture: String) {\n pricingProperties { propertyID functionName }\n pricingsDetailed(first: $first, productID: $productID, isForFrontEnd: true, languageCulture: $languageCulture) {\n edges {\n node {\n id\n description\n infoPricingText\n priceDescriptionEnabled\n priceStructure\n products {\n productID\n }\n printTypes {\n printTypeID\n }\n rules {\n ruleID\n propertyID\n allMatchType\n elementID\n elementTitle\n isSetupPrice\n priceType\n\t\t\t\t\t\t\t\t\t\t\t\t\tsimplified\n targets {\n area\n color\n side\n targetID\n }\n conditions {\n conditionID\n formula\n position\n priceToAdd\n quantity\n }\n }\n }\n }\n }\n }",
32105
- variables: {
32106
- first: 50,
32107
- productID: product.get('modelID'),
32108
- languageCulture: _this.config.clientLang
32109
- }
32110
- };
32090
+ return _context2.abrupt("return");
32091
+ case 3:
32092
+ // REST replacement of the legacy GraphQL `pricingsDetailed` + `pricingProperties` query.
32093
+ // Frontend hits the stable REST endpoints to avoid breakage from backoffice GraphQL changes.
32111
32094
  axiosConfig = {
32112
32095
  headers: {
32113
32096
  'Content-Type': 'application/json',
@@ -32119,58 +32102,81 @@ var DesignPriceCalculatorRuleBased = /*#__PURE__*/_createClass(function DesignPr
32119
32102
  } else {
32120
32103
  axiosConfig['headers']['X-Auth-Token'] = _this.config.token;
32121
32104
  }
32122
- requestData = {
32123
- type: 'POST',
32124
- url: Zakeke.config.graphqlUrl,
32125
- data: JSON.stringify(query),
32126
- contentType: 'application/json',
32127
- dataType: 'json'
32128
- };
32129
- if (_this.config.isOwin) {
32130
- requestData['Authorization'] = 'Bearer ' + _this.config.token;
32131
- } else {
32132
- requestData['X-Auth-Token'] = _this.config.token;
32133
- }
32134
- _context.prev = 9;
32135
- if (!(typeof _this.config.cloudFlareApiUrl !== 'undefined' && _this.config.cloudFlareApiUrl !== null && _this.config.cloudFlareApiUrl !== '')) {
32136
- _context.next = 16;
32105
+ languageCulture = (_this.config.clientLang || 'en').split('-')[0] || 'en';
32106
+ detailedQuery = new URLSearchParams({
32107
+ ps: '50',
32108
+ pn: '1',
32109
+ productID: String(product.get('modelID')),
32110
+ isForFrontEnd: 'true',
32111
+ languageCulture: languageCulture
32112
+ }).toString();
32113
+ fetchFromBase = /*#__PURE__*/function () {
32114
+ var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(baseUrl) {
32115
+ var _yield$Promise$all, _yield$Promise$all2, propsRes, detailedRes;
32116
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
32117
+ while (1) switch (_context.prev = _context.next) {
32118
+ case 0:
32119
+ _context.next = 2;
32120
+ return Promise.all([axios__WEBPACK_IMPORTED_MODULE_2__["default"].get(baseUrl + 'pricinggroups/properties', axiosConfig), axios__WEBPACK_IMPORTED_MODULE_2__["default"].get(baseUrl + 'pricinggroups/detailed?' + detailedQuery, axiosConfig)]);
32121
+ case 2:
32122
+ _yield$Promise$all = _context.sent;
32123
+ _yield$Promise$all2 = _slicedToArray(_yield$Promise$all, 2);
32124
+ propsRes = _yield$Promise$all2[0];
32125
+ detailedRes = _yield$Promise$all2[1];
32126
+ return _context.abrupt("return", {
32127
+ pricings: detailedRes.data,
32128
+ properties: propsRes.data
32129
+ });
32130
+ case 7:
32131
+ case "end":
32132
+ return _context.stop();
32133
+ }
32134
+ }, _callee);
32135
+ }));
32136
+ return function fetchFromBase(_x3) {
32137
+ return _ref2.apply(this, arguments);
32138
+ };
32139
+ }();
32140
+ _context2.prev = 8;
32141
+ if (!_this.config.cloudFlareApiUrl) {
32142
+ _context2.next = 17;
32137
32143
  break;
32138
32144
  }
32139
- _context.next = 13;
32140
- return axios__WEBPACK_IMPORTED_MODULE_2__["default"].post(_this.config.cloudFlareApiUrl, query, axiosConfig);
32141
- case 13:
32142
- responseCF = _context.sent;
32143
- callback(responseCF.data.data.pricingsDetailed.edges.map(function (edge) {
32144
- return edge.node;
32145
- }), responseCF.data.data.pricingProperties);
32146
- return _context.abrupt("return");
32147
- case 16:
32148
- _context.next = 21;
32145
+ _context2.next = 12;
32146
+ return fetchFromBase(_this.config.cloudFlareApiUrl);
32147
+ case 12:
32148
+ _yield$fetchFromBase = _context2.sent;
32149
+ pricings = _yield$fetchFromBase.pricings;
32150
+ properties = _yield$fetchFromBase.properties;
32151
+ callback(pricings, properties);
32152
+ return _context2.abrupt("return");
32153
+ case 17:
32154
+ _context2.next = 22;
32149
32155
  break;
32150
- case 18:
32151
- _context.prev = 18;
32152
- _context.t0 = _context["catch"](9);
32153
- console.error('Error in CloudFlare API', _context.t0);
32154
- case 21:
32155
- _context.prev = 21;
32156
- _context.next = 24;
32157
- return axios__WEBPACK_IMPORTED_MODULE_2__["default"].post(Zakeke.config.graphqlUrl, query, axiosConfig);
32158
- case 24:
32159
- response = _context.sent;
32160
- callback(response.data.data.pricingsDetailed.edges.map(function (edge) {
32161
- return edge.node;
32162
- }), response.data.data.pricingProperties);
32163
- _context.next = 31;
32156
+ case 19:
32157
+ _context2.prev = 19;
32158
+ _context2.t0 = _context2["catch"](8);
32159
+ console.error('Error in CloudFlare API', _context2.t0);
32160
+ case 22:
32161
+ _context2.prev = 22;
32162
+ _context2.next = 25;
32163
+ return fetchFromBase(_this.config.apiUrl);
32164
+ case 25:
32165
+ _yield$fetchFromBase2 = _context2.sent;
32166
+ _pricings = _yield$fetchFromBase2.pricings;
32167
+ _properties = _yield$fetchFromBase2.properties;
32168
+ callback(_pricings, _properties);
32169
+ _context2.next = 34;
32164
32170
  break;
32165
- case 28:
32166
- _context.prev = 28;
32167
- _context.t1 = _context["catch"](21);
32168
- console.error('Error in API', _context.t1);
32169
32171
  case 31:
32172
+ _context2.prev = 31;
32173
+ _context2.t1 = _context2["catch"](22);
32174
+ console.error('Error in API', _context2.t1);
32175
+ case 34:
32170
32176
  case "end":
32171
- return _context.stop();
32177
+ return _context2.stop();
32172
32178
  }
32173
- }, _callee, null, [[9, 18], [21, 28]]);
32179
+ }, _callee2, null, [[8, 19], [22, 31]]);
32174
32180
  }));
32175
32181
  return function (_x, _x2) {
32176
32182
  return _ref.apply(this, arguments);
@@ -32217,10 +32223,10 @@ var DesignPriceCalculatorRuleBased = /*#__PURE__*/_createClass(function DesignPr
32217
32223
  });
32218
32224
  })) || null];
32219
32225
  })];
32220
- notRegroupedPricingAndSideIDs[0].forEach(function (_ref2) {
32221
- var _ref3 = _slicedToArray(_ref2, 2),
32222
- sideID = _ref3[0],
32223
- pricing = _ref3[1];
32226
+ notRegroupedPricingAndSideIDs[0].forEach(function (_ref3) {
32227
+ var _ref4 = _slicedToArray(_ref3, 2),
32228
+ sideID = _ref4[0],
32229
+ pricing = _ref4[1];
32224
32230
  if (!pricingSidesMapping.get(pricing)) pricingSidesMapping.set(pricing, [sideID]);else {
32225
32231
  var value = pricingSidesMapping.get(pricing);
32226
32232
  value.push(sideID);
@@ -33143,10 +33149,10 @@ var DesignPriceCalculatorRuleBased = /*#__PURE__*/_createClass(function DesignPr
33143
33149
  priceStructure: pricing.priceStructure
33144
33150
  };
33145
33151
  });
33146
- if (apiUrl !== undefined) this.config.apiUrl = apiUrl + 'graphql';
33152
+ if (apiUrl !== undefined) this.config.apiUrl = apiUrl;
33147
33153
  if (token !== undefined) this.config.token = token;
33148
33154
  if (isOwin !== undefined) this.config.isOwin = isOwin;
33149
- if (cloudFlareApiUrl) this.config.cloudFlareApiUrl = cloudFlareApiUrl + 'graphql';
33155
+ if (cloudFlareApiUrl) this.config.cloudFlareApiUrl = cloudFlareApiUrl;
33150
33156
  if (clientLang) this.config.clientLang = clientLang;
33151
33157
  });
33152
33158
 
@@ -108121,7 +108127,10 @@ const Lg = class pl extends ku {
108121
108127
  const s = this.getMeshByID(e);
108122
108128
  if (s) {
108123
108129
  let o = null;
108124
- t && typeof t == "number" && !isNaN(t) && (n === "width" ? o = { width: t } : n === "height" ? o = { height: t } : n === "depth" && (o = { depth: t })), s.metadata || (s.metadata = {}), s.metadata.sizecm = o;
108130
+ if (t && typeof t == "number" && !isNaN(t) && (n === "width" ? o = { width: t } : n === "height" ? o = { height: t } : n === "depth" && (o = { depth: t })), this._scene)
108131
+ for (const h of this._scene.meshes)
108132
+ h !== s && h.metadata && h.metadata.sizecm && (h.metadata.sizecm = null);
108133
+ s.metadata || (s.metadata = {}), s.metadata.sizecm = o;
108125
108134
  }
108126
108135
  }
108127
108136
  getMeshWidthCm(e) {