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