@bonlineza/luxity-lib 2.36.1-beta.4 → 2.36.1
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 +1511 -933
- 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 +1466 -917
- package/InterestsSubheading.js +10 -5
- package/InvertedTextButton.js +63 -27
- package/LuxityAppSideNav.js +22 -19
- package/LuxityDesktopHeader.js +663 -549
- package/LuxityFooter.js +325 -434
- package/LuxityGraphQLDropdownSelector.js +1543 -949
- package/LuxityGraphQLMultiselector.js +321 -167
- package/LuxityMobileHeader.js +807 -681
- package/LuxityPageReady.js +136 -74
- package/LuxityProductInterestItem.js +175 -97
- package/LuxitySideNav.js +310 -382
- package/MaterialSelector.js +1550 -955
- package/ModelSelector.js +1550 -955
- package/NotificationDropDown.js +221 -122
- 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/TextButton.js +58 -26
- package/Tooltip.js +39 -17
- package/Tracking.js +1 -0
- package/WrapperButton.js +43 -20
- package/build/bundle.css +1 -1
- package/build/bundle.js +2973 -2457
- package/package.json +2 -3
- 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/MaterialSelector.js
CHANGED
|
@@ -18,526 +18,674 @@
|
|
|
18
18
|
axios = axios && Object.prototype.hasOwnProperty.call(axios, 'default') ? axios['default'] : axios;
|
|
19
19
|
Cookies = Cookies && Object.prototype.hasOwnProperty.call(Cookies, 'default') ? Cookies['default'] : Cookies;
|
|
20
20
|
|
|
21
|
-
function
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
return n;
|
|
25
|
-
}
|
|
26
|
-
function _arrayWithHoles(r) {
|
|
27
|
-
if (Array.isArray(r)) return r;
|
|
28
|
-
}
|
|
29
|
-
function _arrayWithoutHoles(r) {
|
|
30
|
-
if (Array.isArray(r)) return _arrayLikeToArray(r);
|
|
31
|
-
}
|
|
32
|
-
function _assertThisInitialized(e) {
|
|
33
|
-
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
34
|
-
return e;
|
|
35
|
-
}
|
|
36
|
-
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
37
|
-
try {
|
|
38
|
-
var i = n[a](c),
|
|
39
|
-
u = i.value;
|
|
40
|
-
} catch (n) {
|
|
41
|
-
return void e(n);
|
|
42
|
-
}
|
|
43
|
-
i.done ? t(u) : Promise.resolve(u).then(r, o);
|
|
44
|
-
}
|
|
45
|
-
function _asyncToGenerator(n) {
|
|
46
|
-
return function () {
|
|
47
|
-
var t = this,
|
|
48
|
-
e = arguments;
|
|
49
|
-
return new Promise(function (r, o) {
|
|
50
|
-
var a = n.apply(t, e);
|
|
51
|
-
function _next(n) {
|
|
52
|
-
asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
|
|
53
|
-
}
|
|
54
|
-
function _throw(n) {
|
|
55
|
-
asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
|
|
56
|
-
}
|
|
57
|
-
_next(void 0);
|
|
58
|
-
});
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
function _callSuper(t, o, e) {
|
|
62
|
-
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
|
|
63
|
-
}
|
|
64
|
-
function _classCallCheck(a, n) {
|
|
65
|
-
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
|
66
|
-
}
|
|
67
|
-
function _defineProperties(e, r) {
|
|
68
|
-
for (var t = 0; t < r.length; t++) {
|
|
69
|
-
var o = r[t];
|
|
70
|
-
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
function _createClass(e, r, t) {
|
|
74
|
-
return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
|
|
75
|
-
writable: !1
|
|
76
|
-
}), e;
|
|
77
|
-
}
|
|
78
|
-
function _defineProperty(e, r, t) {
|
|
79
|
-
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
80
|
-
value: t,
|
|
81
|
-
enumerable: !0,
|
|
82
|
-
configurable: !0,
|
|
83
|
-
writable: !0
|
|
84
|
-
}) : e[r] = t, e;
|
|
85
|
-
}
|
|
86
|
-
function _extends() {
|
|
87
|
-
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
88
|
-
for (var e = 1; e < arguments.length; e++) {
|
|
89
|
-
var t = arguments[e];
|
|
90
|
-
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
91
|
-
}
|
|
92
|
-
return n;
|
|
93
|
-
}, _extends.apply(null, arguments);
|
|
94
|
-
}
|
|
95
|
-
function _getPrototypeOf(t) {
|
|
96
|
-
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
|
|
97
|
-
return t.__proto__ || Object.getPrototypeOf(t);
|
|
98
|
-
}, _getPrototypeOf(t);
|
|
99
|
-
}
|
|
100
|
-
function _inherits(t, e) {
|
|
101
|
-
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
|
102
|
-
t.prototype = Object.create(e && e.prototype, {
|
|
103
|
-
constructor: {
|
|
104
|
-
value: t,
|
|
105
|
-
writable: !0,
|
|
106
|
-
configurable: !0
|
|
107
|
-
}
|
|
108
|
-
}), Object.defineProperty(t, "prototype", {
|
|
109
|
-
writable: !1
|
|
110
|
-
}), e && _setPrototypeOf(t, e);
|
|
111
|
-
}
|
|
112
|
-
function _isNativeReflectConstruct() {
|
|
113
|
-
try {
|
|
114
|
-
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
115
|
-
} catch (t) {}
|
|
116
|
-
return (_isNativeReflectConstruct = function () {
|
|
117
|
-
return !!t;
|
|
118
|
-
})();
|
|
119
|
-
}
|
|
120
|
-
function _iterableToArray(r) {
|
|
121
|
-
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
122
|
-
}
|
|
123
|
-
function _iterableToArrayLimit(r, l) {
|
|
124
|
-
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
125
|
-
if (null != t) {
|
|
126
|
-
var e,
|
|
127
|
-
n,
|
|
128
|
-
i,
|
|
129
|
-
u,
|
|
130
|
-
a = [],
|
|
131
|
-
f = !0,
|
|
132
|
-
o = !1;
|
|
133
|
-
try {
|
|
134
|
-
if (i = (t = t.call(r)).next, 0 === l) {
|
|
135
|
-
if (Object(t) !== t) return;
|
|
136
|
-
f = !1;
|
|
137
|
-
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
138
|
-
} catch (r) {
|
|
139
|
-
o = !0, n = r;
|
|
140
|
-
} finally {
|
|
141
|
-
try {
|
|
142
|
-
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
|
|
143
|
-
} finally {
|
|
144
|
-
if (o) throw n;
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
return a;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
function _nonIterableRest() {
|
|
151
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
152
|
-
}
|
|
153
|
-
function _nonIterableSpread() {
|
|
154
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
155
|
-
}
|
|
156
|
-
function ownKeys(e, r) {
|
|
157
|
-
var t = Object.keys(e);
|
|
21
|
+
function ownKeys(object, enumerableOnly) {
|
|
22
|
+
var keys = Object.keys(object);
|
|
23
|
+
|
|
158
24
|
if (Object.getOwnPropertySymbols) {
|
|
159
|
-
var
|
|
160
|
-
|
|
161
|
-
return Object.getOwnPropertyDescriptor(
|
|
162
|
-
})),
|
|
25
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
26
|
+
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
|
27
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
28
|
+
})), keys.push.apply(keys, symbols);
|
|
163
29
|
}
|
|
164
|
-
|
|
30
|
+
|
|
31
|
+
return keys;
|
|
165
32
|
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
33
|
+
|
|
34
|
+
function _objectSpread2(target) {
|
|
35
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
36
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
37
|
+
i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
|
38
|
+
_defineProperty(target, key, source[key]);
|
|
39
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
|
|
40
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
173
41
|
});
|
|
174
42
|
}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
function _objectWithoutProperties(e, t) {
|
|
178
|
-
if (null == e) return {};
|
|
179
|
-
var o,
|
|
180
|
-
r,
|
|
181
|
-
i = _objectWithoutPropertiesLoose(e, t);
|
|
182
|
-
if (Object.getOwnPropertySymbols) {
|
|
183
|
-
var n = Object.getOwnPropertySymbols(e);
|
|
184
|
-
for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
185
|
-
}
|
|
186
|
-
return i;
|
|
187
|
-
}
|
|
188
|
-
function _objectWithoutPropertiesLoose(r, e) {
|
|
189
|
-
if (null == r) return {};
|
|
190
|
-
var t = {};
|
|
191
|
-
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
192
|
-
if (-1 !== e.indexOf(n)) continue;
|
|
193
|
-
t[n] = r[n];
|
|
194
|
-
}
|
|
195
|
-
return t;
|
|
196
|
-
}
|
|
197
|
-
function _possibleConstructorReturn(t, e) {
|
|
198
|
-
if (e && ("object" == typeof e || "function" == typeof e)) return e;
|
|
199
|
-
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
|
200
|
-
return _assertThisInitialized(t);
|
|
43
|
+
|
|
44
|
+
return target;
|
|
201
45
|
}
|
|
46
|
+
|
|
202
47
|
function _regeneratorRuntime() {
|
|
48
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
49
|
+
|
|
203
50
|
_regeneratorRuntime = function () {
|
|
204
|
-
return
|
|
51
|
+
return exports;
|
|
205
52
|
};
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
return Object.defineProperty(t, e, {
|
|
219
|
-
value: r,
|
|
53
|
+
|
|
54
|
+
var exports = {},
|
|
55
|
+
Op = Object.prototype,
|
|
56
|
+
hasOwn = Op.hasOwnProperty,
|
|
57
|
+
$Symbol = "function" == typeof Symbol ? Symbol : {},
|
|
58
|
+
iteratorSymbol = $Symbol.iterator || "@@iterator",
|
|
59
|
+
asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
|
|
60
|
+
toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
|
61
|
+
|
|
62
|
+
function define(obj, key, value) {
|
|
63
|
+
return Object.defineProperty(obj, key, {
|
|
64
|
+
value: value,
|
|
220
65
|
enumerable: !0,
|
|
221
66
|
configurable: !0,
|
|
222
67
|
writable: !0
|
|
223
|
-
}),
|
|
68
|
+
}), obj[key];
|
|
224
69
|
}
|
|
70
|
+
|
|
225
71
|
try {
|
|
226
72
|
define({}, "");
|
|
227
|
-
} catch (
|
|
228
|
-
define = function (
|
|
229
|
-
return
|
|
73
|
+
} catch (err) {
|
|
74
|
+
define = function (obj, key, value) {
|
|
75
|
+
return obj[key] = value;
|
|
230
76
|
};
|
|
231
77
|
}
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
78
|
+
|
|
79
|
+
function wrap(innerFn, outerFn, self, tryLocsList) {
|
|
80
|
+
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
|
|
81
|
+
generator = Object.create(protoGenerator.prototype),
|
|
82
|
+
context = new Context(tryLocsList || []);
|
|
83
|
+
return generator._invoke = function (innerFn, self, context) {
|
|
84
|
+
var state = "suspendedStart";
|
|
85
|
+
return function (method, arg) {
|
|
86
|
+
if ("executing" === state) throw new Error("Generator is already running");
|
|
87
|
+
|
|
88
|
+
if ("completed" === state) {
|
|
89
|
+
if ("throw" === method) throw arg;
|
|
90
|
+
return doneResult();
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
for (context.method = method, context.arg = arg;;) {
|
|
94
|
+
var delegate = context.delegate;
|
|
95
|
+
|
|
96
|
+
if (delegate) {
|
|
97
|
+
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
98
|
+
|
|
99
|
+
if (delegateResult) {
|
|
100
|
+
if (delegateResult === ContinueSentinel) continue;
|
|
101
|
+
return delegateResult;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
|
|
106
|
+
if ("suspendedStart" === state) throw state = "completed", context.arg;
|
|
107
|
+
context.dispatchException(context.arg);
|
|
108
|
+
} else "return" === context.method && context.abrupt("return", context.arg);
|
|
109
|
+
state = "executing";
|
|
110
|
+
var record = tryCatch(innerFn, self, context);
|
|
111
|
+
|
|
112
|
+
if ("normal" === record.type) {
|
|
113
|
+
if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
|
|
114
|
+
return {
|
|
115
|
+
value: record.arg,
|
|
116
|
+
done: context.done
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
"throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
}(innerFn, self, context), generator;
|
|
239
124
|
}
|
|
240
|
-
|
|
125
|
+
|
|
126
|
+
function tryCatch(fn, obj, arg) {
|
|
241
127
|
try {
|
|
242
128
|
return {
|
|
243
129
|
type: "normal",
|
|
244
|
-
arg:
|
|
130
|
+
arg: fn.call(obj, arg)
|
|
245
131
|
};
|
|
246
|
-
} catch (
|
|
132
|
+
} catch (err) {
|
|
247
133
|
return {
|
|
248
134
|
type: "throw",
|
|
249
|
-
arg:
|
|
135
|
+
arg: err
|
|
250
136
|
};
|
|
251
137
|
}
|
|
252
138
|
}
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
s = "completed",
|
|
258
|
-
y = {};
|
|
139
|
+
|
|
140
|
+
exports.wrap = wrap;
|
|
141
|
+
var ContinueSentinel = {};
|
|
142
|
+
|
|
259
143
|
function Generator() {}
|
|
144
|
+
|
|
260
145
|
function GeneratorFunction() {}
|
|
146
|
+
|
|
261
147
|
function GeneratorFunctionPrototype() {}
|
|
262
|
-
|
|
263
|
-
|
|
148
|
+
|
|
149
|
+
var IteratorPrototype = {};
|
|
150
|
+
define(IteratorPrototype, iteratorSymbol, function () {
|
|
264
151
|
return this;
|
|
265
152
|
});
|
|
266
|
-
var
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
var
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
153
|
+
var getProto = Object.getPrototypeOf,
|
|
154
|
+
NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
|
155
|
+
NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
|
|
156
|
+
var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
|
|
157
|
+
|
|
158
|
+
function defineIteratorMethods(prototype) {
|
|
159
|
+
["next", "throw", "return"].forEach(function (method) {
|
|
160
|
+
define(prototype, method, function (arg) {
|
|
161
|
+
return this._invoke(method, arg);
|
|
274
162
|
});
|
|
275
163
|
});
|
|
276
164
|
}
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
invoke("
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
}
|
|
290
|
-
|
|
165
|
+
|
|
166
|
+
function AsyncIterator(generator, PromiseImpl) {
|
|
167
|
+
function invoke(method, arg, resolve, reject) {
|
|
168
|
+
var record = tryCatch(generator[method], generator, arg);
|
|
169
|
+
|
|
170
|
+
if ("throw" !== record.type) {
|
|
171
|
+
var result = record.arg,
|
|
172
|
+
value = result.value;
|
|
173
|
+
return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
|
|
174
|
+
invoke("next", value, resolve, reject);
|
|
175
|
+
}, function (err) {
|
|
176
|
+
invoke("throw", err, resolve, reject);
|
|
177
|
+
}) : PromiseImpl.resolve(value).then(function (unwrapped) {
|
|
178
|
+
result.value = unwrapped, resolve(result);
|
|
179
|
+
}, function (error) {
|
|
180
|
+
return invoke("throw", error, resolve, reject);
|
|
291
181
|
});
|
|
292
182
|
}
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
183
|
+
|
|
184
|
+
reject(record.arg);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
var previousPromise;
|
|
188
|
+
|
|
189
|
+
this._invoke = function (method, arg) {
|
|
190
|
+
function callInvokeWithMethodAndArg() {
|
|
191
|
+
return new PromiseImpl(function (resolve, reject) {
|
|
192
|
+
invoke(method, arg, resolve, reject);
|
|
193
|
+
});
|
|
304
194
|
}
|
|
305
|
-
|
|
195
|
+
|
|
196
|
+
return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
197
|
+
};
|
|
306
198
|
}
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
return
|
|
314
|
-
|
|
315
|
-
done: !0
|
|
316
|
-
};
|
|
317
|
-
}
|
|
318
|
-
for (n.method = i, n.arg = a;;) {
|
|
319
|
-
var c = n.delegate;
|
|
320
|
-
if (c) {
|
|
321
|
-
var u = maybeInvokeDelegate(c, n);
|
|
322
|
-
if (u) {
|
|
323
|
-
if (u === y) continue;
|
|
324
|
-
return u;
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
|
|
328
|
-
if (o === h) throw o = s, n.arg;
|
|
329
|
-
n.dispatchException(n.arg);
|
|
330
|
-
} else "return" === n.method && n.abrupt("return", n.arg);
|
|
331
|
-
o = f;
|
|
332
|
-
var p = tryCatch(e, r, n);
|
|
333
|
-
if ("normal" === p.type) {
|
|
334
|
-
if (o = n.done ? s : l, p.arg === y) continue;
|
|
335
|
-
return {
|
|
336
|
-
value: p.arg,
|
|
337
|
-
done: n.done
|
|
338
|
-
};
|
|
339
|
-
}
|
|
340
|
-
"throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
|
|
199
|
+
|
|
200
|
+
function maybeInvokeDelegate(delegate, context) {
|
|
201
|
+
var method = delegate.iterator[context.method];
|
|
202
|
+
|
|
203
|
+
if (undefined === method) {
|
|
204
|
+
if (context.delegate = null, "throw" === context.method) {
|
|
205
|
+
if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
|
|
206
|
+
context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
|
|
341
207
|
}
|
|
342
|
-
|
|
208
|
+
|
|
209
|
+
return ContinueSentinel;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
var record = tryCatch(method, delegate.iterator, context.arg);
|
|
213
|
+
if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
|
|
214
|
+
var info = record.arg;
|
|
215
|
+
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);
|
|
343
216
|
}
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
var i = tryCatch(o, e.iterator, r.arg);
|
|
349
|
-
if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
|
|
350
|
-
var a = i.arg;
|
|
351
|
-
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);
|
|
352
|
-
}
|
|
353
|
-
function pushTryEntry(t) {
|
|
354
|
-
var e = {
|
|
355
|
-
tryLoc: t[0]
|
|
217
|
+
|
|
218
|
+
function pushTryEntry(locs) {
|
|
219
|
+
var entry = {
|
|
220
|
+
tryLoc: locs[0]
|
|
356
221
|
};
|
|
357
|
-
1 in
|
|
222
|
+
1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
|
|
358
223
|
}
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
224
|
+
|
|
225
|
+
function resetTryEntry(entry) {
|
|
226
|
+
var record = entry.completion || {};
|
|
227
|
+
record.type = "normal", delete record.arg, entry.completion = record;
|
|
362
228
|
}
|
|
363
|
-
|
|
229
|
+
|
|
230
|
+
function Context(tryLocsList) {
|
|
364
231
|
this.tryEntries = [{
|
|
365
232
|
tryLoc: "root"
|
|
366
|
-
}],
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
if (
|
|
373
|
-
if (
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
233
|
+
}], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
function values(iterable) {
|
|
237
|
+
if (iterable) {
|
|
238
|
+
var iteratorMethod = iterable[iteratorSymbol];
|
|
239
|
+
if (iteratorMethod) return iteratorMethod.call(iterable);
|
|
240
|
+
if ("function" == typeof iterable.next) return iterable;
|
|
241
|
+
|
|
242
|
+
if (!isNaN(iterable.length)) {
|
|
243
|
+
var i = -1,
|
|
244
|
+
next = function next() {
|
|
245
|
+
for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
|
|
246
|
+
|
|
247
|
+
return next.value = undefined, next.done = !0, next;
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
return next.next = next;
|
|
380
251
|
}
|
|
381
252
|
}
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
|
|
253
|
+
|
|
254
|
+
return {
|
|
255
|
+
next: doneResult
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
function doneResult() {
|
|
260
|
+
return {
|
|
261
|
+
value: undefined,
|
|
262
|
+
done: !0
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
|
|
267
|
+
var ctor = "function" == typeof genFun && genFun.constructor;
|
|
268
|
+
return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
|
|
269
|
+
}, exports.mark = function (genFun) {
|
|
270
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
|
|
271
|
+
}, exports.awrap = function (arg) {
|
|
396
272
|
return {
|
|
397
|
-
__await:
|
|
273
|
+
__await: arg
|
|
398
274
|
};
|
|
399
|
-
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype,
|
|
275
|
+
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
|
|
400
276
|
return this;
|
|
401
|
-
}),
|
|
402
|
-
void 0 ===
|
|
403
|
-
var
|
|
404
|
-
return
|
|
405
|
-
return
|
|
277
|
+
}), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
|
278
|
+
void 0 === PromiseImpl && (PromiseImpl = Promise);
|
|
279
|
+
var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
|
|
280
|
+
return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
|
|
281
|
+
return result.done ? result.value : iter.next();
|
|
406
282
|
});
|
|
407
|
-
}, defineIteratorMethods(
|
|
283
|
+
}, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
|
|
408
284
|
return this;
|
|
409
|
-
}), define(
|
|
285
|
+
}), define(Gp, "toString", function () {
|
|
410
286
|
return "[object Generator]";
|
|
411
|
-
}),
|
|
412
|
-
var
|
|
413
|
-
|
|
414
|
-
for (var
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
287
|
+
}), exports.keys = function (object) {
|
|
288
|
+
var keys = [];
|
|
289
|
+
|
|
290
|
+
for (var key in object) keys.push(key);
|
|
291
|
+
|
|
292
|
+
return keys.reverse(), function next() {
|
|
293
|
+
for (; keys.length;) {
|
|
294
|
+
var key = keys.pop();
|
|
295
|
+
if (key in object) return next.value = key, next.done = !1, next;
|
|
419
296
|
}
|
|
297
|
+
|
|
420
298
|
return next.done = !0, next;
|
|
421
299
|
};
|
|
422
|
-
},
|
|
300
|
+
}, exports.values = values, Context.prototype = {
|
|
423
301
|
constructor: Context,
|
|
424
|
-
reset: function (
|
|
425
|
-
if (this.prev = 0, this.next = 0, this.sent = this._sent =
|
|
302
|
+
reset: function (skipTempReset) {
|
|
303
|
+
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);
|
|
426
304
|
},
|
|
427
305
|
stop: function () {
|
|
428
306
|
this.done = !0;
|
|
429
|
-
var
|
|
430
|
-
if ("throw" ===
|
|
307
|
+
var rootRecord = this.tryEntries[0].completion;
|
|
308
|
+
if ("throw" === rootRecord.type) throw rootRecord.arg;
|
|
431
309
|
return this.rval;
|
|
432
310
|
},
|
|
433
|
-
dispatchException: function (
|
|
434
|
-
if (this.done) throw
|
|
435
|
-
var
|
|
436
|
-
|
|
437
|
-
|
|
311
|
+
dispatchException: function (exception) {
|
|
312
|
+
if (this.done) throw exception;
|
|
313
|
+
var context = this;
|
|
314
|
+
|
|
315
|
+
function handle(loc, caught) {
|
|
316
|
+
return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
|
|
438
317
|
}
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
if (
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
if (this.prev <
|
|
318
|
+
|
|
319
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
320
|
+
var entry = this.tryEntries[i],
|
|
321
|
+
record = entry.completion;
|
|
322
|
+
if ("root" === entry.tryLoc) return handle("end");
|
|
323
|
+
|
|
324
|
+
if (entry.tryLoc <= this.prev) {
|
|
325
|
+
var hasCatch = hasOwn.call(entry, "catchLoc"),
|
|
326
|
+
hasFinally = hasOwn.call(entry, "finallyLoc");
|
|
327
|
+
|
|
328
|
+
if (hasCatch && hasFinally) {
|
|
329
|
+
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
330
|
+
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
331
|
+
} else if (hasCatch) {
|
|
332
|
+
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
451
333
|
} else {
|
|
452
|
-
if (!
|
|
453
|
-
if (this.prev <
|
|
334
|
+
if (!hasFinally) throw new Error("try statement without catch or finally");
|
|
335
|
+
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
454
336
|
}
|
|
455
337
|
}
|
|
456
338
|
}
|
|
457
339
|
},
|
|
458
|
-
abrupt: function (
|
|
459
|
-
for (var
|
|
460
|
-
var
|
|
461
|
-
|
|
462
|
-
|
|
340
|
+
abrupt: function (type, arg) {
|
|
341
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
342
|
+
var entry = this.tryEntries[i];
|
|
343
|
+
|
|
344
|
+
if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
|
|
345
|
+
var finallyEntry = entry;
|
|
463
346
|
break;
|
|
464
347
|
}
|
|
465
348
|
}
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
349
|
+
|
|
350
|
+
finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
|
|
351
|
+
var record = finallyEntry ? finallyEntry.completion : {};
|
|
352
|
+
return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
|
|
469
353
|
},
|
|
470
|
-
complete: function (
|
|
471
|
-
if ("throw" ===
|
|
472
|
-
return "break" ===
|
|
354
|
+
complete: function (record, afterLoc) {
|
|
355
|
+
if ("throw" === record.type) throw record.arg;
|
|
356
|
+
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;
|
|
473
357
|
},
|
|
474
|
-
finish: function (
|
|
475
|
-
for (var
|
|
476
|
-
var
|
|
477
|
-
if (
|
|
358
|
+
finish: function (finallyLoc) {
|
|
359
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
360
|
+
var entry = this.tryEntries[i];
|
|
361
|
+
if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
|
|
478
362
|
}
|
|
479
363
|
},
|
|
480
|
-
catch: function (
|
|
481
|
-
for (var
|
|
482
|
-
var
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
364
|
+
catch: function (tryLoc) {
|
|
365
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
|
366
|
+
var entry = this.tryEntries[i];
|
|
367
|
+
|
|
368
|
+
if (entry.tryLoc === tryLoc) {
|
|
369
|
+
var record = entry.completion;
|
|
370
|
+
|
|
371
|
+
if ("throw" === record.type) {
|
|
372
|
+
var thrown = record.arg;
|
|
373
|
+
resetTryEntry(entry);
|
|
488
374
|
}
|
|
489
|
-
|
|
375
|
+
|
|
376
|
+
return thrown;
|
|
490
377
|
}
|
|
491
378
|
}
|
|
492
|
-
|
|
379
|
+
|
|
380
|
+
throw new Error("illegal catch attempt");
|
|
493
381
|
},
|
|
494
|
-
delegateYield: function (
|
|
382
|
+
delegateYield: function (iterable, resultName, nextLoc) {
|
|
495
383
|
return this.delegate = {
|
|
496
|
-
iterator: values(
|
|
497
|
-
resultName:
|
|
498
|
-
nextLoc:
|
|
499
|
-
}, "next" === this.method && (this.arg =
|
|
384
|
+
iterator: values(iterable),
|
|
385
|
+
resultName: resultName,
|
|
386
|
+
nextLoc: nextLoc
|
|
387
|
+
}, "next" === this.method && (this.arg = undefined), ContinueSentinel;
|
|
388
|
+
}
|
|
389
|
+
}, exports;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
393
|
+
try {
|
|
394
|
+
var info = gen[key](arg);
|
|
395
|
+
var value = info.value;
|
|
396
|
+
} catch (error) {
|
|
397
|
+
reject(error);
|
|
398
|
+
return;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
if (info.done) {
|
|
402
|
+
resolve(value);
|
|
403
|
+
} else {
|
|
404
|
+
Promise.resolve(value).then(_next, _throw);
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
function _asyncToGenerator(fn) {
|
|
409
|
+
return function () {
|
|
410
|
+
var self = this,
|
|
411
|
+
args = arguments;
|
|
412
|
+
return new Promise(function (resolve, reject) {
|
|
413
|
+
var gen = fn.apply(self, args);
|
|
414
|
+
|
|
415
|
+
function _next(value) {
|
|
416
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
function _throw(err) {
|
|
420
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
_next(undefined);
|
|
424
|
+
});
|
|
425
|
+
};
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
function _classCallCheck(instance, Constructor) {
|
|
429
|
+
if (!(instance instanceof Constructor)) {
|
|
430
|
+
throw new TypeError("Cannot call a class as a function");
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
function _defineProperties(target, props) {
|
|
435
|
+
for (var i = 0; i < props.length; i++) {
|
|
436
|
+
var descriptor = props[i];
|
|
437
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
438
|
+
descriptor.configurable = true;
|
|
439
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
440
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
function _createClass(Constructor, protoProps, staticProps) {
|
|
445
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
446
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
447
|
+
Object.defineProperty(Constructor, "prototype", {
|
|
448
|
+
writable: false
|
|
449
|
+
});
|
|
450
|
+
return Constructor;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
function _defineProperty(obj, key, value) {
|
|
454
|
+
if (key in obj) {
|
|
455
|
+
Object.defineProperty(obj, key, {
|
|
456
|
+
value: value,
|
|
457
|
+
enumerable: true,
|
|
458
|
+
configurable: true,
|
|
459
|
+
writable: true
|
|
460
|
+
});
|
|
461
|
+
} else {
|
|
462
|
+
obj[key] = value;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
return obj;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
function _extends() {
|
|
469
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
470
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
471
|
+
var source = arguments[i];
|
|
472
|
+
|
|
473
|
+
for (var key in source) {
|
|
474
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
475
|
+
target[key] = source[key];
|
|
476
|
+
}
|
|
477
|
+
}
|
|
500
478
|
}
|
|
501
|
-
|
|
479
|
+
|
|
480
|
+
return target;
|
|
481
|
+
};
|
|
482
|
+
return _extends.apply(this, arguments);
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
function _inherits(subClass, superClass) {
|
|
486
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
|
487
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
491
|
+
constructor: {
|
|
492
|
+
value: subClass,
|
|
493
|
+
writable: true,
|
|
494
|
+
configurable: true
|
|
495
|
+
}
|
|
496
|
+
});
|
|
497
|
+
Object.defineProperty(subClass, "prototype", {
|
|
498
|
+
writable: false
|
|
499
|
+
});
|
|
500
|
+
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
function _getPrototypeOf(o) {
|
|
504
|
+
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
|
|
505
|
+
return o.__proto__ || Object.getPrototypeOf(o);
|
|
506
|
+
};
|
|
507
|
+
return _getPrototypeOf(o);
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
function _setPrototypeOf(o, p) {
|
|
511
|
+
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
|
512
|
+
o.__proto__ = p;
|
|
513
|
+
return o;
|
|
514
|
+
};
|
|
515
|
+
return _setPrototypeOf(o, p);
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
function _isNativeReflectConstruct() {
|
|
519
|
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
520
|
+
if (Reflect.construct.sham) return false;
|
|
521
|
+
if (typeof Proxy === "function") return true;
|
|
522
|
+
|
|
523
|
+
try {
|
|
524
|
+
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
525
|
+
return true;
|
|
526
|
+
} catch (e) {
|
|
527
|
+
return false;
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
532
|
+
if (source == null) return {};
|
|
533
|
+
var target = {};
|
|
534
|
+
var sourceKeys = Object.keys(source);
|
|
535
|
+
var key, i;
|
|
536
|
+
|
|
537
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
538
|
+
key = sourceKeys[i];
|
|
539
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
540
|
+
target[key] = source[key];
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
return target;
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
function _objectWithoutProperties(source, excluded) {
|
|
547
|
+
if (source == null) return {};
|
|
548
|
+
|
|
549
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
550
|
+
|
|
551
|
+
var key, i;
|
|
552
|
+
|
|
553
|
+
if (Object.getOwnPropertySymbols) {
|
|
554
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
555
|
+
|
|
556
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
557
|
+
key = sourceSymbolKeys[i];
|
|
558
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
559
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
560
|
+
target[key] = source[key];
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
return target;
|
|
502
565
|
}
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
566
|
+
|
|
567
|
+
function _assertThisInitialized(self) {
|
|
568
|
+
if (self === void 0) {
|
|
569
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
return self;
|
|
507
573
|
}
|
|
508
|
-
|
|
509
|
-
|
|
574
|
+
|
|
575
|
+
function _possibleConstructorReturn(self, call) {
|
|
576
|
+
if (call && (typeof call === "object" || typeof call === "function")) {
|
|
577
|
+
return call;
|
|
578
|
+
} else if (call !== void 0) {
|
|
579
|
+
throw new TypeError("Derived constructors may only return object or undefined");
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
return _assertThisInitialized(self);
|
|
510
583
|
}
|
|
511
|
-
|
|
512
|
-
|
|
584
|
+
|
|
585
|
+
function _createSuper(Derived) {
|
|
586
|
+
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
587
|
+
|
|
588
|
+
return function _createSuperInternal() {
|
|
589
|
+
var Super = _getPrototypeOf(Derived),
|
|
590
|
+
result;
|
|
591
|
+
|
|
592
|
+
if (hasNativeReflectConstruct) {
|
|
593
|
+
var NewTarget = _getPrototypeOf(this).constructor;
|
|
594
|
+
|
|
595
|
+
result = Reflect.construct(Super, arguments, NewTarget);
|
|
596
|
+
} else {
|
|
597
|
+
result = Super.apply(this, arguments);
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
return _possibleConstructorReturn(this, result);
|
|
601
|
+
};
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
function _taggedTemplateLiteral(strings, raw) {
|
|
605
|
+
if (!raw) {
|
|
606
|
+
raw = strings.slice(0);
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
return Object.freeze(Object.defineProperties(strings, {
|
|
513
610
|
raw: {
|
|
514
|
-
value: Object.freeze(
|
|
611
|
+
value: Object.freeze(raw)
|
|
515
612
|
}
|
|
516
613
|
}));
|
|
517
614
|
}
|
|
518
|
-
|
|
519
|
-
|
|
615
|
+
|
|
616
|
+
function _slicedToArray(arr, i) {
|
|
617
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
function _toConsumableArray(arr) {
|
|
621
|
+
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
520
622
|
}
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
if (void 0 !== e) {
|
|
525
|
-
var i = e.call(t, r || "default");
|
|
526
|
-
if ("object" != typeof i) return i;
|
|
527
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
528
|
-
}
|
|
529
|
-
return ("string" === r ? String : Number)(t);
|
|
623
|
+
|
|
624
|
+
function _arrayWithoutHoles(arr) {
|
|
625
|
+
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
530
626
|
}
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
627
|
+
|
|
628
|
+
function _arrayWithHoles(arr) {
|
|
629
|
+
if (Array.isArray(arr)) return arr;
|
|
534
630
|
}
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
631
|
+
|
|
632
|
+
function _iterableToArray(iter) {
|
|
633
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
function _iterableToArrayLimit(arr, i) {
|
|
637
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
638
|
+
|
|
639
|
+
if (_i == null) return;
|
|
640
|
+
var _arr = [];
|
|
641
|
+
var _n = true;
|
|
642
|
+
var _d = false;
|
|
643
|
+
|
|
644
|
+
var _s, _e;
|
|
645
|
+
|
|
646
|
+
try {
|
|
647
|
+
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
|
648
|
+
_arr.push(_s.value);
|
|
649
|
+
|
|
650
|
+
if (i && _arr.length === i) break;
|
|
651
|
+
}
|
|
652
|
+
} catch (err) {
|
|
653
|
+
_d = true;
|
|
654
|
+
_e = err;
|
|
655
|
+
} finally {
|
|
656
|
+
try {
|
|
657
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
658
|
+
} finally {
|
|
659
|
+
if (_d) throw _e;
|
|
660
|
+
}
|
|
540
661
|
}
|
|
662
|
+
|
|
663
|
+
return _arr;
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
667
|
+
if (!o) return;
|
|
668
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
669
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
670
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
671
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
672
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
function _arrayLikeToArray(arr, len) {
|
|
676
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
677
|
+
|
|
678
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
679
|
+
|
|
680
|
+
return arr2;
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
function _nonIterableSpread() {
|
|
684
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
function _nonIterableRest() {
|
|
688
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
541
689
|
}
|
|
542
690
|
|
|
543
691
|
var interpretErrorMessage = function interpretErrorMessage(error) {
|
|
@@ -549,39 +697,50 @@
|
|
|
549
697
|
var LuxityPageReadyContext = /*#__PURE__*/React__default.createContext({
|
|
550
698
|
data: null
|
|
551
699
|
});
|
|
552
|
-
|
|
553
700
|
/**
|
|
554
701
|
* A flavour of PageReady with Luxity customisations
|
|
555
702
|
* 1. the onIsLoading callback is useful to parent components that have more complex data interactions
|
|
556
703
|
* 2. an error message interpreter is supplied from the local helper library
|
|
557
704
|
*/
|
|
705
|
+
|
|
558
706
|
var LuxityPageReady = /*#__PURE__*/function (_React$Component) {
|
|
707
|
+
_inherits(LuxityPageReady, _React$Component);
|
|
708
|
+
|
|
709
|
+
var _super = _createSuper(LuxityPageReady);
|
|
710
|
+
|
|
559
711
|
function LuxityPageReady() {
|
|
560
712
|
var _this;
|
|
713
|
+
|
|
561
714
|
_classCallCheck(this, LuxityPageReady);
|
|
715
|
+
|
|
562
716
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
563
717
|
args[_key] = arguments[_key];
|
|
564
718
|
}
|
|
565
|
-
|
|
566
|
-
|
|
719
|
+
|
|
720
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
721
|
+
|
|
722
|
+
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
567
723
|
data: null
|
|
568
724
|
});
|
|
569
|
-
|
|
725
|
+
|
|
726
|
+
_defineProperty(_assertThisInitialized(_this), "refreshPage", function () {
|
|
570
727
|
return _this.pageReadyInstance.initRequest();
|
|
571
728
|
});
|
|
729
|
+
|
|
572
730
|
return _this;
|
|
573
731
|
}
|
|
574
|
-
|
|
575
|
-
|
|
732
|
+
|
|
733
|
+
_createClass(LuxityPageReady, [{
|
|
576
734
|
key: "render",
|
|
577
735
|
value: function render() {
|
|
578
736
|
var _this2 = this;
|
|
737
|
+
|
|
579
738
|
var _this$props = this.props,
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
739
|
+
customErrorMessage = _this$props.customErrorMessage,
|
|
740
|
+
customErrorHandler = _this$props.customErrorHandler,
|
|
741
|
+
getRequestPromise = _this$props.getRequestPromise,
|
|
742
|
+
_onData = _this$props.onData,
|
|
743
|
+
children = _this$props.children;
|
|
585
744
|
var data = this.state.data;
|
|
586
745
|
return /*#__PURE__*/React__default.createElement(PageReady, {
|
|
587
746
|
ref: function ref(inst) {
|
|
@@ -591,15 +750,19 @@
|
|
|
591
750
|
_this2.setState({
|
|
592
751
|
data: res.data
|
|
593
752
|
});
|
|
753
|
+
|
|
594
754
|
_onData(res);
|
|
595
755
|
},
|
|
596
756
|
getRequestInstance: function getRequestInstance() {
|
|
597
757
|
_this2.props.onIsLoading(true);
|
|
758
|
+
|
|
598
759
|
return getRequestPromise().then(function (out) {
|
|
599
760
|
_this2.props.onIsLoading(false);
|
|
761
|
+
|
|
600
762
|
return out;
|
|
601
763
|
}).catch(function (oops) {
|
|
602
764
|
_this2.props.onIsLoading(false);
|
|
765
|
+
|
|
603
766
|
return oops;
|
|
604
767
|
});
|
|
605
768
|
},
|
|
@@ -616,7 +779,10 @@
|
|
|
616
779
|
}, children));
|
|
617
780
|
}
|
|
618
781
|
}]);
|
|
782
|
+
|
|
783
|
+
return LuxityPageReady;
|
|
619
784
|
}(React__default.Component);
|
|
785
|
+
|
|
620
786
|
LuxityPageReady.defaultProps = {
|
|
621
787
|
onIsLoading: function onIsLoading() {
|
|
622
788
|
return null;
|
|
@@ -732,6 +898,7 @@
|
|
|
732
898
|
var inputMarginRight = '0.2em';
|
|
733
899
|
var CheckboxLabel = styled__default.label(_templateObject$6 || (_templateObject$6 = _taggedTemplateLiteral(["\n cursor: pointer;\n position: relative;\n display: flex;\n align-items: center;\n\n span {\n :before {\n content: '\\2713';\n position: absolute;\n display: none;\n color: white;\n left: 0.4em;\n top: 0.1em;\n font-size: ", ";\n text-align: center;\n }\n }\n\n input {\n font-size: ", ";\n background-color: ", ";\n appearance: none;\n outline: none;\n height: 1em;\n width: 1em;\n margin-right: ", ";\n border: 1px solid ", ";\n border-radius: ", ";\n transition-duration: 0.3s;\n cursor: pointer;\n\n &:checked {\n background-color: ", ";\n }\n\n &:checked + span:before {\n display: block;\n }\n }\n"], ["\n cursor: pointer;\n position: relative;\n display: flex;\n align-items: center;\n\n span {\n :before {\n content: '\\\\2713';\n position: absolute;\n display: none;\n color: white;\n left: 0.4em;\n top: 0.1em;\n font-size: ", ";\n text-align: center;\n }\n }\n\n input {\n font-size: ", ";\n background-color: ", ";\n appearance: none;\n outline: none;\n height: 1em;\n width: 1em;\n margin-right: ", ";\n border: 1px solid ", ";\n border-radius: ", ";\n transition-duration: 0.3s;\n cursor: pointer;\n\n &:checked {\n background-color: ", ";\n }\n\n &:checked + span:before {\n display: block;\n }\n }\n"])), function (props) {
|
|
734
900
|
var _props$theme;
|
|
901
|
+
|
|
735
902
|
return (_props$theme = props.theme) !== null && _props$theme !== void 0 && _props$theme.fontSizes.length ? props.theme.fontSizes[4] : '1em';
|
|
736
903
|
}, function (props) {
|
|
737
904
|
return props.theme.fontSizes[4];
|
|
@@ -750,7 +917,8 @@
|
|
|
750
917
|
}
|
|
751
918
|
});
|
|
752
919
|
|
|
753
|
-
|
|
920
|
+
/** @format */
|
|
921
|
+
|
|
754
922
|
numeral.register('locale', 'en-ZA', {
|
|
755
923
|
delimiters: {
|
|
756
924
|
thousands: ',',
|
|
@@ -771,12 +939,12 @@
|
|
|
771
939
|
});
|
|
772
940
|
numeral.locale('en-ZA');
|
|
773
941
|
String.locale = numeral.locale;
|
|
774
|
-
|
|
775
942
|
/**
|
|
776
943
|
* Curreny Formatter
|
|
777
944
|
* @param {number} number - the number to be formatted
|
|
778
945
|
* @param {boolean} round - flag to indicate if the number needs to be rounded off
|
|
779
946
|
*/
|
|
947
|
+
|
|
780
948
|
function fC(number) {
|
|
781
949
|
var round = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
782
950
|
var parsedNumber = parseFloat(number);
|
|
@@ -784,7 +952,6 @@
|
|
|
784
952
|
}
|
|
785
953
|
|
|
786
954
|
/** @format */
|
|
787
|
-
|
|
788
955
|
var request = {
|
|
789
956
|
fetching: false,
|
|
790
957
|
failed: false,
|
|
@@ -891,35 +1058,48 @@
|
|
|
891
1058
|
|
|
892
1059
|
var _templateObject$9, _templateObject2, _templateObject3, _templateObject4;
|
|
893
1060
|
var MALE = genders.MALE,
|
|
894
|
-
|
|
895
|
-
|
|
1061
|
+
FEMALE = genders.FEMALE,
|
|
1062
|
+
UNISEX = genders.UNISEX;
|
|
1063
|
+
|
|
896
1064
|
var TrashIcon = function TrashIcon(_ref) {
|
|
897
1065
|
var onClick = _ref.onClick,
|
|
898
|
-
|
|
1066
|
+
id = _ref.id;
|
|
899
1067
|
return /*#__PURE__*/React__default.createElement(IconWrapper, {
|
|
900
1068
|
onClick: onClick,
|
|
901
1069
|
id: id
|
|
902
1070
|
}, /*#__PURE__*/React__default.createElement(SvgWrapper, null, /*#__PURE__*/React__default.createElement(Trash, null)));
|
|
903
1071
|
};
|
|
1072
|
+
|
|
904
1073
|
var InterestItem = /*#__PURE__*/function (_React$Component) {
|
|
1074
|
+
_inherits(InterestItem, _React$Component);
|
|
1075
|
+
|
|
1076
|
+
var _super = _createSuper(InterestItem);
|
|
1077
|
+
|
|
905
1078
|
function InterestItem(props) {
|
|
906
1079
|
var _this;
|
|
1080
|
+
|
|
907
1081
|
_classCallCheck(this, InterestItem);
|
|
908
|
-
|
|
909
|
-
|
|
1082
|
+
|
|
1083
|
+
_this = _super.call(this, props);
|
|
1084
|
+
|
|
1085
|
+
_defineProperty(_assertThisInitialized(_this), "deleteInterestItem", function () {
|
|
910
1086
|
var id = _this.props.data.id;
|
|
1087
|
+
|
|
911
1088
|
_this.setState({
|
|
912
1089
|
delete: _objectSpread2(_objectSpread2({}, request), {}, {
|
|
913
1090
|
fetching: true
|
|
914
1091
|
})
|
|
915
1092
|
});
|
|
1093
|
+
|
|
916
1094
|
var url = _this.props.deleteInterestApi(id);
|
|
1095
|
+
|
|
917
1096
|
simpleRequest(_this.props.requestInstance, url, method.DELETE, null, function () {
|
|
918
1097
|
_this.setState({
|
|
919
1098
|
delete: _objectSpread2(_objectSpread2({}, request), {}, {
|
|
920
1099
|
success: true
|
|
921
1100
|
})
|
|
922
1101
|
});
|
|
1102
|
+
|
|
923
1103
|
_this.props.onDeleted(_this.props.data);
|
|
924
1104
|
}, function () {
|
|
925
1105
|
return _this.setState({
|
|
@@ -927,25 +1107,32 @@
|
|
|
927
1107
|
});
|
|
928
1108
|
});
|
|
929
1109
|
});
|
|
930
|
-
|
|
1110
|
+
|
|
1111
|
+
_defineProperty(_assertThisInitialized(_this), "getGender", function (gender) {
|
|
931
1112
|
switch (gender) {
|
|
932
1113
|
case MALE:
|
|
933
1114
|
return 'Male';
|
|
1115
|
+
|
|
934
1116
|
case FEMALE:
|
|
935
1117
|
return 'Female';
|
|
1118
|
+
|
|
936
1119
|
case UNISEX:
|
|
937
1120
|
default:
|
|
938
1121
|
return 'Unisex';
|
|
939
1122
|
}
|
|
940
1123
|
});
|
|
941
|
-
|
|
1124
|
+
|
|
1125
|
+
_defineProperty(_assertThisInitialized(_this), "getCategory", function (category) {
|
|
942
1126
|
if (category === interestCategories.APPAREL) {
|
|
943
1127
|
return 'CLOTHING';
|
|
944
1128
|
}
|
|
1129
|
+
|
|
945
1130
|
return category;
|
|
946
1131
|
});
|
|
947
|
-
|
|
1132
|
+
|
|
1133
|
+
_defineProperty(_assertThisInitialized(_this), "render", function () {
|
|
948
1134
|
var _data$min_shoe_size, _data$max_shoe_size;
|
|
1135
|
+
|
|
949
1136
|
var data = _this.props.data;
|
|
950
1137
|
var success = _this.state.delete.success;
|
|
951
1138
|
return /*#__PURE__*/React__default.createElement(InterestItemContainer, {
|
|
@@ -995,14 +1182,16 @@
|
|
|
995
1182
|
}
|
|
996
1183
|
}));
|
|
997
1184
|
});
|
|
1185
|
+
|
|
998
1186
|
_this.state = {
|
|
999
1187
|
delete: _objectSpread2({}, request)
|
|
1000
1188
|
};
|
|
1001
1189
|
return _this;
|
|
1002
1190
|
}
|
|
1003
|
-
|
|
1191
|
+
|
|
1004
1192
|
return _createClass(InterestItem);
|
|
1005
1193
|
}(React__default.Component);
|
|
1194
|
+
|
|
1006
1195
|
var SheoSizeContentDiv = styled__default.div(_templateObject$9 || (_templateObject$9 = _taggedTemplateLiteral(["\n @media (max-width: ", ") {\n display: none;\n }\n"])), media.xs);
|
|
1007
1196
|
var InterestItemTitle = styled__default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n font-weight: bold;\n display: none;\n\n @media (max-width: ", ") {\n display: inline;\n }\n"])), media.xs);
|
|
1008
1197
|
var InterestItemContainer = styled__default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n\n .no-shoe-size-section {\n @media (max-width: ", ") {\n display: none;\n }\n }\n"])), media.xs);
|
|
@@ -1018,11 +1207,11 @@
|
|
|
1018
1207
|
return props.theme.marginPaddings[0];
|
|
1019
1208
|
}, media.xs);
|
|
1020
1209
|
var ThemedInterestItem = themed(InterestItem);
|
|
1021
|
-
|
|
1022
1210
|
/**
|
|
1023
1211
|
* The Interest Item view shows the selected interest configuration,
|
|
1024
1212
|
* and gives user control to delete it.
|
|
1025
1213
|
*/
|
|
1214
|
+
|
|
1026
1215
|
var InterestItem$1 = (function (props) {
|
|
1027
1216
|
return /*#__PURE__*/React__default.createElement(ThemedInterestItem, props);
|
|
1028
1217
|
});
|
|
@@ -1069,14 +1258,16 @@
|
|
|
1069
1258
|
*/
|
|
1070
1259
|
var RadioButtons = function RadioButtons(_ref) {
|
|
1071
1260
|
var options = _ref.options,
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1261
|
+
name = _ref.name,
|
|
1262
|
+
noWrap = _ref.noWrap,
|
|
1263
|
+
title = _ref.title,
|
|
1264
|
+
errors = _ref.errors;
|
|
1265
|
+
|
|
1076
1266
|
var _useState = React.useState(errors[name]),
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1267
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
1268
|
+
errMsg = _useState2[0],
|
|
1269
|
+
setErrMsg = _useState2[1];
|
|
1270
|
+
|
|
1080
1271
|
React.useEffect(function () {
|
|
1081
1272
|
setErrMsg(errors[name]);
|
|
1082
1273
|
}, [errors, name]);
|
|
@@ -1084,15 +1275,15 @@
|
|
|
1084
1275
|
noWrap: noWrap
|
|
1085
1276
|
}, options.map(function (_ref2, index) {
|
|
1086
1277
|
var _ref2$actionCallback = _ref2.actionCallback,
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1278
|
+
actionCallback = _ref2$actionCallback === void 0 ? function () {
|
|
1279
|
+
return null;
|
|
1280
|
+
} : _ref2$actionCallback,
|
|
1281
|
+
_ref2$value = _ref2.value,
|
|
1282
|
+
value = _ref2$value === void 0 ? '' : _ref2$value,
|
|
1283
|
+
_ref2$innerText = _ref2.innerText,
|
|
1284
|
+
innerText = _ref2$innerText === void 0 ? '' : _ref2$innerText,
|
|
1285
|
+
_ref2$checked = _ref2.checked,
|
|
1286
|
+
checked = _ref2$checked === void 0 ? false : _ref2$checked;
|
|
1096
1287
|
return /*#__PURE__*/React__default.createElement(RadioButtonLabel, {
|
|
1097
1288
|
key: "".concat(name, "-").concat(index),
|
|
1098
1289
|
htmlFor: "".concat(name, "_").concat(index)
|
|
@@ -1109,6 +1300,7 @@
|
|
|
1109
1300
|
}), /*#__PURE__*/React__default.createElement(RadioButtonCircle, null, /*#__PURE__*/React__default.createElement(RadioButtonCircleInner, null)), /*#__PURE__*/React__default.createElement(RadioButtonText, null, innerText));
|
|
1110
1301
|
}))), errMsg && /*#__PURE__*/React__default.createElement(ErrorMessage, null, errMsg));
|
|
1111
1302
|
};
|
|
1303
|
+
|
|
1112
1304
|
RadioButtons.defaultProps = {
|
|
1113
1305
|
noWrap: false,
|
|
1114
1306
|
title: '',
|
|
@@ -1117,8 +1309,8 @@
|
|
|
1117
1309
|
var RadioButtons$1 = themed(RadioButtons);
|
|
1118
1310
|
|
|
1119
1311
|
var _templateObject$i, _templateObject2$1, _templateObject3$1, _templateObject4$1, _templateObject5;
|
|
1120
|
-
|
|
1121
1312
|
/* position relative is required for the Body element to be positioned correctly */
|
|
1313
|
+
|
|
1122
1314
|
var relativeInlineStyle = styled.css(_templateObject$i || (_templateObject$i = _taggedTemplateLiteral(["\n position: relative;\n"])));
|
|
1123
1315
|
var topMiddleBodyStyle = styled.css(_templateObject2$1 || (_templateObject2$1 = _taggedTemplateLiteral(["\n position: absolute;\n z-index: 1;\n bottom: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n"])));
|
|
1124
1316
|
var getTopMiddleArrowAfterStyle = function getTopMiddleArrowAfterStyle(props) {
|
|
@@ -1132,31 +1324,40 @@
|
|
|
1132
1324
|
};
|
|
1133
1325
|
|
|
1134
1326
|
var _templateObject$j;
|
|
1327
|
+
|
|
1135
1328
|
var getBodyStyle = function getBodyStyle() {
|
|
1136
1329
|
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1137
1330
|
var _props$toolTipPositio = props.toolTipPosition,
|
|
1138
|
-
|
|
1331
|
+
toolTipPosition = _props$toolTipPositio === void 0 ? '' : _props$toolTipPositio;
|
|
1332
|
+
|
|
1139
1333
|
switch (toolTipPosition) {
|
|
1140
1334
|
case 'top':
|
|
1141
1335
|
return topMiddleBodyStyle;
|
|
1336
|
+
|
|
1142
1337
|
case 'bottom':
|
|
1143
1338
|
return getBottomMiddleBodyStyle(props);
|
|
1339
|
+
|
|
1144
1340
|
default:
|
|
1145
1341
|
return null;
|
|
1146
1342
|
}
|
|
1147
1343
|
};
|
|
1344
|
+
|
|
1148
1345
|
var getAfterStyling = function getAfterStyling() {
|
|
1149
1346
|
var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
1150
1347
|
var toolTipPosition = props.toolTipPosition;
|
|
1348
|
+
|
|
1151
1349
|
switch (toolTipPosition) {
|
|
1152
1350
|
case 'top':
|
|
1153
1351
|
return getTopMiddleArrowAfterStyle(props);
|
|
1352
|
+
|
|
1154
1353
|
case 'bottom':
|
|
1155
1354
|
return getBottomMiddleArrowAfterStyle(props);
|
|
1355
|
+
|
|
1156
1356
|
default:
|
|
1157
1357
|
return '';
|
|
1158
1358
|
}
|
|
1159
1359
|
};
|
|
1360
|
+
|
|
1160
1361
|
var Body$1 = styled__default.span(_templateObject$j || (_templateObject$j = _taggedTemplateLiteral(["\n ", ";\n visibility: hidden;\n opacity: 0;\n width: ", ";\n transition: visibility 0.3s linear, opacity 0.3s linear;\n background-color: ", ";\n color: white;\n text-align: center;\n border-radius: 5px;\n ", "\n &::after {\n content: ' ';\n position: absolute;\n ", "\n }\n"])), relativeInlineStyle, function (props) {
|
|
1161
1362
|
return props.bodyWidth;
|
|
1162
1363
|
}, function (props) {
|
|
@@ -1175,20 +1376,25 @@
|
|
|
1175
1376
|
var baseButtonStyle = styled.css(_templateObject2$2 || (_templateObject2$2 = _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"])));
|
|
1176
1377
|
|
|
1177
1378
|
var _excluded = ["children"];
|
|
1379
|
+
|
|
1178
1380
|
var _templateObject$m;
|
|
1179
1381
|
var Button = styled__default.button(_templateObject$m || (_templateObject$m = _taggedTemplateLiteral(["\n ", ";\n background-color: #fff;\n color: ", ";\n border: 1px solid ", ";\n\n &:disabled {\n ", "\n }\n"])), baseButtonStyle, function (props) {
|
|
1180
1382
|
return props.theme.colors.primary;
|
|
1181
1383
|
}, function (props) {
|
|
1182
1384
|
return props.theme.colors.primary;
|
|
1183
1385
|
}, disabledButtonStyle);
|
|
1386
|
+
|
|
1184
1387
|
var PrimaryButton = function PrimaryButton(_ref) {
|
|
1185
1388
|
var children = _ref.children,
|
|
1186
|
-
|
|
1389
|
+
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
1390
|
+
|
|
1187
1391
|
return /*#__PURE__*/React__default.createElement(Button, restProps, children);
|
|
1188
1392
|
};
|
|
1393
|
+
|
|
1189
1394
|
var PrimaryButton$1 = themed(PrimaryButton);
|
|
1190
1395
|
|
|
1191
1396
|
var _excluded$1 = ["children"];
|
|
1397
|
+
|
|
1192
1398
|
var _templateObject$n;
|
|
1193
1399
|
var Button$1 = styled__default.button(_templateObject$n || (_templateObject$n = _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) {
|
|
1194
1400
|
return props.theme.colors.ntrlMin;
|
|
@@ -1203,14 +1409,18 @@
|
|
|
1203
1409
|
}, disabledButtonStyle, function (props) {
|
|
1204
1410
|
return props.theme.colors.base;
|
|
1205
1411
|
});
|
|
1412
|
+
|
|
1206
1413
|
var SecondaryButton = function SecondaryButton(_ref) {
|
|
1207
1414
|
var children = _ref.children,
|
|
1208
|
-
|
|
1415
|
+
restProps = _objectWithoutProperties(_ref, _excluded$1);
|
|
1416
|
+
|
|
1209
1417
|
return /*#__PURE__*/React__default.createElement(Button$1, restProps, children);
|
|
1210
1418
|
};
|
|
1419
|
+
|
|
1211
1420
|
var SecondaryButton$1 = themed(SecondaryButton);
|
|
1212
1421
|
|
|
1213
1422
|
var _excluded$2 = ["children"];
|
|
1423
|
+
|
|
1214
1424
|
var _templateObject$o;
|
|
1215
1425
|
var Button$2 = styled__default.button(_templateObject$o || (_templateObject$o = _taggedTemplateLiteral(["\n ", ";\n background-color: transparent;\n color: ", ";\n &:hover {\n color: ", ";\n }\n &:disabled {\n ", ";\n color: ", ";\n }\n"])), baseButtonStyle, function (props) {
|
|
1216
1426
|
return props.theme.colors.base;
|
|
@@ -1219,17 +1429,21 @@
|
|
|
1219
1429
|
}, disabledButtonStyle, function (props) {
|
|
1220
1430
|
return props.theme.colors.base;
|
|
1221
1431
|
});
|
|
1432
|
+
|
|
1222
1433
|
var TextButton = function TextButton(_ref) {
|
|
1223
1434
|
var children = _ref.children,
|
|
1224
|
-
|
|
1435
|
+
restProps = _objectWithoutProperties(_ref, _excluded$2);
|
|
1436
|
+
|
|
1225
1437
|
return /*#__PURE__*/React__default.createElement(Button$2, restProps, children);
|
|
1226
1438
|
};
|
|
1439
|
+
|
|
1227
1440
|
TextButton.defaultProps = {
|
|
1228
1441
|
type: 'button'
|
|
1229
1442
|
};
|
|
1230
1443
|
var TextButton$1 = themed(TextButton);
|
|
1231
1444
|
|
|
1232
1445
|
var _excluded$3 = ["children"];
|
|
1446
|
+
|
|
1233
1447
|
var _templateObject$p;
|
|
1234
1448
|
var Button$3 = styled__default(TextButton$1)(_templateObject$p || (_templateObject$p = _taggedTemplateLiteral(["\n color: ", ";\n background-color: ", ";\n &:hover {\n color: ", ";\n background-color: ", ";\n }\n &:disabled {\n background-color: ", ";\n color: ", ";\n }\n"])), function (props) {
|
|
1235
1449
|
return props.theme.colors.ntrlMin;
|
|
@@ -1244,19 +1458,25 @@
|
|
|
1244
1458
|
}, function (props) {
|
|
1245
1459
|
return props.theme.colors.primary;
|
|
1246
1460
|
});
|
|
1461
|
+
|
|
1247
1462
|
var InvertedTextButton = function InvertedTextButton(_ref) {
|
|
1248
1463
|
var children = _ref.children,
|
|
1249
|
-
|
|
1464
|
+
restProps = _objectWithoutProperties(_ref, _excluded$3);
|
|
1465
|
+
|
|
1250
1466
|
return /*#__PURE__*/React__default.createElement(Button$3, restProps, children);
|
|
1251
1467
|
};
|
|
1468
|
+
|
|
1252
1469
|
var InvertedTextButton$1 = themed(InvertedTextButton);
|
|
1253
1470
|
|
|
1254
1471
|
var _excluded$4 = ["children"];
|
|
1472
|
+
|
|
1255
1473
|
var _templateObject$q;
|
|
1256
1474
|
var Button$4 = styled__default.button(_templateObject$q || (_templateObject$q = _taggedTemplateLiteral(["\n outline: none;\n cursor: pointer;\n background-color: transparent;\n border: none;\n &:disabled {\n ", ";\n }\n"])), disabledButtonStyle);
|
|
1475
|
+
|
|
1257
1476
|
var WrapperButton = function WrapperButton(_ref) {
|
|
1258
1477
|
var children = _ref.children,
|
|
1259
|
-
|
|
1478
|
+
restProps = _objectWithoutProperties(_ref, _excluded$4);
|
|
1479
|
+
|
|
1260
1480
|
return /*#__PURE__*/React__default.createElement(Button$4, restProps, children);
|
|
1261
1481
|
};
|
|
1262
1482
|
|
|
@@ -1265,28 +1485,31 @@
|
|
|
1265
1485
|
var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
1266
1486
|
return value.replace(/\D/g, '');
|
|
1267
1487
|
};
|
|
1268
|
-
|
|
1269
1488
|
/**
|
|
1270
1489
|
* Currency Input which formats the value to a specific format
|
|
1271
1490
|
*/
|
|
1491
|
+
|
|
1272
1492
|
var CurrencyInputFormatter = function CurrencyInputFormatter(_ref) {
|
|
1273
1493
|
var value = _ref.value,
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1494
|
+
onChange = _ref.onChange,
|
|
1495
|
+
prefix = _ref.prefix,
|
|
1496
|
+
allowNegativeValue = _ref.allowNegativeValue,
|
|
1497
|
+
groupSeparator = _ref.groupSeparator,
|
|
1498
|
+
decimalSeparator = _ref.decimalSeparator,
|
|
1499
|
+
rest = _objectWithoutProperties(_ref, _excluded$5);
|
|
1500
|
+
|
|
1280
1501
|
var handleValueChange = function handleValueChange(event) {
|
|
1281
1502
|
var inputValue = event.target.value;
|
|
1282
1503
|
var unmaskedValue = unMask(inputValue);
|
|
1283
1504
|
onChange(unmaskedValue);
|
|
1284
1505
|
};
|
|
1506
|
+
|
|
1285
1507
|
var formatCurrency = function formatCurrency(originalValue) {
|
|
1286
1508
|
var numericValue = Number(originalValue);
|
|
1287
1509
|
var formattedValue = numericValue.toLocaleString('en-US');
|
|
1288
1510
|
return prefix + formattedValue;
|
|
1289
1511
|
};
|
|
1512
|
+
|
|
1290
1513
|
var formattedValue = formatCurrency(value);
|
|
1291
1514
|
return /*#__PURE__*/React__default.createElement("input", _extends({}, rest, {
|
|
1292
1515
|
type: "text",
|
|
@@ -1294,6 +1517,7 @@
|
|
|
1294
1517
|
onChange: handleValueChange
|
|
1295
1518
|
}));
|
|
1296
1519
|
};
|
|
1520
|
+
|
|
1297
1521
|
CurrencyInputFormatter.defaultProps = {
|
|
1298
1522
|
value: '',
|
|
1299
1523
|
prefix: 'R',
|
|
@@ -7871,6 +8095,7 @@
|
|
|
7871
8095
|
var ReactSelectWrapper = function ReactSelectWrapper(props) {
|
|
7872
8096
|
return /*#__PURE__*/React__default.createElement(index$1, props);
|
|
7873
8097
|
};
|
|
8098
|
+
|
|
7874
8099
|
ReactSelectWrapper.defaultProps = {
|
|
7875
8100
|
isMulti: false,
|
|
7876
8101
|
isSearchable: false,
|
|
@@ -7898,23 +8123,23 @@
|
|
|
7898
8123
|
return props.hasBorder ? props.theme.colors.borderColor : props.theme.colors.ntrlMin;
|
|
7899
8124
|
}, function (_ref) {
|
|
7900
8125
|
var isChecked = _ref.isChecked,
|
|
7901
|
-
|
|
8126
|
+
theme = _ref.theme;
|
|
7902
8127
|
return isChecked ? theme.colors.primary : theme.colors.gray;
|
|
7903
8128
|
}, function (_ref2) {
|
|
7904
8129
|
var isChecked = _ref2.isChecked,
|
|
7905
|
-
|
|
8130
|
+
theme = _ref2.theme;
|
|
7906
8131
|
return isChecked ? 'white' : theme.colors.base;
|
|
7907
8132
|
}, function (_ref3) {
|
|
7908
8133
|
var isChecked = _ref3.isChecked,
|
|
7909
|
-
|
|
8134
|
+
theme = _ref3.theme;
|
|
7910
8135
|
return isChecked ? theme.colors.ntrlMin : theme.colors.primary;
|
|
7911
8136
|
}, function (_ref4) {
|
|
7912
8137
|
var isChecked = _ref4.isChecked,
|
|
7913
|
-
|
|
8138
|
+
theme = _ref4.theme;
|
|
7914
8139
|
return isChecked ? 'white' : theme.colors.base;
|
|
7915
8140
|
}, function (_ref5) {
|
|
7916
8141
|
var isChecked = _ref5.isChecked,
|
|
7917
|
-
|
|
8142
|
+
theme = _ref5.theme;
|
|
7918
8143
|
return isChecked ? theme.colors.primary : 'white';
|
|
7919
8144
|
}, media.sm, function (props) {
|
|
7920
8145
|
return props.theme.marginPaddings[2];
|
|
@@ -8066,35 +8291,43 @@
|
|
|
8066
8291
|
|
|
8067
8292
|
var _templateObject$u, _templateObject2$3;
|
|
8068
8293
|
var categories = catArray;
|
|
8294
|
+
|
|
8069
8295
|
var getSvg = function getSvg() {
|
|
8070
8296
|
var category = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
8297
|
+
|
|
8071
8298
|
switch (category) {
|
|
8072
8299
|
case interestCategories.BAGS:
|
|
8073
8300
|
return /*#__PURE__*/React__default.createElement(Bags, null);
|
|
8301
|
+
|
|
8074
8302
|
case interestCategories.SHOES:
|
|
8075
8303
|
return /*#__PURE__*/React__default.createElement(Shoes, null);
|
|
8304
|
+
|
|
8076
8305
|
case interestCategories.APPAREL:
|
|
8077
8306
|
return /*#__PURE__*/React__default.createElement(Clothing, null);
|
|
8307
|
+
|
|
8078
8308
|
case interestCategories.ACCESSORIES:
|
|
8079
8309
|
return /*#__PURE__*/React__default.createElement(Accessories, null);
|
|
8310
|
+
|
|
8080
8311
|
case interestCategories.WATCHES:
|
|
8081
8312
|
return /*#__PURE__*/React__default.createElement(Watches, null);
|
|
8313
|
+
|
|
8082
8314
|
default:
|
|
8083
8315
|
return null;
|
|
8084
8316
|
}
|
|
8085
8317
|
};
|
|
8318
|
+
|
|
8086
8319
|
var Container$1 = styled__default.div(_templateObject$u || (_templateObject$u = _taggedTemplateLiteral(["\n margin-bottom: ", ";\n"])), function (props) {
|
|
8087
8320
|
return props.theme.marginPaddings[5];
|
|
8088
8321
|
});
|
|
8089
8322
|
var CategoryTitle = styled__default.h1(_templateObject2$3 || (_templateObject2$3 = _taggedTemplateLiteral(["\n margin-top: 10px;\n font-size: 14px;\n text-transform: uppercase;\n"])));
|
|
8090
|
-
|
|
8091
8323
|
/**
|
|
8092
8324
|
* InterestCatSelector is a specialized selector for select luxity specific interest categories
|
|
8093
8325
|
*/
|
|
8326
|
+
|
|
8094
8327
|
var InterestCatSelector = function InterestCatSelector(_ref) {
|
|
8095
8328
|
var onCategoryChange = _ref.onCategoryChange,
|
|
8096
|
-
|
|
8097
|
-
|
|
8329
|
+
errorMessage = _ref.errorMessage,
|
|
8330
|
+
category = _ref.category;
|
|
8098
8331
|
return /*#__PURE__*/React__default.createElement(Container$1, null, /*#__PURE__*/React__default.createElement(Body$2, null, categories.map(function (cat, index) {
|
|
8099
8332
|
return /*#__PURE__*/React__default.createElement(WrapperButton, {
|
|
8100
8333
|
key: "cat-".concat(index),
|
|
@@ -8109,6 +8342,7 @@
|
|
|
8109
8342
|
}, getSvg(cat.value), /*#__PURE__*/React__default.createElement(CategoryTitle, null, cat.categoryTitle)));
|
|
8110
8343
|
})), errorMessage && /*#__PURE__*/React__default.createElement(ErrorMessage$1, null, errorMessage));
|
|
8111
8344
|
};
|
|
8345
|
+
|
|
8112
8346
|
InterestCatSelector.defaultProps = {
|
|
8113
8347
|
errorMessage: '',
|
|
8114
8348
|
category: null,
|
|
@@ -8119,82 +8353,117 @@
|
|
|
8119
8353
|
var CategoryInterestSelector = themed(InterestCatSelector);
|
|
8120
8354
|
|
|
8121
8355
|
function _extends$2() {
|
|
8122
|
-
|
|
8123
|
-
for (var
|
|
8124
|
-
var
|
|
8125
|
-
|
|
8356
|
+
_extends$2 = Object.assign ? Object.assign.bind() : function (target) {
|
|
8357
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
8358
|
+
var source = arguments[i];
|
|
8359
|
+
|
|
8360
|
+
for (var key in source) {
|
|
8361
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
8362
|
+
target[key] = source[key];
|
|
8363
|
+
}
|
|
8364
|
+
}
|
|
8126
8365
|
}
|
|
8127
|
-
|
|
8128
|
-
|
|
8366
|
+
|
|
8367
|
+
return target;
|
|
8368
|
+
};
|
|
8369
|
+
return _extends$2.apply(this, arguments);
|
|
8129
8370
|
}
|
|
8130
8371
|
|
|
8131
|
-
function _assertThisInitialized$2(
|
|
8132
|
-
if (
|
|
8133
|
-
|
|
8372
|
+
function _assertThisInitialized$2(self) {
|
|
8373
|
+
if (self === void 0) {
|
|
8374
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
8375
|
+
}
|
|
8376
|
+
|
|
8377
|
+
return self;
|
|
8134
8378
|
}
|
|
8135
8379
|
|
|
8136
|
-
function _setPrototypeOf$2(
|
|
8137
|
-
|
|
8138
|
-
|
|
8139
|
-
|
|
8380
|
+
function _setPrototypeOf$2(o, p) {
|
|
8381
|
+
_setPrototypeOf$2 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
|
8382
|
+
o.__proto__ = p;
|
|
8383
|
+
return o;
|
|
8384
|
+
};
|
|
8385
|
+
return _setPrototypeOf$2(o, p);
|
|
8140
8386
|
}
|
|
8141
8387
|
|
|
8142
|
-
function _inheritsLoose(
|
|
8143
|
-
|
|
8388
|
+
function _inheritsLoose(subClass, superClass) {
|
|
8389
|
+
subClass.prototype = Object.create(superClass.prototype);
|
|
8390
|
+
subClass.prototype.constructor = subClass;
|
|
8391
|
+
_setPrototypeOf$2(subClass, superClass);
|
|
8144
8392
|
}
|
|
8145
8393
|
|
|
8146
|
-
function _getPrototypeOf$2(
|
|
8147
|
-
|
|
8148
|
-
return
|
|
8149
|
-
}
|
|
8394
|
+
function _getPrototypeOf$2(o) {
|
|
8395
|
+
_getPrototypeOf$2 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
|
|
8396
|
+
return o.__proto__ || Object.getPrototypeOf(o);
|
|
8397
|
+
};
|
|
8398
|
+
return _getPrototypeOf$2(o);
|
|
8150
8399
|
}
|
|
8151
8400
|
|
|
8152
|
-
function _isNativeFunction(
|
|
8153
|
-
|
|
8154
|
-
return -1 !== Function.toString.call(t).indexOf("[native code]");
|
|
8155
|
-
} catch (n) {
|
|
8156
|
-
return "function" == typeof t;
|
|
8157
|
-
}
|
|
8401
|
+
function _isNativeFunction(fn) {
|
|
8402
|
+
return Function.toString.call(fn).indexOf("[native code]") !== -1;
|
|
8158
8403
|
}
|
|
8159
8404
|
|
|
8160
8405
|
function _isNativeReflectConstruct$1() {
|
|
8406
|
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
8407
|
+
if (Reflect.construct.sham) return false;
|
|
8408
|
+
if (typeof Proxy === "function") return true;
|
|
8409
|
+
|
|
8161
8410
|
try {
|
|
8162
|
-
|
|
8163
|
-
|
|
8164
|
-
|
|
8165
|
-
return
|
|
8166
|
-
}
|
|
8411
|
+
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
8412
|
+
return true;
|
|
8413
|
+
} catch (e) {
|
|
8414
|
+
return false;
|
|
8415
|
+
}
|
|
8167
8416
|
}
|
|
8168
8417
|
|
|
8169
|
-
function _construct(
|
|
8170
|
-
if (_isNativeReflectConstruct$1())
|
|
8171
|
-
|
|
8172
|
-
|
|
8173
|
-
|
|
8174
|
-
|
|
8418
|
+
function _construct(Parent, args, Class) {
|
|
8419
|
+
if (_isNativeReflectConstruct$1()) {
|
|
8420
|
+
_construct = Reflect.construct.bind();
|
|
8421
|
+
} else {
|
|
8422
|
+
_construct = function _construct(Parent, args, Class) {
|
|
8423
|
+
var a = [null];
|
|
8424
|
+
a.push.apply(a, args);
|
|
8425
|
+
var Constructor = Function.bind.apply(Parent, a);
|
|
8426
|
+
var instance = new Constructor();
|
|
8427
|
+
if (Class) _setPrototypeOf$2(instance, Class.prototype);
|
|
8428
|
+
return instance;
|
|
8429
|
+
};
|
|
8430
|
+
}
|
|
8431
|
+
|
|
8432
|
+
return _construct.apply(null, arguments);
|
|
8175
8433
|
}
|
|
8176
8434
|
|
|
8177
|
-
function _wrapNativeSuper(
|
|
8178
|
-
var
|
|
8179
|
-
|
|
8180
|
-
|
|
8181
|
-
if (
|
|
8182
|
-
|
|
8183
|
-
|
|
8184
|
-
|
|
8435
|
+
function _wrapNativeSuper(Class) {
|
|
8436
|
+
var _cache = typeof Map === "function" ? new Map() : undefined;
|
|
8437
|
+
|
|
8438
|
+
_wrapNativeSuper = function _wrapNativeSuper(Class) {
|
|
8439
|
+
if (Class === null || !_isNativeFunction(Class)) return Class;
|
|
8440
|
+
|
|
8441
|
+
if (typeof Class !== "function") {
|
|
8442
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
8443
|
+
}
|
|
8444
|
+
|
|
8445
|
+
if (typeof _cache !== "undefined") {
|
|
8446
|
+
if (_cache.has(Class)) return _cache.get(Class);
|
|
8447
|
+
|
|
8448
|
+
_cache.set(Class, Wrapper);
|
|
8185
8449
|
}
|
|
8450
|
+
|
|
8186
8451
|
function Wrapper() {
|
|
8187
|
-
return _construct(
|
|
8452
|
+
return _construct(Class, arguments, _getPrototypeOf$2(this).constructor);
|
|
8188
8453
|
}
|
|
8189
|
-
|
|
8454
|
+
|
|
8455
|
+
Wrapper.prototype = Object.create(Class.prototype, {
|
|
8190
8456
|
constructor: {
|
|
8191
8457
|
value: Wrapper,
|
|
8192
|
-
enumerable:
|
|
8193
|
-
writable:
|
|
8194
|
-
configurable:
|
|
8458
|
+
enumerable: false,
|
|
8459
|
+
writable: true,
|
|
8460
|
+
configurable: true
|
|
8195
8461
|
}
|
|
8196
|
-
})
|
|
8197
|
-
|
|
8462
|
+
});
|
|
8463
|
+
return _setPrototypeOf$2(Wrapper, Class);
|
|
8464
|
+
};
|
|
8465
|
+
|
|
8466
|
+
return _wrapNativeSuper(Class);
|
|
8198
8467
|
}
|
|
8199
8468
|
|
|
8200
8469
|
// based on https://github.com/styled-components/styled-components/blob/fcf6f3804c57a14dd7984dfab7bc06ee2edca044/src/utils/error.js
|
|
@@ -8863,9 +9132,10 @@
|
|
|
8863
9132
|
}, function (props) {
|
|
8864
9133
|
return getSliderMarkStyle(props);
|
|
8865
9134
|
});
|
|
9135
|
+
|
|
8866
9136
|
var getSliderMarkStyle = function getSliderMarkStyle(_ref) {
|
|
8867
9137
|
var showMarks = _ref.showMarks,
|
|
8868
|
-
|
|
9138
|
+
primary = _ref.theme.colors.primary;
|
|
8869
9139
|
var visiblityStyle = showMarks ? styled.css(_templateObject2$4 || (_templateObject2$4 = _taggedTemplateLiteral([""]))) : styled.css(_templateObject3$2 || (_templateObject3$2 = _taggedTemplateLiteral(["\n .rc-slider-mark-text,\n .rc-slider-dot {\n visibility: hidden;\n }\n "])));
|
|
8870
9140
|
return styled.css(_templateObject4$2 || (_templateObject4$2 = _taggedTemplateLiteral(["\n .rc-slider-mark-text {\n color: ", ";\n }\n\n .rc-slider-dot {\n border-color: ", ";\n background-color: white;\n }\n ", "\n "])), primary, primary, visiblityStyle);
|
|
8871
9141
|
};
|
|
@@ -8877,24 +9147,28 @@
|
|
|
8877
9147
|
var Footer = styled__default.div(_templateObject$y || (_templateObject$y = _taggedTemplateLiteral(["\n display: flex;\n flex-flow: row nowrap;\n justify-content: flex-end;\n"])));
|
|
8878
9148
|
|
|
8879
9149
|
var _excluded$6 = ["dragging", "value", "offset", "index"],
|
|
8880
|
-
|
|
9150
|
+
_excluded2 = ["renderTitleSection", "marks", "defaultMinValue", "defaultMaxValue", "min", "max", "toolTipComponent", "renderFooterSection", "onChange", "children", "identifier", "showMarks"];
|
|
9151
|
+
|
|
8881
9152
|
var _templateObject$z;
|
|
8882
9153
|
var debounceBuilder = functions.debounced(100);
|
|
8883
9154
|
var ChildrenWrapper = styled__default.div(_templateObject$z || (_templateObject$z = _taggedTemplateLiteral(["\n margin-bottom: ", ";\n"])), function (props) {
|
|
8884
9155
|
return props.theme.marginPaddings[3];
|
|
8885
9156
|
});
|
|
9157
|
+
|
|
8886
9158
|
var renderCustomHandle = function renderCustomHandle() {
|
|
8887
9159
|
var marks = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
8888
9160
|
var toolTipComponent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
8889
9161
|
var handleProps = arguments.length > 2 ? arguments[2] : undefined;
|
|
9162
|
+
|
|
8890
9163
|
var dragging = handleProps.dragging,
|
|
8891
|
-
|
|
8892
|
-
|
|
8893
|
-
|
|
8894
|
-
|
|
9164
|
+
value = handleProps.value,
|
|
9165
|
+
offset = handleProps.offset,
|
|
9166
|
+
index = handleProps.index,
|
|
9167
|
+
restHandleProps = _objectWithoutProperties(handleProps, _excluded$6);
|
|
9168
|
+
|
|
8895
9169
|
var getToolTipProps = function getToolTipProps() {
|
|
8896
|
-
var newProps = {};
|
|
8897
|
-
|
|
9170
|
+
var newProps = {}; // Ensures that Tooltip component does not get ref prop
|
|
9171
|
+
|
|
8898
9172
|
Object.keys(handleProps).forEach(function (propName) {
|
|
8899
9173
|
if (propName !== 'ref') {
|
|
8900
9174
|
newProps[propName] = handleProps[propName];
|
|
@@ -8902,6 +9176,7 @@
|
|
|
8902
9176
|
});
|
|
8903
9177
|
return newProps;
|
|
8904
9178
|
};
|
|
9179
|
+
|
|
8905
9180
|
var Tooltip = toolTipComponent;
|
|
8906
9181
|
return /*#__PURE__*/React__default.createElement(React.Fragment, {
|
|
8907
9182
|
key: index
|
|
@@ -8918,47 +9193,55 @@
|
|
|
8918
9193
|
marks: marks
|
|
8919
9194
|
}, getToolTipProps()))));
|
|
8920
9195
|
};
|
|
8921
|
-
|
|
8922
9196
|
/** slider ui component for react */
|
|
9197
|
+
|
|
9198
|
+
|
|
8923
9199
|
var RangeSlider = function RangeSlider(_ref) {
|
|
8924
9200
|
var renderTitleSection = _ref.renderTitleSection,
|
|
8925
|
-
|
|
8926
|
-
|
|
8927
|
-
|
|
8928
|
-
|
|
8929
|
-
|
|
8930
|
-
|
|
8931
|
-
|
|
8932
|
-
|
|
8933
|
-
|
|
8934
|
-
|
|
8935
|
-
|
|
8936
|
-
|
|
9201
|
+
marks = _ref.marks,
|
|
9202
|
+
defaultMinValue = _ref.defaultMinValue,
|
|
9203
|
+
defaultMaxValue = _ref.defaultMaxValue,
|
|
9204
|
+
min = _ref.min,
|
|
9205
|
+
max = _ref.max,
|
|
9206
|
+
toolTipComponent = _ref.toolTipComponent,
|
|
9207
|
+
renderFooterSection = _ref.renderFooterSection,
|
|
9208
|
+
onChange = _ref.onChange,
|
|
9209
|
+
childRenderer = _ref.children,
|
|
9210
|
+
identifier = _ref.identifier,
|
|
9211
|
+
showMarks = _ref.showMarks,
|
|
9212
|
+
restProps = _objectWithoutProperties(_ref, _excluded2);
|
|
9213
|
+
|
|
8937
9214
|
var _useState = React.useState(defaultMinValue),
|
|
8938
|
-
|
|
8939
|
-
|
|
8940
|
-
|
|
9215
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
9216
|
+
currMinVal = _useState2[0],
|
|
9217
|
+
setMinVal = _useState2[1];
|
|
9218
|
+
|
|
8941
9219
|
var _useState3 = React.useState(defaultMaxValue),
|
|
8942
|
-
|
|
8943
|
-
|
|
8944
|
-
|
|
9220
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
9221
|
+
currMaxVal = _useState4[0],
|
|
9222
|
+
setMaxVal = _useState4[1];
|
|
8945
9223
|
/*
|
|
8946
9224
|
*Description variable stores the time that the component renders
|
|
8947
9225
|
* the state is used to enforce reenders for the component since the date now
|
|
8948
9226
|
* is always changing
|
|
8949
9227
|
* */
|
|
9228
|
+
|
|
9229
|
+
|
|
8950
9230
|
var _useState5 = React.useState(0),
|
|
8951
|
-
|
|
8952
|
-
|
|
8953
|
-
|
|
9231
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
9232
|
+
seed = _useState6[0],
|
|
9233
|
+
setSeed = _useState6[1];
|
|
9234
|
+
|
|
8954
9235
|
var manuallyChangeMinValue = function manuallyChangeMinValue(val) {
|
|
8955
9236
|
setMinVal(val);
|
|
8956
9237
|
setSeed(Date.now());
|
|
8957
9238
|
};
|
|
9239
|
+
|
|
8958
9240
|
var manuallyChangeMaxValue = function manuallyChangeMaxValue(val) {
|
|
8959
9241
|
setMaxVal(val);
|
|
8960
9242
|
setSeed(Date.now());
|
|
8961
9243
|
};
|
|
9244
|
+
|
|
8962
9245
|
var prevMinVal = functions.usePrevious(currMinVal);
|
|
8963
9246
|
var prevMaxVal = functions.usePrevious(currMaxVal);
|
|
8964
9247
|
React.useEffect(function () {
|
|
@@ -8994,8 +9277,9 @@
|
|
|
8994
9277
|
defaultValue: [defaultMinValue, defaultMaxValue],
|
|
8995
9278
|
onChange: function onChange(_ref2) {
|
|
8996
9279
|
var _ref3 = _slicedToArray(_ref2, 2),
|
|
8997
|
-
|
|
8998
|
-
|
|
9280
|
+
nextMin = _ref3[0],
|
|
9281
|
+
nextMax = _ref3[1];
|
|
9282
|
+
|
|
8999
9283
|
setMinVal(nextMin);
|
|
9000
9284
|
setMaxVal(nextMax);
|
|
9001
9285
|
},
|
|
@@ -9008,6 +9292,7 @@
|
|
|
9008
9292
|
allowCross: false
|
|
9009
9293
|
}, restProps)), /*#__PURE__*/React__default.createElement(Footer, null, renderFooterSection(actionsObj)));
|
|
9010
9294
|
};
|
|
9295
|
+
|
|
9011
9296
|
RangeSlider.defaultProps = {
|
|
9012
9297
|
renderTitleSection: function renderTitleSection() {
|
|
9013
9298
|
return false;
|
|
@@ -9038,10 +9323,11 @@
|
|
|
9038
9323
|
}, function (props) {
|
|
9039
9324
|
return props.theme.marginPaddings[3];
|
|
9040
9325
|
});
|
|
9326
|
+
|
|
9041
9327
|
var InterestsSubheading = function InterestsSubheading(_ref) {
|
|
9042
9328
|
var title = _ref.title,
|
|
9043
|
-
|
|
9044
|
-
|
|
9329
|
+
children = _ref.children,
|
|
9330
|
+
className = _ref.className;
|
|
9045
9331
|
return /*#__PURE__*/React__default.createElement(InterestsSubheadingContainer, {
|
|
9046
9332
|
className: className
|
|
9047
9333
|
}, /*#__PURE__*/React__default.createElement(Title$2, null, title), /*#__PURE__*/React__default.createElement("div", null, children));
|
|
@@ -9053,23 +9339,31 @@
|
|
|
9053
9339
|
});
|
|
9054
9340
|
|
|
9055
9341
|
var debounceBuilder$1 = functions.debounced(50);
|
|
9342
|
+
|
|
9056
9343
|
var getMaxPrice = function getMaxPrice() {
|
|
9057
9344
|
var interestCategory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
9345
|
+
|
|
9058
9346
|
switch (interestCategory) {
|
|
9059
9347
|
case interestCategories.ACCESSORIES:
|
|
9060
9348
|
return interestCategoryMaxPrices.ACCESSORIES;
|
|
9349
|
+
|
|
9061
9350
|
case interestCategories.BAGS:
|
|
9062
9351
|
return interestCategoryMaxPrices.BAGS;
|
|
9352
|
+
|
|
9063
9353
|
case interestCategories.SHOES:
|
|
9064
9354
|
return interestCategoryMaxPrices.SHOES;
|
|
9355
|
+
|
|
9065
9356
|
case interestCategories.WATCHES:
|
|
9066
9357
|
return interestCategoryMaxPrices.WATCHES;
|
|
9358
|
+
|
|
9067
9359
|
case interestCategories.APPAREL:
|
|
9068
9360
|
return interestCategoryMaxPrices.APPAREL;
|
|
9361
|
+
|
|
9069
9362
|
default:
|
|
9070
9363
|
return 0;
|
|
9071
9364
|
}
|
|
9072
9365
|
};
|
|
9366
|
+
|
|
9073
9367
|
var getFooterButtons = function getFooterButtons(actionObj) {
|
|
9074
9368
|
var giveFullRange = actionObj.giveFullRange;
|
|
9075
9369
|
return /*#__PURE__*/React__default.createElement(SecondaryButton$1, {
|
|
@@ -9077,21 +9371,24 @@
|
|
|
9077
9371
|
onClick: giveFullRange
|
|
9078
9372
|
}, "Full Price Range");
|
|
9079
9373
|
};
|
|
9080
|
-
|
|
9081
9374
|
/** UI Slider with minimum and max input fields give the ability to
|
|
9082
9375
|
* select a price range */
|
|
9376
|
+
|
|
9377
|
+
|
|
9083
9378
|
var PriceRangeSelector = function PriceRangeSelector(_ref) {
|
|
9084
9379
|
var onChange = _ref.onChange,
|
|
9085
|
-
|
|
9380
|
+
category = _ref.category;
|
|
9086
9381
|
var maxPrice = getMaxPrice(category);
|
|
9382
|
+
|
|
9087
9383
|
var handleSlideChange = function handleSlideChange(value) {
|
|
9088
9384
|
var min_price = value.min,
|
|
9089
|
-
|
|
9385
|
+
max_price = value.max;
|
|
9090
9386
|
onChange({
|
|
9091
9387
|
min_price: min_price,
|
|
9092
9388
|
max_price: max_price
|
|
9093
9389
|
});
|
|
9094
9390
|
};
|
|
9391
|
+
|
|
9095
9392
|
var handleMinCurrencyChange = function handleMinCurrencyChange(targetValue, currMaxVal, manuallyChangeMinValue) {
|
|
9096
9393
|
var value = parseInt(unMask(targetValue), 10);
|
|
9097
9394
|
value = Number.isNaN(value) ? 0 : value;
|
|
@@ -9104,6 +9401,7 @@
|
|
|
9104
9401
|
});
|
|
9105
9402
|
});
|
|
9106
9403
|
};
|
|
9404
|
+
|
|
9107
9405
|
var handleMaxCurrencyChange = function handleMaxCurrencyChange(targetValue, currMinVal, manuallyChangeMaxValue) {
|
|
9108
9406
|
var value = parseInt(unMask(targetValue), 10);
|
|
9109
9407
|
value = Number.isNaN(value) ? 0 : value;
|
|
@@ -9116,6 +9414,7 @@
|
|
|
9116
9414
|
});
|
|
9117
9415
|
});
|
|
9118
9416
|
};
|
|
9417
|
+
|
|
9119
9418
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
9120
9419
|
className: "price-ranges"
|
|
9121
9420
|
}, /*#__PURE__*/React__default.createElement(RangeSlider$1, {
|
|
@@ -9134,9 +9433,9 @@
|
|
|
9134
9433
|
title: "Price Ranges"
|
|
9135
9434
|
}, function (_ref2) {
|
|
9136
9435
|
var manuallyChangeMinValue = _ref2.manuallyChangeMinValue,
|
|
9137
|
-
|
|
9138
|
-
|
|
9139
|
-
|
|
9436
|
+
manuallyChangeMaxValue = _ref2.manuallyChangeMaxValue,
|
|
9437
|
+
currMinVal = _ref2.currMinVal,
|
|
9438
|
+
currMaxVal = _ref2.currMaxVal;
|
|
9140
9439
|
return /*#__PURE__*/React__default.createElement(CurrencyInputWrapper, null, /*#__PURE__*/React__default.createElement(CurrencyInputFormatter, {
|
|
9141
9440
|
"data-qe-id": "masked-input-min",
|
|
9142
9441
|
value: currMinVal,
|
|
@@ -9152,6 +9451,7 @@
|
|
|
9152
9451
|
}));
|
|
9153
9452
|
}));
|
|
9154
9453
|
};
|
|
9454
|
+
|
|
9155
9455
|
PriceRangeSelector.defaultProps = {
|
|
9156
9456
|
onChange: function onChange() {
|
|
9157
9457
|
return false;
|
|
@@ -9172,6 +9472,7 @@
|
|
|
9172
9472
|
var shoe_sizes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
9173
9473
|
return shoe_sizes.length - 1;
|
|
9174
9474
|
};
|
|
9475
|
+
|
|
9175
9476
|
var formatResultsForRangeSlider = function formatResultsForRangeSlider() {
|
|
9176
9477
|
var shoe_sizes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
9177
9478
|
var newDataShape = {};
|
|
@@ -9181,24 +9482,28 @@
|
|
|
9181
9482
|
});
|
|
9182
9483
|
return newDataShape;
|
|
9183
9484
|
};
|
|
9485
|
+
|
|
9184
9486
|
var ToolTipComponent = function ToolTipComponent(props) {
|
|
9185
9487
|
var marks = props.marks,
|
|
9186
|
-
|
|
9488
|
+
value = props.value;
|
|
9187
9489
|
return /*#__PURE__*/React__default.createElement("div", null, marks[value]);
|
|
9188
9490
|
};
|
|
9189
|
-
|
|
9190
9491
|
/** slider ui component for shoe size selection interests */
|
|
9492
|
+
|
|
9493
|
+
|
|
9191
9494
|
var ShoeSizeSelector = function ShoeSizeSelector(_ref2) {
|
|
9192
9495
|
var onChange = _ref2.onChange,
|
|
9193
|
-
|
|
9496
|
+
shoeSizes = _ref2.shoeSizes;
|
|
9497
|
+
|
|
9194
9498
|
var handleShoeSizeChange = function handleShoeSizeChange(value) {
|
|
9195
9499
|
var min_shoe_key = value.min,
|
|
9196
|
-
|
|
9500
|
+
max_shoe_key = value.max;
|
|
9197
9501
|
onChange({
|
|
9198
9502
|
min_shoe_size_id: shoeSizes[min_shoe_key].id,
|
|
9199
9503
|
max_shoe_size_id: shoeSizes[max_shoe_key].id
|
|
9200
9504
|
});
|
|
9201
9505
|
};
|
|
9506
|
+
|
|
9202
9507
|
var getFooterButtons = function getFooterButtons(actionObj) {
|
|
9203
9508
|
var giveFullRange = actionObj.giveFullRange;
|
|
9204
9509
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(InvertedTextButton$1, {
|
|
@@ -9207,6 +9512,7 @@
|
|
|
9207
9512
|
onClick: giveFullRange
|
|
9208
9513
|
}, "Full Shoe Size Range"));
|
|
9209
9514
|
};
|
|
9515
|
+
|
|
9210
9516
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(RangeSlider$1, {
|
|
9211
9517
|
identifier: "shoe-size-range-slider",
|
|
9212
9518
|
marks: formatResultsForRangeSlider(shoeSizes),
|
|
@@ -9219,6 +9525,7 @@
|
|
|
9219
9525
|
onChange: handleShoeSizeChange
|
|
9220
9526
|
}));
|
|
9221
9527
|
};
|
|
9528
|
+
|
|
9222
9529
|
ShoeSizeSelector.defaultProps = {
|
|
9223
9530
|
onChange: function onChange() {
|
|
9224
9531
|
return false;
|
|
@@ -9227,17 +9534,23 @@
|
|
|
9227
9534
|
};
|
|
9228
9535
|
|
|
9229
9536
|
var SimpleErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
9537
|
+
_inherits(SimpleErrorBoundary, _React$Component);
|
|
9538
|
+
|
|
9539
|
+
var _super = _createSuper(SimpleErrorBoundary);
|
|
9540
|
+
|
|
9230
9541
|
function SimpleErrorBoundary(props) {
|
|
9231
9542
|
var _this;
|
|
9543
|
+
|
|
9232
9544
|
_classCallCheck(this, SimpleErrorBoundary);
|
|
9233
|
-
|
|
9545
|
+
|
|
9546
|
+
_this = _super.call(this, props);
|
|
9234
9547
|
_this.state = {
|
|
9235
9548
|
hasError: false
|
|
9236
9549
|
};
|
|
9237
9550
|
return _this;
|
|
9238
9551
|
}
|
|
9239
|
-
|
|
9240
|
-
|
|
9552
|
+
|
|
9553
|
+
_createClass(SimpleErrorBoundary, [{
|
|
9241
9554
|
key: "componentDidCatch",
|
|
9242
9555
|
value: function componentDidCatch(error, errorInfo) {
|
|
9243
9556
|
// You can also log the error to an error reporting service
|
|
@@ -9250,6 +9563,7 @@
|
|
|
9250
9563
|
// You can render any custom fallback UI
|
|
9251
9564
|
return this.props.showMessageOnError ? /*#__PURE__*/React__default.createElement("h1", null, this.props.errorMessage) : null;
|
|
9252
9565
|
}
|
|
9566
|
+
|
|
9253
9567
|
return this.props.children;
|
|
9254
9568
|
}
|
|
9255
9569
|
}], [{
|
|
@@ -9261,7 +9575,10 @@
|
|
|
9261
9575
|
};
|
|
9262
9576
|
}
|
|
9263
9577
|
}]);
|
|
9578
|
+
|
|
9579
|
+
return SimpleErrorBoundary;
|
|
9264
9580
|
}(React__default.Component);
|
|
9581
|
+
|
|
9265
9582
|
SimpleErrorBoundary.defaultProps = {
|
|
9266
9583
|
errorMessage: 'Something went wrong',
|
|
9267
9584
|
errorLogger: null,
|
|
@@ -9272,19 +9589,21 @@
|
|
|
9272
9589
|
var StyledHeader = styled__default.h5(_templateObject$D || (_templateObject$D = _taggedTemplateLiteral(["\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n\n @media (max-width: ", ") {\n display: block;\n }\n\n .icon-header__left {\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n\n @media (max-width: ", ") {\n align-self: flex-start;\n }\n\n svg {\n height: 1.5em;\n width: 1.5em;\n margin-right: ", ";\n }\n }\n\n .icon-header__right {\n display: flex;\n flex-grow: 1;\n justify-content: flex-end;\n\n @media (max-width: ", ") {\n justify-content: flex-start;\n }\n }\n"])), media.sm, media.sm, function (props) {
|
|
9273
9590
|
return props.theme.marginPaddings[1];
|
|
9274
9591
|
}, media.sm);
|
|
9592
|
+
|
|
9275
9593
|
/**
|
|
9276
9594
|
* IconHeader can render the standard Luxity Page/Section Header nodes with SVG
|
|
9277
9595
|
*/
|
|
9278
9596
|
var IconHeader = function IconHeader(_ref) {
|
|
9279
9597
|
var title = _ref.title,
|
|
9280
|
-
|
|
9281
|
-
|
|
9598
|
+
SvgComponent = _ref.svgComponent,
|
|
9599
|
+
renderAppendage = _ref.renderAppendage;
|
|
9282
9600
|
return /*#__PURE__*/React__default.createElement(StyledHeader, null, /*#__PURE__*/React__default.createElement("div", {
|
|
9283
9601
|
className: "icon-header__left"
|
|
9284
9602
|
}, /*#__PURE__*/React__default.createElement(SvgComponent, null), title), /*#__PURE__*/React__default.createElement("div", {
|
|
9285
9603
|
className: "icon-header__right"
|
|
9286
9604
|
}, renderAppendage && renderAppendage()));
|
|
9287
9605
|
};
|
|
9606
|
+
|
|
9288
9607
|
IconHeader.defaultProps = {
|
|
9289
9608
|
title: '',
|
|
9290
9609
|
svgComponent: function svgComponent() {
|
|
@@ -9338,25 +9657,37 @@
|
|
|
9338
9657
|
/**
|
|
9339
9658
|
* It represents the React Component that contains the notifications.
|
|
9340
9659
|
* */
|
|
9660
|
+
|
|
9341
9661
|
var LuxityNotifications = function LuxityNotifications(props) {
|
|
9342
9662
|
return /*#__PURE__*/React__default.createElement(Notifications__default, props);
|
|
9343
9663
|
};
|
|
9344
9664
|
|
|
9345
9665
|
var NotificationDropDown = /*#__PURE__*/function (_React$Component) {
|
|
9666
|
+
_inherits(NotificationDropDown, _React$Component);
|
|
9667
|
+
|
|
9668
|
+
var _super = _createSuper(NotificationDropDown);
|
|
9669
|
+
|
|
9346
9670
|
function NotificationDropDown(props) {
|
|
9347
9671
|
var _this;
|
|
9672
|
+
|
|
9348
9673
|
_classCallCheck(this, NotificationDropDown);
|
|
9349
|
-
|
|
9350
|
-
|
|
9674
|
+
|
|
9675
|
+
_this = _super.call(this, props);
|
|
9676
|
+
|
|
9677
|
+
_defineProperty(_assertThisInitialized(_this), "postUpdate", function (selectedOption, type) {
|
|
9351
9678
|
_this.setState({
|
|
9352
9679
|
request: _objectSpread2(_objectSpread2({}, request), {}, {
|
|
9353
9680
|
fetching: true
|
|
9354
9681
|
})
|
|
9355
9682
|
});
|
|
9683
|
+
|
|
9356
9684
|
_this.props.setSchedule(selectedOption.value, type).then(function () {
|
|
9357
|
-
_this
|
|
9685
|
+
var _this$setState;
|
|
9686
|
+
|
|
9687
|
+
_this.setState((_this$setState = {}, _defineProperty(_this$setState, type === 'EMAIL' ? 'emailSelectedOption' : 'whatsappSelectedOption', selectedOption), _defineProperty(_this$setState, "request", _objectSpread2(_objectSpread2({}, request), {}, {
|
|
9358
9688
|
success: true
|
|
9359
|
-
})));
|
|
9689
|
+
})), _this$setState));
|
|
9690
|
+
|
|
9360
9691
|
success("".concat(type === 'EMAIL' ? 'Email' : 'WhatsApp', " Notification Frequency Updated"));
|
|
9361
9692
|
}).catch(function () {
|
|
9362
9693
|
_this.setState({
|
|
@@ -9364,10 +9695,12 @@
|
|
|
9364
9695
|
failed: true
|
|
9365
9696
|
})
|
|
9366
9697
|
});
|
|
9698
|
+
|
|
9367
9699
|
error('Error Occurred');
|
|
9368
9700
|
});
|
|
9369
9701
|
});
|
|
9370
|
-
|
|
9702
|
+
|
|
9703
|
+
_defineProperty(_assertThisInitialized(_this), "getOptionsFromEnumResult", function (enumResult) {
|
|
9371
9704
|
var enumValues = enumResult.data.__type.enumValues;
|
|
9372
9705
|
return enumValues.map(function (enumItem) {
|
|
9373
9706
|
return {
|
|
@@ -9376,17 +9709,20 @@
|
|
|
9376
9709
|
};
|
|
9377
9710
|
});
|
|
9378
9711
|
});
|
|
9379
|
-
|
|
9712
|
+
|
|
9713
|
+
_defineProperty(_assertThisInitialized(_this), "onData", function (_ref) {
|
|
9380
9714
|
var data = _ref.data;
|
|
9715
|
+
|
|
9381
9716
|
var options = _this.getOptionsFromEnumResult(data);
|
|
9717
|
+
|
|
9382
9718
|
var _data$data$user = data.data.user,
|
|
9383
|
-
|
|
9384
|
-
|
|
9385
|
-
|
|
9386
|
-
|
|
9719
|
+
email_interest_send_schedule = _data$data$user.email_interest_send_schedule,
|
|
9720
|
+
whatsapp_interest_send_schedule = _data$data$user.whatsapp_interest_send_schedule,
|
|
9721
|
+
vip = _data$data$user.vip;
|
|
9722
|
+
|
|
9387
9723
|
_this.setState({
|
|
9388
9724
|
options: options,
|
|
9389
|
-
|
|
9725
|
+
isVip: vip,
|
|
9390
9726
|
emailSelectedOption: options.find(function (item) {
|
|
9391
9727
|
return item.value === email_interest_send_schedule;
|
|
9392
9728
|
}),
|
|
@@ -9395,13 +9731,14 @@
|
|
|
9395
9731
|
})
|
|
9396
9732
|
});
|
|
9397
9733
|
});
|
|
9398
|
-
|
|
9734
|
+
|
|
9735
|
+
_defineProperty(_assertThisInitialized(_this), "render", function () {
|
|
9399
9736
|
var _this$state = _this.state,
|
|
9400
|
-
|
|
9401
|
-
|
|
9402
|
-
|
|
9403
|
-
|
|
9404
|
-
|
|
9737
|
+
options = _this$state.options,
|
|
9738
|
+
emailSelectedOption = _this$state.emailSelectedOption,
|
|
9739
|
+
whatsappSelectedOption = _this$state.whatsappSelectedOption,
|
|
9740
|
+
isVip = _this$state.isVip,
|
|
9741
|
+
updating = _this$state.request.fetching;
|
|
9405
9742
|
return /*#__PURE__*/React__default.createElement(NotifyContainer, null, /*#__PURE__*/React__default.createElement(LuxityNotifications, null), /*#__PURE__*/React__default.createElement(LuxityPageReady, {
|
|
9406
9743
|
getRequestPromise: _this.props.getSchedule,
|
|
9407
9744
|
onData: function onData(data) {
|
|
@@ -9409,7 +9746,7 @@
|
|
|
9409
9746
|
}
|
|
9410
9747
|
}, /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
9411
9748
|
className: "notification-settings"
|
|
9412
|
-
},
|
|
9749
|
+
}, isVip && /*#__PURE__*/React__default.createElement("div", {
|
|
9413
9750
|
className: "notification-row-wrapper"
|
|
9414
9751
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
9415
9752
|
className: "notification-dropdown-label"
|
|
@@ -9449,18 +9786,20 @@
|
|
|
9449
9786
|
value: emailSelectedOption
|
|
9450
9787
|
}))))));
|
|
9451
9788
|
});
|
|
9789
|
+
|
|
9452
9790
|
_this.state = {
|
|
9453
9791
|
options: [],
|
|
9454
9792
|
emailSelectedOption: null,
|
|
9455
9793
|
whatsappSelectedOption: null,
|
|
9456
|
-
|
|
9794
|
+
isVip: false,
|
|
9457
9795
|
request: _objectSpread2({}, request)
|
|
9458
9796
|
};
|
|
9459
9797
|
return _this;
|
|
9460
9798
|
}
|
|
9461
|
-
|
|
9799
|
+
|
|
9462
9800
|
return _createClass(NotificationDropDown);
|
|
9463
9801
|
}(React__default.Component);
|
|
9802
|
+
|
|
9464
9803
|
var NotificationDropDown$1 = themed(NotificationDropDown);
|
|
9465
9804
|
|
|
9466
9805
|
var _templateObject$F, _templateObject2$6;
|
|
@@ -9502,49 +9841,65 @@
|
|
|
9502
9841
|
}, function (props) {
|
|
9503
9842
|
return props.theme.colors.ntrlMin;
|
|
9504
9843
|
});
|
|
9505
|
-
|
|
9506
9844
|
/**
|
|
9507
9845
|
* Multiselector with a GraphQL flavour (TODO: to be revised to make it remote api agnostic)
|
|
9508
9846
|
*/
|
|
9847
|
+
|
|
9509
9848
|
var GraphQLMultiSelector = /*#__PURE__*/function (_React$Component) {
|
|
9849
|
+
_inherits(GraphQLMultiSelector, _React$Component);
|
|
9850
|
+
|
|
9851
|
+
var _super = _createSuper(GraphQLMultiSelector);
|
|
9852
|
+
|
|
9510
9853
|
function GraphQLMultiSelector(props) {
|
|
9511
9854
|
var _this;
|
|
9855
|
+
|
|
9512
9856
|
_classCallCheck(this, GraphQLMultiSelector);
|
|
9513
|
-
|
|
9514
|
-
|
|
9857
|
+
|
|
9858
|
+
_this = _super.call(this, props);
|
|
9859
|
+
|
|
9860
|
+
_defineProperty(_assertThisInitialized(_this), "componentDidUpdate", function (prevProps) {
|
|
9515
9861
|
if (prevProps.graphQuery !== _this.props.graphQuery) {
|
|
9516
9862
|
_this.makeRequest();
|
|
9517
9863
|
}
|
|
9518
9864
|
});
|
|
9519
|
-
|
|
9865
|
+
|
|
9866
|
+
_defineProperty(_assertThisInitialized(_this), "makeRequest", function () {
|
|
9520
9867
|
_this.pageReady.refreshPage();
|
|
9521
9868
|
});
|
|
9522
|
-
|
|
9869
|
+
|
|
9870
|
+
_defineProperty(_assertThisInitialized(_this), "emptySelected", function () {
|
|
9523
9871
|
return _this.setState({
|
|
9524
9872
|
selected: [ALL_ITEM]
|
|
9525
9873
|
});
|
|
9526
9874
|
});
|
|
9527
|
-
|
|
9875
|
+
|
|
9876
|
+
_defineProperty(_assertThisInitialized(_this), "setNewResults", function (res) {
|
|
9528
9877
|
var selectedIds = _this.state.selected.map(function (sel) {
|
|
9529
9878
|
return sel.id;
|
|
9530
9879
|
});
|
|
9880
|
+
|
|
9531
9881
|
var pagination = _this.props.resultProcessor(res);
|
|
9882
|
+
|
|
9532
9883
|
var allSelected = _this.state.selected.some(function (item) {
|
|
9533
9884
|
return item.id === ALL_ITEM.id;
|
|
9534
9885
|
});
|
|
9886
|
+
|
|
9535
9887
|
var newList = pagination.data.filter(function (newItem) {
|
|
9536
9888
|
return !selectedIds.includes(newItem.id);
|
|
9537
9889
|
});
|
|
9538
9890
|
newList = allSelected ? newList : [ALL_ITEM].concat(_toConsumableArray(newList));
|
|
9891
|
+
|
|
9539
9892
|
_this.setState({
|
|
9540
9893
|
list: newList,
|
|
9541
9894
|
pagination: pagination
|
|
9542
9895
|
});
|
|
9543
9896
|
});
|
|
9544
|
-
|
|
9897
|
+
|
|
9898
|
+
_defineProperty(_assertThisInitialized(_this), "onAddItem", function (addSelectedItem) {
|
|
9545
9899
|
_this.setState(function (prevState) {
|
|
9546
9900
|
var newSelectedList;
|
|
9547
9901
|
var newList;
|
|
9902
|
+
|
|
9548
9903
|
if (addSelectedItem.id === ALL_ITEM.id) {
|
|
9549
9904
|
// Clear Selected List
|
|
9550
9905
|
// and move previous Selected items to list
|
|
@@ -9564,6 +9919,7 @@
|
|
|
9564
9919
|
return item.id !== addSelectedItem.id;
|
|
9565
9920
|
})));
|
|
9566
9921
|
}
|
|
9922
|
+
|
|
9567
9923
|
return {
|
|
9568
9924
|
selected: newSelectedList,
|
|
9569
9925
|
list: newList
|
|
@@ -9574,20 +9930,24 @@
|
|
|
9574
9930
|
}));
|
|
9575
9931
|
});
|
|
9576
9932
|
});
|
|
9577
|
-
|
|
9933
|
+
|
|
9934
|
+
_defineProperty(_assertThisInitialized(_this), "onRemoveItem", function (removeSelectedItem) {
|
|
9578
9935
|
_this.setState(function (prevState) {
|
|
9579
9936
|
// Cannot remove ALL from selection by unselecting it
|
|
9580
9937
|
if ((removeSelectedItem === null || removeSelectedItem === void 0 ? void 0 : removeSelectedItem.id) === ALL_ITEM.id) {
|
|
9581
9938
|
return {};
|
|
9582
9939
|
}
|
|
9940
|
+
|
|
9583
9941
|
var newSelectedList = prevState.selected.filter(function (item) {
|
|
9584
9942
|
return item.id !== removeSelectedItem.id;
|
|
9585
9943
|
});
|
|
9944
|
+
|
|
9586
9945
|
var newList = _toConsumableArray(prevState.list).concat(removeSelectedItem).filter(function (item) {
|
|
9587
9946
|
return item.id !== ALL_ITEM.id;
|
|
9588
9947
|
}).sort(function (a, b) {
|
|
9589
9948
|
return a.id - b.id;
|
|
9590
9949
|
});
|
|
9950
|
+
|
|
9591
9951
|
return {
|
|
9592
9952
|
list: newList,
|
|
9593
9953
|
selected: newSelectedList.length ? newSelectedList : [ALL_ITEM]
|
|
@@ -9598,23 +9958,25 @@
|
|
|
9598
9958
|
}));
|
|
9599
9959
|
});
|
|
9600
9960
|
});
|
|
9601
|
-
|
|
9961
|
+
|
|
9962
|
+
_defineProperty(_assertThisInitialized(_this), "onIsLoading", function (flag) {
|
|
9602
9963
|
_this.setState({
|
|
9603
9964
|
isLoading: flag
|
|
9604
9965
|
});
|
|
9605
9966
|
});
|
|
9606
|
-
|
|
9967
|
+
|
|
9968
|
+
_defineProperty(_assertThisInitialized(_this), "render", function () {
|
|
9607
9969
|
var _this$props = _this.props,
|
|
9608
|
-
|
|
9609
|
-
|
|
9610
|
-
|
|
9611
|
-
|
|
9612
|
-
|
|
9970
|
+
baseClass = _this$props.baseClass,
|
|
9971
|
+
ItemRenderer = _this$props.itemRenderer,
|
|
9972
|
+
identifier = _this$props.identifier,
|
|
9973
|
+
triggerRequest = _this$props.triggerRequest,
|
|
9974
|
+
className = _this$props.className;
|
|
9613
9975
|
var _this$state = _this.state,
|
|
9614
|
-
|
|
9615
|
-
|
|
9616
|
-
|
|
9617
|
-
|
|
9976
|
+
list = _this$state.list,
|
|
9977
|
+
selected = _this$state.selected,
|
|
9978
|
+
pagination = _this$state.pagination,
|
|
9979
|
+
isLoading = _this$state.isLoading;
|
|
9618
9980
|
return /*#__PURE__*/React__default.createElement(StyledMultiselector, null, /*#__PURE__*/React__default.createElement("div", {
|
|
9619
9981
|
"data-qe-id": identifier,
|
|
9620
9982
|
className: "".concat(className, " ").concat(baseClass)
|
|
@@ -9653,6 +10015,7 @@
|
|
|
9653
10015
|
type: "button"
|
|
9654
10016
|
}, "SHOW MORE"))));
|
|
9655
10017
|
});
|
|
10018
|
+
|
|
9656
10019
|
_this.state = {
|
|
9657
10020
|
selected: [ALL_ITEM],
|
|
9658
10021
|
list: [],
|
|
@@ -9661,9 +10024,10 @@
|
|
|
9661
10024
|
};
|
|
9662
10025
|
return _this;
|
|
9663
10026
|
}
|
|
9664
|
-
|
|
10027
|
+
|
|
9665
10028
|
return _createClass(GraphQLMultiSelector);
|
|
9666
10029
|
}(React__default.Component);
|
|
10030
|
+
|
|
9667
10031
|
GraphQLMultiSelector.defaultProps = {
|
|
9668
10032
|
baseClass: 'multiselector'
|
|
9669
10033
|
};
|
|
@@ -9684,12 +10048,13 @@
|
|
|
9684
10048
|
});
|
|
9685
10049
|
|
|
9686
10050
|
var _templateObject$G;
|
|
10051
|
+
|
|
9687
10052
|
var Title$3 = function Title(_ref) {
|
|
9688
10053
|
var baseClass = _ref.baseClass,
|
|
9689
|
-
|
|
9690
|
-
|
|
9691
|
-
|
|
9692
|
-
|
|
10054
|
+
className = _ref.className,
|
|
10055
|
+
title = _ref.title,
|
|
10056
|
+
searchPlaceHolder = _ref.searchPlaceHolder,
|
|
10057
|
+
onSearchChanged = _ref.onSearchChanged;
|
|
9693
10058
|
return /*#__PURE__*/React__default.createElement(InterestsSubheading, {
|
|
9694
10059
|
className: "".concat(className, " ").concat(baseClass, "__title"),
|
|
9695
10060
|
title: title
|
|
@@ -9702,6 +10067,7 @@
|
|
|
9702
10067
|
onChange: onSearchChanged
|
|
9703
10068
|
})));
|
|
9704
10069
|
};
|
|
10070
|
+
|
|
9705
10071
|
var StyledTitle = styled__default(Title$3)(_templateObject$G || (_templateObject$G = _taggedTemplateLiteral(["\n margin-bottom: ", ";\n font-weight: bold;\n display: flex;\n align-items: center;\n font-size: ", ";\n\n .title__search,\n .title__search {\n display: flex;\n justify-content: center;\n align-items: center;\n min-height: 30px;\n margin-bottom: ", ";\n\n svg {\n margin-left: ", ";\n fill: ", ";\n stroke: ", ";\n }\n\n input {\n width: 140px;\n border: none;\n font-size: ", ";\n transition: 0.2s border-color ease-in-out;\n margin-left: ", ";\n padding: 0;\n\n :focus {\n border-color: ", ";\n border-bottom: none;\n }\n }\n }\n"])), function (props) {
|
|
9706
10072
|
return props.theme.marginPaddings[2];
|
|
9707
10073
|
}, function (props) {
|
|
@@ -9724,26 +10090,37 @@
|
|
|
9724
10090
|
var Title$4 = themed(StyledTitle);
|
|
9725
10091
|
|
|
9726
10092
|
var debounceBuilder$3 = functions.debounced(200);
|
|
10093
|
+
|
|
9727
10094
|
/**
|
|
9728
10095
|
* Luxity flavoured GraphQLMultiselector with text Search, category and limit controls
|
|
9729
10096
|
*/
|
|
9730
10097
|
var LuxityGraphQLMultiselector = /*#__PURE__*/function (_React$Component) {
|
|
10098
|
+
_inherits(LuxityGraphQLMultiselector, _React$Component);
|
|
10099
|
+
|
|
10100
|
+
var _super = _createSuper(LuxityGraphQLMultiselector);
|
|
10101
|
+
|
|
9731
10102
|
function LuxityGraphQLMultiselector(props) {
|
|
9732
10103
|
var _this;
|
|
10104
|
+
|
|
9733
10105
|
_classCallCheck(this, LuxityGraphQLMultiselector);
|
|
9734
|
-
|
|
9735
|
-
|
|
9736
|
-
|
|
10106
|
+
|
|
10107
|
+
_this = _super.call(this, props);
|
|
10108
|
+
|
|
10109
|
+
_defineProperty(_assertThisInitialized(_this), "multiSelectorRef", /*#__PURE__*/React__default.createRef());
|
|
10110
|
+
|
|
10111
|
+
_defineProperty(_assertThisInitialized(_this), "increaseLimit", function () {
|
|
9737
10112
|
_this.setState(function (prevState) {
|
|
9738
10113
|
return {
|
|
9739
10114
|
limit: prevState.limit + _this.props.queryLimitIncrement
|
|
9740
10115
|
};
|
|
9741
10116
|
});
|
|
9742
10117
|
});
|
|
9743
|
-
|
|
10118
|
+
|
|
10119
|
+
_defineProperty(_assertThisInitialized(_this), "onChange", function (selection) {
|
|
9744
10120
|
_this.props.onChange(selection);
|
|
9745
10121
|
});
|
|
9746
|
-
|
|
10122
|
+
|
|
10123
|
+
_defineProperty(_assertThisInitialized(_this), "onSearchChanged", function (event) {
|
|
9747
10124
|
event.preventDefault();
|
|
9748
10125
|
var searchText = event.target.value;
|
|
9749
10126
|
debounceBuilder$3(function () {
|
|
@@ -9752,21 +10129,22 @@
|
|
|
9752
10129
|
});
|
|
9753
10130
|
});
|
|
9754
10131
|
});
|
|
9755
|
-
|
|
10132
|
+
|
|
10133
|
+
_defineProperty(_assertThisInitialized(_this), "render", function () {
|
|
9756
10134
|
var _this$state = _this.state,
|
|
9757
|
-
|
|
9758
|
-
|
|
9759
|
-
|
|
10135
|
+
limit = _this$state.limit,
|
|
10136
|
+
category = _this$state.category,
|
|
10137
|
+
nameFilter = _this$state.nameFilter;
|
|
9760
10138
|
var _this$props = _this.props,
|
|
9761
|
-
|
|
9762
|
-
|
|
9763
|
-
|
|
9764
|
-
|
|
9765
|
-
|
|
9766
|
-
|
|
9767
|
-
|
|
9768
|
-
|
|
9769
|
-
|
|
10139
|
+
title = _this$props.title,
|
|
10140
|
+
baseClass = _this$props.baseClass,
|
|
10141
|
+
getGraphQuery = _this$props.getGraphQuery,
|
|
10142
|
+
resultProcessor = _this$props.resultProcessor,
|
|
10143
|
+
itemRenderer = _this$props.itemRenderer,
|
|
10144
|
+
searchPlaceHolder = _this$props.searchPlaceHolder,
|
|
10145
|
+
graphApi = _this$props.graphApi,
|
|
10146
|
+
identifier = _this$props.identifier,
|
|
10147
|
+
requestInstance = _this$props.requestInstance;
|
|
9770
10148
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
9771
10149
|
className: baseClass
|
|
9772
10150
|
}, /*#__PURE__*/React__default.createElement(Title$4, {
|
|
@@ -9789,6 +10167,7 @@
|
|
|
9789
10167
|
itemRenderer: itemRenderer
|
|
9790
10168
|
})));
|
|
9791
10169
|
});
|
|
10170
|
+
|
|
9792
10171
|
_this.state = {
|
|
9793
10172
|
limit: props.baseQueryLimit,
|
|
9794
10173
|
category: props.category,
|
|
@@ -9796,11 +10175,12 @@
|
|
|
9796
10175
|
};
|
|
9797
10176
|
return _this;
|
|
9798
10177
|
}
|
|
9799
|
-
|
|
9800
|
-
|
|
10178
|
+
|
|
10179
|
+
_createClass(LuxityGraphQLMultiselector, [{
|
|
9801
10180
|
key: "componentDidUpdate",
|
|
9802
10181
|
value: function componentDidUpdate(prevProps) {
|
|
9803
10182
|
var _this$multiSelectorRe;
|
|
10183
|
+
|
|
9804
10184
|
if (prevProps.category !== this.props.category && (_this$multiSelectorRe = this.multiSelectorRef) !== null && _this$multiSelectorRe !== void 0 && _this$multiSelectorRe.current) {
|
|
9805
10185
|
this.multiSelectorRef.current.emptySelected();
|
|
9806
10186
|
}
|
|
@@ -9813,10 +10193,14 @@
|
|
|
9813
10193
|
category: props.category
|
|
9814
10194
|
};
|
|
9815
10195
|
}
|
|
10196
|
+
|
|
9816
10197
|
return null;
|
|
9817
10198
|
}
|
|
9818
10199
|
}]);
|
|
10200
|
+
|
|
10201
|
+
return LuxityGraphQLMultiselector;
|
|
9819
10202
|
}(React__default.Component);
|
|
10203
|
+
|
|
9820
10204
|
LuxityGraphQLMultiselector.defaultProps = {
|
|
9821
10205
|
baseClass: '',
|
|
9822
10206
|
searchPlaceHolder: '',
|
|
@@ -9837,10 +10221,11 @@
|
|
|
9837
10221
|
return props.theme.colors.ntrlMin;
|
|
9838
10222
|
});
|
|
9839
10223
|
var UnselectedButton = themed(BaseButton);
|
|
10224
|
+
|
|
9840
10225
|
var ItemRenderer = function ItemRenderer(_ref) {
|
|
9841
10226
|
var item = _ref.item,
|
|
9842
|
-
|
|
9843
|
-
|
|
10227
|
+
onSelect = _ref.onSelect,
|
|
10228
|
+
selected = _ref.selected;
|
|
9844
10229
|
var props = {
|
|
9845
10230
|
onClick: function onClick(e) {
|
|
9846
10231
|
e.preventDefault();
|
|
@@ -9852,12 +10237,12 @@
|
|
|
9852
10237
|
|
|
9853
10238
|
var BrandSelector = function BrandSelector(_ref) {
|
|
9854
10239
|
var onChange = _ref.onChange,
|
|
9855
|
-
|
|
9856
|
-
|
|
9857
|
-
|
|
9858
|
-
|
|
9859
|
-
|
|
9860
|
-
|
|
10240
|
+
category = _ref.category,
|
|
10241
|
+
graphApi = _ref.graphApi,
|
|
10242
|
+
itemRenderer = _ref.itemRenderer,
|
|
10243
|
+
getGraphQuery = _ref.getGraphQuery,
|
|
10244
|
+
resultProcessor = _ref.resultProcessor,
|
|
10245
|
+
requestInstance = _ref.requestInstance;
|
|
9861
10246
|
return /*#__PURE__*/React__default.createElement(LuxityGraphQLMultiselector, {
|
|
9862
10247
|
baseQueryLimit: 16,
|
|
9863
10248
|
title: "Brands",
|
|
@@ -9874,6 +10259,7 @@
|
|
|
9874
10259
|
requestInstance: requestInstance
|
|
9875
10260
|
});
|
|
9876
10261
|
};
|
|
10262
|
+
|
|
9877
10263
|
BrandSelector.defaultProps = {
|
|
9878
10264
|
itemRenderer: ItemRenderer,
|
|
9879
10265
|
resultProcessor: function resultProcessor(result) {
|
|
@@ -9883,12 +10269,12 @@
|
|
|
9883
10269
|
|
|
9884
10270
|
var StyleSelector = function StyleSelector(_ref) {
|
|
9885
10271
|
var onChange = _ref.onChange,
|
|
9886
|
-
|
|
9887
|
-
|
|
9888
|
-
|
|
9889
|
-
|
|
9890
|
-
|
|
9891
|
-
|
|
10272
|
+
category = _ref.category,
|
|
10273
|
+
graphApi = _ref.graphApi,
|
|
10274
|
+
itemRenderer = _ref.itemRenderer,
|
|
10275
|
+
getGraphQuery = _ref.getGraphQuery,
|
|
10276
|
+
resultProcessor = _ref.resultProcessor,
|
|
10277
|
+
requestInstance = _ref.requestInstance;
|
|
9892
10278
|
return /*#__PURE__*/React__default.createElement(LuxityGraphQLMultiselector, {
|
|
9893
10279
|
title: "Styles",
|
|
9894
10280
|
queryId: "getStyles",
|
|
@@ -9905,6 +10291,7 @@
|
|
|
9905
10291
|
requestInstance: requestInstance
|
|
9906
10292
|
});
|
|
9907
10293
|
};
|
|
10294
|
+
|
|
9908
10295
|
StyleSelector.defaultProps = {
|
|
9909
10296
|
itemRenderer: ItemRenderer,
|
|
9910
10297
|
resultProcessor: function resultProcessor(result) {
|
|
@@ -9936,14 +10323,17 @@
|
|
|
9936
10323
|
ShoeSizeFadeContainer.defaultProps = {
|
|
9937
10324
|
childVisible: false
|
|
9938
10325
|
};
|
|
10326
|
+
|
|
9939
10327
|
var OpacityTransitionRender = function OpacityTransitionRender(_ref) {
|
|
9940
10328
|
var shoeSizeType = _ref.shoeSizeType,
|
|
9941
|
-
|
|
10329
|
+
children = _ref.children;
|
|
9942
10330
|
var prevShoeSizeType = functions.usePrevious(shoeSizeType);
|
|
10331
|
+
|
|
9943
10332
|
var _React$useState = React__default.useState(false),
|
|
9944
|
-
|
|
9945
|
-
|
|
9946
|
-
|
|
10333
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
10334
|
+
childVisible = _React$useState2[0],
|
|
10335
|
+
setChildVisible = _React$useState2[1];
|
|
10336
|
+
|
|
9947
10337
|
React__default.useEffect(function () {
|
|
9948
10338
|
if (prevShoeSizeType !== shoeSizeType) {
|
|
9949
10339
|
setChildVisible(false);
|
|
@@ -9956,25 +10346,30 @@
|
|
|
9956
10346
|
childVisible: childVisible
|
|
9957
10347
|
}, children);
|
|
9958
10348
|
};
|
|
10349
|
+
|
|
9959
10350
|
var WrappedShoeSizeSelector = function WrappedShoeSizeSelector(_ref2) {
|
|
9960
10351
|
var onChange = _ref2.onChange,
|
|
9961
|
-
|
|
9962
|
-
|
|
9963
|
-
|
|
9964
|
-
|
|
10352
|
+
requestInstance = _ref2.requestInstance,
|
|
10353
|
+
graphApi = _ref2.graphApi,
|
|
10354
|
+
defaultShoeSizeType = _ref2.defaultShoeSizeType,
|
|
10355
|
+
getGraphQuery = _ref2.getGraphQuery;
|
|
10356
|
+
|
|
9965
10357
|
var _useState = React.useState(defaultShoeSizeType),
|
|
9966
|
-
|
|
9967
|
-
|
|
9968
|
-
|
|
10358
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
10359
|
+
shoeSizeType = _useState2[0],
|
|
10360
|
+
setShoeSizeType = _useState2[1];
|
|
10361
|
+
|
|
9969
10362
|
var _useState3 = React.useState(defaultShoeSizeType),
|
|
9970
|
-
|
|
9971
|
-
|
|
9972
|
-
|
|
10363
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
10364
|
+
transitionedTo = _useState4[0],
|
|
10365
|
+
setTransitionedTo = _useState4[1];
|
|
10366
|
+
|
|
9973
10367
|
var triggerRequest = function triggerRequest() {
|
|
9974
10368
|
return requestInstance.post(graphApi, {
|
|
9975
10369
|
query: getGraphQuery()
|
|
9976
10370
|
});
|
|
9977
10371
|
};
|
|
10372
|
+
|
|
9978
10373
|
var shoeSizeTypeProps = {
|
|
9979
10374
|
name: 'shoe_size_type',
|
|
9980
10375
|
noWrap: true,
|
|
@@ -9998,12 +10393,15 @@
|
|
|
9998
10393
|
checked: shoeSizeType === shoeSizeTypes.eu.value
|
|
9999
10394
|
}]
|
|
10000
10395
|
};
|
|
10396
|
+
|
|
10001
10397
|
var handlePropOnChange = function handlePropOnChange(value) {
|
|
10002
10398
|
var payload = _objectSpread2(_objectSpread2({}, value), {}, {
|
|
10003
10399
|
shoe_size_type: shoeSizeType
|
|
10004
10400
|
});
|
|
10401
|
+
|
|
10005
10402
|
onChange(payload);
|
|
10006
10403
|
};
|
|
10404
|
+
|
|
10007
10405
|
var renderShoeSizeSelector = function renderShoeSizeSelector() {
|
|
10008
10406
|
var passedShoeSizes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
10009
10407
|
return /*#__PURE__*/React__default.createElement(ShoeSizeSelector, {
|
|
@@ -10013,32 +10411,38 @@
|
|
|
10013
10411
|
}
|
|
10014
10412
|
});
|
|
10015
10413
|
};
|
|
10414
|
+
|
|
10016
10415
|
var getShoeSizeSelector = function getShoeSizeSelector() {
|
|
10017
10416
|
var euShoeSizes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
10018
10417
|
var ukShoeShoes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
10418
|
+
|
|
10019
10419
|
if (shoeSizeType === shoeSizeTypes.eu.value) {
|
|
10020
10420
|
return renderShoeSizeSelector(euShoeSizes);
|
|
10021
10421
|
}
|
|
10422
|
+
|
|
10022
10423
|
if (shoeSizeType === shoeSizeTypes.uk.value) {
|
|
10023
10424
|
return renderShoeSizeSelector(ukShoeShoes);
|
|
10024
10425
|
}
|
|
10426
|
+
|
|
10025
10427
|
return null;
|
|
10026
10428
|
};
|
|
10429
|
+
|
|
10027
10430
|
return /*#__PURE__*/React__default.createElement(LuxityPageReady, {
|
|
10028
10431
|
getRequestPromise: triggerRequest
|
|
10029
10432
|
}, /*#__PURE__*/React__default.createElement(TitleWrapper, null, /*#__PURE__*/React__default.createElement(InterestsSubheading, {
|
|
10030
10433
|
title: "Shoe Size Range"
|
|
10031
10434
|
}, /*#__PURE__*/React__default.createElement(RadioButtons$1, shoeSizeTypeProps))), /*#__PURE__*/React__default.createElement(LuxityPageReadyContext.Consumer, null, function (_ref3) {
|
|
10032
10435
|
var _ref3$data$data = _ref3.data.data,
|
|
10033
|
-
|
|
10034
|
-
|
|
10035
|
-
|
|
10036
|
-
|
|
10436
|
+
_ref3$data$data$luxit = _ref3$data$data.luxity_eu_shoe_sizes,
|
|
10437
|
+
luxity_eu_shoe_sizes = _ref3$data$data$luxit === void 0 ? [] : _ref3$data$data$luxit,
|
|
10438
|
+
_ref3$data$data$luxit2 = _ref3$data$data.luxity_uk_shoe_sizes,
|
|
10439
|
+
luxity_uk_shoe_sizes = _ref3$data$data$luxit2 === void 0 ? [] : _ref3$data$data$luxit2;
|
|
10037
10440
|
return /*#__PURE__*/React__default.createElement(OpacityTransitionRender, {
|
|
10038
10441
|
shoeSizeType: transitionedTo
|
|
10039
10442
|
}, getShoeSizeSelector(luxity_eu_shoe_sizes, luxity_uk_shoe_sizes));
|
|
10040
10443
|
}));
|
|
10041
10444
|
};
|
|
10445
|
+
|
|
10042
10446
|
WrappedShoeSizeSelector.defaultProps = {
|
|
10043
10447
|
onChange: function onChange() {
|
|
10044
10448
|
return false;
|
|
@@ -10061,6 +10465,7 @@
|
|
|
10061
10465
|
});
|
|
10062
10466
|
|
|
10063
10467
|
var _excluded$7 = ["title", "checked", "renderIcon", "onChange", "checkedValue", "unCheckedValue"];
|
|
10468
|
+
|
|
10064
10469
|
var _templateObject$K, _templateObject2$8, _templateObject3$3;
|
|
10065
10470
|
var Content = styled__default.div(_templateObject$K || (_templateObject$K = _taggedTemplateLiteral(["\n background-color: transparent;\n border: 1px solid ", ";\n transition: 200ms ease-in-out;\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: ", ";\n cursor: pointer;\n"])), function (props) {
|
|
10066
10471
|
return props.theme.colors.primary;
|
|
@@ -10079,32 +10484,36 @@
|
|
|
10079
10484
|
}, Content, InputText, function (props) {
|
|
10080
10485
|
return props.theme.colors.ntrlMin;
|
|
10081
10486
|
}, Content);
|
|
10082
|
-
|
|
10083
10487
|
/**
|
|
10084
10488
|
* CheckButton: Styled checkbox that resembles a button
|
|
10085
10489
|
* */
|
|
10490
|
+
|
|
10086
10491
|
var CheckButton = function CheckButton(props) {
|
|
10087
10492
|
var title = props.title,
|
|
10088
|
-
|
|
10089
|
-
|
|
10090
|
-
|
|
10091
|
-
|
|
10092
|
-
|
|
10093
|
-
|
|
10493
|
+
checked = props.checked,
|
|
10494
|
+
renderIcon = props.renderIcon,
|
|
10495
|
+
onChange = props.onChange,
|
|
10496
|
+
checkedValue = props.checkedValue,
|
|
10497
|
+
unCheckedValue = props.unCheckedValue,
|
|
10498
|
+
restProps = _objectWithoutProperties(props, _excluded$7);
|
|
10499
|
+
|
|
10094
10500
|
var _React$useState = React__default.useState(checked),
|
|
10095
|
-
|
|
10096
|
-
|
|
10097
|
-
|
|
10501
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
10502
|
+
checkedState = _React$useState2[0],
|
|
10503
|
+
setCheck = _React$useState2[1];
|
|
10504
|
+
|
|
10098
10505
|
var prevCheckState = functions.usePrevious(checkedState);
|
|
10099
10506
|
React__default.useEffect(function () {
|
|
10100
10507
|
if (prevCheckState !== checkedState) {
|
|
10101
10508
|
onChange(checkedState);
|
|
10102
10509
|
}
|
|
10103
10510
|
}, [checkedState, onChange, prevCheckState]);
|
|
10511
|
+
|
|
10104
10512
|
var handleInputChange = function handleInputChange(e) {
|
|
10105
10513
|
var targetChecked = e.target.checked;
|
|
10106
10514
|
setCheck(targetChecked);
|
|
10107
10515
|
};
|
|
10516
|
+
|
|
10108
10517
|
return /*#__PURE__*/React__default.createElement(StyledLabel, null, /*#__PURE__*/React__default.createElement("input", _extends({
|
|
10109
10518
|
defaultChecked: checked
|
|
10110
10519
|
}, restProps, {
|
|
@@ -10112,6 +10521,7 @@
|
|
|
10112
10521
|
onChange: handleInputChange
|
|
10113
10522
|
})), /*#__PURE__*/React__default.createElement(Content, null, /*#__PURE__*/React__default.createElement(InputText, null, title), renderIcon(checkedState)));
|
|
10114
10523
|
};
|
|
10524
|
+
|
|
10115
10525
|
CheckButton.defaultProps = {
|
|
10116
10526
|
title: '',
|
|
10117
10527
|
checked: false,
|
|
@@ -10125,24 +10535,29 @@
|
|
|
10125
10535
|
var CheckButton$1 = themed(CheckButton);
|
|
10126
10536
|
|
|
10127
10537
|
var MALE$1 = genders.MALE,
|
|
10128
|
-
|
|
10538
|
+
FEMALE$1 = genders.FEMALE;
|
|
10539
|
+
|
|
10129
10540
|
/**
|
|
10130
10541
|
* Stylized CheckboxButton for selecting gender
|
|
10131
10542
|
* */
|
|
10132
10543
|
var GenderCheckbox = function GenderCheckbox(_ref) {
|
|
10133
10544
|
var gender = _ref.gender,
|
|
10134
|
-
|
|
10135
|
-
|
|
10545
|
+
checked = _ref.checked,
|
|
10546
|
+
onInputChange = _ref.onInputChange;
|
|
10547
|
+
|
|
10136
10548
|
var getTitle = function getTitle() {
|
|
10137
10549
|
switch (gender) {
|
|
10138
10550
|
case MALE$1:
|
|
10139
10551
|
return 'Male';
|
|
10552
|
+
|
|
10140
10553
|
case FEMALE$1:
|
|
10141
10554
|
return 'Female';
|
|
10555
|
+
|
|
10142
10556
|
default:
|
|
10143
10557
|
return '';
|
|
10144
10558
|
}
|
|
10145
10559
|
};
|
|
10560
|
+
|
|
10146
10561
|
return /*#__PURE__*/React__default.createElement(CheckButton$1, {
|
|
10147
10562
|
onChange: onInputChange,
|
|
10148
10563
|
checked: checked,
|
|
@@ -10150,20 +10565,22 @@
|
|
|
10150
10565
|
title: getTitle()
|
|
10151
10566
|
});
|
|
10152
10567
|
};
|
|
10568
|
+
|
|
10153
10569
|
GenderCheckbox.defaultProps = {
|
|
10154
10570
|
name: ''
|
|
10155
10571
|
};
|
|
10156
10572
|
|
|
10157
10573
|
var MALE$2 = genders.MALE,
|
|
10158
|
-
|
|
10574
|
+
FEMALE$2 = genders.FEMALE;
|
|
10575
|
+
|
|
10159
10576
|
/**
|
|
10160
10577
|
* GenderSelector: specialized selector to pick genders for the Interest Component
|
|
10161
10578
|
* */
|
|
10162
10579
|
var GenderSelector = function GenderSelector(_ref) {
|
|
10163
10580
|
var gender = _ref.gender,
|
|
10164
|
-
|
|
10165
|
-
|
|
10166
|
-
|
|
10581
|
+
onChange = _ref.onChange,
|
|
10582
|
+
maleInputRef = _ref.maleInputRef,
|
|
10583
|
+
femaleInputRef = _ref.femaleInputRef;
|
|
10167
10584
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
10168
10585
|
className: "gender-selector"
|
|
10169
10586
|
}, /*#__PURE__*/React__default.createElement(InterestsSubheading, {
|
|
@@ -10188,6 +10605,7 @@
|
|
|
10188
10605
|
checkBoxButtonRef: femaleInputRef
|
|
10189
10606
|
})));
|
|
10190
10607
|
};
|
|
10608
|
+
|
|
10191
10609
|
GenderSelector.defaultProps = {
|
|
10192
10610
|
gender: null,
|
|
10193
10611
|
onChange: function onChange() {
|
|
@@ -10198,13 +10616,15 @@
|
|
|
10198
10616
|
|
|
10199
10617
|
var ConditionSelector = function ConditionSelector(_ref) {
|
|
10200
10618
|
var onChange = _ref.onChange,
|
|
10201
|
-
|
|
10202
|
-
|
|
10203
|
-
|
|
10204
|
-
|
|
10619
|
+
graphApi = _ref.graphApi,
|
|
10620
|
+
itemRenderer = _ref.itemRenderer,
|
|
10621
|
+
getGraphQuery = _ref.getGraphQuery,
|
|
10622
|
+
requestInstance = _ref.requestInstance;
|
|
10623
|
+
|
|
10205
10624
|
var resultProcessor = function resultProcessor(result) {
|
|
10206
10625
|
return result.data.data.conditions_list;
|
|
10207
10626
|
};
|
|
10627
|
+
|
|
10208
10628
|
return /*#__PURE__*/React__default.createElement(LuxityGraphQLMultiselector, {
|
|
10209
10629
|
title: "Condition",
|
|
10210
10630
|
queryId: "getCondition",
|
|
@@ -10221,6 +10641,7 @@
|
|
|
10221
10641
|
requestInstance: requestInstance
|
|
10222
10642
|
});
|
|
10223
10643
|
};
|
|
10644
|
+
|
|
10224
10645
|
ConditionSelector.defaultProps = {
|
|
10225
10646
|
itemRenderer: ItemRenderer
|
|
10226
10647
|
};
|
|
@@ -10259,30 +10680,41 @@
|
|
|
10259
10680
|
request: _objectSpread2({}, request),
|
|
10260
10681
|
isCategoriesShown: false
|
|
10261
10682
|
};
|
|
10262
|
-
|
|
10263
10683
|
/**
|
|
10264
10684
|
* Generates Interest UI and submits graph payloads as a highly specialised component
|
|
10265
10685
|
*/
|
|
10686
|
+
|
|
10266
10687
|
var AddInterest = /*#__PURE__*/function (_React$Component) {
|
|
10688
|
+
_inherits(AddInterest, _React$Component);
|
|
10689
|
+
|
|
10690
|
+
var _super = _createSuper(AddInterest);
|
|
10691
|
+
|
|
10267
10692
|
function AddInterest(props) {
|
|
10268
10693
|
var _this;
|
|
10694
|
+
|
|
10269
10695
|
_classCallCheck(this, AddInterest);
|
|
10270
|
-
|
|
10271
|
-
|
|
10272
|
-
|
|
10273
|
-
_defineProperty(_this, "
|
|
10696
|
+
|
|
10697
|
+
_this = _super.call(this, props);
|
|
10698
|
+
|
|
10699
|
+
_defineProperty(_assertThisInitialized(_this), "maleCheckBoxRef", /*#__PURE__*/React__default.createRef());
|
|
10700
|
+
|
|
10701
|
+
_defineProperty(_assertThisInitialized(_this), "femaleCheckBoxRef", /*#__PURE__*/React__default.createRef());
|
|
10702
|
+
|
|
10703
|
+
_defineProperty(_assertThisInitialized(_this), "onCategoryChanged", function (categoryType) {
|
|
10274
10704
|
_this.setState({
|
|
10275
10705
|
category_type: categoryType,
|
|
10276
10706
|
brands: [],
|
|
10277
10707
|
styles: []
|
|
10278
10708
|
});
|
|
10279
10709
|
});
|
|
10280
|
-
|
|
10710
|
+
|
|
10711
|
+
_defineProperty(_assertThisInitialized(_this), "onGenderChanged", function (isChecked, gender) {
|
|
10281
10712
|
return _this.setState(function (prevState) {
|
|
10282
10713
|
// current array of options
|
|
10283
10714
|
var gendersSelected = _toConsumableArray(prevState.gender);
|
|
10284
|
-
|
|
10285
|
-
// check if the check box is checked or unchecked
|
|
10715
|
+
|
|
10716
|
+
var index; // check if the check box is checked or unchecked
|
|
10717
|
+
|
|
10286
10718
|
if (isChecked) {
|
|
10287
10719
|
gendersSelected.push(gender);
|
|
10288
10720
|
} else {
|
|
@@ -10290,65 +10722,76 @@
|
|
|
10290
10722
|
index = gendersSelected.indexOf(gender);
|
|
10291
10723
|
gendersSelected.splice(index, 1);
|
|
10292
10724
|
}
|
|
10725
|
+
|
|
10293
10726
|
return {
|
|
10294
10727
|
gender: gendersSelected
|
|
10295
10728
|
};
|
|
10296
10729
|
});
|
|
10297
10730
|
});
|
|
10298
|
-
|
|
10731
|
+
|
|
10732
|
+
_defineProperty(_assertThisInitialized(_this), "onBrandsChanged", function (brandsArray) {
|
|
10299
10733
|
_this.setState({
|
|
10300
10734
|
brands: brandsArray.map(function (brand) {
|
|
10301
10735
|
return brand.id;
|
|
10302
10736
|
})
|
|
10303
10737
|
});
|
|
10304
10738
|
});
|
|
10305
|
-
|
|
10739
|
+
|
|
10740
|
+
_defineProperty(_assertThisInitialized(_this), "onShoeSizesChanged", function (shoeSizes) {
|
|
10306
10741
|
_this.setState(_objectSpread2({}, shoeSizes));
|
|
10307
10742
|
});
|
|
10308
|
-
|
|
10743
|
+
|
|
10744
|
+
_defineProperty(_assertThisInitialized(_this), "onPriceRangesChanged", function (priceRange) {
|
|
10309
10745
|
_this.setState(_objectSpread2({}, priceRange));
|
|
10310
10746
|
});
|
|
10311
|
-
|
|
10747
|
+
|
|
10748
|
+
_defineProperty(_assertThisInitialized(_this), "onStylesChanged", function (stylesArray) {
|
|
10312
10749
|
_this.setState({
|
|
10313
10750
|
styles: stylesArray.map(function (style) {
|
|
10314
10751
|
return style.id;
|
|
10315
10752
|
})
|
|
10316
10753
|
});
|
|
10317
10754
|
});
|
|
10318
|
-
|
|
10755
|
+
|
|
10756
|
+
_defineProperty(_assertThisInitialized(_this), "onConditionChanged", function (conditions) {
|
|
10319
10757
|
_this.setState({
|
|
10320
10758
|
condition: conditions.map(function (condition) {
|
|
10321
10759
|
return condition.id;
|
|
10322
10760
|
})
|
|
10323
10761
|
});
|
|
10324
10762
|
});
|
|
10325
|
-
|
|
10763
|
+
|
|
10764
|
+
_defineProperty(_assertThisInitialized(_this), "payloadIsValid", function () {
|
|
10326
10765
|
// price/shoe-size always have initial values as soon as category is set
|
|
10327
10766
|
var category_type = _this.state.category_type;
|
|
10328
10767
|
return category_type !== null;
|
|
10329
10768
|
});
|
|
10330
|
-
|
|
10769
|
+
|
|
10770
|
+
_defineProperty(_assertThisInitialized(_this), "submitInterest", function () {
|
|
10331
10771
|
_this.setState({
|
|
10332
10772
|
request: _objectSpread2(_objectSpread2({}, request), {}, {
|
|
10333
10773
|
fetching: true
|
|
10334
10774
|
})
|
|
10335
10775
|
});
|
|
10776
|
+
|
|
10336
10777
|
var _this$state = _this.state,
|
|
10337
|
-
|
|
10338
|
-
|
|
10339
|
-
|
|
10340
|
-
|
|
10341
|
-
|
|
10342
|
-
|
|
10343
|
-
|
|
10344
|
-
|
|
10345
|
-
|
|
10346
|
-
|
|
10347
|
-
|
|
10778
|
+
brands = _this$state.brands,
|
|
10779
|
+
min_shoe_size_id = _this$state.min_shoe_size_id,
|
|
10780
|
+
max_shoe_size_id = _this$state.max_shoe_size_id,
|
|
10781
|
+
shoe_size_type = _this$state.shoe_size_type,
|
|
10782
|
+
min_price = _this$state.min_price,
|
|
10783
|
+
max_price = _this$state.max_price,
|
|
10784
|
+
styles = _this$state.styles,
|
|
10785
|
+
category_type = _this$state.category_type,
|
|
10786
|
+
requestState = _this$state.request,
|
|
10787
|
+
gender = _this$state.gender,
|
|
10788
|
+
condition = _this$state.condition;
|
|
10348
10789
|
var payloadGender = gender[0];
|
|
10790
|
+
|
|
10349
10791
|
if (gender.length > 1 || !gender.length) {
|
|
10350
10792
|
payloadGender = UNISEX$1;
|
|
10351
10793
|
}
|
|
10794
|
+
|
|
10352
10795
|
var basePayload = {
|
|
10353
10796
|
category_type: category_type,
|
|
10354
10797
|
brands: brands,
|
|
@@ -10364,21 +10807,27 @@
|
|
|
10364
10807
|
max_shoe_size_id: max_shoe_size_id,
|
|
10365
10808
|
shoe_size_type: shoe_size_type
|
|
10366
10809
|
} : {};
|
|
10810
|
+
|
|
10367
10811
|
var payload = _objectSpread2(_objectSpread2({}, basePayload), shoeSizesPayload);
|
|
10812
|
+
|
|
10368
10813
|
simpleRequest(_this.props.requestInstance, _this.props.addInterestApi, method.POST, payload, function () {
|
|
10369
10814
|
_this.setState({
|
|
10370
10815
|
request: _objectSpread2(_objectSpread2({}, request), {}, {
|
|
10371
10816
|
success: true
|
|
10372
10817
|
})
|
|
10373
10818
|
});
|
|
10819
|
+
|
|
10374
10820
|
_this.props.onSubmitSuccess(_objectSpread2({}, payload));
|
|
10375
10821
|
}, _this.handleRequestError);
|
|
10376
10822
|
});
|
|
10377
|
-
|
|
10823
|
+
|
|
10824
|
+
_defineProperty(_assertThisInitialized(_this), "handleRequestError", function (_ref) {
|
|
10378
10825
|
var data = _ref.data;
|
|
10826
|
+
|
|
10379
10827
|
_this.setState({
|
|
10380
10828
|
request: _objectSpread2({}, request)
|
|
10381
10829
|
});
|
|
10830
|
+
|
|
10382
10831
|
var errorMessages = Object.keys(data).map(function (key) {
|
|
10383
10832
|
return data[key];
|
|
10384
10833
|
}).flat();
|
|
@@ -10388,32 +10837,37 @@
|
|
|
10388
10837
|
}, message);
|
|
10389
10838
|
}));
|
|
10390
10839
|
});
|
|
10391
|
-
|
|
10840
|
+
|
|
10841
|
+
_defineProperty(_assertThisInitialized(_this), "resetState", function () {
|
|
10392
10842
|
_this.setState(_objectSpread2({}, defaultState));
|
|
10843
|
+
|
|
10393
10844
|
_this.props.onCancel();
|
|
10394
10845
|
});
|
|
10395
|
-
|
|
10846
|
+
|
|
10847
|
+
_defineProperty(_assertThisInitialized(_this), "handleGenderChange", function (isChecked, gender) {
|
|
10396
10848
|
return _this.onGenderChanged(isChecked, gender);
|
|
10397
10849
|
});
|
|
10398
|
-
|
|
10850
|
+
|
|
10851
|
+
_defineProperty(_assertThisInitialized(_this), "onAddInterestClick", function () {
|
|
10399
10852
|
_this.setState(function (prevState) {
|
|
10400
10853
|
return _objectSpread2(_objectSpread2({}, prevState), {}, {
|
|
10401
10854
|
isCategoriesShown: true
|
|
10402
10855
|
});
|
|
10403
10856
|
});
|
|
10404
10857
|
});
|
|
10405
|
-
|
|
10858
|
+
|
|
10859
|
+
_defineProperty(_assertThisInitialized(_this), "render", function () {
|
|
10406
10860
|
var _this$state2 = _this.state,
|
|
10407
|
-
|
|
10408
|
-
|
|
10861
|
+
category_type = _this$state2.category_type,
|
|
10862
|
+
fetching = _this$state2.request.fetching;
|
|
10409
10863
|
var _this$props = _this.props,
|
|
10410
|
-
|
|
10411
|
-
|
|
10412
|
-
|
|
10413
|
-
|
|
10414
|
-
|
|
10415
|
-
|
|
10416
|
-
|
|
10864
|
+
requestInstance = _this$props.requestInstance,
|
|
10865
|
+
baseGraphApi = _this$props.baseGraphApi,
|
|
10866
|
+
getBrandsGraphQuery = _this$props.getBrandsGraphQuery,
|
|
10867
|
+
getStylesGraphQuery = _this$props.getStylesGraphQuery,
|
|
10868
|
+
getShoesGraphQuery = _this$props.getShoesGraphQuery,
|
|
10869
|
+
defaultShoeSizeType = _this$props.defaultShoeSizeType,
|
|
10870
|
+
getConditionsGraphQuery = _this$props.getConditionsGraphQuery;
|
|
10417
10871
|
return /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
10418
10872
|
className: "interests__section-wrapper"
|
|
10419
10873
|
}, /*#__PURE__*/React__default.createElement(AddInterestContainer, null, /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement(CatSelectorParagraph, null, "Select the category that interests you"), /*#__PURE__*/React__default.createElement(CategoryInterestSelector, {
|
|
@@ -10464,16 +10918,19 @@
|
|
|
10464
10918
|
type: "button",
|
|
10465
10919
|
onClick: function onClick() {
|
|
10466
10920
|
_this.submitInterest();
|
|
10921
|
+
|
|
10467
10922
|
_this.resetState();
|
|
10468
10923
|
}
|
|
10469
10924
|
}, fetching ? 'SAVING' : 'SAVE'))))))));
|
|
10470
10925
|
});
|
|
10926
|
+
|
|
10471
10927
|
_this.state = _objectSpread2({}, defaultState);
|
|
10472
10928
|
return _this;
|
|
10473
10929
|
}
|
|
10474
|
-
|
|
10930
|
+
|
|
10475
10931
|
return _createClass(AddInterest);
|
|
10476
10932
|
}(React__default.Component);
|
|
10933
|
+
|
|
10477
10934
|
var AddInterest$1 = themed(AddInterest);
|
|
10478
10935
|
|
|
10479
10936
|
var _templateObject$M;
|
|
@@ -10484,6 +10941,7 @@
|
|
|
10484
10941
|
}, function (props) {
|
|
10485
10942
|
return props.theme.marginPaddings[1];
|
|
10486
10943
|
}, media.xs);
|
|
10944
|
+
|
|
10487
10945
|
var MyInterestTitleHeading = function MyInterestTitleHeading() {
|
|
10488
10946
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
10489
10947
|
className: "interests__title"
|
|
@@ -10505,6 +10963,7 @@
|
|
|
10505
10963
|
className: "heading-title-empty"
|
|
10506
10964
|
})));
|
|
10507
10965
|
};
|
|
10966
|
+
|
|
10508
10967
|
var MyInterestTitleHeading$1 = themed(MyInterestTitleHeading);
|
|
10509
10968
|
|
|
10510
10969
|
var _templateObject$N;
|
|
@@ -10513,6 +10972,7 @@
|
|
|
10513
10972
|
}, function (props) {
|
|
10514
10973
|
return props.theme.marginPaddings[1];
|
|
10515
10974
|
}, media.xs);
|
|
10975
|
+
|
|
10516
10976
|
var MyProductInterestTitleHeading = function MyProductInterestTitleHeading() {
|
|
10517
10977
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
10518
10978
|
className: "interests__title"
|
|
@@ -10528,6 +10988,7 @@
|
|
|
10528
10988
|
className: "heading-title-empty"
|
|
10529
10989
|
})));
|
|
10530
10990
|
};
|
|
10991
|
+
|
|
10531
10992
|
var MyProductInterestTitleHeading$1 = themed(MyProductInterestTitleHeading);
|
|
10532
10993
|
|
|
10533
10994
|
var Add = (function (props) {
|
|
@@ -10550,6 +11011,7 @@
|
|
|
10550
11011
|
|
|
10551
11012
|
function getToken() {
|
|
10552
11013
|
var _Cookies$get;
|
|
11014
|
+
|
|
10553
11015
|
return (_Cookies$get = Cookies.get('_tk')) === null || _Cookies$get === void 0 ? void 0 : _Cookies$get.replace('*', 'Bearer ');
|
|
10554
11016
|
}
|
|
10555
11017
|
function setToken(value) {
|
|
@@ -10557,29 +11019,35 @@
|
|
|
10557
11019
|
}
|
|
10558
11020
|
|
|
10559
11021
|
/** @format */
|
|
11022
|
+
|
|
10560
11023
|
function getEncodedSearch(currentUrl) {
|
|
10561
11024
|
var splitUrl = currentUrl.split('?');
|
|
10562
11025
|
var baseUrl = splitUrl[0];
|
|
10563
11026
|
var nextUrlSegments = splitUrl[1].split('&');
|
|
10564
11027
|
var nextQueryString = splitUrl[1];
|
|
11028
|
+
|
|
10565
11029
|
if (nextUrlSegments.length > 0) {
|
|
10566
11030
|
nextQueryString = nextUrlSegments.map(function (v) {
|
|
10567
11031
|
var nextValue = v;
|
|
11032
|
+
|
|
10568
11033
|
if (v.includes('search=')) {
|
|
10569
11034
|
var temp = v.split('=');
|
|
10570
11035
|
nextValue = "".concat(temp[0], "=").concat(encodeURIComponent(temp[1]));
|
|
10571
11036
|
}
|
|
11037
|
+
|
|
10572
11038
|
return nextValue;
|
|
10573
11039
|
}).join('&');
|
|
10574
11040
|
}
|
|
11041
|
+
|
|
10575
11042
|
return "".concat(baseUrl, "?").concat(nextQueryString);
|
|
10576
11043
|
}
|
|
10577
|
-
|
|
10578
11044
|
/**
|
|
10579
11045
|
* Gets an instance of Axios that is configured with the custom failure handlers
|
|
10580
11046
|
* @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]
|
|
10581
11047
|
* @param {Function} onForbidden - callback triggers when http status = 403
|
|
10582
11048
|
*/
|
|
11049
|
+
|
|
11050
|
+
|
|
10583
11051
|
var axiosInstance = function axiosInstance(onAuthFailed, onForbidden) {
|
|
10584
11052
|
var instance = axios.create({
|
|
10585
11053
|
validateStatus: function validateStatus(status) {
|
|
@@ -10587,56 +11055,60 @@
|
|
|
10587
11055
|
}
|
|
10588
11056
|
});
|
|
10589
11057
|
var token = getToken();
|
|
11058
|
+
|
|
10590
11059
|
if (token !== '') {
|
|
10591
11060
|
instance.defaults.headers.common.Authorization = token;
|
|
10592
11061
|
}
|
|
10593
|
-
instance.defaults.headers.common['Content-Type'] = 'application/json;charset=UTF-8';
|
|
10594
11062
|
|
|
10595
|
-
// Add a request interceptor
|
|
11063
|
+
instance.defaults.headers.common['Content-Type'] = 'application/json;charset=UTF-8'; // Add a request interceptor
|
|
11064
|
+
|
|
10596
11065
|
instance.interceptors.request.use(function (request, error) {
|
|
10597
11066
|
if (error) {
|
|
10598
11067
|
return Promise.reject(error.response);
|
|
10599
11068
|
}
|
|
11069
|
+
|
|
10600
11070
|
if (request.url.includes('search') && request.url.includes('?')) {
|
|
10601
11071
|
// do some uri manipulation for ie
|
|
10602
11072
|
// https://stackoverflow.com/questions/18220057
|
|
10603
|
-
|
|
10604
11073
|
// eslint-disable-next-line no-param-reassign
|
|
10605
11074
|
request.url = getEncodedSearch(request.url);
|
|
10606
|
-
}
|
|
11075
|
+
} // eslint-disable-next-line no-param-reassign
|
|
11076
|
+
|
|
10607
11077
|
|
|
10608
|
-
// eslint-disable-next-line no-param-reassign
|
|
10609
11078
|
request.headers.common['Content-Type'] = 'application/json; charset=utf-8';
|
|
11079
|
+
|
|
10610
11080
|
if (typeof request.body === 'undefined') {
|
|
10611
11081
|
request.body = {};
|
|
10612
11082
|
}
|
|
11083
|
+
|
|
10613
11084
|
token = getToken();
|
|
11085
|
+
|
|
10614
11086
|
if (token !== '') {
|
|
10615
11087
|
// eslint-disable-next-line no-param-reassign
|
|
10616
11088
|
request.headers.common.Authorization = token;
|
|
10617
11089
|
}
|
|
11090
|
+
|
|
10618
11091
|
return request;
|
|
10619
11092
|
}, function (error) {
|
|
10620
11093
|
return Promise.reject(error.message);
|
|
10621
|
-
});
|
|
11094
|
+
}); // Add a response interceptor
|
|
10622
11095
|
|
|
10623
|
-
// Add a response interceptor
|
|
10624
11096
|
instance.interceptors.response.use(function (response, error) {
|
|
10625
11097
|
if (error) {
|
|
10626
11098
|
return Promise.reject(error.response);
|
|
10627
11099
|
}
|
|
11100
|
+
|
|
10628
11101
|
if (response.headers.authorization) {
|
|
10629
11102
|
setToken(response.headers.authorization);
|
|
10630
11103
|
}
|
|
11104
|
+
|
|
10631
11105
|
return response;
|
|
10632
11106
|
}, function (error) {
|
|
10633
11107
|
if (error.response) {
|
|
10634
11108
|
// network error
|
|
10635
11109
|
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) {
|
|
10636
11110
|
onAuthFailed();
|
|
10637
|
-
}
|
|
10638
|
-
|
|
10639
|
-
// if (error.response.status === 500) {
|
|
11111
|
+
} // if (error.response.status === 500) {
|
|
10640
11112
|
// // INTERNAL SERVER ERROR
|
|
10641
11113
|
// store.dispatch({
|
|
10642
11114
|
// type: AppConstants.OVERLAY.SERVER_ERROR,
|
|
@@ -10644,34 +11116,39 @@
|
|
|
10644
11116
|
// return Promise.reject(error.response);
|
|
10645
11117
|
// }
|
|
10646
11118
|
|
|
11119
|
+
|
|
10647
11120
|
if (error.response.status === 403) {
|
|
10648
11121
|
// FORBIDDEN
|
|
10649
11122
|
onForbidden();
|
|
10650
11123
|
}
|
|
11124
|
+
|
|
10651
11125
|
return Promise.reject(error.response);
|
|
10652
11126
|
}
|
|
11127
|
+
|
|
10653
11128
|
return Promise.reject(error);
|
|
10654
11129
|
});
|
|
10655
11130
|
return instance;
|
|
10656
|
-
};
|
|
11131
|
+
}; // NOTE: this to be instanciated with params: onAuthFailed, onForbidden
|
|
10657
11132
|
|
|
10658
11133
|
var _excluded$8 = ["children"];
|
|
11134
|
+
|
|
10659
11135
|
var DropdownSelector = function DropdownSelector(_ref) {
|
|
10660
11136
|
var selectedOption = _ref.selectedOption,
|
|
10661
|
-
|
|
10662
|
-
|
|
10663
|
-
|
|
10664
|
-
|
|
10665
|
-
|
|
10666
|
-
|
|
10667
|
-
|
|
11137
|
+
onOptionChange = _ref.onOptionChange,
|
|
11138
|
+
options = _ref.options,
|
|
11139
|
+
isSearchable = _ref.isSearchable,
|
|
11140
|
+
placeholder = _ref.placeholder,
|
|
11141
|
+
name = _ref.name,
|
|
11142
|
+
showSearchIcon = _ref.showSearchIcon,
|
|
11143
|
+
isDisabled = _ref.isDisabled;
|
|
10668
11144
|
var customComponents = {
|
|
10669
11145
|
DropdownIndicator: function DropdownIndicator() {
|
|
10670
11146
|
return null;
|
|
10671
11147
|
},
|
|
10672
11148
|
ValueContainer: function ValueContainer(_ref2) {
|
|
10673
11149
|
var children = _ref2.children,
|
|
10674
|
-
|
|
11150
|
+
props = _objectWithoutProperties(_ref2, _excluded$8);
|
|
11151
|
+
|
|
10675
11152
|
return /*#__PURE__*/React__default.createElement("div", _extends({
|
|
10676
11153
|
style: {
|
|
10677
11154
|
position: 'relative'
|
|
@@ -10799,6 +11276,7 @@
|
|
|
10799
11276
|
isDisabled: isDisabled
|
|
10800
11277
|
}));
|
|
10801
11278
|
};
|
|
11279
|
+
|
|
10802
11280
|
DropdownSelector.defaultProps = {
|
|
10803
11281
|
isSearchable: false,
|
|
10804
11282
|
selectedOption: null,
|
|
@@ -10823,144 +11301,178 @@
|
|
|
10823
11301
|
}, function (props) {
|
|
10824
11302
|
return props.theme.marginPaddings[1];
|
|
10825
11303
|
});
|
|
11304
|
+
|
|
10826
11305
|
var AddProductInterest = function AddProductInterest(_ref) {
|
|
10827
11306
|
var baseGraphApi = _ref.baseGraphApi,
|
|
10828
|
-
|
|
10829
|
-
|
|
10830
|
-
|
|
10831
|
-
|
|
10832
|
-
|
|
10833
|
-
|
|
10834
|
-
|
|
11307
|
+
getBrandsGraphQuery = _ref.getBrandsGraphQuery,
|
|
11308
|
+
getModelsGraphQuery = _ref.getModelsGraphQuery,
|
|
11309
|
+
getMaterialsGraphQuery = _ref.getMaterialsGraphQuery,
|
|
11310
|
+
onCancel = _ref.onCancel,
|
|
11311
|
+
requestInstance = _ref.requestInstance,
|
|
11312
|
+
addLuxityProductInterestApi = _ref.addLuxityProductInterestApi,
|
|
11313
|
+
onSubmitSuccess = _ref.onSubmitSuccess;
|
|
11314
|
+
|
|
10835
11315
|
var _useState = React.useState([]),
|
|
10836
|
-
|
|
10837
|
-
|
|
10838
|
-
|
|
11316
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
11317
|
+
brands = _useState2[0],
|
|
11318
|
+
setBrands = _useState2[1];
|
|
11319
|
+
|
|
10839
11320
|
var _useState3 = React.useState([]),
|
|
10840
|
-
|
|
10841
|
-
|
|
10842
|
-
|
|
11321
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
11322
|
+
models = _useState4[0],
|
|
11323
|
+
setModels = _useState4[1];
|
|
11324
|
+
|
|
10843
11325
|
var _useState5 = React.useState([]),
|
|
10844
|
-
|
|
10845
|
-
|
|
10846
|
-
|
|
11326
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
11327
|
+
materials = _useState6[0],
|
|
11328
|
+
setMaterials = _useState6[1];
|
|
11329
|
+
|
|
10847
11330
|
var _useState7 = React.useState(null),
|
|
10848
|
-
|
|
10849
|
-
|
|
10850
|
-
|
|
11331
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
11332
|
+
selectedBrand = _useState8[0],
|
|
11333
|
+
setSelectedBrand = _useState8[1];
|
|
11334
|
+
|
|
10851
11335
|
var _useState9 = React.useState(null),
|
|
10852
|
-
|
|
10853
|
-
|
|
10854
|
-
|
|
11336
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
11337
|
+
selectedModel = _useState10[0],
|
|
11338
|
+
setSelectedModel = _useState10[1];
|
|
11339
|
+
|
|
10855
11340
|
var _useState11 = React.useState(null),
|
|
10856
|
-
|
|
10857
|
-
|
|
10858
|
-
|
|
10859
|
-
|
|
11341
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
11342
|
+
selectedMaterial = _useState12[0],
|
|
11343
|
+
setSelectedMaterial = _useState12[1];
|
|
11344
|
+
|
|
11345
|
+
var fetchBrands = React.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
10860
11346
|
var _response$data, _response$data$data, _response$data$data$l, response, formattedBrands;
|
|
11347
|
+
|
|
10861
11348
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
10862
|
-
while (1)
|
|
10863
|
-
|
|
10864
|
-
_context.prev = 0;
|
|
10865
|
-
_context.next = 3;
|
|
10866
|
-
return axiosInstance.post("".concat(baseGraphApi, "?id=getBrands"), {
|
|
10867
|
-
query: getBrandsGraphQuery(1000, 1, 'id|desc')
|
|
10868
|
-
});
|
|
10869
|
-
case 3:
|
|
10870
|
-
response = _context.sent;
|
|
10871
|
-
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) {
|
|
10872
|
-
formattedBrands = response.data.data.luxity_brands.data.map(function (brand) {
|
|
10873
|
-
return {
|
|
10874
|
-
value: brand.id,
|
|
10875
|
-
label: brand.name
|
|
10876
|
-
};
|
|
10877
|
-
});
|
|
10878
|
-
setBrands(formattedBrands);
|
|
10879
|
-
}
|
|
10880
|
-
_context.next = 10;
|
|
10881
|
-
break;
|
|
10882
|
-
case 7:
|
|
10883
|
-
_context.prev = 7;
|
|
10884
|
-
_context.t0 = _context["catch"](0);
|
|
10885
|
-
error(_context.t0.message);
|
|
10886
|
-
case 10:
|
|
10887
|
-
case "end":
|
|
10888
|
-
return _context.stop();
|
|
10889
|
-
}
|
|
10890
|
-
}, _callee, null, [[0, 7]]);
|
|
10891
|
-
})), [baseGraphApi, getBrandsGraphQuery]);
|
|
10892
|
-
var fetchModels = React.useCallback(/*#__PURE__*/function () {
|
|
10893
|
-
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(brandId) {
|
|
10894
|
-
var _response$data2, _response$data2$data, _response$data2$data$, response, formattedModels;
|
|
10895
|
-
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
10896
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
11349
|
+
while (1) {
|
|
11350
|
+
switch (_context.prev = _context.next) {
|
|
10897
11351
|
case 0:
|
|
10898
|
-
|
|
10899
|
-
|
|
10900
|
-
return axiosInstance.post("".concat(baseGraphApi, "?id=
|
|
10901
|
-
query:
|
|
11352
|
+
_context.prev = 0;
|
|
11353
|
+
_context.next = 3;
|
|
11354
|
+
return axiosInstance.post("".concat(baseGraphApi, "?id=getBrands"), {
|
|
11355
|
+
query: getBrandsGraphQuery(1000, 1, 'id|desc')
|
|
10902
11356
|
});
|
|
11357
|
+
|
|
10903
11358
|
case 3:
|
|
10904
|
-
response =
|
|
10905
|
-
|
|
10906
|
-
|
|
11359
|
+
response = _context.sent;
|
|
11360
|
+
|
|
11361
|
+
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) {
|
|
11362
|
+
formattedBrands = response.data.data.luxity_brands.data.map(function (brand) {
|
|
10907
11363
|
return {
|
|
10908
|
-
value:
|
|
10909
|
-
label:
|
|
11364
|
+
value: brand.id,
|
|
11365
|
+
label: brand.name
|
|
10910
11366
|
};
|
|
10911
11367
|
});
|
|
10912
|
-
|
|
11368
|
+
setBrands(formattedBrands);
|
|
10913
11369
|
}
|
|
10914
|
-
|
|
11370
|
+
|
|
11371
|
+
_context.next = 10;
|
|
10915
11372
|
break;
|
|
11373
|
+
|
|
10916
11374
|
case 7:
|
|
10917
|
-
|
|
10918
|
-
|
|
10919
|
-
error(
|
|
11375
|
+
_context.prev = 7;
|
|
11376
|
+
_context.t0 = _context["catch"](0);
|
|
11377
|
+
error(_context.t0.message);
|
|
11378
|
+
|
|
10920
11379
|
case 10:
|
|
10921
11380
|
case "end":
|
|
10922
|
-
return
|
|
11381
|
+
return _context.stop();
|
|
11382
|
+
}
|
|
11383
|
+
}
|
|
11384
|
+
}, _callee, null, [[0, 7]]);
|
|
11385
|
+
})), [baseGraphApi, getBrandsGraphQuery]);
|
|
11386
|
+
var fetchModels = React.useCallback( /*#__PURE__*/function () {
|
|
11387
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(brandId) {
|
|
11388
|
+
var _response$data2, _response$data2$data, _response$data2$data$, response, formattedModels;
|
|
11389
|
+
|
|
11390
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
11391
|
+
while (1) {
|
|
11392
|
+
switch (_context2.prev = _context2.next) {
|
|
11393
|
+
case 0:
|
|
11394
|
+
_context2.prev = 0;
|
|
11395
|
+
_context2.next = 3;
|
|
11396
|
+
return axiosInstance.post("".concat(baseGraphApi, "?id=getModels"), {
|
|
11397
|
+
query: getModelsGraphQuery(brandId)
|
|
11398
|
+
});
|
|
11399
|
+
|
|
11400
|
+
case 3:
|
|
11401
|
+
response = _context2.sent;
|
|
11402
|
+
|
|
11403
|
+
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) {
|
|
11404
|
+
formattedModels = response.data.data.luxity_models.data.map(function (model) {
|
|
11405
|
+
return {
|
|
11406
|
+
value: model.id,
|
|
11407
|
+
label: model.name
|
|
11408
|
+
};
|
|
11409
|
+
});
|
|
11410
|
+
setModels(formattedModels);
|
|
11411
|
+
}
|
|
11412
|
+
|
|
11413
|
+
_context2.next = 10;
|
|
11414
|
+
break;
|
|
11415
|
+
|
|
11416
|
+
case 7:
|
|
11417
|
+
_context2.prev = 7;
|
|
11418
|
+
_context2.t0 = _context2["catch"](0);
|
|
11419
|
+
error(_context2.t0.message);
|
|
11420
|
+
|
|
11421
|
+
case 10:
|
|
11422
|
+
case "end":
|
|
11423
|
+
return _context2.stop();
|
|
11424
|
+
}
|
|
10923
11425
|
}
|
|
10924
11426
|
}, _callee2, null, [[0, 7]]);
|
|
10925
11427
|
}));
|
|
11428
|
+
|
|
10926
11429
|
return function (_x) {
|
|
10927
11430
|
return _ref3.apply(this, arguments);
|
|
10928
11431
|
};
|
|
10929
11432
|
}(), [baseGraphApi, getModelsGraphQuery]);
|
|
10930
|
-
var fetchMaterials = React.useCallback(/*#__PURE__*/function () {
|
|
10931
|
-
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(brandId) {
|
|
11433
|
+
var fetchMaterials = React.useCallback( /*#__PURE__*/function () {
|
|
11434
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(brandId) {
|
|
10932
11435
|
var _response$data3, _response$data3$data, _response$data3$data$, response, formattedMaterials;
|
|
11436
|
+
|
|
10933
11437
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
10934
|
-
while (1)
|
|
10935
|
-
|
|
10936
|
-
|
|
10937
|
-
|
|
10938
|
-
|
|
10939
|
-
|
|
10940
|
-
|
|
10941
|
-
case 3:
|
|
10942
|
-
response = _context3.sent;
|
|
10943
|
-
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) {
|
|
10944
|
-
formattedMaterials = response.data.data.luxity_materials.data.map(function (material) {
|
|
10945
|
-
return {
|
|
10946
|
-
value: material.id,
|
|
10947
|
-
label: material.name
|
|
10948
|
-
};
|
|
11438
|
+
while (1) {
|
|
11439
|
+
switch (_context3.prev = _context3.next) {
|
|
11440
|
+
case 0:
|
|
11441
|
+
_context3.prev = 0;
|
|
11442
|
+
_context3.next = 3;
|
|
11443
|
+
return axiosInstance.post("".concat(baseGraphApi, "?id=getMaterials"), {
|
|
11444
|
+
query: getMaterialsGraphQuery(brandId)
|
|
10949
11445
|
});
|
|
10950
|
-
|
|
10951
|
-
|
|
10952
|
-
|
|
10953
|
-
|
|
10954
|
-
|
|
10955
|
-
|
|
10956
|
-
|
|
10957
|
-
|
|
10958
|
-
|
|
10959
|
-
|
|
10960
|
-
|
|
11446
|
+
|
|
11447
|
+
case 3:
|
|
11448
|
+
response = _context3.sent;
|
|
11449
|
+
|
|
11450
|
+
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) {
|
|
11451
|
+
formattedMaterials = response.data.data.luxity_materials.data.map(function (material) {
|
|
11452
|
+
return {
|
|
11453
|
+
value: material.id,
|
|
11454
|
+
label: material.name
|
|
11455
|
+
};
|
|
11456
|
+
});
|
|
11457
|
+
setMaterials(formattedMaterials);
|
|
11458
|
+
}
|
|
11459
|
+
|
|
11460
|
+
_context3.next = 10;
|
|
11461
|
+
break;
|
|
11462
|
+
|
|
11463
|
+
case 7:
|
|
11464
|
+
_context3.prev = 7;
|
|
11465
|
+
_context3.t0 = _context3["catch"](0);
|
|
11466
|
+
error(_context3.t0.message);
|
|
11467
|
+
|
|
11468
|
+
case 10:
|
|
11469
|
+
case "end":
|
|
11470
|
+
return _context3.stop();
|
|
11471
|
+
}
|
|
10961
11472
|
}
|
|
10962
11473
|
}, _callee3, null, [[0, 7]]);
|
|
10963
11474
|
}));
|
|
11475
|
+
|
|
10964
11476
|
return function (_x2) {
|
|
10965
11477
|
return _ref4.apply(this, arguments);
|
|
10966
11478
|
};
|
|
@@ -10981,15 +11493,19 @@
|
|
|
10981
11493
|
setSelectedMaterial(null);
|
|
10982
11494
|
}
|
|
10983
11495
|
}, [selectedBrand, fetchModels, fetchMaterials]);
|
|
11496
|
+
|
|
10984
11497
|
var onBrandChange = function onBrandChange(selectedOption) {
|
|
10985
11498
|
setSelectedBrand(selectedOption);
|
|
10986
11499
|
};
|
|
11500
|
+
|
|
10987
11501
|
var onModelChange = function onModelChange(selectedOption) {
|
|
10988
11502
|
setSelectedModel(selectedOption);
|
|
10989
11503
|
};
|
|
11504
|
+
|
|
10990
11505
|
var onMaterialChange = function onMaterialChange(selectedOption) {
|
|
10991
11506
|
setSelectedMaterial(selectedOption);
|
|
10992
11507
|
};
|
|
11508
|
+
|
|
10993
11509
|
var submitInterest = function submitInterest() {
|
|
10994
11510
|
var payload = {
|
|
10995
11511
|
luxity_brand_id: selectedBrand === null || selectedBrand === void 0 ? void 0 : selectedBrand.value,
|
|
@@ -11001,6 +11517,7 @@
|
|
|
11001
11517
|
onCancel();
|
|
11002
11518
|
}, handleRequestError);
|
|
11003
11519
|
};
|
|
11520
|
+
|
|
11004
11521
|
var handleRequestError = function handleRequestError(_ref5) {
|
|
11005
11522
|
var data = _ref5.data;
|
|
11006
11523
|
var errorMessages = Object.keys(data).map(function (key) {
|
|
@@ -11012,6 +11529,7 @@
|
|
|
11012
11529
|
}, message);
|
|
11013
11530
|
}));
|
|
11014
11531
|
};
|
|
11532
|
+
|
|
11015
11533
|
var onReset = function onReset() {
|
|
11016
11534
|
onCancel();
|
|
11017
11535
|
setSelectedModel(null);
|
|
@@ -11021,6 +11539,7 @@
|
|
|
11021
11539
|
setMaterials([]);
|
|
11022
11540
|
setModels([]);
|
|
11023
11541
|
};
|
|
11542
|
+
|
|
11024
11543
|
return /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
11025
11544
|
className: "interests__section-wrapper"
|
|
11026
11545
|
}, /*#__PURE__*/React__default.createElement(AddInterestContainer$1, null, /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -11068,36 +11587,50 @@
|
|
|
11068
11587
|
onClick: submitInterest
|
|
11069
11588
|
}, "SAVE"))))))));
|
|
11070
11589
|
};
|
|
11590
|
+
|
|
11071
11591
|
var AddProductInterest$1 = themed(AddProductInterest);
|
|
11072
11592
|
|
|
11073
11593
|
var _templateObject$P, _templateObject2$b, _templateObject3$5;
|
|
11594
|
+
|
|
11074
11595
|
var TrashIcon$1 = function TrashIcon(_ref) {
|
|
11075
11596
|
var onClick = _ref.onClick,
|
|
11076
|
-
|
|
11597
|
+
id = _ref.id;
|
|
11077
11598
|
return /*#__PURE__*/React__default.createElement(IconWrapper, {
|
|
11078
11599
|
onClick: onClick,
|
|
11079
11600
|
id: id
|
|
11080
11601
|
}, /*#__PURE__*/React__default.createElement(SvgWrapper, null, /*#__PURE__*/React__default.createElement(Trash, null)));
|
|
11081
11602
|
};
|
|
11603
|
+
|
|
11082
11604
|
var LuxityProductInterestItem = /*#__PURE__*/function (_React$Component) {
|
|
11605
|
+
_inherits(LuxityProductInterestItem, _React$Component);
|
|
11606
|
+
|
|
11607
|
+
var _super = _createSuper(LuxityProductInterestItem);
|
|
11608
|
+
|
|
11083
11609
|
function LuxityProductInterestItem(props) {
|
|
11084
11610
|
var _this;
|
|
11611
|
+
|
|
11085
11612
|
_classCallCheck(this, LuxityProductInterestItem);
|
|
11086
|
-
|
|
11087
|
-
|
|
11613
|
+
|
|
11614
|
+
_this = _super.call(this, props);
|
|
11615
|
+
|
|
11616
|
+
_defineProperty(_assertThisInitialized(_this), "deleteInterestItem", function () {
|
|
11088
11617
|
var id = _this.props.data.id;
|
|
11618
|
+
|
|
11089
11619
|
_this.setState({
|
|
11090
11620
|
delete: _objectSpread2(_objectSpread2({}, request), {}, {
|
|
11091
11621
|
fetching: true
|
|
11092
11622
|
})
|
|
11093
11623
|
});
|
|
11624
|
+
|
|
11094
11625
|
var url = _this.props.deleteInterestApi(id);
|
|
11626
|
+
|
|
11095
11627
|
simpleRequest(_this.props.requestInstance, url, method.DELETE, null, function () {
|
|
11096
11628
|
_this.setState({
|
|
11097
11629
|
delete: _objectSpread2(_objectSpread2({}, request), {}, {
|
|
11098
11630
|
success: true
|
|
11099
11631
|
})
|
|
11100
11632
|
});
|
|
11633
|
+
|
|
11101
11634
|
_this.props.onDeleted(_this.props.data);
|
|
11102
11635
|
}, function () {
|
|
11103
11636
|
return _this.setState({
|
|
@@ -11105,8 +11638,10 @@
|
|
|
11105
11638
|
});
|
|
11106
11639
|
});
|
|
11107
11640
|
});
|
|
11108
|
-
|
|
11641
|
+
|
|
11642
|
+
_defineProperty(_assertThisInitialized(_this), "render", function () {
|
|
11109
11643
|
var _data$luxity_model, _data$luxity_material;
|
|
11644
|
+
|
|
11110
11645
|
var data = _this.props.data;
|
|
11111
11646
|
var success = _this.state.delete.success;
|
|
11112
11647
|
return /*#__PURE__*/React__default.createElement(InterestItemContainer$1, {
|
|
@@ -11136,14 +11671,16 @@
|
|
|
11136
11671
|
}
|
|
11137
11672
|
}));
|
|
11138
11673
|
});
|
|
11674
|
+
|
|
11139
11675
|
_this.state = {
|
|
11140
11676
|
delete: _objectSpread2({}, request)
|
|
11141
11677
|
};
|
|
11142
11678
|
return _this;
|
|
11143
11679
|
}
|
|
11144
|
-
|
|
11680
|
+
|
|
11145
11681
|
return _createClass(LuxityProductInterestItem);
|
|
11146
11682
|
}(React__default.Component);
|
|
11683
|
+
|
|
11147
11684
|
var InterestItemTitle$1 = styled__default.div(_templateObject$P || (_templateObject$P = _taggedTemplateLiteral(["\n font-weight: bold;\n display: none;\n\n @media (max-width: ", ") {\n display: inline;\n }\n"])), media.xs);
|
|
11148
11685
|
var InterestItemContainer$1 = styled__default.div(_templateObject2$b || (_templateObject2$b = _taggedTemplateLiteral(["\n display: flex;\n\n .no-shoe-size-section {\n @media (max-width: ", ") {\n display: none;\n }\n }\n"])), media.xs);
|
|
11149
11686
|
var InterestItemContent$1 = styled__default.div(_templateObject3$5 || (_templateObject3$5 = _taggedTemplateLiteral(["\n display: flex;\n justify-content: space-between;\n width: 95%;\n height: 100%;\n border: 1px solid ", ";\n padding: 1rem;\n margin-bottom: ", ";\n\n .interest-item__container_heading {\n color: ", ";\n flex-basis: calc(100% / 6);\n margin-top: 0.3rem;\n\n @media (max-width: ", ") {\n display: inline;\n }\n }\n\n .list-items {\n display: inline-flex;\n flex-direction: column;\n\n @media (max-width: ", ") {\n margin-left: ", ";\n }\n }\n\n @media (max-width: ", ") {\n flex-direction: column;\n }\n"])), function (props) {
|
|
@@ -11156,25 +11693,27 @@
|
|
|
11156
11693
|
return props.theme.marginPaddings[0];
|
|
11157
11694
|
}, media.xs);
|
|
11158
11695
|
var ThemedInterestItem$1 = themed(LuxityProductInterestItem);
|
|
11159
|
-
|
|
11160
11696
|
/**
|
|
11161
11697
|
* The Interest Item view shows the selected interest configuration,
|
|
11162
11698
|
* and gives user control to delete it.
|
|
11163
11699
|
*/
|
|
11700
|
+
|
|
11164
11701
|
var LuxityProductInterestItem$1 = (function (props) {
|
|
11165
11702
|
return /*#__PURE__*/React__default.createElement(ThemedInterestItem$1, props);
|
|
11166
11703
|
});
|
|
11167
11704
|
|
|
11168
11705
|
var _templateObject$Q, _templateObject2$c;
|
|
11169
11706
|
var AddInterestButtonContainer = styled__default.div(_templateObject$Q || (_templateObject$Q = _taggedTemplateLiteral(["\n display: flex;\n width: 100%;\n\n #add-icon {\n margin-bottom: 1.5rem;\n\n svg {\n width: 15px;\n }\n }\n"])));
|
|
11707
|
+
|
|
11170
11708
|
var AddIcon = function AddIcon(_ref) {
|
|
11171
11709
|
var onClick = _ref.onClick,
|
|
11172
|
-
|
|
11710
|
+
id = _ref.id;
|
|
11173
11711
|
return /*#__PURE__*/React__default.createElement(IconWrapper, {
|
|
11174
11712
|
id: id,
|
|
11175
11713
|
onClick: onClick
|
|
11176
11714
|
}, /*#__PURE__*/React__default.createElement(SvgWrapper, null, /*#__PURE__*/React__default.createElement(Add, null)));
|
|
11177
11715
|
};
|
|
11716
|
+
|
|
11178
11717
|
var AccountIcon = themed(function () {
|
|
11179
11718
|
return /*#__PURE__*/React__default.createElement(SvgWrapper, null, /*#__PURE__*/React__default.createElement(Account, null));
|
|
11180
11719
|
});
|
|
@@ -11187,39 +11726,50 @@
|
|
|
11187
11726
|
}, function (props) {
|
|
11188
11727
|
return props.theme.marginPaddings[2];
|
|
11189
11728
|
}));
|
|
11729
|
+
|
|
11190
11730
|
/**
|
|
11191
11731
|
* Page/View that controls the viewing and Adding of Luxity Interests
|
|
11192
11732
|
*/
|
|
11193
11733
|
var Interests = /*#__PURE__*/function (_React$Component) {
|
|
11734
|
+
_inherits(Interests, _React$Component);
|
|
11735
|
+
|
|
11736
|
+
var _super = _createSuper(Interests);
|
|
11737
|
+
|
|
11194
11738
|
function Interests(props) {
|
|
11195
11739
|
var _this;
|
|
11740
|
+
|
|
11196
11741
|
_classCallCheck(this, Interests);
|
|
11197
|
-
|
|
11198
|
-
|
|
11199
|
-
|
|
11200
|
-
_defineProperty(_this, "
|
|
11742
|
+
|
|
11743
|
+
_this = _super.call(this, props);
|
|
11744
|
+
|
|
11745
|
+
_defineProperty(_assertThisInitialized(_this), "categoryInterestType", 'CATEGORY');
|
|
11746
|
+
|
|
11747
|
+
_defineProperty(_assertThisInitialized(_this), "productInterestType", 'PRODUCT');
|
|
11748
|
+
|
|
11749
|
+
_defineProperty(_assertThisInitialized(_this), "setInterests", function (data) {
|
|
11201
11750
|
var _data$data$data = data.data.data,
|
|
11202
|
-
|
|
11203
|
-
|
|
11751
|
+
interests = _data$data$data.interests.data,
|
|
11752
|
+
luxity_product_interests = _data$data$data.luxity_product_interests.data;
|
|
11753
|
+
|
|
11204
11754
|
_this.setState({
|
|
11205
11755
|
interests: interests,
|
|
11206
11756
|
luxity_product_interests: luxity_product_interests
|
|
11207
11757
|
});
|
|
11208
11758
|
});
|
|
11209
|
-
|
|
11210
|
-
_defineProperty(_this, "onInterestSubmitSuccess", function (interestItem) {
|
|
11759
|
+
|
|
11760
|
+
_defineProperty(_assertThisInitialized(_this), "onInterestSubmitSuccess", function (interestItem) {
|
|
11211
11761
|
// due to the fact that we dont get the Interest payload back - we have to re-request the list
|
|
11212
11762
|
_this.triggerInterestRequest().then(function (res) {
|
|
11213
11763
|
return _this.setInterests(res);
|
|
11214
|
-
});
|
|
11215
|
-
|
|
11216
|
-
// UNCOMMENT WHEN Interest Items is returned as expected Object Shape
|
|
11764
|
+
}); // UNCOMMENT WHEN Interest Items is returned as expected Object Shape
|
|
11217
11765
|
// this.setState(prevState => {
|
|
11218
11766
|
// const newInterests = [interestItem].concat(prevState.interests);
|
|
11219
11767
|
// return { ...prevState, interests: newInterests };
|
|
11220
11768
|
// });
|
|
11769
|
+
|
|
11221
11770
|
});
|
|
11222
|
-
|
|
11771
|
+
|
|
11772
|
+
_defineProperty(_assertThisInitialized(_this), "onDeleteInterest", function (deletedItem) {
|
|
11223
11773
|
_this.setState(function (prevState) {
|
|
11224
11774
|
var newInterests = prevState.interests.filter(function (item) {
|
|
11225
11775
|
return item.id !== deletedItem.id;
|
|
@@ -11229,7 +11779,8 @@
|
|
|
11229
11779
|
});
|
|
11230
11780
|
});
|
|
11231
11781
|
});
|
|
11232
|
-
|
|
11782
|
+
|
|
11783
|
+
_defineProperty(_assertThisInitialized(_this), "onDeleteLuxityProductInterest", function (deleteItem) {
|
|
11233
11784
|
_this.setState(function (prevState) {
|
|
11234
11785
|
var newLuxityProductInterests = prevState.luxity_product_interests.filter(function (item) {
|
|
11235
11786
|
return item.id !== deleteItem.id;
|
|
@@ -11239,25 +11790,29 @@
|
|
|
11239
11790
|
});
|
|
11240
11791
|
});
|
|
11241
11792
|
});
|
|
11242
|
-
|
|
11793
|
+
|
|
11794
|
+
_defineProperty(_assertThisInitialized(_this), "triggerInterestRequest", function () {
|
|
11243
11795
|
var _this$props = _this.props,
|
|
11244
|
-
|
|
11245
|
-
|
|
11246
|
-
|
|
11796
|
+
requestInstance = _this$props.requestInstance,
|
|
11797
|
+
baseGraphApi = _this$props.baseGraphApi,
|
|
11798
|
+
interestQuery = _this$props.interestQuery;
|
|
11247
11799
|
return requestInstance.post("".concat(baseGraphApi, "?id=getInterests"), {
|
|
11248
11800
|
query: interestQuery
|
|
11249
11801
|
});
|
|
11250
11802
|
});
|
|
11251
|
-
|
|
11803
|
+
|
|
11804
|
+
_defineProperty(_assertThisInitialized(_this), "onAddInterestClick", function (interestType) {
|
|
11252
11805
|
_this.setState({
|
|
11253
11806
|
interestType: interestType
|
|
11254
11807
|
});
|
|
11255
11808
|
});
|
|
11256
|
-
|
|
11809
|
+
|
|
11810
|
+
_defineProperty(_assertThisInitialized(_this), "onCancel", function () {
|
|
11257
11811
|
_this.setState({
|
|
11258
11812
|
interestType: null
|
|
11259
11813
|
});
|
|
11260
11814
|
});
|
|
11815
|
+
|
|
11261
11816
|
_this.state = {
|
|
11262
11817
|
interests: [],
|
|
11263
11818
|
luxity_product_interests: [],
|
|
@@ -11265,31 +11820,32 @@
|
|
|
11265
11820
|
};
|
|
11266
11821
|
return _this;
|
|
11267
11822
|
}
|
|
11268
|
-
|
|
11269
|
-
|
|
11823
|
+
|
|
11824
|
+
_createClass(Interests, [{
|
|
11270
11825
|
key: "render",
|
|
11271
11826
|
value: function render() {
|
|
11272
11827
|
var _this2 = this;
|
|
11828
|
+
|
|
11273
11829
|
var _this$state = this.state,
|
|
11274
|
-
|
|
11275
|
-
|
|
11830
|
+
interests = _this$state.interests,
|
|
11831
|
+
luxity_product_interests = _this$state.luxity_product_interests;
|
|
11276
11832
|
var _this$props2 = this.props,
|
|
11277
|
-
|
|
11278
|
-
|
|
11279
|
-
|
|
11280
|
-
|
|
11281
|
-
|
|
11282
|
-
|
|
11283
|
-
|
|
11284
|
-
|
|
11285
|
-
|
|
11286
|
-
|
|
11287
|
-
|
|
11288
|
-
|
|
11289
|
-
|
|
11290
|
-
|
|
11291
|
-
|
|
11292
|
-
|
|
11833
|
+
addInterestApi = _this$props2.addInterestApi,
|
|
11834
|
+
requestInstance = _this$props2.requestInstance,
|
|
11835
|
+
baseGraphApi = _this$props2.baseGraphApi,
|
|
11836
|
+
getBrandsGraphQuery = _this$props2.getBrandsGraphQuery,
|
|
11837
|
+
getStylesGraphQuery = _this$props2.getStylesGraphQuery,
|
|
11838
|
+
getShoesGraphQuery = _this$props2.getShoesGraphQuery,
|
|
11839
|
+
deleteInterestApi = _this$props2.deleteInterestApi,
|
|
11840
|
+
setSchedule = _this$props2.setSchedule,
|
|
11841
|
+
getSchedule = _this$props2.getSchedule,
|
|
11842
|
+
interestsTitle = _this$props2.interestsTitle,
|
|
11843
|
+
defaultShoeSizeType = _this$props2.defaultShoeSizeType,
|
|
11844
|
+
getMaterialsGraphQuery = _this$props2.getMaterialsGraphQuery,
|
|
11845
|
+
getModelsGraphQuery = _this$props2.getModelsGraphQuery,
|
|
11846
|
+
addLuxityProductInterestApi = _this$props2.addLuxityProductInterestApi,
|
|
11847
|
+
deleteLuxityProductInterestApi = _this$props2.deleteLuxityProductInterestApi,
|
|
11848
|
+
getConditionsGraphQuery = _this$props2.getConditionsGraphQuery;
|
|
11293
11849
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
11294
11850
|
className: "interests"
|
|
11295
11851
|
}, /*#__PURE__*/React__default.createElement(Notifications__default, {
|
|
@@ -11378,7 +11934,10 @@
|
|
|
11378
11934
|
}))));
|
|
11379
11935
|
}
|
|
11380
11936
|
}]);
|
|
11937
|
+
|
|
11938
|
+
return Interests;
|
|
11381
11939
|
}(React__default.Component);
|
|
11940
|
+
|
|
11382
11941
|
Interests.defaultProps = {
|
|
11383
11942
|
interestsTitle: 'Interests',
|
|
11384
11943
|
defaultShoeSizeType: shoeSizeTypes.eu.value
|
|
@@ -11699,49 +12258,63 @@
|
|
|
11699
12258
|
}, function (props) {
|
|
11700
12259
|
return props.theme.colors.ntrlMin;
|
|
11701
12260
|
});
|
|
11702
|
-
|
|
11703
12261
|
/**
|
|
11704
12262
|
* Multiselector with a GraphQL flavour (TODO: to be revised to make it remote api agnostic)
|
|
11705
12263
|
*/
|
|
12264
|
+
|
|
11706
12265
|
var GraphQLDropdownSelector = /*#__PURE__*/function (_React$Component) {
|
|
12266
|
+
_inherits(GraphQLDropdownSelector, _React$Component);
|
|
12267
|
+
|
|
12268
|
+
var _super = _createSuper(GraphQLDropdownSelector);
|
|
12269
|
+
|
|
11707
12270
|
function GraphQLDropdownSelector(props) {
|
|
11708
12271
|
var _this;
|
|
12272
|
+
|
|
11709
12273
|
_classCallCheck(this, GraphQLDropdownSelector);
|
|
11710
|
-
|
|
11711
|
-
|
|
12274
|
+
|
|
12275
|
+
_this = _super.call(this, props);
|
|
12276
|
+
|
|
12277
|
+
_defineProperty(_assertThisInitialized(_this), "componentDidUpdate", function (prevProps) {
|
|
11712
12278
|
if (prevProps.graphQuery !== _this.props.graphQuery) {
|
|
11713
12279
|
_this.makeRequest();
|
|
11714
12280
|
}
|
|
11715
12281
|
});
|
|
11716
|
-
|
|
12282
|
+
|
|
12283
|
+
_defineProperty(_assertThisInitialized(_this), "makeRequest", function () {
|
|
11717
12284
|
_this.pageReady.refreshPage();
|
|
11718
12285
|
});
|
|
11719
|
-
|
|
12286
|
+
|
|
12287
|
+
_defineProperty(_assertThisInitialized(_this), "emptySelected", function () {
|
|
11720
12288
|
return _this.setState({
|
|
11721
12289
|
selected: [ALL_ITEM$1]
|
|
11722
12290
|
});
|
|
11723
12291
|
});
|
|
11724
|
-
|
|
12292
|
+
|
|
12293
|
+
_defineProperty(_assertThisInitialized(_this), "setNewResults", function (res) {
|
|
11725
12294
|
var selectedIds = _this.state.selected.map(function (sel) {
|
|
11726
12295
|
return sel.value;
|
|
11727
12296
|
});
|
|
12297
|
+
|
|
11728
12298
|
var pagination = _this.props.resultProcessor(res);
|
|
12299
|
+
|
|
11729
12300
|
var allSelected = _this.state.selected.some(function (item) {
|
|
11730
12301
|
return item.value === ALL_ITEM$1.value;
|
|
11731
12302
|
});
|
|
12303
|
+
|
|
11732
12304
|
var newList = pagination.filter(function (newItem) {
|
|
11733
12305
|
return !selectedIds.includes(newItem.value);
|
|
11734
12306
|
});
|
|
11735
|
-
newList = allSelected ? newList : [ALL_ITEM$1].concat(_toConsumableArray(newList));
|
|
12307
|
+
newList = allSelected ? newList : [ALL_ITEM$1].concat(_toConsumableArray(newList)); // eslint-disable-next-line react/no-unused-state
|
|
11736
12308
|
|
|
11737
|
-
// eslint-disable-next-line react/no-unused-state
|
|
11738
12309
|
_this.setState({
|
|
11739
12310
|
list: newList,
|
|
11740
12311
|
pagination: pagination
|
|
11741
12312
|
});
|
|
11742
12313
|
});
|
|
11743
|
-
|
|
12314
|
+
|
|
12315
|
+
_defineProperty(_assertThisInitialized(_this), "onAddItem", function (addSelectedItem) {
|
|
11744
12316
|
var newSelectedList;
|
|
12317
|
+
|
|
11745
12318
|
if (addSelectedItem.includes(ALL_ITEM$1)) {
|
|
11746
12319
|
newSelectedList = [ALL_ITEM$1];
|
|
11747
12320
|
} else {
|
|
@@ -11749,6 +12322,7 @@
|
|
|
11749
12322
|
return item.value !== ALL_ITEM$1.value;
|
|
11750
12323
|
});
|
|
11751
12324
|
}
|
|
12325
|
+
|
|
11752
12326
|
_this.setState(function (prevState) {
|
|
11753
12327
|
return _objectSpread2(_objectSpread2({}, prevState), {}, {
|
|
11754
12328
|
selected: newSelectedList
|
|
@@ -11759,17 +12333,19 @@
|
|
|
11759
12333
|
}));
|
|
11760
12334
|
});
|
|
11761
12335
|
});
|
|
11762
|
-
|
|
12336
|
+
|
|
12337
|
+
_defineProperty(_assertThisInitialized(_this), "onIsLoading", function (flag) {
|
|
11763
12338
|
_this.setState({
|
|
11764
12339
|
isLoading: flag
|
|
11765
12340
|
});
|
|
11766
12341
|
});
|
|
11767
|
-
|
|
12342
|
+
|
|
12343
|
+
_defineProperty(_assertThisInitialized(_this), "render", function () {
|
|
11768
12344
|
var _this$props = _this.props,
|
|
11769
|
-
|
|
11770
|
-
|
|
11771
|
-
|
|
11772
|
-
|
|
12345
|
+
baseClass = _this$props.baseClass,
|
|
12346
|
+
identifier = _this$props.identifier,
|
|
12347
|
+
triggerRequest = _this$props.triggerRequest,
|
|
12348
|
+
className = _this$props.className;
|
|
11773
12349
|
var list = _this.state.list;
|
|
11774
12350
|
return /*#__PURE__*/React__default.createElement(StyledMultiselector$1, null, /*#__PURE__*/React__default.createElement("div", {
|
|
11775
12351
|
"data-qe-id": identifier,
|
|
@@ -11794,6 +12370,7 @@
|
|
|
11794
12370
|
isSearchable: true
|
|
11795
12371
|
}))));
|
|
11796
12372
|
});
|
|
12373
|
+
|
|
11797
12374
|
_this.state = {
|
|
11798
12375
|
selected: [ALL_ITEM$1],
|
|
11799
12376
|
list: [],
|
|
@@ -11802,9 +12379,10 @@
|
|
|
11802
12379
|
};
|
|
11803
12380
|
return _this;
|
|
11804
12381
|
}
|
|
11805
|
-
|
|
12382
|
+
|
|
11806
12383
|
return _createClass(GraphQLDropdownSelector);
|
|
11807
12384
|
}(React__default.Component);
|
|
12385
|
+
|
|
11808
12386
|
GraphQLDropdownSelector.defaultProps = {
|
|
11809
12387
|
baseClass: 'multiselector'
|
|
11810
12388
|
};
|
|
@@ -11814,33 +12392,43 @@
|
|
|
11814
12392
|
* Luxity flavoured GraphQLMultiselector with text Search, category and limit controls
|
|
11815
12393
|
*/
|
|
11816
12394
|
var LuxityGraphQLDropdownSelector = /*#__PURE__*/function (_React$Component) {
|
|
12395
|
+
_inherits(LuxityGraphQLDropdownSelector, _React$Component);
|
|
12396
|
+
|
|
12397
|
+
var _super = _createSuper(LuxityGraphQLDropdownSelector);
|
|
12398
|
+
|
|
11817
12399
|
function LuxityGraphQLDropdownSelector(props) {
|
|
11818
12400
|
var _this;
|
|
12401
|
+
|
|
11819
12402
|
_classCallCheck(this, LuxityGraphQLDropdownSelector);
|
|
11820
|
-
|
|
11821
|
-
|
|
11822
|
-
|
|
12403
|
+
|
|
12404
|
+
_this = _super.call(this, props);
|
|
12405
|
+
|
|
12406
|
+
_defineProperty(_assertThisInitialized(_this), "multiSelectorRef", /*#__PURE__*/React__default.createRef());
|
|
12407
|
+
|
|
12408
|
+
_defineProperty(_assertThisInitialized(_this), "increaseLimit", function () {
|
|
11823
12409
|
_this.setState(function (prevState) {
|
|
11824
12410
|
return {
|
|
11825
12411
|
limit: prevState.limit + _this.props.queryLimitIncrement
|
|
11826
12412
|
};
|
|
11827
12413
|
});
|
|
11828
12414
|
});
|
|
11829
|
-
|
|
12415
|
+
|
|
12416
|
+
_defineProperty(_assertThisInitialized(_this), "onChange", function (selection) {
|
|
11830
12417
|
_this.props.onChange(selection);
|
|
11831
12418
|
});
|
|
11832
|
-
|
|
12419
|
+
|
|
12420
|
+
_defineProperty(_assertThisInitialized(_this), "render", function () {
|
|
11833
12421
|
var _this$state = _this.state,
|
|
11834
|
-
|
|
11835
|
-
|
|
12422
|
+
limit = _this$state.limit,
|
|
12423
|
+
query_arguments = _this$state.query_arguments;
|
|
11836
12424
|
var _this$props = _this.props,
|
|
11837
|
-
|
|
11838
|
-
|
|
11839
|
-
|
|
11840
|
-
|
|
11841
|
-
|
|
11842
|
-
|
|
11843
|
-
|
|
12425
|
+
title = _this$props.title,
|
|
12426
|
+
baseClass = _this$props.baseClass,
|
|
12427
|
+
getGraphQuery = _this$props.getGraphQuery,
|
|
12428
|
+
resultProcessor = _this$props.resultProcessor,
|
|
12429
|
+
graphApi = _this$props.graphApi,
|
|
12430
|
+
identifier = _this$props.identifier,
|
|
12431
|
+
requestInstance = _this$props.requestInstance;
|
|
11844
12432
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
11845
12433
|
className: baseClass
|
|
11846
12434
|
}, /*#__PURE__*/React__default.createElement(InterestsSubheading, {
|
|
@@ -11859,17 +12447,19 @@
|
|
|
11859
12447
|
resultProcessor: resultProcessor
|
|
11860
12448
|
})));
|
|
11861
12449
|
});
|
|
12450
|
+
|
|
11862
12451
|
_this.state = {
|
|
11863
12452
|
limit: props.baseQueryLimit,
|
|
11864
12453
|
query_arguments: props.query_arguments
|
|
11865
12454
|
};
|
|
11866
12455
|
return _this;
|
|
11867
12456
|
}
|
|
11868
|
-
|
|
11869
|
-
|
|
12457
|
+
|
|
12458
|
+
_createClass(LuxityGraphQLDropdownSelector, [{
|
|
11870
12459
|
key: "componentDidUpdate",
|
|
11871
12460
|
value: function componentDidUpdate(prevProps) {
|
|
11872
12461
|
var _this$multiSelectorRe;
|
|
12462
|
+
|
|
11873
12463
|
if (prevProps.query_arguments !== this.props.query_arguments && (_this$multiSelectorRe = this.multiSelectorRef) !== null && _this$multiSelectorRe !== void 0 && _this$multiSelectorRe.current) {
|
|
11874
12464
|
this.multiSelectorRef.current.emptySelected();
|
|
11875
12465
|
}
|
|
@@ -11882,10 +12472,14 @@
|
|
|
11882
12472
|
query_arguments: props.query_arguments
|
|
11883
12473
|
};
|
|
11884
12474
|
}
|
|
12475
|
+
|
|
11885
12476
|
return null;
|
|
11886
12477
|
}
|
|
11887
12478
|
}]);
|
|
12479
|
+
|
|
12480
|
+
return LuxityGraphQLDropdownSelector;
|
|
11888
12481
|
}(React__default.Component);
|
|
12482
|
+
|
|
11889
12483
|
LuxityGraphQLDropdownSelector.defaultProps = {
|
|
11890
12484
|
baseClass: '',
|
|
11891
12485
|
searchPlaceHolder: '',
|
|
@@ -11895,11 +12489,11 @@
|
|
|
11895
12489
|
|
|
11896
12490
|
var MaterialSelector = function MaterialSelector(_ref) {
|
|
11897
12491
|
var onChange = _ref.onChange,
|
|
11898
|
-
|
|
11899
|
-
|
|
11900
|
-
|
|
11901
|
-
|
|
11902
|
-
|
|
12492
|
+
brands = _ref.brands,
|
|
12493
|
+
graphApi = _ref.graphApi,
|
|
12494
|
+
getGraphQuery = _ref.getGraphQuery,
|
|
12495
|
+
resultProcessor = _ref.resultProcessor,
|
|
12496
|
+
requestInstance = _ref.requestInstance;
|
|
11903
12497
|
return /*#__PURE__*/React__default.createElement(LuxityGraphQLDropdownSelector, {
|
|
11904
12498
|
baseQueryLimit: 1000,
|
|
11905
12499
|
title: "Materials",
|
|
@@ -11914,11 +12508,12 @@
|
|
|
11914
12508
|
requestInstance: requestInstance
|
|
11915
12509
|
});
|
|
11916
12510
|
};
|
|
12511
|
+
|
|
11917
12512
|
MaterialSelector.defaultProps = {
|
|
11918
12513
|
resultProcessor: function resultProcessor(result) {
|
|
11919
12514
|
return result.data.data.luxity_materials.data.map(function (_ref2) {
|
|
11920
12515
|
var id = _ref2.id,
|
|
11921
|
-
|
|
12516
|
+
name = _ref2.name;
|
|
11922
12517
|
return {
|
|
11923
12518
|
label: name,
|
|
11924
12519
|
value: id
|