@bonlineza/luxity-lib 2.36.1-uk-platform.1 → 2.36.2

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 (94) hide show
  1. package/Accordion.js +116 -76
  2. package/AddInterest.js +777 -440
  3. package/AddProductInterest.js +644 -485
  4. package/BrandSelector.js +336 -176
  5. package/Checkbox.js +101 -68
  6. package/CheckboxButton.js +124 -79
  7. package/CommunicationPreferenceOptionsRenderer.js +169 -159
  8. package/CommunicationPreferenceSection.js +178 -166
  9. package/CommunicationPreferences.js +427 -549
  10. package/ConditionSelector.js +336 -174
  11. package/CountryCodeSelect.js +10 -7
  12. package/CurrencyInputFormatter.js +56 -29
  13. package/CurrencySelect.js +49 -23
  14. package/DropdownSelector.js +92 -68
  15. package/GALink.js +16 -6
  16. package/GenderSelector.js +142 -88
  17. package/GraphQLDropdownSelector.js +1508 -929
  18. package/GraphQLMultiSelector.js +274 -141
  19. package/IconHeader.js +25 -11
  20. package/IconWrapper.js +7 -3
  21. package/InterestCatSelector.js +74 -34
  22. package/InterestItem.js +187 -103
  23. package/Interests.js +1463 -913
  24. package/InterestsSubheading.js +10 -5
  25. package/InvertedTextButton.js +63 -27
  26. package/LuxityAppSideNav.js +21 -18
  27. package/LuxityDesktopHeader.js +451 -298
  28. package/LuxityFooter.js +321 -430
  29. package/LuxityGraphQLDropdownSelector.js +1540 -945
  30. package/LuxityGraphQLMultiselector.js +321 -167
  31. package/LuxityMobileHeader.js +544 -353
  32. package/LuxityPageReady.js +136 -74
  33. package/LuxityProductInterestItem.js +175 -97
  34. package/LuxitySideNav.js +244 -176
  35. package/MaterialSelector.js +1547 -951
  36. package/ModelSelector.js +1547 -951
  37. package/NotificationDropDown.js +218 -118
  38. package/Notify.js +1 -0
  39. package/OutlinePrimaryButton.js +58 -26
  40. package/PriceRangeSelector.js +281 -168
  41. package/PrimaryButton.js +58 -26
  42. package/RadioButtons.js +140 -114
  43. package/RangeSlider.js +242 -152
  44. package/RareStepFooter.js +41 -27
  45. package/RareStepHeader.js +190 -139
  46. package/ReactSelectWrapper.js +1 -0
  47. package/SecondaryButton.js +58 -26
  48. package/ShoeSizeRangeSelector.js +260 -162
  49. package/ShoeSizeSelector.js +263 -158
  50. package/SimpleErrorBoundary.js +106 -59
  51. package/StyleSelector.js +336 -176
  52. package/TestComponent.js +15 -0
  53. package/TextButton.js +58 -26
  54. package/Tooltip.js +39 -17
  55. package/Tracking.js +1 -0
  56. package/WrapperButton.js +43 -20
  57. package/build/CountryCodeSelect/index.js +18 -0
  58. package/build/ReactSelectWrapper/index.js +34 -0
  59. package/build/bundle.css +1 -1
  60. package/build/bundle.js +2616 -1974
  61. package/package.json +1 -1
  62. package/postcss.config.js +6 -0
  63. package/svg/Accessories.js +13 -6
  64. package/svg/Account.js +13 -6
  65. package/svg/Add.js +13 -6
  66. package/svg/ArrowRight.js +13 -6
  67. package/svg/Bags.js +13 -6
  68. package/svg/BurgerMenu.js +13 -6
  69. package/svg/Calendar.js +13 -6
  70. package/svg/CalendarCircled.js +13 -6
  71. package/svg/CheckCircled.js +13 -6
  72. package/svg/Close.js +13 -6
  73. package/svg/Clothing.js +13 -6
  74. package/svg/Dot.js +13 -6
  75. package/svg/Edit.js +13 -6
  76. package/svg/Eye.js +13 -6
  77. package/svg/FileAttach.js +13 -6
  78. package/svg/FileAttachCircled.js +13 -6
  79. package/svg/LightBulb.js +13 -6
  80. package/svg/Logo.js +13 -6
  81. package/svg/LuxityMenu.js +13 -6
  82. package/svg/Minus.js +13 -6
  83. package/svg/MobileAvatar.js +13 -6
  84. package/svg/MyOrder.js +13 -6
  85. package/svg/MyPayment.js +13 -6
  86. package/svg/MyProfile.js +14 -8
  87. package/svg/MySale.js +13 -6
  88. package/svg/Notification.js +13 -6
  89. package/svg/PointerDown.js +13 -6
  90. package/svg/Search.js +13 -6
  91. package/svg/Shoes.js +13 -6
  92. package/svg/SvgWrapper.js +7 -3
  93. package/svg/Trash.js +13 -6
  94. package/svg/Watches.js +13 -6
@@ -14,462 +14,555 @@
14
14
  raf = raf && Object.prototype.hasOwnProperty.call(raf, 'default') ? raf['default'] : raf;
15
15
  AutosizeInput = AutosizeInput && Object.prototype.hasOwnProperty.call(AutosizeInput, 'default') ? AutosizeInput['default'] : AutosizeInput;
16
16
 
17
- function _arrayLikeToArray(r, a) {
18
- (null == a || a > r.length) && (a = r.length);
19
- for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
20
- return n;
21
- }
22
- function _arrayWithHoles(r) {
23
- if (Array.isArray(r)) return r;
24
- }
25
- function asyncGeneratorStep(n, t, e, r, o, a, c) {
26
- try {
27
- var i = n[a](c),
28
- u = i.value;
29
- } catch (n) {
30
- return void e(n);
31
- }
32
- i.done ? t(u) : Promise.resolve(u).then(r, o);
33
- }
34
- function _asyncToGenerator(n) {
35
- return function () {
36
- var t = this,
37
- e = arguments;
38
- return new Promise(function (r, o) {
39
- var a = n.apply(t, e);
40
- function _next(n) {
41
- asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
42
- }
43
- function _throw(n) {
44
- asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
45
- }
46
- _next(void 0);
47
- });
48
- };
49
- }
50
- function _defineProperty(e, r, t) {
51
- return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
52
- value: t,
53
- enumerable: !0,
54
- configurable: !0,
55
- writable: !0
56
- }) : e[r] = t, e;
57
- }
58
- function _extends() {
59
- return _extends = Object.assign ? Object.assign.bind() : function (n) {
60
- for (var e = 1; e < arguments.length; e++) {
61
- var t = arguments[e];
62
- for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
63
- }
64
- return n;
65
- }, _extends.apply(null, arguments);
66
- }
67
- function _iterableToArrayLimit(r, l) {
68
- var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
69
- if (null != t) {
70
- var e,
71
- n,
72
- i,
73
- u,
74
- a = [],
75
- f = !0,
76
- o = !1;
77
- try {
78
- if (i = (t = t.call(r)).next, 0 === l) {
79
- if (Object(t) !== t) return;
80
- f = !1;
81
- } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
82
- } catch (r) {
83
- o = !0, n = r;
84
- } finally {
85
- try {
86
- if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
87
- } finally {
88
- if (o) throw n;
89
- }
90
- }
91
- return a;
92
- }
93
- }
94
- function _nonIterableRest() {
95
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
96
- }
97
- function ownKeys(e, r) {
98
- var t = Object.keys(e);
17
+ function ownKeys(object, enumerableOnly) {
18
+ var keys = Object.keys(object);
19
+
99
20
  if (Object.getOwnPropertySymbols) {
100
- var o = Object.getOwnPropertySymbols(e);
101
- r && (o = o.filter(function (r) {
102
- return Object.getOwnPropertyDescriptor(e, r).enumerable;
103
- })), t.push.apply(t, o);
21
+ var symbols = Object.getOwnPropertySymbols(object);
22
+ enumerableOnly && (symbols = symbols.filter(function (sym) {
23
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
24
+ })), keys.push.apply(keys, symbols);
104
25
  }
105
- return t;
26
+
27
+ return keys;
106
28
  }
107
- function _objectSpread2(e) {
108
- for (var r = 1; r < arguments.length; r++) {
109
- var t = null != arguments[r] ? arguments[r] : {};
110
- r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
111
- _defineProperty(e, r, t[r]);
112
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
113
- Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
29
+
30
+ function _objectSpread2(target) {
31
+ for (var i = 1; i < arguments.length; i++) {
32
+ var source = null != arguments[i] ? arguments[i] : {};
33
+ i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
34
+ _defineProperty(target, key, source[key]);
35
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
36
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
114
37
  });
115
38
  }
116
- return e;
117
- }
118
- function _objectWithoutProperties(e, t) {
119
- if (null == e) return {};
120
- var o,
121
- r,
122
- i = _objectWithoutPropertiesLoose(e, t);
123
- if (Object.getOwnPropertySymbols) {
124
- var n = Object.getOwnPropertySymbols(e);
125
- for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
126
- }
127
- return i;
128
- }
129
- function _objectWithoutPropertiesLoose(r, e) {
130
- if (null == r) return {};
131
- var t = {};
132
- for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
133
- if (-1 !== e.indexOf(n)) continue;
134
- t[n] = r[n];
135
- }
136
- return t;
39
+
40
+ return target;
137
41
  }
42
+
138
43
  function _regeneratorRuntime() {
44
+ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
45
+
139
46
  _regeneratorRuntime = function () {
140
- return e;
47
+ return exports;
141
48
  };
142
- var t,
143
- e = {},
144
- r = Object.prototype,
145
- n = r.hasOwnProperty,
146
- o = Object.defineProperty || function (t, e, r) {
147
- t[e] = r.value;
148
- },
149
- i = "function" == typeof Symbol ? Symbol : {},
150
- a = i.iterator || "@@iterator",
151
- c = i.asyncIterator || "@@asyncIterator",
152
- u = i.toStringTag || "@@toStringTag";
153
- function define(t, e, r) {
154
- return Object.defineProperty(t, e, {
155
- value: r,
49
+
50
+ var exports = {},
51
+ Op = Object.prototype,
52
+ hasOwn = Op.hasOwnProperty,
53
+ $Symbol = "function" == typeof Symbol ? Symbol : {},
54
+ iteratorSymbol = $Symbol.iterator || "@@iterator",
55
+ asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
56
+ toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
57
+
58
+ function define(obj, key, value) {
59
+ return Object.defineProperty(obj, key, {
60
+ value: value,
156
61
  enumerable: !0,
157
62
  configurable: !0,
158
63
  writable: !0
159
- }), t[e];
64
+ }), obj[key];
160
65
  }
66
+
161
67
  try {
162
68
  define({}, "");
163
- } catch (t) {
164
- define = function (t, e, r) {
165
- return t[e] = r;
69
+ } catch (err) {
70
+ define = function (obj, key, value) {
71
+ return obj[key] = value;
166
72
  };
167
73
  }
168
- function wrap(t, e, r, n) {
169
- var i = e && e.prototype instanceof Generator ? e : Generator,
170
- a = Object.create(i.prototype),
171
- c = new Context(n || []);
172
- return o(a, "_invoke", {
173
- value: makeInvokeMethod(t, r, c)
174
- }), a;
74
+
75
+ function wrap(innerFn, outerFn, self, tryLocsList) {
76
+ var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
77
+ generator = Object.create(protoGenerator.prototype),
78
+ context = new Context(tryLocsList || []);
79
+ return generator._invoke = function (innerFn, self, context) {
80
+ var state = "suspendedStart";
81
+ return function (method, arg) {
82
+ if ("executing" === state) throw new Error("Generator is already running");
83
+
84
+ if ("completed" === state) {
85
+ if ("throw" === method) throw arg;
86
+ return doneResult();
87
+ }
88
+
89
+ for (context.method = method, context.arg = arg;;) {
90
+ var delegate = context.delegate;
91
+
92
+ if (delegate) {
93
+ var delegateResult = maybeInvokeDelegate(delegate, context);
94
+
95
+ if (delegateResult) {
96
+ if (delegateResult === ContinueSentinel) continue;
97
+ return delegateResult;
98
+ }
99
+ }
100
+
101
+ if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
102
+ if ("suspendedStart" === state) throw state = "completed", context.arg;
103
+ context.dispatchException(context.arg);
104
+ } else "return" === context.method && context.abrupt("return", context.arg);
105
+ state = "executing";
106
+ var record = tryCatch(innerFn, self, context);
107
+
108
+ if ("normal" === record.type) {
109
+ if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
110
+ return {
111
+ value: record.arg,
112
+ done: context.done
113
+ };
114
+ }
115
+
116
+ "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
117
+ }
118
+ };
119
+ }(innerFn, self, context), generator;
175
120
  }
176
- function tryCatch(t, e, r) {
121
+
122
+ function tryCatch(fn, obj, arg) {
177
123
  try {
178
124
  return {
179
125
  type: "normal",
180
- arg: t.call(e, r)
126
+ arg: fn.call(obj, arg)
181
127
  };
182
- } catch (t) {
128
+ } catch (err) {
183
129
  return {
184
130
  type: "throw",
185
- arg: t
131
+ arg: err
186
132
  };
187
133
  }
188
134
  }
189
- e.wrap = wrap;
190
- var h = "suspendedStart",
191
- l = "suspendedYield",
192
- f = "executing",
193
- s = "completed",
194
- y = {};
135
+
136
+ exports.wrap = wrap;
137
+ var ContinueSentinel = {};
138
+
195
139
  function Generator() {}
140
+
196
141
  function GeneratorFunction() {}
142
+
197
143
  function GeneratorFunctionPrototype() {}
198
- var p = {};
199
- define(p, a, function () {
144
+
145
+ var IteratorPrototype = {};
146
+ define(IteratorPrototype, iteratorSymbol, function () {
200
147
  return this;
201
148
  });
202
- var d = Object.getPrototypeOf,
203
- v = d && d(d(values([])));
204
- v && v !== r && n.call(v, a) && (p = v);
205
- var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
206
- function defineIteratorMethods(t) {
207
- ["next", "throw", "return"].forEach(function (e) {
208
- define(t, e, function (t) {
209
- return this._invoke(e, t);
149
+ var getProto = Object.getPrototypeOf,
150
+ NativeIteratorPrototype = getProto && getProto(getProto(values([])));
151
+ NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
152
+ var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
153
+
154
+ function defineIteratorMethods(prototype) {
155
+ ["next", "throw", "return"].forEach(function (method) {
156
+ define(prototype, method, function (arg) {
157
+ return this._invoke(method, arg);
210
158
  });
211
159
  });
212
160
  }
213
- function AsyncIterator(t, e) {
214
- function invoke(r, o, i, a) {
215
- var c = tryCatch(t[r], t, o);
216
- if ("throw" !== c.type) {
217
- var u = c.arg,
218
- h = u.value;
219
- return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
220
- invoke("next", t, i, a);
221
- }, function (t) {
222
- invoke("throw", t, i, a);
223
- }) : e.resolve(h).then(function (t) {
224
- u.value = t, i(u);
225
- }, function (t) {
226
- return invoke("throw", t, i, a);
161
+
162
+ function AsyncIterator(generator, PromiseImpl) {
163
+ function invoke(method, arg, resolve, reject) {
164
+ var record = tryCatch(generator[method], generator, arg);
165
+
166
+ if ("throw" !== record.type) {
167
+ var result = record.arg,
168
+ value = result.value;
169
+ return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
170
+ invoke("next", value, resolve, reject);
171
+ }, function (err) {
172
+ invoke("throw", err, resolve, reject);
173
+ }) : PromiseImpl.resolve(value).then(function (unwrapped) {
174
+ result.value = unwrapped, resolve(result);
175
+ }, function (error) {
176
+ return invoke("throw", error, resolve, reject);
227
177
  });
228
178
  }
229
- a(c.arg);
230
- }
231
- var r;
232
- o(this, "_invoke", {
233
- value: function (t, n) {
234
- function callInvokeWithMethodAndArg() {
235
- return new e(function (e, r) {
236
- invoke(t, n, e, r);
237
- });
238
- }
239
- return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
240
- }
241
- });
242
- }
243
- function makeInvokeMethod(e, r, n) {
244
- var o = h;
245
- return function (i, a) {
246
- if (o === f) throw Error("Generator is already running");
247
- if (o === s) {
248
- if ("throw" === i) throw a;
249
- return {
250
- value: t,
251
- done: !0
252
- };
253
- }
254
- for (n.method = i, n.arg = a;;) {
255
- var c = n.delegate;
256
- if (c) {
257
- var u = maybeInvokeDelegate(c, n);
258
- if (u) {
259
- if (u === y) continue;
260
- return u;
261
- }
262
- }
263
- if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
264
- if (o === h) throw o = s, n.arg;
265
- n.dispatchException(n.arg);
266
- } else "return" === n.method && n.abrupt("return", n.arg);
267
- o = f;
268
- var p = tryCatch(e, r, n);
269
- if ("normal" === p.type) {
270
- if (o = n.done ? s : l, p.arg === y) continue;
271
- return {
272
- value: p.arg,
273
- done: n.done
274
- };
275
- }
276
- "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
179
+
180
+ reject(record.arg);
181
+ }
182
+
183
+ var previousPromise;
184
+
185
+ this._invoke = function (method, arg) {
186
+ function callInvokeWithMethodAndArg() {
187
+ return new PromiseImpl(function (resolve, reject) {
188
+ invoke(method, arg, resolve, reject);
189
+ });
277
190
  }
191
+
192
+ return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
278
193
  };
279
194
  }
280
- function maybeInvokeDelegate(e, r) {
281
- var n = r.method,
282
- o = e.iterator[n];
283
- 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;
284
- var i = tryCatch(o, e.iterator, r.arg);
285
- if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
286
- var a = i.arg;
287
- 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);
195
+
196
+ function maybeInvokeDelegate(delegate, context) {
197
+ var method = delegate.iterator[context.method];
198
+
199
+ if (undefined === method) {
200
+ if (context.delegate = null, "throw" === context.method) {
201
+ if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
202
+ context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
203
+ }
204
+
205
+ return ContinueSentinel;
206
+ }
207
+
208
+ var record = tryCatch(method, delegate.iterator, context.arg);
209
+ if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
210
+ var info = record.arg;
211
+ return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
288
212
  }
289
- function pushTryEntry(t) {
290
- var e = {
291
- tryLoc: t[0]
213
+
214
+ function pushTryEntry(locs) {
215
+ var entry = {
216
+ tryLoc: locs[0]
292
217
  };
293
- 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
218
+ 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
294
219
  }
295
- function resetTryEntry(t) {
296
- var e = t.completion || {};
297
- e.type = "normal", delete e.arg, t.completion = e;
220
+
221
+ function resetTryEntry(entry) {
222
+ var record = entry.completion || {};
223
+ record.type = "normal", delete record.arg, entry.completion = record;
298
224
  }
299
- function Context(t) {
225
+
226
+ function Context(tryLocsList) {
300
227
  this.tryEntries = [{
301
228
  tryLoc: "root"
302
- }], t.forEach(pushTryEntry, this), this.reset(!0);
229
+ }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
303
230
  }
304
- function values(e) {
305
- if (e || "" === e) {
306
- var r = e[a];
307
- if (r) return r.call(e);
308
- if ("function" == typeof e.next) return e;
309
- if (!isNaN(e.length)) {
310
- var o = -1,
311
- i = function next() {
312
- for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
313
- return next.value = t, next.done = !0, next;
314
- };
315
- return i.next = i;
231
+
232
+ function values(iterable) {
233
+ if (iterable) {
234
+ var iteratorMethod = iterable[iteratorSymbol];
235
+ if (iteratorMethod) return iteratorMethod.call(iterable);
236
+ if ("function" == typeof iterable.next) return iterable;
237
+
238
+ if (!isNaN(iterable.length)) {
239
+ var i = -1,
240
+ next = function next() {
241
+ for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
242
+
243
+ return next.value = undefined, next.done = !0, next;
244
+ };
245
+
246
+ return next.next = next;
316
247
  }
317
248
  }
318
- throw new TypeError(typeof e + " is not iterable");
249
+
250
+ return {
251
+ next: doneResult
252
+ };
253
+ }
254
+
255
+ function doneResult() {
256
+ return {
257
+ value: undefined,
258
+ done: !0
259
+ };
319
260
  }
320
- return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
321
- value: GeneratorFunctionPrototype,
322
- configurable: !0
323
- }), o(GeneratorFunctionPrototype, "constructor", {
324
- value: GeneratorFunction,
325
- configurable: !0
326
- }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
327
- var e = "function" == typeof t && t.constructor;
328
- return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
329
- }, e.mark = function (t) {
330
- return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
331
- }, e.awrap = function (t) {
261
+
262
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
263
+ var ctor = "function" == typeof genFun && genFun.constructor;
264
+ return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
265
+ }, exports.mark = function (genFun) {
266
+ return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
267
+ }, exports.awrap = function (arg) {
332
268
  return {
333
- __await: t
269
+ __await: arg
334
270
  };
335
- }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
271
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
336
272
  return this;
337
- }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
338
- void 0 === i && (i = Promise);
339
- var a = new AsyncIterator(wrap(t, r, n, o), i);
340
- return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
341
- return t.done ? t.value : a.next();
273
+ }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
274
+ void 0 === PromiseImpl && (PromiseImpl = Promise);
275
+ var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
276
+ return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
277
+ return result.done ? result.value : iter.next();
342
278
  });
343
- }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
279
+ }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
344
280
  return this;
345
- }), define(g, "toString", function () {
281
+ }), define(Gp, "toString", function () {
346
282
  return "[object Generator]";
347
- }), e.keys = function (t) {
348
- var e = Object(t),
349
- r = [];
350
- for (var n in e) r.push(n);
351
- return r.reverse(), function next() {
352
- for (; r.length;) {
353
- var t = r.pop();
354
- if (t in e) return next.value = t, next.done = !1, next;
283
+ }), exports.keys = function (object) {
284
+ var keys = [];
285
+
286
+ for (var key in object) keys.push(key);
287
+
288
+ return keys.reverse(), function next() {
289
+ for (; keys.length;) {
290
+ var key = keys.pop();
291
+ if (key in object) return next.value = key, next.done = !1, next;
355
292
  }
293
+
356
294
  return next.done = !0, next;
357
295
  };
358
- }, e.values = values, Context.prototype = {
296
+ }, exports.values = values, Context.prototype = {
359
297
  constructor: Context,
360
- reset: function (e) {
361
- 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);
298
+ reset: function (skipTempReset) {
299
+ if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
362
300
  },
363
301
  stop: function () {
364
302
  this.done = !0;
365
- var t = this.tryEntries[0].completion;
366
- if ("throw" === t.type) throw t.arg;
303
+ var rootRecord = this.tryEntries[0].completion;
304
+ if ("throw" === rootRecord.type) throw rootRecord.arg;
367
305
  return this.rval;
368
306
  },
369
- dispatchException: function (e) {
370
- if (this.done) throw e;
371
- var r = this;
372
- function handle(n, o) {
373
- return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
307
+ dispatchException: function (exception) {
308
+ if (this.done) throw exception;
309
+ var context = this;
310
+
311
+ function handle(loc, caught) {
312
+ return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
374
313
  }
375
- for (var o = this.tryEntries.length - 1; o >= 0; --o) {
376
- var i = this.tryEntries[o],
377
- a = i.completion;
378
- if ("root" === i.tryLoc) return handle("end");
379
- if (i.tryLoc <= this.prev) {
380
- var c = n.call(i, "catchLoc"),
381
- u = n.call(i, "finallyLoc");
382
- if (c && u) {
383
- if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
384
- if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
385
- } else if (c) {
386
- if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
314
+
315
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
316
+ var entry = this.tryEntries[i],
317
+ record = entry.completion;
318
+ if ("root" === entry.tryLoc) return handle("end");
319
+
320
+ if (entry.tryLoc <= this.prev) {
321
+ var hasCatch = hasOwn.call(entry, "catchLoc"),
322
+ hasFinally = hasOwn.call(entry, "finallyLoc");
323
+
324
+ if (hasCatch && hasFinally) {
325
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
326
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
327
+ } else if (hasCatch) {
328
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
387
329
  } else {
388
- if (!u) throw Error("try statement without catch or finally");
389
- if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
330
+ if (!hasFinally) throw new Error("try statement without catch or finally");
331
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
390
332
  }
391
333
  }
392
334
  }
393
335
  },
394
- abrupt: function (t, e) {
395
- for (var r = this.tryEntries.length - 1; r >= 0; --r) {
396
- var o = this.tryEntries[r];
397
- if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
398
- var i = o;
336
+ abrupt: function (type, arg) {
337
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
338
+ var entry = this.tryEntries[i];
339
+
340
+ if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
341
+ var finallyEntry = entry;
399
342
  break;
400
343
  }
401
344
  }
402
- i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
403
- var a = i ? i.completion : {};
404
- return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
345
+
346
+ finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
347
+ var record = finallyEntry ? finallyEntry.completion : {};
348
+ return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
405
349
  },
406
- complete: function (t, e) {
407
- if ("throw" === t.type) throw t.arg;
408
- 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;
350
+ complete: function (record, afterLoc) {
351
+ if ("throw" === record.type) throw record.arg;
352
+ return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
409
353
  },
410
- finish: function (t) {
411
- for (var e = this.tryEntries.length - 1; e >= 0; --e) {
412
- var r = this.tryEntries[e];
413
- if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
354
+ finish: function (finallyLoc) {
355
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
356
+ var entry = this.tryEntries[i];
357
+ if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
414
358
  }
415
359
  },
416
- catch: function (t) {
417
- for (var e = this.tryEntries.length - 1; e >= 0; --e) {
418
- var r = this.tryEntries[e];
419
- if (r.tryLoc === t) {
420
- var n = r.completion;
421
- if ("throw" === n.type) {
422
- var o = n.arg;
423
- resetTryEntry(r);
360
+ catch: function (tryLoc) {
361
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
362
+ var entry = this.tryEntries[i];
363
+
364
+ if (entry.tryLoc === tryLoc) {
365
+ var record = entry.completion;
366
+
367
+ if ("throw" === record.type) {
368
+ var thrown = record.arg;
369
+ resetTryEntry(entry);
424
370
  }
425
- return o;
371
+
372
+ return thrown;
426
373
  }
427
374
  }
428
- throw Error("illegal catch attempt");
375
+
376
+ throw new Error("illegal catch attempt");
429
377
  },
430
- delegateYield: function (e, r, n) {
378
+ delegateYield: function (iterable, resultName, nextLoc) {
431
379
  return this.delegate = {
432
- iterator: values(e),
433
- resultName: r,
434
- nextLoc: n
435
- }, "next" === this.method && (this.arg = t), y;
380
+ iterator: values(iterable),
381
+ resultName: resultName,
382
+ nextLoc: nextLoc
383
+ }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
436
384
  }
437
- }, e;
385
+ }, exports;
438
386
  }
439
- function _slicedToArray(r, e) {
440
- return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
387
+
388
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
389
+ try {
390
+ var info = gen[key](arg);
391
+ var value = info.value;
392
+ } catch (error) {
393
+ reject(error);
394
+ return;
395
+ }
396
+
397
+ if (info.done) {
398
+ resolve(value);
399
+ } else {
400
+ Promise.resolve(value).then(_next, _throw);
401
+ }
441
402
  }
442
- function _taggedTemplateLiteral(e, t) {
443
- return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, {
403
+
404
+ function _asyncToGenerator(fn) {
405
+ return function () {
406
+ var self = this,
407
+ args = arguments;
408
+ return new Promise(function (resolve, reject) {
409
+ var gen = fn.apply(self, args);
410
+
411
+ function _next(value) {
412
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
413
+ }
414
+
415
+ function _throw(err) {
416
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
417
+ }
418
+
419
+ _next(undefined);
420
+ });
421
+ };
422
+ }
423
+
424
+ function _defineProperty(obj, key, value) {
425
+ if (key in obj) {
426
+ Object.defineProperty(obj, key, {
427
+ value: value,
428
+ enumerable: true,
429
+ configurable: true,
430
+ writable: true
431
+ });
432
+ } else {
433
+ obj[key] = value;
434
+ }
435
+
436
+ return obj;
437
+ }
438
+
439
+ function _extends() {
440
+ _extends = Object.assign ? Object.assign.bind() : function (target) {
441
+ for (var i = 1; i < arguments.length; i++) {
442
+ var source = arguments[i];
443
+
444
+ for (var key in source) {
445
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
446
+ target[key] = source[key];
447
+ }
448
+ }
449
+ }
450
+
451
+ return target;
452
+ };
453
+ return _extends.apply(this, arguments);
454
+ }
455
+
456
+ function _objectWithoutPropertiesLoose(source, excluded) {
457
+ if (source == null) return {};
458
+ var target = {};
459
+ var sourceKeys = Object.keys(source);
460
+ var key, i;
461
+
462
+ for (i = 0; i < sourceKeys.length; i++) {
463
+ key = sourceKeys[i];
464
+ if (excluded.indexOf(key) >= 0) continue;
465
+ target[key] = source[key];
466
+ }
467
+
468
+ return target;
469
+ }
470
+
471
+ function _objectWithoutProperties(source, excluded) {
472
+ if (source == null) return {};
473
+
474
+ var target = _objectWithoutPropertiesLoose(source, excluded);
475
+
476
+ var key, i;
477
+
478
+ if (Object.getOwnPropertySymbols) {
479
+ var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
480
+
481
+ for (i = 0; i < sourceSymbolKeys.length; i++) {
482
+ key = sourceSymbolKeys[i];
483
+ if (excluded.indexOf(key) >= 0) continue;
484
+ if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
485
+ target[key] = source[key];
486
+ }
487
+ }
488
+
489
+ return target;
490
+ }
491
+
492
+ function _taggedTemplateLiteral(strings, raw) {
493
+ if (!raw) {
494
+ raw = strings.slice(0);
495
+ }
496
+
497
+ return Object.freeze(Object.defineProperties(strings, {
444
498
  raw: {
445
- value: Object.freeze(t)
499
+ value: Object.freeze(raw)
446
500
  }
447
501
  }));
448
502
  }
449
- function _toPrimitive(t, r) {
450
- if ("object" != typeof t || !t) return t;
451
- var e = t[Symbol.toPrimitive];
452
- if (void 0 !== e) {
453
- var i = e.call(t, r || "default");
454
- if ("object" != typeof i) return i;
455
- throw new TypeError("@@toPrimitive must return a primitive value.");
456
- }
457
- return ("string" === r ? String : Number)(t);
503
+
504
+ function _slicedToArray(arr, i) {
505
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
458
506
  }
459
- function _toPropertyKey(t) {
460
- var i = _toPrimitive(t, "string");
461
- return "symbol" == typeof i ? i : i + "";
507
+
508
+ function _arrayWithHoles(arr) {
509
+ if (Array.isArray(arr)) return arr;
462
510
  }
463
- function _unsupportedIterableToArray(r, a) {
464
- if (r) {
465
- if ("string" == typeof r) return _arrayLikeToArray(r, a);
466
- var t = {}.toString.call(r).slice(8, -1);
467
- 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;
511
+
512
+ function _iterableToArrayLimit(arr, i) {
513
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
514
+
515
+ if (_i == null) return;
516
+ var _arr = [];
517
+ var _n = true;
518
+ var _d = false;
519
+
520
+ var _s, _e;
521
+
522
+ try {
523
+ for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
524
+ _arr.push(_s.value);
525
+
526
+ if (i && _arr.length === i) break;
527
+ }
528
+ } catch (err) {
529
+ _d = true;
530
+ _e = err;
531
+ } finally {
532
+ try {
533
+ if (!_n && _i["return"] != null) _i["return"]();
534
+ } finally {
535
+ if (_d) throw _e;
536
+ }
468
537
  }
538
+
539
+ return _arr;
540
+ }
541
+
542
+ function _unsupportedIterableToArray(o, minLen) {
543
+ if (!o) return;
544
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
545
+ var n = Object.prototype.toString.call(o).slice(8, -1);
546
+ if (n === "Object" && o.constructor) n = o.constructor.name;
547
+ if (n === "Map" || n === "Set") return Array.from(o);
548
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
549
+ }
550
+
551
+ function _arrayLikeToArray(arr, len) {
552
+ if (len == null || len > arr.length) len = arr.length;
553
+
554
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
555
+
556
+ return arr2;
557
+ }
558
+
559
+ function _nonIterableRest() {
560
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
469
561
  }
470
562
 
471
563
  function getToken() {
472
564
  var _Cookies$get;
565
+
473
566
  return (_Cookies$get = Cookies.get('_tk')) === null || _Cookies$get === void 0 ? void 0 : _Cookies$get.replace('*', 'Bearer ');
474
567
  }
475
568
  function setToken(value) {
@@ -477,29 +570,35 @@
477
570
  }
478
571
 
479
572
  /** @format */
573
+
480
574
  function getEncodedSearch(currentUrl) {
481
575
  var splitUrl = currentUrl.split('?');
482
576
  var baseUrl = splitUrl[0];
483
577
  var nextUrlSegments = splitUrl[1].split('&');
484
578
  var nextQueryString = splitUrl[1];
579
+
485
580
  if (nextUrlSegments.length > 0) {
486
581
  nextQueryString = nextUrlSegments.map(function (v) {
487
582
  var nextValue = v;
583
+
488
584
  if (v.includes('search=')) {
489
585
  var temp = v.split('=');
490
586
  nextValue = "".concat(temp[0], "=").concat(encodeURIComponent(temp[1]));
491
587
  }
588
+
492
589
  return nextValue;
493
590
  }).join('&');
494
591
  }
592
+
495
593
  return "".concat(baseUrl, "?").concat(nextQueryString);
496
594
  }
497
-
498
595
  /**
499
596
  * Gets an instance of Axios that is configured with the custom failure handlers
500
597
  * @param {Function} onAuthFailed - callback triggers when auth fails - ie, server error is one of ['token_invalid', 'token_not_provided', 'user_not_found', 'token_expired'] or http status is one of [401, 503, 400]
501
598
  * @param {Function} onForbidden - callback triggers when http status = 403
502
599
  */
600
+
601
+
503
602
  var axiosInstance = function axiosInstance(onAuthFailed, onForbidden) {
504
603
  var instance = axios.create({
505
604
  validateStatus: function validateStatus(status) {
@@ -507,56 +606,60 @@
507
606
  }
508
607
  });
509
608
  var token = getToken();
609
+
510
610
  if (token !== '') {
511
611
  instance.defaults.headers.common.Authorization = token;
512
612
  }
513
- instance.defaults.headers.common['Content-Type'] = 'application/json;charset=UTF-8';
514
613
 
515
- // Add a request interceptor
614
+ instance.defaults.headers.common['Content-Type'] = 'application/json;charset=UTF-8'; // Add a request interceptor
615
+
516
616
  instance.interceptors.request.use(function (request, error) {
517
617
  if (error) {
518
618
  return Promise.reject(error.response);
519
619
  }
620
+
520
621
  if (request.url.includes('search') && request.url.includes('?')) {
521
622
  // do some uri manipulation for ie
522
623
  // https://stackoverflow.com/questions/18220057
523
-
524
624
  // eslint-disable-next-line no-param-reassign
525
625
  request.url = getEncodedSearch(request.url);
526
- }
626
+ } // eslint-disable-next-line no-param-reassign
627
+
527
628
 
528
- // eslint-disable-next-line no-param-reassign
529
629
  request.headers.common['Content-Type'] = 'application/json; charset=utf-8';
630
+
530
631
  if (typeof request.body === 'undefined') {
531
632
  request.body = {};
532
633
  }
634
+
533
635
  token = getToken();
636
+
534
637
  if (token !== '') {
535
638
  // eslint-disable-next-line no-param-reassign
536
639
  request.headers.common.Authorization = token;
537
640
  }
641
+
538
642
  return request;
539
643
  }, function (error) {
540
644
  return Promise.reject(error.message);
541
- });
645
+ }); // Add a response interceptor
542
646
 
543
- // Add a response interceptor
544
647
  instance.interceptors.response.use(function (response, error) {
545
648
  if (error) {
546
649
  return Promise.reject(error.response);
547
650
  }
651
+
548
652
  if (response.headers.authorization) {
549
653
  setToken(response.headers.authorization);
550
654
  }
655
+
551
656
  return response;
552
657
  }, function (error) {
553
658
  if (error.response) {
554
659
  // network error
555
660
  if (error.response.data && error.response.data.error && (error.response.data.error === 'token_invalid' || error.response.data.error === 'token_not_provided' || error.response.data.error === 'user_not_found' || error.response.data.error === 'token_expired') || error.response.status === 401 || error.response.status === 503 || error.response.status === 400) {
556
661
  onAuthFailed();
557
- }
558
-
559
- // if (error.response.status === 500) {
662
+ } // if (error.response.status === 500) {
560
663
  // // INTERNAL SERVER ERROR
561
664
  // store.dispatch({
562
665
  // type: AppConstants.OVERLAY.SERVER_ERROR,
@@ -564,16 +667,19 @@
564
667
  // return Promise.reject(error.response);
565
668
  // }
566
669
 
670
+
567
671
  if (error.response.status === 403) {
568
672
  // FORBIDDEN
569
673
  onForbidden();
570
674
  }
675
+
571
676
  return Promise.reject(error.response);
572
677
  }
678
+
573
679
  return Promise.reject(error);
574
680
  });
575
681
  return instance;
576
- };
682
+ }; // NOTE: this to be instanciated with params: onAuthFailed, onForbidden
577
683
 
578
684
  var defaultNotifyTime = 5000;
579
685
  var error = function error(message) {
@@ -7181,22 +7287,24 @@
7181
7287
  });
7182
7288
 
7183
7289
  var _excluded = ["children"];
7290
+
7184
7291
  var DropdownSelector = function DropdownSelector(_ref) {
7185
7292
  var selectedOption = _ref.selectedOption,
7186
- onOptionChange = _ref.onOptionChange,
7187
- options = _ref.options,
7188
- isSearchable = _ref.isSearchable,
7189
- placeholder = _ref.placeholder,
7190
- name = _ref.name,
7191
- showSearchIcon = _ref.showSearchIcon,
7192
- isDisabled = _ref.isDisabled;
7293
+ onOptionChange = _ref.onOptionChange,
7294
+ options = _ref.options,
7295
+ isSearchable = _ref.isSearchable,
7296
+ placeholder = _ref.placeholder,
7297
+ name = _ref.name,
7298
+ showSearchIcon = _ref.showSearchIcon,
7299
+ isDisabled = _ref.isDisabled;
7193
7300
  var customComponents = {
7194
7301
  DropdownIndicator: function DropdownIndicator() {
7195
7302
  return null;
7196
7303
  },
7197
7304
  ValueContainer: function ValueContainer(_ref2) {
7198
7305
  var children = _ref2.children,
7199
- props = _objectWithoutProperties(_ref2, _excluded);
7306
+ props = _objectWithoutProperties(_ref2, _excluded);
7307
+
7200
7308
  return /*#__PURE__*/React__default.createElement("div", _extends({
7201
7309
  style: {
7202
7310
  position: 'relative'
@@ -7324,6 +7432,7 @@
7324
7432
  isDisabled: isDisabled
7325
7433
  }));
7326
7434
  };
7435
+
7327
7436
  DropdownSelector.defaultProps = {
7328
7437
  isSearchable: false,
7329
7438
  selectedOption: null,
@@ -7402,20 +7511,25 @@
7402
7511
  var baseButtonStyle = styled.css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n padding: 1rem 2rem;\n cursor: pointer;\n letter-spacing: 1.3px;\n border-style: none;\n text-transform: uppercase;\n font-size: 12px;\n color: #fff;\n transition: 0.2s ease-in-out;\n outline: none;\n"])));
7403
7512
 
7404
7513
  var _excluded$1 = ["children"];
7514
+
7405
7515
  var _templateObject$1;
7406
7516
  var Button = styled__default.button(_templateObject$1 || (_templateObject$1 = _taggedTemplateLiteral(["\n ", ";\n background-color: #fff;\n color: ", ";\n border: 1px solid ", ";\n\n &:disabled {\n ", "\n }\n"])), baseButtonStyle, function (props) {
7407
7517
  return props.theme.colors.primary;
7408
7518
  }, function (props) {
7409
7519
  return props.theme.colors.primary;
7410
7520
  }, disabledButtonStyle);
7521
+
7411
7522
  var PrimaryButton = function PrimaryButton(_ref) {
7412
7523
  var children = _ref.children,
7413
- restProps = _objectWithoutProperties(_ref, _excluded$1);
7524
+ restProps = _objectWithoutProperties(_ref, _excluded$1);
7525
+
7414
7526
  return /*#__PURE__*/React__default.createElement(Button, restProps, children);
7415
7527
  };
7528
+
7416
7529
  var PrimaryButton$1 = themed(PrimaryButton);
7417
7530
 
7418
7531
  var _excluded$2 = ["children"];
7532
+
7419
7533
  var _templateObject$2;
7420
7534
  var Button$1 = styled__default.button(_templateObject$2 || (_templateObject$2 = _taggedTemplateLiteral(["\n ", ";\n background-color: ", ";\n color: ", ";\n border: 1px solid ", ";\n &:hover {\n background-color: ", ";\n color: ", ";\n }\n &:disabled {\n ", "\n &:hover {\n background-color: ", ";\n }\n }\n"])), baseButtonStyle, function (props) {
7421
7535
  return props.theme.colors.ntrlMin;
@@ -7430,11 +7544,14 @@
7430
7544
  }, disabledButtonStyle, function (props) {
7431
7545
  return props.theme.colors.base;
7432
7546
  });
7547
+
7433
7548
  var SecondaryButton = function SecondaryButton(_ref) {
7434
7549
  var children = _ref.children,
7435
- restProps = _objectWithoutProperties(_ref, _excluded$2);
7550
+ restProps = _objectWithoutProperties(_ref, _excluded$2);
7551
+
7436
7552
  return /*#__PURE__*/React__default.createElement(Button$1, restProps, children);
7437
7553
  };
7554
+
7438
7555
  var SecondaryButton$1 = themed(SecondaryButton);
7439
7556
 
7440
7557
  var media = {
@@ -7459,144 +7576,178 @@
7459
7576
  }, function (props) {
7460
7577
  return props.theme.marginPaddings[1];
7461
7578
  });
7579
+
7462
7580
  var AddProductInterest = function AddProductInterest(_ref) {
7463
7581
  var baseGraphApi = _ref.baseGraphApi,
7464
- getBrandsGraphQuery = _ref.getBrandsGraphQuery,
7465
- getModelsGraphQuery = _ref.getModelsGraphQuery,
7466
- getMaterialsGraphQuery = _ref.getMaterialsGraphQuery,
7467
- onCancel = _ref.onCancel,
7468
- requestInstance = _ref.requestInstance,
7469
- addLuxityProductInterestApi = _ref.addLuxityProductInterestApi,
7470
- onSubmitSuccess = _ref.onSubmitSuccess;
7582
+ getBrandsGraphQuery = _ref.getBrandsGraphQuery,
7583
+ getModelsGraphQuery = _ref.getModelsGraphQuery,
7584
+ getMaterialsGraphQuery = _ref.getMaterialsGraphQuery,
7585
+ onCancel = _ref.onCancel,
7586
+ requestInstance = _ref.requestInstance,
7587
+ addLuxityProductInterestApi = _ref.addLuxityProductInterestApi,
7588
+ onSubmitSuccess = _ref.onSubmitSuccess;
7589
+
7471
7590
  var _useState = React.useState([]),
7472
- _useState2 = _slicedToArray(_useState, 2),
7473
- brands = _useState2[0],
7474
- setBrands = _useState2[1];
7591
+ _useState2 = _slicedToArray(_useState, 2),
7592
+ brands = _useState2[0],
7593
+ setBrands = _useState2[1];
7594
+
7475
7595
  var _useState3 = React.useState([]),
7476
- _useState4 = _slicedToArray(_useState3, 2),
7477
- models = _useState4[0],
7478
- setModels = _useState4[1];
7596
+ _useState4 = _slicedToArray(_useState3, 2),
7597
+ models = _useState4[0],
7598
+ setModels = _useState4[1];
7599
+
7479
7600
  var _useState5 = React.useState([]),
7480
- _useState6 = _slicedToArray(_useState5, 2),
7481
- materials = _useState6[0],
7482
- setMaterials = _useState6[1];
7601
+ _useState6 = _slicedToArray(_useState5, 2),
7602
+ materials = _useState6[0],
7603
+ setMaterials = _useState6[1];
7604
+
7483
7605
  var _useState7 = React.useState(null),
7484
- _useState8 = _slicedToArray(_useState7, 2),
7485
- selectedBrand = _useState8[0],
7486
- setSelectedBrand = _useState8[1];
7606
+ _useState8 = _slicedToArray(_useState7, 2),
7607
+ selectedBrand = _useState8[0],
7608
+ setSelectedBrand = _useState8[1];
7609
+
7487
7610
  var _useState9 = React.useState(null),
7488
- _useState10 = _slicedToArray(_useState9, 2),
7489
- selectedModel = _useState10[0],
7490
- setSelectedModel = _useState10[1];
7611
+ _useState10 = _slicedToArray(_useState9, 2),
7612
+ selectedModel = _useState10[0],
7613
+ setSelectedModel = _useState10[1];
7614
+
7491
7615
  var _useState11 = React.useState(null),
7492
- _useState12 = _slicedToArray(_useState11, 2),
7493
- selectedMaterial = _useState12[0],
7494
- setSelectedMaterial = _useState12[1];
7495
- var fetchBrands = React.useCallback(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
7616
+ _useState12 = _slicedToArray(_useState11, 2),
7617
+ selectedMaterial = _useState12[0],
7618
+ setSelectedMaterial = _useState12[1];
7619
+
7620
+ var fetchBrands = React.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
7496
7621
  var _response$data, _response$data$data, _response$data$data$l, response, formattedBrands;
7622
+
7497
7623
  return _regeneratorRuntime().wrap(function _callee$(_context) {
7498
- while (1) switch (_context.prev = _context.next) {
7499
- case 0:
7500
- _context.prev = 0;
7501
- _context.next = 3;
7502
- return axiosInstance.post("".concat(baseGraphApi, "?id=getBrands"), {
7503
- query: getBrandsGraphQuery(1000, 1, 'id|desc')
7504
- });
7505
- case 3:
7506
- response = _context.sent;
7507
- if (response !== null && response !== void 0 && (_response$data = response.data) !== null && _response$data !== void 0 && (_response$data$data = _response$data.data) !== null && _response$data$data !== void 0 && (_response$data$data$l = _response$data$data.luxity_brands) !== null && _response$data$data$l !== void 0 && _response$data$data$l.data) {
7508
- formattedBrands = response.data.data.luxity_brands.data.map(function (brand) {
7509
- return {
7510
- value: brand.id,
7511
- label: brand.name
7512
- };
7513
- });
7514
- setBrands(formattedBrands);
7515
- }
7516
- _context.next = 10;
7517
- break;
7518
- case 7:
7519
- _context.prev = 7;
7520
- _context.t0 = _context["catch"](0);
7521
- error(_context.t0.message);
7522
- case 10:
7523
- case "end":
7524
- return _context.stop();
7525
- }
7526
- }, _callee, null, [[0, 7]]);
7527
- })), [baseGraphApi, getBrandsGraphQuery]);
7528
- var fetchModels = React.useCallback(/*#__PURE__*/function () {
7529
- var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(brandId) {
7530
- var _response$data2, _response$data2$data, _response$data2$data$, response, formattedModels;
7531
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
7532
- while (1) switch (_context2.prev = _context2.next) {
7624
+ while (1) {
7625
+ switch (_context.prev = _context.next) {
7533
7626
  case 0:
7534
- _context2.prev = 0;
7535
- _context2.next = 3;
7536
- return axiosInstance.post("".concat(baseGraphApi, "?id=getModels"), {
7537
- query: getModelsGraphQuery(brandId)
7627
+ _context.prev = 0;
7628
+ _context.next = 3;
7629
+ return axiosInstance.post("".concat(baseGraphApi, "?id=getBrands"), {
7630
+ query: getBrandsGraphQuery(1000, 1, 'id|desc')
7538
7631
  });
7632
+
7539
7633
  case 3:
7540
- response = _context2.sent;
7541
- if (response !== null && response !== void 0 && (_response$data2 = response.data) !== null && _response$data2 !== void 0 && (_response$data2$data = _response$data2.data) !== null && _response$data2$data !== void 0 && (_response$data2$data$ = _response$data2$data.luxity_models) !== null && _response$data2$data$ !== void 0 && _response$data2$data$.data) {
7542
- formattedModels = response.data.data.luxity_models.data.map(function (model) {
7634
+ response = _context.sent;
7635
+
7636
+ if (response !== null && response !== void 0 && (_response$data = response.data) !== null && _response$data !== void 0 && (_response$data$data = _response$data.data) !== null && _response$data$data !== void 0 && (_response$data$data$l = _response$data$data.luxity_brands) !== null && _response$data$data$l !== void 0 && _response$data$data$l.data) {
7637
+ formattedBrands = response.data.data.luxity_brands.data.map(function (brand) {
7543
7638
  return {
7544
- value: model.id,
7545
- label: model.name
7639
+ value: brand.id,
7640
+ label: brand.name
7546
7641
  };
7547
7642
  });
7548
- setModels(formattedModels);
7643
+ setBrands(formattedBrands);
7549
7644
  }
7550
- _context2.next = 10;
7645
+
7646
+ _context.next = 10;
7551
7647
  break;
7648
+
7552
7649
  case 7:
7553
- _context2.prev = 7;
7554
- _context2.t0 = _context2["catch"](0);
7555
- error(_context2.t0.message);
7650
+ _context.prev = 7;
7651
+ _context.t0 = _context["catch"](0);
7652
+ error(_context.t0.message);
7653
+
7556
7654
  case 10:
7557
7655
  case "end":
7558
- return _context2.stop();
7656
+ return _context.stop();
7657
+ }
7658
+ }
7659
+ }, _callee, null, [[0, 7]]);
7660
+ })), [baseGraphApi, getBrandsGraphQuery]);
7661
+ var fetchModels = React.useCallback( /*#__PURE__*/function () {
7662
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(brandId) {
7663
+ var _response$data2, _response$data2$data, _response$data2$data$, response, formattedModels;
7664
+
7665
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
7666
+ while (1) {
7667
+ switch (_context2.prev = _context2.next) {
7668
+ case 0:
7669
+ _context2.prev = 0;
7670
+ _context2.next = 3;
7671
+ return axiosInstance.post("".concat(baseGraphApi, "?id=getModels"), {
7672
+ query: getModelsGraphQuery(brandId)
7673
+ });
7674
+
7675
+ case 3:
7676
+ response = _context2.sent;
7677
+
7678
+ if (response !== null && response !== void 0 && (_response$data2 = response.data) !== null && _response$data2 !== void 0 && (_response$data2$data = _response$data2.data) !== null && _response$data2$data !== void 0 && (_response$data2$data$ = _response$data2$data.luxity_models) !== null && _response$data2$data$ !== void 0 && _response$data2$data$.data) {
7679
+ formattedModels = response.data.data.luxity_models.data.map(function (model) {
7680
+ return {
7681
+ value: model.id,
7682
+ label: model.name
7683
+ };
7684
+ });
7685
+ setModels(formattedModels);
7686
+ }
7687
+
7688
+ _context2.next = 10;
7689
+ break;
7690
+
7691
+ case 7:
7692
+ _context2.prev = 7;
7693
+ _context2.t0 = _context2["catch"](0);
7694
+ error(_context2.t0.message);
7695
+
7696
+ case 10:
7697
+ case "end":
7698
+ return _context2.stop();
7699
+ }
7559
7700
  }
7560
7701
  }, _callee2, null, [[0, 7]]);
7561
7702
  }));
7703
+
7562
7704
  return function (_x) {
7563
7705
  return _ref3.apply(this, arguments);
7564
7706
  };
7565
7707
  }(), [baseGraphApi, getModelsGraphQuery]);
7566
- var fetchMaterials = React.useCallback(/*#__PURE__*/function () {
7567
- var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(brandId) {
7708
+ var fetchMaterials = React.useCallback( /*#__PURE__*/function () {
7709
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(brandId) {
7568
7710
  var _response$data3, _response$data3$data, _response$data3$data$, response, formattedMaterials;
7711
+
7569
7712
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
7570
- while (1) switch (_context3.prev = _context3.next) {
7571
- case 0:
7572
- _context3.prev = 0;
7573
- _context3.next = 3;
7574
- return axiosInstance.post("".concat(baseGraphApi, "?id=getMaterials"), {
7575
- query: getMaterialsGraphQuery(brandId)
7576
- });
7577
- case 3:
7578
- response = _context3.sent;
7579
- if (response !== null && response !== void 0 && (_response$data3 = response.data) !== null && _response$data3 !== void 0 && (_response$data3$data = _response$data3.data) !== null && _response$data3$data !== void 0 && (_response$data3$data$ = _response$data3$data.luxity_materials) !== null && _response$data3$data$ !== void 0 && _response$data3$data$.data) {
7580
- formattedMaterials = response.data.data.luxity_materials.data.map(function (material) {
7581
- return {
7582
- value: material.id,
7583
- label: material.name
7584
- };
7713
+ while (1) {
7714
+ switch (_context3.prev = _context3.next) {
7715
+ case 0:
7716
+ _context3.prev = 0;
7717
+ _context3.next = 3;
7718
+ return axiosInstance.post("".concat(baseGraphApi, "?id=getMaterials"), {
7719
+ query: getMaterialsGraphQuery(brandId)
7585
7720
  });
7586
- setMaterials(formattedMaterials);
7587
- }
7588
- _context3.next = 10;
7589
- break;
7590
- case 7:
7591
- _context3.prev = 7;
7592
- _context3.t0 = _context3["catch"](0);
7593
- error(_context3.t0.message);
7594
- case 10:
7595
- case "end":
7596
- return _context3.stop();
7721
+
7722
+ case 3:
7723
+ response = _context3.sent;
7724
+
7725
+ if (response !== null && response !== void 0 && (_response$data3 = response.data) !== null && _response$data3 !== void 0 && (_response$data3$data = _response$data3.data) !== null && _response$data3$data !== void 0 && (_response$data3$data$ = _response$data3$data.luxity_materials) !== null && _response$data3$data$ !== void 0 && _response$data3$data$.data) {
7726
+ formattedMaterials = response.data.data.luxity_materials.data.map(function (material) {
7727
+ return {
7728
+ value: material.id,
7729
+ label: material.name
7730
+ };
7731
+ });
7732
+ setMaterials(formattedMaterials);
7733
+ }
7734
+
7735
+ _context3.next = 10;
7736
+ break;
7737
+
7738
+ case 7:
7739
+ _context3.prev = 7;
7740
+ _context3.t0 = _context3["catch"](0);
7741
+ error(_context3.t0.message);
7742
+
7743
+ case 10:
7744
+ case "end":
7745
+ return _context3.stop();
7746
+ }
7597
7747
  }
7598
7748
  }, _callee3, null, [[0, 7]]);
7599
7749
  }));
7750
+
7600
7751
  return function (_x2) {
7601
7752
  return _ref4.apply(this, arguments);
7602
7753
  };
@@ -7617,15 +7768,19 @@
7617
7768
  setSelectedMaterial(null);
7618
7769
  }
7619
7770
  }, [selectedBrand, fetchModels, fetchMaterials]);
7771
+
7620
7772
  var onBrandChange = function onBrandChange(selectedOption) {
7621
7773
  setSelectedBrand(selectedOption);
7622
7774
  };
7775
+
7623
7776
  var onModelChange = function onModelChange(selectedOption) {
7624
7777
  setSelectedModel(selectedOption);
7625
7778
  };
7779
+
7626
7780
  var onMaterialChange = function onMaterialChange(selectedOption) {
7627
7781
  setSelectedMaterial(selectedOption);
7628
7782
  };
7783
+
7629
7784
  var submitInterest = function submitInterest() {
7630
7785
  var payload = {
7631
7786
  luxity_brand_id: selectedBrand === null || selectedBrand === void 0 ? void 0 : selectedBrand.value,
@@ -7637,6 +7792,7 @@
7637
7792
  onCancel();
7638
7793
  }, handleRequestError);
7639
7794
  };
7795
+
7640
7796
  var handleRequestError = function handleRequestError(_ref5) {
7641
7797
  var data = _ref5.data;
7642
7798
  var errorMessages = Object.keys(data).map(function (key) {
@@ -7648,6 +7804,7 @@
7648
7804
  }, message);
7649
7805
  }));
7650
7806
  };
7807
+
7651
7808
  var onReset = function onReset() {
7652
7809
  onCancel();
7653
7810
  setSelectedModel(null);
@@ -7657,6 +7814,7 @@
7657
7814
  setMaterials([]);
7658
7815
  setModels([]);
7659
7816
  };
7817
+
7660
7818
  return /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
7661
7819
  className: "interests__section-wrapper"
7662
7820
  }, /*#__PURE__*/React__default.createElement(AddInterestContainer, null, /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
@@ -7704,6 +7862,7 @@
7704
7862
  onClick: submitInterest
7705
7863
  }, "SAVE"))))))));
7706
7864
  };
7865
+
7707
7866
  var index$2 = themed(AddProductInterest);
7708
7867
 
7709
7868
  return index$2;