@bonlineza/luxity-lib 2.36.1-beta.1 → 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 +933 -1511
- 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 +922 -1471
- package/InterestsSubheading.js +5 -10
- package/InvertedTextButton.js +27 -63
- package/LuxityAppSideNav.js +18 -21
- package/LuxityDesktopHeader.js +219 -274
- package/LuxityFooter.js +430 -321
- package/LuxityGraphQLDropdownSelector.js +949 -1543
- 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 +956 -1551
- package/ModelSelector.js +956 -1551
- package/NotificationDropDown.js +122 -221
- 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 +1834 -2387
- 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,20 +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
|
-
|
|
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;
|
|
7629
7435
|
_this.setState({
|
|
7630
7436
|
options: options,
|
|
7631
|
-
|
|
7437
|
+
canReceiveWhatsAppNotifications: is_early_access || is_exclusive,
|
|
7632
7438
|
emailSelectedOption: options.find(function (item) {
|
|
7633
7439
|
return item.value === email_interest_send_schedule;
|
|
7634
7440
|
}),
|
|
@@ -7637,14 +7443,13 @@
|
|
|
7637
7443
|
})
|
|
7638
7444
|
});
|
|
7639
7445
|
});
|
|
7640
|
-
|
|
7641
|
-
_defineProperty(_assertThisInitialized(_this), "render", function () {
|
|
7446
|
+
_defineProperty(_this, "render", function () {
|
|
7642
7447
|
var _this$state = _this.state,
|
|
7643
|
-
|
|
7644
|
-
|
|
7645
|
-
|
|
7646
|
-
|
|
7647
|
-
|
|
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;
|
|
7648
7453
|
return /*#__PURE__*/React__default.createElement(NotifyContainer, null, /*#__PURE__*/React__default.createElement(LuxityNotifications, null), /*#__PURE__*/React__default.createElement(LuxityPageReady, {
|
|
7649
7454
|
getRequestPromise: _this.props.getSchedule,
|
|
7650
7455
|
onData: function onData(data) {
|
|
@@ -7652,7 +7457,7 @@
|
|
|
7652
7457
|
}
|
|
7653
7458
|
}, /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
7654
7459
|
className: "notification-settings"
|
|
7655
|
-
},
|
|
7460
|
+
}, canReceiveWhatsAppNotifications && /*#__PURE__*/React__default.createElement("div", {
|
|
7656
7461
|
className: "notification-row-wrapper"
|
|
7657
7462
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
7658
7463
|
className: "notification-dropdown-label"
|
|
@@ -7692,20 +7497,18 @@
|
|
|
7692
7497
|
value: emailSelectedOption
|
|
7693
7498
|
}))))));
|
|
7694
7499
|
});
|
|
7695
|
-
|
|
7696
7500
|
_this.state = {
|
|
7697
7501
|
options: [],
|
|
7698
7502
|
emailSelectedOption: null,
|
|
7699
7503
|
whatsappSelectedOption: null,
|
|
7700
|
-
|
|
7504
|
+
canReceiveWhatsAppNotifications: false,
|
|
7701
7505
|
request: _objectSpread2({}, request)
|
|
7702
7506
|
};
|
|
7703
7507
|
return _this;
|
|
7704
7508
|
}
|
|
7705
|
-
|
|
7509
|
+
_inherits(NotificationDropDown, _React$Component);
|
|
7706
7510
|
return _createClass(NotificationDropDown);
|
|
7707
7511
|
}(React__default.Component);
|
|
7708
|
-
|
|
7709
7512
|
var NotificationDropDown$1 = themed(NotificationDropDown);
|
|
7710
7513
|
|
|
7711
7514
|
var simpleRequest = (function (axiosInstance, url) {
|
|
@@ -7765,23 +7568,23 @@
|
|
|
7765
7568
|
return props.hasBorder ? props.theme.colors.borderColor : props.theme.colors.ntrlMin;
|
|
7766
7569
|
}, function (_ref) {
|
|
7767
7570
|
var isChecked = _ref.isChecked,
|
|
7768
|
-
|
|
7571
|
+
theme = _ref.theme;
|
|
7769
7572
|
return isChecked ? theme.colors.primary : theme.colors.gray;
|
|
7770
7573
|
}, function (_ref2) {
|
|
7771
7574
|
var isChecked = _ref2.isChecked,
|
|
7772
|
-
|
|
7575
|
+
theme = _ref2.theme;
|
|
7773
7576
|
return isChecked ? 'white' : theme.colors.base;
|
|
7774
7577
|
}, function (_ref3) {
|
|
7775
7578
|
var isChecked = _ref3.isChecked,
|
|
7776
|
-
|
|
7579
|
+
theme = _ref3.theme;
|
|
7777
7580
|
return isChecked ? theme.colors.ntrlMin : theme.colors.primary;
|
|
7778
7581
|
}, function (_ref4) {
|
|
7779
7582
|
var isChecked = _ref4.isChecked,
|
|
7780
|
-
|
|
7583
|
+
theme = _ref4.theme;
|
|
7781
7584
|
return isChecked ? 'white' : theme.colors.base;
|
|
7782
7585
|
}, function (_ref5) {
|
|
7783
7586
|
var isChecked = _ref5.isChecked,
|
|
7784
|
-
|
|
7587
|
+
theme = _ref5.theme;
|
|
7785
7588
|
return isChecked ? theme.colors.primary : 'white';
|
|
7786
7589
|
}, media.sm, function (props) {
|
|
7787
7590
|
return props.theme.marginPaddings[2];
|
|
@@ -7936,56 +7739,45 @@
|
|
|
7936
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"])));
|
|
7937
7740
|
|
|
7938
7741
|
var _excluded = ["children"];
|
|
7939
|
-
|
|
7940
7742
|
var _templateObject$6;
|
|
7941
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);
|
|
7942
|
-
|
|
7943
7744
|
var WrapperButton = function WrapperButton(_ref) {
|
|
7944
7745
|
var children = _ref.children,
|
|
7945
|
-
|
|
7946
|
-
|
|
7746
|
+
restProps = _objectWithoutProperties(_ref, _excluded);
|
|
7947
7747
|
return /*#__PURE__*/React__default.createElement(Button, restProps, children);
|
|
7948
7748
|
};
|
|
7949
7749
|
|
|
7950
7750
|
var _templateObject$7, _templateObject2$1;
|
|
7951
7751
|
var categories = catArray;
|
|
7952
|
-
|
|
7953
7752
|
var getSvg = function getSvg() {
|
|
7954
7753
|
var category = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
7955
|
-
|
|
7956
7754
|
switch (category) {
|
|
7957
7755
|
case interestCategories.BAGS:
|
|
7958
7756
|
return /*#__PURE__*/React__default.createElement(Bags, null);
|
|
7959
|
-
|
|
7960
7757
|
case interestCategories.SHOES:
|
|
7961
7758
|
return /*#__PURE__*/React__default.createElement(Shoes, null);
|
|
7962
|
-
|
|
7963
7759
|
case interestCategories.APPAREL:
|
|
7964
7760
|
return /*#__PURE__*/React__default.createElement(Clothing, null);
|
|
7965
|
-
|
|
7966
7761
|
case interestCategories.ACCESSORIES:
|
|
7967
7762
|
return /*#__PURE__*/React__default.createElement(Accessories, null);
|
|
7968
|
-
|
|
7969
7763
|
case interestCategories.WATCHES:
|
|
7970
7764
|
return /*#__PURE__*/React__default.createElement(Watches, null);
|
|
7971
|
-
|
|
7972
7765
|
default:
|
|
7973
7766
|
return null;
|
|
7974
7767
|
}
|
|
7975
7768
|
};
|
|
7976
|
-
|
|
7977
7769
|
var Container = styled__default.div(_templateObject$7 || (_templateObject$7 = _taggedTemplateLiteral(["\n margin-bottom: ", ";\n"])), function (props) {
|
|
7978
7770
|
return props.theme.marginPaddings[5];
|
|
7979
7771
|
});
|
|
7980
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
|
+
|
|
7981
7774
|
/**
|
|
7982
7775
|
* InterestCatSelector is a specialized selector for select luxity specific interest categories
|
|
7983
7776
|
*/
|
|
7984
|
-
|
|
7985
7777
|
var InterestCatSelector = function InterestCatSelector(_ref) {
|
|
7986
7778
|
var onCategoryChange = _ref.onCategoryChange,
|
|
7987
|
-
|
|
7988
|
-
|
|
7779
|
+
errorMessage = _ref.errorMessage,
|
|
7780
|
+
category = _ref.category;
|
|
7989
7781
|
return /*#__PURE__*/React__default.createElement(Container, null, /*#__PURE__*/React__default.createElement(Body, null, categories.map(function (cat, index) {
|
|
7990
7782
|
return /*#__PURE__*/React__default.createElement(WrapperButton, {
|
|
7991
7783
|
key: "cat-".concat(index),
|
|
@@ -8000,7 +7792,6 @@
|
|
|
8000
7792
|
}, getSvg(cat.value), /*#__PURE__*/React__default.createElement(CategoryTitle, null, cat.categoryTitle)));
|
|
8001
7793
|
})), errorMessage && /*#__PURE__*/React__default.createElement(ErrorMessage, null, errorMessage));
|
|
8002
7794
|
};
|
|
8003
|
-
|
|
8004
7795
|
InterestCatSelector.defaultProps = {
|
|
8005
7796
|
errorMessage: '',
|
|
8006
7797
|
category: null,
|
|
@@ -8011,7 +7802,6 @@
|
|
|
8011
7802
|
var CategoryInterestSelector = themed(InterestCatSelector);
|
|
8012
7803
|
|
|
8013
7804
|
var _excluded$1 = ["children"];
|
|
8014
|
-
|
|
8015
7805
|
var _templateObject$8;
|
|
8016
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) {
|
|
8017
7807
|
return props.theme.colors.base;
|
|
@@ -8020,21 +7810,17 @@
|
|
|
8020
7810
|
}, disabledButtonStyle, function (props) {
|
|
8021
7811
|
return props.theme.colors.base;
|
|
8022
7812
|
});
|
|
8023
|
-
|
|
8024
7813
|
var TextButton = function TextButton(_ref) {
|
|
8025
7814
|
var children = _ref.children,
|
|
8026
|
-
|
|
8027
|
-
|
|
7815
|
+
restProps = _objectWithoutProperties(_ref, _excluded$1);
|
|
8028
7816
|
return /*#__PURE__*/React__default.createElement(Button$1, restProps, children);
|
|
8029
7817
|
};
|
|
8030
|
-
|
|
8031
7818
|
TextButton.defaultProps = {
|
|
8032
7819
|
type: 'button'
|
|
8033
7820
|
};
|
|
8034
7821
|
var TextButton$1 = themed(TextButton);
|
|
8035
7822
|
|
|
8036
7823
|
var _excluded$2 = ["children"];
|
|
8037
|
-
|
|
8038
7824
|
var _templateObject$9;
|
|
8039
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) {
|
|
8040
7826
|
return props.theme.colors.ntrlMin;
|
|
@@ -8049,14 +7835,11 @@
|
|
|
8049
7835
|
}, function (props) {
|
|
8050
7836
|
return props.theme.colors.primary;
|
|
8051
7837
|
});
|
|
8052
|
-
|
|
8053
7838
|
var InvertedTextButton = function InvertedTextButton(_ref) {
|
|
8054
7839
|
var children = _ref.children,
|
|
8055
|
-
|
|
8056
|
-
|
|
7840
|
+
restProps = _objectWithoutProperties(_ref, _excluded$2);
|
|
8057
7841
|
return /*#__PURE__*/React__default.createElement(Button$2, restProps, children);
|
|
8058
7842
|
};
|
|
8059
|
-
|
|
8060
7843
|
var InvertedTextButton$1 = themed(InvertedTextButton);
|
|
8061
7844
|
|
|
8062
7845
|
var _templateObject$a, _templateObject2$2;
|
|
@@ -8098,65 +7881,49 @@
|
|
|
8098
7881
|
}, function (props) {
|
|
8099
7882
|
return props.theme.colors.ntrlMin;
|
|
8100
7883
|
});
|
|
7884
|
+
|
|
8101
7885
|
/**
|
|
8102
7886
|
* Multiselector with a GraphQL flavour (TODO: to be revised to make it remote api agnostic)
|
|
8103
7887
|
*/
|
|
8104
|
-
|
|
8105
7888
|
var GraphQLMultiSelector = /*#__PURE__*/function (_React$Component) {
|
|
8106
|
-
_inherits(GraphQLMultiSelector, _React$Component);
|
|
8107
|
-
|
|
8108
|
-
var _super = _createSuper(GraphQLMultiSelector);
|
|
8109
|
-
|
|
8110
7889
|
function GraphQLMultiSelector(props) {
|
|
8111
7890
|
var _this;
|
|
8112
|
-
|
|
8113
7891
|
_classCallCheck(this, GraphQLMultiSelector);
|
|
8114
|
-
|
|
8115
|
-
_this
|
|
8116
|
-
|
|
8117
|
-
_defineProperty(_assertThisInitialized(_this), "componentDidUpdate", function (prevProps) {
|
|
7892
|
+
_this = _callSuper(this, GraphQLMultiSelector, [props]);
|
|
7893
|
+
_defineProperty(_this, "componentDidUpdate", function (prevProps) {
|
|
8118
7894
|
if (prevProps.graphQuery !== _this.props.graphQuery) {
|
|
8119
7895
|
_this.makeRequest();
|
|
8120
7896
|
}
|
|
8121
7897
|
});
|
|
8122
|
-
|
|
8123
|
-
_defineProperty(_assertThisInitialized(_this), "makeRequest", function () {
|
|
7898
|
+
_defineProperty(_this, "makeRequest", function () {
|
|
8124
7899
|
_this.pageReady.refreshPage();
|
|
8125
7900
|
});
|
|
8126
|
-
|
|
8127
|
-
_defineProperty(_assertThisInitialized(_this), "emptySelected", function () {
|
|
7901
|
+
_defineProperty(_this, "emptySelected", function () {
|
|
8128
7902
|
return _this.setState({
|
|
8129
7903
|
selected: [ALL_ITEM]
|
|
8130
7904
|
});
|
|
8131
7905
|
});
|
|
8132
|
-
|
|
8133
|
-
_defineProperty(_assertThisInitialized(_this), "setNewResults", function (res) {
|
|
7906
|
+
_defineProperty(_this, "setNewResults", function (res) {
|
|
8134
7907
|
var selectedIds = _this.state.selected.map(function (sel) {
|
|
8135
7908
|
return sel.id;
|
|
8136
7909
|
});
|
|
8137
|
-
|
|
8138
7910
|
var pagination = _this.props.resultProcessor(res);
|
|
8139
|
-
|
|
8140
7911
|
var allSelected = _this.state.selected.some(function (item) {
|
|
8141
7912
|
return item.id === ALL_ITEM.id;
|
|
8142
7913
|
});
|
|
8143
|
-
|
|
8144
7914
|
var newList = pagination.data.filter(function (newItem) {
|
|
8145
7915
|
return !selectedIds.includes(newItem.id);
|
|
8146
7916
|
});
|
|
8147
7917
|
newList = allSelected ? newList : [ALL_ITEM].concat(_toConsumableArray(newList));
|
|
8148
|
-
|
|
8149
7918
|
_this.setState({
|
|
8150
7919
|
list: newList,
|
|
8151
7920
|
pagination: pagination
|
|
8152
7921
|
});
|
|
8153
7922
|
});
|
|
8154
|
-
|
|
8155
|
-
_defineProperty(_assertThisInitialized(_this), "onAddItem", function (addSelectedItem) {
|
|
7923
|
+
_defineProperty(_this, "onAddItem", function (addSelectedItem) {
|
|
8156
7924
|
_this.setState(function (prevState) {
|
|
8157
7925
|
var newSelectedList;
|
|
8158
7926
|
var newList;
|
|
8159
|
-
|
|
8160
7927
|
if (addSelectedItem.id === ALL_ITEM.id) {
|
|
8161
7928
|
// Clear Selected List
|
|
8162
7929
|
// and move previous Selected items to list
|
|
@@ -8176,7 +7943,6 @@
|
|
|
8176
7943
|
return item.id !== addSelectedItem.id;
|
|
8177
7944
|
})));
|
|
8178
7945
|
}
|
|
8179
|
-
|
|
8180
7946
|
return {
|
|
8181
7947
|
selected: newSelectedList,
|
|
8182
7948
|
list: newList
|
|
@@ -8187,24 +7953,20 @@
|
|
|
8187
7953
|
}));
|
|
8188
7954
|
});
|
|
8189
7955
|
});
|
|
8190
|
-
|
|
8191
|
-
_defineProperty(_assertThisInitialized(_this), "onRemoveItem", function (removeSelectedItem) {
|
|
7956
|
+
_defineProperty(_this, "onRemoveItem", function (removeSelectedItem) {
|
|
8192
7957
|
_this.setState(function (prevState) {
|
|
8193
7958
|
// Cannot remove ALL from selection by unselecting it
|
|
8194
7959
|
if ((removeSelectedItem === null || removeSelectedItem === void 0 ? void 0 : removeSelectedItem.id) === ALL_ITEM.id) {
|
|
8195
7960
|
return {};
|
|
8196
7961
|
}
|
|
8197
|
-
|
|
8198
7962
|
var newSelectedList = prevState.selected.filter(function (item) {
|
|
8199
7963
|
return item.id !== removeSelectedItem.id;
|
|
8200
7964
|
});
|
|
8201
|
-
|
|
8202
7965
|
var newList = _toConsumableArray(prevState.list).concat(removeSelectedItem).filter(function (item) {
|
|
8203
7966
|
return item.id !== ALL_ITEM.id;
|
|
8204
7967
|
}).sort(function (a, b) {
|
|
8205
7968
|
return a.id - b.id;
|
|
8206
7969
|
});
|
|
8207
|
-
|
|
8208
7970
|
return {
|
|
8209
7971
|
list: newList,
|
|
8210
7972
|
selected: newSelectedList.length ? newSelectedList : [ALL_ITEM]
|
|
@@ -8215,25 +7977,23 @@
|
|
|
8215
7977
|
}));
|
|
8216
7978
|
});
|
|
8217
7979
|
});
|
|
8218
|
-
|
|
8219
|
-
_defineProperty(_assertThisInitialized(_this), "onIsLoading", function (flag) {
|
|
7980
|
+
_defineProperty(_this, "onIsLoading", function (flag) {
|
|
8220
7981
|
_this.setState({
|
|
8221
7982
|
isLoading: flag
|
|
8222
7983
|
});
|
|
8223
7984
|
});
|
|
8224
|
-
|
|
8225
|
-
_defineProperty(_assertThisInitialized(_this), "render", function () {
|
|
7985
|
+
_defineProperty(_this, "render", function () {
|
|
8226
7986
|
var _this$props = _this.props,
|
|
8227
|
-
|
|
8228
|
-
|
|
8229
|
-
|
|
8230
|
-
|
|
8231
|
-
|
|
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;
|
|
8232
7992
|
var _this$state = _this.state,
|
|
8233
|
-
|
|
8234
|
-
|
|
8235
|
-
|
|
8236
|
-
|
|
7993
|
+
list = _this$state.list,
|
|
7994
|
+
selected = _this$state.selected,
|
|
7995
|
+
pagination = _this$state.pagination,
|
|
7996
|
+
isLoading = _this$state.isLoading;
|
|
8237
7997
|
return /*#__PURE__*/React__default.createElement(StyledMultiselector, null, /*#__PURE__*/React__default.createElement("div", {
|
|
8238
7998
|
"data-qe-id": identifier,
|
|
8239
7999
|
className: "".concat(className, " ").concat(baseClass)
|
|
@@ -8272,7 +8032,6 @@
|
|
|
8272
8032
|
type: "button"
|
|
8273
8033
|
}, "SHOW MORE"))));
|
|
8274
8034
|
});
|
|
8275
|
-
|
|
8276
8035
|
_this.state = {
|
|
8277
8036
|
selected: [ALL_ITEM],
|
|
8278
8037
|
list: [],
|
|
@@ -8281,10 +8040,9 @@
|
|
|
8281
8040
|
};
|
|
8282
8041
|
return _this;
|
|
8283
8042
|
}
|
|
8284
|
-
|
|
8043
|
+
_inherits(GraphQLMultiSelector, _React$Component);
|
|
8285
8044
|
return _createClass(GraphQLMultiSelector);
|
|
8286
8045
|
}(React__default.Component);
|
|
8287
|
-
|
|
8288
8046
|
GraphQLMultiSelector.defaultProps = {
|
|
8289
8047
|
baseClass: 'multiselector'
|
|
8290
8048
|
};
|
|
@@ -8317,24 +8075,22 @@
|
|
|
8317
8075
|
}, function (props) {
|
|
8318
8076
|
return props.theme.marginPaddings[3];
|
|
8319
8077
|
});
|
|
8320
|
-
|
|
8321
8078
|
var InterestsSubheading = function InterestsSubheading(_ref) {
|
|
8322
8079
|
var title = _ref.title,
|
|
8323
|
-
|
|
8324
|
-
|
|
8080
|
+
children = _ref.children,
|
|
8081
|
+
className = _ref.className;
|
|
8325
8082
|
return /*#__PURE__*/React__default.createElement(InterestsSubheadingContainer, {
|
|
8326
8083
|
className: className
|
|
8327
8084
|
}, /*#__PURE__*/React__default.createElement(Title, null, title), /*#__PURE__*/React__default.createElement("div", null, children));
|
|
8328
8085
|
};
|
|
8329
8086
|
|
|
8330
8087
|
var _templateObject$c;
|
|
8331
|
-
|
|
8332
8088
|
var Title$1 = function Title(_ref) {
|
|
8333
8089
|
var baseClass = _ref.baseClass,
|
|
8334
|
-
|
|
8335
|
-
|
|
8336
|
-
|
|
8337
|
-
|
|
8090
|
+
className = _ref.className,
|
|
8091
|
+
title = _ref.title,
|
|
8092
|
+
searchPlaceHolder = _ref.searchPlaceHolder,
|
|
8093
|
+
onSearchChanged = _ref.onSearchChanged;
|
|
8338
8094
|
return /*#__PURE__*/React__default.createElement(InterestsSubheading, {
|
|
8339
8095
|
className: "".concat(className, " ").concat(baseClass, "__title"),
|
|
8340
8096
|
title: title
|
|
@@ -8347,7 +8103,6 @@
|
|
|
8347
8103
|
onChange: onSearchChanged
|
|
8348
8104
|
})));
|
|
8349
8105
|
};
|
|
8350
|
-
|
|
8351
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) {
|
|
8352
8107
|
return props.theme.marginPaddings[2];
|
|
8353
8108
|
}, function (props) {
|
|
@@ -8370,37 +8125,26 @@
|
|
|
8370
8125
|
var Title$2 = themed(StyledTitle);
|
|
8371
8126
|
|
|
8372
8127
|
var debounceBuilder = functions.debounced(200);
|
|
8373
|
-
|
|
8374
8128
|
/**
|
|
8375
8129
|
* Luxity flavoured GraphQLMultiselector with text Search, category and limit controls
|
|
8376
8130
|
*/
|
|
8377
8131
|
var LuxityGraphQLMultiselector = /*#__PURE__*/function (_React$Component) {
|
|
8378
|
-
_inherits(LuxityGraphQLMultiselector, _React$Component);
|
|
8379
|
-
|
|
8380
|
-
var _super = _createSuper(LuxityGraphQLMultiselector);
|
|
8381
|
-
|
|
8382
8132
|
function LuxityGraphQLMultiselector(props) {
|
|
8383
8133
|
var _this;
|
|
8384
|
-
|
|
8385
8134
|
_classCallCheck(this, LuxityGraphQLMultiselector);
|
|
8386
|
-
|
|
8387
|
-
_this
|
|
8388
|
-
|
|
8389
|
-
_defineProperty(_assertThisInitialized(_this), "multiSelectorRef", /*#__PURE__*/React__default.createRef());
|
|
8390
|
-
|
|
8391
|
-
_defineProperty(_assertThisInitialized(_this), "increaseLimit", function () {
|
|
8135
|
+
_this = _callSuper(this, LuxityGraphQLMultiselector, [props]);
|
|
8136
|
+
_defineProperty(_this, "multiSelectorRef", /*#__PURE__*/React__default.createRef());
|
|
8137
|
+
_defineProperty(_this, "increaseLimit", function () {
|
|
8392
8138
|
_this.setState(function (prevState) {
|
|
8393
8139
|
return {
|
|
8394
8140
|
limit: prevState.limit + _this.props.queryLimitIncrement
|
|
8395
8141
|
};
|
|
8396
8142
|
});
|
|
8397
8143
|
});
|
|
8398
|
-
|
|
8399
|
-
_defineProperty(_assertThisInitialized(_this), "onChange", function (selection) {
|
|
8144
|
+
_defineProperty(_this, "onChange", function (selection) {
|
|
8400
8145
|
_this.props.onChange(selection);
|
|
8401
8146
|
});
|
|
8402
|
-
|
|
8403
|
-
_defineProperty(_assertThisInitialized(_this), "onSearchChanged", function (event) {
|
|
8147
|
+
_defineProperty(_this, "onSearchChanged", function (event) {
|
|
8404
8148
|
event.preventDefault();
|
|
8405
8149
|
var searchText = event.target.value;
|
|
8406
8150
|
debounceBuilder(function () {
|
|
@@ -8409,22 +8153,21 @@
|
|
|
8409
8153
|
});
|
|
8410
8154
|
});
|
|
8411
8155
|
});
|
|
8412
|
-
|
|
8413
|
-
_defineProperty(_assertThisInitialized(_this), "render", function () {
|
|
8156
|
+
_defineProperty(_this, "render", function () {
|
|
8414
8157
|
var _this$state = _this.state,
|
|
8415
|
-
|
|
8416
|
-
|
|
8417
|
-
|
|
8158
|
+
limit = _this$state.limit,
|
|
8159
|
+
category = _this$state.category,
|
|
8160
|
+
nameFilter = _this$state.nameFilter;
|
|
8418
8161
|
var _this$props = _this.props,
|
|
8419
|
-
|
|
8420
|
-
|
|
8421
|
-
|
|
8422
|
-
|
|
8423
|
-
|
|
8424
|
-
|
|
8425
|
-
|
|
8426
|
-
|
|
8427
|
-
|
|
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;
|
|
8428
8171
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
8429
8172
|
className: baseClass
|
|
8430
8173
|
}, /*#__PURE__*/React__default.createElement(Title$2, {
|
|
@@ -8447,7 +8190,6 @@
|
|
|
8447
8190
|
itemRenderer: itemRenderer
|
|
8448
8191
|
})));
|
|
8449
8192
|
});
|
|
8450
|
-
|
|
8451
8193
|
_this.state = {
|
|
8452
8194
|
limit: props.baseQueryLimit,
|
|
8453
8195
|
category: props.category,
|
|
@@ -8455,12 +8197,11 @@
|
|
|
8455
8197
|
};
|
|
8456
8198
|
return _this;
|
|
8457
8199
|
}
|
|
8458
|
-
|
|
8459
|
-
_createClass(LuxityGraphQLMultiselector, [{
|
|
8200
|
+
_inherits(LuxityGraphQLMultiselector, _React$Component);
|
|
8201
|
+
return _createClass(LuxityGraphQLMultiselector, [{
|
|
8460
8202
|
key: "componentDidUpdate",
|
|
8461
8203
|
value: function componentDidUpdate(prevProps) {
|
|
8462
8204
|
var _this$multiSelectorRe;
|
|
8463
|
-
|
|
8464
8205
|
if (prevProps.category !== this.props.category && (_this$multiSelectorRe = this.multiSelectorRef) !== null && _this$multiSelectorRe !== void 0 && _this$multiSelectorRe.current) {
|
|
8465
8206
|
this.multiSelectorRef.current.emptySelected();
|
|
8466
8207
|
}
|
|
@@ -8473,14 +8214,10 @@
|
|
|
8473
8214
|
category: props.category
|
|
8474
8215
|
};
|
|
8475
8216
|
}
|
|
8476
|
-
|
|
8477
8217
|
return null;
|
|
8478
8218
|
}
|
|
8479
8219
|
}]);
|
|
8480
|
-
|
|
8481
|
-
return LuxityGraphQLMultiselector;
|
|
8482
8220
|
}(React__default.Component);
|
|
8483
|
-
|
|
8484
8221
|
LuxityGraphQLMultiselector.defaultProps = {
|
|
8485
8222
|
baseClass: '',
|
|
8486
8223
|
searchPlaceHolder: '',
|
|
@@ -8489,21 +8226,17 @@
|
|
|
8489
8226
|
};
|
|
8490
8227
|
|
|
8491
8228
|
var _excluded$3 = ["children"];
|
|
8492
|
-
|
|
8493
8229
|
var _templateObject$d;
|
|
8494
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) {
|
|
8495
8231
|
return props.theme.colors.primary;
|
|
8496
8232
|
}, function (props) {
|
|
8497
8233
|
return props.theme.colors.primary;
|
|
8498
8234
|
}, disabledButtonStyle);
|
|
8499
|
-
|
|
8500
8235
|
var PrimaryButton = function PrimaryButton(_ref) {
|
|
8501
8236
|
var children = _ref.children,
|
|
8502
|
-
|
|
8503
|
-
|
|
8237
|
+
restProps = _objectWithoutProperties(_ref, _excluded$3);
|
|
8504
8238
|
return /*#__PURE__*/React__default.createElement(Button$3, restProps, children);
|
|
8505
8239
|
};
|
|
8506
|
-
|
|
8507
8240
|
var PrimaryButton$1 = themed(PrimaryButton);
|
|
8508
8241
|
|
|
8509
8242
|
var _templateObject$e;
|
|
@@ -8519,11 +8252,10 @@
|
|
|
8519
8252
|
return props.theme.colors.ntrlMin;
|
|
8520
8253
|
});
|
|
8521
8254
|
var UnselectedButton = themed(BaseButton);
|
|
8522
|
-
|
|
8523
8255
|
var ItemRenderer = function ItemRenderer(_ref) {
|
|
8524
8256
|
var item = _ref.item,
|
|
8525
|
-
|
|
8526
|
-
|
|
8257
|
+
onSelect = _ref.onSelect,
|
|
8258
|
+
selected = _ref.selected;
|
|
8527
8259
|
var props = {
|
|
8528
8260
|
onClick: function onClick(e) {
|
|
8529
8261
|
e.preventDefault();
|
|
@@ -8535,12 +8267,12 @@
|
|
|
8535
8267
|
|
|
8536
8268
|
var BrandSelector = function BrandSelector(_ref) {
|
|
8537
8269
|
var onChange = _ref.onChange,
|
|
8538
|
-
|
|
8539
|
-
|
|
8540
|
-
|
|
8541
|
-
|
|
8542
|
-
|
|
8543
|
-
|
|
8270
|
+
category = _ref.category,
|
|
8271
|
+
graphApi = _ref.graphApi,
|
|
8272
|
+
itemRenderer = _ref.itemRenderer,
|
|
8273
|
+
getGraphQuery = _ref.getGraphQuery,
|
|
8274
|
+
resultProcessor = _ref.resultProcessor,
|
|
8275
|
+
requestInstance = _ref.requestInstance;
|
|
8544
8276
|
return /*#__PURE__*/React__default.createElement(LuxityGraphQLMultiselector, {
|
|
8545
8277
|
baseQueryLimit: 16,
|
|
8546
8278
|
title: "Brands",
|
|
@@ -8557,7 +8289,6 @@
|
|
|
8557
8289
|
requestInstance: requestInstance
|
|
8558
8290
|
});
|
|
8559
8291
|
};
|
|
8560
|
-
|
|
8561
8292
|
BrandSelector.defaultProps = {
|
|
8562
8293
|
itemRenderer: ItemRenderer,
|
|
8563
8294
|
resultProcessor: function resultProcessor(result) {
|
|
@@ -8567,12 +8298,12 @@
|
|
|
8567
8298
|
|
|
8568
8299
|
var StyleSelector = function StyleSelector(_ref) {
|
|
8569
8300
|
var onChange = _ref.onChange,
|
|
8570
|
-
|
|
8571
|
-
|
|
8572
|
-
|
|
8573
|
-
|
|
8574
|
-
|
|
8575
|
-
|
|
8301
|
+
category = _ref.category,
|
|
8302
|
+
graphApi = _ref.graphApi,
|
|
8303
|
+
itemRenderer = _ref.itemRenderer,
|
|
8304
|
+
getGraphQuery = _ref.getGraphQuery,
|
|
8305
|
+
resultProcessor = _ref.resultProcessor,
|
|
8306
|
+
requestInstance = _ref.requestInstance;
|
|
8576
8307
|
return /*#__PURE__*/React__default.createElement(LuxityGraphQLMultiselector, {
|
|
8577
8308
|
title: "Styles",
|
|
8578
8309
|
queryId: "getStyles",
|
|
@@ -8589,7 +8320,6 @@
|
|
|
8589
8320
|
requestInstance: requestInstance
|
|
8590
8321
|
});
|
|
8591
8322
|
};
|
|
8592
|
-
|
|
8593
8323
|
StyleSelector.defaultProps = {
|
|
8594
8324
|
itemRenderer: ItemRenderer,
|
|
8595
8325
|
resultProcessor: function resultProcessor(result) {
|
|
@@ -8604,117 +8334,82 @@
|
|
|
8604
8334
|
};
|
|
8605
8335
|
|
|
8606
8336
|
function _extends$2() {
|
|
8607
|
-
_extends$2 = Object.assign ? Object.assign.bind() : function (
|
|
8608
|
-
for (var
|
|
8609
|
-
var
|
|
8610
|
-
|
|
8611
|
-
for (var key in source) {
|
|
8612
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
8613
|
-
target[key] = source[key];
|
|
8614
|
-
}
|
|
8615
|
-
}
|
|
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]);
|
|
8616
8341
|
}
|
|
8617
|
-
|
|
8618
|
-
|
|
8619
|
-
};
|
|
8620
|
-
return _extends$2.apply(this, arguments);
|
|
8342
|
+
return n;
|
|
8343
|
+
}, _extends$2.apply(null, arguments);
|
|
8621
8344
|
}
|
|
8622
8345
|
|
|
8623
|
-
function _assertThisInitialized$2(
|
|
8624
|
-
if (
|
|
8625
|
-
|
|
8626
|
-
}
|
|
8627
|
-
|
|
8628
|
-
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;
|
|
8629
8349
|
}
|
|
8630
8350
|
|
|
8631
|
-
function _setPrototypeOf$2(
|
|
8632
|
-
_setPrototypeOf$2 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function
|
|
8633
|
-
|
|
8634
|
-
|
|
8635
|
-
};
|
|
8636
|
-
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);
|
|
8637
8355
|
}
|
|
8638
8356
|
|
|
8639
|
-
function _inheritsLoose(
|
|
8640
|
-
|
|
8641
|
-
subClass.prototype.constructor = subClass;
|
|
8642
|
-
_setPrototypeOf$2(subClass, superClass);
|
|
8357
|
+
function _inheritsLoose(t, o) {
|
|
8358
|
+
t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf$2(t, o);
|
|
8643
8359
|
}
|
|
8644
8360
|
|
|
8645
|
-
function _getPrototypeOf$2(
|
|
8646
|
-
_getPrototypeOf$2 = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function
|
|
8647
|
-
return
|
|
8648
|
-
};
|
|
8649
|
-
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);
|
|
8650
8365
|
}
|
|
8651
8366
|
|
|
8652
|
-
function _isNativeFunction(
|
|
8653
|
-
|
|
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
|
+
}
|
|
8654
8373
|
}
|
|
8655
8374
|
|
|
8656
8375
|
function _isNativeReflectConstruct$1() {
|
|
8657
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
8658
|
-
if (Reflect.construct.sham) return false;
|
|
8659
|
-
if (typeof Proxy === "function") return true;
|
|
8660
|
-
|
|
8661
8376
|
try {
|
|
8662
|
-
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
8663
|
-
|
|
8664
|
-
|
|
8665
|
-
return
|
|
8666
|
-
}
|
|
8377
|
+
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
8378
|
+
} catch (t) {}
|
|
8379
|
+
return (_isNativeReflectConstruct$1 = function _isNativeReflectConstruct() {
|
|
8380
|
+
return !!t;
|
|
8381
|
+
})();
|
|
8667
8382
|
}
|
|
8668
8383
|
|
|
8669
|
-
function _construct(
|
|
8670
|
-
if (_isNativeReflectConstruct$1())
|
|
8671
|
-
|
|
8672
|
-
|
|
8673
|
-
|
|
8674
|
-
|
|
8675
|
-
a.push.apply(a, args);
|
|
8676
|
-
var Constructor = Function.bind.apply(Parent, a);
|
|
8677
|
-
var instance = new Constructor();
|
|
8678
|
-
if (Class) _setPrototypeOf$2(instance, Class.prototype);
|
|
8679
|
-
return instance;
|
|
8680
|
-
};
|
|
8681
|
-
}
|
|
8682
|
-
|
|
8683
|
-
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;
|
|
8684
8390
|
}
|
|
8685
8391
|
|
|
8686
|
-
function _wrapNativeSuper(
|
|
8687
|
-
var
|
|
8688
|
-
|
|
8689
|
-
|
|
8690
|
-
if (
|
|
8691
|
-
|
|
8692
|
-
|
|
8693
|
-
|
|
8694
|
-
}
|
|
8695
|
-
|
|
8696
|
-
if (typeof _cache !== "undefined") {
|
|
8697
|
-
if (_cache.has(Class)) return _cache.get(Class);
|
|
8698
|
-
|
|
8699
|
-
_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);
|
|
8700
8400
|
}
|
|
8701
|
-
|
|
8702
8401
|
function Wrapper() {
|
|
8703
|
-
return _construct(
|
|
8402
|
+
return _construct(t, arguments, _getPrototypeOf$2(this).constructor);
|
|
8704
8403
|
}
|
|
8705
|
-
|
|
8706
|
-
Wrapper.prototype = Object.create(Class.prototype, {
|
|
8404
|
+
return Wrapper.prototype = Object.create(t.prototype, {
|
|
8707
8405
|
constructor: {
|
|
8708
8406
|
value: Wrapper,
|
|
8709
|
-
enumerable:
|
|
8710
|
-
writable:
|
|
8711
|
-
configurable:
|
|
8407
|
+
enumerable: !1,
|
|
8408
|
+
writable: !0,
|
|
8409
|
+
configurable: !0
|
|
8712
8410
|
}
|
|
8713
|
-
});
|
|
8714
|
-
|
|
8715
|
-
};
|
|
8716
|
-
|
|
8717
|
-
return _wrapNativeSuper(Class);
|
|
8411
|
+
}), _setPrototypeOf$2(Wrapper, t);
|
|
8412
|
+
}, _wrapNativeSuper(t);
|
|
8718
8413
|
}
|
|
8719
8414
|
|
|
8720
8415
|
// based on https://github.com/styled-components/styled-components/blob/fcf6f3804c57a14dd7984dfab7bc06ee2edca044/src/utils/error.js
|
|
@@ -9383,10 +9078,9 @@
|
|
|
9383
9078
|
}, function (props) {
|
|
9384
9079
|
return getSliderMarkStyle(props);
|
|
9385
9080
|
});
|
|
9386
|
-
|
|
9387
9081
|
var getSliderMarkStyle = function getSliderMarkStyle(_ref) {
|
|
9388
9082
|
var showMarks = _ref.showMarks,
|
|
9389
|
-
|
|
9083
|
+
primary = _ref.theme.colors.primary;
|
|
9390
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 "])));
|
|
9391
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);
|
|
9392
9086
|
};
|
|
@@ -9398,28 +9092,24 @@
|
|
|
9398
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"])));
|
|
9399
9093
|
|
|
9400
9094
|
var _excluded$4 = ["dragging", "value", "offset", "index"],
|
|
9401
|
-
|
|
9402
|
-
|
|
9095
|
+
_excluded2 = ["renderTitleSection", "marks", "defaultMinValue", "defaultMaxValue", "min", "max", "toolTipComponent", "renderFooterSection", "onChange", "children", "identifier", "showMarks"];
|
|
9403
9096
|
var _templateObject$j;
|
|
9404
9097
|
var debounceBuilder$1 = functions.debounced(100);
|
|
9405
9098
|
var ChildrenWrapper = styled__default.div(_templateObject$j || (_templateObject$j = _taggedTemplateLiteral(["\n margin-bottom: ", ";\n"])), function (props) {
|
|
9406
9099
|
return props.theme.marginPaddings[3];
|
|
9407
9100
|
});
|
|
9408
|
-
|
|
9409
9101
|
var renderCustomHandle = function renderCustomHandle() {
|
|
9410
9102
|
var marks = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
9411
9103
|
var toolTipComponent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
|
9412
9104
|
var handleProps = arguments.length > 2 ? arguments[2] : undefined;
|
|
9413
|
-
|
|
9414
9105
|
var dragging = handleProps.dragging,
|
|
9415
|
-
|
|
9416
|
-
|
|
9417
|
-
|
|
9418
|
-
|
|
9419
|
-
|
|
9106
|
+
value = handleProps.value,
|
|
9107
|
+
offset = handleProps.offset,
|
|
9108
|
+
index = handleProps.index,
|
|
9109
|
+
restHandleProps = _objectWithoutProperties(handleProps, _excluded$4);
|
|
9420
9110
|
var getToolTipProps = function getToolTipProps() {
|
|
9421
|
-
var newProps = {};
|
|
9422
|
-
|
|
9111
|
+
var newProps = {};
|
|
9112
|
+
// Ensures that Tooltip component does not get ref prop
|
|
9423
9113
|
Object.keys(handleProps).forEach(function (propName) {
|
|
9424
9114
|
if (propName !== 'ref') {
|
|
9425
9115
|
newProps[propName] = handleProps[propName];
|
|
@@ -9427,7 +9117,6 @@
|
|
|
9427
9117
|
});
|
|
9428
9118
|
return newProps;
|
|
9429
9119
|
};
|
|
9430
|
-
|
|
9431
9120
|
var Tooltip = toolTipComponent;
|
|
9432
9121
|
return /*#__PURE__*/React__default.createElement(React.Fragment, {
|
|
9433
9122
|
key: index
|
|
@@ -9444,55 +9133,47 @@
|
|
|
9444
9133
|
marks: marks
|
|
9445
9134
|
}, getToolTipProps()))));
|
|
9446
9135
|
};
|
|
9447
|
-
/** slider ui component for react */
|
|
9448
|
-
|
|
9449
9136
|
|
|
9137
|
+
/** slider ui component for react */
|
|
9450
9138
|
var RangeSlider = function RangeSlider(_ref) {
|
|
9451
9139
|
var renderTitleSection = _ref.renderTitleSection,
|
|
9452
|
-
|
|
9453
|
-
|
|
9454
|
-
|
|
9455
|
-
|
|
9456
|
-
|
|
9457
|
-
|
|
9458
|
-
|
|
9459
|
-
|
|
9460
|
-
|
|
9461
|
-
|
|
9462
|
-
|
|
9463
|
-
|
|
9464
|
-
|
|
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);
|
|
9465
9152
|
var _useState = React.useState(defaultMinValue),
|
|
9466
|
-
|
|
9467
|
-
|
|
9468
|
-
|
|
9469
|
-
|
|
9153
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
9154
|
+
currMinVal = _useState2[0],
|
|
9155
|
+
setMinVal = _useState2[1];
|
|
9470
9156
|
var _useState3 = React.useState(defaultMaxValue),
|
|
9471
|
-
|
|
9472
|
-
|
|
9473
|
-
|
|
9157
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
9158
|
+
currMaxVal = _useState4[0],
|
|
9159
|
+
setMaxVal = _useState4[1];
|
|
9474
9160
|
/*
|
|
9475
9161
|
*Description variable stores the time that the component renders
|
|
9476
9162
|
* the state is used to enforce reenders for the component since the date now
|
|
9477
9163
|
* is always changing
|
|
9478
9164
|
* */
|
|
9479
|
-
|
|
9480
|
-
|
|
9481
9165
|
var _useState5 = React.useState(0),
|
|
9482
|
-
|
|
9483
|
-
|
|
9484
|
-
|
|
9485
|
-
|
|
9166
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
9167
|
+
seed = _useState6[0],
|
|
9168
|
+
setSeed = _useState6[1];
|
|
9486
9169
|
var manuallyChangeMinValue = function manuallyChangeMinValue(val) {
|
|
9487
9170
|
setMinVal(val);
|
|
9488
9171
|
setSeed(Date.now());
|
|
9489
9172
|
};
|
|
9490
|
-
|
|
9491
9173
|
var manuallyChangeMaxValue = function manuallyChangeMaxValue(val) {
|
|
9492
9174
|
setMaxVal(val);
|
|
9493
9175
|
setSeed(Date.now());
|
|
9494
9176
|
};
|
|
9495
|
-
|
|
9496
9177
|
var prevMinVal = functions.usePrevious(currMinVal);
|
|
9497
9178
|
var prevMaxVal = functions.usePrevious(currMaxVal);
|
|
9498
9179
|
React.useEffect(function () {
|
|
@@ -9528,9 +9209,8 @@
|
|
|
9528
9209
|
defaultValue: [defaultMinValue, defaultMaxValue],
|
|
9529
9210
|
onChange: function onChange(_ref2) {
|
|
9530
9211
|
var _ref3 = _slicedToArray(_ref2, 2),
|
|
9531
|
-
|
|
9532
|
-
|
|
9533
|
-
|
|
9212
|
+
nextMin = _ref3[0],
|
|
9213
|
+
nextMax = _ref3[1];
|
|
9534
9214
|
setMinVal(nextMin);
|
|
9535
9215
|
setMaxVal(nextMax);
|
|
9536
9216
|
},
|
|
@@ -9543,7 +9223,6 @@
|
|
|
9543
9223
|
allowCross: false
|
|
9544
9224
|
}, restProps)), /*#__PURE__*/React__default.createElement(Footer, null, renderFooterSection(actionsObj)));
|
|
9545
9225
|
};
|
|
9546
|
-
|
|
9547
9226
|
RangeSlider.defaultProps = {
|
|
9548
9227
|
renderTitleSection: function renderTitleSection() {
|
|
9549
9228
|
return false;
|
|
@@ -9565,7 +9244,6 @@
|
|
|
9565
9244
|
var shoe_sizes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
9566
9245
|
return shoe_sizes.length - 1;
|
|
9567
9246
|
};
|
|
9568
|
-
|
|
9569
9247
|
var formatResultsForRangeSlider = function formatResultsForRangeSlider() {
|
|
9570
9248
|
var shoe_sizes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
9571
9249
|
var newDataShape = {};
|
|
@@ -9575,28 +9253,24 @@
|
|
|
9575
9253
|
});
|
|
9576
9254
|
return newDataShape;
|
|
9577
9255
|
};
|
|
9578
|
-
|
|
9579
9256
|
var ToolTipComponent = function ToolTipComponent(props) {
|
|
9580
9257
|
var marks = props.marks,
|
|
9581
|
-
|
|
9258
|
+
value = props.value;
|
|
9582
9259
|
return /*#__PURE__*/React__default.createElement("div", null, marks[value]);
|
|
9583
9260
|
};
|
|
9584
|
-
/** slider ui component for shoe size selection interests */
|
|
9585
|
-
|
|
9586
9261
|
|
|
9262
|
+
/** slider ui component for shoe size selection interests */
|
|
9587
9263
|
var ShoeSizeSelector = function ShoeSizeSelector(_ref2) {
|
|
9588
9264
|
var onChange = _ref2.onChange,
|
|
9589
|
-
|
|
9590
|
-
|
|
9265
|
+
shoeSizes = _ref2.shoeSizes;
|
|
9591
9266
|
var handleShoeSizeChange = function handleShoeSizeChange(value) {
|
|
9592
9267
|
var min_shoe_key = value.min,
|
|
9593
|
-
|
|
9268
|
+
max_shoe_key = value.max;
|
|
9594
9269
|
onChange({
|
|
9595
9270
|
min_shoe_size_id: shoeSizes[min_shoe_key].id,
|
|
9596
9271
|
max_shoe_size_id: shoeSizes[max_shoe_key].id
|
|
9597
9272
|
});
|
|
9598
9273
|
};
|
|
9599
|
-
|
|
9600
9274
|
var getFooterButtons = function getFooterButtons(actionObj) {
|
|
9601
9275
|
var giveFullRange = actionObj.giveFullRange;
|
|
9602
9276
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(InvertedTextButton$1, {
|
|
@@ -9605,7 +9279,6 @@
|
|
|
9605
9279
|
onClick: giveFullRange
|
|
9606
9280
|
}, "Full Shoe Size Range"));
|
|
9607
9281
|
};
|
|
9608
|
-
|
|
9609
9282
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(RangeSlider$1, {
|
|
9610
9283
|
identifier: "shoe-size-range-slider",
|
|
9611
9284
|
marks: formatResultsForRangeSlider(shoeSizes),
|
|
@@ -9618,7 +9291,6 @@
|
|
|
9618
9291
|
onChange: handleShoeSizeChange
|
|
9619
9292
|
}));
|
|
9620
9293
|
};
|
|
9621
|
-
|
|
9622
9294
|
ShoeSizeSelector.defaultProps = {
|
|
9623
9295
|
onChange: function onChange() {
|
|
9624
9296
|
return false;
|
|
@@ -9667,7 +9339,6 @@
|
|
|
9667
9339
|
var inputMarginRight = '0.2em';
|
|
9668
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) {
|
|
9669
9341
|
var _props$theme;
|
|
9670
|
-
|
|
9671
9342
|
return (_props$theme = props.theme) !== null && _props$theme !== void 0 && _props$theme.fontSizes.length ? props.theme.fontSizes[4] : '1em';
|
|
9672
9343
|
}, function (props) {
|
|
9673
9344
|
return props.theme.fontSizes[4];
|
|
@@ -9691,16 +9362,14 @@
|
|
|
9691
9362
|
*/
|
|
9692
9363
|
var RadioButtons = function RadioButtons(_ref) {
|
|
9693
9364
|
var options = _ref.options,
|
|
9694
|
-
|
|
9695
|
-
|
|
9696
|
-
|
|
9697
|
-
|
|
9698
|
-
|
|
9365
|
+
name = _ref.name,
|
|
9366
|
+
noWrap = _ref.noWrap,
|
|
9367
|
+
title = _ref.title,
|
|
9368
|
+
errors = _ref.errors;
|
|
9699
9369
|
var _useState = React.useState(errors[name]),
|
|
9700
|
-
|
|
9701
|
-
|
|
9702
|
-
|
|
9703
|
-
|
|
9370
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
9371
|
+
errMsg = _useState2[0],
|
|
9372
|
+
setErrMsg = _useState2[1];
|
|
9704
9373
|
React.useEffect(function () {
|
|
9705
9374
|
setErrMsg(errors[name]);
|
|
9706
9375
|
}, [errors, name]);
|
|
@@ -9708,15 +9377,15 @@
|
|
|
9708
9377
|
noWrap: noWrap
|
|
9709
9378
|
}, options.map(function (_ref2, index) {
|
|
9710
9379
|
var _ref2$actionCallback = _ref2.actionCallback,
|
|
9711
|
-
|
|
9712
|
-
|
|
9713
|
-
|
|
9714
|
-
|
|
9715
|
-
|
|
9716
|
-
|
|
9717
|
-
|
|
9718
|
-
|
|
9719
|
-
|
|
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;
|
|
9720
9389
|
return /*#__PURE__*/React__default.createElement(RadioButtonLabel, {
|
|
9721
9390
|
key: "".concat(name, "-").concat(index),
|
|
9722
9391
|
htmlFor: "".concat(name, "_").concat(index)
|
|
@@ -9733,7 +9402,6 @@
|
|
|
9733
9402
|
}), /*#__PURE__*/React__default.createElement(RadioButtonCircle, null, /*#__PURE__*/React__default.createElement(RadioButtonCircleInner, null)), /*#__PURE__*/React__default.createElement(RadioButtonText, null, innerText));
|
|
9734
9403
|
}))), errMsg && /*#__PURE__*/React__default.createElement(ErrorMessage$1, null, errMsg));
|
|
9735
9404
|
};
|
|
9736
|
-
|
|
9737
9405
|
RadioButtons.defaultProps = {
|
|
9738
9406
|
noWrap: false,
|
|
9739
9407
|
title: '',
|
|
@@ -9765,17 +9433,14 @@
|
|
|
9765
9433
|
ShoeSizeFadeContainer.defaultProps = {
|
|
9766
9434
|
childVisible: false
|
|
9767
9435
|
};
|
|
9768
|
-
|
|
9769
9436
|
var OpacityTransitionRender = function OpacityTransitionRender(_ref) {
|
|
9770
9437
|
var shoeSizeType = _ref.shoeSizeType,
|
|
9771
|
-
|
|
9438
|
+
children = _ref.children;
|
|
9772
9439
|
var prevShoeSizeType = functions.usePrevious(shoeSizeType);
|
|
9773
|
-
|
|
9774
9440
|
var _React$useState = React__default.useState(false),
|
|
9775
|
-
|
|
9776
|
-
|
|
9777
|
-
|
|
9778
|
-
|
|
9441
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
9442
|
+
childVisible = _React$useState2[0],
|
|
9443
|
+
setChildVisible = _React$useState2[1];
|
|
9779
9444
|
React__default.useEffect(function () {
|
|
9780
9445
|
if (prevShoeSizeType !== shoeSizeType) {
|
|
9781
9446
|
setChildVisible(false);
|
|
@@ -9788,30 +9453,25 @@
|
|
|
9788
9453
|
childVisible: childVisible
|
|
9789
9454
|
}, children);
|
|
9790
9455
|
};
|
|
9791
|
-
|
|
9792
9456
|
var WrappedShoeSizeSelector = function WrappedShoeSizeSelector(_ref2) {
|
|
9793
9457
|
var onChange = _ref2.onChange,
|
|
9794
|
-
|
|
9795
|
-
|
|
9796
|
-
|
|
9797
|
-
|
|
9798
|
-
|
|
9458
|
+
requestInstance = _ref2.requestInstance,
|
|
9459
|
+
graphApi = _ref2.graphApi,
|
|
9460
|
+
defaultShoeSizeType = _ref2.defaultShoeSizeType,
|
|
9461
|
+
getGraphQuery = _ref2.getGraphQuery;
|
|
9799
9462
|
var _useState = React.useState(defaultShoeSizeType),
|
|
9800
|
-
|
|
9801
|
-
|
|
9802
|
-
|
|
9803
|
-
|
|
9463
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
9464
|
+
shoeSizeType = _useState2[0],
|
|
9465
|
+
setShoeSizeType = _useState2[1];
|
|
9804
9466
|
var _useState3 = React.useState(defaultShoeSizeType),
|
|
9805
|
-
|
|
9806
|
-
|
|
9807
|
-
|
|
9808
|
-
|
|
9467
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
9468
|
+
transitionedTo = _useState4[0],
|
|
9469
|
+
setTransitionedTo = _useState4[1];
|
|
9809
9470
|
var triggerRequest = function triggerRequest() {
|
|
9810
9471
|
return requestInstance.post(graphApi, {
|
|
9811
9472
|
query: getGraphQuery()
|
|
9812
9473
|
});
|
|
9813
9474
|
};
|
|
9814
|
-
|
|
9815
9475
|
var shoeSizeTypeProps = {
|
|
9816
9476
|
name: 'shoe_size_type',
|
|
9817
9477
|
noWrap: true,
|
|
@@ -9835,15 +9495,12 @@
|
|
|
9835
9495
|
checked: shoeSizeType === shoeSizeTypes.eu.value
|
|
9836
9496
|
}]
|
|
9837
9497
|
};
|
|
9838
|
-
|
|
9839
9498
|
var handlePropOnChange = function handlePropOnChange(value) {
|
|
9840
9499
|
var payload = _objectSpread2(_objectSpread2({}, value), {}, {
|
|
9841
9500
|
shoe_size_type: shoeSizeType
|
|
9842
9501
|
});
|
|
9843
|
-
|
|
9844
9502
|
onChange(payload);
|
|
9845
9503
|
};
|
|
9846
|
-
|
|
9847
9504
|
var renderShoeSizeSelector = function renderShoeSizeSelector() {
|
|
9848
9505
|
var passedShoeSizes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
9849
9506
|
return /*#__PURE__*/React__default.createElement(ShoeSizeSelector, {
|
|
@@ -9853,38 +9510,32 @@
|
|
|
9853
9510
|
}
|
|
9854
9511
|
});
|
|
9855
9512
|
};
|
|
9856
|
-
|
|
9857
9513
|
var getShoeSizeSelector = function getShoeSizeSelector() {
|
|
9858
9514
|
var euShoeSizes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
9859
9515
|
var ukShoeShoes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
9860
|
-
|
|
9861
9516
|
if (shoeSizeType === shoeSizeTypes.eu.value) {
|
|
9862
9517
|
return renderShoeSizeSelector(euShoeSizes);
|
|
9863
9518
|
}
|
|
9864
|
-
|
|
9865
9519
|
if (shoeSizeType === shoeSizeTypes.uk.value) {
|
|
9866
9520
|
return renderShoeSizeSelector(ukShoeShoes);
|
|
9867
9521
|
}
|
|
9868
|
-
|
|
9869
9522
|
return null;
|
|
9870
9523
|
};
|
|
9871
|
-
|
|
9872
9524
|
return /*#__PURE__*/React__default.createElement(LuxityPageReady, {
|
|
9873
9525
|
getRequestPromise: triggerRequest
|
|
9874
9526
|
}, /*#__PURE__*/React__default.createElement(TitleWrapper, null, /*#__PURE__*/React__default.createElement(InterestsSubheading, {
|
|
9875
9527
|
title: "Shoe Size Range"
|
|
9876
9528
|
}, /*#__PURE__*/React__default.createElement(RadioButtons$1, shoeSizeTypeProps))), /*#__PURE__*/React__default.createElement(LuxityPageReadyContext.Consumer, null, function (_ref3) {
|
|
9877
9529
|
var _ref3$data$data = _ref3.data.data,
|
|
9878
|
-
|
|
9879
|
-
|
|
9880
|
-
|
|
9881
|
-
|
|
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;
|
|
9882
9534
|
return /*#__PURE__*/React__default.createElement(OpacityTransitionRender, {
|
|
9883
9535
|
shoeSizeType: transitionedTo
|
|
9884
9536
|
}, getShoeSizeSelector(luxity_eu_shoe_sizes, luxity_uk_shoe_sizes));
|
|
9885
9537
|
}));
|
|
9886
9538
|
};
|
|
9887
|
-
|
|
9888
9539
|
WrappedShoeSizeSelector.defaultProps = {
|
|
9889
9540
|
onChange: function onChange() {
|
|
9890
9541
|
return false;
|
|
@@ -9896,31 +9547,28 @@
|
|
|
9896
9547
|
var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
9897
9548
|
return value.replace(/\D/g, '');
|
|
9898
9549
|
};
|
|
9550
|
+
|
|
9899
9551
|
/**
|
|
9900
9552
|
* Currency Input which formats the value to a specific format
|
|
9901
9553
|
*/
|
|
9902
|
-
|
|
9903
9554
|
var CurrencyInputFormatter = function CurrencyInputFormatter(_ref) {
|
|
9904
9555
|
var value = _ref.value,
|
|
9905
|
-
|
|
9906
|
-
|
|
9907
|
-
|
|
9908
|
-
|
|
9909
|
-
|
|
9910
|
-
|
|
9911
|
-
|
|
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);
|
|
9912
9562
|
var handleValueChange = function handleValueChange(event) {
|
|
9913
9563
|
var inputValue = event.target.value;
|
|
9914
9564
|
var unmaskedValue = unMask(inputValue);
|
|
9915
9565
|
onChange(unmaskedValue);
|
|
9916
9566
|
};
|
|
9917
|
-
|
|
9918
9567
|
var formatCurrency = function formatCurrency(originalValue) {
|
|
9919
9568
|
var numericValue = Number(originalValue);
|
|
9920
9569
|
var formattedValue = numericValue.toLocaleString('en-US');
|
|
9921
9570
|
return prefix + formattedValue;
|
|
9922
9571
|
};
|
|
9923
|
-
|
|
9924
9572
|
var formattedValue = formatCurrency(value);
|
|
9925
9573
|
return /*#__PURE__*/React__default.createElement("input", _extends({}, rest, {
|
|
9926
9574
|
type: "text",
|
|
@@ -9928,7 +9576,6 @@
|
|
|
9928
9576
|
onChange: handleValueChange
|
|
9929
9577
|
}));
|
|
9930
9578
|
};
|
|
9931
|
-
|
|
9932
9579
|
CurrencyInputFormatter.defaultProps = {
|
|
9933
9580
|
value: '',
|
|
9934
9581
|
prefix: 'R',
|
|
@@ -9939,7 +9586,6 @@
|
|
|
9939
9586
|
};
|
|
9940
9587
|
|
|
9941
9588
|
var _excluded$6 = ["children"];
|
|
9942
|
-
|
|
9943
9589
|
var _templateObject$u;
|
|
9944
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) {
|
|
9945
9591
|
return props.theme.colors.ntrlMin;
|
|
@@ -9954,14 +9600,11 @@
|
|
|
9954
9600
|
}, disabledButtonStyle, function (props) {
|
|
9955
9601
|
return props.theme.colors.base;
|
|
9956
9602
|
});
|
|
9957
|
-
|
|
9958
9603
|
var SecondaryButton = function SecondaryButton(_ref) {
|
|
9959
9604
|
var children = _ref.children,
|
|
9960
|
-
|
|
9961
|
-
|
|
9605
|
+
restProps = _objectWithoutProperties(_ref, _excluded$6);
|
|
9962
9606
|
return /*#__PURE__*/React__default.createElement(Button$4, restProps, children);
|
|
9963
9607
|
};
|
|
9964
|
-
|
|
9965
9608
|
var SecondaryButton$1 = themed(SecondaryButton);
|
|
9966
9609
|
|
|
9967
9610
|
var _templateObject$v;
|
|
@@ -9970,31 +9613,23 @@
|
|
|
9970
9613
|
});
|
|
9971
9614
|
|
|
9972
9615
|
var debounceBuilder$2 = functions.debounced(50);
|
|
9973
|
-
|
|
9974
9616
|
var getMaxPrice = function getMaxPrice() {
|
|
9975
9617
|
var interestCategory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
9976
|
-
|
|
9977
9618
|
switch (interestCategory) {
|
|
9978
9619
|
case interestCategories.ACCESSORIES:
|
|
9979
9620
|
return interestCategoryMaxPrices.ACCESSORIES;
|
|
9980
|
-
|
|
9981
9621
|
case interestCategories.BAGS:
|
|
9982
9622
|
return interestCategoryMaxPrices.BAGS;
|
|
9983
|
-
|
|
9984
9623
|
case interestCategories.SHOES:
|
|
9985
9624
|
return interestCategoryMaxPrices.SHOES;
|
|
9986
|
-
|
|
9987
9625
|
case interestCategories.WATCHES:
|
|
9988
9626
|
return interestCategoryMaxPrices.WATCHES;
|
|
9989
|
-
|
|
9990
9627
|
case interestCategories.APPAREL:
|
|
9991
9628
|
return interestCategoryMaxPrices.APPAREL;
|
|
9992
|
-
|
|
9993
9629
|
default:
|
|
9994
9630
|
return 0;
|
|
9995
9631
|
}
|
|
9996
9632
|
};
|
|
9997
|
-
|
|
9998
9633
|
var getFooterButtons = function getFooterButtons(actionObj) {
|
|
9999
9634
|
var giveFullRange = actionObj.giveFullRange;
|
|
10000
9635
|
return /*#__PURE__*/React__default.createElement(SecondaryButton$1, {
|
|
@@ -10002,24 +9637,21 @@
|
|
|
10002
9637
|
onClick: giveFullRange
|
|
10003
9638
|
}, "Full Price Range");
|
|
10004
9639
|
};
|
|
9640
|
+
|
|
10005
9641
|
/** UI Slider with minimum and max input fields give the ability to
|
|
10006
9642
|
* select a price range */
|
|
10007
|
-
|
|
10008
|
-
|
|
10009
9643
|
var PriceRangeSelector = function PriceRangeSelector(_ref) {
|
|
10010
9644
|
var onChange = _ref.onChange,
|
|
10011
|
-
|
|
9645
|
+
category = _ref.category;
|
|
10012
9646
|
var maxPrice = getMaxPrice(category);
|
|
10013
|
-
|
|
10014
9647
|
var handleSlideChange = function handleSlideChange(value) {
|
|
10015
9648
|
var min_price = value.min,
|
|
10016
|
-
|
|
9649
|
+
max_price = value.max;
|
|
10017
9650
|
onChange({
|
|
10018
9651
|
min_price: min_price,
|
|
10019
9652
|
max_price: max_price
|
|
10020
9653
|
});
|
|
10021
9654
|
};
|
|
10022
|
-
|
|
10023
9655
|
var handleMinCurrencyChange = function handleMinCurrencyChange(targetValue, currMaxVal, manuallyChangeMinValue) {
|
|
10024
9656
|
var value = parseInt(unMask(targetValue), 10);
|
|
10025
9657
|
value = Number.isNaN(value) ? 0 : value;
|
|
@@ -10032,7 +9664,6 @@
|
|
|
10032
9664
|
});
|
|
10033
9665
|
});
|
|
10034
9666
|
};
|
|
10035
|
-
|
|
10036
9667
|
var handleMaxCurrencyChange = function handleMaxCurrencyChange(targetValue, currMinVal, manuallyChangeMaxValue) {
|
|
10037
9668
|
var value = parseInt(unMask(targetValue), 10);
|
|
10038
9669
|
value = Number.isNaN(value) ? 0 : value;
|
|
@@ -10045,7 +9676,6 @@
|
|
|
10045
9676
|
});
|
|
10046
9677
|
});
|
|
10047
9678
|
};
|
|
10048
|
-
|
|
10049
9679
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
10050
9680
|
className: "price-ranges"
|
|
10051
9681
|
}, /*#__PURE__*/React__default.createElement(RangeSlider$1, {
|
|
@@ -10064,9 +9694,9 @@
|
|
|
10064
9694
|
title: "Price Ranges"
|
|
10065
9695
|
}, function (_ref2) {
|
|
10066
9696
|
var manuallyChangeMinValue = _ref2.manuallyChangeMinValue,
|
|
10067
|
-
|
|
10068
|
-
|
|
10069
|
-
|
|
9697
|
+
manuallyChangeMaxValue = _ref2.manuallyChangeMaxValue,
|
|
9698
|
+
currMinVal = _ref2.currMinVal,
|
|
9699
|
+
currMaxVal = _ref2.currMaxVal;
|
|
10070
9700
|
return /*#__PURE__*/React__default.createElement(CurrencyInputWrapper, null, /*#__PURE__*/React__default.createElement(CurrencyInputFormatter, {
|
|
10071
9701
|
"data-qe-id": "masked-input-min",
|
|
10072
9702
|
value: currMinVal,
|
|
@@ -10082,7 +9712,6 @@
|
|
|
10082
9712
|
}));
|
|
10083
9713
|
}));
|
|
10084
9714
|
};
|
|
10085
|
-
|
|
10086
9715
|
PriceRangeSelector.defaultProps = {
|
|
10087
9716
|
onChange: function onChange() {
|
|
10088
9717
|
return false;
|
|
@@ -10106,7 +9735,6 @@
|
|
|
10106
9735
|
});
|
|
10107
9736
|
|
|
10108
9737
|
var _excluded$7 = ["title", "checked", "renderIcon", "onChange", "checkedValue", "unCheckedValue"];
|
|
10109
|
-
|
|
10110
9738
|
var _templateObject$x, _templateObject2$6, _templateObject3$1;
|
|
10111
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) {
|
|
10112
9740
|
return props.theme.colors.primary;
|
|
@@ -10125,36 +9753,32 @@
|
|
|
10125
9753
|
}, Content, InputText, function (props) {
|
|
10126
9754
|
return props.theme.colors.ntrlMin;
|
|
10127
9755
|
}, Content);
|
|
9756
|
+
|
|
10128
9757
|
/**
|
|
10129
9758
|
* CheckButton: Styled checkbox that resembles a button
|
|
10130
9759
|
* */
|
|
10131
|
-
|
|
10132
9760
|
var CheckButton = function CheckButton(props) {
|
|
10133
9761
|
var title = props.title,
|
|
10134
|
-
|
|
10135
|
-
|
|
10136
|
-
|
|
10137
|
-
|
|
10138
|
-
|
|
10139
|
-
|
|
10140
|
-
|
|
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);
|
|
10141
9768
|
var _React$useState = React__default.useState(checked),
|
|
10142
|
-
|
|
10143
|
-
|
|
10144
|
-
|
|
10145
|
-
|
|
9769
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
9770
|
+
checkedState = _React$useState2[0],
|
|
9771
|
+
setCheck = _React$useState2[1];
|
|
10146
9772
|
var prevCheckState = functions.usePrevious(checkedState);
|
|
10147
9773
|
React__default.useEffect(function () {
|
|
10148
9774
|
if (prevCheckState !== checkedState) {
|
|
10149
9775
|
onChange(checkedState);
|
|
10150
9776
|
}
|
|
10151
9777
|
}, [checkedState, onChange, prevCheckState]);
|
|
10152
|
-
|
|
10153
9778
|
var handleInputChange = function handleInputChange(e) {
|
|
10154
9779
|
var targetChecked = e.target.checked;
|
|
10155
9780
|
setCheck(targetChecked);
|
|
10156
9781
|
};
|
|
10157
|
-
|
|
10158
9782
|
return /*#__PURE__*/React__default.createElement(StyledLabel, null, /*#__PURE__*/React__default.createElement("input", _extends({
|
|
10159
9783
|
defaultChecked: checked
|
|
10160
9784
|
}, restProps, {
|
|
@@ -10162,7 +9786,6 @@
|
|
|
10162
9786
|
onChange: handleInputChange
|
|
10163
9787
|
})), /*#__PURE__*/React__default.createElement(Content, null, /*#__PURE__*/React__default.createElement(InputText, null, title), renderIcon(checkedState)));
|
|
10164
9788
|
};
|
|
10165
|
-
|
|
10166
9789
|
CheckButton.defaultProps = {
|
|
10167
9790
|
title: '',
|
|
10168
9791
|
checked: false,
|
|
@@ -10176,29 +9799,24 @@
|
|
|
10176
9799
|
var CheckButton$1 = themed(CheckButton);
|
|
10177
9800
|
|
|
10178
9801
|
var MALE = genders.MALE,
|
|
10179
|
-
|
|
10180
|
-
|
|
9802
|
+
FEMALE = genders.FEMALE;
|
|
10181
9803
|
/**
|
|
10182
9804
|
* Stylized CheckboxButton for selecting gender
|
|
10183
9805
|
* */
|
|
10184
9806
|
var GenderCheckbox = function GenderCheckbox(_ref) {
|
|
10185
9807
|
var gender = _ref.gender,
|
|
10186
|
-
|
|
10187
|
-
|
|
10188
|
-
|
|
9808
|
+
checked = _ref.checked,
|
|
9809
|
+
onInputChange = _ref.onInputChange;
|
|
10189
9810
|
var getTitle = function getTitle() {
|
|
10190
9811
|
switch (gender) {
|
|
10191
9812
|
case MALE:
|
|
10192
9813
|
return 'Male';
|
|
10193
|
-
|
|
10194
9814
|
case FEMALE:
|
|
10195
9815
|
return 'Female';
|
|
10196
|
-
|
|
10197
9816
|
default:
|
|
10198
9817
|
return '';
|
|
10199
9818
|
}
|
|
10200
9819
|
};
|
|
10201
|
-
|
|
10202
9820
|
return /*#__PURE__*/React__default.createElement(CheckButton$1, {
|
|
10203
9821
|
onChange: onInputChange,
|
|
10204
9822
|
checked: checked,
|
|
@@ -10206,22 +9824,20 @@
|
|
|
10206
9824
|
title: getTitle()
|
|
10207
9825
|
});
|
|
10208
9826
|
};
|
|
10209
|
-
|
|
10210
9827
|
GenderCheckbox.defaultProps = {
|
|
10211
9828
|
name: ''
|
|
10212
9829
|
};
|
|
10213
9830
|
|
|
10214
9831
|
var MALE$1 = genders.MALE,
|
|
10215
|
-
|
|
10216
|
-
|
|
9832
|
+
FEMALE$1 = genders.FEMALE;
|
|
10217
9833
|
/**
|
|
10218
9834
|
* GenderSelector: specialized selector to pick genders for the Interest Component
|
|
10219
9835
|
* */
|
|
10220
9836
|
var GenderSelector = function GenderSelector(_ref) {
|
|
10221
9837
|
var gender = _ref.gender,
|
|
10222
|
-
|
|
10223
|
-
|
|
10224
|
-
|
|
9838
|
+
onChange = _ref.onChange,
|
|
9839
|
+
maleInputRef = _ref.maleInputRef,
|
|
9840
|
+
femaleInputRef = _ref.femaleInputRef;
|
|
10225
9841
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
10226
9842
|
className: "gender-selector"
|
|
10227
9843
|
}, /*#__PURE__*/React__default.createElement(InterestsSubheading, {
|
|
@@ -10246,7 +9862,6 @@
|
|
|
10246
9862
|
checkBoxButtonRef: femaleInputRef
|
|
10247
9863
|
})));
|
|
10248
9864
|
};
|
|
10249
|
-
|
|
10250
9865
|
GenderSelector.defaultProps = {
|
|
10251
9866
|
gender: null,
|
|
10252
9867
|
onChange: function onChange() {
|
|
@@ -10257,15 +9872,13 @@
|
|
|
10257
9872
|
|
|
10258
9873
|
var ConditionSelector = function ConditionSelector(_ref) {
|
|
10259
9874
|
var onChange = _ref.onChange,
|
|
10260
|
-
|
|
10261
|
-
|
|
10262
|
-
|
|
10263
|
-
|
|
10264
|
-
|
|
9875
|
+
graphApi = _ref.graphApi,
|
|
9876
|
+
itemRenderer = _ref.itemRenderer,
|
|
9877
|
+
getGraphQuery = _ref.getGraphQuery,
|
|
9878
|
+
requestInstance = _ref.requestInstance;
|
|
10265
9879
|
var resultProcessor = function resultProcessor(result) {
|
|
10266
9880
|
return result.data.data.conditions_list;
|
|
10267
9881
|
};
|
|
10268
|
-
|
|
10269
9882
|
return /*#__PURE__*/React__default.createElement(LuxityGraphQLMultiselector, {
|
|
10270
9883
|
title: "Condition",
|
|
10271
9884
|
queryId: "getCondition",
|
|
@@ -10282,7 +9895,6 @@
|
|
|
10282
9895
|
requestInstance: requestInstance
|
|
10283
9896
|
});
|
|
10284
9897
|
};
|
|
10285
|
-
|
|
10286
9898
|
ConditionSelector.defaultProps = {
|
|
10287
9899
|
itemRenderer: ItemRenderer
|
|
10288
9900
|
};
|
|
@@ -10321,41 +9933,30 @@
|
|
|
10321
9933
|
request: _objectSpread2({}, request),
|
|
10322
9934
|
isCategoriesShown: false
|
|
10323
9935
|
};
|
|
9936
|
+
|
|
10324
9937
|
/**
|
|
10325
9938
|
* Generates Interest UI and submits graph payloads as a highly specialised component
|
|
10326
9939
|
*/
|
|
10327
|
-
|
|
10328
9940
|
var AddInterest = /*#__PURE__*/function (_React$Component) {
|
|
10329
|
-
_inherits(AddInterest, _React$Component);
|
|
10330
|
-
|
|
10331
|
-
var _super = _createSuper(AddInterest);
|
|
10332
|
-
|
|
10333
9941
|
function AddInterest(props) {
|
|
10334
9942
|
var _this;
|
|
10335
|
-
|
|
10336
9943
|
_classCallCheck(this, AddInterest);
|
|
10337
|
-
|
|
10338
|
-
_this
|
|
10339
|
-
|
|
10340
|
-
_defineProperty(
|
|
10341
|
-
|
|
10342
|
-
_defineProperty(_assertThisInitialized(_this), "femaleCheckBoxRef", /*#__PURE__*/React__default.createRef());
|
|
10343
|
-
|
|
10344
|
-
_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) {
|
|
10345
9948
|
_this.setState({
|
|
10346
9949
|
category_type: categoryType,
|
|
10347
9950
|
brands: [],
|
|
10348
9951
|
styles: []
|
|
10349
9952
|
});
|
|
10350
9953
|
});
|
|
10351
|
-
|
|
10352
|
-
_defineProperty(_assertThisInitialized(_this), "onGenderChanged", function (isChecked, gender) {
|
|
9954
|
+
_defineProperty(_this, "onGenderChanged", function (isChecked, gender) {
|
|
10353
9955
|
return _this.setState(function (prevState) {
|
|
10354
9956
|
// current array of options
|
|
10355
9957
|
var gendersSelected = _toConsumableArray(prevState.gender);
|
|
10356
|
-
|
|
10357
|
-
|
|
10358
|
-
|
|
9958
|
+
var index;
|
|
9959
|
+
// check if the check box is checked or unchecked
|
|
10359
9960
|
if (isChecked) {
|
|
10360
9961
|
gendersSelected.push(gender);
|
|
10361
9962
|
} else {
|
|
@@ -10363,76 +9964,65 @@
|
|
|
10363
9964
|
index = gendersSelected.indexOf(gender);
|
|
10364
9965
|
gendersSelected.splice(index, 1);
|
|
10365
9966
|
}
|
|
10366
|
-
|
|
10367
9967
|
return {
|
|
10368
9968
|
gender: gendersSelected
|
|
10369
9969
|
};
|
|
10370
9970
|
});
|
|
10371
9971
|
});
|
|
10372
|
-
|
|
10373
|
-
_defineProperty(_assertThisInitialized(_this), "onBrandsChanged", function (brandsArray) {
|
|
9972
|
+
_defineProperty(_this, "onBrandsChanged", function (brandsArray) {
|
|
10374
9973
|
_this.setState({
|
|
10375
9974
|
brands: brandsArray.map(function (brand) {
|
|
10376
9975
|
return brand.id;
|
|
10377
9976
|
})
|
|
10378
9977
|
});
|
|
10379
9978
|
});
|
|
10380
|
-
|
|
10381
|
-
_defineProperty(_assertThisInitialized(_this), "onShoeSizesChanged", function (shoeSizes) {
|
|
9979
|
+
_defineProperty(_this, "onShoeSizesChanged", function (shoeSizes) {
|
|
10382
9980
|
_this.setState(_objectSpread2({}, shoeSizes));
|
|
10383
9981
|
});
|
|
10384
|
-
|
|
10385
|
-
_defineProperty(_assertThisInitialized(_this), "onPriceRangesChanged", function (priceRange) {
|
|
9982
|
+
_defineProperty(_this, "onPriceRangesChanged", function (priceRange) {
|
|
10386
9983
|
_this.setState(_objectSpread2({}, priceRange));
|
|
10387
9984
|
});
|
|
10388
|
-
|
|
10389
|
-
_defineProperty(_assertThisInitialized(_this), "onStylesChanged", function (stylesArray) {
|
|
9985
|
+
_defineProperty(_this, "onStylesChanged", function (stylesArray) {
|
|
10390
9986
|
_this.setState({
|
|
10391
9987
|
styles: stylesArray.map(function (style) {
|
|
10392
9988
|
return style.id;
|
|
10393
9989
|
})
|
|
10394
9990
|
});
|
|
10395
9991
|
});
|
|
10396
|
-
|
|
10397
|
-
_defineProperty(_assertThisInitialized(_this), "onConditionChanged", function (conditions) {
|
|
9992
|
+
_defineProperty(_this, "onConditionChanged", function (conditions) {
|
|
10398
9993
|
_this.setState({
|
|
10399
9994
|
condition: conditions.map(function (condition) {
|
|
10400
9995
|
return condition.id;
|
|
10401
9996
|
})
|
|
10402
9997
|
});
|
|
10403
9998
|
});
|
|
10404
|
-
|
|
10405
|
-
_defineProperty(_assertThisInitialized(_this), "payloadIsValid", function () {
|
|
9999
|
+
_defineProperty(_this, "payloadIsValid", function () {
|
|
10406
10000
|
// price/shoe-size always have initial values as soon as category is set
|
|
10407
10001
|
var category_type = _this.state.category_type;
|
|
10408
10002
|
return category_type !== null;
|
|
10409
10003
|
});
|
|
10410
|
-
|
|
10411
|
-
_defineProperty(_assertThisInitialized(_this), "submitInterest", function () {
|
|
10004
|
+
_defineProperty(_this, "submitInterest", function () {
|
|
10412
10005
|
_this.setState({
|
|
10413
10006
|
request: _objectSpread2(_objectSpread2({}, request), {}, {
|
|
10414
10007
|
fetching: true
|
|
10415
10008
|
})
|
|
10416
10009
|
});
|
|
10417
|
-
|
|
10418
10010
|
var _this$state = _this.state,
|
|
10419
|
-
|
|
10420
|
-
|
|
10421
|
-
|
|
10422
|
-
|
|
10423
|
-
|
|
10424
|
-
|
|
10425
|
-
|
|
10426
|
-
|
|
10427
|
-
|
|
10428
|
-
|
|
10429
|
-
|
|
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;
|
|
10430
10022
|
var payloadGender = gender[0];
|
|
10431
|
-
|
|
10432
10023
|
if (gender.length > 1 || !gender.length) {
|
|
10433
10024
|
payloadGender = UNISEX;
|
|
10434
10025
|
}
|
|
10435
|
-
|
|
10436
10026
|
var basePayload = {
|
|
10437
10027
|
category_type: category_type,
|
|
10438
10028
|
brands: brands,
|
|
@@ -10448,27 +10038,21 @@
|
|
|
10448
10038
|
max_shoe_size_id: max_shoe_size_id,
|
|
10449
10039
|
shoe_size_type: shoe_size_type
|
|
10450
10040
|
} : {};
|
|
10451
|
-
|
|
10452
10041
|
var payload = _objectSpread2(_objectSpread2({}, basePayload), shoeSizesPayload);
|
|
10453
|
-
|
|
10454
10042
|
simpleRequest(_this.props.requestInstance, _this.props.addInterestApi, method.POST, payload, function () {
|
|
10455
10043
|
_this.setState({
|
|
10456
10044
|
request: _objectSpread2(_objectSpread2({}, request), {}, {
|
|
10457
10045
|
success: true
|
|
10458
10046
|
})
|
|
10459
10047
|
});
|
|
10460
|
-
|
|
10461
10048
|
_this.props.onSubmitSuccess(_objectSpread2({}, payload));
|
|
10462
10049
|
}, _this.handleRequestError);
|
|
10463
10050
|
});
|
|
10464
|
-
|
|
10465
|
-
_defineProperty(_assertThisInitialized(_this), "handleRequestError", function (_ref) {
|
|
10051
|
+
_defineProperty(_this, "handleRequestError", function (_ref) {
|
|
10466
10052
|
var data = _ref.data;
|
|
10467
|
-
|
|
10468
10053
|
_this.setState({
|
|
10469
10054
|
request: _objectSpread2({}, request)
|
|
10470
10055
|
});
|
|
10471
|
-
|
|
10472
10056
|
var errorMessages = Object.keys(data).map(function (key) {
|
|
10473
10057
|
return data[key];
|
|
10474
10058
|
}).flat();
|
|
@@ -10478,37 +10062,32 @@
|
|
|
10478
10062
|
}, message);
|
|
10479
10063
|
}));
|
|
10480
10064
|
});
|
|
10481
|
-
|
|
10482
|
-
_defineProperty(_assertThisInitialized(_this), "resetState", function () {
|
|
10065
|
+
_defineProperty(_this, "resetState", function () {
|
|
10483
10066
|
_this.setState(_objectSpread2({}, defaultState));
|
|
10484
|
-
|
|
10485
10067
|
_this.props.onCancel();
|
|
10486
10068
|
});
|
|
10487
|
-
|
|
10488
|
-
_defineProperty(_assertThisInitialized(_this), "handleGenderChange", function (isChecked, gender) {
|
|
10069
|
+
_defineProperty(_this, "handleGenderChange", function (isChecked, gender) {
|
|
10489
10070
|
return _this.onGenderChanged(isChecked, gender);
|
|
10490
10071
|
});
|
|
10491
|
-
|
|
10492
|
-
_defineProperty(_assertThisInitialized(_this), "onAddInterestClick", function () {
|
|
10072
|
+
_defineProperty(_this, "onAddInterestClick", function () {
|
|
10493
10073
|
_this.setState(function (prevState) {
|
|
10494
10074
|
return _objectSpread2(_objectSpread2({}, prevState), {}, {
|
|
10495
10075
|
isCategoriesShown: true
|
|
10496
10076
|
});
|
|
10497
10077
|
});
|
|
10498
10078
|
});
|
|
10499
|
-
|
|
10500
|
-
_defineProperty(_assertThisInitialized(_this), "render", function () {
|
|
10079
|
+
_defineProperty(_this, "render", function () {
|
|
10501
10080
|
var _this$state2 = _this.state,
|
|
10502
|
-
|
|
10503
|
-
|
|
10081
|
+
category_type = _this$state2.category_type,
|
|
10082
|
+
fetching = _this$state2.request.fetching;
|
|
10504
10083
|
var _this$props = _this.props,
|
|
10505
|
-
|
|
10506
|
-
|
|
10507
|
-
|
|
10508
|
-
|
|
10509
|
-
|
|
10510
|
-
|
|
10511
|
-
|
|
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;
|
|
10512
10091
|
return /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
10513
10092
|
className: "interests__section-wrapper"
|
|
10514
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, {
|
|
@@ -10559,23 +10138,19 @@
|
|
|
10559
10138
|
type: "button",
|
|
10560
10139
|
onClick: function onClick() {
|
|
10561
10140
|
_this.submitInterest();
|
|
10562
|
-
|
|
10563
10141
|
_this.resetState();
|
|
10564
10142
|
}
|
|
10565
10143
|
}, fetching ? 'SAVING' : 'SAVE'))))))));
|
|
10566
10144
|
});
|
|
10567
|
-
|
|
10568
10145
|
_this.state = _objectSpread2({}, defaultState);
|
|
10569
10146
|
return _this;
|
|
10570
10147
|
}
|
|
10571
|
-
|
|
10148
|
+
_inherits(AddInterest, _React$Component);
|
|
10572
10149
|
return _createClass(AddInterest);
|
|
10573
10150
|
}(React__default.Component);
|
|
10574
|
-
|
|
10575
10151
|
var AddInterest$1 = themed(AddInterest);
|
|
10576
10152
|
|
|
10577
|
-
|
|
10578
|
-
|
|
10153
|
+
// Register a locale for South African currency confiuguration
|
|
10579
10154
|
numeral.register('locale', 'en-ZA', {
|
|
10580
10155
|
delimiters: {
|
|
10581
10156
|
thousands: ',',
|
|
@@ -10596,12 +10171,12 @@
|
|
|
10596
10171
|
});
|
|
10597
10172
|
numeral.locale('en-ZA');
|
|
10598
10173
|
String.locale = numeral.locale;
|
|
10174
|
+
|
|
10599
10175
|
/**
|
|
10600
10176
|
* Curreny Formatter
|
|
10601
10177
|
* @param {number} number - the number to be formatted
|
|
10602
10178
|
* @param {boolean} round - flag to indicate if the number needs to be rounded off
|
|
10603
10179
|
*/
|
|
10604
|
-
|
|
10605
10180
|
function fC(number) {
|
|
10606
10181
|
var round = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
10607
10182
|
var parsedNumber = parseFloat(number);
|
|
@@ -10639,48 +10214,35 @@
|
|
|
10639
10214
|
|
|
10640
10215
|
var _templateObject$B, _templateObject2$8, _templateObject3$3, _templateObject4$1;
|
|
10641
10216
|
var MALE$2 = genders.MALE,
|
|
10642
|
-
|
|
10643
|
-
|
|
10644
|
-
|
|
10217
|
+
FEMALE$2 = genders.FEMALE,
|
|
10218
|
+
UNISEX$1 = genders.UNISEX;
|
|
10645
10219
|
var TrashIcon = function TrashIcon(_ref) {
|
|
10646
10220
|
var onClick = _ref.onClick,
|
|
10647
|
-
|
|
10221
|
+
id = _ref.id;
|
|
10648
10222
|
return /*#__PURE__*/React__default.createElement(IconWrapper, {
|
|
10649
10223
|
onClick: onClick,
|
|
10650
10224
|
id: id
|
|
10651
10225
|
}, /*#__PURE__*/React__default.createElement(SvgWrapper$1, null, /*#__PURE__*/React__default.createElement(Trash, null)));
|
|
10652
10226
|
};
|
|
10653
|
-
|
|
10654
10227
|
var InterestItem = /*#__PURE__*/function (_React$Component) {
|
|
10655
|
-
_inherits(InterestItem, _React$Component);
|
|
10656
|
-
|
|
10657
|
-
var _super = _createSuper(InterestItem);
|
|
10658
|
-
|
|
10659
10228
|
function InterestItem(props) {
|
|
10660
10229
|
var _this;
|
|
10661
|
-
|
|
10662
10230
|
_classCallCheck(this, InterestItem);
|
|
10663
|
-
|
|
10664
|
-
_this
|
|
10665
|
-
|
|
10666
|
-
_defineProperty(_assertThisInitialized(_this), "deleteInterestItem", function () {
|
|
10231
|
+
_this = _callSuper(this, InterestItem, [props]);
|
|
10232
|
+
_defineProperty(_this, "deleteInterestItem", function () {
|
|
10667
10233
|
var id = _this.props.data.id;
|
|
10668
|
-
|
|
10669
10234
|
_this.setState({
|
|
10670
10235
|
delete: _objectSpread2(_objectSpread2({}, request), {}, {
|
|
10671
10236
|
fetching: true
|
|
10672
10237
|
})
|
|
10673
10238
|
});
|
|
10674
|
-
|
|
10675
10239
|
var url = _this.props.deleteInterestApi(id);
|
|
10676
|
-
|
|
10677
10240
|
simpleRequest(_this.props.requestInstance, url, method.DELETE, null, function () {
|
|
10678
10241
|
_this.setState({
|
|
10679
10242
|
delete: _objectSpread2(_objectSpread2({}, request), {}, {
|
|
10680
10243
|
success: true
|
|
10681
10244
|
})
|
|
10682
10245
|
});
|
|
10683
|
-
|
|
10684
10246
|
_this.props.onDeleted(_this.props.data);
|
|
10685
10247
|
}, function () {
|
|
10686
10248
|
return _this.setState({
|
|
@@ -10688,32 +10250,25 @@
|
|
|
10688
10250
|
});
|
|
10689
10251
|
});
|
|
10690
10252
|
});
|
|
10691
|
-
|
|
10692
|
-
_defineProperty(_assertThisInitialized(_this), "getGender", function (gender) {
|
|
10253
|
+
_defineProperty(_this, "getGender", function (gender) {
|
|
10693
10254
|
switch (gender) {
|
|
10694
10255
|
case MALE$2:
|
|
10695
10256
|
return 'Male';
|
|
10696
|
-
|
|
10697
10257
|
case FEMALE$2:
|
|
10698
10258
|
return 'Female';
|
|
10699
|
-
|
|
10700
10259
|
case UNISEX$1:
|
|
10701
10260
|
default:
|
|
10702
10261
|
return 'Unisex';
|
|
10703
10262
|
}
|
|
10704
10263
|
});
|
|
10705
|
-
|
|
10706
|
-
_defineProperty(_assertThisInitialized(_this), "getCategory", function (category) {
|
|
10264
|
+
_defineProperty(_this, "getCategory", function (category) {
|
|
10707
10265
|
if (category === interestCategories.APPAREL) {
|
|
10708
10266
|
return 'CLOTHING';
|
|
10709
10267
|
}
|
|
10710
|
-
|
|
10711
10268
|
return category;
|
|
10712
10269
|
});
|
|
10713
|
-
|
|
10714
|
-
_defineProperty(_assertThisInitialized(_this), "render", function () {
|
|
10270
|
+
_defineProperty(_this, "render", function () {
|
|
10715
10271
|
var _data$min_shoe_size, _data$max_shoe_size;
|
|
10716
|
-
|
|
10717
10272
|
var data = _this.props.data;
|
|
10718
10273
|
var success = _this.state.delete.success;
|
|
10719
10274
|
return /*#__PURE__*/React__default.createElement(InterestItemContainer, {
|
|
@@ -10763,16 +10318,14 @@
|
|
|
10763
10318
|
}
|
|
10764
10319
|
}));
|
|
10765
10320
|
});
|
|
10766
|
-
|
|
10767
10321
|
_this.state = {
|
|
10768
10322
|
delete: _objectSpread2({}, request)
|
|
10769
10323
|
};
|
|
10770
10324
|
return _this;
|
|
10771
10325
|
}
|
|
10772
|
-
|
|
10326
|
+
_inherits(InterestItem, _React$Component);
|
|
10773
10327
|
return _createClass(InterestItem);
|
|
10774
10328
|
}(React__default.Component);
|
|
10775
|
-
|
|
10776
10329
|
var SheoSizeContentDiv = styled__default.div(_templateObject$B || (_templateObject$B = _taggedTemplateLiteral(["\n @media (max-width: ", ") {\n display: none;\n }\n"])), media.xs);
|
|
10777
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);
|
|
10778
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);
|
|
@@ -10788,11 +10341,11 @@
|
|
|
10788
10341
|
return props.theme.marginPaddings[0];
|
|
10789
10342
|
}, media.xs);
|
|
10790
10343
|
var ThemedInterestItem = themed(InterestItem);
|
|
10344
|
+
|
|
10791
10345
|
/**
|
|
10792
10346
|
* The Interest Item view shows the selected interest configuration,
|
|
10793
10347
|
* and gives user control to delete it.
|
|
10794
10348
|
*/
|
|
10795
|
-
|
|
10796
10349
|
var InterestItem$1 = (function (props) {
|
|
10797
10350
|
return /*#__PURE__*/React__default.createElement(ThemedInterestItem, props);
|
|
10798
10351
|
});
|
|
@@ -10805,7 +10358,6 @@
|
|
|
10805
10358
|
}, function (props) {
|
|
10806
10359
|
return props.theme.marginPaddings[1];
|
|
10807
10360
|
}, media.xs);
|
|
10808
|
-
|
|
10809
10361
|
var MyInterestTitleHeading = function MyInterestTitleHeading() {
|
|
10810
10362
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
10811
10363
|
className: "interests__title"
|
|
@@ -10827,7 +10379,6 @@
|
|
|
10827
10379
|
className: "heading-title-empty"
|
|
10828
10380
|
})));
|
|
10829
10381
|
};
|
|
10830
|
-
|
|
10831
10382
|
var MyInterestTitleHeading$1 = themed(MyInterestTitleHeading);
|
|
10832
10383
|
|
|
10833
10384
|
var _templateObject$D;
|
|
@@ -10836,7 +10387,6 @@
|
|
|
10836
10387
|
}, function (props) {
|
|
10837
10388
|
return props.theme.marginPaddings[1];
|
|
10838
10389
|
}, media.xs);
|
|
10839
|
-
|
|
10840
10390
|
var MyProductInterestTitleHeading = function MyProductInterestTitleHeading() {
|
|
10841
10391
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
10842
10392
|
className: "interests__title"
|
|
@@ -10852,7 +10402,6 @@
|
|
|
10852
10402
|
className: "heading-title-empty"
|
|
10853
10403
|
})));
|
|
10854
10404
|
};
|
|
10855
|
-
|
|
10856
10405
|
var MyProductInterestTitleHeading$1 = themed(MyProductInterestTitleHeading);
|
|
10857
10406
|
|
|
10858
10407
|
var Add = (function (props) {
|
|
@@ -10875,7 +10424,6 @@
|
|
|
10875
10424
|
|
|
10876
10425
|
function getToken() {
|
|
10877
10426
|
var _Cookies$get;
|
|
10878
|
-
|
|
10879
10427
|
return (_Cookies$get = Cookies.get('_tk')) === null || _Cookies$get === void 0 ? void 0 : _Cookies$get.replace('*', 'Bearer ');
|
|
10880
10428
|
}
|
|
10881
10429
|
function setToken(value) {
|
|
@@ -10883,35 +10431,29 @@
|
|
|
10883
10431
|
}
|
|
10884
10432
|
|
|
10885
10433
|
/** @format */
|
|
10886
|
-
|
|
10887
10434
|
function getEncodedSearch(currentUrl) {
|
|
10888
10435
|
var splitUrl = currentUrl.split('?');
|
|
10889
10436
|
var baseUrl = splitUrl[0];
|
|
10890
10437
|
var nextUrlSegments = splitUrl[1].split('&');
|
|
10891
10438
|
var nextQueryString = splitUrl[1];
|
|
10892
|
-
|
|
10893
10439
|
if (nextUrlSegments.length > 0) {
|
|
10894
10440
|
nextQueryString = nextUrlSegments.map(function (v) {
|
|
10895
10441
|
var nextValue = v;
|
|
10896
|
-
|
|
10897
10442
|
if (v.includes('search=')) {
|
|
10898
10443
|
var temp = v.split('=');
|
|
10899
10444
|
nextValue = "".concat(temp[0], "=").concat(encodeURIComponent(temp[1]));
|
|
10900
10445
|
}
|
|
10901
|
-
|
|
10902
10446
|
return nextValue;
|
|
10903
10447
|
}).join('&');
|
|
10904
10448
|
}
|
|
10905
|
-
|
|
10906
10449
|
return "".concat(baseUrl, "?").concat(nextQueryString);
|
|
10907
10450
|
}
|
|
10451
|
+
|
|
10908
10452
|
/**
|
|
10909
10453
|
* Gets an instance of Axios that is configured with the custom failure handlers
|
|
10910
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]
|
|
10911
10455
|
* @param {Function} onForbidden - callback triggers when http status = 403
|
|
10912
10456
|
*/
|
|
10913
|
-
|
|
10914
|
-
|
|
10915
10457
|
var axiosInstance = function axiosInstance(onAuthFailed, onForbidden) {
|
|
10916
10458
|
var instance = axios.create({
|
|
10917
10459
|
validateStatus: function validateStatus(status) {
|
|
@@ -10919,60 +10461,56 @@
|
|
|
10919
10461
|
}
|
|
10920
10462
|
});
|
|
10921
10463
|
var token = getToken();
|
|
10922
|
-
|
|
10923
10464
|
if (token !== '') {
|
|
10924
10465
|
instance.defaults.headers.common.Authorization = token;
|
|
10925
10466
|
}
|
|
10467
|
+
instance.defaults.headers.common['Content-Type'] = 'application/json;charset=UTF-8';
|
|
10926
10468
|
|
|
10927
|
-
|
|
10928
|
-
|
|
10469
|
+
// Add a request interceptor
|
|
10929
10470
|
instance.interceptors.request.use(function (request, error) {
|
|
10930
10471
|
if (error) {
|
|
10931
10472
|
return Promise.reject(error.response);
|
|
10932
10473
|
}
|
|
10933
|
-
|
|
10934
10474
|
if (request.url.includes('search') && request.url.includes('?')) {
|
|
10935
10475
|
// do some uri manipulation for ie
|
|
10936
10476
|
// https://stackoverflow.com/questions/18220057
|
|
10477
|
+
|
|
10937
10478
|
// eslint-disable-next-line no-param-reassign
|
|
10938
10479
|
request.url = getEncodedSearch(request.url);
|
|
10939
|
-
}
|
|
10940
|
-
|
|
10480
|
+
}
|
|
10941
10481
|
|
|
10482
|
+
// eslint-disable-next-line no-param-reassign
|
|
10942
10483
|
request.headers.common['Content-Type'] = 'application/json; charset=utf-8';
|
|
10943
|
-
|
|
10944
10484
|
if (typeof request.body === 'undefined') {
|
|
10945
10485
|
request.body = {};
|
|
10946
10486
|
}
|
|
10947
|
-
|
|
10948
10487
|
token = getToken();
|
|
10949
|
-
|
|
10950
10488
|
if (token !== '') {
|
|
10951
10489
|
// eslint-disable-next-line no-param-reassign
|
|
10952
10490
|
request.headers.common.Authorization = token;
|
|
10953
10491
|
}
|
|
10954
|
-
|
|
10955
10492
|
return request;
|
|
10956
10493
|
}, function (error) {
|
|
10957
10494
|
return Promise.reject(error.message);
|
|
10958
|
-
});
|
|
10495
|
+
});
|
|
10959
10496
|
|
|
10497
|
+
// Add a response interceptor
|
|
10960
10498
|
instance.interceptors.response.use(function (response, error) {
|
|
10961
10499
|
if (error) {
|
|
10962
10500
|
return Promise.reject(error.response);
|
|
10963
10501
|
}
|
|
10964
|
-
|
|
10965
10502
|
if (response.headers.authorization) {
|
|
10966
10503
|
setToken(response.headers.authorization);
|
|
10967
10504
|
}
|
|
10968
|
-
|
|
10969
10505
|
return response;
|
|
10970
10506
|
}, function (error) {
|
|
10971
10507
|
if (error.response) {
|
|
10972
10508
|
// network error
|
|
10973
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) {
|
|
10974
10510
|
onAuthFailed();
|
|
10975
|
-
}
|
|
10511
|
+
}
|
|
10512
|
+
|
|
10513
|
+
// if (error.response.status === 500) {
|
|
10976
10514
|
// // INTERNAL SERVER ERROR
|
|
10977
10515
|
// store.dispatch({
|
|
10978
10516
|
// type: AppConstants.OVERLAY.SERVER_ERROR,
|
|
@@ -10980,39 +10518,34 @@
|
|
|
10980
10518
|
// return Promise.reject(error.response);
|
|
10981
10519
|
// }
|
|
10982
10520
|
|
|
10983
|
-
|
|
10984
10521
|
if (error.response.status === 403) {
|
|
10985
10522
|
// FORBIDDEN
|
|
10986
10523
|
onForbidden();
|
|
10987
10524
|
}
|
|
10988
|
-
|
|
10989
10525
|
return Promise.reject(error.response);
|
|
10990
10526
|
}
|
|
10991
|
-
|
|
10992
10527
|
return Promise.reject(error);
|
|
10993
10528
|
});
|
|
10994
10529
|
return instance;
|
|
10995
|
-
};
|
|
10530
|
+
};
|
|
10996
10531
|
|
|
10997
10532
|
var _excluded$8 = ["children"];
|
|
10998
|
-
|
|
10999
10533
|
var DropdownSelector = function DropdownSelector(_ref) {
|
|
11000
10534
|
var selectedOption = _ref.selectedOption,
|
|
11001
|
-
|
|
11002
|
-
|
|
11003
|
-
|
|
11004
|
-
|
|
11005
|
-
|
|
11006
|
-
|
|
11007
|
-
|
|
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;
|
|
11008
10542
|
var customComponents = {
|
|
11009
10543
|
DropdownIndicator: function DropdownIndicator() {
|
|
11010
10544
|
return null;
|
|
11011
10545
|
},
|
|
11012
10546
|
ValueContainer: function ValueContainer(_ref2) {
|
|
11013
10547
|
var children = _ref2.children,
|
|
11014
|
-
|
|
11015
|
-
|
|
10548
|
+
props = _objectWithoutProperties(_ref2, _excluded$8);
|
|
11016
10549
|
return /*#__PURE__*/React__default.createElement("div", _extends({
|
|
11017
10550
|
style: {
|
|
11018
10551
|
position: 'relative'
|
|
@@ -11140,7 +10673,6 @@
|
|
|
11140
10673
|
isDisabled: isDisabled
|
|
11141
10674
|
}));
|
|
11142
10675
|
};
|
|
11143
|
-
|
|
11144
10676
|
DropdownSelector.defaultProps = {
|
|
11145
10677
|
isSearchable: false,
|
|
11146
10678
|
selectedOption: null,
|
|
@@ -11165,178 +10697,144 @@
|
|
|
11165
10697
|
}, function (props) {
|
|
11166
10698
|
return props.theme.marginPaddings[1];
|
|
11167
10699
|
});
|
|
11168
|
-
|
|
11169
10700
|
var AddProductInterest = function AddProductInterest(_ref) {
|
|
11170
10701
|
var baseGraphApi = _ref.baseGraphApi,
|
|
11171
|
-
|
|
11172
|
-
|
|
11173
|
-
|
|
11174
|
-
|
|
11175
|
-
|
|
11176
|
-
|
|
11177
|
-
|
|
11178
|
-
|
|
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;
|
|
11179
10709
|
var _useState = React.useState([]),
|
|
11180
|
-
|
|
11181
|
-
|
|
11182
|
-
|
|
11183
|
-
|
|
10710
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
10711
|
+
brands = _useState2[0],
|
|
10712
|
+
setBrands = _useState2[1];
|
|
11184
10713
|
var _useState3 = React.useState([]),
|
|
11185
|
-
|
|
11186
|
-
|
|
11187
|
-
|
|
11188
|
-
|
|
10714
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
10715
|
+
models = _useState4[0],
|
|
10716
|
+
setModels = _useState4[1];
|
|
11189
10717
|
var _useState5 = React.useState([]),
|
|
11190
|
-
|
|
11191
|
-
|
|
11192
|
-
|
|
11193
|
-
|
|
10718
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
10719
|
+
materials = _useState6[0],
|
|
10720
|
+
setMaterials = _useState6[1];
|
|
11194
10721
|
var _useState7 = React.useState(null),
|
|
11195
|
-
|
|
11196
|
-
|
|
11197
|
-
|
|
11198
|
-
|
|
10722
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
10723
|
+
selectedBrand = _useState8[0],
|
|
10724
|
+
setSelectedBrand = _useState8[1];
|
|
11199
10725
|
var _useState9 = React.useState(null),
|
|
11200
|
-
|
|
11201
|
-
|
|
11202
|
-
|
|
11203
|
-
|
|
10726
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
10727
|
+
selectedModel = _useState10[0],
|
|
10728
|
+
setSelectedModel = _useState10[1];
|
|
11204
10729
|
var _useState11 = React.useState(null),
|
|
11205
|
-
|
|
11206
|
-
|
|
11207
|
-
|
|
11208
|
-
|
|
11209
|
-
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() {
|
|
11210
10734
|
var _response$data, _response$data$data, _response$data$data$l, response, formattedBrands;
|
|
11211
|
-
|
|
11212
10735
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
11213
|
-
while (1) {
|
|
11214
|
-
|
|
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) {
|
|
11215
10771
|
case 0:
|
|
11216
|
-
|
|
11217
|
-
|
|
11218
|
-
return axiosInstance.post("".concat(baseGraphApi, "?id=
|
|
11219
|
-
query:
|
|
10772
|
+
_context2.prev = 0;
|
|
10773
|
+
_context2.next = 3;
|
|
10774
|
+
return axiosInstance.post("".concat(baseGraphApi, "?id=getModels"), {
|
|
10775
|
+
query: getModelsGraphQuery(brandId)
|
|
11220
10776
|
});
|
|
11221
|
-
|
|
11222
10777
|
case 3:
|
|
11223
|
-
response =
|
|
11224
|
-
|
|
11225
|
-
|
|
11226
|
-
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) {
|
|
11227
10781
|
return {
|
|
11228
|
-
value:
|
|
11229
|
-
label:
|
|
10782
|
+
value: model.id,
|
|
10783
|
+
label: model.name
|
|
11230
10784
|
};
|
|
11231
10785
|
});
|
|
11232
|
-
|
|
10786
|
+
setModels(formattedModels);
|
|
11233
10787
|
}
|
|
11234
|
-
|
|
11235
|
-
_context.next = 10;
|
|
10788
|
+
_context2.next = 10;
|
|
11236
10789
|
break;
|
|
11237
|
-
|
|
11238
10790
|
case 7:
|
|
11239
|
-
|
|
11240
|
-
|
|
11241
|
-
error(
|
|
11242
|
-
|
|
10791
|
+
_context2.prev = 7;
|
|
10792
|
+
_context2.t0 = _context2["catch"](0);
|
|
10793
|
+
error(_context2.t0.message);
|
|
11243
10794
|
case 10:
|
|
11244
10795
|
case "end":
|
|
11245
|
-
return
|
|
11246
|
-
}
|
|
11247
|
-
}
|
|
11248
|
-
}, _callee, null, [[0, 7]]);
|
|
11249
|
-
})), [baseGraphApi, getBrandsGraphQuery]);
|
|
11250
|
-
var fetchModels = React.useCallback( /*#__PURE__*/function () {
|
|
11251
|
-
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(brandId) {
|
|
11252
|
-
var _response$data2, _response$data2$data, _response$data2$data$, response, formattedModels;
|
|
11253
|
-
|
|
11254
|
-
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
11255
|
-
while (1) {
|
|
11256
|
-
switch (_context2.prev = _context2.next) {
|
|
11257
|
-
case 0:
|
|
11258
|
-
_context2.prev = 0;
|
|
11259
|
-
_context2.next = 3;
|
|
11260
|
-
return axiosInstance.post("".concat(baseGraphApi, "?id=getModels"), {
|
|
11261
|
-
query: getModelsGraphQuery(brandId)
|
|
11262
|
-
});
|
|
11263
|
-
|
|
11264
|
-
case 3:
|
|
11265
|
-
response = _context2.sent;
|
|
11266
|
-
|
|
11267
|
-
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) {
|
|
11268
|
-
formattedModels = response.data.data.luxity_models.data.map(function (model) {
|
|
11269
|
-
return {
|
|
11270
|
-
value: model.id,
|
|
11271
|
-
label: model.name
|
|
11272
|
-
};
|
|
11273
|
-
});
|
|
11274
|
-
setModels(formattedModels);
|
|
11275
|
-
}
|
|
11276
|
-
|
|
11277
|
-
_context2.next = 10;
|
|
11278
|
-
break;
|
|
11279
|
-
|
|
11280
|
-
case 7:
|
|
11281
|
-
_context2.prev = 7;
|
|
11282
|
-
_context2.t0 = _context2["catch"](0);
|
|
11283
|
-
error(_context2.t0.message);
|
|
11284
|
-
|
|
11285
|
-
case 10:
|
|
11286
|
-
case "end":
|
|
11287
|
-
return _context2.stop();
|
|
11288
|
-
}
|
|
10796
|
+
return _context2.stop();
|
|
11289
10797
|
}
|
|
11290
10798
|
}, _callee2, null, [[0, 7]]);
|
|
11291
10799
|
}));
|
|
11292
|
-
|
|
11293
10800
|
return function (_x) {
|
|
11294
10801
|
return _ref3.apply(this, arguments);
|
|
11295
10802
|
};
|
|
11296
10803
|
}(), [baseGraphApi, getModelsGraphQuery]);
|
|
11297
|
-
var fetchMaterials = React.useCallback(
|
|
11298
|
-
var _ref4 = _asyncToGenerator(
|
|
10804
|
+
var fetchMaterials = React.useCallback(/*#__PURE__*/function () {
|
|
10805
|
+
var _ref4 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(brandId) {
|
|
11299
10806
|
var _response$data3, _response$data3$data, _response$data3$data$, response, formattedMaterials;
|
|
11300
|
-
|
|
11301
10807
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
11302
|
-
while (1) {
|
|
11303
|
-
|
|
11304
|
-
|
|
11305
|
-
|
|
11306
|
-
|
|
11307
|
-
|
|
11308
|
-
|
|
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
|
+
};
|
|
11309
10823
|
});
|
|
11310
|
-
|
|
11311
|
-
|
|
11312
|
-
|
|
11313
|
-
|
|
11314
|
-
|
|
11315
|
-
|
|
11316
|
-
|
|
11317
|
-
|
|
11318
|
-
|
|
11319
|
-
|
|
11320
|
-
|
|
11321
|
-
setMaterials(formattedMaterials);
|
|
11322
|
-
}
|
|
11323
|
-
|
|
11324
|
-
_context3.next = 10;
|
|
11325
|
-
break;
|
|
11326
|
-
|
|
11327
|
-
case 7:
|
|
11328
|
-
_context3.prev = 7;
|
|
11329
|
-
_context3.t0 = _context3["catch"](0);
|
|
11330
|
-
error(_context3.t0.message);
|
|
11331
|
-
|
|
11332
|
-
case 10:
|
|
11333
|
-
case "end":
|
|
11334
|
-
return _context3.stop();
|
|
11335
|
-
}
|
|
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();
|
|
11336
10835
|
}
|
|
11337
10836
|
}, _callee3, null, [[0, 7]]);
|
|
11338
10837
|
}));
|
|
11339
|
-
|
|
11340
10838
|
return function (_x2) {
|
|
11341
10839
|
return _ref4.apply(this, arguments);
|
|
11342
10840
|
};
|
|
@@ -11357,19 +10855,15 @@
|
|
|
11357
10855
|
setSelectedMaterial(null);
|
|
11358
10856
|
}
|
|
11359
10857
|
}, [selectedBrand, fetchModels, fetchMaterials]);
|
|
11360
|
-
|
|
11361
10858
|
var onBrandChange = function onBrandChange(selectedOption) {
|
|
11362
10859
|
setSelectedBrand(selectedOption);
|
|
11363
10860
|
};
|
|
11364
|
-
|
|
11365
10861
|
var onModelChange = function onModelChange(selectedOption) {
|
|
11366
10862
|
setSelectedModel(selectedOption);
|
|
11367
10863
|
};
|
|
11368
|
-
|
|
11369
10864
|
var onMaterialChange = function onMaterialChange(selectedOption) {
|
|
11370
10865
|
setSelectedMaterial(selectedOption);
|
|
11371
10866
|
};
|
|
11372
|
-
|
|
11373
10867
|
var submitInterest = function submitInterest() {
|
|
11374
10868
|
var payload = {
|
|
11375
10869
|
luxity_brand_id: selectedBrand === null || selectedBrand === void 0 ? void 0 : selectedBrand.value,
|
|
@@ -11381,7 +10875,6 @@
|
|
|
11381
10875
|
onCancel();
|
|
11382
10876
|
}, handleRequestError);
|
|
11383
10877
|
};
|
|
11384
|
-
|
|
11385
10878
|
var handleRequestError = function handleRequestError(_ref5) {
|
|
11386
10879
|
var data = _ref5.data;
|
|
11387
10880
|
var errorMessages = Object.keys(data).map(function (key) {
|
|
@@ -11393,7 +10886,6 @@
|
|
|
11393
10886
|
}, message);
|
|
11394
10887
|
}));
|
|
11395
10888
|
};
|
|
11396
|
-
|
|
11397
10889
|
var onReset = function onReset() {
|
|
11398
10890
|
onCancel();
|
|
11399
10891
|
setSelectedModel(null);
|
|
@@ -11403,7 +10895,6 @@
|
|
|
11403
10895
|
setMaterials([]);
|
|
11404
10896
|
setModels([]);
|
|
11405
10897
|
};
|
|
11406
|
-
|
|
11407
10898
|
return /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
11408
10899
|
className: "interests__section-wrapper"
|
|
11409
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", {
|
|
@@ -11451,50 +10942,36 @@
|
|
|
11451
10942
|
onClick: submitInterest
|
|
11452
10943
|
}, "SAVE"))))))));
|
|
11453
10944
|
};
|
|
11454
|
-
|
|
11455
10945
|
var AddProductInterest$1 = themed(AddProductInterest);
|
|
11456
10946
|
|
|
11457
10947
|
var _templateObject$F, _templateObject2$a, _templateObject3$4;
|
|
11458
|
-
|
|
11459
10948
|
var TrashIcon$1 = function TrashIcon(_ref) {
|
|
11460
10949
|
var onClick = _ref.onClick,
|
|
11461
|
-
|
|
10950
|
+
id = _ref.id;
|
|
11462
10951
|
return /*#__PURE__*/React__default.createElement(IconWrapper, {
|
|
11463
10952
|
onClick: onClick,
|
|
11464
10953
|
id: id
|
|
11465
10954
|
}, /*#__PURE__*/React__default.createElement(SvgWrapper$1, null, /*#__PURE__*/React__default.createElement(Trash, null)));
|
|
11466
10955
|
};
|
|
11467
|
-
|
|
11468
10956
|
var LuxityProductInterestItem = /*#__PURE__*/function (_React$Component) {
|
|
11469
|
-
_inherits(LuxityProductInterestItem, _React$Component);
|
|
11470
|
-
|
|
11471
|
-
var _super = _createSuper(LuxityProductInterestItem);
|
|
11472
|
-
|
|
11473
10957
|
function LuxityProductInterestItem(props) {
|
|
11474
10958
|
var _this;
|
|
11475
|
-
|
|
11476
10959
|
_classCallCheck(this, LuxityProductInterestItem);
|
|
11477
|
-
|
|
11478
|
-
_this
|
|
11479
|
-
|
|
11480
|
-
_defineProperty(_assertThisInitialized(_this), "deleteInterestItem", function () {
|
|
10960
|
+
_this = _callSuper(this, LuxityProductInterestItem, [props]);
|
|
10961
|
+
_defineProperty(_this, "deleteInterestItem", function () {
|
|
11481
10962
|
var id = _this.props.data.id;
|
|
11482
|
-
|
|
11483
10963
|
_this.setState({
|
|
11484
10964
|
delete: _objectSpread2(_objectSpread2({}, request), {}, {
|
|
11485
10965
|
fetching: true
|
|
11486
10966
|
})
|
|
11487
10967
|
});
|
|
11488
|
-
|
|
11489
10968
|
var url = _this.props.deleteInterestApi(id);
|
|
11490
|
-
|
|
11491
10969
|
simpleRequest(_this.props.requestInstance, url, method.DELETE, null, function () {
|
|
11492
10970
|
_this.setState({
|
|
11493
10971
|
delete: _objectSpread2(_objectSpread2({}, request), {}, {
|
|
11494
10972
|
success: true
|
|
11495
10973
|
})
|
|
11496
10974
|
});
|
|
11497
|
-
|
|
11498
10975
|
_this.props.onDeleted(_this.props.data);
|
|
11499
10976
|
}, function () {
|
|
11500
10977
|
return _this.setState({
|
|
@@ -11502,10 +10979,8 @@
|
|
|
11502
10979
|
});
|
|
11503
10980
|
});
|
|
11504
10981
|
});
|
|
11505
|
-
|
|
11506
|
-
_defineProperty(_assertThisInitialized(_this), "render", function () {
|
|
10982
|
+
_defineProperty(_this, "render", function () {
|
|
11507
10983
|
var _data$luxity_model, _data$luxity_material;
|
|
11508
|
-
|
|
11509
10984
|
var data = _this.props.data;
|
|
11510
10985
|
var success = _this.state.delete.success;
|
|
11511
10986
|
return /*#__PURE__*/React__default.createElement(InterestItemContainer$1, {
|
|
@@ -11535,16 +11010,14 @@
|
|
|
11535
11010
|
}
|
|
11536
11011
|
}));
|
|
11537
11012
|
});
|
|
11538
|
-
|
|
11539
11013
|
_this.state = {
|
|
11540
11014
|
delete: _objectSpread2({}, request)
|
|
11541
11015
|
};
|
|
11542
11016
|
return _this;
|
|
11543
11017
|
}
|
|
11544
|
-
|
|
11018
|
+
_inherits(LuxityProductInterestItem, _React$Component);
|
|
11545
11019
|
return _createClass(LuxityProductInterestItem);
|
|
11546
11020
|
}(React__default.Component);
|
|
11547
|
-
|
|
11548
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);
|
|
11549
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);
|
|
11550
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) {
|
|
@@ -11557,27 +11030,25 @@
|
|
|
11557
11030
|
return props.theme.marginPaddings[0];
|
|
11558
11031
|
}, media.xs);
|
|
11559
11032
|
var ThemedInterestItem$1 = themed(LuxityProductInterestItem);
|
|
11033
|
+
|
|
11560
11034
|
/**
|
|
11561
11035
|
* The Interest Item view shows the selected interest configuration,
|
|
11562
11036
|
* and gives user control to delete it.
|
|
11563
11037
|
*/
|
|
11564
|
-
|
|
11565
11038
|
var LuxityProductInterestItem$1 = (function (props) {
|
|
11566
11039
|
return /*#__PURE__*/React__default.createElement(ThemedInterestItem$1, props);
|
|
11567
11040
|
});
|
|
11568
11041
|
|
|
11569
11042
|
var _templateObject$G, _templateObject2$b;
|
|
11570
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"])));
|
|
11571
|
-
|
|
11572
11044
|
var AddIcon = function AddIcon(_ref) {
|
|
11573
11045
|
var onClick = _ref.onClick,
|
|
11574
|
-
|
|
11046
|
+
id = _ref.id;
|
|
11575
11047
|
return /*#__PURE__*/React__default.createElement(IconWrapper, {
|
|
11576
11048
|
id: id,
|
|
11577
11049
|
onClick: onClick
|
|
11578
11050
|
}, /*#__PURE__*/React__default.createElement(SvgWrapper$1, null, /*#__PURE__*/React__default.createElement(Add, null)));
|
|
11579
11051
|
};
|
|
11580
|
-
|
|
11581
11052
|
var AccountIcon = themed(function () {
|
|
11582
11053
|
return /*#__PURE__*/React__default.createElement(SvgWrapper$1, null, /*#__PURE__*/React__default.createElement(Account, null));
|
|
11583
11054
|
});
|
|
@@ -11590,50 +11061,39 @@
|
|
|
11590
11061
|
}, function (props) {
|
|
11591
11062
|
return props.theme.marginPaddings[2];
|
|
11592
11063
|
}));
|
|
11593
|
-
|
|
11594
11064
|
/**
|
|
11595
11065
|
* Page/View that controls the viewing and Adding of Luxity Interests
|
|
11596
11066
|
*/
|
|
11597
11067
|
var Interests = /*#__PURE__*/function (_React$Component) {
|
|
11598
|
-
_inherits(Interests, _React$Component);
|
|
11599
|
-
|
|
11600
|
-
var _super = _createSuper(Interests);
|
|
11601
|
-
|
|
11602
11068
|
function Interests(props) {
|
|
11603
11069
|
var _this;
|
|
11604
|
-
|
|
11605
11070
|
_classCallCheck(this, Interests);
|
|
11606
|
-
|
|
11607
|
-
_this
|
|
11608
|
-
|
|
11609
|
-
_defineProperty(
|
|
11610
|
-
|
|
11611
|
-
_defineProperty(_assertThisInitialized(_this), "productInterestType", 'PRODUCT');
|
|
11612
|
-
|
|
11613
|
-
_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) {
|
|
11614
11075
|
var _data$data$data = data.data.data,
|
|
11615
|
-
|
|
11616
|
-
|
|
11617
|
-
|
|
11076
|
+
interests = _data$data$data.interests.data,
|
|
11077
|
+
luxity_product_interests = _data$data$data.luxity_product_interests.data;
|
|
11618
11078
|
_this.setState({
|
|
11619
11079
|
interests: interests,
|
|
11620
11080
|
luxity_product_interests: luxity_product_interests
|
|
11621
11081
|
});
|
|
11622
11082
|
});
|
|
11623
|
-
|
|
11624
|
-
_defineProperty(
|
|
11083
|
+
// eslint-disable-next-line
|
|
11084
|
+
_defineProperty(_this, "onInterestSubmitSuccess", function (interestItem) {
|
|
11625
11085
|
// due to the fact that we dont get the Interest payload back - we have to re-request the list
|
|
11626
11086
|
_this.triggerInterestRequest().then(function (res) {
|
|
11627
11087
|
return _this.setInterests(res);
|
|
11628
|
-
});
|
|
11088
|
+
});
|
|
11089
|
+
|
|
11090
|
+
// UNCOMMENT WHEN Interest Items is returned as expected Object Shape
|
|
11629
11091
|
// this.setState(prevState => {
|
|
11630
11092
|
// const newInterests = [interestItem].concat(prevState.interests);
|
|
11631
11093
|
// return { ...prevState, interests: newInterests };
|
|
11632
11094
|
// });
|
|
11633
|
-
|
|
11634
11095
|
});
|
|
11635
|
-
|
|
11636
|
-
_defineProperty(_assertThisInitialized(_this), "onDeleteInterest", function (deletedItem) {
|
|
11096
|
+
_defineProperty(_this, "onDeleteInterest", function (deletedItem) {
|
|
11637
11097
|
_this.setState(function (prevState) {
|
|
11638
11098
|
var newInterests = prevState.interests.filter(function (item) {
|
|
11639
11099
|
return item.id !== deletedItem.id;
|
|
@@ -11643,8 +11103,7 @@
|
|
|
11643
11103
|
});
|
|
11644
11104
|
});
|
|
11645
11105
|
});
|
|
11646
|
-
|
|
11647
|
-
_defineProperty(_assertThisInitialized(_this), "onDeleteLuxityProductInterest", function (deleteItem) {
|
|
11106
|
+
_defineProperty(_this, "onDeleteLuxityProductInterest", function (deleteItem) {
|
|
11648
11107
|
_this.setState(function (prevState) {
|
|
11649
11108
|
var newLuxityProductInterests = prevState.luxity_product_interests.filter(function (item) {
|
|
11650
11109
|
return item.id !== deleteItem.id;
|
|
@@ -11654,29 +11113,25 @@
|
|
|
11654
11113
|
});
|
|
11655
11114
|
});
|
|
11656
11115
|
});
|
|
11657
|
-
|
|
11658
|
-
_defineProperty(_assertThisInitialized(_this), "triggerInterestRequest", function () {
|
|
11116
|
+
_defineProperty(_this, "triggerInterestRequest", function () {
|
|
11659
11117
|
var _this$props = _this.props,
|
|
11660
|
-
|
|
11661
|
-
|
|
11662
|
-
|
|
11118
|
+
requestInstance = _this$props.requestInstance,
|
|
11119
|
+
baseGraphApi = _this$props.baseGraphApi,
|
|
11120
|
+
interestQuery = _this$props.interestQuery;
|
|
11663
11121
|
return requestInstance.post("".concat(baseGraphApi, "?id=getInterests"), {
|
|
11664
11122
|
query: interestQuery
|
|
11665
11123
|
});
|
|
11666
11124
|
});
|
|
11667
|
-
|
|
11668
|
-
_defineProperty(_assertThisInitialized(_this), "onAddInterestClick", function (interestType) {
|
|
11125
|
+
_defineProperty(_this, "onAddInterestClick", function (interestType) {
|
|
11669
11126
|
_this.setState({
|
|
11670
11127
|
interestType: interestType
|
|
11671
11128
|
});
|
|
11672
11129
|
});
|
|
11673
|
-
|
|
11674
|
-
_defineProperty(_assertThisInitialized(_this), "onCancel", function () {
|
|
11130
|
+
_defineProperty(_this, "onCancel", function () {
|
|
11675
11131
|
_this.setState({
|
|
11676
11132
|
interestType: null
|
|
11677
11133
|
});
|
|
11678
11134
|
});
|
|
11679
|
-
|
|
11680
11135
|
_this.state = {
|
|
11681
11136
|
interests: [],
|
|
11682
11137
|
luxity_product_interests: [],
|
|
@@ -11684,32 +11139,31 @@
|
|
|
11684
11139
|
};
|
|
11685
11140
|
return _this;
|
|
11686
11141
|
}
|
|
11687
|
-
|
|
11688
|
-
_createClass(Interests, [{
|
|
11142
|
+
_inherits(Interests, _React$Component);
|
|
11143
|
+
return _createClass(Interests, [{
|
|
11689
11144
|
key: "render",
|
|
11690
11145
|
value: function render() {
|
|
11691
11146
|
var _this2 = this;
|
|
11692
|
-
|
|
11693
11147
|
var _this$state = this.state,
|
|
11694
|
-
|
|
11695
|
-
|
|
11148
|
+
interests = _this$state.interests,
|
|
11149
|
+
luxity_product_interests = _this$state.luxity_product_interests;
|
|
11696
11150
|
var _this$props2 = this.props,
|
|
11697
|
-
|
|
11698
|
-
|
|
11699
|
-
|
|
11700
|
-
|
|
11701
|
-
|
|
11702
|
-
|
|
11703
|
-
|
|
11704
|
-
|
|
11705
|
-
|
|
11706
|
-
|
|
11707
|
-
|
|
11708
|
-
|
|
11709
|
-
|
|
11710
|
-
|
|
11711
|
-
|
|
11712
|
-
|
|
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;
|
|
11713
11167
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
11714
11168
|
className: "interests"
|
|
11715
11169
|
}, /*#__PURE__*/React__default.createElement(Notifications__default, {
|
|
@@ -11798,10 +11252,7 @@
|
|
|
11798
11252
|
}))));
|
|
11799
11253
|
}
|
|
11800
11254
|
}]);
|
|
11801
|
-
|
|
11802
|
-
return Interests;
|
|
11803
11255
|
}(React__default.Component);
|
|
11804
|
-
|
|
11805
11256
|
Interests.defaultProps = {
|
|
11806
11257
|
interestsTitle: 'Interests',
|
|
11807
11258
|
defaultShoeSizeType: shoeSizeTypes.eu.value
|