@koine/next 1.0.1 → 1.0.2

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.
Files changed (66) hide show
  1. package/Analytics/AnalyticsGoogle.d.ts +6 -0
  2. package/Analytics/index.d.ts +1 -0
  3. package/Auth/helpers.d.ts +17 -0
  4. package/Auth/index.d.ts +4 -0
  5. package/Auth/useLogin.d.ts +7 -0
  6. package/Auth/useLoginUrl.d.ts +1 -0
  7. package/Auth/useLogout.d.ts +6 -0
  8. package/Favicon/Favicon.d.ts +4 -0
  9. package/Favicon/index.d.ts +1 -0
  10. package/Forms/index.d.ts +2 -0
  11. package/Forms/useForm.d.ts +32 -0
  12. package/Forms/useSubmit.d.ts +24 -0
  13. package/Head/Head.d.ts +1 -0
  14. package/Head/index.d.ts +1 -0
  15. package/I18n/I18n.d.ts +48 -0
  16. package/I18n/index.d.ts +1 -0
  17. package/Img/Img.d.ts +21 -0
  18. package/Img/index.d.ts +1 -0
  19. package/Link/Link.d.ts +8 -0
  20. package/Link/index.d.ts +1 -0
  21. package/NextProgress/NextProgress.d.ts +14 -0
  22. package/NextProgress/index.d.ts +1 -0
  23. package/Seo/Seo.d.ts +3 -0
  24. package/Seo/SeoDefaults.d.ts +3 -0
  25. package/Seo/helpers.d.ts +48 -0
  26. package/Seo/index.d.ts +12 -0
  27. package/Theme/Theme.d.ts +46 -0
  28. package/Theme/index.d.ts +1 -0
  29. package/Theme.js +1905 -0
  30. package/_tslib.js +41 -0
  31. package/app/App--emotion.d.ts +10 -0
  32. package/app/App--sc.d.ts +10 -0
  33. package/app/App--vanilla.d.ts +10 -0
  34. package/app/AppAuth--emotion.d.ts +10 -0
  35. package/app/AppAuth--sc.d.ts +10 -0
  36. package/app/AppHead.d.ts +3 -0
  37. package/app/AppMain--vanilla.d.ts +27 -0
  38. package/app/AppMain.d.ts +34 -0
  39. package/app/AppTheme--emotion.d.ts +15 -0
  40. package/app/AppTheme--sc.d.ts +13 -0
  41. package/app/AppTheme--vanilla.d.ts +10 -0
  42. package/app/index.d.ts +11 -0
  43. package/app/motion-features.d.ts +2 -0
  44. package/app.js +235 -0
  45. package/config/index.d.ts +58 -0
  46. package/config.js +156 -880
  47. package/document/Document--emotion.d.ts +5 -0
  48. package/document/Document--sc.d.ts +11 -0
  49. package/document/Document--vanilla.d.ts +11 -0
  50. package/document/Document.d.ts +10 -0
  51. package/document/emotion.d.ts +5 -0
  52. package/document/index.d.ts +4 -0
  53. package/document.js +207 -0
  54. package/emotion.js +1329 -0
  55. package/es.object.assign.js +1074 -0
  56. package/es.string.replace.js +785 -0
  57. package/es.string.split.js +201 -0
  58. package/index.d.ts +12 -0
  59. package/index.esm.js +4437 -4406
  60. package/index.js +743 -0
  61. package/index.umd.js +4635 -4623
  62. package/package.json +12 -4
  63. package/types.d.ts +91 -0
  64. package/utils/api.d.ts +55 -0
  65. package/utils/index.d.ts +19 -0
  66. package/motion-features.esm.js +0 -2
package/emotion.js ADDED
@@ -0,0 +1,1329 @@
1
+ 'use strict';
2
+
3
+ /*
4
+
5
+ Based off glamor's StyleSheet, thanks Sunil ❤️
6
+
7
+ high performance StyleSheet for css-in-js systems
8
+
9
+ - uses multiple style tags behind the scenes for millions of rules
10
+ - uses `insertRule` for appending in production for *much* faster performance
11
+
12
+ // usage
13
+
14
+ import { StyleSheet } from '@emotion/sheet'
15
+
16
+ let styleSheet = new StyleSheet({ key: '', container: document.head })
17
+
18
+ styleSheet.insert('#box { border: 1px solid red; }')
19
+ - appends a css rule into the stylesheet
20
+
21
+ styleSheet.flush()
22
+ - empties the stylesheet of all its contents
23
+
24
+ */
25
+ // $FlowFixMe
26
+ function sheetForTag(tag) {
27
+ if (tag.sheet) {
28
+ // $FlowFixMe
29
+ return tag.sheet;
30
+ } // this weirdness brought to you by firefox
31
+
32
+ /* istanbul ignore next */
33
+
34
+
35
+ for (var i = 0; i < document.styleSheets.length; i++) {
36
+ if (document.styleSheets[i].ownerNode === tag) {
37
+ // $FlowFixMe
38
+ return document.styleSheets[i];
39
+ }
40
+ }
41
+ }
42
+
43
+ function createStyleElement(options) {
44
+ var tag = document.createElement('style');
45
+ tag.setAttribute('data-emotion', options.key);
46
+
47
+ if (options.nonce !== undefined) {
48
+ tag.setAttribute('nonce', options.nonce);
49
+ }
50
+
51
+ tag.appendChild(document.createTextNode(''));
52
+ tag.setAttribute('data-s', '');
53
+ return tag;
54
+ }
55
+
56
+ var StyleSheet = /*#__PURE__*/function () {
57
+ function StyleSheet(options) {
58
+ var _this = this;
59
+
60
+ this._insertTag = function (tag) {
61
+ var before;
62
+
63
+ if (_this.tags.length === 0) {
64
+ if (_this.insertionPoint) {
65
+ before = _this.insertionPoint.nextSibling;
66
+ } else if (_this.prepend) {
67
+ before = _this.container.firstChild;
68
+ } else {
69
+ before = _this.before;
70
+ }
71
+ } else {
72
+ before = _this.tags[_this.tags.length - 1].nextSibling;
73
+ }
74
+
75
+ _this.container.insertBefore(tag, before);
76
+
77
+ _this.tags.push(tag);
78
+ };
79
+
80
+ this.isSpeedy = options.speedy === undefined ? process.env.NODE_ENV === 'production' : options.speedy;
81
+ this.tags = [];
82
+ this.ctr = 0;
83
+ this.nonce = options.nonce; // key is the value of the data-emotion attribute, it's used to identify different sheets
84
+
85
+ this.key = options.key;
86
+ this.container = options.container;
87
+ this.prepend = options.prepend;
88
+ this.insertionPoint = options.insertionPoint;
89
+ this.before = null;
90
+ }
91
+
92
+ var _proto = StyleSheet.prototype;
93
+
94
+ _proto.hydrate = function hydrate(nodes) {
95
+ nodes.forEach(this._insertTag);
96
+ };
97
+
98
+ _proto.insert = function insert(rule) {
99
+ // the max length is how many rules we have per style tag, it's 65000 in speedy mode
100
+ // it's 1 in dev because we insert source maps that map a single rule to a location
101
+ // and you can only have one source map per style tag
102
+ if (this.ctr % (this.isSpeedy ? 65000 : 1) === 0) {
103
+ this._insertTag(createStyleElement(this));
104
+ }
105
+
106
+ var tag = this.tags[this.tags.length - 1];
107
+
108
+ if (process.env.NODE_ENV !== 'production') {
109
+ var isImportRule = rule.charCodeAt(0) === 64 && rule.charCodeAt(1) === 105;
110
+
111
+ if (isImportRule && this._alreadyInsertedOrderInsensitiveRule) {
112
+ // this would only cause problem in speedy mode
113
+ // but we don't want enabling speedy to affect the observable behavior
114
+ // so we report this error at all times
115
+ console.error("You're attempting to insert the following rule:\n" + rule + '\n\n`@import` rules must be before all other types of rules in a stylesheet but other rules have already been inserted. Please ensure that `@import` rules are before all other rules.');
116
+ }
117
+ this._alreadyInsertedOrderInsensitiveRule = this._alreadyInsertedOrderInsensitiveRule || !isImportRule;
118
+ }
119
+
120
+ if (this.isSpeedy) {
121
+ var sheet = sheetForTag(tag);
122
+
123
+ try {
124
+ // this is the ultrafast version, works across browsers
125
+ // the big drawback is that the css won't be editable in devtools
126
+ sheet.insertRule(rule, sheet.cssRules.length);
127
+ } catch (e) {
128
+ if (process.env.NODE_ENV !== 'production' && !/:(-moz-placeholder|-moz-focus-inner|-moz-focusring|-ms-input-placeholder|-moz-read-write|-moz-read-only|-ms-clear){/.test(rule)) {
129
+ console.error("There was a problem inserting the following rule: \"" + rule + "\"", e);
130
+ }
131
+ }
132
+ } else {
133
+ tag.appendChild(document.createTextNode(rule));
134
+ }
135
+
136
+ this.ctr++;
137
+ };
138
+
139
+ _proto.flush = function flush() {
140
+ // $FlowFixMe
141
+ this.tags.forEach(function (tag) {
142
+ return tag.parentNode && tag.parentNode.removeChild(tag);
143
+ });
144
+ this.tags = [];
145
+ this.ctr = 0;
146
+
147
+ if (process.env.NODE_ENV !== 'production') {
148
+ this._alreadyInsertedOrderInsensitiveRule = false;
149
+ }
150
+ };
151
+
152
+ return StyleSheet;
153
+ }();
154
+
155
+ var MS = '-ms-';
156
+ var MOZ = '-moz-';
157
+ var WEBKIT = '-webkit-';
158
+
159
+ var COMMENT = 'comm';
160
+ var RULESET = 'rule';
161
+ var DECLARATION = 'decl';
162
+ var IMPORT = '@import';
163
+ var KEYFRAMES = '@keyframes';
164
+
165
+ /**
166
+ * @param {number}
167
+ * @return {number}
168
+ */
169
+ var abs = Math.abs;
170
+
171
+ /**
172
+ * @param {number}
173
+ * @return {string}
174
+ */
175
+ var from = String.fromCharCode;
176
+
177
+ /**
178
+ * @param {object}
179
+ * @return {object}
180
+ */
181
+ var assign = Object.assign;
182
+
183
+ /**
184
+ * @param {string} value
185
+ * @param {number} length
186
+ * @return {number}
187
+ */
188
+ function hash (value, length) {
189
+ return (((((((length << 2) ^ charat(value, 0)) << 2) ^ charat(value, 1)) << 2) ^ charat(value, 2)) << 2) ^ charat(value, 3)
190
+ }
191
+
192
+ /**
193
+ * @param {string} value
194
+ * @return {string}
195
+ */
196
+ function trim (value) {
197
+ return value.trim()
198
+ }
199
+
200
+ /**
201
+ * @param {string} value
202
+ * @param {RegExp} pattern
203
+ * @return {string?}
204
+ */
205
+ function match (value, pattern) {
206
+ return (value = pattern.exec(value)) ? value[0] : value
207
+ }
208
+
209
+ /**
210
+ * @param {string} value
211
+ * @param {(string|RegExp)} pattern
212
+ * @param {string} replacement
213
+ * @return {string}
214
+ */
215
+ function replace (value, pattern, replacement) {
216
+ return value.replace(pattern, replacement)
217
+ }
218
+
219
+ /**
220
+ * @param {string} value
221
+ * @param {string} search
222
+ * @return {number}
223
+ */
224
+ function indexof (value, search) {
225
+ return value.indexOf(search)
226
+ }
227
+
228
+ /**
229
+ * @param {string} value
230
+ * @param {number} index
231
+ * @return {number}
232
+ */
233
+ function charat (value, index) {
234
+ return value.charCodeAt(index) | 0
235
+ }
236
+
237
+ /**
238
+ * @param {string} value
239
+ * @param {number} begin
240
+ * @param {number} end
241
+ * @return {string}
242
+ */
243
+ function substr (value, begin, end) {
244
+ return value.slice(begin, end)
245
+ }
246
+
247
+ /**
248
+ * @param {string} value
249
+ * @return {number}
250
+ */
251
+ function strlen (value) {
252
+ return value.length
253
+ }
254
+
255
+ /**
256
+ * @param {any[]} value
257
+ * @return {number}
258
+ */
259
+ function sizeof (value) {
260
+ return value.length
261
+ }
262
+
263
+ /**
264
+ * @param {any} value
265
+ * @param {any[]} array
266
+ * @return {any}
267
+ */
268
+ function append (value, array) {
269
+ return array.push(value), value
270
+ }
271
+
272
+ /**
273
+ * @param {string[]} array
274
+ * @param {function} callback
275
+ * @return {string}
276
+ */
277
+ function combine (array, callback) {
278
+ return array.map(callback).join('')
279
+ }
280
+
281
+ var line = 1;
282
+ var column = 1;
283
+ var length = 0;
284
+ var position = 0;
285
+ var character = 0;
286
+ var characters = '';
287
+
288
+ /**
289
+ * @param {string} value
290
+ * @param {object | null} root
291
+ * @param {object | null} parent
292
+ * @param {string} type
293
+ * @param {string[] | string} props
294
+ * @param {object[] | string} children
295
+ * @param {number} length
296
+ */
297
+ function node (value, root, parent, type, props, children, length) {
298
+ return {value: value, root: root, parent: parent, type: type, props: props, children: children, line: line, column: column, length: length, return: ''}
299
+ }
300
+
301
+ /**
302
+ * @param {object} root
303
+ * @param {object} props
304
+ * @return {object}
305
+ */
306
+ function copy (root, props) {
307
+ return assign(node('', null, null, '', null, null, 0), root, {length: -root.length}, props)
308
+ }
309
+
310
+ /**
311
+ * @return {number}
312
+ */
313
+ function char () {
314
+ return character
315
+ }
316
+
317
+ /**
318
+ * @return {number}
319
+ */
320
+ function prev () {
321
+ character = position > 0 ? charat(characters, --position) : 0;
322
+
323
+ if (column--, character === 10)
324
+ column = 1, line--;
325
+
326
+ return character
327
+ }
328
+
329
+ /**
330
+ * @return {number}
331
+ */
332
+ function next () {
333
+ character = position < length ? charat(characters, position++) : 0;
334
+
335
+ if (column++, character === 10)
336
+ column = 1, line++;
337
+
338
+ return character
339
+ }
340
+
341
+ /**
342
+ * @return {number}
343
+ */
344
+ function peek () {
345
+ return charat(characters, position)
346
+ }
347
+
348
+ /**
349
+ * @return {number}
350
+ */
351
+ function caret () {
352
+ return position
353
+ }
354
+
355
+ /**
356
+ * @param {number} begin
357
+ * @param {number} end
358
+ * @return {string}
359
+ */
360
+ function slice (begin, end) {
361
+ return substr(characters, begin, end)
362
+ }
363
+
364
+ /**
365
+ * @param {number} type
366
+ * @return {number}
367
+ */
368
+ function token (type) {
369
+ switch (type) {
370
+ // \0 \t \n \r \s whitespace token
371
+ case 0: case 9: case 10: case 13: case 32:
372
+ return 5
373
+ // ! + , / > @ ~ isolate token
374
+ case 33: case 43: case 44: case 47: case 62: case 64: case 126:
375
+ // ; { } breakpoint token
376
+ case 59: case 123: case 125:
377
+ return 4
378
+ // : accompanied token
379
+ case 58:
380
+ return 3
381
+ // " ' ( [ opening delimit token
382
+ case 34: case 39: case 40: case 91:
383
+ return 2
384
+ // ) ] closing delimit token
385
+ case 41: case 93:
386
+ return 1
387
+ }
388
+
389
+ return 0
390
+ }
391
+
392
+ /**
393
+ * @param {string} value
394
+ * @return {any[]}
395
+ */
396
+ function alloc (value) {
397
+ return line = column = 1, length = strlen(characters = value), position = 0, []
398
+ }
399
+
400
+ /**
401
+ * @param {any} value
402
+ * @return {any}
403
+ */
404
+ function dealloc (value) {
405
+ return characters = '', value
406
+ }
407
+
408
+ /**
409
+ * @param {number} type
410
+ * @return {string}
411
+ */
412
+ function delimit (type) {
413
+ return trim(slice(position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type)))
414
+ }
415
+
416
+ /**
417
+ * @param {number} type
418
+ * @return {string}
419
+ */
420
+ function whitespace (type) {
421
+ while (character = peek())
422
+ if (character < 33)
423
+ next();
424
+ else
425
+ break
426
+
427
+ return token(type) > 2 || token(character) > 3 ? '' : ' '
428
+ }
429
+
430
+ /**
431
+ * @param {number} index
432
+ * @param {number} count
433
+ * @return {string}
434
+ */
435
+ function escaping (index, count) {
436
+ while (--count && next())
437
+ // not 0-9 A-F a-f
438
+ if (character < 48 || character > 102 || (character > 57 && character < 65) || (character > 70 && character < 97))
439
+ break
440
+
441
+ return slice(index, caret() + (count < 6 && peek() == 32 && next() == 32))
442
+ }
443
+
444
+ /**
445
+ * @param {number} type
446
+ * @return {number}
447
+ */
448
+ function delimiter (type) {
449
+ while (next())
450
+ switch (character) {
451
+ // ] ) " '
452
+ case type:
453
+ return position
454
+ // " '
455
+ case 34: case 39:
456
+ if (type !== 34 && type !== 39)
457
+ delimiter(character);
458
+ break
459
+ // (
460
+ case 40:
461
+ if (type === 41)
462
+ delimiter(type);
463
+ break
464
+ // \
465
+ case 92:
466
+ next();
467
+ break
468
+ }
469
+
470
+ return position
471
+ }
472
+
473
+ /**
474
+ * @param {number} type
475
+ * @param {number} index
476
+ * @return {number}
477
+ */
478
+ function commenter (type, index) {
479
+ while (next())
480
+ // //
481
+ if (type + character === 47 + 10)
482
+ break
483
+ // /*
484
+ else if (type + character === 42 + 42 && peek() === 47)
485
+ break
486
+
487
+ return '/*' + slice(index, position - 1) + '*' + from(type === 47 ? type : next())
488
+ }
489
+
490
+ /**
491
+ * @param {number} index
492
+ * @return {string}
493
+ */
494
+ function identifier (index) {
495
+ while (!token(peek()))
496
+ next();
497
+
498
+ return slice(index, position)
499
+ }
500
+
501
+ /**
502
+ * @param {string} value
503
+ * @return {object[]}
504
+ */
505
+ function compile (value) {
506
+ return dealloc(parse('', null, null, null, [''], value = alloc(value), 0, [0], value))
507
+ }
508
+
509
+ /**
510
+ * @param {string} value
511
+ * @param {object} root
512
+ * @param {object?} parent
513
+ * @param {string[]} rule
514
+ * @param {string[]} rules
515
+ * @param {string[]} rulesets
516
+ * @param {number[]} pseudo
517
+ * @param {number[]} points
518
+ * @param {string[]} declarations
519
+ * @return {object}
520
+ */
521
+ function parse (value, root, parent, rule, rules, rulesets, pseudo, points, declarations) {
522
+ var index = 0;
523
+ var offset = 0;
524
+ var length = pseudo;
525
+ var atrule = 0;
526
+ var property = 0;
527
+ var previous = 0;
528
+ var variable = 1;
529
+ var scanning = 1;
530
+ var ampersand = 1;
531
+ var character = 0;
532
+ var type = '';
533
+ var props = rules;
534
+ var children = rulesets;
535
+ var reference = rule;
536
+ var characters = type;
537
+
538
+ while (scanning)
539
+ switch (previous = character, character = next()) {
540
+ // (
541
+ case 40:
542
+ if (previous != 108 && characters.charCodeAt(length - 1) == 58) {
543
+ if (indexof(characters += replace(delimit(character), '&', '&\f'), '&\f') != -1)
544
+ ampersand = -1;
545
+ break
546
+ }
547
+ // " ' [
548
+ case 34: case 39: case 91:
549
+ characters += delimit(character);
550
+ break
551
+ // \t \n \r \s
552
+ case 9: case 10: case 13: case 32:
553
+ characters += whitespace(previous);
554
+ break
555
+ // \
556
+ case 92:
557
+ characters += escaping(caret() - 1, 7);
558
+ continue
559
+ // /
560
+ case 47:
561
+ switch (peek()) {
562
+ case 42: case 47:
563
+ append(comment(commenter(next(), caret()), root, parent), declarations);
564
+ break
565
+ default:
566
+ characters += '/';
567
+ }
568
+ break
569
+ // {
570
+ case 123 * variable:
571
+ points[index++] = strlen(characters) * ampersand;
572
+ // } ; \0
573
+ case 125 * variable: case 59: case 0:
574
+ switch (character) {
575
+ // \0 }
576
+ case 0: case 125: scanning = 0;
577
+ // ;
578
+ case 59 + offset:
579
+ if (property > 0 && (strlen(characters) - length))
580
+ append(property > 32 ? declaration(characters + ';', rule, parent, length - 1) : declaration(replace(characters, ' ', '') + ';', rule, parent, length - 2), declarations);
581
+ break
582
+ // @ ;
583
+ case 59: characters += ';';
584
+ // { rule/at-rule
585
+ default:
586
+ append(reference = ruleset(characters, root, parent, index, offset, rules, points, type, props = [], children = [], length), rulesets);
587
+
588
+ if (character === 123)
589
+ if (offset === 0)
590
+ parse(characters, root, reference, reference, props, rulesets, length, points, children);
591
+ else
592
+ switch (atrule) {
593
+ // d m s
594
+ case 100: case 109: case 115:
595
+ parse(value, reference, reference, rule && append(ruleset(value, reference, reference, 0, 0, rules, points, type, rules, props = [], length), children), rules, children, length, points, rule ? props : children);
596
+ break
597
+ default:
598
+ parse(characters, reference, reference, reference, [''], children, 0, points, children);
599
+ }
600
+ }
601
+
602
+ index = offset = property = 0, variable = ampersand = 1, type = characters = '', length = pseudo;
603
+ break
604
+ // :
605
+ case 58:
606
+ length = 1 + strlen(characters), property = previous;
607
+ default:
608
+ if (variable < 1)
609
+ if (character == 123)
610
+ --variable;
611
+ else if (character == 125 && variable++ == 0 && prev() == 125)
612
+ continue
613
+
614
+ switch (characters += from(character), character * variable) {
615
+ // &
616
+ case 38:
617
+ ampersand = offset > 0 ? 1 : (characters += '\f', -1);
618
+ break
619
+ // ,
620
+ case 44:
621
+ points[index++] = (strlen(characters) - 1) * ampersand, ampersand = 1;
622
+ break
623
+ // @
624
+ case 64:
625
+ // -
626
+ if (peek() === 45)
627
+ characters += delimit(next());
628
+
629
+ atrule = peek(), offset = length = strlen(type = characters += identifier(caret())), character++;
630
+ break
631
+ // -
632
+ case 45:
633
+ if (previous === 45 && strlen(characters) == 2)
634
+ variable = 0;
635
+ }
636
+ }
637
+
638
+ return rulesets
639
+ }
640
+
641
+ /**
642
+ * @param {string} value
643
+ * @param {object} root
644
+ * @param {object?} parent
645
+ * @param {number} index
646
+ * @param {number} offset
647
+ * @param {string[]} rules
648
+ * @param {number[]} points
649
+ * @param {string} type
650
+ * @param {string[]} props
651
+ * @param {string[]} children
652
+ * @param {number} length
653
+ * @return {object}
654
+ */
655
+ function ruleset (value, root, parent, index, offset, rules, points, type, props, children, length) {
656
+ var post = offset - 1;
657
+ var rule = offset === 0 ? rules : [''];
658
+ var size = sizeof(rule);
659
+
660
+ for (var i = 0, j = 0, k = 0; i < index; ++i)
661
+ for (var x = 0, y = substr(value, post + 1, post = abs(j = points[i])), z = value; x < size; ++x)
662
+ if (z = trim(j > 0 ? rule[x] + ' ' + y : replace(y, /&\f/g, rule[x])))
663
+ props[k++] = z;
664
+
665
+ return node(value, root, parent, offset === 0 ? RULESET : type, props, children, length)
666
+ }
667
+
668
+ /**
669
+ * @param {number} value
670
+ * @param {object} root
671
+ * @param {object?} parent
672
+ * @return {object}
673
+ */
674
+ function comment (value, root, parent) {
675
+ return node(value, root, parent, COMMENT, from(char()), substr(value, 2, -2), 0)
676
+ }
677
+
678
+ /**
679
+ * @param {string} value
680
+ * @param {object} root
681
+ * @param {object?} parent
682
+ * @param {number} length
683
+ * @return {object}
684
+ */
685
+ function declaration (value, root, parent, length) {
686
+ return node(value, root, parent, DECLARATION, substr(value, 0, length), substr(value, length + 1, -1), length)
687
+ }
688
+
689
+ /**
690
+ * @param {string} value
691
+ * @param {number} length
692
+ * @return {string}
693
+ */
694
+ function prefix (value, length) {
695
+ switch (hash(value, length)) {
696
+ // color-adjust
697
+ case 5103:
698
+ return WEBKIT + 'print-' + value + value
699
+ // animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function)
700
+ case 5737: case 4201: case 3177: case 3433: case 1641: case 4457: case 2921:
701
+ // text-decoration, filter, clip-path, backface-visibility, column, box-decoration-break
702
+ case 5572: case 6356: case 5844: case 3191: case 6645: case 3005:
703
+ // mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite,
704
+ case 6391: case 5879: case 5623: case 6135: case 4599: case 4855:
705
+ // background-clip, columns, column-(count|fill|gap|rule|rule-color|rule-style|rule-width|span|width)
706
+ case 4215: case 6389: case 5109: case 5365: case 5621: case 3829:
707
+ return WEBKIT + value + value
708
+ // appearance, user-select, transform, hyphens, text-size-adjust
709
+ case 5349: case 4246: case 4810: case 6968: case 2756:
710
+ return WEBKIT + value + MOZ + value + MS + value + value
711
+ // flex, flex-direction
712
+ case 6828: case 4268:
713
+ return WEBKIT + value + MS + value + value
714
+ // order
715
+ case 6165:
716
+ return WEBKIT + value + MS + 'flex-' + value + value
717
+ // align-items
718
+ case 5187:
719
+ return WEBKIT + value + replace(value, /(\w+).+(:[^]+)/, WEBKIT + 'box-$1$2' + MS + 'flex-$1$2') + value
720
+ // align-self
721
+ case 5443:
722
+ return WEBKIT + value + MS + 'flex-item-' + replace(value, /flex-|-self/, '') + value
723
+ // align-content
724
+ case 4675:
725
+ return WEBKIT + value + MS + 'flex-line-pack' + replace(value, /align-content|flex-|-self/, '') + value
726
+ // flex-shrink
727
+ case 5548:
728
+ return WEBKIT + value + MS + replace(value, 'shrink', 'negative') + value
729
+ // flex-basis
730
+ case 5292:
731
+ return WEBKIT + value + MS + replace(value, 'basis', 'preferred-size') + value
732
+ // flex-grow
733
+ case 6060:
734
+ return WEBKIT + 'box-' + replace(value, '-grow', '') + WEBKIT + value + MS + replace(value, 'grow', 'positive') + value
735
+ // transition
736
+ case 4554:
737
+ return WEBKIT + replace(value, /([^-])(transform)/g, '$1' + WEBKIT + '$2') + value
738
+ // cursor
739
+ case 6187:
740
+ return replace(replace(replace(value, /(zoom-|grab)/, WEBKIT + '$1'), /(image-set)/, WEBKIT + '$1'), value, '') + value
741
+ // background, background-image
742
+ case 5495: case 3959:
743
+ return replace(value, /(image-set\([^]*)/, WEBKIT + '$1' + '$`$1')
744
+ // justify-content
745
+ case 4968:
746
+ return replace(replace(value, /(.+:)(flex-)?(.*)/, WEBKIT + 'box-pack:$3' + MS + 'flex-pack:$3'), /s.+-b[^;]+/, 'justify') + WEBKIT + value + value
747
+ // (margin|padding)-inline-(start|end)
748
+ case 4095: case 3583: case 4068: case 2532:
749
+ return replace(value, /(.+)-inline(.+)/, WEBKIT + '$1$2') + value
750
+ // (min|max)?(width|height|inline-size|block-size)
751
+ case 8116: case 7059: case 5753: case 5535:
752
+ case 5445: case 5701: case 4933: case 4677:
753
+ case 5533: case 5789: case 5021: case 4765:
754
+ // stretch, max-content, min-content, fill-available
755
+ if (strlen(value) - 1 - length > 6)
756
+ switch (charat(value, length + 1)) {
757
+ // (m)ax-content, (m)in-content
758
+ case 109:
759
+ // -
760
+ if (charat(value, length + 4) !== 45)
761
+ break
762
+ // (f)ill-available, (f)it-content
763
+ case 102:
764
+ return replace(value, /(.+:)(.+)-([^]+)/, '$1' + WEBKIT + '$2-$3' + '$1' + MOZ + (charat(value, length + 3) == 108 ? '$3' : '$2-$3')) + value
765
+ // (s)tretch
766
+ case 115:
767
+ return ~indexof(value, 'stretch') ? prefix(replace(value, 'stretch', 'fill-available'), length) + value : value
768
+ }
769
+ break
770
+ // position: sticky
771
+ case 4949:
772
+ // (s)ticky?
773
+ if (charat(value, length + 1) !== 115)
774
+ break
775
+ // display: (flex|inline-flex)
776
+ case 6444:
777
+ switch (charat(value, strlen(value) - 3 - (~indexof(value, '!important') && 10))) {
778
+ // stic(k)y
779
+ case 107:
780
+ return replace(value, ':', ':' + WEBKIT) + value
781
+ // (inline-)?fl(e)x
782
+ case 101:
783
+ return replace(value, /(.+:)([^;!]+)(;|!.+)?/, '$1' + WEBKIT + (charat(value, 14) === 45 ? 'inline-' : '') + 'box$3' + '$1' + WEBKIT + '$2$3' + '$1' + MS + '$2box$3') + value
784
+ }
785
+ break
786
+ // writing-mode
787
+ case 5936:
788
+ switch (charat(value, length + 11)) {
789
+ // vertical-l(r)
790
+ case 114:
791
+ return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, 'tb') + value
792
+ // vertical-r(l)
793
+ case 108:
794
+ return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, 'tb-rl') + value
795
+ // horizontal(-)tb
796
+ case 45:
797
+ return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, 'lr') + value
798
+ }
799
+
800
+ return WEBKIT + value + MS + value + value
801
+ }
802
+
803
+ return value
804
+ }
805
+
806
+ /**
807
+ * @param {object[]} children
808
+ * @param {function} callback
809
+ * @return {string}
810
+ */
811
+ function serialize (children, callback) {
812
+ var output = '';
813
+ var length = sizeof(children);
814
+
815
+ for (var i = 0; i < length; i++)
816
+ output += callback(children[i], i, children, callback) || '';
817
+
818
+ return output
819
+ }
820
+
821
+ /**
822
+ * @param {object} element
823
+ * @param {number} index
824
+ * @param {object[]} children
825
+ * @param {function} callback
826
+ * @return {string}
827
+ */
828
+ function stringify (element, index, children, callback) {
829
+ switch (element.type) {
830
+ case IMPORT: case DECLARATION: return element.return = element.return || element.value
831
+ case COMMENT: return ''
832
+ case KEYFRAMES: return element.return = element.value + '{' + serialize(element.children, callback) + '}'
833
+ case RULESET: element.value = element.props.join(',');
834
+ }
835
+
836
+ return strlen(children = serialize(element.children, callback)) ? element.return = element.value + '{' + children + '}' : ''
837
+ }
838
+
839
+ /**
840
+ * @param {function[]} collection
841
+ * @return {function}
842
+ */
843
+ function middleware (collection) {
844
+ var length = sizeof(collection);
845
+
846
+ return function (element, index, children, callback) {
847
+ var output = '';
848
+
849
+ for (var i = 0; i < length; i++)
850
+ output += collection[i](element, index, children, callback) || '';
851
+
852
+ return output
853
+ }
854
+ }
855
+
856
+ /**
857
+ * @param {function} callback
858
+ * @return {function}
859
+ */
860
+ function rulesheet (callback) {
861
+ return function (element) {
862
+ if (!element.root)
863
+ if (element = element.return)
864
+ callback(element);
865
+ }
866
+ }
867
+
868
+ /**
869
+ * @param {object} element
870
+ * @param {number} index
871
+ * @param {object[]} children
872
+ * @param {function} callback
873
+ */
874
+ function prefixer (element, index, children, callback) {
875
+ if (element.length > -1)
876
+ if (!element.return)
877
+ switch (element.type) {
878
+ case DECLARATION: element.return = prefix(element.value, element.length);
879
+ break
880
+ case KEYFRAMES:
881
+ return serialize([copy(element, {value: replace(element.value, '@', '@' + WEBKIT)})], callback)
882
+ case RULESET:
883
+ if (element.length)
884
+ return combine(element.props, function (value) {
885
+ switch (match(value, /(::plac\w+|:read-\w+)/)) {
886
+ // :read-(only|write)
887
+ case ':read-only': case ':read-write':
888
+ return serialize([copy(element, {props: [replace(value, /:(read-\w+)/, ':' + MOZ + '$1')]})], callback)
889
+ // :placeholder
890
+ case '::placeholder':
891
+ return serialize([
892
+ copy(element, {props: [replace(value, /:(plac\w+)/, ':' + WEBKIT + 'input-$1')]}),
893
+ copy(element, {props: [replace(value, /:(plac\w+)/, ':' + MOZ + '$1')]}),
894
+ copy(element, {props: [replace(value, /:(plac\w+)/, MS + 'input-$1')]})
895
+ ], callback)
896
+ }
897
+
898
+ return ''
899
+ })
900
+ }
901
+ }
902
+
903
+ var weakMemoize = function weakMemoize(func) {
904
+ // $FlowFixMe flow doesn't include all non-primitive types as allowed for weakmaps
905
+ var cache = new WeakMap();
906
+ return function (arg) {
907
+ if (cache.has(arg)) {
908
+ // $FlowFixMe
909
+ return cache.get(arg);
910
+ }
911
+
912
+ var ret = func(arg);
913
+ cache.set(arg, ret);
914
+ return ret;
915
+ };
916
+ };
917
+
918
+ function memoize(fn) {
919
+ var cache = Object.create(null);
920
+ return function (arg) {
921
+ if (cache[arg] === undefined) cache[arg] = fn(arg);
922
+ return cache[arg];
923
+ };
924
+ }
925
+
926
+ var last = function last(arr) {
927
+ return arr.length ? arr[arr.length - 1] : null;
928
+ }; // based on https://github.com/thysultan/stylis.js/blob/e6843c373ebcbbfade25ebcc23f540ed8508da0a/src/Tokenizer.js#L239-L244
929
+
930
+
931
+ var identifierWithPointTracking = function identifierWithPointTracking(begin, points, index) {
932
+ var previous = 0;
933
+ var character = 0;
934
+
935
+ while (true) {
936
+ previous = character;
937
+ character = peek(); // &\f
938
+
939
+ if (previous === 38 && character === 12) {
940
+ points[index] = 1;
941
+ }
942
+
943
+ if (token(character)) {
944
+ break;
945
+ }
946
+
947
+ next();
948
+ }
949
+
950
+ return slice(begin, position);
951
+ };
952
+
953
+ var toRules = function toRules(parsed, points) {
954
+ // pretend we've started with a comma
955
+ var index = -1;
956
+ var character = 44;
957
+
958
+ do {
959
+ switch (token(character)) {
960
+ case 0:
961
+ // &\f
962
+ if (character === 38 && peek() === 12) {
963
+ // this is not 100% correct, we don't account for literal sequences here - like for example quoted strings
964
+ // stylis inserts \f after & to know when & where it should replace this sequence with the context selector
965
+ // and when it should just concatenate the outer and inner selectors
966
+ // it's very unlikely for this sequence to actually appear in a different context, so we just leverage this fact here
967
+ points[index] = 1;
968
+ }
969
+
970
+ parsed[index] += identifierWithPointTracking(position - 1, points, index);
971
+ break;
972
+
973
+ case 2:
974
+ parsed[index] += delimit(character);
975
+ break;
976
+
977
+ case 4:
978
+ // comma
979
+ if (character === 44) {
980
+ // colon
981
+ parsed[++index] = peek() === 58 ? '&\f' : '';
982
+ points[index] = parsed[index].length;
983
+ break;
984
+ }
985
+
986
+ // fallthrough
987
+
988
+ default:
989
+ parsed[index] += from(character);
990
+ }
991
+ } while (character = next());
992
+
993
+ return parsed;
994
+ };
995
+
996
+ var getRules = function getRules(value, points) {
997
+ return dealloc(toRules(alloc(value), points));
998
+ }; // WeakSet would be more appropriate, but only WeakMap is supported in IE11
999
+
1000
+
1001
+ var fixedElements = /* #__PURE__ */new WeakMap();
1002
+ var compat = function compat(element) {
1003
+ if (element.type !== 'rule' || !element.parent || // positive .length indicates that this rule contains pseudo
1004
+ // negative .length indicates that this rule has been already prefixed
1005
+ element.length < 1) {
1006
+ return;
1007
+ }
1008
+
1009
+ var value = element.value,
1010
+ parent = element.parent;
1011
+ var isImplicitRule = element.column === parent.column && element.line === parent.line;
1012
+
1013
+ while (parent.type !== 'rule') {
1014
+ parent = parent.parent;
1015
+ if (!parent) return;
1016
+ } // short-circuit for the simplest case
1017
+
1018
+
1019
+ if (element.props.length === 1 && value.charCodeAt(0) !== 58
1020
+ /* colon */
1021
+ && !fixedElements.get(parent)) {
1022
+ return;
1023
+ } // if this is an implicitly inserted rule (the one eagerly inserted at the each new nested level)
1024
+ // then the props has already been manipulated beforehand as they that array is shared between it and its "rule parent"
1025
+
1026
+
1027
+ if (isImplicitRule) {
1028
+ return;
1029
+ }
1030
+
1031
+ fixedElements.set(element, true);
1032
+ var points = [];
1033
+ var rules = getRules(value, points);
1034
+ var parentRules = parent.props;
1035
+
1036
+ for (var i = 0, k = 0; i < rules.length; i++) {
1037
+ for (var j = 0; j < parentRules.length; j++, k++) {
1038
+ element.props[k] = points[i] ? rules[i].replace(/&\f/g, parentRules[j]) : parentRules[j] + " " + rules[i];
1039
+ }
1040
+ }
1041
+ };
1042
+ var removeLabel = function removeLabel(element) {
1043
+ if (element.type === 'decl') {
1044
+ var value = element.value;
1045
+
1046
+ if ( // charcode for l
1047
+ value.charCodeAt(0) === 108 && // charcode for b
1048
+ value.charCodeAt(2) === 98) {
1049
+ // this ignores label
1050
+ element["return"] = '';
1051
+ element.value = '';
1052
+ }
1053
+ }
1054
+ };
1055
+ var ignoreFlag = 'emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason';
1056
+
1057
+ var isIgnoringComment = function isIgnoringComment(element) {
1058
+ return !!element && element.type === 'comm' && element.children.indexOf(ignoreFlag) > -1;
1059
+ };
1060
+
1061
+ var createUnsafeSelectorsAlarm = function createUnsafeSelectorsAlarm(cache) {
1062
+ return function (element, index, children) {
1063
+ if (element.type !== 'rule') return;
1064
+ var unsafePseudoClasses = element.value.match(/(:first|:nth|:nth-last)-child/g);
1065
+
1066
+ if (unsafePseudoClasses && cache.compat !== true) {
1067
+ var prevElement = index > 0 ? children[index - 1] : null;
1068
+
1069
+ if (prevElement && isIgnoringComment(last(prevElement.children))) {
1070
+ return;
1071
+ }
1072
+
1073
+ unsafePseudoClasses.forEach(function (unsafePseudoClass) {
1074
+ console.error("The pseudo class \"" + unsafePseudoClass + "\" is potentially unsafe when doing server-side rendering. Try changing it to \"" + unsafePseudoClass.split('-child')[0] + "-of-type\".");
1075
+ });
1076
+ }
1077
+ };
1078
+ };
1079
+
1080
+ var isImportRule = function isImportRule(element) {
1081
+ return element.type.charCodeAt(1) === 105 && element.type.charCodeAt(0) === 64;
1082
+ };
1083
+
1084
+ var isPrependedWithRegularRules = function isPrependedWithRegularRules(index, children) {
1085
+ for (var i = index - 1; i >= 0; i--) {
1086
+ if (!isImportRule(children[i])) {
1087
+ return true;
1088
+ }
1089
+ }
1090
+
1091
+ return false;
1092
+ }; // use this to remove incorrect elements from further processing
1093
+ // so they don't get handed to the `sheet` (or anything else)
1094
+ // as that could potentially lead to additional logs which in turn could be overhelming to the user
1095
+
1096
+
1097
+ var nullifyElement = function nullifyElement(element) {
1098
+ element.type = '';
1099
+ element.value = '';
1100
+ element["return"] = '';
1101
+ element.children = '';
1102
+ element.props = '';
1103
+ };
1104
+
1105
+ var incorrectImportAlarm = function incorrectImportAlarm(element, index, children) {
1106
+ if (!isImportRule(element)) {
1107
+ return;
1108
+ }
1109
+
1110
+ if (element.parent) {
1111
+ console.error("`@import` rules can't be nested inside other rules. Please move it to the top level and put it before regular rules. Keep in mind that they can only be used within global styles.");
1112
+ nullifyElement(element);
1113
+ } else if (isPrependedWithRegularRules(index, children)) {
1114
+ console.error("`@import` rules can't be after other rules. Please put your `@import` rules before your other rules.");
1115
+ nullifyElement(element);
1116
+ }
1117
+ };
1118
+
1119
+ var isBrowser = typeof document !== 'undefined';
1120
+ var getServerStylisCache = isBrowser ? undefined : weakMemoize(function () {
1121
+ return memoize(function () {
1122
+ var cache = {};
1123
+ return function (name) {
1124
+ return cache[name];
1125
+ };
1126
+ });
1127
+ });
1128
+ var defaultStylisPlugins = [prefixer];
1129
+
1130
+ var createCache = function createCache(options) {
1131
+ var key = options.key;
1132
+
1133
+ if (process.env.NODE_ENV !== 'production' && !key) {
1134
+ throw new Error("You have to configure `key` for your cache. Please make sure it's unique (and not equal to 'css') as it's used for linking styles to your cache.\n" + "If multiple caches share the same key they might \"fight\" for each other's style elements.");
1135
+ }
1136
+
1137
+ if (isBrowser && key === 'css') {
1138
+ var ssrStyles = document.querySelectorAll("style[data-emotion]:not([data-s])"); // get SSRed styles out of the way of React's hydration
1139
+ // document.head is a safe place to move them to(though note document.head is not necessarily the last place they will be)
1140
+ // note this very very intentionally targets all style elements regardless of the key to ensure
1141
+ // that creating a cache works inside of render of a React component
1142
+
1143
+ Array.prototype.forEach.call(ssrStyles, function (node) {
1144
+ // we want to only move elements which have a space in the data-emotion attribute value
1145
+ // because that indicates that it is an Emotion 11 server-side rendered style elements
1146
+ // while we will already ignore Emotion 11 client-side inserted styles because of the :not([data-s]) part in the selector
1147
+ // Emotion 10 client-side inserted styles did not have data-s (but importantly did not have a space in their data-emotion attributes)
1148
+ // so checking for the space ensures that loading Emotion 11 after Emotion 10 has inserted some styles
1149
+ // will not result in the Emotion 10 styles being destroyed
1150
+ var dataEmotionAttribute = node.getAttribute('data-emotion');
1151
+
1152
+ if (dataEmotionAttribute.indexOf(' ') === -1) {
1153
+ return;
1154
+ }
1155
+ document.head.appendChild(node);
1156
+ node.setAttribute('data-s', '');
1157
+ });
1158
+ }
1159
+
1160
+ var stylisPlugins = options.stylisPlugins || defaultStylisPlugins;
1161
+
1162
+ if (process.env.NODE_ENV !== 'production') {
1163
+ // $FlowFixMe
1164
+ if (/[^a-z-]/.test(key)) {
1165
+ throw new Error("Emotion key must only contain lower case alphabetical characters and - but \"" + key + "\" was passed");
1166
+ }
1167
+ }
1168
+
1169
+ var inserted = {}; // $FlowFixMe
1170
+
1171
+ var container;
1172
+ var nodesToHydrate = [];
1173
+
1174
+ if (isBrowser) {
1175
+ container = options.container || document.head;
1176
+ Array.prototype.forEach.call( // this means we will ignore elements which don't have a space in them which
1177
+ // means that the style elements we're looking at are only Emotion 11 server-rendered style elements
1178
+ document.querySelectorAll("style[data-emotion^=\"" + key + " \"]"), function (node) {
1179
+ var attrib = node.getAttribute("data-emotion").split(' '); // $FlowFixMe
1180
+
1181
+ for (var i = 1; i < attrib.length; i++) {
1182
+ inserted[attrib[i]] = true;
1183
+ }
1184
+
1185
+ nodesToHydrate.push(node);
1186
+ });
1187
+ }
1188
+
1189
+ var _insert;
1190
+
1191
+ var omnipresentPlugins = [compat, removeLabel];
1192
+
1193
+ if (process.env.NODE_ENV !== 'production') {
1194
+ omnipresentPlugins.push(createUnsafeSelectorsAlarm({
1195
+ get compat() {
1196
+ return cache.compat;
1197
+ }
1198
+
1199
+ }), incorrectImportAlarm);
1200
+ }
1201
+
1202
+ if (isBrowser) {
1203
+ var currentSheet;
1204
+ var finalizingPlugins = [stringify, process.env.NODE_ENV !== 'production' ? function (element) {
1205
+ if (!element.root) {
1206
+ if (element["return"]) {
1207
+ currentSheet.insert(element["return"]);
1208
+ } else if (element.value && element.type !== COMMENT) {
1209
+ // insert empty rule in non-production environments
1210
+ // so @emotion/jest can grab `key` from the (JS)DOM for caches without any rules inserted yet
1211
+ currentSheet.insert(element.value + "{}");
1212
+ }
1213
+ }
1214
+ } : rulesheet(function (rule) {
1215
+ currentSheet.insert(rule);
1216
+ })];
1217
+ var serializer = middleware(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins));
1218
+
1219
+ var stylis = function stylis(styles) {
1220
+ return serialize(compile(styles), serializer);
1221
+ };
1222
+
1223
+ _insert = function insert(selector, serialized, sheet, shouldCache) {
1224
+ currentSheet = sheet;
1225
+
1226
+ if (process.env.NODE_ENV !== 'production' && serialized.map !== undefined) {
1227
+ currentSheet = {
1228
+ insert: function insert(rule) {
1229
+ sheet.insert(rule + serialized.map);
1230
+ }
1231
+ };
1232
+ }
1233
+
1234
+ stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles);
1235
+
1236
+ if (shouldCache) {
1237
+ cache.inserted[serialized.name] = true;
1238
+ }
1239
+ };
1240
+ } else {
1241
+ var _finalizingPlugins = [stringify];
1242
+
1243
+ var _serializer = middleware(omnipresentPlugins.concat(stylisPlugins, _finalizingPlugins));
1244
+
1245
+ var _stylis = function _stylis(styles) {
1246
+ return serialize(compile(styles), _serializer);
1247
+ }; // $FlowFixMe
1248
+
1249
+
1250
+ var serverStylisCache = getServerStylisCache(stylisPlugins)(key);
1251
+
1252
+ var getRules = function getRules(selector, serialized) {
1253
+ var name = serialized.name;
1254
+
1255
+ if (serverStylisCache[name] === undefined) {
1256
+ serverStylisCache[name] = _stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles);
1257
+ }
1258
+
1259
+ return serverStylisCache[name];
1260
+ };
1261
+
1262
+ _insert = function _insert(selector, serialized, sheet, shouldCache) {
1263
+ var name = serialized.name;
1264
+ var rules = getRules(selector, serialized);
1265
+
1266
+ if (cache.compat === undefined) {
1267
+ // in regular mode, we don't set the styles on the inserted cache
1268
+ // since we don't need to and that would be wasting memory
1269
+ // we return them so that they are rendered in a style tag
1270
+ if (shouldCache) {
1271
+ cache.inserted[name] = true;
1272
+ }
1273
+
1274
+ if ( // using === development instead of !== production
1275
+ // because if people do ssr in tests, the source maps showing up would be annoying
1276
+ process.env.NODE_ENV === 'development' && serialized.map !== undefined) {
1277
+ return rules + serialized.map;
1278
+ }
1279
+
1280
+ return rules;
1281
+ } else {
1282
+ // in compat mode, we put the styles on the inserted cache so
1283
+ // that emotion-server can pull out the styles
1284
+ // except when we don't want to cache it which was in Global but now
1285
+ // is nowhere but we don't want to do a major right now
1286
+ // and just in case we're going to leave the case here
1287
+ // it's also not affecting client side bundle size
1288
+ // so it's really not a big deal
1289
+ if (shouldCache) {
1290
+ cache.inserted[name] = rules;
1291
+ } else {
1292
+ return rules;
1293
+ }
1294
+ }
1295
+ };
1296
+ }
1297
+
1298
+ var cache = {
1299
+ key: key,
1300
+ sheet: new StyleSheet({
1301
+ key: key,
1302
+ container: container,
1303
+ nonce: options.nonce,
1304
+ speedy: options.speedy,
1305
+ prepend: options.prepend,
1306
+ insertionPoint: options.insertionPoint
1307
+ }),
1308
+ nonce: options.nonce,
1309
+ inserted: inserted,
1310
+ registered: {},
1311
+ insert: _insert
1312
+ };
1313
+ cache.sheet.hydrate(nodesToHydrate);
1314
+ return cache;
1315
+ };
1316
+
1317
+ /**
1318
+ * prepend: true moves MUI styles to the top of the <head> so they're loaded first.
1319
+ * It allows developers to easily override MUI styles with other styling solutions, like CSS modules.
1320
+ */
1321
+
1322
+ function createEmotionCache() {
1323
+ return createCache({
1324
+ key: "css",
1325
+ prepend: true
1326
+ });
1327
+ }
1328
+
1329
+ exports.createEmotionCache = createEmotionCache;