@moda/om 19.7.2 → 19.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +1699 -1507
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +1699 -1507
- package/dist/index.esm.js.map +1 -1
- package/dist/src/components/SearchInput/SearchInput.d.ts +1 -0
- package/dist/src/components/Select/Select.d.ts +2 -0
- package/dist/src/components/Select/Select.stories.d.ts +1 -0
- package/dist/styles.css +1 -1
- package/package.json +3 -3
- package/src/components/SearchInput/SearchInput.tsx +6 -1
- package/src/components/Select/Select.scss +14 -0
- package/src/components/Select/Select.stories.tsx +13 -0
- package/src/components/Select/Select.tsx +11 -0
package/dist/index.cjs.js
CHANGED
|
@@ -23,1003 +23,1074 @@ function _interopNamespaceDefault(e) {
|
|
|
23
23
|
|
|
24
24
|
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
25
25
|
|
|
26
|
-
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
27
|
-
|
|
28
26
|
function getDefaultExportFromCjs (x) {
|
|
29
27
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
30
28
|
}
|
|
31
29
|
|
|
32
|
-
|
|
33
|
-
(function (global, factory) {
|
|
34
|
-
factory() ;
|
|
35
|
-
})(commonjsGlobal, function () {
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Applies the :focus-visible polyfill at the given scope.
|
|
39
|
-
* A scope in this case is either the top-level Document or a Shadow Root.
|
|
40
|
-
*
|
|
41
|
-
* @param {(Document|ShadowRoot)} scope
|
|
42
|
-
* @see https://github.com/WICG/focus-visible
|
|
43
|
-
*/
|
|
44
|
-
function applyFocusVisiblePolyfill(scope) {
|
|
45
|
-
var hadKeyboardEvent = true;
|
|
46
|
-
var hadFocusVisibleRecently = false;
|
|
47
|
-
var hadFocusVisibleRecentlyTimeout = null;
|
|
48
|
-
var inputTypesAllowlist = {
|
|
49
|
-
text: true,
|
|
50
|
-
search: true,
|
|
51
|
-
url: true,
|
|
52
|
-
tel: true,
|
|
53
|
-
email: true,
|
|
54
|
-
password: true,
|
|
55
|
-
number: true,
|
|
56
|
-
date: true,
|
|
57
|
-
month: true,
|
|
58
|
-
week: true,
|
|
59
|
-
time: true,
|
|
60
|
-
datetime: true,
|
|
61
|
-
'datetime-local': true
|
|
62
|
-
};
|
|
30
|
+
var focusVisible$1 = {exports: {}};
|
|
63
31
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
return false;
|
|
74
|
-
}
|
|
32
|
+
var focusVisible = focusVisible$1.exports;
|
|
33
|
+
var hasRequiredFocusVisible;
|
|
34
|
+
function requireFocusVisible() {
|
|
35
|
+
if (hasRequiredFocusVisible) return focusVisible$1.exports;
|
|
36
|
+
hasRequiredFocusVisible = 1;
|
|
37
|
+
(function (module, exports) {
|
|
38
|
+
(function (global, factory) {
|
|
39
|
+
factory() ;
|
|
40
|
+
})(focusVisible, function () {
|
|
75
41
|
|
|
76
42
|
/**
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
* @param {
|
|
81
|
-
* @
|
|
43
|
+
* Applies the :focus-visible polyfill at the given scope.
|
|
44
|
+
* A scope in this case is either the top-level Document or a Shadow Root.
|
|
45
|
+
*
|
|
46
|
+
* @param {(Document|ShadowRoot)} scope
|
|
47
|
+
* @see https://github.com/WICG/focus-visible
|
|
82
48
|
*/
|
|
83
|
-
function
|
|
84
|
-
var
|
|
85
|
-
var
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
49
|
+
function applyFocusVisiblePolyfill(scope) {
|
|
50
|
+
var hadKeyboardEvent = true;
|
|
51
|
+
var hadFocusVisibleRecently = false;
|
|
52
|
+
var hadFocusVisibleRecentlyTimeout = null;
|
|
53
|
+
var inputTypesAllowlist = {
|
|
54
|
+
text: true,
|
|
55
|
+
search: true,
|
|
56
|
+
url: true,
|
|
57
|
+
tel: true,
|
|
58
|
+
email: true,
|
|
59
|
+
password: true,
|
|
60
|
+
number: true,
|
|
61
|
+
date: true,
|
|
62
|
+
month: true,
|
|
63
|
+
week: true,
|
|
64
|
+
time: true,
|
|
65
|
+
datetime: true,
|
|
66
|
+
'datetime-local': true
|
|
67
|
+
};
|
|
97
68
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
69
|
+
/**
|
|
70
|
+
* Helper function for legacy browsers and iframes which sometimes focus
|
|
71
|
+
* elements like document, body, and non-interactive SVG.
|
|
72
|
+
* @param {Element} el
|
|
73
|
+
*/
|
|
74
|
+
function isValidFocusTarget(el) {
|
|
75
|
+
if (el && el !== document && el.nodeName !== 'HTML' && el.nodeName !== 'BODY' && 'classList' in el && 'contains' in el.classList) {
|
|
76
|
+
return true;
|
|
77
|
+
}
|
|
78
|
+
return false;
|
|
106
79
|
}
|
|
107
|
-
el.classList.add('focus-visible');
|
|
108
|
-
el.setAttribute('data-focus-visible-added', '');
|
|
109
|
-
}
|
|
110
80
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
81
|
+
/**
|
|
82
|
+
* Computes whether the given element should automatically trigger the
|
|
83
|
+
* `focus-visible` class being added, i.e. whether it should always match
|
|
84
|
+
* `:focus-visible` when focused.
|
|
85
|
+
* @param {Element} el
|
|
86
|
+
* @return {boolean}
|
|
87
|
+
*/
|
|
88
|
+
function focusTriggersKeyboardModality(el) {
|
|
89
|
+
var type = el.type;
|
|
90
|
+
var tagName = el.tagName;
|
|
91
|
+
if (tagName === 'INPUT' && inputTypesAllowlist[type] && !el.readOnly) {
|
|
92
|
+
return true;
|
|
93
|
+
}
|
|
94
|
+
if (tagName === 'TEXTAREA' && !el.readOnly) {
|
|
95
|
+
return true;
|
|
96
|
+
}
|
|
97
|
+
if (el.isContentEditable) {
|
|
98
|
+
return true;
|
|
99
|
+
}
|
|
100
|
+
return false;
|
|
119
101
|
}
|
|
120
|
-
el.classList.remove('focus-visible');
|
|
121
|
-
el.removeAttribute('data-focus-visible-added');
|
|
122
|
-
}
|
|
123
102
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
|
|
103
|
+
/**
|
|
104
|
+
* Add the `focus-visible` class to the given element if it was not added by
|
|
105
|
+
* the author.
|
|
106
|
+
* @param {Element} el
|
|
107
|
+
*/
|
|
108
|
+
function addFocusVisibleClass(el) {
|
|
109
|
+
if (el.classList.contains('focus-visible')) {
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
el.classList.add('focus-visible');
|
|
113
|
+
el.setAttribute('data-focus-visible-added', '');
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Remove the `focus-visible` class from the given element if it was not
|
|
118
|
+
* originally added by the author.
|
|
119
|
+
* @param {Element} el
|
|
120
|
+
*/
|
|
121
|
+
function removeFocusVisibleClass(el) {
|
|
122
|
+
if (!el.hasAttribute('data-focus-visible-added')) {
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
el.classList.remove('focus-visible');
|
|
126
|
+
el.removeAttribute('data-focus-visible-added');
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* If the most recent user interaction was via the keyboard;
|
|
131
|
+
* and the key press did not include a meta, alt/option, or control key;
|
|
132
|
+
* then the modality is keyboard. Otherwise, the modality is not keyboard.
|
|
133
|
+
* Apply `focus-visible` to any current active element and keep track
|
|
134
|
+
* of our keyboard modality state with `hadKeyboardEvent`.
|
|
135
|
+
* @param {KeyboardEvent} e
|
|
136
|
+
*/
|
|
137
|
+
function onKeyDown(e) {
|
|
138
|
+
if (e.metaKey || e.altKey || e.ctrlKey) {
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
if (isValidFocusTarget(scope.activeElement)) {
|
|
142
|
+
addFocusVisibleClass(scope.activeElement);
|
|
143
|
+
}
|
|
144
|
+
hadKeyboardEvent = true;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* If at any point a user clicks with a pointing device, ensure that we change
|
|
149
|
+
* the modality away from keyboard.
|
|
150
|
+
* This avoids the situation where a user presses a key on an already focused
|
|
151
|
+
* element, and then clicks on a different element, focusing it with a
|
|
152
|
+
* pointing device, while we still think we're in keyboard modality.
|
|
153
|
+
* @param {Event} e
|
|
154
|
+
*/
|
|
155
|
+
function onPointerDown(e) {
|
|
156
|
+
hadKeyboardEvent = false;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* On `focus`, add the `focus-visible` class to the target if:
|
|
161
|
+
* - the target received focus as a result of keyboard navigation, or
|
|
162
|
+
* - the event target is an element that will likely require interaction
|
|
163
|
+
* via the keyboard (e.g. a text box)
|
|
164
|
+
* @param {Event} e
|
|
165
|
+
*/
|
|
166
|
+
function onFocus(e) {
|
|
167
|
+
// Prevent IE from focusing the document or HTML element.
|
|
168
|
+
if (!isValidFocusTarget(e.target)) {
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
if (hadKeyboardEvent || focusTriggersKeyboardModality(e.target)) {
|
|
172
|
+
addFocusVisibleClass(e.target);
|
|
173
|
+
}
|
|
138
174
|
}
|
|
139
|
-
hadKeyboardEvent = true;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* If at any point a user clicks with a pointing device, ensure that we change
|
|
144
|
-
* the modality away from keyboard.
|
|
145
|
-
* This avoids the situation where a user presses a key on an already focused
|
|
146
|
-
* element, and then clicks on a different element, focusing it with a
|
|
147
|
-
* pointing device, while we still think we're in keyboard modality.
|
|
148
|
-
* @param {Event} e
|
|
149
|
-
*/
|
|
150
|
-
function onPointerDown(e) {
|
|
151
|
-
hadKeyboardEvent = false;
|
|
152
|
-
}
|
|
153
175
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
176
|
+
/**
|
|
177
|
+
* On `blur`, remove the `focus-visible` class from the target.
|
|
178
|
+
* @param {Event} e
|
|
179
|
+
*/
|
|
180
|
+
function onBlur(e) {
|
|
181
|
+
if (!isValidFocusTarget(e.target)) {
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
if (e.target.classList.contains('focus-visible') || e.target.hasAttribute('data-focus-visible-added')) {
|
|
185
|
+
// To detect a tab/window switch, we look for a blur event followed
|
|
186
|
+
// rapidly by a visibility change.
|
|
187
|
+
// If we don't see a visibility change within 100ms, it's probably a
|
|
188
|
+
// regular focus change.
|
|
189
|
+
hadFocusVisibleRecently = true;
|
|
190
|
+
window.clearTimeout(hadFocusVisibleRecentlyTimeout);
|
|
191
|
+
hadFocusVisibleRecentlyTimeout = window.setTimeout(function () {
|
|
192
|
+
hadFocusVisibleRecently = false;
|
|
193
|
+
}, 100);
|
|
194
|
+
removeFocusVisibleClass(e.target);
|
|
195
|
+
}
|
|
168
196
|
}
|
|
169
|
-
}
|
|
170
197
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
hadFocusVisibleRecently = false;
|
|
188
|
-
}, 100);
|
|
189
|
-
removeFocusVisibleClass(e.target);
|
|
198
|
+
/**
|
|
199
|
+
* If the user changes tabs, keep track of whether or not the previously
|
|
200
|
+
* focused element had .focus-visible.
|
|
201
|
+
* @param {Event} e
|
|
202
|
+
*/
|
|
203
|
+
function onVisibilityChange(e) {
|
|
204
|
+
if (document.visibilityState === 'hidden') {
|
|
205
|
+
// If the tab becomes active again, the browser will handle calling focus
|
|
206
|
+
// on the element (Safari actually calls it twice).
|
|
207
|
+
// If this tab change caused a blur on an element with focus-visible,
|
|
208
|
+
// re-apply the class when the user switches back to the tab.
|
|
209
|
+
if (hadFocusVisibleRecently) {
|
|
210
|
+
hadKeyboardEvent = true;
|
|
211
|
+
}
|
|
212
|
+
addInitialPointerMoveListeners();
|
|
213
|
+
}
|
|
190
214
|
}
|
|
191
|
-
}
|
|
192
215
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
216
|
+
/**
|
|
217
|
+
* Add a group of listeners to detect usage of any pointing devices.
|
|
218
|
+
* These listeners will be added when the polyfill first loads, and anytime
|
|
219
|
+
* the window is blurred, so that they are active when the window regains
|
|
220
|
+
* focus.
|
|
221
|
+
*/
|
|
222
|
+
function addInitialPointerMoveListeners() {
|
|
223
|
+
document.addEventListener('mousemove', onInitialPointerMove);
|
|
224
|
+
document.addEventListener('mousedown', onInitialPointerMove);
|
|
225
|
+
document.addEventListener('mouseup', onInitialPointerMove);
|
|
226
|
+
document.addEventListener('pointermove', onInitialPointerMove);
|
|
227
|
+
document.addEventListener('pointerdown', onInitialPointerMove);
|
|
228
|
+
document.addEventListener('pointerup', onInitialPointerMove);
|
|
229
|
+
document.addEventListener('touchmove', onInitialPointerMove);
|
|
230
|
+
document.addEventListener('touchstart', onInitialPointerMove);
|
|
231
|
+
document.addEventListener('touchend', onInitialPointerMove);
|
|
232
|
+
}
|
|
233
|
+
function removeInitialPointerMoveListeners() {
|
|
234
|
+
document.removeEventListener('mousemove', onInitialPointerMove);
|
|
235
|
+
document.removeEventListener('mousedown', onInitialPointerMove);
|
|
236
|
+
document.removeEventListener('mouseup', onInitialPointerMove);
|
|
237
|
+
document.removeEventListener('pointermove', onInitialPointerMove);
|
|
238
|
+
document.removeEventListener('pointerdown', onInitialPointerMove);
|
|
239
|
+
document.removeEventListener('pointerup', onInitialPointerMove);
|
|
240
|
+
document.removeEventListener('touchmove', onInitialPointerMove);
|
|
241
|
+
document.removeEventListener('touchstart', onInitialPointerMove);
|
|
242
|
+
document.removeEventListener('touchend', onInitialPointerMove);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* When the polfyill first loads, assume the user is in keyboard modality.
|
|
247
|
+
* If any event is received from a pointing device (e.g. mouse, pointer,
|
|
248
|
+
* touch), turn off keyboard modality.
|
|
249
|
+
* This accounts for situations where focus enters the page from the URL bar.
|
|
250
|
+
* @param {Event} e
|
|
251
|
+
*/
|
|
252
|
+
function onInitialPointerMove(e) {
|
|
253
|
+
// Work around a Safari quirk that fires a mousemove on <html> whenever the
|
|
254
|
+
// window blurs, even if you're tabbing out of the page. ¯\_(ツ)_/¯
|
|
255
|
+
if (e.target.nodeName && e.target.nodeName.toLowerCase() === 'html') {
|
|
256
|
+
return;
|
|
206
257
|
}
|
|
207
|
-
|
|
258
|
+
hadKeyboardEvent = false;
|
|
259
|
+
removeInitialPointerMoveListeners();
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
// For some kinds of state, we are interested in changes at the global scope
|
|
263
|
+
// only. For example, global pointer input, global key presses and global
|
|
264
|
+
// visibility change should affect the state at every scope:
|
|
265
|
+
document.addEventListener('keydown', onKeyDown, true);
|
|
266
|
+
document.addEventListener('mousedown', onPointerDown, true);
|
|
267
|
+
document.addEventListener('pointerdown', onPointerDown, true);
|
|
268
|
+
document.addEventListener('touchstart', onPointerDown, true);
|
|
269
|
+
document.addEventListener('visibilitychange', onVisibilityChange, true);
|
|
270
|
+
addInitialPointerMoveListeners();
|
|
271
|
+
|
|
272
|
+
// For focus and blur, we specifically care about state changes in the local
|
|
273
|
+
// scope. This is because focus / blur events that originate from within a
|
|
274
|
+
// shadow root are not re-dispatched from the host element if it was already
|
|
275
|
+
// the active element in its own scope:
|
|
276
|
+
scope.addEventListener('focus', onFocus, true);
|
|
277
|
+
scope.addEventListener('blur', onBlur, true);
|
|
278
|
+
|
|
279
|
+
// We detect that a node is a ShadowRoot by ensuring that it is a
|
|
280
|
+
// DocumentFragment and also has a host property. This check covers native
|
|
281
|
+
// implementation and polyfill implementation transparently. If we only cared
|
|
282
|
+
// about the native implementation, we could just check if the scope was
|
|
283
|
+
// an instance of a ShadowRoot.
|
|
284
|
+
if (scope.nodeType === Node.DOCUMENT_FRAGMENT_NODE && scope.host) {
|
|
285
|
+
// Since a ShadowRoot is a special kind of DocumentFragment, it does not
|
|
286
|
+
// have a root element to add a class to. So, we add this attribute to the
|
|
287
|
+
// host element instead:
|
|
288
|
+
scope.host.setAttribute('data-js-focus-visible', '');
|
|
289
|
+
} else if (scope.nodeType === Node.DOCUMENT_NODE) {
|
|
290
|
+
document.documentElement.classList.add('js-focus-visible');
|
|
291
|
+
document.documentElement.setAttribute('data-js-focus-visible', '');
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
// It is important to wrap all references to global window and document in
|
|
296
|
+
// these checks to support server-side rendering use cases
|
|
297
|
+
// @see https://github.com/WICG/focus-visible/issues/199
|
|
298
|
+
if (typeof window !== 'undefined' && typeof document !== 'undefined') {
|
|
299
|
+
// Make the polyfill helper globally available. This can be used as a signal
|
|
300
|
+
// to interested libraries that wish to coordinate with the polyfill for e.g.,
|
|
301
|
+
// applying the polyfill to a shadow root:
|
|
302
|
+
window.applyFocusVisiblePolyfill = applyFocusVisiblePolyfill;
|
|
303
|
+
|
|
304
|
+
// Notify interested libraries of the polyfill's presence, in case the
|
|
305
|
+
// polyfill was loaded lazily:
|
|
306
|
+
var event;
|
|
307
|
+
try {
|
|
308
|
+
event = new CustomEvent('focus-visible-polyfill-ready');
|
|
309
|
+
} catch (error) {
|
|
310
|
+
// IE11 does not support using CustomEvent as a constructor directly:
|
|
311
|
+
event = document.createEvent('CustomEvent');
|
|
312
|
+
event.initCustomEvent('focus-visible-polyfill-ready', false, false, {});
|
|
208
313
|
}
|
|
314
|
+
window.dispatchEvent(event);
|
|
209
315
|
}
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
* the window is blurred, so that they are active when the window regains
|
|
215
|
-
* focus.
|
|
216
|
-
*/
|
|
217
|
-
function addInitialPointerMoveListeners() {
|
|
218
|
-
document.addEventListener('mousemove', onInitialPointerMove);
|
|
219
|
-
document.addEventListener('mousedown', onInitialPointerMove);
|
|
220
|
-
document.addEventListener('mouseup', onInitialPointerMove);
|
|
221
|
-
document.addEventListener('pointermove', onInitialPointerMove);
|
|
222
|
-
document.addEventListener('pointerdown', onInitialPointerMove);
|
|
223
|
-
document.addEventListener('pointerup', onInitialPointerMove);
|
|
224
|
-
document.addEventListener('touchmove', onInitialPointerMove);
|
|
225
|
-
document.addEventListener('touchstart', onInitialPointerMove);
|
|
226
|
-
document.addEventListener('touchend', onInitialPointerMove);
|
|
227
|
-
}
|
|
228
|
-
function removeInitialPointerMoveListeners() {
|
|
229
|
-
document.removeEventListener('mousemove', onInitialPointerMove);
|
|
230
|
-
document.removeEventListener('mousedown', onInitialPointerMove);
|
|
231
|
-
document.removeEventListener('mouseup', onInitialPointerMove);
|
|
232
|
-
document.removeEventListener('pointermove', onInitialPointerMove);
|
|
233
|
-
document.removeEventListener('pointerdown', onInitialPointerMove);
|
|
234
|
-
document.removeEventListener('pointerup', onInitialPointerMove);
|
|
235
|
-
document.removeEventListener('touchmove', onInitialPointerMove);
|
|
236
|
-
document.removeEventListener('touchstart', onInitialPointerMove);
|
|
237
|
-
document.removeEventListener('touchend', onInitialPointerMove);
|
|
316
|
+
if (typeof document !== 'undefined') {
|
|
317
|
+
// Apply the polyfill to the global document, so that no JavaScript
|
|
318
|
+
// coordination is required to use the polyfill in the top-level document:
|
|
319
|
+
applyFocusVisiblePolyfill(document);
|
|
238
320
|
}
|
|
321
|
+
});
|
|
322
|
+
})();
|
|
323
|
+
return focusVisible$1.exports;
|
|
324
|
+
}
|
|
239
325
|
|
|
240
|
-
|
|
241
|
-
* When the polfyill first loads, assume the user is in keyboard modality.
|
|
242
|
-
* If any event is received from a pointing device (e.g. mouse, pointer,
|
|
243
|
-
* touch), turn off keyboard modality.
|
|
244
|
-
* This accounts for situations where focus enters the page from the URL bar.
|
|
245
|
-
* @param {Event} e
|
|
246
|
-
*/
|
|
247
|
-
function onInitialPointerMove(e) {
|
|
248
|
-
// Work around a Safari quirk that fires a mousemove on <html> whenever the
|
|
249
|
-
// window blurs, even if you're tabbing out of the page. ¯\_(ツ)_/¯
|
|
250
|
-
if (e.target.nodeName && e.target.nodeName.toLowerCase() === 'html') {
|
|
251
|
-
return;
|
|
252
|
-
}
|
|
253
|
-
hadKeyboardEvent = false;
|
|
254
|
-
removeInitialPointerMoveListeners();
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
// For some kinds of state, we are interested in changes at the global scope
|
|
258
|
-
// only. For example, global pointer input, global key presses and global
|
|
259
|
-
// visibility change should affect the state at every scope:
|
|
260
|
-
document.addEventListener('keydown', onKeyDown, true);
|
|
261
|
-
document.addEventListener('mousedown', onPointerDown, true);
|
|
262
|
-
document.addEventListener('pointerdown', onPointerDown, true);
|
|
263
|
-
document.addEventListener('touchstart', onPointerDown, true);
|
|
264
|
-
document.addEventListener('visibilitychange', onVisibilityChange, true);
|
|
265
|
-
addInitialPointerMoveListeners();
|
|
266
|
-
|
|
267
|
-
// For focus and blur, we specifically care about state changes in the local
|
|
268
|
-
// scope. This is because focus / blur events that originate from within a
|
|
269
|
-
// shadow root are not re-dispatched from the host element if it was already
|
|
270
|
-
// the active element in its own scope:
|
|
271
|
-
scope.addEventListener('focus', onFocus, true);
|
|
272
|
-
scope.addEventListener('blur', onBlur, true);
|
|
273
|
-
|
|
274
|
-
// We detect that a node is a ShadowRoot by ensuring that it is a
|
|
275
|
-
// DocumentFragment and also has a host property. This check covers native
|
|
276
|
-
// implementation and polyfill implementation transparently. If we only cared
|
|
277
|
-
// about the native implementation, we could just check if the scope was
|
|
278
|
-
// an instance of a ShadowRoot.
|
|
279
|
-
if (scope.nodeType === Node.DOCUMENT_FRAGMENT_NODE && scope.host) {
|
|
280
|
-
// Since a ShadowRoot is a special kind of DocumentFragment, it does not
|
|
281
|
-
// have a root element to add a class to. So, we add this attribute to the
|
|
282
|
-
// host element instead:
|
|
283
|
-
scope.host.setAttribute('data-js-focus-visible', '');
|
|
284
|
-
} else if (scope.nodeType === Node.DOCUMENT_NODE) {
|
|
285
|
-
document.documentElement.classList.add('js-focus-visible');
|
|
286
|
-
document.documentElement.setAttribute('data-js-focus-visible', '');
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
// It is important to wrap all references to global window and document in
|
|
291
|
-
// these checks to support server-side rendering use cases
|
|
292
|
-
// @see https://github.com/WICG/focus-visible/issues/199
|
|
293
|
-
if (typeof window !== 'undefined' && typeof document !== 'undefined') {
|
|
294
|
-
// Make the polyfill helper globally available. This can be used as a signal
|
|
295
|
-
// to interested libraries that wish to coordinate with the polyfill for e.g.,
|
|
296
|
-
// applying the polyfill to a shadow root:
|
|
297
|
-
window.applyFocusVisiblePolyfill = applyFocusVisiblePolyfill;
|
|
298
|
-
|
|
299
|
-
// Notify interested libraries of the polyfill's presence, in case the
|
|
300
|
-
// polyfill was loaded lazily:
|
|
301
|
-
var event;
|
|
302
|
-
try {
|
|
303
|
-
event = new CustomEvent('focus-visible-polyfill-ready');
|
|
304
|
-
} catch (error) {
|
|
305
|
-
// IE11 does not support using CustomEvent as a constructor directly:
|
|
306
|
-
event = document.createEvent('CustomEvent');
|
|
307
|
-
event.initCustomEvent('focus-visible-polyfill-ready', false, false, {});
|
|
308
|
-
}
|
|
309
|
-
window.dispatchEvent(event);
|
|
310
|
-
}
|
|
311
|
-
if (typeof document !== 'undefined') {
|
|
312
|
-
// Apply the polyfill to the global document, so that no JavaScript
|
|
313
|
-
// coordination is required to use the polyfill in the top-level document:
|
|
314
|
-
applyFocusVisiblePolyfill(document);
|
|
315
|
-
}
|
|
316
|
-
});
|
|
317
|
-
})();
|
|
326
|
+
requireFocusVisible();
|
|
318
327
|
|
|
319
328
|
var dist$4 = {};
|
|
320
329
|
|
|
321
330
|
var colors = {};
|
|
322
331
|
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
"
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
"mint": "rgb(227, 251, 226)",
|
|
364
|
-
"money-good": "rgb(4, 108, 0)",
|
|
365
|
-
"fuchsia": "rgb(196, 76, 176)",
|
|
366
|
-
"dark-fuchsia": "rgb(180, 60, 160)",
|
|
367
|
-
"teal": "rgb(0, 111, 98)",
|
|
368
|
-
"ivory": "rgb(242, 233, 219)"
|
|
369
|
-
},
|
|
370
|
-
"global": {
|
|
371
|
-
"klein-blue": "rgb(38, 48, 120)",
|
|
372
|
-
"persian-blue": "rgb(30, 34, 170)",
|
|
373
|
-
"brick": "rgb(147, 58, 32)",
|
|
374
|
-
"goldenrod": "rgb(186, 145, 46)",
|
|
375
|
-
"seafoam": "rgb(177, 191, 170)",
|
|
376
|
-
"coral": "rgb(255, 146, 121)"
|
|
377
|
-
},
|
|
378
|
-
"mens": {
|
|
379
|
-
"cornflower-blue": "rgb(127, 154, 207)",
|
|
380
|
-
"moss-green": "rgb(104, 104, 59)",
|
|
381
|
-
"blush": "rgb(243, 222, 217)",
|
|
382
|
-
"noise": "rgb(242, 243, 245)",
|
|
383
|
-
"canary": "rgb(240, 246, 89)"
|
|
384
|
-
},
|
|
385
|
-
"womens": {
|
|
386
|
-
"burnt-orange": "rgb(213, 107, 39)",
|
|
387
|
-
"lilac": "rgb(215, 179, 208)",
|
|
388
|
-
"forest-green": "rgb(0, 55, 40)",
|
|
389
|
-
"cream": "rgb(248, 245, 238)",
|
|
390
|
-
"fuchsia": "rgb(196, 76, 176)",
|
|
391
|
-
"dark-fuchsia": "rgb(180, 60, 160)"
|
|
392
|
-
},
|
|
393
|
-
"greyscale": {
|
|
394
|
-
"coal": "rgb(0, 0, 0)",
|
|
395
|
-
"ink": "rgb(25, 26, 27)",
|
|
396
|
-
"cement": "rgb(101, 101, 102)",
|
|
397
|
-
"fog": "rgb(151, 152, 153)",
|
|
398
|
-
"elephant": "rgb(202, 203, 204)",
|
|
399
|
-
"noise": "rgb(242, 243, 245)",
|
|
400
|
-
"snow": "rgb(255, 255, 255)"
|
|
401
|
-
}
|
|
402
|
-
};
|
|
403
|
-
|
|
404
|
-
var typography = {};
|
|
405
|
-
|
|
406
|
-
Object.defineProperty(typography, "__esModule", {
|
|
407
|
-
value: true
|
|
408
|
-
});
|
|
409
|
-
typography.typography = void 0;
|
|
410
|
-
// THIS FILE IS AUTO-GENERATED. DO NOT EDIT.
|
|
411
|
-
typography.typography = {
|
|
412
|
-
"fonts": {
|
|
413
|
-
"sans": ["Moda Operandi Sans", "Arial", "sans-serif"],
|
|
414
|
-
"serif": ["Moda Operandi Serif", "Times New Roman", "Times", "serif"],
|
|
415
|
-
"code": ["Menlo", "Monaco", "Consolas", "Courier New", "monospace"]
|
|
416
|
-
},
|
|
417
|
-
"line-heights": [1.1, 1.2, 1.4, 1.6],
|
|
418
|
-
"letter-spacing": [0, "0.02em", "0.04em", "0.1em"],
|
|
419
|
-
"font-scale": ["0.75rem", "0.8125rem", "1rem", "1.25rem", "1.5rem", "2rem", "3rem", "3.75rem", "6rem"],
|
|
420
|
-
"root-font-size": "16px",
|
|
421
|
-
"text-treatments": {
|
|
422
|
-
"display": {
|
|
423
|
-
"font-size": "6rem",
|
|
424
|
-
"line-height": 1.1,
|
|
425
|
-
"letter-spacing": 0
|
|
426
|
-
},
|
|
427
|
-
"h1": {
|
|
428
|
-
"font-size": "3.75rem",
|
|
429
|
-
"line-height": 1.2,
|
|
430
|
-
"letter-spacing": 0
|
|
431
|
-
},
|
|
432
|
-
"h2": {
|
|
433
|
-
"font-size": "3rem",
|
|
434
|
-
"line-height": 1.1,
|
|
435
|
-
"letter-spacing": 0
|
|
436
|
-
},
|
|
437
|
-
"h3": {
|
|
438
|
-
"font-size": "2rem",
|
|
439
|
-
"line-height": 1.2,
|
|
440
|
-
"letter-spacing": 0
|
|
441
|
-
},
|
|
442
|
-
"h4": {
|
|
443
|
-
"font-size": "1.5rem",
|
|
444
|
-
"line-height": 1.4,
|
|
445
|
-
"letter-spacing": 0
|
|
332
|
+
var hasRequiredColors;
|
|
333
|
+
function requireColors() {
|
|
334
|
+
if (hasRequiredColors) return colors;
|
|
335
|
+
hasRequiredColors = 1;
|
|
336
|
+
Object.defineProperty(colors, "__esModule", {
|
|
337
|
+
value: true
|
|
338
|
+
});
|
|
339
|
+
colors.colors = void 0;
|
|
340
|
+
// THIS FILE IS AUTO-GENERATED. DO NOT EDIT.
|
|
341
|
+
colors.colors = {
|
|
342
|
+
"all": {
|
|
343
|
+
"coal": "rgb(0, 0, 0)",
|
|
344
|
+
"ink": "rgb(25, 26, 27)",
|
|
345
|
+
"cement": "rgb(101, 101, 102)",
|
|
346
|
+
"fog": "rgb(151, 152, 153)",
|
|
347
|
+
"elephant": "rgb(202, 203, 204)",
|
|
348
|
+
"noise": "rgb(242, 243, 245)",
|
|
349
|
+
"snow": "rgb(255, 255, 255)",
|
|
350
|
+
"strawberry": "rgb(250, 222, 221)",
|
|
351
|
+
"code-red": "rgb(238, 7, 0)",
|
|
352
|
+
"mint": "rgb(227, 251, 226)",
|
|
353
|
+
"money-good": "rgb(4, 108, 0)",
|
|
354
|
+
"fuchsia": "rgb(196, 76, 176)",
|
|
355
|
+
"dark-fuchsia": "rgb(180, 60, 160)",
|
|
356
|
+
"teal": "rgb(0, 111, 98)",
|
|
357
|
+
"ivory": "rgb(242, 233, 219)",
|
|
358
|
+
"klein-blue": "rgb(38, 48, 120)",
|
|
359
|
+
"persian-blue": "rgb(30, 34, 170)",
|
|
360
|
+
"brick": "rgb(147, 58, 32)",
|
|
361
|
+
"goldenrod": "rgb(186, 145, 46)",
|
|
362
|
+
"seafoam": "rgb(177, 191, 170)",
|
|
363
|
+
"coral": "rgb(255, 146, 121)",
|
|
364
|
+
"burnt-orange": "rgb(213, 107, 39)",
|
|
365
|
+
"lilac": "rgb(215, 179, 208)",
|
|
366
|
+
"forest-green": "rgb(0, 55, 40)",
|
|
367
|
+
"cream": "rgb(248, 245, 238)",
|
|
368
|
+
"cornflower-blue": "rgb(127, 154, 207)",
|
|
369
|
+
"moss-green": "rgb(104, 104, 59)",
|
|
370
|
+
"blush": "rgb(243, 222, 217)",
|
|
371
|
+
"canary": "rgb(240, 246, 89)"
|
|
446
372
|
},
|
|
447
|
-
"
|
|
448
|
-
"
|
|
449
|
-
"
|
|
450
|
-
"
|
|
373
|
+
"ui": {
|
|
374
|
+
"strawberry": "rgb(250, 222, 221)",
|
|
375
|
+
"code-red": "rgb(238, 7, 0)",
|
|
376
|
+
"mint": "rgb(227, 251, 226)",
|
|
377
|
+
"money-good": "rgb(4, 108, 0)",
|
|
378
|
+
"fuchsia": "rgb(196, 76, 176)",
|
|
379
|
+
"dark-fuchsia": "rgb(180, 60, 160)",
|
|
380
|
+
"teal": "rgb(0, 111, 98)",
|
|
381
|
+
"ivory": "rgb(242, 233, 219)"
|
|
451
382
|
},
|
|
452
|
-
"
|
|
453
|
-
"
|
|
454
|
-
"
|
|
455
|
-
"
|
|
383
|
+
"global": {
|
|
384
|
+
"klein-blue": "rgb(38, 48, 120)",
|
|
385
|
+
"persian-blue": "rgb(30, 34, 170)",
|
|
386
|
+
"brick": "rgb(147, 58, 32)",
|
|
387
|
+
"goldenrod": "rgb(186, 145, 46)",
|
|
388
|
+
"seafoam": "rgb(177, 191, 170)",
|
|
389
|
+
"coral": "rgb(255, 146, 121)"
|
|
456
390
|
},
|
|
457
|
-
"
|
|
458
|
-
"
|
|
459
|
-
"
|
|
460
|
-
"
|
|
391
|
+
"mens": {
|
|
392
|
+
"cornflower-blue": "rgb(127, 154, 207)",
|
|
393
|
+
"moss-green": "rgb(104, 104, 59)",
|
|
394
|
+
"blush": "rgb(243, 222, 217)",
|
|
395
|
+
"noise": "rgb(242, 243, 245)",
|
|
396
|
+
"canary": "rgb(240, 246, 89)"
|
|
461
397
|
},
|
|
462
|
-
"
|
|
463
|
-
"
|
|
464
|
-
"
|
|
465
|
-
"
|
|
466
|
-
"
|
|
398
|
+
"womens": {
|
|
399
|
+
"burnt-orange": "rgb(213, 107, 39)",
|
|
400
|
+
"lilac": "rgb(215, 179, 208)",
|
|
401
|
+
"forest-green": "rgb(0, 55, 40)",
|
|
402
|
+
"cream": "rgb(248, 245, 238)",
|
|
403
|
+
"fuchsia": "rgb(196, 76, 176)",
|
|
404
|
+
"dark-fuchsia": "rgb(180, 60, 160)"
|
|
467
405
|
},
|
|
468
|
-
"
|
|
469
|
-
"
|
|
470
|
-
"
|
|
471
|
-
"
|
|
406
|
+
"greyscale": {
|
|
407
|
+
"coal": "rgb(0, 0, 0)",
|
|
408
|
+
"ink": "rgb(25, 26, 27)",
|
|
409
|
+
"cement": "rgb(101, 101, 102)",
|
|
410
|
+
"fog": "rgb(151, 152, 153)",
|
|
411
|
+
"elephant": "rgb(202, 203, 204)",
|
|
412
|
+
"noise": "rgb(242, 243, 245)",
|
|
413
|
+
"snow": "rgb(255, 255, 255)"
|
|
414
|
+
}
|
|
415
|
+
};
|
|
416
|
+
return colors;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
var typography = {};
|
|
420
|
+
|
|
421
|
+
var hasRequiredTypography;
|
|
422
|
+
function requireTypography() {
|
|
423
|
+
if (hasRequiredTypography) return typography;
|
|
424
|
+
hasRequiredTypography = 1;
|
|
425
|
+
Object.defineProperty(typography, "__esModule", {
|
|
426
|
+
value: true
|
|
427
|
+
});
|
|
428
|
+
typography.typography = void 0;
|
|
429
|
+
// THIS FILE IS AUTO-GENERATED. DO NOT EDIT.
|
|
430
|
+
typography.typography = {
|
|
431
|
+
"fonts": {
|
|
432
|
+
"sans": ["Moda Operandi Sans", "Arial", "sans-serif"],
|
|
433
|
+
"serif": ["Moda Operandi Serif", "Times New Roman", "Times", "serif"],
|
|
434
|
+
"code": ["Menlo", "Monaco", "Consolas", "Courier New", "monospace"]
|
|
472
435
|
},
|
|
473
|
-
"
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
436
|
+
"line-heights": [1.1, 1.2, 1.4, 1.6],
|
|
437
|
+
"letter-spacing": [0, "0.02em", "0.04em", "0.1em"],
|
|
438
|
+
"font-scale": ["0.75rem", "0.8125rem", "1rem", "1.25rem", "1.5rem", "2rem", "3rem", "3.75rem", "6rem"],
|
|
439
|
+
"root-font-size": "16px",
|
|
440
|
+
"text-treatments": {
|
|
441
|
+
"display": {
|
|
442
|
+
"font-size": "6rem",
|
|
443
|
+
"line-height": 1.1,
|
|
444
|
+
"letter-spacing": 0
|
|
445
|
+
},
|
|
446
|
+
"h1": {
|
|
447
|
+
"font-size": "3.75rem",
|
|
448
|
+
"line-height": 1.2,
|
|
449
|
+
"letter-spacing": 0
|
|
450
|
+
},
|
|
451
|
+
"h2": {
|
|
452
|
+
"font-size": "3rem",
|
|
453
|
+
"line-height": 1.1,
|
|
454
|
+
"letter-spacing": 0
|
|
455
|
+
},
|
|
456
|
+
"h3": {
|
|
457
|
+
"font-size": "2rem",
|
|
458
|
+
"line-height": 1.2,
|
|
459
|
+
"letter-spacing": 0
|
|
460
|
+
},
|
|
461
|
+
"h4": {
|
|
462
|
+
"font-size": "1.5rem",
|
|
463
|
+
"line-height": 1.4,
|
|
464
|
+
"letter-spacing": 0
|
|
465
|
+
},
|
|
466
|
+
"h5": {
|
|
467
|
+
"font-size": "1.25rem",
|
|
468
|
+
"line-height": 1.4,
|
|
469
|
+
"letter-spacing": "0.02em"
|
|
470
|
+
},
|
|
471
|
+
"h6": {
|
|
472
|
+
"font-size": "1rem",
|
|
473
|
+
"line-height": 1.4,
|
|
474
|
+
"letter-spacing": "0.04em"
|
|
475
|
+
},
|
|
476
|
+
"body1": {
|
|
477
|
+
"font-size": "0.8125rem",
|
|
478
|
+
"line-height": 1.6,
|
|
479
|
+
"letter-spacing": "0.04em"
|
|
480
|
+
},
|
|
481
|
+
"bold1": {
|
|
482
|
+
"font-size": "0.8125rem",
|
|
483
|
+
"line-height": 1.6,
|
|
484
|
+
"letter-spacing": "0.1em",
|
|
485
|
+
"font-weight": "bold"
|
|
486
|
+
},
|
|
487
|
+
"body2": {
|
|
488
|
+
"font-size": "0.75rem",
|
|
489
|
+
"line-height": 1.4,
|
|
490
|
+
"letter-spacing": "0.04em"
|
|
491
|
+
},
|
|
492
|
+
"eyebrow": {
|
|
493
|
+
"font-size": "0.75rem",
|
|
494
|
+
"line-height": 1.4,
|
|
495
|
+
"letter-spacing": "0.1em",
|
|
496
|
+
"text-transform": "uppercase"
|
|
497
|
+
}
|
|
478
498
|
}
|
|
479
|
-
}
|
|
480
|
-
|
|
499
|
+
};
|
|
500
|
+
return typography;
|
|
501
|
+
}
|
|
481
502
|
|
|
482
503
|
var space = {};
|
|
483
504
|
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
"
|
|
495
|
-
"
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
505
|
+
var hasRequiredSpace;
|
|
506
|
+
function requireSpace() {
|
|
507
|
+
if (hasRequiredSpace) return space;
|
|
508
|
+
hasRequiredSpace = 1;
|
|
509
|
+
Object.defineProperty(space, "__esModule", {
|
|
510
|
+
value: true
|
|
511
|
+
});
|
|
512
|
+
space.space = void 0;
|
|
513
|
+
// THIS FILE IS AUTO-GENERATED. DO NOT EDIT.
|
|
514
|
+
space.space = {
|
|
515
|
+
"scale": ["0rem", "0.25rem", "0.5rem", "0.75rem", "1rem", "1.5rem", "2rem", "3rem", "4rem", "6rem", "8rem", "12rem", "24rem"],
|
|
516
|
+
"map": {
|
|
517
|
+
"0x": "0rem",
|
|
518
|
+
"quarter-x": "0.25rem",
|
|
519
|
+
"half-x": "0.5rem",
|
|
520
|
+
"three-quarter-x": "0.75rem",
|
|
521
|
+
"1x": "1rem",
|
|
522
|
+
"one-and-a-half-x": "1.5rem",
|
|
523
|
+
"2x": "2rem",
|
|
524
|
+
"3x": "3rem",
|
|
525
|
+
"4x": "4rem",
|
|
526
|
+
"6x": "6rem",
|
|
527
|
+
"8x": "8rem",
|
|
528
|
+
"12x": "12rem",
|
|
529
|
+
"24x": "24rem"
|
|
530
|
+
}
|
|
531
|
+
};
|
|
532
|
+
return space;
|
|
533
|
+
}
|
|
507
534
|
|
|
508
535
|
var breakpoints = {};
|
|
509
536
|
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
537
|
+
var hasRequiredBreakpoints;
|
|
538
|
+
function requireBreakpoints() {
|
|
539
|
+
if (hasRequiredBreakpoints) return breakpoints;
|
|
540
|
+
hasRequiredBreakpoints = 1;
|
|
541
|
+
Object.defineProperty(breakpoints, "__esModule", {
|
|
542
|
+
value: true
|
|
543
|
+
});
|
|
544
|
+
breakpoints.breakpoints = void 0;
|
|
545
|
+
// THIS FILE IS AUTO-GENERATED. DO NOT EDIT.
|
|
546
|
+
breakpoints.breakpoints = {
|
|
547
|
+
"xs": "25rem",
|
|
548
|
+
"sm": "48rem",
|
|
549
|
+
"md": "62rem",
|
|
550
|
+
"lg": "80rem",
|
|
551
|
+
"xl": "100rem"
|
|
552
|
+
};
|
|
553
|
+
return breakpoints;
|
|
554
|
+
}
|
|
522
555
|
|
|
523
556
|
var helpers = {};
|
|
524
557
|
|
|
525
558
|
var colorString = {exports: {}};
|
|
526
559
|
|
|
527
|
-
var colorName
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
560
|
+
var colorName;
|
|
561
|
+
var hasRequiredColorName;
|
|
562
|
+
function requireColorName() {
|
|
563
|
+
if (hasRequiredColorName) return colorName;
|
|
564
|
+
hasRequiredColorName = 1;
|
|
565
|
+
colorName = {
|
|
566
|
+
"aliceblue": [240, 248, 255],
|
|
567
|
+
"antiquewhite": [250, 235, 215],
|
|
568
|
+
"aqua": [0, 255, 255],
|
|
569
|
+
"aquamarine": [127, 255, 212],
|
|
570
|
+
"azure": [240, 255, 255],
|
|
571
|
+
"beige": [245, 245, 220],
|
|
572
|
+
"bisque": [255, 228, 196],
|
|
573
|
+
"black": [0, 0, 0],
|
|
574
|
+
"blanchedalmond": [255, 235, 205],
|
|
575
|
+
"blue": [0, 0, 255],
|
|
576
|
+
"blueviolet": [138, 43, 226],
|
|
577
|
+
"brown": [165, 42, 42],
|
|
578
|
+
"burlywood": [222, 184, 135],
|
|
579
|
+
"cadetblue": [95, 158, 160],
|
|
580
|
+
"chartreuse": [127, 255, 0],
|
|
581
|
+
"chocolate": [210, 105, 30],
|
|
582
|
+
"coral": [255, 127, 80],
|
|
583
|
+
"cornflowerblue": [100, 149, 237],
|
|
584
|
+
"cornsilk": [255, 248, 220],
|
|
585
|
+
"crimson": [220, 20, 60],
|
|
586
|
+
"cyan": [0, 255, 255],
|
|
587
|
+
"darkblue": [0, 0, 139],
|
|
588
|
+
"darkcyan": [0, 139, 139],
|
|
589
|
+
"darkgoldenrod": [184, 134, 11],
|
|
590
|
+
"darkgray": [169, 169, 169],
|
|
591
|
+
"darkgreen": [0, 100, 0],
|
|
592
|
+
"darkgrey": [169, 169, 169],
|
|
593
|
+
"darkkhaki": [189, 183, 107],
|
|
594
|
+
"darkmagenta": [139, 0, 139],
|
|
595
|
+
"darkolivegreen": [85, 107, 47],
|
|
596
|
+
"darkorange": [255, 140, 0],
|
|
597
|
+
"darkorchid": [153, 50, 204],
|
|
598
|
+
"darkred": [139, 0, 0],
|
|
599
|
+
"darksalmon": [233, 150, 122],
|
|
600
|
+
"darkseagreen": [143, 188, 143],
|
|
601
|
+
"darkslateblue": [72, 61, 139],
|
|
602
|
+
"darkslategray": [47, 79, 79],
|
|
603
|
+
"darkslategrey": [47, 79, 79],
|
|
604
|
+
"darkturquoise": [0, 206, 209],
|
|
605
|
+
"darkviolet": [148, 0, 211],
|
|
606
|
+
"deeppink": [255, 20, 147],
|
|
607
|
+
"deepskyblue": [0, 191, 255],
|
|
608
|
+
"dimgray": [105, 105, 105],
|
|
609
|
+
"dimgrey": [105, 105, 105],
|
|
610
|
+
"dodgerblue": [30, 144, 255],
|
|
611
|
+
"firebrick": [178, 34, 34],
|
|
612
|
+
"floralwhite": [255, 250, 240],
|
|
613
|
+
"forestgreen": [34, 139, 34],
|
|
614
|
+
"fuchsia": [255, 0, 255],
|
|
615
|
+
"gainsboro": [220, 220, 220],
|
|
616
|
+
"ghostwhite": [248, 248, 255],
|
|
617
|
+
"gold": [255, 215, 0],
|
|
618
|
+
"goldenrod": [218, 165, 32],
|
|
619
|
+
"gray": [128, 128, 128],
|
|
620
|
+
"green": [0, 128, 0],
|
|
621
|
+
"greenyellow": [173, 255, 47],
|
|
622
|
+
"grey": [128, 128, 128],
|
|
623
|
+
"honeydew": [240, 255, 240],
|
|
624
|
+
"hotpink": [255, 105, 180],
|
|
625
|
+
"indianred": [205, 92, 92],
|
|
626
|
+
"indigo": [75, 0, 130],
|
|
627
|
+
"ivory": [255, 255, 240],
|
|
628
|
+
"khaki": [240, 230, 140],
|
|
629
|
+
"lavender": [230, 230, 250],
|
|
630
|
+
"lavenderblush": [255, 240, 245],
|
|
631
|
+
"lawngreen": [124, 252, 0],
|
|
632
|
+
"lemonchiffon": [255, 250, 205],
|
|
633
|
+
"lightblue": [173, 216, 230],
|
|
634
|
+
"lightcoral": [240, 128, 128],
|
|
635
|
+
"lightcyan": [224, 255, 255],
|
|
636
|
+
"lightgoldenrodyellow": [250, 250, 210],
|
|
637
|
+
"lightgray": [211, 211, 211],
|
|
638
|
+
"lightgreen": [144, 238, 144],
|
|
639
|
+
"lightgrey": [211, 211, 211],
|
|
640
|
+
"lightpink": [255, 182, 193],
|
|
641
|
+
"lightsalmon": [255, 160, 122],
|
|
642
|
+
"lightseagreen": [32, 178, 170],
|
|
643
|
+
"lightskyblue": [135, 206, 250],
|
|
644
|
+
"lightslategray": [119, 136, 153],
|
|
645
|
+
"lightslategrey": [119, 136, 153],
|
|
646
|
+
"lightsteelblue": [176, 196, 222],
|
|
647
|
+
"lightyellow": [255, 255, 224],
|
|
648
|
+
"lime": [0, 255, 0],
|
|
649
|
+
"limegreen": [50, 205, 50],
|
|
650
|
+
"linen": [250, 240, 230],
|
|
651
|
+
"magenta": [255, 0, 255],
|
|
652
|
+
"maroon": [128, 0, 0],
|
|
653
|
+
"mediumaquamarine": [102, 205, 170],
|
|
654
|
+
"mediumblue": [0, 0, 205],
|
|
655
|
+
"mediumorchid": [186, 85, 211],
|
|
656
|
+
"mediumpurple": [147, 112, 219],
|
|
657
|
+
"mediumseagreen": [60, 179, 113],
|
|
658
|
+
"mediumslateblue": [123, 104, 238],
|
|
659
|
+
"mediumspringgreen": [0, 250, 154],
|
|
660
|
+
"mediumturquoise": [72, 209, 204],
|
|
661
|
+
"mediumvioletred": [199, 21, 133],
|
|
662
|
+
"midnightblue": [25, 25, 112],
|
|
663
|
+
"mintcream": [245, 255, 250],
|
|
664
|
+
"mistyrose": [255, 228, 225],
|
|
665
|
+
"moccasin": [255, 228, 181],
|
|
666
|
+
"navajowhite": [255, 222, 173],
|
|
667
|
+
"navy": [0, 0, 128],
|
|
668
|
+
"oldlace": [253, 245, 230],
|
|
669
|
+
"olive": [128, 128, 0],
|
|
670
|
+
"olivedrab": [107, 142, 35],
|
|
671
|
+
"orange": [255, 165, 0],
|
|
672
|
+
"orangered": [255, 69, 0],
|
|
673
|
+
"orchid": [218, 112, 214],
|
|
674
|
+
"palegoldenrod": [238, 232, 170],
|
|
675
|
+
"palegreen": [152, 251, 152],
|
|
676
|
+
"paleturquoise": [175, 238, 238],
|
|
677
|
+
"palevioletred": [219, 112, 147],
|
|
678
|
+
"papayawhip": [255, 239, 213],
|
|
679
|
+
"peachpuff": [255, 218, 185],
|
|
680
|
+
"peru": [205, 133, 63],
|
|
681
|
+
"pink": [255, 192, 203],
|
|
682
|
+
"plum": [221, 160, 221],
|
|
683
|
+
"powderblue": [176, 224, 230],
|
|
684
|
+
"purple": [128, 0, 128],
|
|
685
|
+
"rebeccapurple": [102, 51, 153],
|
|
686
|
+
"red": [255, 0, 0],
|
|
687
|
+
"rosybrown": [188, 143, 143],
|
|
688
|
+
"royalblue": [65, 105, 225],
|
|
689
|
+
"saddlebrown": [139, 69, 19],
|
|
690
|
+
"salmon": [250, 128, 114],
|
|
691
|
+
"sandybrown": [244, 164, 96],
|
|
692
|
+
"seagreen": [46, 139, 87],
|
|
693
|
+
"seashell": [255, 245, 238],
|
|
694
|
+
"sienna": [160, 82, 45],
|
|
695
|
+
"silver": [192, 192, 192],
|
|
696
|
+
"skyblue": [135, 206, 235],
|
|
697
|
+
"slateblue": [106, 90, 205],
|
|
698
|
+
"slategray": [112, 128, 144],
|
|
699
|
+
"slategrey": [112, 128, 144],
|
|
700
|
+
"snow": [255, 250, 250],
|
|
701
|
+
"springgreen": [0, 255, 127],
|
|
702
|
+
"steelblue": [70, 130, 180],
|
|
703
|
+
"tan": [210, 180, 140],
|
|
704
|
+
"teal": [0, 128, 128],
|
|
705
|
+
"thistle": [216, 191, 216],
|
|
706
|
+
"tomato": [255, 99, 71],
|
|
707
|
+
"turquoise": [64, 224, 208],
|
|
708
|
+
"violet": [238, 130, 238],
|
|
709
|
+
"wheat": [245, 222, 179],
|
|
710
|
+
"white": [255, 255, 255],
|
|
711
|
+
"whitesmoke": [245, 245, 245],
|
|
712
|
+
"yellow": [255, 255, 0],
|
|
713
|
+
"yellowgreen": [154, 205, 50]
|
|
714
|
+
};
|
|
715
|
+
return colorName;
|
|
716
|
+
}
|
|
677
717
|
|
|
678
718
|
var simpleSwizzle = {exports: {}};
|
|
679
719
|
|
|
680
|
-
var isArrayish
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
720
|
+
var isArrayish;
|
|
721
|
+
var hasRequiredIsArrayish;
|
|
722
|
+
function requireIsArrayish() {
|
|
723
|
+
if (hasRequiredIsArrayish) return isArrayish;
|
|
724
|
+
hasRequiredIsArrayish = 1;
|
|
725
|
+
isArrayish = function isArrayish(obj) {
|
|
726
|
+
if (!obj || typeof obj === 'string') {
|
|
727
|
+
return false;
|
|
728
|
+
}
|
|
729
|
+
return obj instanceof Array || Array.isArray(obj) || obj.length >= 0 && (obj.splice instanceof Function || Object.getOwnPropertyDescriptor(obj, obj.length - 1) && obj.constructor.name !== 'String');
|
|
730
|
+
};
|
|
731
|
+
return isArrayish;
|
|
732
|
+
}
|
|
686
733
|
|
|
687
|
-
var
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
var
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
734
|
+
var hasRequiredSimpleSwizzle;
|
|
735
|
+
function requireSimpleSwizzle() {
|
|
736
|
+
if (hasRequiredSimpleSwizzle) return simpleSwizzle.exports;
|
|
737
|
+
hasRequiredSimpleSwizzle = 1;
|
|
738
|
+
var isArrayish = requireIsArrayish();
|
|
739
|
+
var concat = Array.prototype.concat;
|
|
740
|
+
var slice = Array.prototype.slice;
|
|
741
|
+
var swizzle = simpleSwizzle.exports = function swizzle(args) {
|
|
742
|
+
var results = [];
|
|
743
|
+
for (var i = 0, len = args.length; i < len; i++) {
|
|
744
|
+
var arg = args[i];
|
|
745
|
+
if (isArrayish(arg)) {
|
|
746
|
+
// http://jsperf.com/javascript-array-concat-vs-push/98
|
|
747
|
+
results = concat.call(results, slice.call(arg));
|
|
748
|
+
} else {
|
|
749
|
+
results.push(arg);
|
|
750
|
+
}
|
|
699
751
|
}
|
|
700
|
-
|
|
701
|
-
return results;
|
|
702
|
-
};
|
|
703
|
-
swizzle$1.wrap = function (fn) {
|
|
704
|
-
return function () {
|
|
705
|
-
return fn(swizzle$1(arguments));
|
|
752
|
+
return results;
|
|
706
753
|
};
|
|
707
|
-
|
|
708
|
-
|
|
754
|
+
swizzle.wrap = function (fn) {
|
|
755
|
+
return function () {
|
|
756
|
+
return fn(swizzle(arguments));
|
|
757
|
+
};
|
|
758
|
+
};
|
|
759
|
+
return simpleSwizzle.exports;
|
|
760
|
+
}
|
|
709
761
|
|
|
710
762
|
/* MIT license */
|
|
711
|
-
var
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
}
|
|
726
|
-
cs
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
var model;
|
|
730
|
-
switch (prefix) {
|
|
731
|
-
case 'hsl':
|
|
732
|
-
val = cs.get.hsl(string);
|
|
733
|
-
model = 'hsl';
|
|
734
|
-
break;
|
|
735
|
-
case 'hwb':
|
|
736
|
-
val = cs.get.hwb(string);
|
|
737
|
-
model = 'hwb';
|
|
738
|
-
break;
|
|
739
|
-
default:
|
|
740
|
-
val = cs.get.rgb(string);
|
|
741
|
-
model = 'rgb';
|
|
742
|
-
break;
|
|
743
|
-
}
|
|
744
|
-
if (!val) {
|
|
745
|
-
return null;
|
|
746
|
-
}
|
|
747
|
-
return {
|
|
748
|
-
model: model,
|
|
749
|
-
value: val
|
|
763
|
+
var hasRequiredColorString;
|
|
764
|
+
function requireColorString() {
|
|
765
|
+
if (hasRequiredColorString) return colorString.exports;
|
|
766
|
+
hasRequiredColorString = 1;
|
|
767
|
+
var colorNames = requireColorName();
|
|
768
|
+
var swizzle = requireSimpleSwizzle();
|
|
769
|
+
var hasOwnProperty = Object.hasOwnProperty;
|
|
770
|
+
var reverseNames = Object.create(null);
|
|
771
|
+
|
|
772
|
+
// create a list of reverse color names
|
|
773
|
+
for (var name in colorNames) {
|
|
774
|
+
if (hasOwnProperty.call(colorNames, name)) {
|
|
775
|
+
reverseNames[colorNames[name]] = name;
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
var cs = colorString.exports = {
|
|
779
|
+
to: {},
|
|
780
|
+
get: {}
|
|
750
781
|
};
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
for (i = 0; i < 3; i++) {
|
|
769
|
-
// https://jsperf.com/slice-vs-substr-vs-substring-methods-long-string/19
|
|
770
|
-
var i2 = i * 2;
|
|
771
|
-
rgb[i] = parseInt(match.slice(i2, i2 + 2), 16);
|
|
772
|
-
}
|
|
773
|
-
if (hexAlpha) {
|
|
774
|
-
rgb[3] = parseInt(hexAlpha, 16) / 255;
|
|
775
|
-
}
|
|
776
|
-
} else if (match = string.match(abbr)) {
|
|
777
|
-
match = match[1];
|
|
778
|
-
hexAlpha = match[3];
|
|
779
|
-
for (i = 0; i < 3; i++) {
|
|
780
|
-
rgb[i] = parseInt(match[i] + match[i], 16);
|
|
782
|
+
cs.get = function (string) {
|
|
783
|
+
var prefix = string.substring(0, 3).toLowerCase();
|
|
784
|
+
var val;
|
|
785
|
+
var model;
|
|
786
|
+
switch (prefix) {
|
|
787
|
+
case 'hsl':
|
|
788
|
+
val = cs.get.hsl(string);
|
|
789
|
+
model = 'hsl';
|
|
790
|
+
break;
|
|
791
|
+
case 'hwb':
|
|
792
|
+
val = cs.get.hwb(string);
|
|
793
|
+
model = 'hwb';
|
|
794
|
+
break;
|
|
795
|
+
default:
|
|
796
|
+
val = cs.get.rgb(string);
|
|
797
|
+
model = 'rgb';
|
|
798
|
+
break;
|
|
781
799
|
}
|
|
782
|
-
if (
|
|
783
|
-
|
|
800
|
+
if (!val) {
|
|
801
|
+
return null;
|
|
784
802
|
}
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
803
|
+
return {
|
|
804
|
+
model: model,
|
|
805
|
+
value: val
|
|
806
|
+
};
|
|
807
|
+
};
|
|
808
|
+
cs.get.rgb = function (string) {
|
|
809
|
+
if (!string) {
|
|
810
|
+
return null;
|
|
788
811
|
}
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
812
|
+
var abbr = /^#([a-f0-9]{3,4})$/i;
|
|
813
|
+
var hex = /^#([a-f0-9]{6})([a-f0-9]{2})?$/i;
|
|
814
|
+
var rgba = /^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/;
|
|
815
|
+
var per = /^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/;
|
|
816
|
+
var keyword = /^(\w+)$/;
|
|
817
|
+
var rgb = [0, 0, 0, 1];
|
|
818
|
+
var match;
|
|
819
|
+
var i;
|
|
820
|
+
var hexAlpha;
|
|
821
|
+
if (match = string.match(hex)) {
|
|
822
|
+
hexAlpha = match[2];
|
|
823
|
+
match = match[1];
|
|
824
|
+
for (i = 0; i < 3; i++) {
|
|
825
|
+
// https://jsperf.com/slice-vs-substr-vs-substring-methods-long-string/19
|
|
826
|
+
var i2 = i * 2;
|
|
827
|
+
rgb[i] = parseInt(match.slice(i2, i2 + 2), 16);
|
|
828
|
+
}
|
|
829
|
+
if (hexAlpha) {
|
|
830
|
+
rgb[3] = parseInt(hexAlpha, 16) / 255;
|
|
831
|
+
}
|
|
832
|
+
} else if (match = string.match(abbr)) {
|
|
833
|
+
match = match[1];
|
|
834
|
+
hexAlpha = match[3];
|
|
835
|
+
for (i = 0; i < 3; i++) {
|
|
836
|
+
rgb[i] = parseInt(match[i] + match[i], 16);
|
|
837
|
+
}
|
|
838
|
+
if (hexAlpha) {
|
|
839
|
+
rgb[3] = parseInt(hexAlpha + hexAlpha, 16) / 255;
|
|
840
|
+
}
|
|
841
|
+
} else if (match = string.match(rgba)) {
|
|
842
|
+
for (i = 0; i < 3; i++) {
|
|
843
|
+
rgb[i] = parseInt(match[i + 1], 0);
|
|
844
|
+
}
|
|
845
|
+
if (match[4]) {
|
|
846
|
+
if (match[5]) {
|
|
847
|
+
rgb[3] = parseFloat(match[4]) * 0.01;
|
|
848
|
+
} else {
|
|
849
|
+
rgb[3] = parseFloat(match[4]);
|
|
850
|
+
}
|
|
794
851
|
}
|
|
852
|
+
} else if (match = string.match(per)) {
|
|
853
|
+
for (i = 0; i < 3; i++) {
|
|
854
|
+
rgb[i] = Math.round(parseFloat(match[i + 1]) * 2.55);
|
|
855
|
+
}
|
|
856
|
+
if (match[4]) {
|
|
857
|
+
if (match[5]) {
|
|
858
|
+
rgb[3] = parseFloat(match[4]) * 0.01;
|
|
859
|
+
} else {
|
|
860
|
+
rgb[3] = parseFloat(match[4]);
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
} else if (match = string.match(keyword)) {
|
|
864
|
+
if (match[1] === 'transparent') {
|
|
865
|
+
return [0, 0, 0, 0];
|
|
866
|
+
}
|
|
867
|
+
if (!hasOwnProperty.call(colorNames, match[1])) {
|
|
868
|
+
return null;
|
|
869
|
+
}
|
|
870
|
+
rgb = colorNames[match[1]];
|
|
871
|
+
rgb[3] = 1;
|
|
872
|
+
return rgb;
|
|
873
|
+
} else {
|
|
874
|
+
return null;
|
|
795
875
|
}
|
|
796
|
-
} else if (match = string.match(per)) {
|
|
797
876
|
for (i = 0; i < 3; i++) {
|
|
798
|
-
rgb[i] =
|
|
877
|
+
rgb[i] = clamp(rgb[i], 0, 255);
|
|
799
878
|
}
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
879
|
+
rgb[3] = clamp(rgb[3], 0, 1);
|
|
880
|
+
return rgb;
|
|
881
|
+
};
|
|
882
|
+
cs.get.hsl = function (string) {
|
|
883
|
+
if (!string) {
|
|
884
|
+
return null;
|
|
806
885
|
}
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
886
|
+
var hsl = /^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/;
|
|
887
|
+
var match = string.match(hsl);
|
|
888
|
+
if (match) {
|
|
889
|
+
var alpha = parseFloat(match[4]);
|
|
890
|
+
var h = (parseFloat(match[1]) % 360 + 360) % 360;
|
|
891
|
+
var s = clamp(parseFloat(match[2]), 0, 100);
|
|
892
|
+
var l = clamp(parseFloat(match[3]), 0, 100);
|
|
893
|
+
var a = clamp(isNaN(alpha) ? 1 : alpha, 0, 1);
|
|
894
|
+
return [h, s, l, a];
|
|
810
895
|
}
|
|
811
|
-
|
|
896
|
+
return null;
|
|
897
|
+
};
|
|
898
|
+
cs.get.hwb = function (string) {
|
|
899
|
+
if (!string) {
|
|
812
900
|
return null;
|
|
813
901
|
}
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
return rgb;
|
|
825
|
-
};
|
|
826
|
-
cs.get.hsl = function (string) {
|
|
827
|
-
if (!string) {
|
|
828
|
-
return null;
|
|
829
|
-
}
|
|
830
|
-
var hsl = /^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/;
|
|
831
|
-
var match = string.match(hsl);
|
|
832
|
-
if (match) {
|
|
833
|
-
var alpha = parseFloat(match[4]);
|
|
834
|
-
var h = (parseFloat(match[1]) % 360 + 360) % 360;
|
|
835
|
-
var s = clamp(parseFloat(match[2]), 0, 100);
|
|
836
|
-
var l = clamp(parseFloat(match[3]), 0, 100);
|
|
837
|
-
var a = clamp(isNaN(alpha) ? 1 : alpha, 0, 1);
|
|
838
|
-
return [h, s, l, a];
|
|
839
|
-
}
|
|
840
|
-
return null;
|
|
841
|
-
};
|
|
842
|
-
cs.get.hwb = function (string) {
|
|
843
|
-
if (!string) {
|
|
902
|
+
var hwb = /^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/;
|
|
903
|
+
var match = string.match(hwb);
|
|
904
|
+
if (match) {
|
|
905
|
+
var alpha = parseFloat(match[4]);
|
|
906
|
+
var h = (parseFloat(match[1]) % 360 + 360) % 360;
|
|
907
|
+
var w = clamp(parseFloat(match[2]), 0, 100);
|
|
908
|
+
var b = clamp(parseFloat(match[3]), 0, 100);
|
|
909
|
+
var a = clamp(isNaN(alpha) ? 1 : alpha, 0, 1);
|
|
910
|
+
return [h, w, b, a];
|
|
911
|
+
}
|
|
844
912
|
return null;
|
|
845
|
-
}
|
|
846
|
-
var hwb = /^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/;
|
|
847
|
-
var match = string.match(hwb);
|
|
848
|
-
if (match) {
|
|
849
|
-
var alpha = parseFloat(match[4]);
|
|
850
|
-
var h = (parseFloat(match[1]) % 360 + 360) % 360;
|
|
851
|
-
var w = clamp(parseFloat(match[2]), 0, 100);
|
|
852
|
-
var b = clamp(parseFloat(match[3]), 0, 100);
|
|
853
|
-
var a = clamp(isNaN(alpha) ? 1 : alpha, 0, 1);
|
|
854
|
-
return [h, w, b, a];
|
|
855
|
-
}
|
|
856
|
-
return null;
|
|
857
|
-
};
|
|
858
|
-
cs.to.hex = function () {
|
|
859
|
-
var rgba = swizzle(arguments);
|
|
860
|
-
return '#' + hexDouble(rgba[0]) + hexDouble(rgba[1]) + hexDouble(rgba[2]) + (rgba[3] < 1 ? hexDouble(Math.round(rgba[3] * 255)) : '');
|
|
861
|
-
};
|
|
862
|
-
cs.to.rgb = function () {
|
|
863
|
-
var rgba = swizzle(arguments);
|
|
864
|
-
return rgba.length < 4 || rgba[3] === 1 ? 'rgb(' + Math.round(rgba[0]) + ', ' + Math.round(rgba[1]) + ', ' + Math.round(rgba[2]) + ')' : 'rgba(' + Math.round(rgba[0]) + ', ' + Math.round(rgba[1]) + ', ' + Math.round(rgba[2]) + ', ' + rgba[3] + ')';
|
|
865
|
-
};
|
|
866
|
-
cs.to.rgb.percent = function () {
|
|
867
|
-
var rgba = swizzle(arguments);
|
|
868
|
-
var r = Math.round(rgba[0] / 255 * 100);
|
|
869
|
-
var g = Math.round(rgba[1] / 255 * 100);
|
|
870
|
-
var b = Math.round(rgba[2] / 255 * 100);
|
|
871
|
-
return rgba.length < 4 || rgba[3] === 1 ? 'rgb(' + r + '%, ' + g + '%, ' + b + '%)' : 'rgba(' + r + '%, ' + g + '%, ' + b + '%, ' + rgba[3] + ')';
|
|
872
|
-
};
|
|
873
|
-
cs.to.hsl = function () {
|
|
874
|
-
var hsla = swizzle(arguments);
|
|
875
|
-
return hsla.length < 4 || hsla[3] === 1 ? 'hsl(' + hsla[0] + ', ' + hsla[1] + '%, ' + hsla[2] + '%)' : 'hsla(' + hsla[0] + ', ' + hsla[1] + '%, ' + hsla[2] + '%, ' + hsla[3] + ')';
|
|
876
|
-
};
|
|
877
|
-
|
|
878
|
-
// hwb is a bit different than rgb(a) & hsl(a) since there is no alpha specific syntax
|
|
879
|
-
// (hwb have alpha optional & 1 is default value)
|
|
880
|
-
cs.to.hwb = function () {
|
|
881
|
-
var hwba = swizzle(arguments);
|
|
882
|
-
var a = '';
|
|
883
|
-
if (hwba.length >= 4 && hwba[3] !== 1) {
|
|
884
|
-
a = ', ' + hwba[3];
|
|
885
|
-
}
|
|
886
|
-
return 'hwb(' + hwba[0] + ', ' + hwba[1] + '%, ' + hwba[2] + '%' + a + ')';
|
|
887
|
-
};
|
|
888
|
-
cs.to.keyword = function (rgb) {
|
|
889
|
-
return reverseNames[rgb.slice(0, 3)];
|
|
890
|
-
};
|
|
891
|
-
|
|
892
|
-
// helpers
|
|
893
|
-
function clamp(num, min, max) {
|
|
894
|
-
return Math.min(Math.max(min, num), max);
|
|
895
|
-
}
|
|
896
|
-
function hexDouble(num) {
|
|
897
|
-
var str = Math.round(num).toString(16).toUpperCase();
|
|
898
|
-
return str.length < 2 ? '0' + str : str;
|
|
899
|
-
}
|
|
900
|
-
var colorStringExports = colorString.exports;
|
|
901
|
-
|
|
902
|
-
(function (exports) {
|
|
903
|
-
|
|
904
|
-
var __assign = commonjsGlobal && commonjsGlobal.__assign || function () {
|
|
905
|
-
__assign = Object.assign || function (t) {
|
|
906
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
907
|
-
s = arguments[i];
|
|
908
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
909
|
-
}
|
|
910
|
-
return t;
|
|
911
|
-
};
|
|
912
|
-
return __assign.apply(this, arguments);
|
|
913
913
|
};
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
918
|
-
ar[i] = from[i];
|
|
919
|
-
}
|
|
920
|
-
}
|
|
921
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
914
|
+
cs.to.hex = function () {
|
|
915
|
+
var rgba = swizzle(arguments);
|
|
916
|
+
return '#' + hexDouble(rgba[0]) + hexDouble(rgba[1]) + hexDouble(rgba[2]) + (rgba[3] < 1 ? hexDouble(Math.round(rgba[3] * 255)) : '');
|
|
922
917
|
};
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
exports.spacing = exports.colorInHex = exports.color = exports.remToUnitlessPx = exports.text = void 0;
|
|
927
|
-
var colorString = colorStringExports;
|
|
928
|
-
var colors_1 = colors;
|
|
929
|
-
var space_1 = space;
|
|
930
|
-
var typography_1 = typography;
|
|
931
|
-
var text = function text(name, font) {
|
|
932
|
-
if (font === void 0) {
|
|
933
|
-
font = 'sans';
|
|
934
|
-
}
|
|
935
|
-
var treatment = typography_1.typography['text-treatments'][name];
|
|
936
|
-
return __assign(__assign({}, treatment), {
|
|
937
|
-
'font-family': typography_1.typography.fonts[font].join(','),
|
|
938
|
-
'line-height': "".concat(treatment['line-height'])
|
|
939
|
-
});
|
|
918
|
+
cs.to.rgb = function () {
|
|
919
|
+
var rgba = swizzle(arguments);
|
|
920
|
+
return rgba.length < 4 || rgba[3] === 1 ? 'rgb(' + Math.round(rgba[0]) + ', ' + Math.round(rgba[1]) + ', ' + Math.round(rgba[2]) + ')' : 'rgba(' + Math.round(rgba[0]) + ', ' + Math.round(rgba[1]) + ', ' + Math.round(rgba[2]) + ', ' + rgba[3] + ')';
|
|
940
921
|
};
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
922
|
+
cs.to.rgb.percent = function () {
|
|
923
|
+
var rgba = swizzle(arguments);
|
|
924
|
+
var r = Math.round(rgba[0] / 255 * 100);
|
|
925
|
+
var g = Math.round(rgba[1] / 255 * 100);
|
|
926
|
+
var b = Math.round(rgba[2] / 255 * 100);
|
|
927
|
+
return rgba.length < 4 || rgba[3] === 1 ? 'rgb(' + r + '%, ' + g + '%, ' + b + '%)' : 'rgba(' + r + '%, ' + g + '%, ' + b + '%, ' + rgba[3] + ')';
|
|
944
928
|
};
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
var color = colors_1.colors.all[name];
|
|
949
|
-
return alpha != null ?
|
|
950
|
-
// eslint-disable-next-line @typescript-eslint/no-magic-numbers
|
|
951
|
-
colorString.to.rgb(__spreadArray(__spreadArray([], ((_a = colorString.get.rgb(color)) === null || _a === void 0 ? void 0 : _a.slice(0, 3)) || [], true), [alpha], false)) : color;
|
|
929
|
+
cs.to.hsl = function () {
|
|
930
|
+
var hsla = swizzle(arguments);
|
|
931
|
+
return hsla.length < 4 || hsla[3] === 1 ? 'hsl(' + hsla[0] + ', ' + hsla[1] + '%, ' + hsla[2] + '%)' : 'hsla(' + hsla[0] + ', ' + hsla[1] + '%, ' + hsla[2] + '%, ' + hsla[3] + ')';
|
|
952
932
|
};
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
933
|
+
|
|
934
|
+
// hwb is a bit different than rgb(a) & hsl(a) since there is no alpha specific syntax
|
|
935
|
+
// (hwb have alpha optional & 1 is default value)
|
|
936
|
+
cs.to.hwb = function () {
|
|
937
|
+
var hwba = swizzle(arguments);
|
|
938
|
+
var a = '';
|
|
939
|
+
if (hwba.length >= 4 && hwba[3] !== 1) {
|
|
940
|
+
a = ', ' + hwba[3];
|
|
941
|
+
}
|
|
942
|
+
return 'hwb(' + hwba[0] + ', ' + hwba[1] + '%, ' + hwba[2] + '%' + a + ')';
|
|
956
943
|
};
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
return [topY, rightX, bottom, left].reduce(function (acc, value) {
|
|
960
|
-
var _a;
|
|
961
|
-
if (value === undefined) return acc;
|
|
962
|
-
return [acc, (_a = space_1.space.scale[Number(value)]) !== null && _a !== void 0 ? _a : value].join(' ');
|
|
963
|
-
}, '');
|
|
944
|
+
cs.to.keyword = function (rgb) {
|
|
945
|
+
return reverseNames[rgb.slice(0, 3)];
|
|
964
946
|
};
|
|
965
|
-
exports.spacing = spacing;
|
|
966
|
-
})(helpers);
|
|
967
947
|
|
|
968
|
-
|
|
948
|
+
// helpers
|
|
949
|
+
function clamp(num, min, max) {
|
|
950
|
+
return Math.min(Math.max(min, num), max);
|
|
951
|
+
}
|
|
952
|
+
function hexDouble(num) {
|
|
953
|
+
var str = Math.round(num).toString(16).toUpperCase();
|
|
954
|
+
return str.length < 2 ? '0' + str : str;
|
|
955
|
+
}
|
|
956
|
+
return colorString.exports;
|
|
957
|
+
}
|
|
969
958
|
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
959
|
+
var hasRequiredHelpers;
|
|
960
|
+
function requireHelpers() {
|
|
961
|
+
if (hasRequiredHelpers) return helpers;
|
|
962
|
+
hasRequiredHelpers = 1;
|
|
963
|
+
(function (exports) {
|
|
964
|
+
|
|
965
|
+
var __assign = helpers && helpers.__assign || function () {
|
|
966
|
+
__assign = Object.assign || function (t) {
|
|
967
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
968
|
+
s = arguments[i];
|
|
969
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
978
970
|
}
|
|
971
|
+
return t;
|
|
979
972
|
};
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
return
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
return
|
|
1012
|
-
}
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
973
|
+
return __assign.apply(this, arguments);
|
|
974
|
+
};
|
|
975
|
+
var __spreadArray = helpers && helpers.__spreadArray || function (to, from, pack) {
|
|
976
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
977
|
+
if (ar || !(i in from)) {
|
|
978
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
979
|
+
ar[i] = from[i];
|
|
980
|
+
}
|
|
981
|
+
}
|
|
982
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
983
|
+
};
|
|
984
|
+
Object.defineProperty(exports, "__esModule", {
|
|
985
|
+
value: true
|
|
986
|
+
});
|
|
987
|
+
exports.spacing = exports.colorInHex = exports.color = exports.remToUnitlessPx = exports.text = void 0;
|
|
988
|
+
var colorString = requireColorString();
|
|
989
|
+
var colors_1 = requireColors();
|
|
990
|
+
var space_1 = requireSpace();
|
|
991
|
+
var typography_1 = requireTypography();
|
|
992
|
+
var text = function text(name, font) {
|
|
993
|
+
if (font === void 0) {
|
|
994
|
+
font = 'sans';
|
|
995
|
+
}
|
|
996
|
+
var treatment = typography_1.typography['text-treatments'][name];
|
|
997
|
+
return __assign(__assign({}, treatment), {
|
|
998
|
+
'font-family': typography_1.typography.fonts[font].join(','),
|
|
999
|
+
'line-height': "".concat(treatment['line-height'])
|
|
1000
|
+
});
|
|
1001
|
+
};
|
|
1002
|
+
exports.text = text;
|
|
1003
|
+
var remToUnitlessPx = function remToUnitlessPx(value) {
|
|
1004
|
+
return parseFloat(value) * parseInt(typography_1.typography['root-font-size'], 10);
|
|
1005
|
+
};
|
|
1006
|
+
exports.remToUnitlessPx = remToUnitlessPx;
|
|
1007
|
+
var color = function color(name, alpha) {
|
|
1008
|
+
var _a;
|
|
1009
|
+
var color = colors_1.colors.all[name];
|
|
1010
|
+
return alpha != null ?
|
|
1011
|
+
// eslint-disable-next-line @typescript-eslint/no-magic-numbers
|
|
1012
|
+
colorString.to.rgb(__spreadArray(__spreadArray([], ((_a = colorString.get.rgb(color)) === null || _a === void 0 ? void 0 : _a.slice(0, 3)) || [], true), [alpha], false)) : color;
|
|
1013
|
+
};
|
|
1014
|
+
exports.color = color;
|
|
1015
|
+
var colorInHex = function colorInHex(name, alpha) {
|
|
1016
|
+
return colorString.to.hex(colorString.get.rgb((0, exports.color)(name, alpha)));
|
|
1017
|
+
};
|
|
1018
|
+
exports.colorInHex = colorInHex;
|
|
1019
|
+
var spacing = function spacing(topY, rightX, bottom, left) {
|
|
1020
|
+
return [topY, rightX, bottom, left].reduce(function (acc, value) {
|
|
1021
|
+
var _a;
|
|
1022
|
+
if (value === undefined) return acc;
|
|
1023
|
+
return [acc, (_a = space_1.space.scale[Number(value)]) !== null && _a !== void 0 ? _a : value].join(' ');
|
|
1024
|
+
}, '');
|
|
1025
|
+
};
|
|
1026
|
+
exports.spacing = spacing;
|
|
1027
|
+
})(helpers);
|
|
1028
|
+
return helpers;
|
|
1029
|
+
}
|
|
1030
|
+
|
|
1031
|
+
var hasRequiredDist$4;
|
|
1032
|
+
function requireDist$4() {
|
|
1033
|
+
if (hasRequiredDist$4) return dist$4;
|
|
1034
|
+
hasRequiredDist$4 = 1;
|
|
1035
|
+
(function (exports) {
|
|
1036
|
+
|
|
1037
|
+
var __createBinding = dist$4 && dist$4.__createBinding || (Object.create ? function (o, m, k, k2) {
|
|
1038
|
+
if (k2 === undefined) k2 = k;
|
|
1039
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
1040
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
1041
|
+
desc = {
|
|
1042
|
+
enumerable: true,
|
|
1043
|
+
get: function get() {
|
|
1044
|
+
return m[k];
|
|
1045
|
+
}
|
|
1046
|
+
};
|
|
1047
|
+
}
|
|
1048
|
+
Object.defineProperty(o, k2, desc);
|
|
1049
|
+
} : function (o, m, k, k2) {
|
|
1050
|
+
if (k2 === undefined) k2 = k;
|
|
1051
|
+
o[k2] = m[k];
|
|
1052
|
+
});
|
|
1053
|
+
var __exportStar = dist$4 && dist$4.__exportStar || function (m, exports) {
|
|
1054
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
1055
|
+
};
|
|
1056
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1057
|
+
value: true
|
|
1058
|
+
});
|
|
1059
|
+
exports.breakpoints = exports.space = exports.typography = exports.colors = void 0;
|
|
1060
|
+
var colors_1 = requireColors();
|
|
1061
|
+
Object.defineProperty(exports, "colors", {
|
|
1062
|
+
enumerable: true,
|
|
1063
|
+
get: function get() {
|
|
1064
|
+
return colors_1.colors;
|
|
1065
|
+
}
|
|
1066
|
+
});
|
|
1067
|
+
var typography_1 = requireTypography();
|
|
1068
|
+
Object.defineProperty(exports, "typography", {
|
|
1069
|
+
enumerable: true,
|
|
1070
|
+
get: function get() {
|
|
1071
|
+
return typography_1.typography;
|
|
1072
|
+
}
|
|
1073
|
+
});
|
|
1074
|
+
var space_1 = requireSpace();
|
|
1075
|
+
Object.defineProperty(exports, "space", {
|
|
1076
|
+
enumerable: true,
|
|
1077
|
+
get: function get() {
|
|
1078
|
+
return space_1.space;
|
|
1079
|
+
}
|
|
1080
|
+
});
|
|
1081
|
+
var breakpoints_1 = requireBreakpoints();
|
|
1082
|
+
Object.defineProperty(exports, "breakpoints", {
|
|
1083
|
+
enumerable: true,
|
|
1084
|
+
get: function get() {
|
|
1085
|
+
return breakpoints_1.breakpoints;
|
|
1086
|
+
}
|
|
1087
|
+
});
|
|
1088
|
+
__exportStar(requireHelpers(), exports);
|
|
1089
|
+
})(dist$4);
|
|
1090
|
+
return dist$4;
|
|
1091
|
+
}
|
|
1092
|
+
|
|
1093
|
+
var distExports$4 = requireDist$4();
|
|
1023
1094
|
|
|
1024
1095
|
function _arrayLikeToArray(r, a) {
|
|
1025
1096
|
(null == a || a > r.length) && (a = r.length);
|
|
@@ -1220,61 +1291,68 @@ var isRenderProps = function isRenderProps(children) {
|
|
|
1220
1291
|
|
|
1221
1292
|
var classnames = {exports: {}};
|
|
1222
1293
|
|
|
1223
|
-
|
|
1224
|
-
|
|
1294
|
+
var hasRequiredClassnames;
|
|
1295
|
+
function requireClassnames() {
|
|
1296
|
+
if (hasRequiredClassnames) return classnames.exports;
|
|
1297
|
+
hasRequiredClassnames = 1;
|
|
1298
|
+
(function (module) {
|
|
1299
|
+
/* global define */
|
|
1225
1300
|
|
|
1226
|
-
|
|
1301
|
+
(function () {
|
|
1227
1302
|
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1303
|
+
var hasOwn = {}.hasOwnProperty;
|
|
1304
|
+
function classNames() {
|
|
1305
|
+
var classes = '';
|
|
1306
|
+
for (var i = 0; i < arguments.length; i++) {
|
|
1307
|
+
var arg = arguments[i];
|
|
1308
|
+
if (arg) {
|
|
1309
|
+
classes = appendClass(classes, parseValue(arg));
|
|
1310
|
+
}
|
|
1235
1311
|
}
|
|
1312
|
+
return classes;
|
|
1236
1313
|
}
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
if (_typeof$1(arg) !== 'object') {
|
|
1244
|
-
return '';
|
|
1245
|
-
}
|
|
1246
|
-
if (Array.isArray(arg)) {
|
|
1247
|
-
return classNames.apply(null, arg);
|
|
1248
|
-
}
|
|
1249
|
-
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
|
|
1250
|
-
return arg.toString();
|
|
1251
|
-
}
|
|
1252
|
-
var classes = '';
|
|
1253
|
-
for (var key in arg) {
|
|
1254
|
-
if (hasOwn.call(arg, key) && arg[key]) {
|
|
1255
|
-
classes = appendClass(classes, key);
|
|
1314
|
+
function parseValue(arg) {
|
|
1315
|
+
if (typeof arg === 'string' || typeof arg === 'number') {
|
|
1316
|
+
return arg;
|
|
1317
|
+
}
|
|
1318
|
+
if (_typeof$1(arg) !== 'object') {
|
|
1319
|
+
return '';
|
|
1256
1320
|
}
|
|
1321
|
+
if (Array.isArray(arg)) {
|
|
1322
|
+
return classNames.apply(null, arg);
|
|
1323
|
+
}
|
|
1324
|
+
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
|
|
1325
|
+
return arg.toString();
|
|
1326
|
+
}
|
|
1327
|
+
var classes = '';
|
|
1328
|
+
for (var key in arg) {
|
|
1329
|
+
if (hasOwn.call(arg, key) && arg[key]) {
|
|
1330
|
+
classes = appendClass(classes, key);
|
|
1331
|
+
}
|
|
1332
|
+
}
|
|
1333
|
+
return classes;
|
|
1257
1334
|
}
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1335
|
+
function appendClass(value, newClass) {
|
|
1336
|
+
if (!newClass) {
|
|
1337
|
+
return value;
|
|
1338
|
+
}
|
|
1339
|
+
if (value) {
|
|
1340
|
+
return value + ' ' + newClass;
|
|
1341
|
+
}
|
|
1342
|
+
return value + newClass;
|
|
1263
1343
|
}
|
|
1264
|
-
if (
|
|
1265
|
-
|
|
1344
|
+
if (module.exports) {
|
|
1345
|
+
classNames["default"] = classNames;
|
|
1346
|
+
module.exports = classNames;
|
|
1347
|
+
} else {
|
|
1348
|
+
window.classNames = classNames;
|
|
1266
1349
|
}
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
window.classNames = classNames;
|
|
1274
|
-
}
|
|
1275
|
-
})();
|
|
1276
|
-
})(classnames);
|
|
1277
|
-
var classnamesExports = classnames.exports;
|
|
1350
|
+
})();
|
|
1351
|
+
})(classnames);
|
|
1352
|
+
return classnames.exports;
|
|
1353
|
+
}
|
|
1354
|
+
|
|
1355
|
+
var classnamesExports = requireClassnames();
|
|
1278
1356
|
var classNames = /*@__PURE__*/getDefaultExportFromCjs(classnamesExports);
|
|
1279
1357
|
|
|
1280
1358
|
var _excluded$G = ["className", "children", "space", "direction", "alignItems", "justifyContent", "style"];
|
|
@@ -1405,15 +1483,15 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
1405
1483
|
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
1406
1484
|
|
|
1407
1485
|
|
|
1408
|
-
var __assign$
|
|
1409
|
-
__assign$
|
|
1486
|
+
var __assign$a = function() {
|
|
1487
|
+
__assign$a = Object.assign || function __assign(t) {
|
|
1410
1488
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
1411
1489
|
s = arguments[i];
|
|
1412
1490
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
1413
1491
|
}
|
|
1414
1492
|
return t;
|
|
1415
1493
|
};
|
|
1416
|
-
return __assign$
|
|
1494
|
+
return __assign$a.apply(this, arguments);
|
|
1417
1495
|
};
|
|
1418
1496
|
|
|
1419
1497
|
function __rest$a(s, e) {
|
|
@@ -1657,7 +1735,7 @@ function createSidecarMedium(options) {
|
|
|
1657
1735
|
options = {};
|
|
1658
1736
|
}
|
|
1659
1737
|
var medium = innerCreateMedium(null);
|
|
1660
|
-
medium.options = __assign$
|
|
1738
|
+
medium.options = __assign$a({
|
|
1661
1739
|
async: true,
|
|
1662
1740
|
ssr: false
|
|
1663
1741
|
}, options);
|
|
@@ -1674,7 +1752,7 @@ var SideCar$1 = function SideCar(_a) {
|
|
|
1674
1752
|
if (!Target) {
|
|
1675
1753
|
throw new Error('Sidecar medium not found');
|
|
1676
1754
|
}
|
|
1677
|
-
return /*#__PURE__*/React__namespace.createElement(Target, __assign$
|
|
1755
|
+
return /*#__PURE__*/React__namespace.createElement(Target, __assign$a({}, rest));
|
|
1678
1756
|
};
|
|
1679
1757
|
SideCar$1.isSideCarExport = true;
|
|
1680
1758
|
function exportSidecar(medium, exported) {
|
|
@@ -1715,8 +1793,8 @@ var RemoveScroll = /*#__PURE__*/React__namespace.forwardRef(function (props, par
|
|
|
1715
1793
|
rest = __rest$a(props, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]);
|
|
1716
1794
|
var SideCar = sideCar;
|
|
1717
1795
|
var containerRef = useMergeRefs([ref, parentRef]);
|
|
1718
|
-
var containerProps = __assign$
|
|
1719
|
-
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, enabled && (
|
|
1796
|
+
var containerProps = __assign$a(__assign$a({}, rest), callbacks);
|
|
1797
|
+
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, enabled && (/*#__PURE__*/React__namespace.createElement(SideCar, {
|
|
1720
1798
|
sideCar: effectCar$1,
|
|
1721
1799
|
removeScrollBar: removeScrollBar,
|
|
1722
1800
|
shards: shards,
|
|
@@ -1726,9 +1804,9 @@ var RemoveScroll = /*#__PURE__*/React__namespace.forwardRef(function (props, par
|
|
|
1726
1804
|
allowPinchZoom: !!allowPinchZoom,
|
|
1727
1805
|
lockRef: ref,
|
|
1728
1806
|
gapMode: gapMode
|
|
1729
|
-
})), forwardProps ? (
|
|
1807
|
+
})), forwardProps ? (/*#__PURE__*/React__namespace.cloneElement(React__namespace.Children.only(children), __assign$a(__assign$a({}, containerProps), {
|
|
1730
1808
|
ref: containerRef
|
|
1731
|
-
}))) : (
|
|
1809
|
+
}))) : (/*#__PURE__*/React__namespace.createElement(Container, __assign$a({}, containerProps, {
|
|
1732
1810
|
className: className,
|
|
1733
1811
|
ref: containerRef
|
|
1734
1812
|
}), children)));
|
|
@@ -2167,9 +2245,9 @@ function requireCheckPropTypes() {
|
|
|
2167
2245
|
hasRequiredCheckPropTypes = 1;
|
|
2168
2246
|
var printWarning = function printWarning() {};
|
|
2169
2247
|
if (process.env.NODE_ENV !== 'production') {
|
|
2170
|
-
var ReactPropTypesSecret = requireReactPropTypesSecret();
|
|
2248
|
+
var ReactPropTypesSecret = /*@__PURE__*/requireReactPropTypesSecret();
|
|
2171
2249
|
var loggedTypeFailures = {};
|
|
2172
|
-
var has = requireHas();
|
|
2250
|
+
var has = /*@__PURE__*/requireHas();
|
|
2173
2251
|
printWarning = function printWarning(text) {
|
|
2174
2252
|
var message = 'Warning: ' + text;
|
|
2175
2253
|
if (typeof console !== 'undefined') {
|
|
@@ -2251,9 +2329,9 @@ function requireFactoryWithTypeCheckers() {
|
|
|
2251
2329
|
hasRequiredFactoryWithTypeCheckers = 1;
|
|
2252
2330
|
var ReactIs = requireReactIs();
|
|
2253
2331
|
var assign = requireObjectAssign();
|
|
2254
|
-
var ReactPropTypesSecret = requireReactPropTypesSecret();
|
|
2255
|
-
var has = requireHas();
|
|
2256
|
-
var checkPropTypes = requireCheckPropTypes();
|
|
2332
|
+
var ReactPropTypesSecret = /*@__PURE__*/requireReactPropTypesSecret();
|
|
2333
|
+
var has = /*@__PURE__*/requireHas();
|
|
2334
|
+
var checkPropTypes = /*@__PURE__*/requireCheckPropTypes();
|
|
2257
2335
|
var printWarning = function printWarning() {};
|
|
2258
2336
|
if (process.env.NODE_ENV !== 'production') {
|
|
2259
2337
|
printWarning = function printWarning(text) {
|
|
@@ -2802,7 +2880,7 @@ var hasRequiredFactoryWithThrowingShims;
|
|
|
2802
2880
|
function requireFactoryWithThrowingShims() {
|
|
2803
2881
|
if (hasRequiredFactoryWithThrowingShims) return factoryWithThrowingShims;
|
|
2804
2882
|
hasRequiredFactoryWithThrowingShims = 1;
|
|
2805
|
-
var ReactPropTypesSecret = requireReactPropTypesSecret();
|
|
2883
|
+
var ReactPropTypesSecret = /*@__PURE__*/requireReactPropTypesSecret();
|
|
2806
2884
|
function emptyFunction() {}
|
|
2807
2885
|
function emptyFunctionWithReset() {}
|
|
2808
2886
|
emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
|
@@ -2857,19 +2935,26 @@ function requireFactoryWithThrowingShims() {
|
|
|
2857
2935
|
* This source code is licensed under the MIT license found in the
|
|
2858
2936
|
* LICENSE file in the root directory of this source tree.
|
|
2859
2937
|
*/
|
|
2860
|
-
|
|
2861
|
-
|
|
2938
|
+
var hasRequiredPropTypes;
|
|
2939
|
+
function requirePropTypes() {
|
|
2940
|
+
if (hasRequiredPropTypes) return propTypes.exports;
|
|
2941
|
+
hasRequiredPropTypes = 1;
|
|
2942
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2943
|
+
var ReactIs = requireReactIs();
|
|
2862
2944
|
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
} else {
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2945
|
+
// By explicitly using `prop-types` you are opting into new development behavior.
|
|
2946
|
+
// http://fb.me/prop-types-in-prod
|
|
2947
|
+
var throwOnDirectAccess = true;
|
|
2948
|
+
propTypes.exports = /*@__PURE__*/requireFactoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess);
|
|
2949
|
+
} else {
|
|
2950
|
+
// By explicitly using `prop-types` you are opting into new production behavior.
|
|
2951
|
+
// http://fb.me/prop-types-in-prod
|
|
2952
|
+
propTypes.exports = /*@__PURE__*/requireFactoryWithThrowingShims()();
|
|
2953
|
+
}
|
|
2954
|
+
return propTypes.exports;
|
|
2871
2955
|
}
|
|
2872
|
-
|
|
2956
|
+
|
|
2957
|
+
var propTypesExports = /*@__PURE__*/ requirePropTypes();
|
|
2873
2958
|
var PropTypes = /*@__PURE__*/getDefaultExportFromCjs(propTypesExports);
|
|
2874
2959
|
|
|
2875
2960
|
/**
|
|
@@ -3145,7 +3230,7 @@ var FocusOn$1 = /*#__PURE__*/React__namespace.forwardRef(function (props, parent
|
|
|
3145
3230
|
var onActivation = lockProps.onActivation,
|
|
3146
3231
|
onDeactivation = lockProps.onDeactivation,
|
|
3147
3232
|
restProps = __rest$a(lockProps, ["onActivation", "onDeactivation"]);
|
|
3148
|
-
var appliedLockProps = __assign$
|
|
3233
|
+
var appliedLockProps = __assign$a(__assign$a({}, restProps), {
|
|
3149
3234
|
as: as,
|
|
3150
3235
|
style: style,
|
|
3151
3236
|
sideCar: sideCar,
|
|
@@ -3170,7 +3255,7 @@ var FocusOn$1 = /*#__PURE__*/React__namespace.forwardRef(function (props, parent
|
|
|
3170
3255
|
lockProps: appliedLockProps,
|
|
3171
3256
|
focusOptions: preventScrollOnFocus ? PREVENT_SCROLL : undefined,
|
|
3172
3257
|
as: RemoveScroll
|
|
3173
|
-
}, children), enabled && (
|
|
3258
|
+
}, children), enabled && (/*#__PURE__*/React__namespace.createElement(SideCar, __assign$a({}, rest, {
|
|
3174
3259
|
sideCar: effectCar,
|
|
3175
3260
|
setLockProps: setLockProps,
|
|
3176
3261
|
shards: shards
|
|
@@ -4809,7 +4894,7 @@ function RemoveScrollSideCar(props) {
|
|
|
4809
4894
|
return;
|
|
4810
4895
|
}, [props.inert, props.lockRef.current, props.shards]);
|
|
4811
4896
|
var shouldCancelEvent = React__namespace.useCallback(function (event, parent) {
|
|
4812
|
-
if ('touches' in event && event.touches.length === 2) {
|
|
4897
|
+
if ('touches' in event && event.touches.length === 2 || event.type === 'wheel' && event.ctrlKey) {
|
|
4813
4898
|
return !lastProps.current.allowPinchZoom;
|
|
4814
4899
|
}
|
|
4815
4900
|
var touch = getTouchXY(event);
|
|
@@ -5193,10 +5278,10 @@ function Effect(_a) {
|
|
|
5193
5278
|
var SideCar = exportSidecar(effectCar, Effect);
|
|
5194
5279
|
|
|
5195
5280
|
var RequireSideCar = function RequireSideCar(props) {
|
|
5196
|
-
return /*#__PURE__*/React__namespace.createElement(SideCar, __assign$
|
|
5281
|
+
return /*#__PURE__*/React__namespace.createElement(SideCar, __assign$a({}, props));
|
|
5197
5282
|
};
|
|
5198
5283
|
var FocusOn = /*#__PURE__*/React__namespace.forwardRef(function (props, ref) {
|
|
5199
|
-
return /*#__PURE__*/React__namespace.createElement(FocusOn$1, __assign$
|
|
5284
|
+
return /*#__PURE__*/React__namespace.createElement(FocusOn$1, __assign$a({}, props, {
|
|
5200
5285
|
ref: ref,
|
|
5201
5286
|
sideCar: RequireSideCar
|
|
5202
5287
|
}));
|
|
@@ -5206,87 +5291,101 @@ var dist$3 = {};
|
|
|
5206
5291
|
|
|
5207
5292
|
var scale = {};
|
|
5208
5293
|
|
|
5209
|
-
|
|
5294
|
+
var hasRequiredScale;
|
|
5295
|
+
function requireScale() {
|
|
5296
|
+
if (hasRequiredScale) return scale;
|
|
5297
|
+
hasRequiredScale = 1;
|
|
5298
|
+
(function (exports) {
|
|
5210
5299
|
|
|
5211
|
-
|
|
5212
|
-
|
|
5213
|
-
|
|
5214
|
-
|
|
5215
|
-
|
|
5300
|
+
var __assign = scale && scale.__assign || function () {
|
|
5301
|
+
__assign = Object.assign || function (t) {
|
|
5302
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5303
|
+
s = arguments[i];
|
|
5304
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
5305
|
+
}
|
|
5306
|
+
return t;
|
|
5307
|
+
};
|
|
5308
|
+
return __assign.apply(this, arguments);
|
|
5309
|
+
};
|
|
5310
|
+
var __rest = scale && scale.__rest || function (s, e) {
|
|
5311
|
+
var t = {};
|
|
5312
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
5313
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
5314
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
5216
5315
|
}
|
|
5217
5316
|
return t;
|
|
5218
5317
|
};
|
|
5219
|
-
|
|
5220
|
-
|
|
5221
|
-
|
|
5222
|
-
|
|
5223
|
-
|
|
5224
|
-
|
|
5225
|
-
|
|
5226
|
-
|
|
5227
|
-
|
|
5228
|
-
|
|
5229
|
-
|
|
5230
|
-
|
|
5231
|
-
|
|
5232
|
-
|
|
5233
|
-
|
|
5234
|
-
|
|
5235
|
-
|
|
5236
|
-
|
|
5237
|
-
|
|
5238
|
-
|
|
5239
|
-
|
|
5240
|
-
|
|
5241
|
-
exports.paddingBottom = function (_a) {
|
|
5242
|
-
var width = _a.width,
|
|
5243
|
-
height = _a.height;
|
|
5244
|
-
return height / width * 100.0 + "%";
|
|
5245
|
-
};
|
|
5246
|
-
exports.scale = function (_a) {
|
|
5247
|
-
var width = _a.width,
|
|
5248
|
-
height = _a.height,
|
|
5249
|
-
dimensions = __rest(_a, ["width", "height"]);
|
|
5250
|
-
var scale = exports.factor(__assign({
|
|
5251
|
-
width: width,
|
|
5252
|
-
height: height
|
|
5253
|
-
}, dimensions));
|
|
5254
|
-
var scaledWidth = Math.floor(width * scale);
|
|
5255
|
-
var scaledHeight = Math.floor(height * scale);
|
|
5256
|
-
return {
|
|
5257
|
-
width: scaledWidth,
|
|
5258
|
-
height: scaledHeight,
|
|
5259
|
-
paddingBottom: exports.paddingBottom({
|
|
5318
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5319
|
+
value: true
|
|
5320
|
+
});
|
|
5321
|
+
exports.scale = exports.paddingBottom = exports.factor = void 0;
|
|
5322
|
+
exports.factor = function (_a) {
|
|
5323
|
+
var width = _a.width,
|
|
5324
|
+
height = _a.height,
|
|
5325
|
+
dimensions = __rest(_a, ["width", "height"]);
|
|
5326
|
+
if ("maxHeight" in dimensions && !("maxWidth" in dimensions)) return dimensions.maxHeight / height;
|
|
5327
|
+
if ("maxWidth" in dimensions && !("maxHeight" in dimensions)) return dimensions.maxWidth / width;
|
|
5328
|
+
return Math.min(dimensions.maxWidth / width, dimensions.maxHeight / height);
|
|
5329
|
+
};
|
|
5330
|
+
exports.paddingBottom = function (_a) {
|
|
5331
|
+
var width = _a.width,
|
|
5332
|
+
height = _a.height;
|
|
5333
|
+
return height / width * 100.0 + "%";
|
|
5334
|
+
};
|
|
5335
|
+
exports.scale = function (_a) {
|
|
5336
|
+
var width = _a.width,
|
|
5337
|
+
height = _a.height,
|
|
5338
|
+
dimensions = __rest(_a, ["width", "height"]);
|
|
5339
|
+
var scale = exports.factor(__assign({
|
|
5260
5340
|
width: width,
|
|
5261
5341
|
height: height
|
|
5262
|
-
})
|
|
5263
|
-
|
|
5342
|
+
}, dimensions));
|
|
5343
|
+
var scaledWidth = Math.floor(width * scale);
|
|
5344
|
+
var scaledHeight = Math.floor(height * scale);
|
|
5345
|
+
return {
|
|
5346
|
+
width: scaledWidth,
|
|
5347
|
+
height: scaledHeight,
|
|
5348
|
+
paddingBottom: exports.paddingBottom({
|
|
5349
|
+
width: width,
|
|
5350
|
+
height: height
|
|
5351
|
+
}),
|
|
5352
|
+
scale: scale
|
|
5353
|
+
};
|
|
5264
5354
|
};
|
|
5265
|
-
};
|
|
5266
|
-
|
|
5355
|
+
})(scale);
|
|
5356
|
+
return scale;
|
|
5357
|
+
}
|
|
5267
5358
|
|
|
5268
|
-
|
|
5359
|
+
var hasRequiredDist$3;
|
|
5360
|
+
function requireDist$3() {
|
|
5361
|
+
if (hasRequiredDist$3) return dist$3;
|
|
5362
|
+
hasRequiredDist$3 = 1;
|
|
5363
|
+
(function (exports) {
|
|
5269
5364
|
|
|
5270
|
-
|
|
5271
|
-
|
|
5272
|
-
|
|
5273
|
-
|
|
5274
|
-
|
|
5275
|
-
|
|
5276
|
-
|
|
5365
|
+
var __createBinding = dist$3 && dist$3.__createBinding || (Object.create ? function (o, m, k, k2) {
|
|
5366
|
+
if (k2 === undefined) k2 = k;
|
|
5367
|
+
Object.defineProperty(o, k2, {
|
|
5368
|
+
enumerable: true,
|
|
5369
|
+
get: function get() {
|
|
5370
|
+
return m[k];
|
|
5371
|
+
}
|
|
5372
|
+
});
|
|
5373
|
+
} : function (o, m, k, k2) {
|
|
5374
|
+
if (k2 === undefined) k2 = k;
|
|
5375
|
+
o[k2] = m[k];
|
|
5277
5376
|
});
|
|
5278
|
-
|
|
5279
|
-
|
|
5280
|
-
|
|
5281
|
-
|
|
5282
|
-
|
|
5283
|
-
|
|
5284
|
-
|
|
5285
|
-
|
|
5286
|
-
|
|
5287
|
-
|
|
5288
|
-
|
|
5289
|
-
|
|
5377
|
+
var __exportStar = dist$3 && dist$3.__exportStar || function (m, exports) {
|
|
5378
|
+
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
|
|
5379
|
+
};
|
|
5380
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5381
|
+
value: true
|
|
5382
|
+
});
|
|
5383
|
+
__exportStar(requireScale(), exports);
|
|
5384
|
+
})(dist$3);
|
|
5385
|
+
return dist$3;
|
|
5386
|
+
}
|
|
5387
|
+
|
|
5388
|
+
var distExports$3 = requireDist$3();
|
|
5290
5389
|
|
|
5291
5390
|
var _excluded$D = ["aspectWidth", "aspectHeight", "maxWidth", "maxHeight", "outlined", "children", "className"];
|
|
5292
5391
|
var DEFAULT_PRODUCT_ASPECT_WIDTH = 128;
|
|
@@ -5297,18 +5396,18 @@ var scaleDimensions = function scaleDimensions(_ref) {
|
|
|
5297
5396
|
height = _ref.height,
|
|
5298
5397
|
maxWidth = _ref.maxWidth,
|
|
5299
5398
|
maxHeight = _ref.maxHeight;
|
|
5300
|
-
if (maxWidth && maxHeight) return
|
|
5399
|
+
if (maxWidth && maxHeight) return distExports$3.scale({
|
|
5301
5400
|
width: width,
|
|
5302
5401
|
height: height,
|
|
5303
5402
|
maxWidth: maxWidth,
|
|
5304
5403
|
maxHeight: maxHeight
|
|
5305
5404
|
});
|
|
5306
|
-
if (maxWidth) return
|
|
5405
|
+
if (maxWidth) return distExports$3.scale({
|
|
5307
5406
|
width: width,
|
|
5308
5407
|
height: height,
|
|
5309
5408
|
maxWidth: maxWidth
|
|
5310
5409
|
});
|
|
5311
|
-
if (maxHeight) return
|
|
5410
|
+
if (maxHeight) return distExports$3.scale({
|
|
5312
5411
|
width: width,
|
|
5313
5412
|
height: height,
|
|
5314
5413
|
maxHeight: maxHeight
|
|
@@ -5316,7 +5415,7 @@ var scaleDimensions = function scaleDimensions(_ref) {
|
|
|
5316
5415
|
return {
|
|
5317
5416
|
width: width,
|
|
5318
5417
|
height: height,
|
|
5319
|
-
paddingBottom:
|
|
5418
|
+
paddingBottom: distExports$3.paddingBottom({
|
|
5320
5419
|
width: width,
|
|
5321
5420
|
height: height
|
|
5322
5421
|
}),
|
|
@@ -5384,7 +5483,7 @@ var Breadcrumbs = function Breadcrumbs(_ref) {
|
|
|
5384
5483
|
itemType: "http://schema.org/BreadcrumbList",
|
|
5385
5484
|
className: classNames('Breadcrumbs', className)
|
|
5386
5485
|
}, rest), React.Children.map(children, function (child, index) {
|
|
5387
|
-
if (
|
|
5486
|
+
if (/*#__PURE__*/React.isValidElement(child)) {
|
|
5388
5487
|
position = position + 1;
|
|
5389
5488
|
return /*#__PURE__*/React.cloneElement(child, _objectSpread2(_objectSpread2({}, child.props), {}, {
|
|
5390
5489
|
key: index,
|
|
@@ -6258,7 +6357,7 @@ function _xfilter(f) {
|
|
|
6258
6357
|
*
|
|
6259
6358
|
* R.filter(isEven, {a: 1, b: 2, c: 3, d: 4}); //=> {b: 2, d: 4}
|
|
6260
6359
|
*/
|
|
6261
|
-
var filter = /*#__PURE__*/_curry2(
|
|
6360
|
+
var filter = /*#__PURE__*/_curry2(/*#__PURE__*/_dispatchable(['fantasy-land/filter', 'filter'], _xfilter, function (pred, filterable) {
|
|
6262
6361
|
return _isObject(filterable) ? _arrayReduce(function (acc, key) {
|
|
6263
6362
|
if (pred(filterable[key])) {
|
|
6264
6363
|
acc[key] = filterable[key];
|
|
@@ -6479,7 +6578,7 @@ var _xmap = function _xmap(f) {
|
|
|
6479
6578
|
* @symb R.map(f, { x: a, y: b }) = { x: f(a), y: f(b) }
|
|
6480
6579
|
* @symb R.map(f, functor_o) = functor_o.map(f)
|
|
6481
6580
|
*/
|
|
6482
|
-
var map = /*#__PURE__*/_curry2(
|
|
6581
|
+
var map = /*#__PURE__*/_curry2(/*#__PURE__*/_dispatchable(['fantasy-land/map', 'map'], _xmap, function map(fn, functor) {
|
|
6483
6582
|
switch (Object.prototype.toString.call(functor)) {
|
|
6484
6583
|
case '[object Function]':
|
|
6485
6584
|
return curryN(functor.length, function () {
|
|
@@ -6971,7 +7070,7 @@ function _xuniqBy(f) {
|
|
|
6971
7070
|
*
|
|
6972
7071
|
* R.uniqBy(Math.abs, [-1, -5, 2, 10, 1, 2]); //=> [-1, -5, 2, 10]
|
|
6973
7072
|
*/
|
|
6974
|
-
var uniqBy = /*#__PURE__*/_curry2(
|
|
7073
|
+
var uniqBy = /*#__PURE__*/_curry2(/*#__PURE__*/_dispatchable([], _xuniqBy, function (fn, list) {
|
|
6975
7074
|
var set = new _Set();
|
|
6976
7075
|
var result = [];
|
|
6977
7076
|
var idx = 0;
|
|
@@ -7073,7 +7172,7 @@ var range = /*#__PURE__*/_curry2(function range(from, to) {
|
|
|
7073
7172
|
return result;
|
|
7074
7173
|
});
|
|
7075
7174
|
|
|
7076
|
-
var breakpointKeys = Object.keys(
|
|
7175
|
+
var breakpointKeys = Object.keys(distExports$4.breakpoints);
|
|
7077
7176
|
|
|
7078
7177
|
// eslint-disable-next-line @typescript-eslint/no-magic-numbers
|
|
7079
7178
|
var ONE_PIXEL = 1 / 16;
|
|
@@ -7084,19 +7183,19 @@ var getMediaQueryBounds = function getMediaQueryBounds(_ref) {
|
|
|
7084
7183
|
case 'at':
|
|
7085
7184
|
{
|
|
7086
7185
|
var prevIndex = breakpointKeys.indexOf(breakpoint) - 1;
|
|
7087
|
-
var prevWidth = prevIndex === -1 ? 0 : parseInt(
|
|
7186
|
+
var prevWidth = prevIndex === -1 ? 0 : parseInt(distExports$4.breakpoints[breakpointKeys[prevIndex]], 10) + ONE_PIXEL;
|
|
7088
7187
|
return {
|
|
7089
7188
|
min: prevWidth,
|
|
7090
|
-
max: parseInt(
|
|
7189
|
+
max: parseInt(distExports$4.breakpoints[breakpoint], 10)
|
|
7091
7190
|
};
|
|
7092
7191
|
}
|
|
7093
7192
|
case 'gt':
|
|
7094
7193
|
return {
|
|
7095
|
-
min: parseInt(
|
|
7194
|
+
min: parseInt(distExports$4.breakpoints[breakpoint], 10) + ONE_PIXEL
|
|
7096
7195
|
};
|
|
7097
7196
|
case 'lt':
|
|
7098
7197
|
return {
|
|
7099
|
-
max: parseInt(
|
|
7198
|
+
max: parseInt(distExports$4.breakpoints[breakpoint], 10)
|
|
7100
7199
|
};
|
|
7101
7200
|
}
|
|
7102
7201
|
};
|
|
@@ -7218,15 +7317,15 @@ var Button = function Button(_ref) {
|
|
|
7218
7317
|
}, rest));
|
|
7219
7318
|
};
|
|
7220
7319
|
|
|
7221
|
-
var __assign$
|
|
7222
|
-
__assign$
|
|
7320
|
+
var __assign$9 = undefined && undefined.__assign || function () {
|
|
7321
|
+
__assign$9 = Object.assign || function (t) {
|
|
7223
7322
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
7224
7323
|
s = arguments[i];
|
|
7225
7324
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
7226
7325
|
}
|
|
7227
7326
|
return t;
|
|
7228
7327
|
};
|
|
7229
|
-
return __assign$
|
|
7328
|
+
return __assign$9.apply(this, arguments);
|
|
7230
7329
|
};
|
|
7231
7330
|
var __rest$9 = undefined && undefined.__rest || function (s, e) {
|
|
7232
7331
|
var t = {};
|
|
@@ -7244,7 +7343,7 @@ var Checkmark16 = function Checkmark16(_a) {
|
|
|
7244
7343
|
_d = _a.width,
|
|
7245
7344
|
width = _d === void 0 ? '16px' : _d,
|
|
7246
7345
|
rest = __rest$9(_a, ["color", "height", "width"]);
|
|
7247
|
-
var svgStyle = __assign$
|
|
7346
|
+
var svgStyle = __assign$9({
|
|
7248
7347
|
"position": "absolute",
|
|
7249
7348
|
"top": "0",
|
|
7250
7349
|
"right": "0",
|
|
@@ -7255,8 +7354,8 @@ var Checkmark16 = function Checkmark16(_a) {
|
|
|
7255
7354
|
}, {
|
|
7256
7355
|
fill: color
|
|
7257
7356
|
});
|
|
7258
|
-
return /*#__PURE__*/React__namespace.createElement("div", __assign$
|
|
7259
|
-
style: __assign$
|
|
7357
|
+
return /*#__PURE__*/React__namespace.createElement("div", __assign$9({
|
|
7358
|
+
style: __assign$9({
|
|
7260
7359
|
"position": "relative"
|
|
7261
7360
|
}, {
|
|
7262
7361
|
height: height,
|
|
@@ -7271,15 +7370,15 @@ var Checkmark16 = function Checkmark16(_a) {
|
|
|
7271
7370
|
};
|
|
7272
7371
|
Checkmark16.displayName = 'Checkmark16';
|
|
7273
7372
|
|
|
7274
|
-
var __assign$
|
|
7275
|
-
__assign$
|
|
7373
|
+
var __assign$8 = undefined && undefined.__assign || function () {
|
|
7374
|
+
__assign$8 = Object.assign || function (t) {
|
|
7276
7375
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
7277
7376
|
s = arguments[i];
|
|
7278
7377
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
7279
7378
|
}
|
|
7280
7379
|
return t;
|
|
7281
7380
|
};
|
|
7282
|
-
return __assign$
|
|
7381
|
+
return __assign$8.apply(this, arguments);
|
|
7283
7382
|
};
|
|
7284
7383
|
var __rest$8 = undefined && undefined.__rest || function (s, e) {
|
|
7285
7384
|
var t = {};
|
|
@@ -7297,7 +7396,7 @@ var Circle12 = function Circle12(_a) {
|
|
|
7297
7396
|
_d = _a.width,
|
|
7298
7397
|
width = _d === void 0 ? '12px' : _d,
|
|
7299
7398
|
rest = __rest$8(_a, ["color", "height", "width"]);
|
|
7300
|
-
var svgStyle = __assign$
|
|
7399
|
+
var svgStyle = __assign$8({
|
|
7301
7400
|
"position": "absolute",
|
|
7302
7401
|
"top": "0",
|
|
7303
7402
|
"right": "0",
|
|
@@ -7308,8 +7407,8 @@ var Circle12 = function Circle12(_a) {
|
|
|
7308
7407
|
}, {
|
|
7309
7408
|
fill: color
|
|
7310
7409
|
});
|
|
7311
|
-
return /*#__PURE__*/React__namespace.createElement("div", __assign$
|
|
7312
|
-
style: __assign$
|
|
7410
|
+
return /*#__PURE__*/React__namespace.createElement("div", __assign$8({
|
|
7411
|
+
style: __assign$8({
|
|
7313
7412
|
"position": "relative"
|
|
7314
7413
|
}, {
|
|
7315
7414
|
height: height,
|
|
@@ -7565,7 +7664,7 @@ var ModalOverlay = function ModalOverlay(_ref) {
|
|
|
7565
7664
|
};
|
|
7566
7665
|
}, [element]);
|
|
7567
7666
|
if (!element) return null;
|
|
7568
|
-
return /*#__PURE__*/require$$1.createPortal(
|
|
7667
|
+
return /*#__PURE__*/require$$1.createPortal(/*#__PURE__*/React.createElement(Overlay, _extends$1({
|
|
7569
7668
|
className: classNames('ModalOverlay', overlayClassName),
|
|
7570
7669
|
show: show
|
|
7571
7670
|
}, rest), /*#__PURE__*/React.createElement(Modal, {
|
|
@@ -7594,7 +7693,7 @@ var Text = function Text(_ref) {
|
|
|
7594
7693
|
return /*#__PURE__*/React.createElement(Component, _extends$1({
|
|
7595
7694
|
className: classNames("Text Text--".concat(treatment, " ").concat(family ? "Text--".concat(family) : ''), className),
|
|
7596
7695
|
style: _objectSpread2({
|
|
7597
|
-
color:
|
|
7696
|
+
color: distExports$4.colors.all[color]
|
|
7598
7697
|
}, style)
|
|
7599
7698
|
}, rest), children);
|
|
7600
7699
|
};
|
|
@@ -9285,377 +9384,430 @@ function requireReactInputMask_development() {
|
|
|
9285
9384
|
return reactInputMask_development;
|
|
9286
9385
|
}
|
|
9287
9386
|
|
|
9288
|
-
|
|
9289
|
-
|
|
9290
|
-
|
|
9291
|
-
|
|
9387
|
+
var hasRequiredReactInputMask;
|
|
9388
|
+
function requireReactInputMask() {
|
|
9389
|
+
if (hasRequiredReactInputMask) return reactInputMask.exports;
|
|
9390
|
+
hasRequiredReactInputMask = 1;
|
|
9391
|
+
if (process.env.NODE_ENV === 'production') {
|
|
9392
|
+
reactInputMask.exports = requireReactInputMask_production_min();
|
|
9393
|
+
} else {
|
|
9394
|
+
reactInputMask.exports = requireReactInputMask_development();
|
|
9395
|
+
}
|
|
9396
|
+
return reactInputMask.exports;
|
|
9292
9397
|
}
|
|
9293
|
-
|
|
9398
|
+
|
|
9399
|
+
var reactInputMaskExports = requireReactInputMask();
|
|
9294
9400
|
var InputMask = /*@__PURE__*/getDefaultExportFromCjs(reactInputMaskExports);
|
|
9295
9401
|
|
|
9296
|
-
var
|
|
9297
|
-
|
|
9298
|
-
|
|
9299
|
-
|
|
9300
|
-
|
|
9301
|
-
|
|
9302
|
-
|
|
9303
|
-
|
|
9304
|
-
|
|
9305
|
-
|
|
9306
|
-
|
|
9307
|
-
|
|
9308
|
-
|
|
9309
|
-
|
|
9310
|
-
|
|
9311
|
-
|
|
9312
|
-
|
|
9313
|
-
|
|
9314
|
-
|
|
9315
|
-
|
|
9316
|
-
|
|
9317
|
-
|
|
9318
|
-
|
|
9319
|
-
|
|
9320
|
-
|
|
9321
|
-
|
|
9322
|
-
|
|
9323
|
-
|
|
9324
|
-
|
|
9325
|
-
|
|
9326
|
-
|
|
9327
|
-
|
|
9328
|
-
|
|
9329
|
-
|
|
9330
|
-
|
|
9331
|
-
|
|
9332
|
-
|
|
9333
|
-
|
|
9334
|
-
|
|
9335
|
-
|
|
9336
|
-
|
|
9337
|
-
|
|
9338
|
-
|
|
9339
|
-
|
|
9340
|
-
|
|
9341
|
-
|
|
9342
|
-
|
|
9343
|
-
|
|
9344
|
-
|
|
9345
|
-
|
|
9346
|
-
|
|
9347
|
-
|
|
9348
|
-
|
|
9349
|
-
|
|
9350
|
-
|
|
9351
|
-
|
|
9352
|
-
|
|
9353
|
-
|
|
9354
|
-
|
|
9355
|
-
|
|
9356
|
-
|
|
9357
|
-
|
|
9358
|
-
|
|
9359
|
-
|
|
9360
|
-
|
|
9361
|
-
|
|
9362
|
-
|
|
9363
|
-
|
|
9364
|
-
|
|
9365
|
-
|
|
9366
|
-
|
|
9367
|
-
|
|
9368
|
-
|
|
9369
|
-
|
|
9370
|
-
|
|
9371
|
-
|
|
9372
|
-
|
|
9373
|
-
|
|
9374
|
-
|
|
9375
|
-
|
|
9376
|
-
|
|
9377
|
-
|
|
9378
|
-
|
|
9379
|
-
|
|
9380
|
-
|
|
9381
|
-
|
|
9382
|
-
|
|
9383
|
-
|
|
9384
|
-
|
|
9385
|
-
|
|
9386
|
-
|
|
9387
|
-
|
|
9388
|
-
|
|
9389
|
-
|
|
9390
|
-
|
|
9391
|
-
|
|
9392
|
-
|
|
9393
|
-
|
|
9394
|
-
|
|
9395
|
-
|
|
9396
|
-
|
|
9397
|
-
|
|
9398
|
-
|
|
9399
|
-
|
|
9400
|
-
|
|
9401
|
-
|
|
9402
|
-
|
|
9403
|
-
|
|
9404
|
-
|
|
9405
|
-
|
|
9406
|
-
|
|
9407
|
-
|
|
9408
|
-
|
|
9409
|
-
|
|
9410
|
-
|
|
9411
|
-
|
|
9412
|
-
|
|
9413
|
-
|
|
9414
|
-
|
|
9415
|
-
|
|
9416
|
-
|
|
9417
|
-
|
|
9418
|
-
|
|
9419
|
-
|
|
9420
|
-
|
|
9421
|
-
|
|
9422
|
-
|
|
9423
|
-
|
|
9424
|
-
|
|
9425
|
-
|
|
9426
|
-
|
|
9402
|
+
var cardTypes_1;
|
|
9403
|
+
var hasRequiredCardTypes;
|
|
9404
|
+
function requireCardTypes() {
|
|
9405
|
+
if (hasRequiredCardTypes) return cardTypes_1;
|
|
9406
|
+
hasRequiredCardTypes = 1;
|
|
9407
|
+
var cardTypes = {
|
|
9408
|
+
visa: {
|
|
9409
|
+
niceType: "Visa",
|
|
9410
|
+
type: "visa",
|
|
9411
|
+
patterns: [4],
|
|
9412
|
+
gaps: [4, 8, 12],
|
|
9413
|
+
lengths: [16, 18, 19],
|
|
9414
|
+
code: {
|
|
9415
|
+
name: "CVV",
|
|
9416
|
+
size: 3
|
|
9417
|
+
}
|
|
9418
|
+
},
|
|
9419
|
+
mastercard: {
|
|
9420
|
+
niceType: "Mastercard",
|
|
9421
|
+
type: "mastercard",
|
|
9422
|
+
patterns: [[51, 55], [2221, 2229], [223, 229], [23, 26], [270, 271], 2720],
|
|
9423
|
+
gaps: [4, 8, 12],
|
|
9424
|
+
lengths: [16],
|
|
9425
|
+
code: {
|
|
9426
|
+
name: "CVC",
|
|
9427
|
+
size: 3
|
|
9428
|
+
}
|
|
9429
|
+
},
|
|
9430
|
+
"american-express": {
|
|
9431
|
+
niceType: "American Express",
|
|
9432
|
+
type: "american-express",
|
|
9433
|
+
patterns: [34, 37],
|
|
9434
|
+
gaps: [4, 10],
|
|
9435
|
+
lengths: [15],
|
|
9436
|
+
code: {
|
|
9437
|
+
name: "CID",
|
|
9438
|
+
size: 4
|
|
9439
|
+
}
|
|
9440
|
+
},
|
|
9441
|
+
"diners-club": {
|
|
9442
|
+
niceType: "Diners Club",
|
|
9443
|
+
type: "diners-club",
|
|
9444
|
+
patterns: [[300, 305], 36, 38, 39],
|
|
9445
|
+
gaps: [4, 10],
|
|
9446
|
+
lengths: [14, 16, 19],
|
|
9447
|
+
code: {
|
|
9448
|
+
name: "CVV",
|
|
9449
|
+
size: 3
|
|
9450
|
+
}
|
|
9451
|
+
},
|
|
9452
|
+
discover: {
|
|
9453
|
+
niceType: "Discover",
|
|
9454
|
+
type: "discover",
|
|
9455
|
+
patterns: [6011, [644, 649], 65],
|
|
9456
|
+
gaps: [4, 8, 12],
|
|
9457
|
+
lengths: [16, 19],
|
|
9458
|
+
code: {
|
|
9459
|
+
name: "CID",
|
|
9460
|
+
size: 3
|
|
9461
|
+
}
|
|
9462
|
+
},
|
|
9463
|
+
jcb: {
|
|
9464
|
+
niceType: "JCB",
|
|
9465
|
+
type: "jcb",
|
|
9466
|
+
patterns: [2131, 1800, [3528, 3589]],
|
|
9467
|
+
gaps: [4, 8, 12],
|
|
9468
|
+
lengths: [16, 17, 18, 19],
|
|
9469
|
+
code: {
|
|
9470
|
+
name: "CVV",
|
|
9471
|
+
size: 3
|
|
9472
|
+
}
|
|
9473
|
+
},
|
|
9474
|
+
unionpay: {
|
|
9475
|
+
niceType: "UnionPay",
|
|
9476
|
+
type: "unionpay",
|
|
9477
|
+
patterns: [620, [62100, 62182], [62184, 62187], [62185, 62197], [62200, 62205], [622010, 622999], 622018, [62207, 62209], [623, 626], 6270, 6272, 6276, [627700, 627779], [627781, 627799], [6282, 6289], 6291, 6292, 810, [8110, 8131], [8132, 8151], [8152, 8163], [8164, 8171]],
|
|
9478
|
+
gaps: [4, 8, 12],
|
|
9479
|
+
lengths: [14, 15, 16, 17, 18, 19],
|
|
9480
|
+
code: {
|
|
9481
|
+
name: "CVN",
|
|
9482
|
+
size: 3
|
|
9483
|
+
}
|
|
9484
|
+
},
|
|
9485
|
+
maestro: {
|
|
9486
|
+
niceType: "Maestro",
|
|
9487
|
+
type: "maestro",
|
|
9488
|
+
patterns: [493698, [500000, 504174], [504176, 506698], [506779, 508999], [56, 59], 63, 67, 6],
|
|
9489
|
+
gaps: [4, 8, 12],
|
|
9490
|
+
lengths: [12, 13, 14, 15, 16, 17, 18, 19],
|
|
9491
|
+
code: {
|
|
9492
|
+
name: "CVC",
|
|
9493
|
+
size: 3
|
|
9494
|
+
}
|
|
9495
|
+
},
|
|
9496
|
+
elo: {
|
|
9497
|
+
niceType: "Elo",
|
|
9498
|
+
type: "elo",
|
|
9499
|
+
patterns: [401178, 401179, 438935, 457631, 457632, 431274, 451416, 457393, 504175, [506699, 506778], [509000, 509999], 627780, 636297, 636368, [650031, 650033], [650035, 650051], [650405, 650439], [650485, 650538], [650541, 650598], [650700, 650718], [650720, 650727], [650901, 650978], [651652, 651679], [655000, 655019], [655021, 655058]],
|
|
9500
|
+
gaps: [4, 8, 12],
|
|
9501
|
+
lengths: [16],
|
|
9502
|
+
code: {
|
|
9503
|
+
name: "CVE",
|
|
9504
|
+
size: 3
|
|
9505
|
+
}
|
|
9506
|
+
},
|
|
9507
|
+
mir: {
|
|
9508
|
+
niceType: "Mir",
|
|
9509
|
+
type: "mir",
|
|
9510
|
+
patterns: [[2200, 2204]],
|
|
9511
|
+
gaps: [4, 8, 12],
|
|
9512
|
+
lengths: [16, 17, 18, 19],
|
|
9513
|
+
code: {
|
|
9514
|
+
name: "CVP2",
|
|
9515
|
+
size: 3
|
|
9516
|
+
}
|
|
9517
|
+
},
|
|
9518
|
+
hiper: {
|
|
9519
|
+
niceType: "Hiper",
|
|
9520
|
+
type: "hiper",
|
|
9521
|
+
patterns: [637095, 63737423, 63743358, 637568, 637599, 637609, 637612],
|
|
9522
|
+
gaps: [4, 8, 12],
|
|
9523
|
+
lengths: [16],
|
|
9524
|
+
code: {
|
|
9525
|
+
name: "CVC",
|
|
9526
|
+
size: 3
|
|
9527
|
+
}
|
|
9528
|
+
},
|
|
9529
|
+
hipercard: {
|
|
9530
|
+
niceType: "Hipercard",
|
|
9531
|
+
type: "hipercard",
|
|
9532
|
+
patterns: [606282],
|
|
9533
|
+
gaps: [4, 8, 12],
|
|
9534
|
+
lengths: [16],
|
|
9535
|
+
code: {
|
|
9536
|
+
name: "CVC",
|
|
9537
|
+
size: 3
|
|
9538
|
+
}
|
|
9427
9539
|
}
|
|
9428
|
-
}
|
|
9429
|
-
|
|
9430
|
-
|
|
9540
|
+
};
|
|
9541
|
+
cardTypes_1 = cardTypes;
|
|
9542
|
+
return cardTypes_1;
|
|
9543
|
+
}
|
|
9431
9544
|
|
|
9432
|
-
var addMatchingCardsToResults
|
|
9545
|
+
var addMatchingCardsToResults = {};
|
|
9433
9546
|
|
|
9434
|
-
var clone
|
|
9547
|
+
var clone = {};
|
|
9435
9548
|
|
|
9436
|
-
|
|
9437
|
-
|
|
9438
|
-
|
|
9439
|
-
|
|
9440
|
-
|
|
9441
|
-
|
|
9442
|
-
|
|
9549
|
+
var hasRequiredClone;
|
|
9550
|
+
function requireClone() {
|
|
9551
|
+
if (hasRequiredClone) return clone;
|
|
9552
|
+
hasRequiredClone = 1;
|
|
9553
|
+
Object.defineProperty(clone, "__esModule", {
|
|
9554
|
+
value: true
|
|
9555
|
+
});
|
|
9556
|
+
clone.clone = void 0;
|
|
9557
|
+
function clone$1(originalObject) {
|
|
9558
|
+
if (!originalObject) {
|
|
9559
|
+
return null;
|
|
9560
|
+
}
|
|
9561
|
+
return JSON.parse(JSON.stringify(originalObject));
|
|
9443
9562
|
}
|
|
9444
|
-
|
|
9563
|
+
clone.clone = clone$1;
|
|
9564
|
+
return clone;
|
|
9445
9565
|
}
|
|
9446
|
-
clone$1.clone = clone;
|
|
9447
9566
|
|
|
9448
|
-
var matches
|
|
9567
|
+
var matches = {};
|
|
9449
9568
|
|
|
9450
|
-
|
|
9451
|
-
|
|
9452
|
-
|
|
9453
|
-
|
|
9454
|
-
|
|
9455
|
-
|
|
9456
|
-
|
|
9457
|
-
|
|
9458
|
-
|
|
9459
|
-
|
|
9460
|
-
|
|
9461
|
-
|
|
9462
|
-
|
|
9463
|
-
|
|
9464
|
-
|
|
9465
|
-
|
|
9466
|
-
|
|
9467
|
-
|
|
9468
|
-
}
|
|
9469
|
-
function
|
|
9470
|
-
|
|
9471
|
-
return
|
|
9569
|
+
var hasRequiredMatches;
|
|
9570
|
+
function requireMatches() {
|
|
9571
|
+
if (hasRequiredMatches) return matches;
|
|
9572
|
+
hasRequiredMatches = 1;
|
|
9573
|
+
/*
|
|
9574
|
+
* Adapted from https://github.com/polvo-labs/card-type/blob/aaab11f80fa1939bccc8f24905a06ae3cd864356/src/cardType.js#L37-L42
|
|
9575
|
+
* */
|
|
9576
|
+
Object.defineProperty(matches, "__esModule", {
|
|
9577
|
+
value: true
|
|
9578
|
+
});
|
|
9579
|
+
matches.matches = void 0;
|
|
9580
|
+
function matchesRange(cardNumber, min, max) {
|
|
9581
|
+
var maxLengthToCheck = String(min).length;
|
|
9582
|
+
var substr = cardNumber.substr(0, maxLengthToCheck);
|
|
9583
|
+
var integerRepresentationOfCardNumber = parseInt(substr, 10);
|
|
9584
|
+
min = parseInt(String(min).substr(0, substr.length), 10);
|
|
9585
|
+
max = parseInt(String(max).substr(0, substr.length), 10);
|
|
9586
|
+
return integerRepresentationOfCardNumber >= min && integerRepresentationOfCardNumber <= max;
|
|
9587
|
+
}
|
|
9588
|
+
function matchesPattern(cardNumber, pattern) {
|
|
9589
|
+
pattern = String(pattern);
|
|
9590
|
+
return pattern.substring(0, cardNumber.length) === cardNumber.substring(0, pattern.length);
|
|
9591
|
+
}
|
|
9592
|
+
function matches$1(cardNumber, pattern) {
|
|
9593
|
+
if (Array.isArray(pattern)) {
|
|
9594
|
+
return matchesRange(cardNumber, pattern[0], pattern[1]);
|
|
9595
|
+
}
|
|
9596
|
+
return matchesPattern(cardNumber, pattern);
|
|
9472
9597
|
}
|
|
9473
|
-
|
|
9598
|
+
matches.matches = matches$1;
|
|
9599
|
+
return matches;
|
|
9474
9600
|
}
|
|
9475
|
-
matches$1.matches = matches;
|
|
9476
9601
|
|
|
9477
|
-
|
|
9478
|
-
|
|
9479
|
-
|
|
9480
|
-
|
|
9481
|
-
|
|
9482
|
-
|
|
9483
|
-
|
|
9484
|
-
|
|
9485
|
-
|
|
9486
|
-
|
|
9487
|
-
|
|
9488
|
-
|
|
9489
|
-
|
|
9490
|
-
|
|
9491
|
-
|
|
9492
|
-
|
|
9493
|
-
|
|
9494
|
-
|
|
9495
|
-
|
|
9496
|
-
|
|
9497
|
-
|
|
9602
|
+
var hasRequiredAddMatchingCardsToResults;
|
|
9603
|
+
function requireAddMatchingCardsToResults() {
|
|
9604
|
+
if (hasRequiredAddMatchingCardsToResults) return addMatchingCardsToResults;
|
|
9605
|
+
hasRequiredAddMatchingCardsToResults = 1;
|
|
9606
|
+
Object.defineProperty(addMatchingCardsToResults, "__esModule", {
|
|
9607
|
+
value: true
|
|
9608
|
+
});
|
|
9609
|
+
addMatchingCardsToResults.addMatchingCardsToResults = void 0;
|
|
9610
|
+
var clone_1 = requireClone();
|
|
9611
|
+
var matches_1 = requireMatches();
|
|
9612
|
+
function addMatchingCardsToResults$1(cardNumber, cardConfiguration, results) {
|
|
9613
|
+
var i, patternLength;
|
|
9614
|
+
for (i = 0; i < cardConfiguration.patterns.length; i++) {
|
|
9615
|
+
var pattern = cardConfiguration.patterns[i];
|
|
9616
|
+
if (!(0, matches_1.matches)(cardNumber, pattern)) {
|
|
9617
|
+
continue;
|
|
9618
|
+
}
|
|
9619
|
+
var clonedCardConfiguration = (0, clone_1.clone)(cardConfiguration);
|
|
9620
|
+
if (Array.isArray(pattern)) {
|
|
9621
|
+
patternLength = String(pattern[0]).length;
|
|
9622
|
+
} else {
|
|
9623
|
+
patternLength = String(pattern).length;
|
|
9624
|
+
}
|
|
9625
|
+
if (cardNumber.length >= patternLength) {
|
|
9626
|
+
clonedCardConfiguration.matchStrength = patternLength;
|
|
9627
|
+
}
|
|
9628
|
+
results.push(clonedCardConfiguration);
|
|
9629
|
+
break;
|
|
9498
9630
|
}
|
|
9499
|
-
results.push(clonedCardConfiguration);
|
|
9500
|
-
break;
|
|
9501
9631
|
}
|
|
9632
|
+
addMatchingCardsToResults.addMatchingCardsToResults = addMatchingCardsToResults$1;
|
|
9633
|
+
return addMatchingCardsToResults;
|
|
9502
9634
|
}
|
|
9503
|
-
addMatchingCardsToResults$1.addMatchingCardsToResults = addMatchingCardsToResults;
|
|
9504
9635
|
|
|
9505
|
-
var isValidInputType
|
|
9636
|
+
var isValidInputType = {};
|
|
9506
9637
|
|
|
9507
|
-
|
|
9508
|
-
|
|
9509
|
-
|
|
9510
|
-
|
|
9511
|
-
|
|
9512
|
-
|
|
9638
|
+
var hasRequiredIsValidInputType;
|
|
9639
|
+
function requireIsValidInputType() {
|
|
9640
|
+
if (hasRequiredIsValidInputType) return isValidInputType;
|
|
9641
|
+
hasRequiredIsValidInputType = 1;
|
|
9642
|
+
Object.defineProperty(isValidInputType, "__esModule", {
|
|
9643
|
+
value: true
|
|
9644
|
+
});
|
|
9645
|
+
isValidInputType.isValidInputType = void 0;
|
|
9646
|
+
function isValidInputType$1(cardNumber) {
|
|
9647
|
+
return typeof cardNumber === "string" || cardNumber instanceof String;
|
|
9648
|
+
}
|
|
9649
|
+
isValidInputType.isValidInputType = isValidInputType$1;
|
|
9650
|
+
return isValidInputType;
|
|
9513
9651
|
}
|
|
9514
|
-
isValidInputType$1.isValidInputType = isValidInputType;
|
|
9515
9652
|
|
|
9516
|
-
var findBestMatch
|
|
9653
|
+
var findBestMatch = {};
|
|
9517
9654
|
|
|
9518
|
-
|
|
9519
|
-
|
|
9520
|
-
|
|
9521
|
-
|
|
9522
|
-
|
|
9523
|
-
|
|
9524
|
-
|
|
9525
|
-
|
|
9526
|
-
|
|
9527
|
-
|
|
9528
|
-
|
|
9529
|
-
|
|
9530
|
-
* */
|
|
9531
|
-
return numberOfResultsWithMaxStrengthProperty > 0 && numberOfResultsWithMaxStrengthProperty === results.length;
|
|
9532
|
-
}
|
|
9533
|
-
function findBestMatch(results) {
|
|
9534
|
-
if (!hasEnoughResultsToDetermineBestMatch(results)) {
|
|
9535
|
-
return null;
|
|
9536
|
-
}
|
|
9537
|
-
return results.reduce(function (bestMatch, result) {
|
|
9538
|
-
if (!bestMatch) {
|
|
9539
|
-
return result;
|
|
9540
|
-
}
|
|
9655
|
+
var hasRequiredFindBestMatch;
|
|
9656
|
+
function requireFindBestMatch() {
|
|
9657
|
+
if (hasRequiredFindBestMatch) return findBestMatch;
|
|
9658
|
+
hasRequiredFindBestMatch = 1;
|
|
9659
|
+
Object.defineProperty(findBestMatch, "__esModule", {
|
|
9660
|
+
value: true
|
|
9661
|
+
});
|
|
9662
|
+
findBestMatch.findBestMatch = void 0;
|
|
9663
|
+
function hasEnoughResultsToDetermineBestMatch(results) {
|
|
9664
|
+
var numberOfResultsWithMaxStrengthProperty = results.filter(function (result) {
|
|
9665
|
+
return result.matchStrength;
|
|
9666
|
+
}).length;
|
|
9541
9667
|
/*
|
|
9542
|
-
*
|
|
9543
|
-
*
|
|
9668
|
+
* if all possible results have a maxStrength property that means the card
|
|
9669
|
+
* number is sufficiently long enough to determine conclusively what the card
|
|
9670
|
+
* type is
|
|
9544
9671
|
* */
|
|
9545
|
-
|
|
9546
|
-
|
|
9672
|
+
return numberOfResultsWithMaxStrengthProperty > 0 && numberOfResultsWithMaxStrengthProperty === results.length;
|
|
9673
|
+
}
|
|
9674
|
+
function findBestMatch$1(results) {
|
|
9675
|
+
if (!hasEnoughResultsToDetermineBestMatch(results)) {
|
|
9676
|
+
return null;
|
|
9547
9677
|
}
|
|
9548
|
-
return bestMatch
|
|
9549
|
-
|
|
9678
|
+
return results.reduce(function (bestMatch, result) {
|
|
9679
|
+
if (!bestMatch) {
|
|
9680
|
+
return result;
|
|
9681
|
+
}
|
|
9682
|
+
/*
|
|
9683
|
+
* If the current best match pattern is less specific than this result, set
|
|
9684
|
+
* the result as the new best match
|
|
9685
|
+
* */
|
|
9686
|
+
if (Number(bestMatch.matchStrength) < Number(result.matchStrength)) {
|
|
9687
|
+
return result;
|
|
9688
|
+
}
|
|
9689
|
+
return bestMatch;
|
|
9690
|
+
});
|
|
9691
|
+
}
|
|
9692
|
+
findBestMatch.findBestMatch = findBestMatch$1;
|
|
9693
|
+
return findBestMatch;
|
|
9550
9694
|
}
|
|
9551
|
-
findBestMatch$1.findBestMatch = findBestMatch;
|
|
9552
9695
|
|
|
9553
|
-
var
|
|
9554
|
-
|
|
9555
|
-
|
|
9556
|
-
|
|
9557
|
-
|
|
9558
|
-
|
|
9559
|
-
|
|
9696
|
+
var dist$2;
|
|
9697
|
+
var hasRequiredDist$2;
|
|
9698
|
+
function requireDist$2() {
|
|
9699
|
+
if (hasRequiredDist$2) return dist$2;
|
|
9700
|
+
hasRequiredDist$2 = 1;
|
|
9701
|
+
var __assign = dist$2 && dist$2.__assign || function () {
|
|
9702
|
+
__assign = Object.assign || function (t) {
|
|
9703
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
9704
|
+
s = arguments[i];
|
|
9705
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
9706
|
+
}
|
|
9707
|
+
return t;
|
|
9708
|
+
};
|
|
9709
|
+
return __assign.apply(this, arguments);
|
|
9560
9710
|
};
|
|
9561
|
-
|
|
9562
|
-
|
|
9563
|
-
var
|
|
9564
|
-
var
|
|
9565
|
-
var
|
|
9566
|
-
var
|
|
9567
|
-
var
|
|
9568
|
-
|
|
9569
|
-
|
|
9570
|
-
|
|
9571
|
-
|
|
9572
|
-
|
|
9573
|
-
|
|
9574
|
-
|
|
9575
|
-
|
|
9576
|
-
|
|
9577
|
-
|
|
9578
|
-
|
|
9579
|
-
|
|
9580
|
-
|
|
9581
|
-
HIPERCARD
|
|
9582
|
-
|
|
9583
|
-
|
|
9584
|
-
|
|
9585
|
-
|
|
9586
|
-
|
|
9587
|
-
|
|
9588
|
-
|
|
9589
|
-
|
|
9590
|
-
return (0, clone_1.clone)(findType(cardType));
|
|
9591
|
-
});
|
|
9592
|
-
}
|
|
9593
|
-
function getCardPosition(name, ignoreErrorForNotExisting) {
|
|
9594
|
-
if (ignoreErrorForNotExisting === void 0) {
|
|
9595
|
-
ignoreErrorForNotExisting = false;
|
|
9711
|
+
var cardTypes = requireCardTypes();
|
|
9712
|
+
var add_matching_cards_to_results_1 = requireAddMatchingCardsToResults();
|
|
9713
|
+
var is_valid_input_type_1 = requireIsValidInputType();
|
|
9714
|
+
var find_best_match_1 = requireFindBestMatch();
|
|
9715
|
+
var clone_1 = requireClone();
|
|
9716
|
+
var customCards = {};
|
|
9717
|
+
var cardNames = {
|
|
9718
|
+
VISA: "visa",
|
|
9719
|
+
MASTERCARD: "mastercard",
|
|
9720
|
+
AMERICAN_EXPRESS: "american-express",
|
|
9721
|
+
DINERS_CLUB: "diners-club",
|
|
9722
|
+
DISCOVER: "discover",
|
|
9723
|
+
JCB: "jcb",
|
|
9724
|
+
UNIONPAY: "unionpay",
|
|
9725
|
+
MAESTRO: "maestro",
|
|
9726
|
+
ELO: "elo",
|
|
9727
|
+
MIR: "mir",
|
|
9728
|
+
HIPER: "hiper",
|
|
9729
|
+
HIPERCARD: "hipercard"
|
|
9730
|
+
};
|
|
9731
|
+
var ORIGINAL_TEST_ORDER = [cardNames.VISA, cardNames.MASTERCARD, cardNames.AMERICAN_EXPRESS, cardNames.DINERS_CLUB, cardNames.DISCOVER, cardNames.JCB, cardNames.UNIONPAY, cardNames.MAESTRO, cardNames.ELO, cardNames.MIR, cardNames.HIPER, cardNames.HIPERCARD];
|
|
9732
|
+
var testOrder = (0, clone_1.clone)(ORIGINAL_TEST_ORDER);
|
|
9733
|
+
function findType(cardType) {
|
|
9734
|
+
return customCards[cardType] || cardTypes[cardType];
|
|
9735
|
+
}
|
|
9736
|
+
function getAllCardTypes() {
|
|
9737
|
+
return testOrder.map(function (cardType) {
|
|
9738
|
+
return (0, clone_1.clone)(findType(cardType));
|
|
9739
|
+
});
|
|
9596
9740
|
}
|
|
9597
|
-
|
|
9598
|
-
|
|
9599
|
-
|
|
9741
|
+
function getCardPosition(name, ignoreErrorForNotExisting) {
|
|
9742
|
+
if (ignoreErrorForNotExisting === void 0) {
|
|
9743
|
+
ignoreErrorForNotExisting = false;
|
|
9744
|
+
}
|
|
9745
|
+
var position = testOrder.indexOf(name);
|
|
9746
|
+
if (!ignoreErrorForNotExisting && position === -1) {
|
|
9747
|
+
throw new Error('"' + name + '" is not a supported card type.');
|
|
9748
|
+
}
|
|
9749
|
+
return position;
|
|
9600
9750
|
}
|
|
9601
|
-
|
|
9602
|
-
|
|
9603
|
-
|
|
9604
|
-
|
|
9605
|
-
|
|
9751
|
+
function creditCardType(cardNumber) {
|
|
9752
|
+
var results = [];
|
|
9753
|
+
if (!(0, is_valid_input_type_1.isValidInputType)(cardNumber)) {
|
|
9754
|
+
return results;
|
|
9755
|
+
}
|
|
9756
|
+
if (cardNumber.length === 0) {
|
|
9757
|
+
return getAllCardTypes();
|
|
9758
|
+
}
|
|
9759
|
+
testOrder.forEach(function (cardType) {
|
|
9760
|
+
var cardConfiguration = findType(cardType);
|
|
9761
|
+
(0, add_matching_cards_to_results_1.addMatchingCardsToResults)(cardNumber, cardConfiguration, results);
|
|
9762
|
+
});
|
|
9763
|
+
var bestMatch = (0, find_best_match_1.findBestMatch)(results);
|
|
9764
|
+
if (bestMatch) {
|
|
9765
|
+
return [bestMatch];
|
|
9766
|
+
}
|
|
9606
9767
|
return results;
|
|
9607
9768
|
}
|
|
9608
|
-
|
|
9609
|
-
return
|
|
9610
|
-
}
|
|
9611
|
-
|
|
9612
|
-
var
|
|
9613
|
-
|
|
9614
|
-
}
|
|
9615
|
-
|
|
9616
|
-
|
|
9617
|
-
|
|
9618
|
-
|
|
9619
|
-
|
|
9769
|
+
creditCardType.getTypeInfo = function (cardType) {
|
|
9770
|
+
return (0, clone_1.clone)(findType(cardType));
|
|
9771
|
+
};
|
|
9772
|
+
creditCardType.removeCard = function (name) {
|
|
9773
|
+
var position = getCardPosition(name);
|
|
9774
|
+
testOrder.splice(position, 1);
|
|
9775
|
+
};
|
|
9776
|
+
creditCardType.addCard = function (config) {
|
|
9777
|
+
var existingCardPosition = getCardPosition(config.type, true);
|
|
9778
|
+
customCards[config.type] = config;
|
|
9779
|
+
if (existingCardPosition === -1) {
|
|
9780
|
+
testOrder.push(config.type);
|
|
9781
|
+
}
|
|
9782
|
+
};
|
|
9783
|
+
creditCardType.updateCard = function (cardType, updates) {
|
|
9784
|
+
var originalObject = customCards[cardType] || cardTypes[cardType];
|
|
9785
|
+
if (!originalObject) {
|
|
9786
|
+
throw new Error("\"".concat(cardType, "\" is not a recognized type. Use `addCard` instead.'"));
|
|
9787
|
+
}
|
|
9788
|
+
if (updates.type && originalObject.type !== updates.type) {
|
|
9789
|
+
throw new Error("Cannot overwrite type parameter.");
|
|
9790
|
+
}
|
|
9791
|
+
var clonedCard = (0, clone_1.clone)(originalObject);
|
|
9792
|
+
clonedCard = __assign(__assign({}, clonedCard), updates);
|
|
9793
|
+
customCards[clonedCard.type] = clonedCard;
|
|
9794
|
+
};
|
|
9795
|
+
creditCardType.changeOrder = function (name, position) {
|
|
9796
|
+
var currentPosition = getCardPosition(name);
|
|
9797
|
+
testOrder.splice(currentPosition, 1);
|
|
9798
|
+
testOrder.splice(position, 0, name);
|
|
9799
|
+
};
|
|
9800
|
+
creditCardType.resetModifications = function () {
|
|
9801
|
+
testOrder = (0, clone_1.clone)(ORIGINAL_TEST_ORDER);
|
|
9802
|
+
customCards = {};
|
|
9803
|
+
};
|
|
9804
|
+
creditCardType.types = cardNames;
|
|
9805
|
+
dist$2 = creditCardType;
|
|
9806
|
+
return dist$2;
|
|
9620
9807
|
}
|
|
9621
|
-
|
|
9622
|
-
|
|
9623
|
-
|
|
9624
|
-
creditCardType.removeCard = function (name) {
|
|
9625
|
-
var position = getCardPosition(name);
|
|
9626
|
-
testOrder.splice(position, 1);
|
|
9627
|
-
};
|
|
9628
|
-
creditCardType.addCard = function (config) {
|
|
9629
|
-
var existingCardPosition = getCardPosition(config.type, true);
|
|
9630
|
-
customCards[config.type] = config;
|
|
9631
|
-
if (existingCardPosition === -1) {
|
|
9632
|
-
testOrder.push(config.type);
|
|
9633
|
-
}
|
|
9634
|
-
};
|
|
9635
|
-
creditCardType.updateCard = function (cardType, updates) {
|
|
9636
|
-
var originalObject = customCards[cardType] || cardTypes[cardType];
|
|
9637
|
-
if (!originalObject) {
|
|
9638
|
-
throw new Error("\"".concat(cardType, "\" is not a recognized type. Use `addCard` instead.'"));
|
|
9639
|
-
}
|
|
9640
|
-
if (updates.type && originalObject.type !== updates.type) {
|
|
9641
|
-
throw new Error("Cannot overwrite type parameter.");
|
|
9642
|
-
}
|
|
9643
|
-
var clonedCard = (0, clone_1.clone)(originalObject);
|
|
9644
|
-
clonedCard = __assign$8(__assign$8({}, clonedCard), updates);
|
|
9645
|
-
customCards[clonedCard.type] = clonedCard;
|
|
9646
|
-
};
|
|
9647
|
-
creditCardType.changeOrder = function (name, position) {
|
|
9648
|
-
var currentPosition = getCardPosition(name);
|
|
9649
|
-
testOrder.splice(currentPosition, 1);
|
|
9650
|
-
testOrder.splice(position, 0, name);
|
|
9651
|
-
};
|
|
9652
|
-
creditCardType.resetModifications = function () {
|
|
9653
|
-
testOrder = (0, clone_1.clone)(ORIGINAL_TEST_ORDER);
|
|
9654
|
-
customCards = {};
|
|
9655
|
-
};
|
|
9656
|
-
creditCardType.types = cardNames;
|
|
9657
|
-
var dist$2 = creditCardType;
|
|
9658
|
-
var creditCardType$1 = /*@__PURE__*/getDefaultExportFromCjs(dist$2);
|
|
9808
|
+
|
|
9809
|
+
var distExports$2 = requireDist$2();
|
|
9810
|
+
var creditCardType = /*@__PURE__*/getDefaultExportFromCjs(distExports$2);
|
|
9659
9811
|
|
|
9660
9812
|
var __assign$7 = undefined && undefined.__assign || function () {
|
|
9661
9813
|
__assign$7 = Object.assign || function (t) {
|
|
@@ -9849,27 +10001,41 @@ var dist$1 = {};
|
|
|
9849
10001
|
|
|
9850
10002
|
var mapCursorToMax = {};
|
|
9851
10003
|
|
|
9852
|
-
|
|
9853
|
-
|
|
9854
|
-
|
|
9855
|
-
|
|
9856
|
-
|
|
9857
|
-
if (cursor >= 0) return cursor % max;
|
|
9858
|
-
var modulo = cursor % max;
|
|
9859
|
-
if (modulo === 0) return Math.abs(modulo); // -0
|
|
9860
|
-
return modulo + max;
|
|
9861
|
-
};
|
|
9862
|
-
|
|
9863
|
-
(function (exports) {
|
|
9864
|
-
|
|
9865
|
-
function __export(m) {
|
|
9866
|
-
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
|
9867
|
-
}
|
|
9868
|
-
Object.defineProperty(exports, "__esModule", {
|
|
10004
|
+
var hasRequiredMapCursorToMax;
|
|
10005
|
+
function requireMapCursorToMax() {
|
|
10006
|
+
if (hasRequiredMapCursorToMax) return mapCursorToMax;
|
|
10007
|
+
hasRequiredMapCursorToMax = 1;
|
|
10008
|
+
Object.defineProperty(mapCursorToMax, "__esModule", {
|
|
9869
10009
|
value: true
|
|
9870
10010
|
});
|
|
9871
|
-
|
|
9872
|
-
|
|
10011
|
+
mapCursorToMax.mapCursorToMax = function (cursor, max) {
|
|
10012
|
+
if (max === 0) return 0;
|
|
10013
|
+
if (cursor >= 0) return cursor % max;
|
|
10014
|
+
var modulo = cursor % max;
|
|
10015
|
+
if (modulo === 0) return Math.abs(modulo); // -0
|
|
10016
|
+
return modulo + max;
|
|
10017
|
+
};
|
|
10018
|
+
return mapCursorToMax;
|
|
10019
|
+
}
|
|
10020
|
+
|
|
10021
|
+
var hasRequiredDist$1;
|
|
10022
|
+
function requireDist$1() {
|
|
10023
|
+
if (hasRequiredDist$1) return dist$1;
|
|
10024
|
+
hasRequiredDist$1 = 1;
|
|
10025
|
+
(function (exports) {
|
|
10026
|
+
|
|
10027
|
+
function __export(m) {
|
|
10028
|
+
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
|
10029
|
+
}
|
|
10030
|
+
Object.defineProperty(exports, "__esModule", {
|
|
10031
|
+
value: true
|
|
10032
|
+
});
|
|
10033
|
+
__export(requireMapCursorToMax());
|
|
10034
|
+
})(dist$1);
|
|
10035
|
+
return dist$1;
|
|
10036
|
+
}
|
|
10037
|
+
|
|
10038
|
+
var distExports$1 = requireDist$1();
|
|
9873
10039
|
|
|
9874
10040
|
var reducer$1 = function reducer(state, action) {
|
|
9875
10041
|
switch (action.type) {
|
|
@@ -9933,7 +10099,7 @@ var useKeyboardListNavigation = function useKeyboardListNavigation(_ref) {
|
|
|
9933
10099
|
dispatch = _useReducer2[1];
|
|
9934
10100
|
var searchTerm = React.useRef('');
|
|
9935
10101
|
var idleTimeout = React.useRef(null);
|
|
9936
|
-
var index =
|
|
10102
|
+
var index = distExports$1.mapCursorToMax(state.cursor, list.length);
|
|
9937
10103
|
var handleKeyDown = React.useCallback(function (event) {
|
|
9938
10104
|
switch (event.key) {
|
|
9939
10105
|
case 'ArrowUp':
|
|
@@ -10154,7 +10320,8 @@ var Search20 = function Search20(_a) {
|
|
|
10154
10320
|
};
|
|
10155
10321
|
Search20.displayName = 'Search20';
|
|
10156
10322
|
|
|
10157
|
-
var _excluded$l = ["className", "onChange", "onClear", "roundBorders", "noBorders", "value"];
|
|
10323
|
+
var _excluded$l = ["className", "onChange", "onClear", "roundBorders", "noBorders", "value", "searchIconSize"];
|
|
10324
|
+
var SEARCH_ICON_DEFAULT_SIZE = 20;
|
|
10158
10325
|
var DEFAULT_INPUT_VALUE = '';
|
|
10159
10326
|
var SearchInput = function SearchInput(_ref) {
|
|
10160
10327
|
var className = _ref.className,
|
|
@@ -10166,6 +10333,8 @@ var SearchInput = function SearchInput(_ref) {
|
|
|
10166
10333
|
noBorders = _ref$noBorders === void 0 ? false : _ref$noBorders,
|
|
10167
10334
|
_ref$value = _ref.value,
|
|
10168
10335
|
value = _ref$value === void 0 ? DEFAULT_INPUT_VALUE : _ref$value,
|
|
10336
|
+
_ref$searchIconSize = _ref.searchIconSize,
|
|
10337
|
+
searchIconSize = _ref$searchIconSize === void 0 ? SEARCH_ICON_DEFAULT_SIZE : _ref$searchIconSize,
|
|
10169
10338
|
rest = _objectWithoutProperties(_ref, _excluded$l);
|
|
10170
10339
|
var ref = React.useRef(null);
|
|
10171
10340
|
var _useState = React.useState(value),
|
|
@@ -10190,7 +10359,10 @@ var SearchInput = function SearchInput(_ref) {
|
|
|
10190
10359
|
className: classNames('SearchInput', className)
|
|
10191
10360
|
}, /*#__PURE__*/React.createElement("div", {
|
|
10192
10361
|
className: "SearchInput__icon"
|
|
10193
|
-
}, /*#__PURE__*/React.createElement(Search20,
|
|
10362
|
+
}, /*#__PURE__*/React.createElement(Search20, {
|
|
10363
|
+
height: "".concat(searchIconSize, "px"),
|
|
10364
|
+
width: "".concat(searchIconSize, "px")
|
|
10365
|
+
})), /*#__PURE__*/React.createElement(TextInput, _extends$1({
|
|
10194
10366
|
className: classNames('SearchInput__input', {
|
|
10195
10367
|
'SearchInput__input--round-borders': roundBorders,
|
|
10196
10368
|
'SearchInput__input--no-borders': noBorders
|
|
@@ -10591,7 +10763,7 @@ var useSelect = function useSelect(_ref) {
|
|
|
10591
10763
|
};
|
|
10592
10764
|
};
|
|
10593
10765
|
|
|
10594
|
-
var _excluded$j = ["allowAutoFill", "autoSelect", "className", "defaultValue", "disabled", "dropDirection", "error", "idRef", "label", "name", "onChange", "options", "placeholder", "searchable", "shiftIconLeftwards", "value", "dataTestId"];
|
|
10766
|
+
var _excluded$j = ["allowAutoFill", "autoSelect", "className", "defaultValue", "disabled", "dropDirection", "error", "idRef", "label", "name", "onChange", "options", "placeholder", "searchable", "shiftIconLeftwards", "value", "dataTestId", "colorSwatch"];
|
|
10595
10767
|
var Select = function Select(_ref) {
|
|
10596
10768
|
var _ref2;
|
|
10597
10769
|
var _ref$allowAutoFill = _ref.allowAutoFill,
|
|
@@ -10616,6 +10788,7 @@ var Select = function Select(_ref) {
|
|
|
10616
10788
|
shiftIconLeftwards = _ref$shiftIconLeftwar === void 0 ? false : _ref$shiftIconLeftwar,
|
|
10617
10789
|
value = _ref.value,
|
|
10618
10790
|
dataTestId = _ref.dataTestId,
|
|
10791
|
+
colorSwatch = _ref.colorSwatch,
|
|
10619
10792
|
rest = _objectWithoutProperties(_ref, _excluded$j);
|
|
10620
10793
|
var _useSelect = useSelect({
|
|
10621
10794
|
value: value,
|
|
@@ -10692,7 +10865,12 @@ var Select = function Select(_ref) {
|
|
|
10692
10865
|
idRef: idRef,
|
|
10693
10866
|
label: label || (selected === undefined ? placeholder : undefined),
|
|
10694
10867
|
hasValue: focused != null || selected != null
|
|
10695
|
-
}), (_ref2 = focused !== null && focused !== void 0 ? focused : selected) === null || _ref2 === void 0 ? void 0 : _ref2.label, /*#__PURE__*/React.createElement("
|
|
10868
|
+
}), (_ref2 = focused !== null && focused !== void 0 ? focused : selected) === null || _ref2 === void 0 ? void 0 : _ref2.label, colorSwatch && /*#__PURE__*/React.createElement("div", {
|
|
10869
|
+
className: "Select__selected-color",
|
|
10870
|
+
style: {
|
|
10871
|
+
backgroundColor: distExports$4.colors.all[colorSwatch]
|
|
10872
|
+
}
|
|
10873
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
10696
10874
|
className: classNames('Select__icon', {
|
|
10697
10875
|
'Select__icon--shifted': shiftIconLeftwards
|
|
10698
10876
|
})
|
|
@@ -10950,7 +11128,7 @@ var CreditCardNumberInput = function CreditCardNumberInput(_ref) {
|
|
|
10950
11128
|
value = _useState2[0],
|
|
10951
11129
|
setValue = _useState2[1];
|
|
10952
11130
|
var mask = React.useMemo(function () {
|
|
10953
|
-
var cardType = creditCardType
|
|
11131
|
+
var cardType = creditCardType(value)[0];
|
|
10954
11132
|
if (!cardType) return DEFAULT_MASK;
|
|
10955
11133
|
var gaps = cardType.gaps,
|
|
10956
11134
|
lengths = cardType.lengths;
|
|
@@ -11097,53 +11275,67 @@ var dist = {};
|
|
|
11097
11275
|
|
|
11098
11276
|
var useCursor = {};
|
|
11099
11277
|
|
|
11100
|
-
|
|
11101
|
-
|
|
11102
|
-
|
|
11103
|
-
|
|
11104
|
-
|
|
11105
|
-
|
|
11106
|
-
|
|
11107
|
-
|
|
11108
|
-
|
|
11109
|
-
|
|
11110
|
-
|
|
11111
|
-
|
|
11112
|
-
|
|
11113
|
-
|
|
11114
|
-
|
|
11115
|
-
|
|
11116
|
-
|
|
11117
|
-
return
|
|
11118
|
-
});
|
|
11119
|
-
|
|
11120
|
-
|
|
11121
|
-
|
|
11122
|
-
|
|
11123
|
-
});
|
|
11124
|
-
|
|
11125
|
-
|
|
11126
|
-
|
|
11127
|
-
|
|
11128
|
-
|
|
11129
|
-
|
|
11130
|
-
|
|
11131
|
-
|
|
11132
|
-
|
|
11133
|
-
|
|
11278
|
+
var hasRequiredUseCursor;
|
|
11279
|
+
function requireUseCursor() {
|
|
11280
|
+
if (hasRequiredUseCursor) return useCursor;
|
|
11281
|
+
hasRequiredUseCursor = 1;
|
|
11282
|
+
Object.defineProperty(useCursor, "__esModule", {
|
|
11283
|
+
value: true
|
|
11284
|
+
});
|
|
11285
|
+
var react_1 = React;
|
|
11286
|
+
var map_cursor_to_max_1 = requireDist$1();
|
|
11287
|
+
useCursor.useCursor = function (_a) {
|
|
11288
|
+
var max = _a.max,
|
|
11289
|
+
_b = _a.initialCursor,
|
|
11290
|
+
initialCursor = _b === void 0 ? 0 : _b;
|
|
11291
|
+
var _c = react_1.useState(initialCursor),
|
|
11292
|
+
cursor = _c[0],
|
|
11293
|
+
setCursor = _c[1];
|
|
11294
|
+
react_1.useEffect(function () {
|
|
11295
|
+
return setCursor(initialCursor);
|
|
11296
|
+
}, [initialCursor]);
|
|
11297
|
+
var handlePrev = react_1.useCallback(function () {
|
|
11298
|
+
return setCursor(function (n) {
|
|
11299
|
+
return n - 1;
|
|
11300
|
+
});
|
|
11301
|
+
}, []);
|
|
11302
|
+
var handleNext = react_1.useCallback(function () {
|
|
11303
|
+
return setCursor(function (n) {
|
|
11304
|
+
return n + 1;
|
|
11305
|
+
});
|
|
11306
|
+
}, []);
|
|
11307
|
+
var index = react_1.useMemo(function () {
|
|
11308
|
+
return map_cursor_to_max_1.mapCursorToMax(cursor, max);
|
|
11309
|
+
}, [cursor, max]);
|
|
11310
|
+
return {
|
|
11311
|
+
handlePrev: handlePrev,
|
|
11312
|
+
handleNext: handleNext,
|
|
11313
|
+
setCursor: setCursor,
|
|
11314
|
+
cursor: cursor,
|
|
11315
|
+
index: index
|
|
11316
|
+
};
|
|
11134
11317
|
};
|
|
11135
|
-
|
|
11318
|
+
return useCursor;
|
|
11319
|
+
}
|
|
11136
11320
|
|
|
11137
|
-
|
|
11321
|
+
var hasRequiredDist;
|
|
11322
|
+
function requireDist() {
|
|
11323
|
+
if (hasRequiredDist) return dist;
|
|
11324
|
+
hasRequiredDist = 1;
|
|
11325
|
+
(function (exports) {
|
|
11138
11326
|
|
|
11139
|
-
|
|
11140
|
-
|
|
11141
|
-
|
|
11142
|
-
|
|
11143
|
-
|
|
11144
|
-
|
|
11145
|
-
|
|
11146
|
-
})(dist);
|
|
11327
|
+
function __export(m) {
|
|
11328
|
+
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
|
11329
|
+
}
|
|
11330
|
+
Object.defineProperty(exports, "__esModule", {
|
|
11331
|
+
value: true
|
|
11332
|
+
});
|
|
11333
|
+
__export(requireUseCursor());
|
|
11334
|
+
})(dist);
|
|
11335
|
+
return dist;
|
|
11336
|
+
}
|
|
11337
|
+
|
|
11338
|
+
var distExports = requireDist();
|
|
11147
11339
|
|
|
11148
11340
|
var Window = function Window(props) {
|
|
11149
11341
|
return /*#__PURE__*/React.createElement("svg", _extends$1({
|
|
@@ -11286,7 +11478,7 @@ var FRAMES = [Triangle, Diamond, ArcWindow, Circle];
|
|
|
11286
11478
|
var Loading = function Loading(_ref) {
|
|
11287
11479
|
var className = _ref.className,
|
|
11288
11480
|
rest = _objectWithoutProperties(_ref, _excluded$a);
|
|
11289
|
-
var _useCursor =
|
|
11481
|
+
var _useCursor = distExports.useCursor({
|
|
11290
11482
|
max: FRAMES.length
|
|
11291
11483
|
}),
|
|
11292
11484
|
index = _useCursor.index,
|
|
@@ -11362,7 +11554,7 @@ var LoadingBalls = function LoadingBalls(_ref) {
|
|
|
11362
11554
|
var INTERVAL_MS = 250;
|
|
11363
11555
|
var LoadingShapes = function LoadingShapes() {
|
|
11364
11556
|
var items = [Triangle, Diamond, ArcWindow, Circle];
|
|
11365
|
-
var _useCursor =
|
|
11557
|
+
var _useCursor = distExports.useCursor({
|
|
11366
11558
|
max: items.length
|
|
11367
11559
|
}),
|
|
11368
11560
|
index = _useCursor.index,
|
|
@@ -12061,10 +12253,10 @@ var VerticalDivider = function VerticalDivider(_ref) {
|
|
|
12061
12253
|
};
|
|
12062
12254
|
|
|
12063
12255
|
var tokens = {
|
|
12064
|
-
colors:
|
|
12065
|
-
typography:
|
|
12066
|
-
space:
|
|
12067
|
-
breakpoints:
|
|
12256
|
+
colors: distExports$4.colors,
|
|
12257
|
+
typography: distExports$4.typography,
|
|
12258
|
+
space: distExports$4.space,
|
|
12259
|
+
breakpoints: distExports$4.breakpoints
|
|
12068
12260
|
};
|
|
12069
12261
|
var Utilities = {
|
|
12070
12262
|
States: States
|