@puckeditor/plugin-emotion-cache 0.21.0-canary.d1c0d6a2

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.js ADDED
@@ -0,0 +1,927 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from2, except, desc) => {
13
+ if (from2 && typeof from2 === "object" || typeof from2 === "function") {
14
+ for (let key of __getOwnPropNames(from2))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from2[key], enumerable: !(desc = __getOwnPropDesc(from2, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // index.tsx
31
+ var index_exports = {};
32
+ __export(index_exports, {
33
+ default: () => index_default
34
+ });
35
+ module.exports = __toCommonJS(index_exports);
36
+
37
+ // ../tsup-config/react-import.js
38
+ var import_react = __toESM(require("react"));
39
+
40
+ // index.tsx
41
+ var import_react2 = require("react");
42
+
43
+ // ../../node_modules/@emotion/sheet/dist/emotion-sheet.esm.js
44
+ var isDevelopment = false;
45
+ function sheetForTag(tag) {
46
+ if (tag.sheet) {
47
+ return tag.sheet;
48
+ }
49
+ for (var i = 0; i < document.styleSheets.length; i++) {
50
+ if (document.styleSheets[i].ownerNode === tag) {
51
+ return document.styleSheets[i];
52
+ }
53
+ }
54
+ return void 0;
55
+ }
56
+ function createStyleElement(options) {
57
+ var tag = document.createElement("style");
58
+ tag.setAttribute("data-emotion", options.key);
59
+ if (options.nonce !== void 0) {
60
+ tag.setAttribute("nonce", options.nonce);
61
+ }
62
+ tag.appendChild(document.createTextNode(""));
63
+ tag.setAttribute("data-s", "");
64
+ return tag;
65
+ }
66
+ var StyleSheet = /* @__PURE__ */ (function() {
67
+ function StyleSheet2(options) {
68
+ var _this = this;
69
+ this._insertTag = function(tag) {
70
+ var before;
71
+ if (_this.tags.length === 0) {
72
+ if (_this.insertionPoint) {
73
+ before = _this.insertionPoint.nextSibling;
74
+ } else if (_this.prepend) {
75
+ before = _this.container.firstChild;
76
+ } else {
77
+ before = _this.before;
78
+ }
79
+ } else {
80
+ before = _this.tags[_this.tags.length - 1].nextSibling;
81
+ }
82
+ _this.container.insertBefore(tag, before);
83
+ _this.tags.push(tag);
84
+ };
85
+ this.isSpeedy = options.speedy === void 0 ? !isDevelopment : options.speedy;
86
+ this.tags = [];
87
+ this.ctr = 0;
88
+ this.nonce = options.nonce;
89
+ this.key = options.key;
90
+ this.container = options.container;
91
+ this.prepend = options.prepend;
92
+ this.insertionPoint = options.insertionPoint;
93
+ this.before = null;
94
+ }
95
+ var _proto = StyleSheet2.prototype;
96
+ _proto.hydrate = function hydrate(nodes) {
97
+ nodes.forEach(this._insertTag);
98
+ };
99
+ _proto.insert = function insert(rule) {
100
+ if (this.ctr % (this.isSpeedy ? 65e3 : 1) === 0) {
101
+ this._insertTag(createStyleElement(this));
102
+ }
103
+ var tag = this.tags[this.tags.length - 1];
104
+ if (this.isSpeedy) {
105
+ var sheet = sheetForTag(tag);
106
+ try {
107
+ sheet.insertRule(rule, sheet.cssRules.length);
108
+ } catch (e) {
109
+ }
110
+ } else {
111
+ tag.appendChild(document.createTextNode(rule));
112
+ }
113
+ this.ctr++;
114
+ };
115
+ _proto.flush = function flush() {
116
+ this.tags.forEach(function(tag) {
117
+ var _tag$parentNode;
118
+ return (_tag$parentNode = tag.parentNode) == null ? void 0 : _tag$parentNode.removeChild(tag);
119
+ });
120
+ this.tags = [];
121
+ this.ctr = 0;
122
+ };
123
+ return StyleSheet2;
124
+ })();
125
+
126
+ // ../../node_modules/stylis/src/Enum.js
127
+ var MS = "-ms-";
128
+ var MOZ = "-moz-";
129
+ var WEBKIT = "-webkit-";
130
+ var COMMENT = "comm";
131
+ var RULESET = "rule";
132
+ var DECLARATION = "decl";
133
+ var IMPORT = "@import";
134
+ var KEYFRAMES = "@keyframes";
135
+ var LAYER = "@layer";
136
+
137
+ // ../../node_modules/stylis/src/Utility.js
138
+ var abs = Math.abs;
139
+ var from = String.fromCharCode;
140
+ var assign = Object.assign;
141
+ function hash(value, length2) {
142
+ return charat(value, 0) ^ 45 ? (((length2 << 2 ^ charat(value, 0)) << 2 ^ charat(value, 1)) << 2 ^ charat(value, 2)) << 2 ^ charat(value, 3) : 0;
143
+ }
144
+ function trim(value) {
145
+ return value.trim();
146
+ }
147
+ function match(value, pattern) {
148
+ return (value = pattern.exec(value)) ? value[0] : value;
149
+ }
150
+ function replace(value, pattern, replacement) {
151
+ return value.replace(pattern, replacement);
152
+ }
153
+ function indexof(value, search) {
154
+ return value.indexOf(search);
155
+ }
156
+ function charat(value, index) {
157
+ return value.charCodeAt(index) | 0;
158
+ }
159
+ function substr(value, begin, end) {
160
+ return value.slice(begin, end);
161
+ }
162
+ function strlen(value) {
163
+ return value.length;
164
+ }
165
+ function sizeof(value) {
166
+ return value.length;
167
+ }
168
+ function append(value, array) {
169
+ return array.push(value), value;
170
+ }
171
+ function combine(array, callback) {
172
+ return array.map(callback).join("");
173
+ }
174
+
175
+ // ../../node_modules/stylis/src/Tokenizer.js
176
+ var line = 1;
177
+ var column = 1;
178
+ var length = 0;
179
+ var position = 0;
180
+ var character = 0;
181
+ var characters = "";
182
+ function node(value, root, parent, type, props, children, length2) {
183
+ return { value, root, parent, type, props, children, line, column, length: length2, return: "" };
184
+ }
185
+ function copy(root, props) {
186
+ return assign(node("", null, null, "", null, null, 0), root, { length: -root.length }, props);
187
+ }
188
+ function char() {
189
+ return character;
190
+ }
191
+ function prev() {
192
+ character = position > 0 ? charat(characters, --position) : 0;
193
+ if (column--, character === 10)
194
+ column = 1, line--;
195
+ return character;
196
+ }
197
+ function next() {
198
+ character = position < length ? charat(characters, position++) : 0;
199
+ if (column++, character === 10)
200
+ column = 1, line++;
201
+ return character;
202
+ }
203
+ function peek() {
204
+ return charat(characters, position);
205
+ }
206
+ function caret() {
207
+ return position;
208
+ }
209
+ function slice(begin, end) {
210
+ return substr(characters, begin, end);
211
+ }
212
+ function token(type) {
213
+ switch (type) {
214
+ // \0 \t \n \r \s whitespace token
215
+ case 0:
216
+ case 9:
217
+ case 10:
218
+ case 13:
219
+ case 32:
220
+ return 5;
221
+ // ! + , / > @ ~ isolate token
222
+ case 33:
223
+ case 43:
224
+ case 44:
225
+ case 47:
226
+ case 62:
227
+ case 64:
228
+ case 126:
229
+ // ; { } breakpoint token
230
+ case 59:
231
+ case 123:
232
+ case 125:
233
+ return 4;
234
+ // : accompanied token
235
+ case 58:
236
+ return 3;
237
+ // " ' ( [ opening delimit token
238
+ case 34:
239
+ case 39:
240
+ case 40:
241
+ case 91:
242
+ return 2;
243
+ // ) ] closing delimit token
244
+ case 41:
245
+ case 93:
246
+ return 1;
247
+ }
248
+ return 0;
249
+ }
250
+ function alloc(value) {
251
+ return line = column = 1, length = strlen(characters = value), position = 0, [];
252
+ }
253
+ function dealloc(value) {
254
+ return characters = "", value;
255
+ }
256
+ function delimit(type) {
257
+ return trim(slice(position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type)));
258
+ }
259
+ function whitespace(type) {
260
+ while (character = peek())
261
+ if (character < 33)
262
+ next();
263
+ else
264
+ break;
265
+ return token(type) > 2 || token(character) > 3 ? "" : " ";
266
+ }
267
+ function escaping(index, count) {
268
+ while (--count && next())
269
+ if (character < 48 || character > 102 || character > 57 && character < 65 || character > 70 && character < 97)
270
+ break;
271
+ return slice(index, caret() + (count < 6 && peek() == 32 && next() == 32));
272
+ }
273
+ function delimiter(type) {
274
+ while (next())
275
+ switch (character) {
276
+ // ] ) " '
277
+ case type:
278
+ return position;
279
+ // " '
280
+ case 34:
281
+ case 39:
282
+ if (type !== 34 && type !== 39)
283
+ delimiter(character);
284
+ break;
285
+ // (
286
+ case 40:
287
+ if (type === 41)
288
+ delimiter(type);
289
+ break;
290
+ // \
291
+ case 92:
292
+ next();
293
+ break;
294
+ }
295
+ return position;
296
+ }
297
+ function commenter(type, index) {
298
+ while (next())
299
+ if (type + character === 47 + 10)
300
+ break;
301
+ else if (type + character === 42 + 42 && peek() === 47)
302
+ break;
303
+ return "/*" + slice(index, position - 1) + "*" + from(type === 47 ? type : next());
304
+ }
305
+ function identifier(index) {
306
+ while (!token(peek()))
307
+ next();
308
+ return slice(index, position);
309
+ }
310
+
311
+ // ../../node_modules/stylis/src/Parser.js
312
+ function compile(value) {
313
+ return dealloc(parse("", null, null, null, [""], value = alloc(value), 0, [0], value));
314
+ }
315
+ function parse(value, root, parent, rule, rules, rulesets, pseudo, points, declarations) {
316
+ var index = 0;
317
+ var offset = 0;
318
+ var length2 = pseudo;
319
+ var atrule = 0;
320
+ var property = 0;
321
+ var previous = 0;
322
+ var variable = 1;
323
+ var scanning = 1;
324
+ var ampersand = 1;
325
+ var character2 = 0;
326
+ var type = "";
327
+ var props = rules;
328
+ var children = rulesets;
329
+ var reference = rule;
330
+ var characters2 = type;
331
+ while (scanning)
332
+ switch (previous = character2, character2 = next()) {
333
+ // (
334
+ case 40:
335
+ if (previous != 108 && charat(characters2, length2 - 1) == 58) {
336
+ if (indexof(characters2 += replace(delimit(character2), "&", "&\f"), "&\f") != -1)
337
+ ampersand = -1;
338
+ break;
339
+ }
340
+ // " ' [
341
+ case 34:
342
+ case 39:
343
+ case 91:
344
+ characters2 += delimit(character2);
345
+ break;
346
+ // \t \n \r \s
347
+ case 9:
348
+ case 10:
349
+ case 13:
350
+ case 32:
351
+ characters2 += whitespace(previous);
352
+ break;
353
+ // \
354
+ case 92:
355
+ characters2 += escaping(caret() - 1, 7);
356
+ continue;
357
+ // /
358
+ case 47:
359
+ switch (peek()) {
360
+ case 42:
361
+ case 47:
362
+ append(comment(commenter(next(), caret()), root, parent), declarations);
363
+ break;
364
+ default:
365
+ characters2 += "/";
366
+ }
367
+ break;
368
+ // {
369
+ case 123 * variable:
370
+ points[index++] = strlen(characters2) * ampersand;
371
+ // } ; \0
372
+ case 125 * variable:
373
+ case 59:
374
+ case 0:
375
+ switch (character2) {
376
+ // \0 }
377
+ case 0:
378
+ case 125:
379
+ scanning = 0;
380
+ // ;
381
+ case 59 + offset:
382
+ if (ampersand == -1) characters2 = replace(characters2, /\f/g, "");
383
+ if (property > 0 && strlen(characters2) - length2)
384
+ append(property > 32 ? declaration(characters2 + ";", rule, parent, length2 - 1) : declaration(replace(characters2, " ", "") + ";", rule, parent, length2 - 2), declarations);
385
+ break;
386
+ // @ ;
387
+ case 59:
388
+ characters2 += ";";
389
+ // { rule/at-rule
390
+ default:
391
+ append(reference = ruleset(characters2, root, parent, index, offset, rules, points, type, props = [], children = [], length2), rulesets);
392
+ if (character2 === 123)
393
+ if (offset === 0)
394
+ parse(characters2, root, reference, reference, props, rulesets, length2, points, children);
395
+ else
396
+ switch (atrule === 99 && charat(characters2, 3) === 110 ? 100 : atrule) {
397
+ // d l m s
398
+ case 100:
399
+ case 108:
400
+ case 109:
401
+ case 115:
402
+ parse(value, reference, reference, rule && append(ruleset(value, reference, reference, 0, 0, rules, points, type, rules, props = [], length2), children), rules, children, length2, points, rule ? props : children);
403
+ break;
404
+ default:
405
+ parse(characters2, reference, reference, reference, [""], children, 0, points, children);
406
+ }
407
+ }
408
+ index = offset = property = 0, variable = ampersand = 1, type = characters2 = "", length2 = pseudo;
409
+ break;
410
+ // :
411
+ case 58:
412
+ length2 = 1 + strlen(characters2), property = previous;
413
+ default:
414
+ if (variable < 1) {
415
+ if (character2 == 123)
416
+ --variable;
417
+ else if (character2 == 125 && variable++ == 0 && prev() == 125)
418
+ continue;
419
+ }
420
+ switch (characters2 += from(character2), character2 * variable) {
421
+ // &
422
+ case 38:
423
+ ampersand = offset > 0 ? 1 : (characters2 += "\f", -1);
424
+ break;
425
+ // ,
426
+ case 44:
427
+ points[index++] = (strlen(characters2) - 1) * ampersand, ampersand = 1;
428
+ break;
429
+ // @
430
+ case 64:
431
+ if (peek() === 45)
432
+ characters2 += delimit(next());
433
+ atrule = peek(), offset = length2 = strlen(type = characters2 += identifier(caret())), character2++;
434
+ break;
435
+ // -
436
+ case 45:
437
+ if (previous === 45 && strlen(characters2) == 2)
438
+ variable = 0;
439
+ }
440
+ }
441
+ return rulesets;
442
+ }
443
+ function ruleset(value, root, parent, index, offset, rules, points, type, props, children, length2) {
444
+ var post = offset - 1;
445
+ var rule = offset === 0 ? rules : [""];
446
+ var size = sizeof(rule);
447
+ for (var i = 0, j = 0, k = 0; i < index; ++i)
448
+ for (var x = 0, y = substr(value, post + 1, post = abs(j = points[i])), z = value; x < size; ++x)
449
+ if (z = trim(j > 0 ? rule[x] + " " + y : replace(y, /&\f/g, rule[x])))
450
+ props[k++] = z;
451
+ return node(value, root, parent, offset === 0 ? RULESET : type, props, children, length2);
452
+ }
453
+ function comment(value, root, parent) {
454
+ return node(value, root, parent, COMMENT, from(char()), substr(value, 2, -2), 0);
455
+ }
456
+ function declaration(value, root, parent, length2) {
457
+ return node(value, root, parent, DECLARATION, substr(value, 0, length2), substr(value, length2 + 1, -1), length2);
458
+ }
459
+
460
+ // ../../node_modules/stylis/src/Serializer.js
461
+ function serialize(children, callback) {
462
+ var output = "";
463
+ var length2 = sizeof(children);
464
+ for (var i = 0; i < length2; i++)
465
+ output += callback(children[i], i, children, callback) || "";
466
+ return output;
467
+ }
468
+ function stringify(element, index, children, callback) {
469
+ switch (element.type) {
470
+ case LAYER:
471
+ if (element.children.length) break;
472
+ case IMPORT:
473
+ case DECLARATION:
474
+ return element.return = element.return || element.value;
475
+ case COMMENT:
476
+ return "";
477
+ case KEYFRAMES:
478
+ return element.return = element.value + "{" + serialize(element.children, callback) + "}";
479
+ case RULESET:
480
+ element.value = element.props.join(",");
481
+ }
482
+ return strlen(children = serialize(element.children, callback)) ? element.return = element.value + "{" + children + "}" : "";
483
+ }
484
+
485
+ // ../../node_modules/stylis/src/Middleware.js
486
+ function middleware(collection) {
487
+ var length2 = sizeof(collection);
488
+ return function(element, index, children, callback) {
489
+ var output = "";
490
+ for (var i = 0; i < length2; i++)
491
+ output += collection[i](element, index, children, callback) || "";
492
+ return output;
493
+ };
494
+ }
495
+ function rulesheet(callback) {
496
+ return function(element) {
497
+ if (!element.root) {
498
+ if (element = element.return)
499
+ callback(element);
500
+ }
501
+ };
502
+ }
503
+
504
+ // ../../node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.esm.js
505
+ var weakMemoize = function weakMemoize2(func) {
506
+ var cache = /* @__PURE__ */ new WeakMap();
507
+ return function(arg) {
508
+ if (cache.has(arg)) {
509
+ return cache.get(arg);
510
+ }
511
+ var ret = func(arg);
512
+ cache.set(arg, ret);
513
+ return ret;
514
+ };
515
+ };
516
+
517
+ // ../../node_modules/@emotion/memoize/dist/emotion-memoize.esm.js
518
+ function memoize(fn) {
519
+ var cache = /* @__PURE__ */ Object.create(null);
520
+ return function(arg) {
521
+ if (cache[arg] === void 0) cache[arg] = fn(arg);
522
+ return cache[arg];
523
+ };
524
+ }
525
+
526
+ // ../../node_modules/@emotion/cache/dist/emotion-cache.esm.js
527
+ var isBrowser = typeof document !== "undefined";
528
+ var identifierWithPointTracking = function identifierWithPointTracking2(begin, points, index) {
529
+ var previous = 0;
530
+ var character2 = 0;
531
+ while (true) {
532
+ previous = character2;
533
+ character2 = peek();
534
+ if (previous === 38 && character2 === 12) {
535
+ points[index] = 1;
536
+ }
537
+ if (token(character2)) {
538
+ break;
539
+ }
540
+ next();
541
+ }
542
+ return slice(begin, position);
543
+ };
544
+ var toRules = function toRules2(parsed, points) {
545
+ var index = -1;
546
+ var character2 = 44;
547
+ do {
548
+ switch (token(character2)) {
549
+ case 0:
550
+ if (character2 === 38 && peek() === 12) {
551
+ points[index] = 1;
552
+ }
553
+ parsed[index] += identifierWithPointTracking(position - 1, points, index);
554
+ break;
555
+ case 2:
556
+ parsed[index] += delimit(character2);
557
+ break;
558
+ case 4:
559
+ if (character2 === 44) {
560
+ parsed[++index] = peek() === 58 ? "&\f" : "";
561
+ points[index] = parsed[index].length;
562
+ break;
563
+ }
564
+ // fallthrough
565
+ default:
566
+ parsed[index] += from(character2);
567
+ }
568
+ } while (character2 = next());
569
+ return parsed;
570
+ };
571
+ var getRules = function getRules2(value, points) {
572
+ return dealloc(toRules(alloc(value), points));
573
+ };
574
+ var fixedElements = /* @__PURE__ */ new WeakMap();
575
+ var compat = function compat2(element) {
576
+ if (element.type !== "rule" || !element.parent || // positive .length indicates that this rule contains pseudo
577
+ // negative .length indicates that this rule has been already prefixed
578
+ element.length < 1) {
579
+ return;
580
+ }
581
+ var value = element.value;
582
+ var parent = element.parent;
583
+ var isImplicitRule = element.column === parent.column && element.line === parent.line;
584
+ while (parent.type !== "rule") {
585
+ parent = parent.parent;
586
+ if (!parent) return;
587
+ }
588
+ if (element.props.length === 1 && value.charCodeAt(0) !== 58 && !fixedElements.get(parent)) {
589
+ return;
590
+ }
591
+ if (isImplicitRule) {
592
+ return;
593
+ }
594
+ fixedElements.set(element, true);
595
+ var points = [];
596
+ var rules = getRules(value, points);
597
+ var parentRules = parent.props;
598
+ for (var i = 0, k = 0; i < rules.length; i++) {
599
+ for (var j = 0; j < parentRules.length; j++, k++) {
600
+ element.props[k] = points[i] ? rules[i].replace(/&\f/g, parentRules[j]) : parentRules[j] + " " + rules[i];
601
+ }
602
+ }
603
+ };
604
+ var removeLabel = function removeLabel2(element) {
605
+ if (element.type === "decl") {
606
+ var value = element.value;
607
+ if (
608
+ // charcode for l
609
+ value.charCodeAt(0) === 108 && // charcode for b
610
+ value.charCodeAt(2) === 98
611
+ ) {
612
+ element["return"] = "";
613
+ element.value = "";
614
+ }
615
+ }
616
+ };
617
+ function prefix(value, length2) {
618
+ switch (hash(value, length2)) {
619
+ // color-adjust
620
+ case 5103:
621
+ return WEBKIT + "print-" + value + value;
622
+ // animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function)
623
+ case 5737:
624
+ case 4201:
625
+ case 3177:
626
+ case 3433:
627
+ case 1641:
628
+ case 4457:
629
+ case 2921:
630
+ // text-decoration, filter, clip-path, backface-visibility, column, box-decoration-break
631
+ case 5572:
632
+ case 6356:
633
+ case 5844:
634
+ case 3191:
635
+ case 6645:
636
+ case 3005:
637
+ // mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite,
638
+ case 6391:
639
+ case 5879:
640
+ case 5623:
641
+ case 6135:
642
+ case 4599:
643
+ case 4855:
644
+ // background-clip, columns, column-(count|fill|gap|rule|rule-color|rule-style|rule-width|span|width)
645
+ case 4215:
646
+ case 6389:
647
+ case 5109:
648
+ case 5365:
649
+ case 5621:
650
+ case 3829:
651
+ return WEBKIT + value + value;
652
+ // appearance, user-select, transform, hyphens, text-size-adjust
653
+ case 5349:
654
+ case 4246:
655
+ case 4810:
656
+ case 6968:
657
+ case 2756:
658
+ return WEBKIT + value + MOZ + value + MS + value + value;
659
+ // flex, flex-direction
660
+ case 6828:
661
+ case 4268:
662
+ return WEBKIT + value + MS + value + value;
663
+ // order
664
+ case 6165:
665
+ return WEBKIT + value + MS + "flex-" + value + value;
666
+ // align-items
667
+ case 5187:
668
+ return WEBKIT + value + replace(value, /(\w+).+(:[^]+)/, WEBKIT + "box-$1$2" + MS + "flex-$1$2") + value;
669
+ // align-self
670
+ case 5443:
671
+ return WEBKIT + value + MS + "flex-item-" + replace(value, /flex-|-self/, "") + value;
672
+ // align-content
673
+ case 4675:
674
+ return WEBKIT + value + MS + "flex-line-pack" + replace(value, /align-content|flex-|-self/, "") + value;
675
+ // flex-shrink
676
+ case 5548:
677
+ return WEBKIT + value + MS + replace(value, "shrink", "negative") + value;
678
+ // flex-basis
679
+ case 5292:
680
+ return WEBKIT + value + MS + replace(value, "basis", "preferred-size") + value;
681
+ // flex-grow
682
+ case 6060:
683
+ return WEBKIT + "box-" + replace(value, "-grow", "") + WEBKIT + value + MS + replace(value, "grow", "positive") + value;
684
+ // transition
685
+ case 4554:
686
+ return WEBKIT + replace(value, /([^-])(transform)/g, "$1" + WEBKIT + "$2") + value;
687
+ // cursor
688
+ case 6187:
689
+ return replace(replace(replace(value, /(zoom-|grab)/, WEBKIT + "$1"), /(image-set)/, WEBKIT + "$1"), value, "") + value;
690
+ // background, background-image
691
+ case 5495:
692
+ case 3959:
693
+ return replace(value, /(image-set\([^]*)/, WEBKIT + "$1$`$1");
694
+ // justify-content
695
+ case 4968:
696
+ return replace(replace(value, /(.+:)(flex-)?(.*)/, WEBKIT + "box-pack:$3" + MS + "flex-pack:$3"), /s.+-b[^;]+/, "justify") + WEBKIT + value + value;
697
+ // (margin|padding)-inline-(start|end)
698
+ case 4095:
699
+ case 3583:
700
+ case 4068:
701
+ case 2532:
702
+ return replace(value, /(.+)-inline(.+)/, WEBKIT + "$1$2") + value;
703
+ // (min|max)?(width|height|inline-size|block-size)
704
+ case 8116:
705
+ case 7059:
706
+ case 5753:
707
+ case 5535:
708
+ case 5445:
709
+ case 5701:
710
+ case 4933:
711
+ case 4677:
712
+ case 5533:
713
+ case 5789:
714
+ case 5021:
715
+ case 4765:
716
+ if (strlen(value) - 1 - length2 > 6) switch (charat(value, length2 + 1)) {
717
+ // (m)ax-content, (m)in-content
718
+ case 109:
719
+ if (charat(value, length2 + 4) !== 45) break;
720
+ // (f)ill-available, (f)it-content
721
+ case 102:
722
+ return replace(value, /(.+:)(.+)-([^]+)/, "$1" + WEBKIT + "$2-$3$1" + MOZ + (charat(value, length2 + 3) == 108 ? "$3" : "$2-$3")) + value;
723
+ // (s)tretch
724
+ case 115:
725
+ return ~indexof(value, "stretch") ? prefix(replace(value, "stretch", "fill-available"), length2) + value : value;
726
+ }
727
+ break;
728
+ // position: sticky
729
+ case 4949:
730
+ if (charat(value, length2 + 1) !== 115) break;
731
+ // display: (flex|inline-flex)
732
+ case 6444:
733
+ switch (charat(value, strlen(value) - 3 - (~indexof(value, "!important") && 10))) {
734
+ // stic(k)y
735
+ case 107:
736
+ return replace(value, ":", ":" + WEBKIT) + value;
737
+ // (inline-)?fl(e)x
738
+ case 101:
739
+ return replace(value, /(.+:)([^;!]+)(;|!.+)?/, "$1" + WEBKIT + (charat(value, 14) === 45 ? "inline-" : "") + "box$3$1" + WEBKIT + "$2$3$1" + MS + "$2box$3") + value;
740
+ }
741
+ break;
742
+ // writing-mode
743
+ case 5936:
744
+ switch (charat(value, length2 + 11)) {
745
+ // vertical-l(r)
746
+ case 114:
747
+ return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, "tb") + value;
748
+ // vertical-r(l)
749
+ case 108:
750
+ return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, "tb-rl") + value;
751
+ // horizontal(-)tb
752
+ case 45:
753
+ return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, "lr") + value;
754
+ }
755
+ return WEBKIT + value + MS + value + value;
756
+ }
757
+ return value;
758
+ }
759
+ var prefixer = function prefixer2(element, index, children, callback) {
760
+ if (element.length > -1) {
761
+ if (!element["return"]) switch (element.type) {
762
+ case DECLARATION:
763
+ element["return"] = prefix(element.value, element.length);
764
+ break;
765
+ case KEYFRAMES:
766
+ return serialize([copy(element, {
767
+ value: replace(element.value, "@", "@" + WEBKIT)
768
+ })], callback);
769
+ case RULESET:
770
+ if (element.length) return combine(element.props, function(value) {
771
+ switch (match(value, /(::plac\w+|:read-\w+)/)) {
772
+ // :read-(only|write)
773
+ case ":read-only":
774
+ case ":read-write":
775
+ return serialize([copy(element, {
776
+ props: [replace(value, /:(read-\w+)/, ":" + MOZ + "$1")]
777
+ })], callback);
778
+ // :placeholder
779
+ case "::placeholder":
780
+ return serialize([copy(element, {
781
+ props: [replace(value, /:(plac\w+)/, ":" + WEBKIT + "input-$1")]
782
+ }), copy(element, {
783
+ props: [replace(value, /:(plac\w+)/, ":" + MOZ + "$1")]
784
+ }), copy(element, {
785
+ props: [replace(value, /:(plac\w+)/, MS + "input-$1")]
786
+ })], callback);
787
+ }
788
+ return "";
789
+ });
790
+ }
791
+ }
792
+ };
793
+ var getServerStylisCache = isBrowser ? void 0 : weakMemoize(function() {
794
+ return memoize(function() {
795
+ return {};
796
+ });
797
+ });
798
+ var defaultStylisPlugins = [prefixer];
799
+ var createCache = function createCache2(options) {
800
+ var key = options.key;
801
+ if (isBrowser && key === "css") {
802
+ var ssrStyles = document.querySelectorAll("style[data-emotion]:not([data-s])");
803
+ Array.prototype.forEach.call(ssrStyles, function(node2) {
804
+ var dataEmotionAttribute = node2.getAttribute("data-emotion");
805
+ if (dataEmotionAttribute.indexOf(" ") === -1) {
806
+ return;
807
+ }
808
+ document.head.appendChild(node2);
809
+ node2.setAttribute("data-s", "");
810
+ });
811
+ }
812
+ var stylisPlugins = options.stylisPlugins || defaultStylisPlugins;
813
+ var inserted = {};
814
+ var container;
815
+ var nodesToHydrate = [];
816
+ if (isBrowser) {
817
+ container = options.container || document.head;
818
+ Array.prototype.forEach.call(
819
+ // this means we will ignore elements which don't have a space in them which
820
+ // means that the style elements we're looking at are only Emotion 11 server-rendered style elements
821
+ document.querySelectorAll('style[data-emotion^="' + key + ' "]'),
822
+ function(node2) {
823
+ var attrib = node2.getAttribute("data-emotion").split(" ");
824
+ for (var i = 1; i < attrib.length; i++) {
825
+ inserted[attrib[i]] = true;
826
+ }
827
+ nodesToHydrate.push(node2);
828
+ }
829
+ );
830
+ }
831
+ var _insert;
832
+ var omnipresentPlugins = [compat, removeLabel];
833
+ if (!getServerStylisCache) {
834
+ var currentSheet;
835
+ var finalizingPlugins = [stringify, rulesheet(function(rule) {
836
+ currentSheet.insert(rule);
837
+ })];
838
+ var serializer = middleware(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins));
839
+ var stylis = function stylis2(styles) {
840
+ return serialize(compile(styles), serializer);
841
+ };
842
+ _insert = function insert(selector, serialized, sheet, shouldCache) {
843
+ currentSheet = sheet;
844
+ stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles);
845
+ if (shouldCache) {
846
+ cache.inserted[serialized.name] = true;
847
+ }
848
+ };
849
+ } else {
850
+ var _finalizingPlugins = [stringify];
851
+ var _serializer = middleware(omnipresentPlugins.concat(stylisPlugins, _finalizingPlugins));
852
+ var _stylis = function _stylis2(styles) {
853
+ return serialize(compile(styles), _serializer);
854
+ };
855
+ var serverStylisCache = getServerStylisCache(stylisPlugins)(key);
856
+ var getRules3 = function getRules4(selector, serialized) {
857
+ var name = serialized.name;
858
+ if (serverStylisCache[name] === void 0) {
859
+ serverStylisCache[name] = _stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles);
860
+ }
861
+ return serverStylisCache[name];
862
+ };
863
+ _insert = function _insert2(selector, serialized, sheet, shouldCache) {
864
+ var name = serialized.name;
865
+ var rules = getRules3(selector, serialized);
866
+ if (cache.compat === void 0) {
867
+ if (shouldCache) {
868
+ cache.inserted[name] = true;
869
+ }
870
+ return rules;
871
+ } else {
872
+ if (shouldCache) {
873
+ cache.inserted[name] = rules;
874
+ } else {
875
+ return rules;
876
+ }
877
+ }
878
+ };
879
+ }
880
+ var cache = {
881
+ key,
882
+ sheet: new StyleSheet({
883
+ key,
884
+ container,
885
+ nonce: options.nonce,
886
+ speedy: options.speedy,
887
+ prepend: options.prepend,
888
+ insertionPoint: options.insertionPoint
889
+ }),
890
+ nonce: options.nonce,
891
+ inserted,
892
+ registered: {},
893
+ insert: _insert
894
+ };
895
+ cache.sheet.hydrate(nodesToHydrate);
896
+ return cache;
897
+ };
898
+
899
+ // index.tsx
900
+ var import_react3 = require("@emotion/react");
901
+ var import_jsx_runtime = require("react/jsx-runtime");
902
+ var createEmotionCachePlugin = (key) => {
903
+ return {
904
+ overrides: {
905
+ iframe: ({ children, document: document2 }) => {
906
+ const [cache, setCache] = (0, import_react2.useState)(null);
907
+ (0, import_react2.useEffect)(() => {
908
+ setTimeout(() => {
909
+ if (document2) {
910
+ setCache(
911
+ createCache({
912
+ key,
913
+ container: document2.head
914
+ })
915
+ );
916
+ }
917
+ }, 0);
918
+ }, [document2, key]);
919
+ if (cache) {
920
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react3.CacheProvider, { value: cache, children });
921
+ }
922
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children });
923
+ }
924
+ }
925
+ };
926
+ };
927
+ var index_default = createEmotionCachePlugin;