@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
package/Interests.js
CHANGED
|
@@ -17,694 +17,540 @@
|
|
|
17
17
|
axios = axios && Object.prototype.hasOwnProperty.call(axios, 'default') ? axios['default'] : axios;
|
|
18
18
|
Cookies = Cookies && Object.prototype.hasOwnProperty.call(Cookies, 'default') ? Cookies['default'] : Cookies;
|
|
19
19
|
|
|
20
|
-
function
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
function _arrayLikeToArray(r, a) {
|
|
21
|
+
(null == a || a > r.length) && (a = r.length);
|
|
22
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
23
|
+
return n;
|
|
24
|
+
}
|
|
25
|
+
function _arrayWithHoles(r) {
|
|
26
|
+
if (Array.isArray(r)) return r;
|
|
27
|
+
}
|
|
28
|
+
function _arrayWithoutHoles(r) {
|
|
29
|
+
if (Array.isArray(r)) return _arrayLikeToArray(r);
|
|
30
|
+
}
|
|
31
|
+
function _assertThisInitialized(e) {
|
|
32
|
+
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
33
|
+
return e;
|
|
34
|
+
}
|
|
35
|
+
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
36
|
+
try {
|
|
37
|
+
var i = n[a](c),
|
|
38
|
+
u = i.value;
|
|
39
|
+
} catch (n) {
|
|
40
|
+
return void e(n);
|
|
41
|
+
}
|
|
42
|
+
i.done ? t(u) : Promise.resolve(u).then(r, o);
|
|
43
|
+
}
|
|
44
|
+
function _asyncToGenerator(n) {
|
|
45
|
+
return function () {
|
|
46
|
+
var t = this,
|
|
47
|
+
e = arguments;
|
|
48
|
+
return new Promise(function (r, o) {
|
|
49
|
+
var a = n.apply(t, e);
|
|
50
|
+
function _next(n) {
|
|
51
|
+
asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
|
|
52
|
+
}
|
|
53
|
+
function _throw(n) {
|
|
54
|
+
asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
|
|
55
|
+
}
|
|
56
|
+
_next(void 0);
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
function _callSuper(t, o, e) {
|
|
61
|
+
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
|
|
62
|
+
}
|
|
63
|
+
function _classCallCheck(a, n) {
|
|
64
|
+
if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
|
|
65
|
+
}
|
|
66
|
+
function _defineProperties(e, r) {
|
|
67
|
+
for (var t = 0; t < r.length; t++) {
|
|
68
|
+
var o = r[t];
|
|
69
|
+
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
function _createClass(e, r, t) {
|
|
73
|
+
return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
|
|
74
|
+
writable: !1
|
|
75
|
+
}), e;
|
|
76
|
+
}
|
|
77
|
+
function _defineProperty(e, r, t) {
|
|
78
|
+
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
79
|
+
value: t,
|
|
80
|
+
enumerable: !0,
|
|
81
|
+
configurable: !0,
|
|
82
|
+
writable: !0
|
|
83
|
+
}) : e[r] = t, e;
|
|
84
|
+
}
|
|
85
|
+
function _extends() {
|
|
86
|
+
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
87
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
88
|
+
var t = arguments[e];
|
|
89
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
90
|
+
}
|
|
91
|
+
return n;
|
|
92
|
+
}, _extends.apply(null, arguments);
|
|
93
|
+
}
|
|
94
|
+
function _getPrototypeOf(t) {
|
|
95
|
+
return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
|
|
96
|
+
return t.__proto__ || Object.getPrototypeOf(t);
|
|
97
|
+
}, _getPrototypeOf(t);
|
|
98
|
+
}
|
|
99
|
+
function _inherits(t, e) {
|
|
100
|
+
if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
|
|
101
|
+
t.prototype = Object.create(e && e.prototype, {
|
|
102
|
+
constructor: {
|
|
103
|
+
value: t,
|
|
104
|
+
writable: !0,
|
|
105
|
+
configurable: !0
|
|
106
|
+
}
|
|
107
|
+
}), Object.defineProperty(t, "prototype", {
|
|
108
|
+
writable: !1
|
|
109
|
+
}), e && _setPrototypeOf(t, e);
|
|
110
|
+
}
|
|
111
|
+
function _isNativeReflectConstruct() {
|
|
112
|
+
try {
|
|
113
|
+
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
114
|
+
} catch (t) {}
|
|
115
|
+
return (_isNativeReflectConstruct = function () {
|
|
116
|
+
return !!t;
|
|
117
|
+
})();
|
|
118
|
+
}
|
|
119
|
+
function _iterableToArray(r) {
|
|
120
|
+
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
121
|
+
}
|
|
122
|
+
function _iterableToArrayLimit(r, l) {
|
|
123
|
+
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
124
|
+
if (null != t) {
|
|
125
|
+
var e,
|
|
126
|
+
n,
|
|
127
|
+
i,
|
|
128
|
+
u,
|
|
129
|
+
a = [],
|
|
130
|
+
f = !0,
|
|
131
|
+
o = !1;
|
|
132
|
+
try {
|
|
133
|
+
if (i = (t = t.call(r)).next, 0 === l) {
|
|
134
|
+
if (Object(t) !== t) return;
|
|
135
|
+
f = !1;
|
|
136
|
+
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
137
|
+
} catch (r) {
|
|
138
|
+
o = !0, n = r;
|
|
139
|
+
} finally {
|
|
140
|
+
try {
|
|
141
|
+
if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
|
|
142
|
+
} finally {
|
|
143
|
+
if (o) throw n;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
return a;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
function _nonIterableRest() {
|
|
150
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
151
|
+
}
|
|
152
|
+
function _nonIterableSpread() {
|
|
153
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
154
|
+
}
|
|
155
|
+
function ownKeys(e, r) {
|
|
156
|
+
var t = Object.keys(e);
|
|
23
157
|
if (Object.getOwnPropertySymbols) {
|
|
24
|
-
var
|
|
25
|
-
|
|
26
|
-
return Object.getOwnPropertyDescriptor(
|
|
27
|
-
})),
|
|
158
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
159
|
+
r && (o = o.filter(function (r) {
|
|
160
|
+
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
161
|
+
})), t.push.apply(t, o);
|
|
28
162
|
}
|
|
29
|
-
|
|
30
|
-
return keys;
|
|
163
|
+
return t;
|
|
31
164
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
165
|
+
function _objectSpread2(e) {
|
|
166
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
167
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
168
|
+
r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
|
|
169
|
+
_defineProperty(e, r, t[r]);
|
|
170
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
|
|
171
|
+
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
40
172
|
});
|
|
41
173
|
}
|
|
42
|
-
|
|
43
|
-
|
|
174
|
+
return e;
|
|
175
|
+
}
|
|
176
|
+
function _objectWithoutProperties(e, t) {
|
|
177
|
+
if (null == e) return {};
|
|
178
|
+
var o,
|
|
179
|
+
r,
|
|
180
|
+
i = _objectWithoutPropertiesLoose(e, t);
|
|
181
|
+
if (Object.getOwnPropertySymbols) {
|
|
182
|
+
var n = Object.getOwnPropertySymbols(e);
|
|
183
|
+
for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
184
|
+
}
|
|
185
|
+
return i;
|
|
186
|
+
}
|
|
187
|
+
function _objectWithoutPropertiesLoose(r, e) {
|
|
188
|
+
if (null == r) return {};
|
|
189
|
+
var t = {};
|
|
190
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
191
|
+
if (-1 !== e.indexOf(n)) continue;
|
|
192
|
+
t[n] = r[n];
|
|
193
|
+
}
|
|
194
|
+
return t;
|
|
195
|
+
}
|
|
196
|
+
function _possibleConstructorReturn(t, e) {
|
|
197
|
+
if (e && ("object" == typeof e || "function" == typeof e)) return e;
|
|
198
|
+
if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
|
|
199
|
+
return _assertThisInitialized(t);
|
|
44
200
|
}
|
|
45
|
-
|
|
46
201
|
function _regeneratorRuntime() {
|
|
47
|
-
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
48
|
-
|
|
49
202
|
_regeneratorRuntime = function () {
|
|
50
|
-
return
|
|
203
|
+
return e;
|
|
51
204
|
};
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
205
|
+
var t,
|
|
206
|
+
e = {},
|
|
207
|
+
r = Object.prototype,
|
|
208
|
+
n = r.hasOwnProperty,
|
|
209
|
+
o = Object.defineProperty || function (t, e, r) {
|
|
210
|
+
t[e] = r.value;
|
|
211
|
+
},
|
|
212
|
+
i = "function" == typeof Symbol ? Symbol : {},
|
|
213
|
+
a = i.iterator || "@@iterator",
|
|
214
|
+
c = i.asyncIterator || "@@asyncIterator",
|
|
215
|
+
u = i.toStringTag || "@@toStringTag";
|
|
216
|
+
function define(t, e, r) {
|
|
217
|
+
return Object.defineProperty(t, e, {
|
|
218
|
+
value: r,
|
|
64
219
|
enumerable: !0,
|
|
65
220
|
configurable: !0,
|
|
66
221
|
writable: !0
|
|
67
|
-
}),
|
|
222
|
+
}), t[e];
|
|
68
223
|
}
|
|
69
|
-
|
|
70
224
|
try {
|
|
71
225
|
define({}, "");
|
|
72
|
-
} catch (
|
|
73
|
-
define = function (
|
|
74
|
-
return
|
|
226
|
+
} catch (t) {
|
|
227
|
+
define = function (t, e, r) {
|
|
228
|
+
return t[e] = r;
|
|
75
229
|
};
|
|
76
230
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
return function (method, arg) {
|
|
85
|
-
if ("executing" === state) throw new Error("Generator is already running");
|
|
86
|
-
|
|
87
|
-
if ("completed" === state) {
|
|
88
|
-
if ("throw" === method) throw arg;
|
|
89
|
-
return doneResult();
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
for (context.method = method, context.arg = arg;;) {
|
|
93
|
-
var delegate = context.delegate;
|
|
94
|
-
|
|
95
|
-
if (delegate) {
|
|
96
|
-
var delegateResult = maybeInvokeDelegate(delegate, context);
|
|
97
|
-
|
|
98
|
-
if (delegateResult) {
|
|
99
|
-
if (delegateResult === ContinueSentinel) continue;
|
|
100
|
-
return delegateResult;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
|
|
105
|
-
if ("suspendedStart" === state) throw state = "completed", context.arg;
|
|
106
|
-
context.dispatchException(context.arg);
|
|
107
|
-
} else "return" === context.method && context.abrupt("return", context.arg);
|
|
108
|
-
state = "executing";
|
|
109
|
-
var record = tryCatch(innerFn, self, context);
|
|
110
|
-
|
|
111
|
-
if ("normal" === record.type) {
|
|
112
|
-
if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
|
|
113
|
-
return {
|
|
114
|
-
value: record.arg,
|
|
115
|
-
done: context.done
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
"throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
|
|
120
|
-
}
|
|
121
|
-
};
|
|
122
|
-
}(innerFn, self, context), generator;
|
|
231
|
+
function wrap(t, e, r, n) {
|
|
232
|
+
var i = e && e.prototype instanceof Generator ? e : Generator,
|
|
233
|
+
a = Object.create(i.prototype),
|
|
234
|
+
c = new Context(n || []);
|
|
235
|
+
return o(a, "_invoke", {
|
|
236
|
+
value: makeInvokeMethod(t, r, c)
|
|
237
|
+
}), a;
|
|
123
238
|
}
|
|
124
|
-
|
|
125
|
-
function tryCatch(fn, obj, arg) {
|
|
239
|
+
function tryCatch(t, e, r) {
|
|
126
240
|
try {
|
|
127
241
|
return {
|
|
128
242
|
type: "normal",
|
|
129
|
-
arg:
|
|
243
|
+
arg: t.call(e, r)
|
|
130
244
|
};
|
|
131
|
-
} catch (
|
|
245
|
+
} catch (t) {
|
|
132
246
|
return {
|
|
133
247
|
type: "throw",
|
|
134
|
-
arg:
|
|
248
|
+
arg: t
|
|
135
249
|
};
|
|
136
250
|
}
|
|
137
251
|
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
252
|
+
e.wrap = wrap;
|
|
253
|
+
var h = "suspendedStart",
|
|
254
|
+
l = "suspendedYield",
|
|
255
|
+
f = "executing",
|
|
256
|
+
s = "completed",
|
|
257
|
+
y = {};
|
|
142
258
|
function Generator() {}
|
|
143
|
-
|
|
144
259
|
function GeneratorFunction() {}
|
|
145
|
-
|
|
146
260
|
function GeneratorFunctionPrototype() {}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
define(IteratorPrototype, iteratorSymbol, function () {
|
|
261
|
+
var p = {};
|
|
262
|
+
define(p, a, function () {
|
|
150
263
|
return this;
|
|
151
264
|
});
|
|
152
|
-
var
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
var
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
return this._invoke(method, arg);
|
|
265
|
+
var d = Object.getPrototypeOf,
|
|
266
|
+
v = d && d(d(values([])));
|
|
267
|
+
v && v !== r && n.call(v, a) && (p = v);
|
|
268
|
+
var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
|
|
269
|
+
function defineIteratorMethods(t) {
|
|
270
|
+
["next", "throw", "return"].forEach(function (e) {
|
|
271
|
+
define(t, e, function (t) {
|
|
272
|
+
return this._invoke(e, t);
|
|
161
273
|
});
|
|
162
274
|
});
|
|
163
275
|
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
invoke("
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
}, function (error) {
|
|
179
|
-
return invoke("throw", error, resolve, reject);
|
|
276
|
+
function AsyncIterator(t, e) {
|
|
277
|
+
function invoke(r, o, i, a) {
|
|
278
|
+
var c = tryCatch(t[r], t, o);
|
|
279
|
+
if ("throw" !== c.type) {
|
|
280
|
+
var u = c.arg,
|
|
281
|
+
h = u.value;
|
|
282
|
+
return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
|
|
283
|
+
invoke("next", t, i, a);
|
|
284
|
+
}, function (t) {
|
|
285
|
+
invoke("throw", t, i, a);
|
|
286
|
+
}) : e.resolve(h).then(function (t) {
|
|
287
|
+
u.value = t, i(u);
|
|
288
|
+
}, function (t) {
|
|
289
|
+
return invoke("throw", t, i, a);
|
|
180
290
|
});
|
|
181
291
|
}
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
292
|
+
a(c.arg);
|
|
293
|
+
}
|
|
294
|
+
var r;
|
|
295
|
+
o(this, "_invoke", {
|
|
296
|
+
value: function (t, n) {
|
|
297
|
+
function callInvokeWithMethodAndArg() {
|
|
298
|
+
return new e(function (e, r) {
|
|
299
|
+
invoke(t, n, e, r);
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
193
303
|
}
|
|
194
|
-
|
|
195
|
-
return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
|
196
|
-
};
|
|
304
|
+
});
|
|
197
305
|
}
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
306
|
+
function makeInvokeMethod(e, r, n) {
|
|
307
|
+
var o = h;
|
|
308
|
+
return function (i, a) {
|
|
309
|
+
if (o === f) throw Error("Generator is already running");
|
|
310
|
+
if (o === s) {
|
|
311
|
+
if ("throw" === i) throw a;
|
|
312
|
+
return {
|
|
313
|
+
value: t,
|
|
314
|
+
done: !0
|
|
315
|
+
};
|
|
206
316
|
}
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
317
|
+
for (n.method = i, n.arg = a;;) {
|
|
318
|
+
var c = n.delegate;
|
|
319
|
+
if (c) {
|
|
320
|
+
var u = maybeInvokeDelegate(c, n);
|
|
321
|
+
if (u) {
|
|
322
|
+
if (u === y) continue;
|
|
323
|
+
return u;
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
|
|
327
|
+
if (o === h) throw o = s, n.arg;
|
|
328
|
+
n.dispatchException(n.arg);
|
|
329
|
+
} else "return" === n.method && n.abrupt("return", n.arg);
|
|
330
|
+
o = f;
|
|
331
|
+
var p = tryCatch(e, r, n);
|
|
332
|
+
if ("normal" === p.type) {
|
|
333
|
+
if (o = n.done ? s : l, p.arg === y) continue;
|
|
334
|
+
return {
|
|
335
|
+
value: p.arg,
|
|
336
|
+
done: n.done
|
|
337
|
+
};
|
|
338
|
+
}
|
|
339
|
+
"throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
|
|
340
|
+
}
|
|
341
|
+
};
|
|
215
342
|
}
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
343
|
+
function maybeInvokeDelegate(e, r) {
|
|
344
|
+
var n = r.method,
|
|
345
|
+
o = e.iterator[n];
|
|
346
|
+
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;
|
|
347
|
+
var i = tryCatch(o, e.iterator, r.arg);
|
|
348
|
+
if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
|
|
349
|
+
var a = i.arg;
|
|
350
|
+
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);
|
|
351
|
+
}
|
|
352
|
+
function pushTryEntry(t) {
|
|
353
|
+
var e = {
|
|
354
|
+
tryLoc: t[0]
|
|
220
355
|
};
|
|
221
|
-
1 in
|
|
356
|
+
1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
|
|
222
357
|
}
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
record.type = "normal", delete record.arg, entry.completion = record;
|
|
358
|
+
function resetTryEntry(t) {
|
|
359
|
+
var e = t.completion || {};
|
|
360
|
+
e.type = "normal", delete e.arg, t.completion = e;
|
|
227
361
|
}
|
|
228
|
-
|
|
229
|
-
function Context(tryLocsList) {
|
|
362
|
+
function Context(t) {
|
|
230
363
|
this.tryEntries = [{
|
|
231
364
|
tryLoc: "root"
|
|
232
|
-
}],
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
if (
|
|
239
|
-
if (
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
next =
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
return next.value = undefined, next.done = !0, next;
|
|
247
|
-
};
|
|
248
|
-
|
|
249
|
-
return next.next = next;
|
|
365
|
+
}], t.forEach(pushTryEntry, this), this.reset(!0);
|
|
366
|
+
}
|
|
367
|
+
function values(e) {
|
|
368
|
+
if (e || "" === e) {
|
|
369
|
+
var r = e[a];
|
|
370
|
+
if (r) return r.call(e);
|
|
371
|
+
if ("function" == typeof e.next) return e;
|
|
372
|
+
if (!isNaN(e.length)) {
|
|
373
|
+
var o = -1,
|
|
374
|
+
i = function next() {
|
|
375
|
+
for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
|
|
376
|
+
return next.value = t, next.done = !0, next;
|
|
377
|
+
};
|
|
378
|
+
return i.next = i;
|
|
250
379
|
}
|
|
251
380
|
}
|
|
252
|
-
|
|
381
|
+
throw new TypeError(typeof e + " is not iterable");
|
|
382
|
+
}
|
|
383
|
+
return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
|
|
384
|
+
value: GeneratorFunctionPrototype,
|
|
385
|
+
configurable: !0
|
|
386
|
+
}), o(GeneratorFunctionPrototype, "constructor", {
|
|
387
|
+
value: GeneratorFunction,
|
|
388
|
+
configurable: !0
|
|
389
|
+
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
|
|
390
|
+
var e = "function" == typeof t && t.constructor;
|
|
391
|
+
return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
|
|
392
|
+
}, e.mark = function (t) {
|
|
393
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
|
|
394
|
+
}, e.awrap = function (t) {
|
|
253
395
|
return {
|
|
254
|
-
|
|
396
|
+
__await: t
|
|
255
397
|
};
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
function doneResult() {
|
|
259
|
-
return {
|
|
260
|
-
value: undefined,
|
|
261
|
-
done: !0
|
|
262
|
-
};
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
|
|
266
|
-
var ctor = "function" == typeof genFun && genFun.constructor;
|
|
267
|
-
return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
|
|
268
|
-
}, exports.mark = function (genFun) {
|
|
269
|
-
return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
|
|
270
|
-
}, exports.awrap = function (arg) {
|
|
271
|
-
return {
|
|
272
|
-
__await: arg
|
|
273
|
-
};
|
|
274
|
-
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
|
|
398
|
+
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
|
|
275
399
|
return this;
|
|
276
|
-
}),
|
|
277
|
-
void 0 ===
|
|
278
|
-
var
|
|
279
|
-
return
|
|
280
|
-
return
|
|
400
|
+
}), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
|
|
401
|
+
void 0 === i && (i = Promise);
|
|
402
|
+
var a = new AsyncIterator(wrap(t, r, n, o), i);
|
|
403
|
+
return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
|
|
404
|
+
return t.done ? t.value : a.next();
|
|
281
405
|
});
|
|
282
|
-
}, defineIteratorMethods(
|
|
406
|
+
}, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
|
|
283
407
|
return this;
|
|
284
|
-
}), define(
|
|
408
|
+
}), define(g, "toString", function () {
|
|
285
409
|
return "[object Generator]";
|
|
286
|
-
}),
|
|
287
|
-
var
|
|
288
|
-
|
|
289
|
-
for (var
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
if (key in object) return next.value = key, next.done = !1, next;
|
|
410
|
+
}), e.keys = function (t) {
|
|
411
|
+
var e = Object(t),
|
|
412
|
+
r = [];
|
|
413
|
+
for (var n in e) r.push(n);
|
|
414
|
+
return r.reverse(), function next() {
|
|
415
|
+
for (; r.length;) {
|
|
416
|
+
var t = r.pop();
|
|
417
|
+
if (t in e) return next.value = t, next.done = !1, next;
|
|
295
418
|
}
|
|
296
|
-
|
|
297
419
|
return next.done = !0, next;
|
|
298
420
|
};
|
|
299
|
-
},
|
|
421
|
+
}, e.values = values, Context.prototype = {
|
|
300
422
|
constructor: Context,
|
|
301
|
-
reset: function (
|
|
302
|
-
if (this.prev = 0, this.next = 0, this.sent = this._sent =
|
|
423
|
+
reset: function (e) {
|
|
424
|
+
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);
|
|
303
425
|
},
|
|
304
426
|
stop: function () {
|
|
305
427
|
this.done = !0;
|
|
306
|
-
var
|
|
307
|
-
if ("throw" ===
|
|
428
|
+
var t = this.tryEntries[0].completion;
|
|
429
|
+
if ("throw" === t.type) throw t.arg;
|
|
308
430
|
return this.rval;
|
|
309
431
|
},
|
|
310
|
-
dispatchException: function (
|
|
311
|
-
if (this.done) throw
|
|
312
|
-
var
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
|
|
432
|
+
dispatchException: function (e) {
|
|
433
|
+
if (this.done) throw e;
|
|
434
|
+
var r = this;
|
|
435
|
+
function handle(n, o) {
|
|
436
|
+
return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
|
|
316
437
|
}
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
if (
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
if (
|
|
328
|
-
if (this.prev <
|
|
329
|
-
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
|
|
330
|
-
} else if (hasCatch) {
|
|
331
|
-
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
|
|
438
|
+
for (var o = this.tryEntries.length - 1; o >= 0; --o) {
|
|
439
|
+
var i = this.tryEntries[o],
|
|
440
|
+
a = i.completion;
|
|
441
|
+
if ("root" === i.tryLoc) return handle("end");
|
|
442
|
+
if (i.tryLoc <= this.prev) {
|
|
443
|
+
var c = n.call(i, "catchLoc"),
|
|
444
|
+
u = n.call(i, "finallyLoc");
|
|
445
|
+
if (c && u) {
|
|
446
|
+
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
447
|
+
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
448
|
+
} else if (c) {
|
|
449
|
+
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
332
450
|
} else {
|
|
333
|
-
if (!
|
|
334
|
-
if (this.prev <
|
|
451
|
+
if (!u) throw Error("try statement without catch or finally");
|
|
452
|
+
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
335
453
|
}
|
|
336
454
|
}
|
|
337
455
|
}
|
|
338
456
|
},
|
|
339
|
-
abrupt: function (
|
|
340
|
-
for (var
|
|
341
|
-
var
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
var finallyEntry = entry;
|
|
457
|
+
abrupt: function (t, e) {
|
|
458
|
+
for (var r = this.tryEntries.length - 1; r >= 0; --r) {
|
|
459
|
+
var o = this.tryEntries[r];
|
|
460
|
+
if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
|
|
461
|
+
var i = o;
|
|
345
462
|
break;
|
|
346
463
|
}
|
|
347
464
|
}
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
|
|
465
|
+
i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
|
|
466
|
+
var a = i ? i.completion : {};
|
|
467
|
+
return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
|
|
352
468
|
},
|
|
353
|
-
complete: function (
|
|
354
|
-
if ("throw" ===
|
|
355
|
-
return "break" ===
|
|
469
|
+
complete: function (t, e) {
|
|
470
|
+
if ("throw" === t.type) throw t.arg;
|
|
471
|
+
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;
|
|
356
472
|
},
|
|
357
|
-
finish: function (
|
|
358
|
-
for (var
|
|
359
|
-
var
|
|
360
|
-
if (
|
|
473
|
+
finish: function (t) {
|
|
474
|
+
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
475
|
+
var r = this.tryEntries[e];
|
|
476
|
+
if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
|
|
361
477
|
}
|
|
362
478
|
},
|
|
363
|
-
catch: function (
|
|
364
|
-
for (var
|
|
365
|
-
var
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
var thrown = record.arg;
|
|
372
|
-
resetTryEntry(entry);
|
|
479
|
+
catch: function (t) {
|
|
480
|
+
for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
|
481
|
+
var r = this.tryEntries[e];
|
|
482
|
+
if (r.tryLoc === t) {
|
|
483
|
+
var n = r.completion;
|
|
484
|
+
if ("throw" === n.type) {
|
|
485
|
+
var o = n.arg;
|
|
486
|
+
resetTryEntry(r);
|
|
373
487
|
}
|
|
374
|
-
|
|
375
|
-
return thrown;
|
|
488
|
+
return o;
|
|
376
489
|
}
|
|
377
490
|
}
|
|
378
|
-
|
|
379
|
-
throw new Error("illegal catch attempt");
|
|
491
|
+
throw Error("illegal catch attempt");
|
|
380
492
|
},
|
|
381
|
-
delegateYield: function (
|
|
493
|
+
delegateYield: function (e, r, n) {
|
|
382
494
|
return this.delegate = {
|
|
383
|
-
iterator: values(
|
|
384
|
-
resultName:
|
|
385
|
-
nextLoc:
|
|
386
|
-
}, "next" === this.method && (this.arg =
|
|
387
|
-
}
|
|
388
|
-
}, exports;
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
392
|
-
try {
|
|
393
|
-
var info = gen[key](arg);
|
|
394
|
-
var value = info.value;
|
|
395
|
-
} catch (error) {
|
|
396
|
-
reject(error);
|
|
397
|
-
return;
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
if (info.done) {
|
|
401
|
-
resolve(value);
|
|
402
|
-
} else {
|
|
403
|
-
Promise.resolve(value).then(_next, _throw);
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
function _asyncToGenerator(fn) {
|
|
408
|
-
return function () {
|
|
409
|
-
var self = this,
|
|
410
|
-
args = arguments;
|
|
411
|
-
return new Promise(function (resolve, reject) {
|
|
412
|
-
var gen = fn.apply(self, args);
|
|
413
|
-
|
|
414
|
-
function _next(value) {
|
|
415
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
function _throw(err) {
|
|
419
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
_next(undefined);
|
|
423
|
-
});
|
|
424
|
-
};
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
function _classCallCheck(instance, Constructor) {
|
|
428
|
-
if (!(instance instanceof Constructor)) {
|
|
429
|
-
throw new TypeError("Cannot call a class as a function");
|
|
430
|
-
}
|
|
431
|
-
}
|
|
432
|
-
|
|
433
|
-
function _defineProperties(target, props) {
|
|
434
|
-
for (var i = 0; i < props.length; i++) {
|
|
435
|
-
var descriptor = props[i];
|
|
436
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
437
|
-
descriptor.configurable = true;
|
|
438
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
439
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
function _createClass(Constructor, protoProps, staticProps) {
|
|
444
|
-
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
445
|
-
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
446
|
-
Object.defineProperty(Constructor, "prototype", {
|
|
447
|
-
writable: false
|
|
448
|
-
});
|
|
449
|
-
return Constructor;
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
function _defineProperty(obj, key, value) {
|
|
453
|
-
if (key in obj) {
|
|
454
|
-
Object.defineProperty(obj, key, {
|
|
455
|
-
value: value,
|
|
456
|
-
enumerable: true,
|
|
457
|
-
configurable: true,
|
|
458
|
-
writable: true
|
|
459
|
-
});
|
|
460
|
-
} else {
|
|
461
|
-
obj[key] = value;
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
return obj;
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
function _extends() {
|
|
468
|
-
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
469
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
470
|
-
var source = arguments[i];
|
|
471
|
-
|
|
472
|
-
for (var key in source) {
|
|
473
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
474
|
-
target[key] = source[key];
|
|
475
|
-
}
|
|
476
|
-
}
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
return target;
|
|
480
|
-
};
|
|
481
|
-
return _extends.apply(this, arguments);
|
|
482
|
-
}
|
|
483
|
-
|
|
484
|
-
function _inherits(subClass, superClass) {
|
|
485
|
-
if (typeof superClass !== "function" && superClass !== null) {
|
|
486
|
-
throw new TypeError("Super expression must either be null or a function");
|
|
487
|
-
}
|
|
488
|
-
|
|
489
|
-
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
490
|
-
constructor: {
|
|
491
|
-
value: subClass,
|
|
492
|
-
writable: true,
|
|
493
|
-
configurable: true
|
|
494
|
-
}
|
|
495
|
-
});
|
|
496
|
-
Object.defineProperty(subClass, "prototype", {
|
|
497
|
-
writable: false
|
|
498
|
-
});
|
|
499
|
-
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
function _getPrototypeOf(o) {
|
|
503
|
-
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
|
|
504
|
-
return o.__proto__ || Object.getPrototypeOf(o);
|
|
505
|
-
};
|
|
506
|
-
return _getPrototypeOf(o);
|
|
507
|
-
}
|
|
508
|
-
|
|
509
|
-
function _setPrototypeOf(o, p) {
|
|
510
|
-
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
|
511
|
-
o.__proto__ = p;
|
|
512
|
-
return o;
|
|
513
|
-
};
|
|
514
|
-
return _setPrototypeOf(o, p);
|
|
515
|
-
}
|
|
516
|
-
|
|
517
|
-
function _isNativeReflectConstruct() {
|
|
518
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
519
|
-
if (Reflect.construct.sham) return false;
|
|
520
|
-
if (typeof Proxy === "function") return true;
|
|
521
|
-
|
|
522
|
-
try {
|
|
523
|
-
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
524
|
-
return true;
|
|
525
|
-
} catch (e) {
|
|
526
|
-
return false;
|
|
527
|
-
}
|
|
528
|
-
}
|
|
529
|
-
|
|
530
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
531
|
-
if (source == null) return {};
|
|
532
|
-
var target = {};
|
|
533
|
-
var sourceKeys = Object.keys(source);
|
|
534
|
-
var key, i;
|
|
535
|
-
|
|
536
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
537
|
-
key = sourceKeys[i];
|
|
538
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
539
|
-
target[key] = source[key];
|
|
540
|
-
}
|
|
541
|
-
|
|
542
|
-
return target;
|
|
543
|
-
}
|
|
544
|
-
|
|
545
|
-
function _objectWithoutProperties(source, excluded) {
|
|
546
|
-
if (source == null) return {};
|
|
547
|
-
|
|
548
|
-
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
549
|
-
|
|
550
|
-
var key, i;
|
|
551
|
-
|
|
552
|
-
if (Object.getOwnPropertySymbols) {
|
|
553
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
554
|
-
|
|
555
|
-
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
556
|
-
key = sourceSymbolKeys[i];
|
|
557
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
558
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
559
|
-
target[key] = source[key];
|
|
560
|
-
}
|
|
561
|
-
}
|
|
562
|
-
|
|
563
|
-
return target;
|
|
564
|
-
}
|
|
565
|
-
|
|
566
|
-
function _assertThisInitialized(self) {
|
|
567
|
-
if (self === void 0) {
|
|
568
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
569
|
-
}
|
|
570
|
-
|
|
571
|
-
return self;
|
|
572
|
-
}
|
|
573
|
-
|
|
574
|
-
function _possibleConstructorReturn(self, call) {
|
|
575
|
-
if (call && (typeof call === "object" || typeof call === "function")) {
|
|
576
|
-
return call;
|
|
577
|
-
} else if (call !== void 0) {
|
|
578
|
-
throw new TypeError("Derived constructors may only return object or undefined");
|
|
579
|
-
}
|
|
580
|
-
|
|
581
|
-
return _assertThisInitialized(self);
|
|
582
|
-
}
|
|
583
|
-
|
|
584
|
-
function _createSuper(Derived) {
|
|
585
|
-
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
586
|
-
|
|
587
|
-
return function _createSuperInternal() {
|
|
588
|
-
var Super = _getPrototypeOf(Derived),
|
|
589
|
-
result;
|
|
590
|
-
|
|
591
|
-
if (hasNativeReflectConstruct) {
|
|
592
|
-
var NewTarget = _getPrototypeOf(this).constructor;
|
|
593
|
-
|
|
594
|
-
result = Reflect.construct(Super, arguments, NewTarget);
|
|
595
|
-
} else {
|
|
596
|
-
result = Super.apply(this, arguments);
|
|
597
|
-
}
|
|
598
|
-
|
|
599
|
-
return _possibleConstructorReturn(this, result);
|
|
600
|
-
};
|
|
601
|
-
}
|
|
602
|
-
|
|
603
|
-
function _taggedTemplateLiteral(strings, raw) {
|
|
604
|
-
if (!raw) {
|
|
605
|
-
raw = strings.slice(0);
|
|
606
|
-
}
|
|
607
|
-
|
|
608
|
-
return Object.freeze(Object.defineProperties(strings, {
|
|
609
|
-
raw: {
|
|
610
|
-
value: Object.freeze(raw)
|
|
611
|
-
}
|
|
612
|
-
}));
|
|
613
|
-
}
|
|
614
|
-
|
|
615
|
-
function _slicedToArray(arr, i) {
|
|
616
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
617
|
-
}
|
|
618
|
-
|
|
619
|
-
function _toConsumableArray(arr) {
|
|
620
|
-
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
621
|
-
}
|
|
622
|
-
|
|
623
|
-
function _arrayWithoutHoles(arr) {
|
|
624
|
-
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
|
625
|
-
}
|
|
626
|
-
|
|
627
|
-
function _arrayWithHoles(arr) {
|
|
628
|
-
if (Array.isArray(arr)) return arr;
|
|
629
|
-
}
|
|
630
|
-
|
|
631
|
-
function _iterableToArray(iter) {
|
|
632
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
633
|
-
}
|
|
634
|
-
|
|
635
|
-
function _iterableToArrayLimit(arr, i) {
|
|
636
|
-
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
637
|
-
|
|
638
|
-
if (_i == null) return;
|
|
639
|
-
var _arr = [];
|
|
640
|
-
var _n = true;
|
|
641
|
-
var _d = false;
|
|
642
|
-
|
|
643
|
-
var _s, _e;
|
|
644
|
-
|
|
645
|
-
try {
|
|
646
|
-
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
|
647
|
-
_arr.push(_s.value);
|
|
648
|
-
|
|
649
|
-
if (i && _arr.length === i) break;
|
|
650
|
-
}
|
|
651
|
-
} catch (err) {
|
|
652
|
-
_d = true;
|
|
653
|
-
_e = err;
|
|
654
|
-
} finally {
|
|
655
|
-
try {
|
|
656
|
-
if (!_n && _i["return"] != null) _i["return"]();
|
|
657
|
-
} finally {
|
|
658
|
-
if (_d) throw _e;
|
|
495
|
+
iterator: values(e),
|
|
496
|
+
resultName: r,
|
|
497
|
+
nextLoc: n
|
|
498
|
+
}, "next" === this.method && (this.arg = t), y;
|
|
659
499
|
}
|
|
660
|
-
}
|
|
661
|
-
|
|
662
|
-
return _arr;
|
|
500
|
+
}, e;
|
|
663
501
|
}
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
669
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
670
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
671
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
502
|
+
function _setPrototypeOf(t, e) {
|
|
503
|
+
return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
|
504
|
+
return t.__proto__ = e, t;
|
|
505
|
+
}, _setPrototypeOf(t, e);
|
|
672
506
|
}
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
676
|
-
|
|
677
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
678
|
-
|
|
679
|
-
return arr2;
|
|
507
|
+
function _slicedToArray(r, e) {
|
|
508
|
+
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
|
|
680
509
|
}
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
510
|
+
function _taggedTemplateLiteral(e, t) {
|
|
511
|
+
return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, {
|
|
512
|
+
raw: {
|
|
513
|
+
value: Object.freeze(t)
|
|
514
|
+
}
|
|
515
|
+
}));
|
|
684
516
|
}
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
517
|
+
function _toConsumableArray(r) {
|
|
518
|
+
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
|
|
519
|
+
}
|
|
520
|
+
function _toPrimitive(t, r) {
|
|
521
|
+
if ("object" != typeof t || !t) return t;
|
|
522
|
+
var e = t[Symbol.toPrimitive];
|
|
523
|
+
if (void 0 !== e) {
|
|
524
|
+
var i = e.call(t, r || "default");
|
|
525
|
+
if ("object" != typeof i) return i;
|
|
526
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
527
|
+
}
|
|
528
|
+
return ("string" === r ? String : Number)(t);
|
|
529
|
+
}
|
|
530
|
+
function _toPropertyKey(t) {
|
|
531
|
+
var i = _toPrimitive(t, "string");
|
|
532
|
+
return "symbol" == typeof i ? i : i + "";
|
|
533
|
+
}
|
|
534
|
+
function _unsupportedIterableToArray(r, a) {
|
|
535
|
+
if (r) {
|
|
536
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
537
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
538
|
+
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;
|
|
539
|
+
}
|
|
688
540
|
}
|
|
689
541
|
|
|
690
542
|
var SimpleErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
691
|
-
_inherits(SimpleErrorBoundary, _React$Component);
|
|
692
|
-
|
|
693
|
-
var _super = _createSuper(SimpleErrorBoundary);
|
|
694
|
-
|
|
695
543
|
function SimpleErrorBoundary(props) {
|
|
696
544
|
var _this;
|
|
697
|
-
|
|
698
545
|
_classCallCheck(this, SimpleErrorBoundary);
|
|
699
|
-
|
|
700
|
-
_this = _super.call(this, props);
|
|
546
|
+
_this = _callSuper(this, SimpleErrorBoundary, [props]);
|
|
701
547
|
_this.state = {
|
|
702
548
|
hasError: false
|
|
703
549
|
};
|
|
704
550
|
return _this;
|
|
705
551
|
}
|
|
706
|
-
|
|
707
|
-
_createClass(SimpleErrorBoundary, [{
|
|
552
|
+
_inherits(SimpleErrorBoundary, _React$Component);
|
|
553
|
+
return _createClass(SimpleErrorBoundary, [{
|
|
708
554
|
key: "componentDidCatch",
|
|
709
555
|
value: function componentDidCatch(error, errorInfo) {
|
|
710
556
|
// You can also log the error to an error reporting service
|
|
@@ -717,7 +563,6 @@
|
|
|
717
563
|
// You can render any custom fallback UI
|
|
718
564
|
return this.props.showMessageOnError ? /*#__PURE__*/React__default.createElement("h1", null, this.props.errorMessage) : null;
|
|
719
565
|
}
|
|
720
|
-
|
|
721
566
|
return this.props.children;
|
|
722
567
|
}
|
|
723
568
|
}], [{
|
|
@@ -729,10 +574,7 @@
|
|
|
729
574
|
};
|
|
730
575
|
}
|
|
731
576
|
}]);
|
|
732
|
-
|
|
733
|
-
return SimpleErrorBoundary;
|
|
734
577
|
}(React__default.Component);
|
|
735
|
-
|
|
736
578
|
SimpleErrorBoundary.defaultProps = {
|
|
737
579
|
errorMessage: 'Something went wrong',
|
|
738
580
|
errorLogger: null,
|
|
@@ -814,21 +656,19 @@
|
|
|
814
656
|
var StyledHeader = styled__default.h5(_templateObject || (_templateObject = _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) {
|
|
815
657
|
return props.theme.marginPaddings[1];
|
|
816
658
|
}, media.sm);
|
|
817
|
-
|
|
818
659
|
/**
|
|
819
660
|
* IconHeader can render the standard Luxity Page/Section Header nodes with SVG
|
|
820
661
|
*/
|
|
821
662
|
var IconHeader = function IconHeader(_ref) {
|
|
822
663
|
var title = _ref.title,
|
|
823
|
-
|
|
824
|
-
|
|
664
|
+
SvgComponent = _ref.svgComponent,
|
|
665
|
+
renderAppendage = _ref.renderAppendage;
|
|
825
666
|
return /*#__PURE__*/React__default.createElement(StyledHeader, null, /*#__PURE__*/React__default.createElement("div", {
|
|
826
667
|
className: "icon-header__left"
|
|
827
668
|
}, /*#__PURE__*/React__default.createElement(SvgComponent, null), title), /*#__PURE__*/React__default.createElement("div", {
|
|
828
669
|
className: "icon-header__right"
|
|
829
670
|
}, renderAppendage && renderAppendage()));
|
|
830
671
|
};
|
|
831
|
-
|
|
832
672
|
IconHeader.defaultProps = {
|
|
833
673
|
title: '',
|
|
834
674
|
svgComponent: function svgComponent() {
|
|
@@ -866,50 +706,39 @@
|
|
|
866
706
|
var LuxityPageReadyContext = /*#__PURE__*/React__default.createContext({
|
|
867
707
|
data: null
|
|
868
708
|
});
|
|
709
|
+
|
|
869
710
|
/**
|
|
870
711
|
* A flavour of PageReady with Luxity customisations
|
|
871
712
|
* 1. the onIsLoading callback is useful to parent components that have more complex data interactions
|
|
872
713
|
* 2. an error message interpreter is supplied from the local helper library
|
|
873
714
|
*/
|
|
874
|
-
|
|
875
715
|
var LuxityPageReady = /*#__PURE__*/function (_React$Component) {
|
|
876
|
-
_inherits(LuxityPageReady, _React$Component);
|
|
877
|
-
|
|
878
|
-
var _super = _createSuper(LuxityPageReady);
|
|
879
|
-
|
|
880
716
|
function LuxityPageReady() {
|
|
881
717
|
var _this;
|
|
882
|
-
|
|
883
718
|
_classCallCheck(this, LuxityPageReady);
|
|
884
|
-
|
|
885
719
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
886
720
|
args[_key] = arguments[_key];
|
|
887
721
|
}
|
|
888
|
-
|
|
889
|
-
_this
|
|
890
|
-
|
|
891
|
-
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
722
|
+
_this = _callSuper(this, LuxityPageReady, [].concat(args));
|
|
723
|
+
_defineProperty(_this, "state", {
|
|
892
724
|
data: null
|
|
893
725
|
});
|
|
894
|
-
|
|
895
|
-
_defineProperty(_assertThisInitialized(_this), "refreshPage", function () {
|
|
726
|
+
_defineProperty(_this, "refreshPage", function () {
|
|
896
727
|
return _this.pageReadyInstance.initRequest();
|
|
897
728
|
});
|
|
898
|
-
|
|
899
729
|
return _this;
|
|
900
730
|
}
|
|
901
|
-
|
|
902
|
-
_createClass(LuxityPageReady, [{
|
|
731
|
+
_inherits(LuxityPageReady, _React$Component);
|
|
732
|
+
return _createClass(LuxityPageReady, [{
|
|
903
733
|
key: "render",
|
|
904
734
|
value: function render() {
|
|
905
735
|
var _this2 = this;
|
|
906
|
-
|
|
907
736
|
var _this$props = this.props,
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
737
|
+
customErrorMessage = _this$props.customErrorMessage,
|
|
738
|
+
customErrorHandler = _this$props.customErrorHandler,
|
|
739
|
+
getRequestPromise = _this$props.getRequestPromise,
|
|
740
|
+
_onData = _this$props.onData,
|
|
741
|
+
children = _this$props.children;
|
|
913
742
|
var data = this.state.data;
|
|
914
743
|
return /*#__PURE__*/React__default.createElement(PageReady, {
|
|
915
744
|
ref: function ref(inst) {
|
|
@@ -919,19 +748,15 @@
|
|
|
919
748
|
_this2.setState({
|
|
920
749
|
data: res.data
|
|
921
750
|
});
|
|
922
|
-
|
|
923
751
|
_onData(res);
|
|
924
752
|
},
|
|
925
753
|
getRequestInstance: function getRequestInstance() {
|
|
926
754
|
_this2.props.onIsLoading(true);
|
|
927
|
-
|
|
928
755
|
return getRequestPromise().then(function (out) {
|
|
929
756
|
_this2.props.onIsLoading(false);
|
|
930
|
-
|
|
931
757
|
return out;
|
|
932
758
|
}).catch(function (oops) {
|
|
933
759
|
_this2.props.onIsLoading(false);
|
|
934
|
-
|
|
935
760
|
return oops;
|
|
936
761
|
});
|
|
937
762
|
},
|
|
@@ -948,10 +773,7 @@
|
|
|
948
773
|
}, children));
|
|
949
774
|
}
|
|
950
775
|
}]);
|
|
951
|
-
|
|
952
|
-
return LuxityPageReady;
|
|
953
776
|
}(React__default.Component);
|
|
954
|
-
|
|
955
777
|
LuxityPageReady.defaultProps = {
|
|
956
778
|
onIsLoading: function onIsLoading() {
|
|
957
779
|
return null;
|
|
@@ -7550,12 +7372,12 @@
|
|
|
7550
7372
|
/**
|
|
7551
7373
|
* It represents the React Component that contains the notifications.
|
|
7552
7374
|
* */
|
|
7553
|
-
|
|
7554
7375
|
var LuxityNotifications = function LuxityNotifications(props) {
|
|
7555
7376
|
return /*#__PURE__*/React__default.createElement(Notifications__default, props);
|
|
7556
7377
|
};
|
|
7557
7378
|
|
|
7558
7379
|
/** @format */
|
|
7380
|
+
|
|
7559
7381
|
var request = {
|
|
7560
7382
|
fetching: false,
|
|
7561
7383
|
failed: false,
|
|
@@ -7569,31 +7391,20 @@
|
|
|
7569
7391
|
};
|
|
7570
7392
|
|
|
7571
7393
|
var NotificationDropDown = /*#__PURE__*/function (_React$Component) {
|
|
7572
|
-
_inherits(NotificationDropDown, _React$Component);
|
|
7573
|
-
|
|
7574
|
-
var _super = _createSuper(NotificationDropDown);
|
|
7575
|
-
|
|
7576
7394
|
function NotificationDropDown(props) {
|
|
7577
7395
|
var _this;
|
|
7578
|
-
|
|
7579
7396
|
_classCallCheck(this, NotificationDropDown);
|
|
7580
|
-
|
|
7581
|
-
_this
|
|
7582
|
-
|
|
7583
|
-
_defineProperty(_assertThisInitialized(_this), "postUpdate", function (selectedOption, type) {
|
|
7397
|
+
_this = _callSuper(this, NotificationDropDown, [props]);
|
|
7398
|
+
_defineProperty(_this, "postUpdate", function (selectedOption, type) {
|
|
7584
7399
|
_this.setState({
|
|
7585
7400
|
request: _objectSpread2(_objectSpread2({}, request), {}, {
|
|
7586
7401
|
fetching: true
|
|
7587
7402
|
})
|
|
7588
7403
|
});
|
|
7589
|
-
|
|
7590
7404
|
_this.props.setSchedule(selectedOption.value, type).then(function () {
|
|
7591
|
-
|
|
7592
|
-
|
|
7593
|
-
_this.setState((_this$setState = {}, _defineProperty(_this$setState, type === 'EMAIL' ? 'emailSelectedOption' : 'whatsappSelectedOption', selectedOption), _defineProperty(_this$setState, "request", _objectSpread2(_objectSpread2({}, request), {}, {
|
|
7405
|
+
_this.setState(_defineProperty(_defineProperty({}, type === 'EMAIL' ? 'emailSelectedOption' : 'whatsappSelectedOption', selectedOption), "request", _objectSpread2(_objectSpread2({}, request), {}, {
|
|
7594
7406
|
success: true
|
|
7595
|
-
}))
|
|
7596
|
-
|
|
7407
|
+
})));
|
|
7597
7408
|
success("".concat(type === 'EMAIL' ? 'Email' : 'WhatsApp', " Notification Frequency Updated"));
|
|
7598
7409
|
}).catch(function () {
|
|
7599
7410
|
_this.setState({
|
|
@@ -7601,12 +7412,10 @@
|
|
|
7601
7412
|
failed: true
|
|
7602
7413
|
})
|
|
7603
7414
|
});
|
|
7604
|
-
|
|
7605
7415
|
error('Error Occurred');
|
|
7606
7416
|
});
|
|
7607
7417
|
});
|
|
7608
|
-
|
|
7609
|
-
_defineProperty(_assertThisInitialized(_this), "getOptionsFromEnumResult", function (enumResult) {
|
|
7418
|
+
_defineProperty(_this, "getOptionsFromEnumResult", function (enumResult) {
|
|
7610
7419
|
var enumValues = enumResult.data.__type.enumValues;
|
|
7611
7420
|
return enumValues.map(function (enumItem) {
|
|
7612
7421
|
return {
|
|
@@ -7615,21 +7424,17 @@
|
|
|
7615
7424
|
};
|
|
7616
7425
|
});
|
|
7617
7426
|
});
|
|
7618
|
-
|
|
7619
|
-
_defineProperty(_assertThisInitialized(_this), "onData", function (_ref) {
|
|
7427
|
+
_defineProperty(_this, "onData", function (_ref) {
|
|
7620
7428
|
var data = _ref.data;
|
|
7621
|
-
|
|
7622
7429
|
var options = _this.getOptionsFromEnumResult(data);
|
|
7623
|
-
|
|
7624
7430
|
var _data$data$user = data.data.user,
|
|
7625
|
-
|
|
7626
|
-
|
|
7627
|
-
|
|
7628
|
-
|
|
7629
|
-
|
|
7431
|
+
email_interest_send_schedule = _data$data$user.email_interest_send_schedule,
|
|
7432
|
+
whatsapp_interest_send_schedule = _data$data$user.whatsapp_interest_send_schedule,
|
|
7433
|
+
is_early_access = _data$data$user.is_early_access,
|
|
7434
|
+
is_exclusive = _data$data$user.is_exclusive;
|
|
7630
7435
|
_this.setState({
|
|
7631
7436
|
options: options,
|
|
7632
|
-
canReceiveWhatsAppNotifications:
|
|
7437
|
+
canReceiveWhatsAppNotifications: is_early_access || is_exclusive,
|
|
7633
7438
|
emailSelectedOption: options.find(function (item) {
|
|
7634
7439
|
return item.value === email_interest_send_schedule;
|
|
7635
7440
|
}),
|
|
@@ -7638,14 +7443,13 @@
|
|
|
7638
7443
|
})
|
|
7639
7444
|
});
|
|
7640
7445
|
});
|
|
7641
|
-
|
|
7642
|
-
_defineProperty(_assertThisInitialized(_this), "render", function () {
|
|
7446
|
+
_defineProperty(_this, "render", function () {
|
|
7643
7447
|
var _this$state = _this.state,
|
|
7644
|
-
|
|
7645
|
-
|
|
7646
|
-
|
|
7647
|
-
|
|
7648
|
-
|
|
7448
|
+
options = _this$state.options,
|
|
7449
|
+
emailSelectedOption = _this$state.emailSelectedOption,
|
|
7450
|
+
whatsappSelectedOption = _this$state.whatsappSelectedOption,
|
|
7451
|
+
canReceiveWhatsAppNotifications = _this$state.canReceiveWhatsAppNotifications,
|
|
7452
|
+
updating = _this$state.request.fetching;
|
|
7649
7453
|
return /*#__PURE__*/React__default.createElement(NotifyContainer, null, /*#__PURE__*/React__default.createElement(LuxityNotifications, null), /*#__PURE__*/React__default.createElement(LuxityPageReady, {
|
|
7650
7454
|
getRequestPromise: _this.props.getSchedule,
|
|
7651
7455
|
onData: function onData(data) {
|
|
@@ -7693,7 +7497,6 @@
|
|
|
7693
7497
|
value: emailSelectedOption
|
|
7694
7498
|
}))))));
|
|
7695
7499
|
});
|
|
7696
|
-
|
|
7697
7500
|
_this.state = {
|
|
7698
7501
|
options: [],
|
|
7699
7502
|
emailSelectedOption: null,
|
|
@@ -7703,10 +7506,9 @@
|
|
|
7703
7506
|
};
|
|
7704
7507
|
return _this;
|
|
7705
7508
|
}
|
|
7706
|
-
|
|
7509
|
+
_inherits(NotificationDropDown, _React$Component);
|
|
7707
7510
|
return _createClass(NotificationDropDown);
|
|
7708
7511
|
}(React__default.Component);
|
|
7709
|
-
|
|
7710
7512
|
var NotificationDropDown$1 = themed(NotificationDropDown);
|
|
7711
7513
|
|
|
7712
7514
|
var simpleRequest = (function (axiosInstance, url) {
|
|
@@ -7766,23 +7568,23 @@
|
|
|
7766
7568
|
return props.hasBorder ? props.theme.colors.borderColor : props.theme.colors.ntrlMin;
|
|
7767
7569
|
}, function (_ref) {
|
|
7768
7570
|
var isChecked = _ref.isChecked,
|
|
7769
|
-
|
|
7571
|
+
theme = _ref.theme;
|
|
7770
7572
|
return isChecked ? theme.colors.primary : theme.colors.gray;
|
|
7771
7573
|
}, function (_ref2) {
|
|
7772
7574
|
var isChecked = _ref2.isChecked,
|
|
7773
|
-
|
|
7575
|
+
theme = _ref2.theme;
|
|
7774
7576
|
return isChecked ? 'white' : theme.colors.base;
|
|
7775
7577
|
}, function (_ref3) {
|
|
7776
7578
|
var isChecked = _ref3.isChecked,
|
|
7777
|
-
|
|
7579
|
+
theme = _ref3.theme;
|
|
7778
7580
|
return isChecked ? theme.colors.ntrlMin : theme.colors.primary;
|
|
7779
7581
|
}, function (_ref4) {
|
|
7780
7582
|
var isChecked = _ref4.isChecked,
|
|
7781
|
-
|
|
7583
|
+
theme = _ref4.theme;
|
|
7782
7584
|
return isChecked ? 'white' : theme.colors.base;
|
|
7783
7585
|
}, function (_ref5) {
|
|
7784
7586
|
var isChecked = _ref5.isChecked,
|
|
7785
|
-
|
|
7587
|
+
theme = _ref5.theme;
|
|
7786
7588
|
return isChecked ? theme.colors.primary : 'white';
|
|
7787
7589
|
}, media.sm, function (props) {
|
|
7788
7590
|
return props.theme.marginPaddings[2];
|
|
@@ -7937,56 +7739,45 @@
|
|
|
7937
7739
|
var baseButtonStyle = styled.css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n padding: 1rem 2rem;\n cursor: pointer;\n letter-spacing: 1.3px;\n border-style: none;\n text-transform: uppercase;\n font-size: 12px;\n color: #fff;\n transition: 0.2s ease-in-out;\n outline: none;\n"])));
|
|
7938
7740
|
|
|
7939
7741
|
var _excluded = ["children"];
|
|
7940
|
-
|
|
7941
7742
|
var _templateObject$6;
|
|
7942
7743
|
var Button = styled__default.button(_templateObject$6 || (_templateObject$6 = _taggedTemplateLiteral(["\n outline: none;\n cursor: pointer;\n background-color: transparent;\n border: none;\n &:disabled {\n ", ";\n }\n"])), disabledButtonStyle);
|
|
7943
|
-
|
|
7944
7744
|
var WrapperButton = function WrapperButton(_ref) {
|
|
7945
7745
|
var children = _ref.children,
|
|
7946
|
-
|
|
7947
|
-
|
|
7746
|
+
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
7948
7747
|
return /*#__PURE__*/React__default.createElement(Button, restProps, children);
|
|
7949
7748
|
};
|
|
7950
7749
|
|
|
7951
7750
|
var _templateObject$7, _templateObject2$1;
|
|
7952
7751
|
var categories = catArray;
|
|
7953
|
-
|
|
7954
7752
|
var getSvg = function getSvg() {
|
|
7955
7753
|
var category = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
7956
|
-
|
|
7957
7754
|
switch (category) {
|
|
7958
7755
|
case interestCategories.BAGS:
|
|
7959
7756
|
return /*#__PURE__*/React__default.createElement(Bags, null);
|
|
7960
|
-
|
|
7961
7757
|
case interestCategories.SHOES:
|
|
7962
7758
|
return /*#__PURE__*/React__default.createElement(Shoes, null);
|
|
7963
|
-
|
|
7964
7759
|
case interestCategories.APPAREL:
|
|
7965
7760
|
return /*#__PURE__*/React__default.createElement(Clothing, null);
|
|
7966
|
-
|
|
7967
7761
|
case interestCategories.ACCESSORIES:
|
|
7968
7762
|
return /*#__PURE__*/React__default.createElement(Accessories, null);
|
|
7969
|
-
|
|
7970
7763
|
case interestCategories.WATCHES:
|
|
7971
7764
|
return /*#__PURE__*/React__default.createElement(Watches, null);
|
|
7972
|
-
|
|
7973
7765
|
default:
|
|
7974
7766
|
return null;
|
|
7975
7767
|
}
|
|
7976
7768
|
};
|
|
7977
|
-
|
|
7978
7769
|
var Container = styled__default.div(_templateObject$7 || (_templateObject$7 = _taggedTemplateLiteral(["\n margin-bottom: ", ";\n"])), function (props) {
|
|
7979
7770
|
return props.theme.marginPaddings[5];
|
|
7980
7771
|
});
|
|
7981
7772
|
var CategoryTitle = styled__default.h1(_templateObject2$1 || (_templateObject2$1 = _taggedTemplateLiteral(["\n margin-top: 10px;\n font-size: 14px;\n text-transform: uppercase;\n"])));
|
|
7773
|
+
|
|
7982
7774
|
/**
|
|
7983
7775
|
* InterestCatSelector is a specialized selector for select luxity specific interest categories
|
|
7984
7776
|
*/
|
|
7985
|
-
|
|
7986
7777
|
var InterestCatSelector = function InterestCatSelector(_ref) {
|
|
7987
7778
|
var onCategoryChange = _ref.onCategoryChange,
|
|
7988
|
-
|
|
7989
|
-
|
|
7779
|
+
errorMessage = _ref.errorMessage,
|
|
7780
|
+
category = _ref.category;
|
|
7990
7781
|
return /*#__PURE__*/React__default.createElement(Container, null, /*#__PURE__*/React__default.createElement(Body, null, categories.map(function (cat, index) {
|
|
7991
7782
|
return /*#__PURE__*/React__default.createElement(WrapperButton, {
|
|
7992
7783
|
key: "cat-".concat(index),
|
|
@@ -8001,7 +7792,6 @@
|
|
|
8001
7792
|
}, getSvg(cat.value), /*#__PURE__*/React__default.createElement(CategoryTitle, null, cat.categoryTitle)));
|
|
8002
7793
|
})), errorMessage && /*#__PURE__*/React__default.createElement(ErrorMessage, null, errorMessage));
|
|
8003
7794
|
};
|
|
8004
|
-
|
|
8005
7795
|
InterestCatSelector.defaultProps = {
|
|
8006
7796
|
errorMessage: '',
|
|
8007
7797
|
category: null,
|
|
@@ -8012,7 +7802,6 @@
|
|
|
8012
7802
|
var CategoryInterestSelector = themed(InterestCatSelector);
|
|
8013
7803
|
|
|
8014
7804
|
var _excluded$1 = ["children"];
|
|
8015
|
-
|
|
8016
7805
|
var _templateObject$8;
|
|
8017
7806
|
var Button$1 = styled__default.button(_templateObject$8 || (_templateObject$8 = _taggedTemplateLiteral(["\n ", ";\n background-color: transparent;\n color: ", ";\n &:hover {\n color: ", ";\n }\n &:disabled {\n ", ";\n color: ", ";\n }\n"])), baseButtonStyle, function (props) {
|
|
8018
7807
|
return props.theme.colors.base;
|
|
@@ -8021,21 +7810,17 @@
|
|
|
8021
7810
|
}, disabledButtonStyle, function (props) {
|
|
8022
7811
|
return props.theme.colors.base;
|
|
8023
7812
|
});
|
|
8024
|
-
|
|
8025
7813
|
var TextButton = function TextButton(_ref) {
|
|
8026
7814
|
var children = _ref.children,
|
|
8027
|
-
|
|
8028
|
-
|
|
7815
|
+
restProps = _objectWithoutProperties(_ref, _excluded$1);
|
|
8029
7816
|
return /*#__PURE__*/React__default.createElement(Button$1, restProps, children);
|
|
8030
7817
|
};
|
|
8031
|
-
|
|
8032
7818
|
TextButton.defaultProps = {
|
|
8033
7819
|
type: 'button'
|
|
8034
7820
|
};
|
|
8035
7821
|
var TextButton$1 = themed(TextButton);
|
|
8036
7822
|
|
|
8037
7823
|
var _excluded$2 = ["children"];
|
|
8038
|
-
|
|
8039
7824
|
var _templateObject$9;
|
|
8040
7825
|
var Button$2 = styled__default(TextButton$1)(_templateObject$9 || (_templateObject$9 = _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) {
|
|
8041
7826
|
return props.theme.colors.ntrlMin;
|
|
@@ -8050,14 +7835,11 @@
|
|
|
8050
7835
|
}, function (props) {
|
|
8051
7836
|
return props.theme.colors.primary;
|
|
8052
7837
|
});
|
|
8053
|
-
|
|
8054
7838
|
var InvertedTextButton = function InvertedTextButton(_ref) {
|
|
8055
7839
|
var children = _ref.children,
|
|
8056
|
-
|
|
8057
|
-
|
|
7840
|
+
restProps = _objectWithoutProperties(_ref, _excluded$2);
|
|
8058
7841
|
return /*#__PURE__*/React__default.createElement(Button$2, restProps, children);
|
|
8059
7842
|
};
|
|
8060
|
-
|
|
8061
7843
|
var InvertedTextButton$1 = themed(InvertedTextButton);
|
|
8062
7844
|
|
|
8063
7845
|
var _templateObject$a, _templateObject2$2;
|
|
@@ -8099,65 +7881,49 @@
|
|
|
8099
7881
|
}, function (props) {
|
|
8100
7882
|
return props.theme.colors.ntrlMin;
|
|
8101
7883
|
});
|
|
7884
|
+
|
|
8102
7885
|
/**
|
|
8103
7886
|
* Multiselector with a GraphQL flavour (TODO: to be revised to make it remote api agnostic)
|
|
8104
7887
|
*/
|
|
8105
|
-
|
|
8106
7888
|
var GraphQLMultiSelector = /*#__PURE__*/function (_React$Component) {
|
|
8107
|
-
_inherits(GraphQLMultiSelector, _React$Component);
|
|
8108
|
-
|
|
8109
|
-
var _super = _createSuper(GraphQLMultiSelector);
|
|
8110
|
-
|
|
8111
7889
|
function GraphQLMultiSelector(props) {
|
|
8112
7890
|
var _this;
|
|
8113
|
-
|
|
8114
7891
|
_classCallCheck(this, GraphQLMultiSelector);
|
|
8115
|
-
|
|
8116
|
-
_this
|
|
8117
|
-
|
|
8118
|
-
_defineProperty(_assertThisInitialized(_this), "componentDidUpdate", function (prevProps) {
|
|
7892
|
+
_this = _callSuper(this, GraphQLMultiSelector, [props]);
|
|
7893
|
+
_defineProperty(_this, "componentDidUpdate", function (prevProps) {
|
|
8119
7894
|
if (prevProps.graphQuery !== _this.props.graphQuery) {
|
|
8120
7895
|
_this.makeRequest();
|
|
8121
7896
|
}
|
|
8122
7897
|
});
|
|
8123
|
-
|
|
8124
|
-
_defineProperty(_assertThisInitialized(_this), "makeRequest", function () {
|
|
7898
|
+
_defineProperty(_this, "makeRequest", function () {
|
|
8125
7899
|
_this.pageReady.refreshPage();
|
|
8126
7900
|
});
|
|
8127
|
-
|
|
8128
|
-
_defineProperty(_assertThisInitialized(_this), "emptySelected", function () {
|
|
7901
|
+
_defineProperty(_this, "emptySelected", function () {
|
|
8129
7902
|
return _this.setState({
|
|
8130
7903
|
selected: [ALL_ITEM]
|
|
8131
7904
|
});
|
|
8132
7905
|
});
|
|
8133
|
-
|
|
8134
|
-
_defineProperty(_assertThisInitialized(_this), "setNewResults", function (res) {
|
|
7906
|
+
_defineProperty(_this, "setNewResults", function (res) {
|
|
8135
7907
|
var selectedIds = _this.state.selected.map(function (sel) {
|
|
8136
7908
|
return sel.id;
|
|
8137
7909
|
});
|
|
8138
|
-
|
|
8139
7910
|
var pagination = _this.props.resultProcessor(res);
|
|
8140
|
-
|
|
8141
7911
|
var allSelected = _this.state.selected.some(function (item) {
|
|
8142
7912
|
return item.id === ALL_ITEM.id;
|
|
8143
7913
|
});
|
|
8144
|
-
|
|
8145
7914
|
var newList = pagination.data.filter(function (newItem) {
|
|
8146
7915
|
return !selectedIds.includes(newItem.id);
|
|
8147
7916
|
});
|
|
8148
7917
|
newList = allSelected ? newList : [ALL_ITEM].concat(_toConsumableArray(newList));
|
|
8149
|
-
|
|
8150
7918
|
_this.setState({
|
|
8151
7919
|
list: newList,
|
|
8152
7920
|
pagination: pagination
|
|
8153
7921
|
});
|
|
8154
7922
|
});
|
|
8155
|
-
|
|
8156
|
-
_defineProperty(_assertThisInitialized(_this), "onAddItem", function (addSelectedItem) {
|
|
7923
|
+
_defineProperty(_this, "onAddItem", function (addSelectedItem) {
|
|
8157
7924
|
_this.setState(function (prevState) {
|
|
8158
7925
|
var newSelectedList;
|
|
8159
7926
|
var newList;
|
|
8160
|
-
|
|
8161
7927
|
if (addSelectedItem.id === ALL_ITEM.id) {
|
|
8162
7928
|
// Clear Selected List
|
|
8163
7929
|
// and move previous Selected items to list
|
|
@@ -8177,7 +7943,6 @@
|
|
|
8177
7943
|
return item.id !== addSelectedItem.id;
|
|
8178
7944
|
})));
|
|
8179
7945
|
}
|
|
8180
|
-
|
|
8181
7946
|
return {
|
|
8182
7947
|
selected: newSelectedList,
|
|
8183
7948
|
list: newList
|
|
@@ -8188,24 +7953,20 @@
|
|
|
8188
7953
|
}));
|
|
8189
7954
|
});
|
|
8190
7955
|
});
|
|
8191
|
-
|
|
8192
|
-
_defineProperty(_assertThisInitialized(_this), "onRemoveItem", function (removeSelectedItem) {
|
|
7956
|
+
_defineProperty(_this, "onRemoveItem", function (removeSelectedItem) {
|
|
8193
7957
|
_this.setState(function (prevState) {
|
|
8194
7958
|
// Cannot remove ALL from selection by unselecting it
|
|
8195
7959
|
if ((removeSelectedItem === null || removeSelectedItem === void 0 ? void 0 : removeSelectedItem.id) === ALL_ITEM.id) {
|
|
8196
7960
|
return {};
|
|
8197
7961
|
}
|
|
8198
|
-
|
|
8199
7962
|
var newSelectedList = prevState.selected.filter(function (item) {
|
|
8200
7963
|
return item.id !== removeSelectedItem.id;
|
|
8201
7964
|
});
|
|
8202
|
-
|
|
8203
7965
|
var newList = _toConsumableArray(prevState.list).concat(removeSelectedItem).filter(function (item) {
|
|
8204
7966
|
return item.id !== ALL_ITEM.id;
|
|
8205
7967
|
}).sort(function (a, b) {
|
|
8206
7968
|
return a.id - b.id;
|
|
8207
7969
|
});
|
|
8208
|
-
|
|
8209
7970
|
return {
|
|
8210
7971
|
list: newList,
|
|
8211
7972
|
selected: newSelectedList.length ? newSelectedList : [ALL_ITEM]
|
|
@@ -8216,25 +7977,23 @@
|
|
|
8216
7977
|
}));
|
|
8217
7978
|
});
|
|
8218
7979
|
});
|
|
8219
|
-
|
|
8220
|
-
_defineProperty(_assertThisInitialized(_this), "onIsLoading", function (flag) {
|
|
7980
|
+
_defineProperty(_this, "onIsLoading", function (flag) {
|
|
8221
7981
|
_this.setState({
|
|
8222
7982
|
isLoading: flag
|
|
8223
7983
|
});
|
|
8224
7984
|
});
|
|
8225
|
-
|
|
8226
|
-
_defineProperty(_assertThisInitialized(_this), "render", function () {
|
|
7985
|
+
_defineProperty(_this, "render", function () {
|
|
8227
7986
|
var _this$props = _this.props,
|
|
8228
|
-
|
|
8229
|
-
|
|
8230
|
-
|
|
8231
|
-
|
|
8232
|
-
|
|
7987
|
+
baseClass = _this$props.baseClass,
|
|
7988
|
+
ItemRenderer = _this$props.itemRenderer,
|
|
7989
|
+
identifier = _this$props.identifier,
|
|
7990
|
+
triggerRequest = _this$props.triggerRequest,
|
|
7991
|
+
className = _this$props.className;
|
|
8233
7992
|
var _this$state = _this.state,
|
|
8234
|
-
|
|
8235
|
-
|
|
8236
|
-
|
|
8237
|
-
|
|
7993
|
+
list = _this$state.list,
|
|
7994
|
+
selected = _this$state.selected,
|
|
7995
|
+
pagination = _this$state.pagination,
|
|
7996
|
+
isLoading = _this$state.isLoading;
|
|
8238
7997
|
return /*#__PURE__*/React__default.createElement(StyledMultiselector, null, /*#__PURE__*/React__default.createElement("div", {
|
|
8239
7998
|
"data-qe-id": identifier,
|
|
8240
7999
|
className: "".concat(className, " ").concat(baseClass)
|
|
@@ -8273,7 +8032,6 @@
|
|
|
8273
8032
|
type: "button"
|
|
8274
8033
|
}, "SHOW MORE"))));
|
|
8275
8034
|
});
|
|
8276
|
-
|
|
8277
8035
|
_this.state = {
|
|
8278
8036
|
selected: [ALL_ITEM],
|
|
8279
8037
|
list: [],
|
|
@@ -8282,10 +8040,9 @@
|
|
|
8282
8040
|
};
|
|
8283
8041
|
return _this;
|
|
8284
8042
|
}
|
|
8285
|
-
|
|
8043
|
+
_inherits(GraphQLMultiSelector, _React$Component);
|
|
8286
8044
|
return _createClass(GraphQLMultiSelector);
|
|
8287
8045
|
}(React__default.Component);
|
|
8288
|
-
|
|
8289
8046
|
GraphQLMultiSelector.defaultProps = {
|
|
8290
8047
|
baseClass: 'multiselector'
|
|
8291
8048
|
};
|
|
@@ -8318,24 +8075,22 @@
|
|
|
8318
8075
|
}, function (props) {
|
|
8319
8076
|
return props.theme.marginPaddings[3];
|
|
8320
8077
|
});
|
|
8321
|
-
|
|
8322
8078
|
var InterestsSubheading = function InterestsSubheading(_ref) {
|
|
8323
8079
|
var title = _ref.title,
|
|
8324
|
-
|
|
8325
|
-
|
|
8080
|
+
children = _ref.children,
|
|
8081
|
+
className = _ref.className;
|
|
8326
8082
|
return /*#__PURE__*/React__default.createElement(InterestsSubheadingContainer, {
|
|
8327
8083
|
className: className
|
|
8328
8084
|
}, /*#__PURE__*/React__default.createElement(Title, null, title), /*#__PURE__*/React__default.createElement("div", null, children));
|
|
8329
8085
|
};
|
|
8330
8086
|
|
|
8331
8087
|
var _templateObject$c;
|
|
8332
|
-
|
|
8333
8088
|
var Title$1 = function Title(_ref) {
|
|
8334
8089
|
var baseClass = _ref.baseClass,
|
|
8335
|
-
|
|
8336
|
-
|
|
8337
|
-
|
|
8338
|
-
|
|
8090
|
+
className = _ref.className,
|
|
8091
|
+
title = _ref.title,
|
|
8092
|
+
searchPlaceHolder = _ref.searchPlaceHolder,
|
|
8093
|
+
onSearchChanged = _ref.onSearchChanged;
|
|
8339
8094
|
return /*#__PURE__*/React__default.createElement(InterestsSubheading, {
|
|
8340
8095
|
className: "".concat(className, " ").concat(baseClass, "__title"),
|
|
8341
8096
|
title: title
|
|
@@ -8348,7 +8103,6 @@
|
|
|
8348
8103
|
onChange: onSearchChanged
|
|
8349
8104
|
})));
|
|
8350
8105
|
};
|
|
8351
|
-
|
|
8352
8106
|
var StyledTitle = styled__default(Title$1)(_templateObject$c || (_templateObject$c = _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) {
|
|
8353
8107
|
return props.theme.marginPaddings[2];
|
|
8354
8108
|
}, function (props) {
|
|
@@ -8371,37 +8125,26 @@
|
|
|
8371
8125
|
var Title$2 = themed(StyledTitle);
|
|
8372
8126
|
|
|
8373
8127
|
var debounceBuilder = functions.debounced(200);
|
|
8374
|
-
|
|
8375
8128
|
/**
|
|
8376
8129
|
* Luxity flavoured GraphQLMultiselector with text Search, category and limit controls
|
|
8377
8130
|
*/
|
|
8378
8131
|
var LuxityGraphQLMultiselector = /*#__PURE__*/function (_React$Component) {
|
|
8379
|
-
_inherits(LuxityGraphQLMultiselector, _React$Component);
|
|
8380
|
-
|
|
8381
|
-
var _super = _createSuper(LuxityGraphQLMultiselector);
|
|
8382
|
-
|
|
8383
8132
|
function LuxityGraphQLMultiselector(props) {
|
|
8384
8133
|
var _this;
|
|
8385
|
-
|
|
8386
8134
|
_classCallCheck(this, LuxityGraphQLMultiselector);
|
|
8387
|
-
|
|
8388
|
-
_this
|
|
8389
|
-
|
|
8390
|
-
_defineProperty(_assertThisInitialized(_this), "multiSelectorRef", /*#__PURE__*/React__default.createRef());
|
|
8391
|
-
|
|
8392
|
-
_defineProperty(_assertThisInitialized(_this), "increaseLimit", function () {
|
|
8135
|
+
_this = _callSuper(this, LuxityGraphQLMultiselector, [props]);
|
|
8136
|
+
_defineProperty(_this, "multiSelectorRef", /*#__PURE__*/React__default.createRef());
|
|
8137
|
+
_defineProperty(_this, "increaseLimit", function () {
|
|
8393
8138
|
_this.setState(function (prevState) {
|
|
8394
8139
|
return {
|
|
8395
8140
|
limit: prevState.limit + _this.props.queryLimitIncrement
|
|
8396
8141
|
};
|
|
8397
8142
|
});
|
|
8398
8143
|
});
|
|
8399
|
-
|
|
8400
|
-
_defineProperty(_assertThisInitialized(_this), "onChange", function (selection) {
|
|
8144
|
+
_defineProperty(_this, "onChange", function (selection) {
|
|
8401
8145
|
_this.props.onChange(selection);
|
|
8402
8146
|
});
|
|
8403
|
-
|
|
8404
|
-
_defineProperty(_assertThisInitialized(_this), "onSearchChanged", function (event) {
|
|
8147
|
+
_defineProperty(_this, "onSearchChanged", function (event) {
|
|
8405
8148
|
event.preventDefault();
|
|
8406
8149
|
var searchText = event.target.value;
|
|
8407
8150
|
debounceBuilder(function () {
|
|
@@ -8410,22 +8153,21 @@
|
|
|
8410
8153
|
});
|
|
8411
8154
|
});
|
|
8412
8155
|
});
|
|
8413
|
-
|
|
8414
|
-
_defineProperty(_assertThisInitialized(_this), "render", function () {
|
|
8156
|
+
_defineProperty(_this, "render", function () {
|
|
8415
8157
|
var _this$state = _this.state,
|
|
8416
|
-
|
|
8417
|
-
|
|
8418
|
-
|
|
8158
|
+
limit = _this$state.limit,
|
|
8159
|
+
category = _this$state.category,
|
|
8160
|
+
nameFilter = _this$state.nameFilter;
|
|
8419
8161
|
var _this$props = _this.props,
|
|
8420
|
-
|
|
8421
|
-
|
|
8422
|
-
|
|
8423
|
-
|
|
8424
|
-
|
|
8425
|
-
|
|
8426
|
-
|
|
8427
|
-
|
|
8428
|
-
|
|
8162
|
+
title = _this$props.title,
|
|
8163
|
+
baseClass = _this$props.baseClass,
|
|
8164
|
+
getGraphQuery = _this$props.getGraphQuery,
|
|
8165
|
+
resultProcessor = _this$props.resultProcessor,
|
|
8166
|
+
itemRenderer = _this$props.itemRenderer,
|
|
8167
|
+
searchPlaceHolder = _this$props.searchPlaceHolder,
|
|
8168
|
+
graphApi = _this$props.graphApi,
|
|
8169
|
+
identifier = _this$props.identifier,
|
|
8170
|
+
requestInstance = _this$props.requestInstance;
|
|
8429
8171
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
8430
8172
|
className: baseClass
|
|
8431
8173
|
}, /*#__PURE__*/React__default.createElement(Title$2, {
|
|
@@ -8448,7 +8190,6 @@
|
|
|
8448
8190
|
itemRenderer: itemRenderer
|
|
8449
8191
|
})));
|
|
8450
8192
|
});
|
|
8451
|
-
|
|
8452
8193
|
_this.state = {
|
|
8453
8194
|
limit: props.baseQueryLimit,
|
|
8454
8195
|
category: props.category,
|
|
@@ -8456,12 +8197,11 @@
|
|
|
8456
8197
|
};
|
|
8457
8198
|
return _this;
|
|
8458
8199
|
}
|
|
8459
|
-
|
|
8460
|
-
_createClass(LuxityGraphQLMultiselector, [{
|
|
8200
|
+
_inherits(LuxityGraphQLMultiselector, _React$Component);
|
|
8201
|
+
return _createClass(LuxityGraphQLMultiselector, [{
|
|
8461
8202
|
key: "componentDidUpdate",
|
|
8462
8203
|
value: function componentDidUpdate(prevProps) {
|
|
8463
8204
|
var _this$multiSelectorRe;
|
|
8464
|
-
|
|
8465
8205
|
if (prevProps.category !== this.props.category && (_this$multiSelectorRe = this.multiSelectorRef) !== null && _this$multiSelectorRe !== void 0 && _this$multiSelectorRe.current) {
|
|
8466
8206
|
this.multiSelectorRef.current.emptySelected();
|
|
8467
8207
|
}
|
|
@@ -8474,14 +8214,10 @@
|
|
|
8474
8214
|
category: props.category
|
|
8475
8215
|
};
|
|
8476
8216
|
}
|
|
8477
|
-
|
|
8478
8217
|
return null;
|
|
8479
8218
|
}
|
|
8480
8219
|
}]);
|
|
8481
|
-
|
|
8482
|
-
return LuxityGraphQLMultiselector;
|
|
8483
8220
|
}(React__default.Component);
|
|
8484
|
-
|
|
8485
8221
|
LuxityGraphQLMultiselector.defaultProps = {
|
|
8486
8222
|
baseClass: '',
|
|
8487
8223
|
searchPlaceHolder: '',
|
|
@@ -8490,21 +8226,17 @@
|
|
|
8490
8226
|
};
|
|
8491
8227
|
|
|
8492
8228
|
var _excluded$3 = ["children"];
|
|
8493
|
-
|
|
8494
8229
|
var _templateObject$d;
|
|
8495
8230
|
var Button$3 = styled__default.button(_templateObject$d || (_templateObject$d = _taggedTemplateLiteral(["\n ", ";\n background-color: #fff;\n color: ", ";\n border: 1px solid ", ";\n\n &:disabled {\n ", "\n }\n"])), baseButtonStyle, function (props) {
|
|
8496
8231
|
return props.theme.colors.primary;
|
|
8497
8232
|
}, function (props) {
|
|
8498
8233
|
return props.theme.colors.primary;
|
|
8499
8234
|
}, disabledButtonStyle);
|
|
8500
|
-
|
|
8501
8235
|
var PrimaryButton = function PrimaryButton(_ref) {
|
|
8502
8236
|
var children = _ref.children,
|
|
8503
|
-
|
|
8504
|
-
|
|
8237
|
+
restProps = _objectWithoutProperties(_ref, _excluded$3);
|
|
8505
8238
|
return /*#__PURE__*/React__default.createElement(Button$3, restProps, children);
|
|
8506
8239
|
};
|
|
8507
|
-
|
|
8508
8240
|
var PrimaryButton$1 = themed(PrimaryButton);
|
|
8509
8241
|
|
|
8510
8242
|
var _templateObject$e;
|
|
@@ -8520,11 +8252,10 @@
|
|
|
8520
8252
|
return props.theme.colors.ntrlMin;
|
|
8521
8253
|
});
|
|
8522
8254
|
var UnselectedButton = themed(BaseButton);
|
|
8523
|
-
|
|
8524
8255
|
var ItemRenderer = function ItemRenderer(_ref) {
|
|
8525
8256
|
var item = _ref.item,
|
|
8526
|
-
|
|
8527
|
-
|
|
8257
|
+
onSelect = _ref.onSelect,
|
|
8258
|
+
selected = _ref.selected;
|
|
8528
8259
|
var props = {
|
|
8529
8260
|
onClick: function onClick(e) {
|
|
8530
8261
|
e.preventDefault();
|
|
@@ -8536,12 +8267,12 @@
|
|
|
8536
8267
|
|
|
8537
8268
|
var BrandSelector = function BrandSelector(_ref) {
|
|
8538
8269
|
var onChange = _ref.onChange,
|
|
8539
|
-
|
|
8540
|
-
|
|
8541
|
-
|
|
8542
|
-
|
|
8543
|
-
|
|
8544
|
-
|
|
8270
|
+
category = _ref.category,
|
|
8271
|
+
graphApi = _ref.graphApi,
|
|
8272
|
+
itemRenderer = _ref.itemRenderer,
|
|
8273
|
+
getGraphQuery = _ref.getGraphQuery,
|
|
8274
|
+
resultProcessor = _ref.resultProcessor,
|
|
8275
|
+
requestInstance = _ref.requestInstance;
|
|
8545
8276
|
return /*#__PURE__*/React__default.createElement(LuxityGraphQLMultiselector, {
|
|
8546
8277
|
baseQueryLimit: 16,
|
|
8547
8278
|
title: "Brands",
|
|
@@ -8558,7 +8289,6 @@
|
|
|
8558
8289
|
requestInstance: requestInstance
|
|
8559
8290
|
});
|
|
8560
8291
|
};
|
|
8561
|
-
|
|
8562
8292
|
BrandSelector.defaultProps = {
|
|
8563
8293
|
itemRenderer: ItemRenderer,
|
|
8564
8294
|
resultProcessor: function resultProcessor(result) {
|
|
@@ -8568,12 +8298,12 @@
|
|
|
8568
8298
|
|
|
8569
8299
|
var StyleSelector = function StyleSelector(_ref) {
|
|
8570
8300
|
var onChange = _ref.onChange,
|
|
8571
|
-
|
|
8572
|
-
|
|
8573
|
-
|
|
8574
|
-
|
|
8575
|
-
|
|
8576
|
-
|
|
8301
|
+
category = _ref.category,
|
|
8302
|
+
graphApi = _ref.graphApi,
|
|
8303
|
+
itemRenderer = _ref.itemRenderer,
|
|
8304
|
+
getGraphQuery = _ref.getGraphQuery,
|
|
8305
|
+
resultProcessor = _ref.resultProcessor,
|
|
8306
|
+
requestInstance = _ref.requestInstance;
|
|
8577
8307
|
return /*#__PURE__*/React__default.createElement(LuxityGraphQLMultiselector, {
|
|
8578
8308
|
title: "Styles",
|
|
8579
8309
|
queryId: "getStyles",
|
|
@@ -8590,7 +8320,6 @@
|
|
|
8590
8320
|
requestInstance: requestInstance
|
|
8591
8321
|
});
|
|
8592
8322
|
};
|
|
8593
|
-
|
|
8594
8323
|
StyleSelector.defaultProps = {
|
|
8595
8324
|
itemRenderer: ItemRenderer,
|
|
8596
8325
|
resultProcessor: function resultProcessor(result) {
|
|
@@ -8605,117 +8334,82 @@
|
|
|
8605
8334
|
};
|
|
8606
8335
|
|
|
8607
8336
|
function _extends$2() {
|
|
8608
|
-
_extends$2 = Object.assign ? Object.assign.bind() : function (
|
|
8609
|
-
for (var
|
|
8610
|
-
var
|
|
8611
|
-
|
|
8612
|
-
for (var key in source) {
|
|
8613
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
8614
|
-
target[key] = source[key];
|
|
8615
|
-
}
|
|
8616
|
-
}
|
|
8337
|
+
return _extends$2 = Object.assign ? Object.assign.bind() : function (n) {
|
|
8338
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
8339
|
+
var t = arguments[e];
|
|
8340
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
8617
8341
|
}
|
|
8618
|
-
|
|
8619
|
-
|
|
8620
|
-
};
|
|
8621
|
-
return _extends$2.apply(this, arguments);
|
|
8342
|
+
return n;
|
|
8343
|
+
}, _extends$2.apply(null, arguments);
|
|
8622
8344
|
}
|
|
8623
8345
|
|
|
8624
|
-
function _assertThisInitialized$2(
|
|
8625
|
-
if (
|
|
8626
|
-
|
|
8627
|
-
}
|
|
8628
|
-
|
|
8629
|
-
return self;
|
|
8346
|
+
function _assertThisInitialized$2(e) {
|
|
8347
|
+
if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
8348
|
+
return e;
|
|
8630
8349
|
}
|
|
8631
8350
|
|
|
8632
|
-
function _setPrototypeOf$2(
|
|
8633
|
-
_setPrototypeOf$2 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function
|
|
8634
|
-
|
|
8635
|
-
|
|
8636
|
-
};
|
|
8637
|
-
return _setPrototypeOf$2(o, p);
|
|
8351
|
+
function _setPrototypeOf$2(t, e) {
|
|
8352
|
+
return _setPrototypeOf$2 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
|
|
8353
|
+
return t.__proto__ = e, t;
|
|
8354
|
+
}, _setPrototypeOf$2(t, e);
|
|
8638
8355
|
}
|
|
8639
8356
|
|
|
8640
|
-
function _inheritsLoose(
|
|
8641
|
-
|
|
8642
|
-
subClass.prototype.constructor = subClass;
|
|
8643
|
-
_setPrototypeOf$2(subClass, superClass);
|
|
8357
|
+
function _inheritsLoose(t, o) {
|
|
8358
|
+
t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf$2(t, o);
|
|
8644
8359
|
}
|
|
8645
8360
|
|
|
8646
|
-
function _getPrototypeOf$2(
|
|
8647
|
-
_getPrototypeOf$2 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function
|
|
8648
|
-
return
|
|
8649
|
-
};
|
|
8650
|
-
return _getPrototypeOf$2(o);
|
|
8361
|
+
function _getPrototypeOf$2(t) {
|
|
8362
|
+
return _getPrototypeOf$2 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
|
|
8363
|
+
return t.__proto__ || Object.getPrototypeOf(t);
|
|
8364
|
+
}, _getPrototypeOf$2(t);
|
|
8651
8365
|
}
|
|
8652
8366
|
|
|
8653
|
-
function _isNativeFunction(
|
|
8654
|
-
|
|
8367
|
+
function _isNativeFunction(t) {
|
|
8368
|
+
try {
|
|
8369
|
+
return -1 !== Function.toString.call(t).indexOf("[native code]");
|
|
8370
|
+
} catch (n) {
|
|
8371
|
+
return "function" == typeof t;
|
|
8372
|
+
}
|
|
8655
8373
|
}
|
|
8656
8374
|
|
|
8657
8375
|
function _isNativeReflectConstruct$1() {
|
|
8658
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
8659
|
-
if (Reflect.construct.sham) return false;
|
|
8660
|
-
if (typeof Proxy === "function") return true;
|
|
8661
|
-
|
|
8662
8376
|
try {
|
|
8663
|
-
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
8664
|
-
|
|
8665
|
-
|
|
8666
|
-
return
|
|
8667
|
-
}
|
|
8377
|
+
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
8378
|
+
} catch (t) {}
|
|
8379
|
+
return (_isNativeReflectConstruct$1 = function _isNativeReflectConstruct() {
|
|
8380
|
+
return !!t;
|
|
8381
|
+
})();
|
|
8668
8382
|
}
|
|
8669
8383
|
|
|
8670
|
-
function _construct(
|
|
8671
|
-
if (_isNativeReflectConstruct$1())
|
|
8672
|
-
|
|
8673
|
-
|
|
8674
|
-
|
|
8675
|
-
|
|
8676
|
-
a.push.apply(a, args);
|
|
8677
|
-
var Constructor = Function.bind.apply(Parent, a);
|
|
8678
|
-
var instance = new Constructor();
|
|
8679
|
-
if (Class) _setPrototypeOf$2(instance, Class.prototype);
|
|
8680
|
-
return instance;
|
|
8681
|
-
};
|
|
8682
|
-
}
|
|
8683
|
-
|
|
8684
|
-
return _construct.apply(null, arguments);
|
|
8384
|
+
function _construct(t, e, r) {
|
|
8385
|
+
if (_isNativeReflectConstruct$1()) return Reflect.construct.apply(null, arguments);
|
|
8386
|
+
var o = [null];
|
|
8387
|
+
o.push.apply(o, e);
|
|
8388
|
+
var p = new (t.bind.apply(t, o))();
|
|
8389
|
+
return r && _setPrototypeOf$2(p, r.prototype), p;
|
|
8685
8390
|
}
|
|
8686
8391
|
|
|
8687
|
-
function _wrapNativeSuper(
|
|
8688
|
-
var
|
|
8689
|
-
|
|
8690
|
-
|
|
8691
|
-
if (
|
|
8692
|
-
|
|
8693
|
-
|
|
8694
|
-
|
|
8695
|
-
}
|
|
8696
|
-
|
|
8697
|
-
if (typeof _cache !== "undefined") {
|
|
8698
|
-
if (_cache.has(Class)) return _cache.get(Class);
|
|
8699
|
-
|
|
8700
|
-
_cache.set(Class, Wrapper);
|
|
8392
|
+
function _wrapNativeSuper(t) {
|
|
8393
|
+
var r = "function" == typeof Map ? new Map() : void 0;
|
|
8394
|
+
return _wrapNativeSuper = function _wrapNativeSuper(t) {
|
|
8395
|
+
if (null === t || !_isNativeFunction(t)) return t;
|
|
8396
|
+
if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function");
|
|
8397
|
+
if (void 0 !== r) {
|
|
8398
|
+
if (r.has(t)) return r.get(t);
|
|
8399
|
+
r.set(t, Wrapper);
|
|
8701
8400
|
}
|
|
8702
|
-
|
|
8703
8401
|
function Wrapper() {
|
|
8704
|
-
return _construct(
|
|
8402
|
+
return _construct(t, arguments, _getPrototypeOf$2(this).constructor);
|
|
8705
8403
|
}
|
|
8706
|
-
|
|
8707
|
-
Wrapper.prototype = Object.create(Class.prototype, {
|
|
8404
|
+
return Wrapper.prototype = Object.create(t.prototype, {
|
|
8708
8405
|
constructor: {
|
|
8709
8406
|
value: Wrapper,
|
|
8710
|
-
enumerable:
|
|
8711
|
-
writable:
|
|
8712
|
-
configurable:
|
|
8407
|
+
enumerable: !1,
|
|
8408
|
+
writable: !0,
|
|
8409
|
+
configurable: !0
|
|
8713
8410
|
}
|
|
8714
|
-
});
|
|
8715
|
-
|
|
8716
|
-
};
|
|
8717
|
-
|
|
8718
|
-
return _wrapNativeSuper(Class);
|
|
8411
|
+
}), _setPrototypeOf$2(Wrapper, t);
|
|
8412
|
+
}, _wrapNativeSuper(t);
|
|
8719
8413
|
}
|
|
8720
8414
|
|
|
8721
8415
|
// based on https://github.com/styled-components/styled-components/blob/fcf6f3804c57a14dd7984dfab7bc06ee2edca044/src/utils/error.js
|
|
@@ -9384,10 +9078,9 @@
|
|
|
9384
9078
|
}, function (props) {
|
|
9385
9079
|
return getSliderMarkStyle(props);
|
|
9386
9080
|
});
|
|
9387
|
-
|
|
9388
9081
|
var getSliderMarkStyle = function getSliderMarkStyle(_ref) {
|
|
9389
9082
|
var showMarks = _ref.showMarks,
|
|
9390
|
-
|
|
9083
|
+
primary = _ref.theme.colors.primary;
|
|
9391
9084
|
var visiblityStyle = showMarks ? styled.css(_templateObject2$4 || (_templateObject2$4 = _taggedTemplateLiteral([""]))) : styled.css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n .rc-slider-mark-text,\n .rc-slider-dot {\n visibility: hidden;\n }\n "])));
|
|
9392
9085
|
return styled.css(_templateObject4 || (_templateObject4 = _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);
|
|
9393
9086
|
};
|
|
@@ -9399,28 +9092,24 @@
|
|
|
9399
9092
|
var Footer = styled__default.div(_templateObject$i || (_templateObject$i = _taggedTemplateLiteral(["\n display: flex;\n flex-flow: row nowrap;\n justify-content: flex-end;\n"])));
|
|
9400
9093
|
|
|
9401
9094
|
var _excluded$4 = ["dragging", "value", "offset", "index"],
|
|
9402
|
-
|
|
9403
|
-
|
|
9095
|
+
_excluded2 = ["renderTitleSection", "marks", "defaultMinValue", "defaultMaxValue", "min", "max", "toolTipComponent", "renderFooterSection", "onChange", "children", "identifier", "showMarks"];
|
|
9404
9096
|
var _templateObject$j;
|
|
9405
9097
|
var debounceBuilder$1 = functions.debounced(100);
|
|
9406
9098
|
var ChildrenWrapper = styled__default.div(_templateObject$j || (_templateObject$j = _taggedTemplateLiteral(["\n margin-bottom: ", ";\n"])), function (props) {
|
|
9407
9099
|
return props.theme.marginPaddings[3];
|
|
9408
9100
|
});
|
|
9409
|
-
|
|
9410
9101
|
var renderCustomHandle = function renderCustomHandle() {
|
|
9411
9102
|
var marks = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
9412
9103
|
var toolTipComponent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
9413
9104
|
var handleProps = arguments.length > 2 ? arguments[2] : undefined;
|
|
9414
|
-
|
|
9415
9105
|
var dragging = handleProps.dragging,
|
|
9416
|
-
|
|
9417
|
-
|
|
9418
|
-
|
|
9419
|
-
|
|
9420
|
-
|
|
9106
|
+
value = handleProps.value,
|
|
9107
|
+
offset = handleProps.offset,
|
|
9108
|
+
index = handleProps.index,
|
|
9109
|
+
restHandleProps = _objectWithoutProperties(handleProps, _excluded$4);
|
|
9421
9110
|
var getToolTipProps = function getToolTipProps() {
|
|
9422
|
-
var newProps = {};
|
|
9423
|
-
|
|
9111
|
+
var newProps = {};
|
|
9112
|
+
// Ensures that Tooltip component does not get ref prop
|
|
9424
9113
|
Object.keys(handleProps).forEach(function (propName) {
|
|
9425
9114
|
if (propName !== 'ref') {
|
|
9426
9115
|
newProps[propName] = handleProps[propName];
|
|
@@ -9428,7 +9117,6 @@
|
|
|
9428
9117
|
});
|
|
9429
9118
|
return newProps;
|
|
9430
9119
|
};
|
|
9431
|
-
|
|
9432
9120
|
var Tooltip = toolTipComponent;
|
|
9433
9121
|
return /*#__PURE__*/React__default.createElement(React.Fragment, {
|
|
9434
9122
|
key: index
|
|
@@ -9445,55 +9133,47 @@
|
|
|
9445
9133
|
marks: marks
|
|
9446
9134
|
}, getToolTipProps()))));
|
|
9447
9135
|
};
|
|
9448
|
-
/** slider ui component for react */
|
|
9449
|
-
|
|
9450
9136
|
|
|
9137
|
+
/** slider ui component for react */
|
|
9451
9138
|
var RangeSlider = function RangeSlider(_ref) {
|
|
9452
9139
|
var renderTitleSection = _ref.renderTitleSection,
|
|
9453
|
-
|
|
9454
|
-
|
|
9455
|
-
|
|
9456
|
-
|
|
9457
|
-
|
|
9458
|
-
|
|
9459
|
-
|
|
9460
|
-
|
|
9461
|
-
|
|
9462
|
-
|
|
9463
|
-
|
|
9464
|
-
|
|
9465
|
-
|
|
9140
|
+
marks = _ref.marks,
|
|
9141
|
+
defaultMinValue = _ref.defaultMinValue,
|
|
9142
|
+
defaultMaxValue = _ref.defaultMaxValue,
|
|
9143
|
+
min = _ref.min,
|
|
9144
|
+
max = _ref.max,
|
|
9145
|
+
toolTipComponent = _ref.toolTipComponent,
|
|
9146
|
+
renderFooterSection = _ref.renderFooterSection,
|
|
9147
|
+
onChange = _ref.onChange,
|
|
9148
|
+
childRenderer = _ref.children,
|
|
9149
|
+
identifier = _ref.identifier,
|
|
9150
|
+
showMarks = _ref.showMarks,
|
|
9151
|
+
restProps = _objectWithoutProperties(_ref, _excluded2);
|
|
9466
9152
|
var _useState = React.useState(defaultMinValue),
|
|
9467
|
-
|
|
9468
|
-
|
|
9469
|
-
|
|
9470
|
-
|
|
9153
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
9154
|
+
currMinVal = _useState2[0],
|
|
9155
|
+
setMinVal = _useState2[1];
|
|
9471
9156
|
var _useState3 = React.useState(defaultMaxValue),
|
|
9472
|
-
|
|
9473
|
-
|
|
9474
|
-
|
|
9157
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
9158
|
+
currMaxVal = _useState4[0],
|
|
9159
|
+
setMaxVal = _useState4[1];
|
|
9475
9160
|
/*
|
|
9476
9161
|
*Description variable stores the time that the component renders
|
|
9477
9162
|
* the state is used to enforce reenders for the component since the date now
|
|
9478
9163
|
* is always changing
|
|
9479
9164
|
* */
|
|
9480
|
-
|
|
9481
|
-
|
|
9482
9165
|
var _useState5 = React.useState(0),
|
|
9483
|
-
|
|
9484
|
-
|
|
9485
|
-
|
|
9486
|
-
|
|
9166
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
9167
|
+
seed = _useState6[0],
|
|
9168
|
+
setSeed = _useState6[1];
|
|
9487
9169
|
var manuallyChangeMinValue = function manuallyChangeMinValue(val) {
|
|
9488
9170
|
setMinVal(val);
|
|
9489
9171
|
setSeed(Date.now());
|
|
9490
9172
|
};
|
|
9491
|
-
|
|
9492
9173
|
var manuallyChangeMaxValue = function manuallyChangeMaxValue(val) {
|
|
9493
9174
|
setMaxVal(val);
|
|
9494
9175
|
setSeed(Date.now());
|
|
9495
9176
|
};
|
|
9496
|
-
|
|
9497
9177
|
var prevMinVal = functions.usePrevious(currMinVal);
|
|
9498
9178
|
var prevMaxVal = functions.usePrevious(currMaxVal);
|
|
9499
9179
|
React.useEffect(function () {
|
|
@@ -9529,9 +9209,8 @@
|
|
|
9529
9209
|
defaultValue: [defaultMinValue, defaultMaxValue],
|
|
9530
9210
|
onChange: function onChange(_ref2) {
|
|
9531
9211
|
var _ref3 = _slicedToArray(_ref2, 2),
|
|
9532
|
-
|
|
9533
|
-
|
|
9534
|
-
|
|
9212
|
+
nextMin = _ref3[0],
|
|
9213
|
+
nextMax = _ref3[1];
|
|
9535
9214
|
setMinVal(nextMin);
|
|
9536
9215
|
setMaxVal(nextMax);
|
|
9537
9216
|
},
|
|
@@ -9544,7 +9223,6 @@
|
|
|
9544
9223
|
allowCross: false
|
|
9545
9224
|
}, restProps)), /*#__PURE__*/React__default.createElement(Footer, null, renderFooterSection(actionsObj)));
|
|
9546
9225
|
};
|
|
9547
|
-
|
|
9548
9226
|
RangeSlider.defaultProps = {
|
|
9549
9227
|
renderTitleSection: function renderTitleSection() {
|
|
9550
9228
|
return false;
|
|
@@ -9566,7 +9244,6 @@
|
|
|
9566
9244
|
var shoe_sizes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
9567
9245
|
return shoe_sizes.length - 1;
|
|
9568
9246
|
};
|
|
9569
|
-
|
|
9570
9247
|
var formatResultsForRangeSlider = function formatResultsForRangeSlider() {
|
|
9571
9248
|
var shoe_sizes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
9572
9249
|
var newDataShape = {};
|
|
@@ -9576,28 +9253,24 @@
|
|
|
9576
9253
|
});
|
|
9577
9254
|
return newDataShape;
|
|
9578
9255
|
};
|
|
9579
|
-
|
|
9580
9256
|
var ToolTipComponent = function ToolTipComponent(props) {
|
|
9581
9257
|
var marks = props.marks,
|
|
9582
|
-
|
|
9258
|
+
value = props.value;
|
|
9583
9259
|
return /*#__PURE__*/React__default.createElement("div", null, marks[value]);
|
|
9584
9260
|
};
|
|
9585
|
-
/** slider ui component for shoe size selection interests */
|
|
9586
|
-
|
|
9587
9261
|
|
|
9262
|
+
/** slider ui component for shoe size selection interests */
|
|
9588
9263
|
var ShoeSizeSelector = function ShoeSizeSelector(_ref2) {
|
|
9589
9264
|
var onChange = _ref2.onChange,
|
|
9590
|
-
|
|
9591
|
-
|
|
9265
|
+
shoeSizes = _ref2.shoeSizes;
|
|
9592
9266
|
var handleShoeSizeChange = function handleShoeSizeChange(value) {
|
|
9593
9267
|
var min_shoe_key = value.min,
|
|
9594
|
-
|
|
9268
|
+
max_shoe_key = value.max;
|
|
9595
9269
|
onChange({
|
|
9596
9270
|
min_shoe_size_id: shoeSizes[min_shoe_key].id,
|
|
9597
9271
|
max_shoe_size_id: shoeSizes[max_shoe_key].id
|
|
9598
9272
|
});
|
|
9599
9273
|
};
|
|
9600
|
-
|
|
9601
9274
|
var getFooterButtons = function getFooterButtons(actionObj) {
|
|
9602
9275
|
var giveFullRange = actionObj.giveFullRange;
|
|
9603
9276
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(InvertedTextButton$1, {
|
|
@@ -9606,7 +9279,6 @@
|
|
|
9606
9279
|
onClick: giveFullRange
|
|
9607
9280
|
}, "Full Shoe Size Range"));
|
|
9608
9281
|
};
|
|
9609
|
-
|
|
9610
9282
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(RangeSlider$1, {
|
|
9611
9283
|
identifier: "shoe-size-range-slider",
|
|
9612
9284
|
marks: formatResultsForRangeSlider(shoeSizes),
|
|
@@ -9619,7 +9291,6 @@
|
|
|
9619
9291
|
onChange: handleShoeSizeChange
|
|
9620
9292
|
}));
|
|
9621
9293
|
};
|
|
9622
|
-
|
|
9623
9294
|
ShoeSizeSelector.defaultProps = {
|
|
9624
9295
|
onChange: function onChange() {
|
|
9625
9296
|
return false;
|
|
@@ -9668,7 +9339,6 @@
|
|
|
9668
9339
|
var inputMarginRight = '0.2em';
|
|
9669
9340
|
var CheckboxLabel = styled__default.label(_templateObject$s || (_templateObject$s = _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) {
|
|
9670
9341
|
var _props$theme;
|
|
9671
|
-
|
|
9672
9342
|
return (_props$theme = props.theme) !== null && _props$theme !== void 0 && _props$theme.fontSizes.length ? props.theme.fontSizes[4] : '1em';
|
|
9673
9343
|
}, function (props) {
|
|
9674
9344
|
return props.theme.fontSizes[4];
|
|
@@ -9692,16 +9362,14 @@
|
|
|
9692
9362
|
*/
|
|
9693
9363
|
var RadioButtons = function RadioButtons(_ref) {
|
|
9694
9364
|
var options = _ref.options,
|
|
9695
|
-
|
|
9696
|
-
|
|
9697
|
-
|
|
9698
|
-
|
|
9699
|
-
|
|
9365
|
+
name = _ref.name,
|
|
9366
|
+
noWrap = _ref.noWrap,
|
|
9367
|
+
title = _ref.title,
|
|
9368
|
+
errors = _ref.errors;
|
|
9700
9369
|
var _useState = React.useState(errors[name]),
|
|
9701
|
-
|
|
9702
|
-
|
|
9703
|
-
|
|
9704
|
-
|
|
9370
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
9371
|
+
errMsg = _useState2[0],
|
|
9372
|
+
setErrMsg = _useState2[1];
|
|
9705
9373
|
React.useEffect(function () {
|
|
9706
9374
|
setErrMsg(errors[name]);
|
|
9707
9375
|
}, [errors, name]);
|
|
@@ -9709,15 +9377,15 @@
|
|
|
9709
9377
|
noWrap: noWrap
|
|
9710
9378
|
}, options.map(function (_ref2, index) {
|
|
9711
9379
|
var _ref2$actionCallback = _ref2.actionCallback,
|
|
9712
|
-
|
|
9713
|
-
|
|
9714
|
-
|
|
9715
|
-
|
|
9716
|
-
|
|
9717
|
-
|
|
9718
|
-
|
|
9719
|
-
|
|
9720
|
-
|
|
9380
|
+
actionCallback = _ref2$actionCallback === void 0 ? function () {
|
|
9381
|
+
return null;
|
|
9382
|
+
} : _ref2$actionCallback,
|
|
9383
|
+
_ref2$value = _ref2.value,
|
|
9384
|
+
value = _ref2$value === void 0 ? '' : _ref2$value,
|
|
9385
|
+
_ref2$innerText = _ref2.innerText,
|
|
9386
|
+
innerText = _ref2$innerText === void 0 ? '' : _ref2$innerText,
|
|
9387
|
+
_ref2$checked = _ref2.checked,
|
|
9388
|
+
checked = _ref2$checked === void 0 ? false : _ref2$checked;
|
|
9721
9389
|
return /*#__PURE__*/React__default.createElement(RadioButtonLabel, {
|
|
9722
9390
|
key: "".concat(name, "-").concat(index),
|
|
9723
9391
|
htmlFor: "".concat(name, "_").concat(index)
|
|
@@ -9734,7 +9402,6 @@
|
|
|
9734
9402
|
}), /*#__PURE__*/React__default.createElement(RadioButtonCircle, null, /*#__PURE__*/React__default.createElement(RadioButtonCircleInner, null)), /*#__PURE__*/React__default.createElement(RadioButtonText, null, innerText));
|
|
9735
9403
|
}))), errMsg && /*#__PURE__*/React__default.createElement(ErrorMessage$1, null, errMsg));
|
|
9736
9404
|
};
|
|
9737
|
-
|
|
9738
9405
|
RadioButtons.defaultProps = {
|
|
9739
9406
|
noWrap: false,
|
|
9740
9407
|
title: '',
|
|
@@ -9766,17 +9433,14 @@
|
|
|
9766
9433
|
ShoeSizeFadeContainer.defaultProps = {
|
|
9767
9434
|
childVisible: false
|
|
9768
9435
|
};
|
|
9769
|
-
|
|
9770
9436
|
var OpacityTransitionRender = function OpacityTransitionRender(_ref) {
|
|
9771
9437
|
var shoeSizeType = _ref.shoeSizeType,
|
|
9772
|
-
|
|
9438
|
+
children = _ref.children;
|
|
9773
9439
|
var prevShoeSizeType = functions.usePrevious(shoeSizeType);
|
|
9774
|
-
|
|
9775
9440
|
var _React$useState = React__default.useState(false),
|
|
9776
|
-
|
|
9777
|
-
|
|
9778
|
-
|
|
9779
|
-
|
|
9441
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
9442
|
+
childVisible = _React$useState2[0],
|
|
9443
|
+
setChildVisible = _React$useState2[1];
|
|
9780
9444
|
React__default.useEffect(function () {
|
|
9781
9445
|
if (prevShoeSizeType !== shoeSizeType) {
|
|
9782
9446
|
setChildVisible(false);
|
|
@@ -9789,30 +9453,25 @@
|
|
|
9789
9453
|
childVisible: childVisible
|
|
9790
9454
|
}, children);
|
|
9791
9455
|
};
|
|
9792
|
-
|
|
9793
9456
|
var WrappedShoeSizeSelector = function WrappedShoeSizeSelector(_ref2) {
|
|
9794
9457
|
var onChange = _ref2.onChange,
|
|
9795
|
-
|
|
9796
|
-
|
|
9797
|
-
|
|
9798
|
-
|
|
9799
|
-
|
|
9458
|
+
requestInstance = _ref2.requestInstance,
|
|
9459
|
+
graphApi = _ref2.graphApi,
|
|
9460
|
+
defaultShoeSizeType = _ref2.defaultShoeSizeType,
|
|
9461
|
+
getGraphQuery = _ref2.getGraphQuery;
|
|
9800
9462
|
var _useState = React.useState(defaultShoeSizeType),
|
|
9801
|
-
|
|
9802
|
-
|
|
9803
|
-
|
|
9804
|
-
|
|
9463
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
9464
|
+
shoeSizeType = _useState2[0],
|
|
9465
|
+
setShoeSizeType = _useState2[1];
|
|
9805
9466
|
var _useState3 = React.useState(defaultShoeSizeType),
|
|
9806
|
-
|
|
9807
|
-
|
|
9808
|
-
|
|
9809
|
-
|
|
9467
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
9468
|
+
transitionedTo = _useState4[0],
|
|
9469
|
+
setTransitionedTo = _useState4[1];
|
|
9810
9470
|
var triggerRequest = function triggerRequest() {
|
|
9811
9471
|
return requestInstance.post(graphApi, {
|
|
9812
9472
|
query: getGraphQuery()
|
|
9813
9473
|
});
|
|
9814
9474
|
};
|
|
9815
|
-
|
|
9816
9475
|
var shoeSizeTypeProps = {
|
|
9817
9476
|
name: 'shoe_size_type',
|
|
9818
9477
|
noWrap: true,
|
|
@@ -9836,15 +9495,12 @@
|
|
|
9836
9495
|
checked: shoeSizeType === shoeSizeTypes.eu.value
|
|
9837
9496
|
}]
|
|
9838
9497
|
};
|
|
9839
|
-
|
|
9840
9498
|
var handlePropOnChange = function handlePropOnChange(value) {
|
|
9841
9499
|
var payload = _objectSpread2(_objectSpread2({}, value), {}, {
|
|
9842
9500
|
shoe_size_type: shoeSizeType
|
|
9843
9501
|
});
|
|
9844
|
-
|
|
9845
9502
|
onChange(payload);
|
|
9846
9503
|
};
|
|
9847
|
-
|
|
9848
9504
|
var renderShoeSizeSelector = function renderShoeSizeSelector() {
|
|
9849
9505
|
var passedShoeSizes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
9850
9506
|
return /*#__PURE__*/React__default.createElement(ShoeSizeSelector, {
|
|
@@ -9854,38 +9510,32 @@
|
|
|
9854
9510
|
}
|
|
9855
9511
|
});
|
|
9856
9512
|
};
|
|
9857
|
-
|
|
9858
9513
|
var getShoeSizeSelector = function getShoeSizeSelector() {
|
|
9859
9514
|
var euShoeSizes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
9860
9515
|
var ukShoeShoes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
9861
|
-
|
|
9862
9516
|
if (shoeSizeType === shoeSizeTypes.eu.value) {
|
|
9863
9517
|
return renderShoeSizeSelector(euShoeSizes);
|
|
9864
9518
|
}
|
|
9865
|
-
|
|
9866
9519
|
if (shoeSizeType === shoeSizeTypes.uk.value) {
|
|
9867
9520
|
return renderShoeSizeSelector(ukShoeShoes);
|
|
9868
9521
|
}
|
|
9869
|
-
|
|
9870
9522
|
return null;
|
|
9871
9523
|
};
|
|
9872
|
-
|
|
9873
9524
|
return /*#__PURE__*/React__default.createElement(LuxityPageReady, {
|
|
9874
9525
|
getRequestPromise: triggerRequest
|
|
9875
9526
|
}, /*#__PURE__*/React__default.createElement(TitleWrapper, null, /*#__PURE__*/React__default.createElement(InterestsSubheading, {
|
|
9876
9527
|
title: "Shoe Size Range"
|
|
9877
9528
|
}, /*#__PURE__*/React__default.createElement(RadioButtons$1, shoeSizeTypeProps))), /*#__PURE__*/React__default.createElement(LuxityPageReadyContext.Consumer, null, function (_ref3) {
|
|
9878
9529
|
var _ref3$data$data = _ref3.data.data,
|
|
9879
|
-
|
|
9880
|
-
|
|
9881
|
-
|
|
9882
|
-
|
|
9530
|
+
_ref3$data$data$luxit = _ref3$data$data.luxity_eu_shoe_sizes,
|
|
9531
|
+
luxity_eu_shoe_sizes = _ref3$data$data$luxit === void 0 ? [] : _ref3$data$data$luxit,
|
|
9532
|
+
_ref3$data$data$luxit2 = _ref3$data$data.luxity_uk_shoe_sizes,
|
|
9533
|
+
luxity_uk_shoe_sizes = _ref3$data$data$luxit2 === void 0 ? [] : _ref3$data$data$luxit2;
|
|
9883
9534
|
return /*#__PURE__*/React__default.createElement(OpacityTransitionRender, {
|
|
9884
9535
|
shoeSizeType: transitionedTo
|
|
9885
9536
|
}, getShoeSizeSelector(luxity_eu_shoe_sizes, luxity_uk_shoe_sizes));
|
|
9886
9537
|
}));
|
|
9887
9538
|
};
|
|
9888
|
-
|
|
9889
9539
|
WrappedShoeSizeSelector.defaultProps = {
|
|
9890
9540
|
onChange: function onChange() {
|
|
9891
9541
|
return false;
|
|
@@ -9897,31 +9547,28 @@
|
|
|
9897
9547
|
var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
9898
9548
|
return value.replace(/\D/g, '');
|
|
9899
9549
|
};
|
|
9550
|
+
|
|
9900
9551
|
/**
|
|
9901
9552
|
* Currency Input which formats the value to a specific format
|
|
9902
9553
|
*/
|
|
9903
|
-
|
|
9904
9554
|
var CurrencyInputFormatter = function CurrencyInputFormatter(_ref) {
|
|
9905
9555
|
var value = _ref.value,
|
|
9906
|
-
|
|
9907
|
-
|
|
9908
|
-
|
|
9909
|
-
|
|
9910
|
-
|
|
9911
|
-
|
|
9912
|
-
|
|
9556
|
+
onChange = _ref.onChange,
|
|
9557
|
+
prefix = _ref.prefix,
|
|
9558
|
+
allowNegativeValue = _ref.allowNegativeValue,
|
|
9559
|
+
groupSeparator = _ref.groupSeparator,
|
|
9560
|
+
decimalSeparator = _ref.decimalSeparator,
|
|
9561
|
+
rest = _objectWithoutProperties(_ref, _excluded$5);
|
|
9913
9562
|
var handleValueChange = function handleValueChange(event) {
|
|
9914
9563
|
var inputValue = event.target.value;
|
|
9915
9564
|
var unmaskedValue = unMask(inputValue);
|
|
9916
9565
|
onChange(unmaskedValue);
|
|
9917
9566
|
};
|
|
9918
|
-
|
|
9919
9567
|
var formatCurrency = function formatCurrency(originalValue) {
|
|
9920
9568
|
var numericValue = Number(originalValue);
|
|
9921
9569
|
var formattedValue = numericValue.toLocaleString('en-US');
|
|
9922
9570
|
return prefix + formattedValue;
|
|
9923
9571
|
};
|
|
9924
|
-
|
|
9925
9572
|
var formattedValue = formatCurrency(value);
|
|
9926
9573
|
return /*#__PURE__*/React__default.createElement("input", _extends({}, rest, {
|
|
9927
9574
|
type: "text",
|
|
@@ -9929,7 +9576,6 @@
|
|
|
9929
9576
|
onChange: handleValueChange
|
|
9930
9577
|
}));
|
|
9931
9578
|
};
|
|
9932
|
-
|
|
9933
9579
|
CurrencyInputFormatter.defaultProps = {
|
|
9934
9580
|
value: '',
|
|
9935
9581
|
prefix: 'R',
|
|
@@ -9940,7 +9586,6 @@
|
|
|
9940
9586
|
};
|
|
9941
9587
|
|
|
9942
9588
|
var _excluded$6 = ["children"];
|
|
9943
|
-
|
|
9944
9589
|
var _templateObject$u;
|
|
9945
9590
|
var Button$4 = styled__default.button(_templateObject$u || (_templateObject$u = _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) {
|
|
9946
9591
|
return props.theme.colors.ntrlMin;
|
|
@@ -9955,14 +9600,11 @@
|
|
|
9955
9600
|
}, disabledButtonStyle, function (props) {
|
|
9956
9601
|
return props.theme.colors.base;
|
|
9957
9602
|
});
|
|
9958
|
-
|
|
9959
9603
|
var SecondaryButton = function SecondaryButton(_ref) {
|
|
9960
9604
|
var children = _ref.children,
|
|
9961
|
-
|
|
9962
|
-
|
|
9605
|
+
restProps = _objectWithoutProperties(_ref, _excluded$6);
|
|
9963
9606
|
return /*#__PURE__*/React__default.createElement(Button$4, restProps, children);
|
|
9964
9607
|
};
|
|
9965
|
-
|
|
9966
9608
|
var SecondaryButton$1 = themed(SecondaryButton);
|
|
9967
9609
|
|
|
9968
9610
|
var _templateObject$v;
|
|
@@ -9971,31 +9613,23 @@
|
|
|
9971
9613
|
});
|
|
9972
9614
|
|
|
9973
9615
|
var debounceBuilder$2 = functions.debounced(50);
|
|
9974
|
-
|
|
9975
9616
|
var getMaxPrice = function getMaxPrice() {
|
|
9976
9617
|
var interestCategory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
9977
|
-
|
|
9978
9618
|
switch (interestCategory) {
|
|
9979
9619
|
case interestCategories.ACCESSORIES:
|
|
9980
9620
|
return interestCategoryMaxPrices.ACCESSORIES;
|
|
9981
|
-
|
|
9982
9621
|
case interestCategories.BAGS:
|
|
9983
9622
|
return interestCategoryMaxPrices.BAGS;
|
|
9984
|
-
|
|
9985
9623
|
case interestCategories.SHOES:
|
|
9986
9624
|
return interestCategoryMaxPrices.SHOES;
|
|
9987
|
-
|
|
9988
9625
|
case interestCategories.WATCHES:
|
|
9989
9626
|
return interestCategoryMaxPrices.WATCHES;
|
|
9990
|
-
|
|
9991
9627
|
case interestCategories.APPAREL:
|
|
9992
9628
|
return interestCategoryMaxPrices.APPAREL;
|
|
9993
|
-
|
|
9994
9629
|
default:
|
|
9995
9630
|
return 0;
|
|
9996
9631
|
}
|
|
9997
9632
|
};
|
|
9998
|
-
|
|
9999
9633
|
var getFooterButtons = function getFooterButtons(actionObj) {
|
|
10000
9634
|
var giveFullRange = actionObj.giveFullRange;
|
|
10001
9635
|
return /*#__PURE__*/React__default.createElement(SecondaryButton$1, {
|
|
@@ -10003,24 +9637,21 @@
|
|
|
10003
9637
|
onClick: giveFullRange
|
|
10004
9638
|
}, "Full Price Range");
|
|
10005
9639
|
};
|
|
9640
|
+
|
|
10006
9641
|
/** UI Slider with minimum and max input fields give the ability to
|
|
10007
9642
|
* select a price range */
|
|
10008
|
-
|
|
10009
|
-
|
|
10010
9643
|
var PriceRangeSelector = function PriceRangeSelector(_ref) {
|
|
10011
9644
|
var onChange = _ref.onChange,
|
|
10012
|
-
|
|
9645
|
+
category = _ref.category;
|
|
10013
9646
|
var maxPrice = getMaxPrice(category);
|
|
10014
|
-
|
|
10015
9647
|
var handleSlideChange = function handleSlideChange(value) {
|
|
10016
9648
|
var min_price = value.min,
|
|
10017
|
-
|
|
9649
|
+
max_price = value.max;
|
|
10018
9650
|
onChange({
|
|
10019
9651
|
min_price: min_price,
|
|
10020
9652
|
max_price: max_price
|
|
10021
9653
|
});
|
|
10022
9654
|
};
|
|
10023
|
-
|
|
10024
9655
|
var handleMinCurrencyChange = function handleMinCurrencyChange(targetValue, currMaxVal, manuallyChangeMinValue) {
|
|
10025
9656
|
var value = parseInt(unMask(targetValue), 10);
|
|
10026
9657
|
value = Number.isNaN(value) ? 0 : value;
|
|
@@ -10033,7 +9664,6 @@
|
|
|
10033
9664
|
});
|
|
10034
9665
|
});
|
|
10035
9666
|
};
|
|
10036
|
-
|
|
10037
9667
|
var handleMaxCurrencyChange = function handleMaxCurrencyChange(targetValue, currMinVal, manuallyChangeMaxValue) {
|
|
10038
9668
|
var value = parseInt(unMask(targetValue), 10);
|
|
10039
9669
|
value = Number.isNaN(value) ? 0 : value;
|
|
@@ -10046,7 +9676,6 @@
|
|
|
10046
9676
|
});
|
|
10047
9677
|
});
|
|
10048
9678
|
};
|
|
10049
|
-
|
|
10050
9679
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
10051
9680
|
className: "price-ranges"
|
|
10052
9681
|
}, /*#__PURE__*/React__default.createElement(RangeSlider$1, {
|
|
@@ -10065,9 +9694,9 @@
|
|
|
10065
9694
|
title: "Price Ranges"
|
|
10066
9695
|
}, function (_ref2) {
|
|
10067
9696
|
var manuallyChangeMinValue = _ref2.manuallyChangeMinValue,
|
|
10068
|
-
|
|
10069
|
-
|
|
10070
|
-
|
|
9697
|
+
manuallyChangeMaxValue = _ref2.manuallyChangeMaxValue,
|
|
9698
|
+
currMinVal = _ref2.currMinVal,
|
|
9699
|
+
currMaxVal = _ref2.currMaxVal;
|
|
10071
9700
|
return /*#__PURE__*/React__default.createElement(CurrencyInputWrapper, null, /*#__PURE__*/React__default.createElement(CurrencyInputFormatter, {
|
|
10072
9701
|
"data-qe-id": "masked-input-min",
|
|
10073
9702
|
value: currMinVal,
|
|
@@ -10083,7 +9712,6 @@
|
|
|
10083
9712
|
}));
|
|
10084
9713
|
}));
|
|
10085
9714
|
};
|
|
10086
|
-
|
|
10087
9715
|
PriceRangeSelector.defaultProps = {
|
|
10088
9716
|
onChange: function onChange() {
|
|
10089
9717
|
return false;
|
|
@@ -10107,7 +9735,6 @@
|
|
|
10107
9735
|
});
|
|
10108
9736
|
|
|
10109
9737
|
var _excluded$7 = ["title", "checked", "renderIcon", "onChange", "checkedValue", "unCheckedValue"];
|
|
10110
|
-
|
|
10111
9738
|
var _templateObject$x, _templateObject2$6, _templateObject3$1;
|
|
10112
9739
|
var Content = styled__default.div(_templateObject$x || (_templateObject$x = _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) {
|
|
10113
9740
|
return props.theme.colors.primary;
|
|
@@ -10126,36 +9753,32 @@
|
|
|
10126
9753
|
}, Content, InputText, function (props) {
|
|
10127
9754
|
return props.theme.colors.ntrlMin;
|
|
10128
9755
|
}, Content);
|
|
9756
|
+
|
|
10129
9757
|
/**
|
|
10130
9758
|
* CheckButton: Styled checkbox that resembles a button
|
|
10131
9759
|
* */
|
|
10132
|
-
|
|
10133
9760
|
var CheckButton = function CheckButton(props) {
|
|
10134
9761
|
var title = props.title,
|
|
10135
|
-
|
|
10136
|
-
|
|
10137
|
-
|
|
10138
|
-
|
|
10139
|
-
|
|
10140
|
-
|
|
10141
|
-
|
|
9762
|
+
checked = props.checked,
|
|
9763
|
+
renderIcon = props.renderIcon,
|
|
9764
|
+
onChange = props.onChange,
|
|
9765
|
+
checkedValue = props.checkedValue,
|
|
9766
|
+
unCheckedValue = props.unCheckedValue,
|
|
9767
|
+
restProps = _objectWithoutProperties(props, _excluded$7);
|
|
10142
9768
|
var _React$useState = React__default.useState(checked),
|
|
10143
|
-
|
|
10144
|
-
|
|
10145
|
-
|
|
10146
|
-
|
|
9769
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
9770
|
+
checkedState = _React$useState2[0],
|
|
9771
|
+
setCheck = _React$useState2[1];
|
|
10147
9772
|
var prevCheckState = functions.usePrevious(checkedState);
|
|
10148
9773
|
React__default.useEffect(function () {
|
|
10149
9774
|
if (prevCheckState !== checkedState) {
|
|
10150
9775
|
onChange(checkedState);
|
|
10151
9776
|
}
|
|
10152
9777
|
}, [checkedState, onChange, prevCheckState]);
|
|
10153
|
-
|
|
10154
9778
|
var handleInputChange = function handleInputChange(e) {
|
|
10155
9779
|
var targetChecked = e.target.checked;
|
|
10156
9780
|
setCheck(targetChecked);
|
|
10157
9781
|
};
|
|
10158
|
-
|
|
10159
9782
|
return /*#__PURE__*/React__default.createElement(StyledLabel, null, /*#__PURE__*/React__default.createElement("input", _extends({
|
|
10160
9783
|
defaultChecked: checked
|
|
10161
9784
|
}, restProps, {
|
|
@@ -10163,7 +9786,6 @@
|
|
|
10163
9786
|
onChange: handleInputChange
|
|
10164
9787
|
})), /*#__PURE__*/React__default.createElement(Content, null, /*#__PURE__*/React__default.createElement(InputText, null, title), renderIcon(checkedState)));
|
|
10165
9788
|
};
|
|
10166
|
-
|
|
10167
9789
|
CheckButton.defaultProps = {
|
|
10168
9790
|
title: '',
|
|
10169
9791
|
checked: false,
|
|
@@ -10177,29 +9799,24 @@
|
|
|
10177
9799
|
var CheckButton$1 = themed(CheckButton);
|
|
10178
9800
|
|
|
10179
9801
|
var MALE = genders.MALE,
|
|
10180
|
-
|
|
10181
|
-
|
|
9802
|
+
FEMALE = genders.FEMALE;
|
|
10182
9803
|
/**
|
|
10183
9804
|
* Stylized CheckboxButton for selecting gender
|
|
10184
9805
|
* */
|
|
10185
9806
|
var GenderCheckbox = function GenderCheckbox(_ref) {
|
|
10186
9807
|
var gender = _ref.gender,
|
|
10187
|
-
|
|
10188
|
-
|
|
10189
|
-
|
|
9808
|
+
checked = _ref.checked,
|
|
9809
|
+
onInputChange = _ref.onInputChange;
|
|
10190
9810
|
var getTitle = function getTitle() {
|
|
10191
9811
|
switch (gender) {
|
|
10192
9812
|
case MALE:
|
|
10193
9813
|
return 'Male';
|
|
10194
|
-
|
|
10195
9814
|
case FEMALE:
|
|
10196
9815
|
return 'Female';
|
|
10197
|
-
|
|
10198
9816
|
default:
|
|
10199
9817
|
return '';
|
|
10200
9818
|
}
|
|
10201
9819
|
};
|
|
10202
|
-
|
|
10203
9820
|
return /*#__PURE__*/React__default.createElement(CheckButton$1, {
|
|
10204
9821
|
onChange: onInputChange,
|
|
10205
9822
|
checked: checked,
|
|
@@ -10207,22 +9824,20 @@
|
|
|
10207
9824
|
title: getTitle()
|
|
10208
9825
|
});
|
|
10209
9826
|
};
|
|
10210
|
-
|
|
10211
9827
|
GenderCheckbox.defaultProps = {
|
|
10212
9828
|
name: ''
|
|
10213
9829
|
};
|
|
10214
9830
|
|
|
10215
9831
|
var MALE$1 = genders.MALE,
|
|
10216
|
-
|
|
10217
|
-
|
|
9832
|
+
FEMALE$1 = genders.FEMALE;
|
|
10218
9833
|
/**
|
|
10219
9834
|
* GenderSelector: specialized selector to pick genders for the Interest Component
|
|
10220
9835
|
* */
|
|
10221
9836
|
var GenderSelector = function GenderSelector(_ref) {
|
|
10222
9837
|
var gender = _ref.gender,
|
|
10223
|
-
|
|
10224
|
-
|
|
10225
|
-
|
|
9838
|
+
onChange = _ref.onChange,
|
|
9839
|
+
maleInputRef = _ref.maleInputRef,
|
|
9840
|
+
femaleInputRef = _ref.femaleInputRef;
|
|
10226
9841
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
10227
9842
|
className: "gender-selector"
|
|
10228
9843
|
}, /*#__PURE__*/React__default.createElement(InterestsSubheading, {
|
|
@@ -10247,7 +9862,6 @@
|
|
|
10247
9862
|
checkBoxButtonRef: femaleInputRef
|
|
10248
9863
|
})));
|
|
10249
9864
|
};
|
|
10250
|
-
|
|
10251
9865
|
GenderSelector.defaultProps = {
|
|
10252
9866
|
gender: null,
|
|
10253
9867
|
onChange: function onChange() {
|
|
@@ -10258,15 +9872,13 @@
|
|
|
10258
9872
|
|
|
10259
9873
|
var ConditionSelector = function ConditionSelector(_ref) {
|
|
10260
9874
|
var onChange = _ref.onChange,
|
|
10261
|
-
|
|
10262
|
-
|
|
10263
|
-
|
|
10264
|
-
|
|
10265
|
-
|
|
9875
|
+
graphApi = _ref.graphApi,
|
|
9876
|
+
itemRenderer = _ref.itemRenderer,
|
|
9877
|
+
getGraphQuery = _ref.getGraphQuery,
|
|
9878
|
+
requestInstance = _ref.requestInstance;
|
|
10266
9879
|
var resultProcessor = function resultProcessor(result) {
|
|
10267
9880
|
return result.data.data.conditions_list;
|
|
10268
9881
|
};
|
|
10269
|
-
|
|
10270
9882
|
return /*#__PURE__*/React__default.createElement(LuxityGraphQLMultiselector, {
|
|
10271
9883
|
title: "Condition",
|
|
10272
9884
|
queryId: "getCondition",
|
|
@@ -10283,7 +9895,6 @@
|
|
|
10283
9895
|
requestInstance: requestInstance
|
|
10284
9896
|
});
|
|
10285
9897
|
};
|
|
10286
|
-
|
|
10287
9898
|
ConditionSelector.defaultProps = {
|
|
10288
9899
|
itemRenderer: ItemRenderer
|
|
10289
9900
|
};
|
|
@@ -10322,41 +9933,30 @@
|
|
|
10322
9933
|
request: _objectSpread2({}, request),
|
|
10323
9934
|
isCategoriesShown: false
|
|
10324
9935
|
};
|
|
9936
|
+
|
|
10325
9937
|
/**
|
|
10326
9938
|
* Generates Interest UI and submits graph payloads as a highly specialised component
|
|
10327
9939
|
*/
|
|
10328
|
-
|
|
10329
9940
|
var AddInterest = /*#__PURE__*/function (_React$Component) {
|
|
10330
|
-
_inherits(AddInterest, _React$Component);
|
|
10331
|
-
|
|
10332
|
-
var _super = _createSuper(AddInterest);
|
|
10333
|
-
|
|
10334
9941
|
function AddInterest(props) {
|
|
10335
9942
|
var _this;
|
|
10336
|
-
|
|
10337
9943
|
_classCallCheck(this, AddInterest);
|
|
10338
|
-
|
|
10339
|
-
_this
|
|
10340
|
-
|
|
10341
|
-
_defineProperty(
|
|
10342
|
-
|
|
10343
|
-
_defineProperty(_assertThisInitialized(_this), "femaleCheckBoxRef", /*#__PURE__*/React__default.createRef());
|
|
10344
|
-
|
|
10345
|
-
_defineProperty(_assertThisInitialized(_this), "onCategoryChanged", function (categoryType) {
|
|
9944
|
+
_this = _callSuper(this, AddInterest, [props]);
|
|
9945
|
+
_defineProperty(_this, "maleCheckBoxRef", /*#__PURE__*/React__default.createRef());
|
|
9946
|
+
_defineProperty(_this, "femaleCheckBoxRef", /*#__PURE__*/React__default.createRef());
|
|
9947
|
+
_defineProperty(_this, "onCategoryChanged", function (categoryType) {
|
|
10346
9948
|
_this.setState({
|
|
10347
9949
|
category_type: categoryType,
|
|
10348
9950
|
brands: [],
|
|
10349
9951
|
styles: []
|
|
10350
9952
|
});
|
|
10351
9953
|
});
|
|
10352
|
-
|
|
10353
|
-
_defineProperty(_assertThisInitialized(_this), "onGenderChanged", function (isChecked, gender) {
|
|
9954
|
+
_defineProperty(_this, "onGenderChanged", function (isChecked, gender) {
|
|
10354
9955
|
return _this.setState(function (prevState) {
|
|
10355
9956
|
// current array of options
|
|
10356
9957
|
var gendersSelected = _toConsumableArray(prevState.gender);
|
|
10357
|
-
|
|
10358
|
-
|
|
10359
|
-
|
|
9958
|
+
var index;
|
|
9959
|
+
// check if the check box is checked or unchecked
|
|
10360
9960
|
if (isChecked) {
|
|
10361
9961
|
gendersSelected.push(gender);
|
|
10362
9962
|
} else {
|
|
@@ -10364,76 +9964,65 @@
|
|
|
10364
9964
|
index = gendersSelected.indexOf(gender);
|
|
10365
9965
|
gendersSelected.splice(index, 1);
|
|
10366
9966
|
}
|
|
10367
|
-
|
|
10368
9967
|
return {
|
|
10369
9968
|
gender: gendersSelected
|
|
10370
9969
|
};
|
|
10371
9970
|
});
|
|
10372
9971
|
});
|
|
10373
|
-
|
|
10374
|
-
_defineProperty(_assertThisInitialized(_this), "onBrandsChanged", function (brandsArray) {
|
|
9972
|
+
_defineProperty(_this, "onBrandsChanged", function (brandsArray) {
|
|
10375
9973
|
_this.setState({
|
|
10376
9974
|
brands: brandsArray.map(function (brand) {
|
|
10377
9975
|
return brand.id;
|
|
10378
9976
|
})
|
|
10379
9977
|
});
|
|
10380
9978
|
});
|
|
10381
|
-
|
|
10382
|
-
_defineProperty(_assertThisInitialized(_this), "onShoeSizesChanged", function (shoeSizes) {
|
|
9979
|
+
_defineProperty(_this, "onShoeSizesChanged", function (shoeSizes) {
|
|
10383
9980
|
_this.setState(_objectSpread2({}, shoeSizes));
|
|
10384
9981
|
});
|
|
10385
|
-
|
|
10386
|
-
_defineProperty(_assertThisInitialized(_this), "onPriceRangesChanged", function (priceRange) {
|
|
9982
|
+
_defineProperty(_this, "onPriceRangesChanged", function (priceRange) {
|
|
10387
9983
|
_this.setState(_objectSpread2({}, priceRange));
|
|
10388
9984
|
});
|
|
10389
|
-
|
|
10390
|
-
_defineProperty(_assertThisInitialized(_this), "onStylesChanged", function (stylesArray) {
|
|
9985
|
+
_defineProperty(_this, "onStylesChanged", function (stylesArray) {
|
|
10391
9986
|
_this.setState({
|
|
10392
9987
|
styles: stylesArray.map(function (style) {
|
|
10393
9988
|
return style.id;
|
|
10394
9989
|
})
|
|
10395
9990
|
});
|
|
10396
9991
|
});
|
|
10397
|
-
|
|
10398
|
-
_defineProperty(_assertThisInitialized(_this), "onConditionChanged", function (conditions) {
|
|
9992
|
+
_defineProperty(_this, "onConditionChanged", function (conditions) {
|
|
10399
9993
|
_this.setState({
|
|
10400
9994
|
condition: conditions.map(function (condition) {
|
|
10401
9995
|
return condition.id;
|
|
10402
9996
|
})
|
|
10403
9997
|
});
|
|
10404
9998
|
});
|
|
10405
|
-
|
|
10406
|
-
_defineProperty(_assertThisInitialized(_this), "payloadIsValid", function () {
|
|
9999
|
+
_defineProperty(_this, "payloadIsValid", function () {
|
|
10407
10000
|
// price/shoe-size always have initial values as soon as category is set
|
|
10408
10001
|
var category_type = _this.state.category_type;
|
|
10409
10002
|
return category_type !== null;
|
|
10410
10003
|
});
|
|
10411
|
-
|
|
10412
|
-
_defineProperty(_assertThisInitialized(_this), "submitInterest", function () {
|
|
10004
|
+
_defineProperty(_this, "submitInterest", function () {
|
|
10413
10005
|
_this.setState({
|
|
10414
10006
|
request: _objectSpread2(_objectSpread2({}, request), {}, {
|
|
10415
10007
|
fetching: true
|
|
10416
10008
|
})
|
|
10417
10009
|
});
|
|
10418
|
-
|
|
10419
10010
|
var _this$state = _this.state,
|
|
10420
|
-
|
|
10421
|
-
|
|
10422
|
-
|
|
10423
|
-
|
|
10424
|
-
|
|
10425
|
-
|
|
10426
|
-
|
|
10427
|
-
|
|
10428
|
-
|
|
10429
|
-
|
|
10430
|
-
|
|
10011
|
+
brands = _this$state.brands,
|
|
10012
|
+
min_shoe_size_id = _this$state.min_shoe_size_id,
|
|
10013
|
+
max_shoe_size_id = _this$state.max_shoe_size_id,
|
|
10014
|
+
shoe_size_type = _this$state.shoe_size_type,
|
|
10015
|
+
min_price = _this$state.min_price,
|
|
10016
|
+
max_price = _this$state.max_price,
|
|
10017
|
+
styles = _this$state.styles,
|
|
10018
|
+
category_type = _this$state.category_type,
|
|
10019
|
+
requestState = _this$state.request,
|
|
10020
|
+
gender = _this$state.gender,
|
|
10021
|
+
condition = _this$state.condition;
|
|
10431
10022
|
var payloadGender = gender[0];
|
|
10432
|
-
|
|
10433
10023
|
if (gender.length > 1 || !gender.length) {
|
|
10434
10024
|
payloadGender = UNISEX;
|
|
10435
10025
|
}
|
|
10436
|
-
|
|
10437
10026
|
var basePayload = {
|
|
10438
10027
|
category_type: category_type,
|
|
10439
10028
|
brands: brands,
|
|
@@ -10449,27 +10038,21 @@
|
|
|
10449
10038
|
max_shoe_size_id: max_shoe_size_id,
|
|
10450
10039
|
shoe_size_type: shoe_size_type
|
|
10451
10040
|
} : {};
|
|
10452
|
-
|
|
10453
10041
|
var payload = _objectSpread2(_objectSpread2({}, basePayload), shoeSizesPayload);
|
|
10454
|
-
|
|
10455
10042
|
simpleRequest(_this.props.requestInstance, _this.props.addInterestApi, method.POST, payload, function () {
|
|
10456
10043
|
_this.setState({
|
|
10457
10044
|
request: _objectSpread2(_objectSpread2({}, request), {}, {
|
|
10458
10045
|
success: true
|
|
10459
10046
|
})
|
|
10460
10047
|
});
|
|
10461
|
-
|
|
10462
10048
|
_this.props.onSubmitSuccess(_objectSpread2({}, payload));
|
|
10463
10049
|
}, _this.handleRequestError);
|
|
10464
10050
|
});
|
|
10465
|
-
|
|
10466
|
-
_defineProperty(_assertThisInitialized(_this), "handleRequestError", function (_ref) {
|
|
10051
|
+
_defineProperty(_this, "handleRequestError", function (_ref) {
|
|
10467
10052
|
var data = _ref.data;
|
|
10468
|
-
|
|
10469
10053
|
_this.setState({
|
|
10470
10054
|
request: _objectSpread2({}, request)
|
|
10471
10055
|
});
|
|
10472
|
-
|
|
10473
10056
|
var errorMessages = Object.keys(data).map(function (key) {
|
|
10474
10057
|
return data[key];
|
|
10475
10058
|
}).flat();
|
|
@@ -10479,37 +10062,32 @@
|
|
|
10479
10062
|
}, message);
|
|
10480
10063
|
}));
|
|
10481
10064
|
});
|
|
10482
|
-
|
|
10483
|
-
_defineProperty(_assertThisInitialized(_this), "resetState", function () {
|
|
10065
|
+
_defineProperty(_this, "resetState", function () {
|
|
10484
10066
|
_this.setState(_objectSpread2({}, defaultState));
|
|
10485
|
-
|
|
10486
10067
|
_this.props.onCancel();
|
|
10487
10068
|
});
|
|
10488
|
-
|
|
10489
|
-
_defineProperty(_assertThisInitialized(_this), "handleGenderChange", function (isChecked, gender) {
|
|
10069
|
+
_defineProperty(_this, "handleGenderChange", function (isChecked, gender) {
|
|
10490
10070
|
return _this.onGenderChanged(isChecked, gender);
|
|
10491
10071
|
});
|
|
10492
|
-
|
|
10493
|
-
_defineProperty(_assertThisInitialized(_this), "onAddInterestClick", function () {
|
|
10072
|
+
_defineProperty(_this, "onAddInterestClick", function () {
|
|
10494
10073
|
_this.setState(function (prevState) {
|
|
10495
10074
|
return _objectSpread2(_objectSpread2({}, prevState), {}, {
|
|
10496
10075
|
isCategoriesShown: true
|
|
10497
10076
|
});
|
|
10498
10077
|
});
|
|
10499
10078
|
});
|
|
10500
|
-
|
|
10501
|
-
_defineProperty(_assertThisInitialized(_this), "render", function () {
|
|
10079
|
+
_defineProperty(_this, "render", function () {
|
|
10502
10080
|
var _this$state2 = _this.state,
|
|
10503
|
-
|
|
10504
|
-
|
|
10081
|
+
category_type = _this$state2.category_type,
|
|
10082
|
+
fetching = _this$state2.request.fetching;
|
|
10505
10083
|
var _this$props = _this.props,
|
|
10506
|
-
|
|
10507
|
-
|
|
10508
|
-
|
|
10509
|
-
|
|
10510
|
-
|
|
10511
|
-
|
|
10512
|
-
|
|
10084
|
+
requestInstance = _this$props.requestInstance,
|
|
10085
|
+
baseGraphApi = _this$props.baseGraphApi,
|
|
10086
|
+
getBrandsGraphQuery = _this$props.getBrandsGraphQuery,
|
|
10087
|
+
getStylesGraphQuery = _this$props.getStylesGraphQuery,
|
|
10088
|
+
getShoesGraphQuery = _this$props.getShoesGraphQuery,
|
|
10089
|
+
defaultShoeSizeType = _this$props.defaultShoeSizeType,
|
|
10090
|
+
getConditionsGraphQuery = _this$props.getConditionsGraphQuery;
|
|
10513
10091
|
return /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
10514
10092
|
className: "interests__section-wrapper"
|
|
10515
10093
|
}, /*#__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, {
|
|
@@ -10560,23 +10138,19 @@
|
|
|
10560
10138
|
type: "button",
|
|
10561
10139
|
onClick: function onClick() {
|
|
10562
10140
|
_this.submitInterest();
|
|
10563
|
-
|
|
10564
10141
|
_this.resetState();
|
|
10565
10142
|
}
|
|
10566
10143
|
}, fetching ? 'SAVING' : 'SAVE'))))))));
|
|
10567
10144
|
});
|
|
10568
|
-
|
|
10569
10145
|
_this.state = _objectSpread2({}, defaultState);
|
|
10570
10146
|
return _this;
|
|
10571
10147
|
}
|
|
10572
|
-
|
|
10148
|
+
_inherits(AddInterest, _React$Component);
|
|
10573
10149
|
return _createClass(AddInterest);
|
|
10574
10150
|
}(React__default.Component);
|
|
10575
|
-
|
|
10576
10151
|
var AddInterest$1 = themed(AddInterest);
|
|
10577
10152
|
|
|
10578
|
-
|
|
10579
|
-
|
|
10153
|
+
// Register a locale for South African currency confiuguration
|
|
10580
10154
|
numeral.register('locale', 'en-ZA', {
|
|
10581
10155
|
delimiters: {
|
|
10582
10156
|
thousands: ',',
|
|
@@ -10597,12 +10171,12 @@
|
|
|
10597
10171
|
});
|
|
10598
10172
|
numeral.locale('en-ZA');
|
|
10599
10173
|
String.locale = numeral.locale;
|
|
10174
|
+
|
|
10600
10175
|
/**
|
|
10601
10176
|
* Curreny Formatter
|
|
10602
10177
|
* @param {number} number - the number to be formatted
|
|
10603
10178
|
* @param {boolean} round - flag to indicate if the number needs to be rounded off
|
|
10604
10179
|
*/
|
|
10605
|
-
|
|
10606
10180
|
function fC(number) {
|
|
10607
10181
|
var round = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
10608
10182
|
var parsedNumber = parseFloat(number);
|
|
@@ -10640,48 +10214,35 @@
|
|
|
10640
10214
|
|
|
10641
10215
|
var _templateObject$B, _templateObject2$8, _templateObject3$3, _templateObject4$1;
|
|
10642
10216
|
var MALE$2 = genders.MALE,
|
|
10643
|
-
|
|
10644
|
-
|
|
10645
|
-
|
|
10217
|
+
FEMALE$2 = genders.FEMALE,
|
|
10218
|
+
UNISEX$1 = genders.UNISEX;
|
|
10646
10219
|
var TrashIcon = function TrashIcon(_ref) {
|
|
10647
10220
|
var onClick = _ref.onClick,
|
|
10648
|
-
|
|
10221
|
+
id = _ref.id;
|
|
10649
10222
|
return /*#__PURE__*/React__default.createElement(IconWrapper, {
|
|
10650
10223
|
onClick: onClick,
|
|
10651
10224
|
id: id
|
|
10652
10225
|
}, /*#__PURE__*/React__default.createElement(SvgWrapper$1, null, /*#__PURE__*/React__default.createElement(Trash, null)));
|
|
10653
10226
|
};
|
|
10654
|
-
|
|
10655
10227
|
var InterestItem = /*#__PURE__*/function (_React$Component) {
|
|
10656
|
-
_inherits(InterestItem, _React$Component);
|
|
10657
|
-
|
|
10658
|
-
var _super = _createSuper(InterestItem);
|
|
10659
|
-
|
|
10660
10228
|
function InterestItem(props) {
|
|
10661
10229
|
var _this;
|
|
10662
|
-
|
|
10663
10230
|
_classCallCheck(this, InterestItem);
|
|
10664
|
-
|
|
10665
|
-
_this
|
|
10666
|
-
|
|
10667
|
-
_defineProperty(_assertThisInitialized(_this), "deleteInterestItem", function () {
|
|
10231
|
+
_this = _callSuper(this, InterestItem, [props]);
|
|
10232
|
+
_defineProperty(_this, "deleteInterestItem", function () {
|
|
10668
10233
|
var id = _this.props.data.id;
|
|
10669
|
-
|
|
10670
10234
|
_this.setState({
|
|
10671
10235
|
delete: _objectSpread2(_objectSpread2({}, request), {}, {
|
|
10672
10236
|
fetching: true
|
|
10673
10237
|
})
|
|
10674
10238
|
});
|
|
10675
|
-
|
|
10676
10239
|
var url = _this.props.deleteInterestApi(id);
|
|
10677
|
-
|
|
10678
10240
|
simpleRequest(_this.props.requestInstance, url, method.DELETE, null, function () {
|
|
10679
10241
|
_this.setState({
|
|
10680
10242
|
delete: _objectSpread2(_objectSpread2({}, request), {}, {
|
|
10681
10243
|
success: true
|
|
10682
10244
|
})
|
|
10683
10245
|
});
|
|
10684
|
-
|
|
10685
10246
|
_this.props.onDeleted(_this.props.data);
|
|
10686
10247
|
}, function () {
|
|
10687
10248
|
return _this.setState({
|
|
@@ -10689,32 +10250,25 @@
|
|
|
10689
10250
|
});
|
|
10690
10251
|
});
|
|
10691
10252
|
});
|
|
10692
|
-
|
|
10693
|
-
_defineProperty(_assertThisInitialized(_this), "getGender", function (gender) {
|
|
10253
|
+
_defineProperty(_this, "getGender", function (gender) {
|
|
10694
10254
|
switch (gender) {
|
|
10695
10255
|
case MALE$2:
|
|
10696
10256
|
return 'Male';
|
|
10697
|
-
|
|
10698
10257
|
case FEMALE$2:
|
|
10699
10258
|
return 'Female';
|
|
10700
|
-
|
|
10701
10259
|
case UNISEX$1:
|
|
10702
10260
|
default:
|
|
10703
10261
|
return 'Unisex';
|
|
10704
10262
|
}
|
|
10705
10263
|
});
|
|
10706
|
-
|
|
10707
|
-
_defineProperty(_assertThisInitialized(_this), "getCategory", function (category) {
|
|
10264
|
+
_defineProperty(_this, "getCategory", function (category) {
|
|
10708
10265
|
if (category === interestCategories.APPAREL) {
|
|
10709
10266
|
return 'CLOTHING';
|
|
10710
10267
|
}
|
|
10711
|
-
|
|
10712
10268
|
return category;
|
|
10713
10269
|
});
|
|
10714
|
-
|
|
10715
|
-
_defineProperty(_assertThisInitialized(_this), "render", function () {
|
|
10270
|
+
_defineProperty(_this, "render", function () {
|
|
10716
10271
|
var _data$min_shoe_size, _data$max_shoe_size;
|
|
10717
|
-
|
|
10718
10272
|
var data = _this.props.data;
|
|
10719
10273
|
var success = _this.state.delete.success;
|
|
10720
10274
|
return /*#__PURE__*/React__default.createElement(InterestItemContainer, {
|
|
@@ -10764,16 +10318,14 @@
|
|
|
10764
10318
|
}
|
|
10765
10319
|
}));
|
|
10766
10320
|
});
|
|
10767
|
-
|
|
10768
10321
|
_this.state = {
|
|
10769
10322
|
delete: _objectSpread2({}, request)
|
|
10770
10323
|
};
|
|
10771
10324
|
return _this;
|
|
10772
10325
|
}
|
|
10773
|
-
|
|
10326
|
+
_inherits(InterestItem, _React$Component);
|
|
10774
10327
|
return _createClass(InterestItem);
|
|
10775
10328
|
}(React__default.Component);
|
|
10776
|
-
|
|
10777
10329
|
var SheoSizeContentDiv = styled__default.div(_templateObject$B || (_templateObject$B = _taggedTemplateLiteral(["\n @media (max-width: ", ") {\n display: none;\n }\n"])), media.xs);
|
|
10778
10330
|
var InterestItemTitle = styled__default.div(_templateObject2$8 || (_templateObject2$8 = _taggedTemplateLiteral(["\n font-weight: bold;\n display: none;\n\n @media (max-width: ", ") {\n display: inline;\n }\n"])), media.xs);
|
|
10779
10331
|
var InterestItemContainer = styled__default.div(_templateObject3$3 || (_templateObject3$3 = _taggedTemplateLiteral(["\n display: flex;\n\n .no-shoe-size-section {\n @media (max-width: ", ") {\n display: none;\n }\n }\n"])), media.xs);
|
|
@@ -10789,11 +10341,11 @@
|
|
|
10789
10341
|
return props.theme.marginPaddings[0];
|
|
10790
10342
|
}, media.xs);
|
|
10791
10343
|
var ThemedInterestItem = themed(InterestItem);
|
|
10344
|
+
|
|
10792
10345
|
/**
|
|
10793
10346
|
* The Interest Item view shows the selected interest configuration,
|
|
10794
10347
|
* and gives user control to delete it.
|
|
10795
10348
|
*/
|
|
10796
|
-
|
|
10797
10349
|
var InterestItem$1 = (function (props) {
|
|
10798
10350
|
return /*#__PURE__*/React__default.createElement(ThemedInterestItem, props);
|
|
10799
10351
|
});
|
|
@@ -10806,7 +10358,6 @@
|
|
|
10806
10358
|
}, function (props) {
|
|
10807
10359
|
return props.theme.marginPaddings[1];
|
|
10808
10360
|
}, media.xs);
|
|
10809
|
-
|
|
10810
10361
|
var MyInterestTitleHeading = function MyInterestTitleHeading() {
|
|
10811
10362
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
10812
10363
|
className: "interests__title"
|
|
@@ -10828,7 +10379,6 @@
|
|
|
10828
10379
|
className: "heading-title-empty"
|
|
10829
10380
|
})));
|
|
10830
10381
|
};
|
|
10831
|
-
|
|
10832
10382
|
var MyInterestTitleHeading$1 = themed(MyInterestTitleHeading);
|
|
10833
10383
|
|
|
10834
10384
|
var _templateObject$D;
|
|
@@ -10837,7 +10387,6 @@
|
|
|
10837
10387
|
}, function (props) {
|
|
10838
10388
|
return props.theme.marginPaddings[1];
|
|
10839
10389
|
}, media.xs);
|
|
10840
|
-
|
|
10841
10390
|
var MyProductInterestTitleHeading = function MyProductInterestTitleHeading() {
|
|
10842
10391
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
10843
10392
|
className: "interests__title"
|
|
@@ -10853,7 +10402,6 @@
|
|
|
10853
10402
|
className: "heading-title-empty"
|
|
10854
10403
|
})));
|
|
10855
10404
|
};
|
|
10856
|
-
|
|
10857
10405
|
var MyProductInterestTitleHeading$1 = themed(MyProductInterestTitleHeading);
|
|
10858
10406
|
|
|
10859
10407
|
var Add = (function (props) {
|
|
@@ -10876,7 +10424,6 @@
|
|
|
10876
10424
|
|
|
10877
10425
|
function getToken() {
|
|
10878
10426
|
var _Cookies$get;
|
|
10879
|
-
|
|
10880
10427
|
return (_Cookies$get = Cookies.get('_tk')) === null || _Cookies$get === void 0 ? void 0 : _Cookies$get.replace('*', 'Bearer ');
|
|
10881
10428
|
}
|
|
10882
10429
|
function setToken(value) {
|
|
@@ -10884,35 +10431,29 @@
|
|
|
10884
10431
|
}
|
|
10885
10432
|
|
|
10886
10433
|
/** @format */
|
|
10887
|
-
|
|
10888
10434
|
function getEncodedSearch(currentUrl) {
|
|
10889
10435
|
var splitUrl = currentUrl.split('?');
|
|
10890
10436
|
var baseUrl = splitUrl[0];
|
|
10891
10437
|
var nextUrlSegments = splitUrl[1].split('&');
|
|
10892
10438
|
var nextQueryString = splitUrl[1];
|
|
10893
|
-
|
|
10894
10439
|
if (nextUrlSegments.length > 0) {
|
|
10895
10440
|
nextQueryString = nextUrlSegments.map(function (v) {
|
|
10896
10441
|
var nextValue = v;
|
|
10897
|
-
|
|
10898
10442
|
if (v.includes('search=')) {
|
|
10899
10443
|
var temp = v.split('=');
|
|
10900
10444
|
nextValue = "".concat(temp[0], "=").concat(encodeURIComponent(temp[1]));
|
|
10901
10445
|
}
|
|
10902
|
-
|
|
10903
10446
|
return nextValue;
|
|
10904
10447
|
}).join('&');
|
|
10905
10448
|
}
|
|
10906
|
-
|
|
10907
10449
|
return "".concat(baseUrl, "?").concat(nextQueryString);
|
|
10908
10450
|
}
|
|
10451
|
+
|
|
10909
10452
|
/**
|
|
10910
10453
|
* Gets an instance of Axios that is configured with the custom failure handlers
|
|
10911
10454
|
* @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]
|
|
10912
10455
|
* @param {Function} onForbidden - callback triggers when http status = 403
|
|
10913
10456
|
*/
|
|
10914
|
-
|
|
10915
|
-
|
|
10916
10457
|
var axiosInstance = function axiosInstance(onAuthFailed, onForbidden) {
|
|
10917
10458
|
var instance = axios.create({
|
|
10918
10459
|
validateStatus: function validateStatus(status) {
|
|
@@ -10920,60 +10461,56 @@
|
|
|
10920
10461
|
}
|
|
10921
10462
|
});
|
|
10922
10463
|
var token = getToken();
|
|
10923
|
-
|
|
10924
10464
|
if (token !== '') {
|
|
10925
10465
|
instance.defaults.headers.common.Authorization = token;
|
|
10926
10466
|
}
|
|
10467
|
+
instance.defaults.headers.common['Content-Type'] = 'application/json;charset=UTF-8';
|
|
10927
10468
|
|
|
10928
|
-
|
|
10929
|
-
|
|
10469
|
+
// Add a request interceptor
|
|
10930
10470
|
instance.interceptors.request.use(function (request, error) {
|
|
10931
10471
|
if (error) {
|
|
10932
10472
|
return Promise.reject(error.response);
|
|
10933
10473
|
}
|
|
10934
|
-
|
|
10935
10474
|
if (request.url.includes('search') && request.url.includes('?')) {
|
|
10936
10475
|
// do some uri manipulation for ie
|
|
10937
10476
|
// https://stackoverflow.com/questions/18220057
|
|
10477
|
+
|
|
10938
10478
|
// eslint-disable-next-line no-param-reassign
|
|
10939
10479
|
request.url = getEncodedSearch(request.url);
|
|
10940
|
-
}
|
|
10941
|
-
|
|
10480
|
+
}
|
|
10942
10481
|
|
|
10482
|
+
// eslint-disable-next-line no-param-reassign
|
|
10943
10483
|
request.headers.common['Content-Type'] = 'application/json; charset=utf-8';
|
|
10944
|
-
|
|
10945
10484
|
if (typeof request.body === 'undefined') {
|
|
10946
10485
|
request.body = {};
|
|
10947
10486
|
}
|
|
10948
|
-
|
|
10949
10487
|
token = getToken();
|
|
10950
|
-
|
|
10951
10488
|
if (token !== '') {
|
|
10952
10489
|
// eslint-disable-next-line no-param-reassign
|
|
10953
10490
|
request.headers.common.Authorization = token;
|
|
10954
10491
|
}
|
|
10955
|
-
|
|
10956
10492
|
return request;
|
|
10957
10493
|
}, function (error) {
|
|
10958
10494
|
return Promise.reject(error.message);
|
|
10959
|
-
});
|
|
10495
|
+
});
|
|
10960
10496
|
|
|
10497
|
+
// Add a response interceptor
|
|
10961
10498
|
instance.interceptors.response.use(function (response, error) {
|
|
10962
10499
|
if (error) {
|
|
10963
10500
|
return Promise.reject(error.response);
|
|
10964
10501
|
}
|
|
10965
|
-
|
|
10966
10502
|
if (response.headers.authorization) {
|
|
10967
10503
|
setToken(response.headers.authorization);
|
|
10968
10504
|
}
|
|
10969
|
-
|
|
10970
10505
|
return response;
|
|
10971
10506
|
}, function (error) {
|
|
10972
10507
|
if (error.response) {
|
|
10973
10508
|
// network error
|
|
10974
10509
|
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) {
|
|
10975
10510
|
onAuthFailed();
|
|
10976
|
-
}
|
|
10511
|
+
}
|
|
10512
|
+
|
|
10513
|
+
// if (error.response.status === 500) {
|
|
10977
10514
|
// // INTERNAL SERVER ERROR
|
|
10978
10515
|
// store.dispatch({
|
|
10979
10516
|
// type: AppConstants.OVERLAY.SERVER_ERROR,
|
|
@@ -10981,39 +10518,34 @@
|
|
|
10981
10518
|
// return Promise.reject(error.response);
|
|
10982
10519
|
// }
|
|
10983
10520
|
|
|
10984
|
-
|
|
10985
10521
|
if (error.response.status === 403) {
|
|
10986
10522
|
// FORBIDDEN
|
|
10987
10523
|
onForbidden();
|
|
10988
10524
|
}
|
|
10989
|
-
|
|
10990
10525
|
return Promise.reject(error.response);
|
|
10991
10526
|
}
|
|
10992
|
-
|
|
10993
10527
|
return Promise.reject(error);
|
|
10994
10528
|
});
|
|
10995
10529
|
return instance;
|
|
10996
|
-
};
|
|
10530
|
+
};
|
|
10997
10531
|
|
|
10998
10532
|
var _excluded$8 = ["children"];
|
|
10999
|
-
|
|
11000
10533
|
var DropdownSelector = function DropdownSelector(_ref) {
|
|
11001
10534
|
var selectedOption = _ref.selectedOption,
|
|
11002
|
-
|
|
11003
|
-
|
|
11004
|
-
|
|
11005
|
-
|
|
11006
|
-
|
|
11007
|
-
|
|
11008
|
-
|
|
10535
|
+
onOptionChange = _ref.onOptionChange,
|
|
10536
|
+
options = _ref.options,
|
|
10537
|
+
isSearchable = _ref.isSearchable,
|
|
10538
|
+
placeholder = _ref.placeholder,
|
|
10539
|
+
name = _ref.name,
|
|
10540
|
+
showSearchIcon = _ref.showSearchIcon,
|
|
10541
|
+
isDisabled = _ref.isDisabled;
|
|
11009
10542
|
var customComponents = {
|
|
11010
10543
|
DropdownIndicator: function DropdownIndicator() {
|
|
11011
10544
|
return null;
|
|
11012
10545
|
},
|
|
11013
10546
|
ValueContainer: function ValueContainer(_ref2) {
|
|
11014
10547
|
var children = _ref2.children,
|
|
11015
|
-
|
|
11016
|
-
|
|
10548
|
+
props = _objectWithoutProperties(_ref2, _excluded$8);
|
|
11017
10549
|
return /*#__PURE__*/React__default.createElement("div", _extends({
|
|
11018
10550
|
style: {
|
|
11019
10551
|
position: 'relative'
|
|
@@ -11141,7 +10673,6 @@
|
|
|
11141
10673
|
isDisabled: isDisabled
|
|
11142
10674
|
}));
|
|
11143
10675
|
};
|
|
11144
|
-
|
|
11145
10676
|
DropdownSelector.defaultProps = {
|
|
11146
10677
|
isSearchable: false,
|
|
11147
10678
|
selectedOption: null,
|
|
@@ -11166,178 +10697,144 @@
|
|
|
11166
10697
|
}, function (props) {
|
|
11167
10698
|
return props.theme.marginPaddings[1];
|
|
11168
10699
|
});
|
|
11169
|
-
|
|
11170
10700
|
var AddProductInterest = function AddProductInterest(_ref) {
|
|
11171
10701
|
var baseGraphApi = _ref.baseGraphApi,
|
|
11172
|
-
|
|
11173
|
-
|
|
11174
|
-
|
|
11175
|
-
|
|
11176
|
-
|
|
11177
|
-
|
|
11178
|
-
|
|
11179
|
-
|
|
10702
|
+
getBrandsGraphQuery = _ref.getBrandsGraphQuery,
|
|
10703
|
+
getModelsGraphQuery = _ref.getModelsGraphQuery,
|
|
10704
|
+
getMaterialsGraphQuery = _ref.getMaterialsGraphQuery,
|
|
10705
|
+
onCancel = _ref.onCancel,
|
|
10706
|
+
requestInstance = _ref.requestInstance,
|
|
10707
|
+
addLuxityProductInterestApi = _ref.addLuxityProductInterestApi,
|
|
10708
|
+
onSubmitSuccess = _ref.onSubmitSuccess;
|
|
11180
10709
|
var _useState = React.useState([]),
|
|
11181
|
-
|
|
11182
|
-
|
|
11183
|
-
|
|
11184
|
-
|
|
10710
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
10711
|
+
brands = _useState2[0],
|
|
10712
|
+
setBrands = _useState2[1];
|
|
11185
10713
|
var _useState3 = React.useState([]),
|
|
11186
|
-
|
|
11187
|
-
|
|
11188
|
-
|
|
11189
|
-
|
|
10714
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
10715
|
+
models = _useState4[0],
|
|
10716
|
+
setModels = _useState4[1];
|
|
11190
10717
|
var _useState5 = React.useState([]),
|
|
11191
|
-
|
|
11192
|
-
|
|
11193
|
-
|
|
11194
|
-
|
|
10718
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
10719
|
+
materials = _useState6[0],
|
|
10720
|
+
setMaterials = _useState6[1];
|
|
11195
10721
|
var _useState7 = React.useState(null),
|
|
11196
|
-
|
|
11197
|
-
|
|
11198
|
-
|
|
11199
|
-
|
|
10722
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
10723
|
+
selectedBrand = _useState8[0],
|
|
10724
|
+
setSelectedBrand = _useState8[1];
|
|
11200
10725
|
var _useState9 = React.useState(null),
|
|
11201
|
-
|
|
11202
|
-
|
|
11203
|
-
|
|
11204
|
-
|
|
10726
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
10727
|
+
selectedModel = _useState10[0],
|
|
10728
|
+
setSelectedModel = _useState10[1];
|
|
11205
10729
|
var _useState11 = React.useState(null),
|
|
11206
|
-
|
|
11207
|
-
|
|
11208
|
-
|
|
11209
|
-
|
|
11210
|
-
var fetchBrands = React.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
10730
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
10731
|
+
selectedMaterial = _useState12[0],
|
|
10732
|
+
setSelectedMaterial = _useState12[1];
|
|
10733
|
+
var fetchBrands = React.useCallback(/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
11211
10734
|
var _response$data, _response$data$data, _response$data$data$l, response, formattedBrands;
|
|
11212
|
-
|
|
11213
10735
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
11214
|
-
while (1) {
|
|
11215
|
-
|
|
10736
|
+
while (1) switch (_context.prev = _context.next) {
|
|
10737
|
+
case 0:
|
|
10738
|
+
_context.prev = 0;
|
|
10739
|
+
_context.next = 3;
|
|
10740
|
+
return axiosInstance.post("".concat(baseGraphApi, "?id=getBrands"), {
|
|
10741
|
+
query: getBrandsGraphQuery(1000, 1, 'id|desc')
|
|
10742
|
+
});
|
|
10743
|
+
case 3:
|
|
10744
|
+
response = _context.sent;
|
|
10745
|
+
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) {
|
|
10746
|
+
formattedBrands = response.data.data.luxity_brands.data.map(function (brand) {
|
|
10747
|
+
return {
|
|
10748
|
+
value: brand.id,
|
|
10749
|
+
label: brand.name
|
|
10750
|
+
};
|
|
10751
|
+
});
|
|
10752
|
+
setBrands(formattedBrands);
|
|
10753
|
+
}
|
|
10754
|
+
_context.next = 10;
|
|
10755
|
+
break;
|
|
10756
|
+
case 7:
|
|
10757
|
+
_context.prev = 7;
|
|
10758
|
+
_context.t0 = _context["catch"](0);
|
|
10759
|
+
error(_context.t0.message);
|
|
10760
|
+
case 10:
|
|
10761
|
+
case "end":
|
|
10762
|
+
return _context.stop();
|
|
10763
|
+
}
|
|
10764
|
+
}, _callee, null, [[0, 7]]);
|
|
10765
|
+
})), [baseGraphApi, getBrandsGraphQuery]);
|
|
10766
|
+
var fetchModels = React.useCallback(/*#__PURE__*/function () {
|
|
10767
|
+
var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(brandId) {
|
|
10768
|
+
var _response$data2, _response$data2$data, _response$data2$data$, response, formattedModels;
|
|
10769
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
10770
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
11216
10771
|
case 0:
|
|
11217
|
-
|
|
11218
|
-
|
|
11219
|
-
return axiosInstance.post("".concat(baseGraphApi, "?id=
|
|
11220
|
-
query:
|
|
10772
|
+
_context2.prev = 0;
|
|
10773
|
+
_context2.next = 3;
|
|
10774
|
+
return axiosInstance.post("".concat(baseGraphApi, "?id=getModels"), {
|
|
10775
|
+
query: getModelsGraphQuery(brandId)
|
|
11221
10776
|
});
|
|
11222
|
-
|
|
11223
10777
|
case 3:
|
|
11224
|
-
response =
|
|
11225
|
-
|
|
11226
|
-
|
|
11227
|
-
formattedBrands = response.data.data.luxity_brands.data.map(function (brand) {
|
|
10778
|
+
response = _context2.sent;
|
|
10779
|
+
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) {
|
|
10780
|
+
formattedModels = response.data.data.luxity_models.data.map(function (model) {
|
|
11228
10781
|
return {
|
|
11229
|
-
value:
|
|
11230
|
-
label:
|
|
10782
|
+
value: model.id,
|
|
10783
|
+
label: model.name
|
|
11231
10784
|
};
|
|
11232
10785
|
});
|
|
11233
|
-
|
|
10786
|
+
setModels(formattedModels);
|
|
11234
10787
|
}
|
|
11235
|
-
|
|
11236
|
-
_context.next = 10;
|
|
10788
|
+
_context2.next = 10;
|
|
11237
10789
|
break;
|
|
11238
|
-
|
|
11239
10790
|
case 7:
|
|
11240
|
-
|
|
11241
|
-
|
|
11242
|
-
error(
|
|
11243
|
-
|
|
10791
|
+
_context2.prev = 7;
|
|
10792
|
+
_context2.t0 = _context2["catch"](0);
|
|
10793
|
+
error(_context2.t0.message);
|
|
11244
10794
|
case 10:
|
|
11245
10795
|
case "end":
|
|
11246
|
-
return
|
|
11247
|
-
}
|
|
11248
|
-
}
|
|
11249
|
-
}, _callee, null, [[0, 7]]);
|
|
11250
|
-
})), [baseGraphApi, getBrandsGraphQuery]);
|
|
11251
|
-
var fetchModels = React.useCallback( /*#__PURE__*/function () {
|
|
11252
|
-
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(brandId) {
|
|
11253
|
-
var _response$data2, _response$data2$data, _response$data2$data$, response, formattedModels;
|
|
11254
|
-
|
|
11255
|
-
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
11256
|
-
while (1) {
|
|
11257
|
-
switch (_context2.prev = _context2.next) {
|
|
11258
|
-
case 0:
|
|
11259
|
-
_context2.prev = 0;
|
|
11260
|
-
_context2.next = 3;
|
|
11261
|
-
return axiosInstance.post("".concat(baseGraphApi, "?id=getModels"), {
|
|
11262
|
-
query: getModelsGraphQuery(brandId)
|
|
11263
|
-
});
|
|
11264
|
-
|
|
11265
|
-
case 3:
|
|
11266
|
-
response = _context2.sent;
|
|
11267
|
-
|
|
11268
|
-
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) {
|
|
11269
|
-
formattedModels = response.data.data.luxity_models.data.map(function (model) {
|
|
11270
|
-
return {
|
|
11271
|
-
value: model.id,
|
|
11272
|
-
label: model.name
|
|
11273
|
-
};
|
|
11274
|
-
});
|
|
11275
|
-
setModels(formattedModels);
|
|
11276
|
-
}
|
|
11277
|
-
|
|
11278
|
-
_context2.next = 10;
|
|
11279
|
-
break;
|
|
11280
|
-
|
|
11281
|
-
case 7:
|
|
11282
|
-
_context2.prev = 7;
|
|
11283
|
-
_context2.t0 = _context2["catch"](0);
|
|
11284
|
-
error(_context2.t0.message);
|
|
11285
|
-
|
|
11286
|
-
case 10:
|
|
11287
|
-
case "end":
|
|
11288
|
-
return _context2.stop();
|
|
11289
|
-
}
|
|
10796
|
+
return _context2.stop();
|
|
11290
10797
|
}
|
|
11291
10798
|
}, _callee2, null, [[0, 7]]);
|
|
11292
10799
|
}));
|
|
11293
|
-
|
|
11294
10800
|
return function (_x) {
|
|
11295
10801
|
return _ref3.apply(this, arguments);
|
|
11296
10802
|
};
|
|
11297
10803
|
}(), [baseGraphApi, getModelsGraphQuery]);
|
|
11298
|
-
var fetchMaterials = React.useCallback(
|
|
11299
|
-
var _ref4 = _asyncToGenerator(
|
|
10804
|
+
var fetchMaterials = React.useCallback(/*#__PURE__*/function () {
|
|
10805
|
+
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(brandId) {
|
|
11300
10806
|
var _response$data3, _response$data3$data, _response$data3$data$, response, formattedMaterials;
|
|
11301
|
-
|
|
11302
10807
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
11303
|
-
while (1) {
|
|
11304
|
-
|
|
11305
|
-
|
|
11306
|
-
|
|
11307
|
-
|
|
11308
|
-
|
|
11309
|
-
|
|
10808
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
10809
|
+
case 0:
|
|
10810
|
+
_context3.prev = 0;
|
|
10811
|
+
_context3.next = 3;
|
|
10812
|
+
return axiosInstance.post("".concat(baseGraphApi, "?id=getMaterials"), {
|
|
10813
|
+
query: getMaterialsGraphQuery(brandId)
|
|
10814
|
+
});
|
|
10815
|
+
case 3:
|
|
10816
|
+
response = _context3.sent;
|
|
10817
|
+
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) {
|
|
10818
|
+
formattedMaterials = response.data.data.luxity_materials.data.map(function (material) {
|
|
10819
|
+
return {
|
|
10820
|
+
value: material.id,
|
|
10821
|
+
label: material.name
|
|
10822
|
+
};
|
|
11310
10823
|
});
|
|
11311
|
-
|
|
11312
|
-
|
|
11313
|
-
|
|
11314
|
-
|
|
11315
|
-
|
|
11316
|
-
|
|
11317
|
-
|
|
11318
|
-
|
|
11319
|
-
|
|
11320
|
-
|
|
11321
|
-
|
|
11322
|
-
setMaterials(formattedMaterials);
|
|
11323
|
-
}
|
|
11324
|
-
|
|
11325
|
-
_context3.next = 10;
|
|
11326
|
-
break;
|
|
11327
|
-
|
|
11328
|
-
case 7:
|
|
11329
|
-
_context3.prev = 7;
|
|
11330
|
-
_context3.t0 = _context3["catch"](0);
|
|
11331
|
-
error(_context3.t0.message);
|
|
11332
|
-
|
|
11333
|
-
case 10:
|
|
11334
|
-
case "end":
|
|
11335
|
-
return _context3.stop();
|
|
11336
|
-
}
|
|
10824
|
+
setMaterials(formattedMaterials);
|
|
10825
|
+
}
|
|
10826
|
+
_context3.next = 10;
|
|
10827
|
+
break;
|
|
10828
|
+
case 7:
|
|
10829
|
+
_context3.prev = 7;
|
|
10830
|
+
_context3.t0 = _context3["catch"](0);
|
|
10831
|
+
error(_context3.t0.message);
|
|
10832
|
+
case 10:
|
|
10833
|
+
case "end":
|
|
10834
|
+
return _context3.stop();
|
|
11337
10835
|
}
|
|
11338
10836
|
}, _callee3, null, [[0, 7]]);
|
|
11339
10837
|
}));
|
|
11340
|
-
|
|
11341
10838
|
return function (_x2) {
|
|
11342
10839
|
return _ref4.apply(this, arguments);
|
|
11343
10840
|
};
|
|
@@ -11358,19 +10855,15 @@
|
|
|
11358
10855
|
setSelectedMaterial(null);
|
|
11359
10856
|
}
|
|
11360
10857
|
}, [selectedBrand, fetchModels, fetchMaterials]);
|
|
11361
|
-
|
|
11362
10858
|
var onBrandChange = function onBrandChange(selectedOption) {
|
|
11363
10859
|
setSelectedBrand(selectedOption);
|
|
11364
10860
|
};
|
|
11365
|
-
|
|
11366
10861
|
var onModelChange = function onModelChange(selectedOption) {
|
|
11367
10862
|
setSelectedModel(selectedOption);
|
|
11368
10863
|
};
|
|
11369
|
-
|
|
11370
10864
|
var onMaterialChange = function onMaterialChange(selectedOption) {
|
|
11371
10865
|
setSelectedMaterial(selectedOption);
|
|
11372
10866
|
};
|
|
11373
|
-
|
|
11374
10867
|
var submitInterest = function submitInterest() {
|
|
11375
10868
|
var payload = {
|
|
11376
10869
|
luxity_brand_id: selectedBrand === null || selectedBrand === void 0 ? void 0 : selectedBrand.value,
|
|
@@ -11382,7 +10875,6 @@
|
|
|
11382
10875
|
onCancel();
|
|
11383
10876
|
}, handleRequestError);
|
|
11384
10877
|
};
|
|
11385
|
-
|
|
11386
10878
|
var handleRequestError = function handleRequestError(_ref5) {
|
|
11387
10879
|
var data = _ref5.data;
|
|
11388
10880
|
var errorMessages = Object.keys(data).map(function (key) {
|
|
@@ -11394,7 +10886,6 @@
|
|
|
11394
10886
|
}, message);
|
|
11395
10887
|
}));
|
|
11396
10888
|
};
|
|
11397
|
-
|
|
11398
10889
|
var onReset = function onReset() {
|
|
11399
10890
|
onCancel();
|
|
11400
10891
|
setSelectedModel(null);
|
|
@@ -11404,7 +10895,6 @@
|
|
|
11404
10895
|
setMaterials([]);
|
|
11405
10896
|
setModels([]);
|
|
11406
10897
|
};
|
|
11407
|
-
|
|
11408
10898
|
return /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
11409
10899
|
className: "interests__section-wrapper"
|
|
11410
10900
|
}, /*#__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", {
|
|
@@ -11452,50 +10942,36 @@
|
|
|
11452
10942
|
onClick: submitInterest
|
|
11453
10943
|
}, "SAVE"))))))));
|
|
11454
10944
|
};
|
|
11455
|
-
|
|
11456
10945
|
var AddProductInterest$1 = themed(AddProductInterest);
|
|
11457
10946
|
|
|
11458
10947
|
var _templateObject$F, _templateObject2$a, _templateObject3$4;
|
|
11459
|
-
|
|
11460
10948
|
var TrashIcon$1 = function TrashIcon(_ref) {
|
|
11461
10949
|
var onClick = _ref.onClick,
|
|
11462
|
-
|
|
10950
|
+
id = _ref.id;
|
|
11463
10951
|
return /*#__PURE__*/React__default.createElement(IconWrapper, {
|
|
11464
10952
|
onClick: onClick,
|
|
11465
10953
|
id: id
|
|
11466
10954
|
}, /*#__PURE__*/React__default.createElement(SvgWrapper$1, null, /*#__PURE__*/React__default.createElement(Trash, null)));
|
|
11467
10955
|
};
|
|
11468
|
-
|
|
11469
10956
|
var LuxityProductInterestItem = /*#__PURE__*/function (_React$Component) {
|
|
11470
|
-
_inherits(LuxityProductInterestItem, _React$Component);
|
|
11471
|
-
|
|
11472
|
-
var _super = _createSuper(LuxityProductInterestItem);
|
|
11473
|
-
|
|
11474
10957
|
function LuxityProductInterestItem(props) {
|
|
11475
10958
|
var _this;
|
|
11476
|
-
|
|
11477
10959
|
_classCallCheck(this, LuxityProductInterestItem);
|
|
11478
|
-
|
|
11479
|
-
_this
|
|
11480
|
-
|
|
11481
|
-
_defineProperty(_assertThisInitialized(_this), "deleteInterestItem", function () {
|
|
10960
|
+
_this = _callSuper(this, LuxityProductInterestItem, [props]);
|
|
10961
|
+
_defineProperty(_this, "deleteInterestItem", function () {
|
|
11482
10962
|
var id = _this.props.data.id;
|
|
11483
|
-
|
|
11484
10963
|
_this.setState({
|
|
11485
10964
|
delete: _objectSpread2(_objectSpread2({}, request), {}, {
|
|
11486
10965
|
fetching: true
|
|
11487
10966
|
})
|
|
11488
10967
|
});
|
|
11489
|
-
|
|
11490
10968
|
var url = _this.props.deleteInterestApi(id);
|
|
11491
|
-
|
|
11492
10969
|
simpleRequest(_this.props.requestInstance, url, method.DELETE, null, function () {
|
|
11493
10970
|
_this.setState({
|
|
11494
10971
|
delete: _objectSpread2(_objectSpread2({}, request), {}, {
|
|
11495
10972
|
success: true
|
|
11496
10973
|
})
|
|
11497
10974
|
});
|
|
11498
|
-
|
|
11499
10975
|
_this.props.onDeleted(_this.props.data);
|
|
11500
10976
|
}, function () {
|
|
11501
10977
|
return _this.setState({
|
|
@@ -11503,10 +10979,8 @@
|
|
|
11503
10979
|
});
|
|
11504
10980
|
});
|
|
11505
10981
|
});
|
|
11506
|
-
|
|
11507
|
-
_defineProperty(_assertThisInitialized(_this), "render", function () {
|
|
10982
|
+
_defineProperty(_this, "render", function () {
|
|
11508
10983
|
var _data$luxity_model, _data$luxity_material;
|
|
11509
|
-
|
|
11510
10984
|
var data = _this.props.data;
|
|
11511
10985
|
var success = _this.state.delete.success;
|
|
11512
10986
|
return /*#__PURE__*/React__default.createElement(InterestItemContainer$1, {
|
|
@@ -11536,16 +11010,14 @@
|
|
|
11536
11010
|
}
|
|
11537
11011
|
}));
|
|
11538
11012
|
});
|
|
11539
|
-
|
|
11540
11013
|
_this.state = {
|
|
11541
11014
|
delete: _objectSpread2({}, request)
|
|
11542
11015
|
};
|
|
11543
11016
|
return _this;
|
|
11544
11017
|
}
|
|
11545
|
-
|
|
11018
|
+
_inherits(LuxityProductInterestItem, _React$Component);
|
|
11546
11019
|
return _createClass(LuxityProductInterestItem);
|
|
11547
11020
|
}(React__default.Component);
|
|
11548
|
-
|
|
11549
11021
|
var InterestItemTitle$1 = styled__default.div(_templateObject$F || (_templateObject$F = _taggedTemplateLiteral(["\n font-weight: bold;\n display: none;\n\n @media (max-width: ", ") {\n display: inline;\n }\n"])), media.xs);
|
|
11550
11022
|
var InterestItemContainer$1 = styled__default.div(_templateObject2$a || (_templateObject2$a = _taggedTemplateLiteral(["\n display: flex;\n\n .no-shoe-size-section {\n @media (max-width: ", ") {\n display: none;\n }\n }\n"])), media.xs);
|
|
11551
11023
|
var InterestItemContent$1 = styled__default.div(_templateObject3$4 || (_templateObject3$4 = _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) {
|
|
@@ -11558,27 +11030,25 @@
|
|
|
11558
11030
|
return props.theme.marginPaddings[0];
|
|
11559
11031
|
}, media.xs);
|
|
11560
11032
|
var ThemedInterestItem$1 = themed(LuxityProductInterestItem);
|
|
11033
|
+
|
|
11561
11034
|
/**
|
|
11562
11035
|
* The Interest Item view shows the selected interest configuration,
|
|
11563
11036
|
* and gives user control to delete it.
|
|
11564
11037
|
*/
|
|
11565
|
-
|
|
11566
11038
|
var LuxityProductInterestItem$1 = (function (props) {
|
|
11567
11039
|
return /*#__PURE__*/React__default.createElement(ThemedInterestItem$1, props);
|
|
11568
11040
|
});
|
|
11569
11041
|
|
|
11570
11042
|
var _templateObject$G, _templateObject2$b;
|
|
11571
11043
|
var AddInterestButtonContainer = styled__default.div(_templateObject$G || (_templateObject$G = _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"])));
|
|
11572
|
-
|
|
11573
11044
|
var AddIcon = function AddIcon(_ref) {
|
|
11574
11045
|
var onClick = _ref.onClick,
|
|
11575
|
-
|
|
11046
|
+
id = _ref.id;
|
|
11576
11047
|
return /*#__PURE__*/React__default.createElement(IconWrapper, {
|
|
11577
11048
|
id: id,
|
|
11578
11049
|
onClick: onClick
|
|
11579
11050
|
}, /*#__PURE__*/React__default.createElement(SvgWrapper$1, null, /*#__PURE__*/React__default.createElement(Add, null)));
|
|
11580
11051
|
};
|
|
11581
|
-
|
|
11582
11052
|
var AccountIcon = themed(function () {
|
|
11583
11053
|
return /*#__PURE__*/React__default.createElement(SvgWrapper$1, null, /*#__PURE__*/React__default.createElement(Account, null));
|
|
11584
11054
|
});
|
|
@@ -11591,50 +11061,39 @@
|
|
|
11591
11061
|
}, function (props) {
|
|
11592
11062
|
return props.theme.marginPaddings[2];
|
|
11593
11063
|
}));
|
|
11594
|
-
|
|
11595
11064
|
/**
|
|
11596
11065
|
* Page/View that controls the viewing and Adding of Luxity Interests
|
|
11597
11066
|
*/
|
|
11598
11067
|
var Interests = /*#__PURE__*/function (_React$Component) {
|
|
11599
|
-
_inherits(Interests, _React$Component);
|
|
11600
|
-
|
|
11601
|
-
var _super = _createSuper(Interests);
|
|
11602
|
-
|
|
11603
11068
|
function Interests(props) {
|
|
11604
11069
|
var _this;
|
|
11605
|
-
|
|
11606
11070
|
_classCallCheck(this, Interests);
|
|
11607
|
-
|
|
11608
|
-
_this
|
|
11609
|
-
|
|
11610
|
-
_defineProperty(
|
|
11611
|
-
|
|
11612
|
-
_defineProperty(_assertThisInitialized(_this), "productInterestType", 'PRODUCT');
|
|
11613
|
-
|
|
11614
|
-
_defineProperty(_assertThisInitialized(_this), "setInterests", function (data) {
|
|
11071
|
+
_this = _callSuper(this, Interests, [props]);
|
|
11072
|
+
_defineProperty(_this, "categoryInterestType", 'CATEGORY');
|
|
11073
|
+
_defineProperty(_this, "productInterestType", 'PRODUCT');
|
|
11074
|
+
_defineProperty(_this, "setInterests", function (data) {
|
|
11615
11075
|
var _data$data$data = data.data.data,
|
|
11616
|
-
|
|
11617
|
-
|
|
11618
|
-
|
|
11076
|
+
interests = _data$data$data.interests.data,
|
|
11077
|
+
luxity_product_interests = _data$data$data.luxity_product_interests.data;
|
|
11619
11078
|
_this.setState({
|
|
11620
11079
|
interests: interests,
|
|
11621
11080
|
luxity_product_interests: luxity_product_interests
|
|
11622
11081
|
});
|
|
11623
11082
|
});
|
|
11624
|
-
|
|
11625
|
-
_defineProperty(
|
|
11083
|
+
// eslint-disable-next-line
|
|
11084
|
+
_defineProperty(_this, "onInterestSubmitSuccess", function (interestItem) {
|
|
11626
11085
|
// due to the fact that we dont get the Interest payload back - we have to re-request the list
|
|
11627
11086
|
_this.triggerInterestRequest().then(function (res) {
|
|
11628
11087
|
return _this.setInterests(res);
|
|
11629
|
-
});
|
|
11088
|
+
});
|
|
11089
|
+
|
|
11090
|
+
// UNCOMMENT WHEN Interest Items is returned as expected Object Shape
|
|
11630
11091
|
// this.setState(prevState => {
|
|
11631
11092
|
// const newInterests = [interestItem].concat(prevState.interests);
|
|
11632
11093
|
// return { ...prevState, interests: newInterests };
|
|
11633
11094
|
// });
|
|
11634
|
-
|
|
11635
11095
|
});
|
|
11636
|
-
|
|
11637
|
-
_defineProperty(_assertThisInitialized(_this), "onDeleteInterest", function (deletedItem) {
|
|
11096
|
+
_defineProperty(_this, "onDeleteInterest", function (deletedItem) {
|
|
11638
11097
|
_this.setState(function (prevState) {
|
|
11639
11098
|
var newInterests = prevState.interests.filter(function (item) {
|
|
11640
11099
|
return item.id !== deletedItem.id;
|
|
@@ -11644,8 +11103,7 @@
|
|
|
11644
11103
|
});
|
|
11645
11104
|
});
|
|
11646
11105
|
});
|
|
11647
|
-
|
|
11648
|
-
_defineProperty(_assertThisInitialized(_this), "onDeleteLuxityProductInterest", function (deleteItem) {
|
|
11106
|
+
_defineProperty(_this, "onDeleteLuxityProductInterest", function (deleteItem) {
|
|
11649
11107
|
_this.setState(function (prevState) {
|
|
11650
11108
|
var newLuxityProductInterests = prevState.luxity_product_interests.filter(function (item) {
|
|
11651
11109
|
return item.id !== deleteItem.id;
|
|
@@ -11655,29 +11113,25 @@
|
|
|
11655
11113
|
});
|
|
11656
11114
|
});
|
|
11657
11115
|
});
|
|
11658
|
-
|
|
11659
|
-
_defineProperty(_assertThisInitialized(_this), "triggerInterestRequest", function () {
|
|
11116
|
+
_defineProperty(_this, "triggerInterestRequest", function () {
|
|
11660
11117
|
var _this$props = _this.props,
|
|
11661
|
-
|
|
11662
|
-
|
|
11663
|
-
|
|
11118
|
+
requestInstance = _this$props.requestInstance,
|
|
11119
|
+
baseGraphApi = _this$props.baseGraphApi,
|
|
11120
|
+
interestQuery = _this$props.interestQuery;
|
|
11664
11121
|
return requestInstance.post("".concat(baseGraphApi, "?id=getInterests"), {
|
|
11665
11122
|
query: interestQuery
|
|
11666
11123
|
});
|
|
11667
11124
|
});
|
|
11668
|
-
|
|
11669
|
-
_defineProperty(_assertThisInitialized(_this), "onAddInterestClick", function (interestType) {
|
|
11125
|
+
_defineProperty(_this, "onAddInterestClick", function (interestType) {
|
|
11670
11126
|
_this.setState({
|
|
11671
11127
|
interestType: interestType
|
|
11672
11128
|
});
|
|
11673
11129
|
});
|
|
11674
|
-
|
|
11675
|
-
_defineProperty(_assertThisInitialized(_this), "onCancel", function () {
|
|
11130
|
+
_defineProperty(_this, "onCancel", function () {
|
|
11676
11131
|
_this.setState({
|
|
11677
11132
|
interestType: null
|
|
11678
11133
|
});
|
|
11679
11134
|
});
|
|
11680
|
-
|
|
11681
11135
|
_this.state = {
|
|
11682
11136
|
interests: [],
|
|
11683
11137
|
luxity_product_interests: [],
|
|
@@ -11685,32 +11139,31 @@
|
|
|
11685
11139
|
};
|
|
11686
11140
|
return _this;
|
|
11687
11141
|
}
|
|
11688
|
-
|
|
11689
|
-
_createClass(Interests, [{
|
|
11142
|
+
_inherits(Interests, _React$Component);
|
|
11143
|
+
return _createClass(Interests, [{
|
|
11690
11144
|
key: "render",
|
|
11691
11145
|
value: function render() {
|
|
11692
11146
|
var _this2 = this;
|
|
11693
|
-
|
|
11694
11147
|
var _this$state = this.state,
|
|
11695
|
-
|
|
11696
|
-
|
|
11148
|
+
interests = _this$state.interests,
|
|
11149
|
+
luxity_product_interests = _this$state.luxity_product_interests;
|
|
11697
11150
|
var _this$props2 = this.props,
|
|
11698
|
-
|
|
11699
|
-
|
|
11700
|
-
|
|
11701
|
-
|
|
11702
|
-
|
|
11703
|
-
|
|
11704
|
-
|
|
11705
|
-
|
|
11706
|
-
|
|
11707
|
-
|
|
11708
|
-
|
|
11709
|
-
|
|
11710
|
-
|
|
11711
|
-
|
|
11712
|
-
|
|
11713
|
-
|
|
11151
|
+
addInterestApi = _this$props2.addInterestApi,
|
|
11152
|
+
requestInstance = _this$props2.requestInstance,
|
|
11153
|
+
baseGraphApi = _this$props2.baseGraphApi,
|
|
11154
|
+
getBrandsGraphQuery = _this$props2.getBrandsGraphQuery,
|
|
11155
|
+
getStylesGraphQuery = _this$props2.getStylesGraphQuery,
|
|
11156
|
+
getShoesGraphQuery = _this$props2.getShoesGraphQuery,
|
|
11157
|
+
deleteInterestApi = _this$props2.deleteInterestApi,
|
|
11158
|
+
setSchedule = _this$props2.setSchedule,
|
|
11159
|
+
getSchedule = _this$props2.getSchedule,
|
|
11160
|
+
interestsTitle = _this$props2.interestsTitle,
|
|
11161
|
+
defaultShoeSizeType = _this$props2.defaultShoeSizeType,
|
|
11162
|
+
getMaterialsGraphQuery = _this$props2.getMaterialsGraphQuery,
|
|
11163
|
+
getModelsGraphQuery = _this$props2.getModelsGraphQuery,
|
|
11164
|
+
addLuxityProductInterestApi = _this$props2.addLuxityProductInterestApi,
|
|
11165
|
+
deleteLuxityProductInterestApi = _this$props2.deleteLuxityProductInterestApi,
|
|
11166
|
+
getConditionsGraphQuery = _this$props2.getConditionsGraphQuery;
|
|
11714
11167
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
11715
11168
|
className: "interests"
|
|
11716
11169
|
}, /*#__PURE__*/React__default.createElement(Notifications__default, {
|
|
@@ -11799,10 +11252,7 @@
|
|
|
11799
11252
|
}))));
|
|
11800
11253
|
}
|
|
11801
11254
|
}]);
|
|
11802
|
-
|
|
11803
|
-
return Interests;
|
|
11804
11255
|
}(React__default.Component);
|
|
11805
|
-
|
|
11806
11256
|
Interests.defaultProps = {
|
|
11807
11257
|
interestsTitle: 'Interests',
|
|
11808
11258
|
defaultShoeSizeType: shoeSizeTypes.eu.value
|