@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.
- package/Accordion.js +116 -76
- package/AddInterest.js +777 -440
- package/AddProductInterest.js +644 -485
- package/BrandSelector.js +336 -176
- package/Checkbox.js +101 -68
- package/CheckboxButton.js +124 -79
- package/CommunicationPreferenceOptionsRenderer.js +169 -159
- package/CommunicationPreferenceSection.js +178 -166
- package/CommunicationPreferences.js +427 -549
- package/ConditionSelector.js +336 -174
- package/CountryCodeSelect.js +10 -7
- package/CurrencyInputFormatter.js +56 -29
- package/CurrencySelect.js +49 -23
- package/DropdownSelector.js +92 -68
- package/GALink.js +16 -6
- package/GenderSelector.js +142 -88
- package/GraphQLDropdownSelector.js +1508 -929
- package/GraphQLMultiSelector.js +274 -141
- package/IconHeader.js +25 -11
- package/IconWrapper.js +7 -3
- package/InterestCatSelector.js +74 -34
- package/InterestItem.js +187 -103
- package/Interests.js +1463 -913
- package/InterestsSubheading.js +10 -5
- package/InvertedTextButton.js +63 -27
- package/LuxityAppSideNav.js +21 -18
- package/LuxityDesktopHeader.js +451 -298
- package/LuxityFooter.js +321 -430
- package/LuxityGraphQLDropdownSelector.js +1540 -945
- package/LuxityGraphQLMultiselector.js +321 -167
- package/LuxityMobileHeader.js +544 -353
- package/LuxityPageReady.js +136 -74
- package/LuxityProductInterestItem.js +175 -97
- package/LuxitySideNav.js +244 -176
- package/MaterialSelector.js +1547 -951
- package/ModelSelector.js +1547 -951
- package/NotificationDropDown.js +218 -118
- package/Notify.js +1 -0
- package/OutlinePrimaryButton.js +58 -26
- package/PriceRangeSelector.js +281 -168
- package/PrimaryButton.js +58 -26
- package/RadioButtons.js +140 -114
- package/RangeSlider.js +242 -152
- package/RareStepFooter.js +41 -27
- package/RareStepHeader.js +190 -139
- package/ReactSelectWrapper.js +1 -0
- package/SecondaryButton.js +58 -26
- package/ShoeSizeRangeSelector.js +260 -162
- package/ShoeSizeSelector.js +263 -158
- package/SimpleErrorBoundary.js +106 -59
- package/StyleSelector.js +336 -176
- package/TestComponent.js +15 -0
- package/TextButton.js +58 -26
- package/Tooltip.js +39 -17
- package/Tracking.js +1 -0
- package/WrapperButton.js +43 -20
- package/build/CountryCodeSelect/index.js +18 -0
- package/build/ReactSelectWrapper/index.js +34 -0
- package/build/bundle.css +1 -1
- package/build/bundle.js +2616 -1974
- package/package.json +1 -1
- package/postcss.config.js +6 -0
- package/svg/Accessories.js +13 -6
- package/svg/Account.js +13 -6
- package/svg/Add.js +13 -6
- package/svg/ArrowRight.js +13 -6
- package/svg/Bags.js +13 -6
- package/svg/BurgerMenu.js +13 -6
- package/svg/Calendar.js +13 -6
- package/svg/CalendarCircled.js +13 -6
- package/svg/CheckCircled.js +13 -6
- package/svg/Close.js +13 -6
- package/svg/Clothing.js +13 -6
- package/svg/Dot.js +13 -6
- package/svg/Edit.js +13 -6
- package/svg/Eye.js +13 -6
- package/svg/FileAttach.js +13 -6
- package/svg/FileAttachCircled.js +13 -6
- package/svg/LightBulb.js +13 -6
- package/svg/Logo.js +13 -6
- package/svg/LuxityMenu.js +13 -6
- package/svg/Minus.js +13 -6
- package/svg/MobileAvatar.js +13 -6
- package/svg/MyOrder.js +13 -6
- package/svg/MyPayment.js +13 -6
- package/svg/MyProfile.js +14 -8
- package/svg/MySale.js +13 -6
- package/svg/Notification.js +13 -6
- package/svg/PointerDown.js +13 -6
- package/svg/Search.js +13 -6
- package/svg/Shoes.js +13 -6
- package/svg/SvgWrapper.js +7 -3
- package/svg/Trash.js +13 -6
- package/svg/Watches.js +13 -6
package/AddProductInterest.js
CHANGED
|
@@ -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
|
|
18
|
-
|
|
19
|
-
|
|
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
|
|
101
|
-
|
|
102
|
-
return Object.getOwnPropertyDescriptor(
|
|
103
|
-
})),
|
|
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
|
-
|
|
26
|
+
|
|
27
|
+
return keys;
|
|
106
28
|
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
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
|
-
|
|
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
|
|
47
|
+
return exports;
|
|
141
48
|
};
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
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
|
-
}),
|
|
64
|
+
}), obj[key];
|
|
160
65
|
}
|
|
66
|
+
|
|
161
67
|
try {
|
|
162
68
|
define({}, "");
|
|
163
|
-
} catch (
|
|
164
|
-
define = function (
|
|
165
|
-
return
|
|
69
|
+
} catch (err) {
|
|
70
|
+
define = function (obj, key, value) {
|
|
71
|
+
return obj[key] = value;
|
|
166
72
|
};
|
|
167
73
|
}
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
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
|
-
|
|
121
|
+
|
|
122
|
+
function tryCatch(fn, obj, arg) {
|
|
177
123
|
try {
|
|
178
124
|
return {
|
|
179
125
|
type: "normal",
|
|
180
|
-
arg:
|
|
126
|
+
arg: fn.call(obj, arg)
|
|
181
127
|
};
|
|
182
|
-
} catch (
|
|
128
|
+
} catch (err) {
|
|
183
129
|
return {
|
|
184
130
|
type: "throw",
|
|
185
|
-
arg:
|
|
131
|
+
arg: err
|
|
186
132
|
};
|
|
187
133
|
}
|
|
188
134
|
}
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
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
|
-
|
|
199
|
-
|
|
144
|
+
|
|
145
|
+
var IteratorPrototype = {};
|
|
146
|
+
define(IteratorPrototype, iteratorSymbol, function () {
|
|
200
147
|
return this;
|
|
201
148
|
});
|
|
202
|
-
var
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
var
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
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
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
invoke("
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
}
|
|
226
|
-
|
|
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
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
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
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
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
|
-
|
|
290
|
-
|
|
291
|
-
|
|
213
|
+
|
|
214
|
+
function pushTryEntry(locs) {
|
|
215
|
+
var entry = {
|
|
216
|
+
tryLoc: locs[0]
|
|
292
217
|
};
|
|
293
|
-
1 in
|
|
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
|
-
|
|
296
|
-
|
|
297
|
-
|
|
220
|
+
|
|
221
|
+
function resetTryEntry(entry) {
|
|
222
|
+
var record = entry.completion || {};
|
|
223
|
+
record.type = "normal", delete record.arg, entry.completion = record;
|
|
298
224
|
}
|
|
299
|
-
|
|
225
|
+
|
|
226
|
+
function Context(tryLocsList) {
|
|
300
227
|
this.tryEntries = [{
|
|
301
228
|
tryLoc: "root"
|
|
302
|
-
}],
|
|
229
|
+
}], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
|
|
303
230
|
}
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
if (
|
|
309
|
-
if (
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
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
|
-
|
|
249
|
+
|
|
250
|
+
return {
|
|
251
|
+
next: doneResult
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
function doneResult() {
|
|
256
|
+
return {
|
|
257
|
+
value: undefined,
|
|
258
|
+
done: !0
|
|
259
|
+
};
|
|
319
260
|
}
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
}
|
|
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:
|
|
269
|
+
__await: arg
|
|
334
270
|
};
|
|
335
|
-
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype,
|
|
271
|
+
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
|
|
336
272
|
return this;
|
|
337
|
-
}),
|
|
338
|
-
void 0 ===
|
|
339
|
-
var
|
|
340
|
-
return
|
|
341
|
-
return
|
|
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(
|
|
279
|
+
}, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
|
|
344
280
|
return this;
|
|
345
|
-
}), define(
|
|
281
|
+
}), define(Gp, "toString", function () {
|
|
346
282
|
return "[object Generator]";
|
|
347
|
-
}),
|
|
348
|
-
var
|
|
349
|
-
|
|
350
|
-
for (var
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
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
|
-
},
|
|
296
|
+
}, exports.values = values, Context.prototype = {
|
|
359
297
|
constructor: Context,
|
|
360
|
-
reset: function (
|
|
361
|
-
if (this.prev = 0, this.next = 0, this.sent = this._sent =
|
|
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
|
|
366
|
-
if ("throw" ===
|
|
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 (
|
|
370
|
-
if (this.done) throw
|
|
371
|
-
var
|
|
372
|
-
|
|
373
|
-
|
|
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
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
if (
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
if (this.prev <
|
|
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 (!
|
|
389
|
-
if (this.prev <
|
|
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 (
|
|
395
|
-
for (var
|
|
396
|
-
var
|
|
397
|
-
|
|
398
|
-
|
|
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
|
-
|
|
403
|
-
|
|
404
|
-
|
|
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 (
|
|
407
|
-
if ("throw" ===
|
|
408
|
-
return "break" ===
|
|
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 (
|
|
411
|
-
for (var
|
|
412
|
-
var
|
|
413
|
-
if (
|
|
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 (
|
|
417
|
-
for (var
|
|
418
|
-
var
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
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
|
-
|
|
371
|
+
|
|
372
|
+
return thrown;
|
|
426
373
|
}
|
|
427
374
|
}
|
|
428
|
-
|
|
375
|
+
|
|
376
|
+
throw new Error("illegal catch attempt");
|
|
429
377
|
},
|
|
430
|
-
delegateYield: function (
|
|
378
|
+
delegateYield: function (iterable, resultName, nextLoc) {
|
|
431
379
|
return this.delegate = {
|
|
432
|
-
iterator: values(
|
|
433
|
-
resultName:
|
|
434
|
-
nextLoc:
|
|
435
|
-
}, "next" === this.method && (this.arg =
|
|
380
|
+
iterator: values(iterable),
|
|
381
|
+
resultName: resultName,
|
|
382
|
+
nextLoc: nextLoc
|
|
383
|
+
}, "next" === this.method && (this.arg = undefined), ContinueSentinel;
|
|
436
384
|
}
|
|
437
|
-
},
|
|
385
|
+
}, exports;
|
|
438
386
|
}
|
|
439
|
-
|
|
440
|
-
|
|
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
|
-
|
|
443
|
-
|
|
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(
|
|
499
|
+
value: Object.freeze(raw)
|
|
446
500
|
}
|
|
447
501
|
}));
|
|
448
502
|
}
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
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
|
-
|
|
460
|
-
|
|
461
|
-
|
|
507
|
+
|
|
508
|
+
function _arrayWithHoles(arr) {
|
|
509
|
+
if (Array.isArray(arr)) return arr;
|
|
462
510
|
}
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
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
|
-
|
|
7187
|
-
|
|
7188
|
-
|
|
7189
|
-
|
|
7190
|
-
|
|
7191
|
-
|
|
7192
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
7465
|
-
|
|
7466
|
-
|
|
7467
|
-
|
|
7468
|
-
|
|
7469
|
-
|
|
7470
|
-
|
|
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
|
-
|
|
7473
|
-
|
|
7474
|
-
|
|
7591
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
7592
|
+
brands = _useState2[0],
|
|
7593
|
+
setBrands = _useState2[1];
|
|
7594
|
+
|
|
7475
7595
|
var _useState3 = React.useState([]),
|
|
7476
|
-
|
|
7477
|
-
|
|
7478
|
-
|
|
7596
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
7597
|
+
models = _useState4[0],
|
|
7598
|
+
setModels = _useState4[1];
|
|
7599
|
+
|
|
7479
7600
|
var _useState5 = React.useState([]),
|
|
7480
|
-
|
|
7481
|
-
|
|
7482
|
-
|
|
7601
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
7602
|
+
materials = _useState6[0],
|
|
7603
|
+
setMaterials = _useState6[1];
|
|
7604
|
+
|
|
7483
7605
|
var _useState7 = React.useState(null),
|
|
7484
|
-
|
|
7485
|
-
|
|
7486
|
-
|
|
7606
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
7607
|
+
selectedBrand = _useState8[0],
|
|
7608
|
+
setSelectedBrand = _useState8[1];
|
|
7609
|
+
|
|
7487
7610
|
var _useState9 = React.useState(null),
|
|
7488
|
-
|
|
7489
|
-
|
|
7490
|
-
|
|
7611
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
7612
|
+
selectedModel = _useState10[0],
|
|
7613
|
+
setSelectedModel = _useState10[1];
|
|
7614
|
+
|
|
7491
7615
|
var _useState11 = React.useState(null),
|
|
7492
|
-
|
|
7493
|
-
|
|
7494
|
-
|
|
7495
|
-
|
|
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)
|
|
7499
|
-
|
|
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
|
-
|
|
7535
|
-
|
|
7536
|
-
return axiosInstance.post("".concat(baseGraphApi, "?id=
|
|
7537
|
-
query:
|
|
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 =
|
|
7541
|
-
|
|
7542
|
-
|
|
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:
|
|
7545
|
-
label:
|
|
7639
|
+
value: brand.id,
|
|
7640
|
+
label: brand.name
|
|
7546
7641
|
};
|
|
7547
7642
|
});
|
|
7548
|
-
|
|
7643
|
+
setBrands(formattedBrands);
|
|
7549
7644
|
}
|
|
7550
|
-
|
|
7645
|
+
|
|
7646
|
+
_context.next = 10;
|
|
7551
7647
|
break;
|
|
7648
|
+
|
|
7552
7649
|
case 7:
|
|
7553
|
-
|
|
7554
|
-
|
|
7555
|
-
error(
|
|
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
|
|
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)
|
|
7571
|
-
|
|
7572
|
-
|
|
7573
|
-
|
|
7574
|
-
|
|
7575
|
-
|
|
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
|
-
|
|
7587
|
-
|
|
7588
|
-
|
|
7589
|
-
|
|
7590
|
-
|
|
7591
|
-
|
|
7592
|
-
|
|
7593
|
-
|
|
7594
|
-
|
|
7595
|
-
|
|
7596
|
-
|
|
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;
|