@nodeblocks/frontend-how-to-use-block 0.1.0 → 0.1.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 +1458 -14
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +1459 -15
- package/dist/index.esm.js.map +1 -1
- package/package.json +3 -1
package/dist/index.cjs.js
CHANGED
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
4
|
var React = require('react');
|
|
5
|
-
var emStyled = require('@emotion/styled');
|
|
6
|
-
require('@emotion/react');
|
|
7
5
|
|
|
8
6
|
function _interopNamespaceDefault(e) {
|
|
9
7
|
var n = Object.create(null);
|
|
@@ -2709,6 +2707,1235 @@ function unstable_createStyleFunctionSx() {
|
|
|
2709
2707
|
const styleFunctionSx = unstable_createStyleFunctionSx();
|
|
2710
2708
|
styleFunctionSx.filterProps = ['sx'];
|
|
2711
2709
|
|
|
2710
|
+
function _extends() {
|
|
2711
|
+
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
2712
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
2713
|
+
var t = arguments[e];
|
|
2714
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
2715
|
+
}
|
|
2716
|
+
return n;
|
|
2717
|
+
}, _extends.apply(null, arguments);
|
|
2718
|
+
}
|
|
2719
|
+
|
|
2720
|
+
/*
|
|
2721
|
+
|
|
2722
|
+
Based off glamor's StyleSheet, thanks Sunil ❤️
|
|
2723
|
+
|
|
2724
|
+
high performance StyleSheet for css-in-js systems
|
|
2725
|
+
|
|
2726
|
+
- uses multiple style tags behind the scenes for millions of rules
|
|
2727
|
+
- uses `insertRule` for appending in production for *much* faster performance
|
|
2728
|
+
|
|
2729
|
+
// usage
|
|
2730
|
+
|
|
2731
|
+
import { StyleSheet } from '@emotion/sheet'
|
|
2732
|
+
|
|
2733
|
+
let styleSheet = new StyleSheet({ key: '', container: document.head })
|
|
2734
|
+
|
|
2735
|
+
styleSheet.insert('#box { border: 1px solid red; }')
|
|
2736
|
+
- appends a css rule into the stylesheet
|
|
2737
|
+
|
|
2738
|
+
styleSheet.flush()
|
|
2739
|
+
- empties the stylesheet of all its contents
|
|
2740
|
+
|
|
2741
|
+
*/
|
|
2742
|
+
|
|
2743
|
+
function sheetForTag(tag) {
|
|
2744
|
+
if (tag.sheet) {
|
|
2745
|
+
return tag.sheet;
|
|
2746
|
+
} // this weirdness brought to you by firefox
|
|
2747
|
+
|
|
2748
|
+
/* istanbul ignore next */
|
|
2749
|
+
|
|
2750
|
+
|
|
2751
|
+
for (var i = 0; i < document.styleSheets.length; i++) {
|
|
2752
|
+
if (document.styleSheets[i].ownerNode === tag) {
|
|
2753
|
+
return document.styleSheets[i];
|
|
2754
|
+
}
|
|
2755
|
+
} // this function should always return with a value
|
|
2756
|
+
// TS can't understand it though so we make it stop complaining here
|
|
2757
|
+
|
|
2758
|
+
|
|
2759
|
+
return undefined;
|
|
2760
|
+
}
|
|
2761
|
+
|
|
2762
|
+
function createStyleElement(options) {
|
|
2763
|
+
var tag = document.createElement('style');
|
|
2764
|
+
tag.setAttribute('data-emotion', options.key);
|
|
2765
|
+
|
|
2766
|
+
if (options.nonce !== undefined) {
|
|
2767
|
+
tag.setAttribute('nonce', options.nonce);
|
|
2768
|
+
}
|
|
2769
|
+
|
|
2770
|
+
tag.appendChild(document.createTextNode(''));
|
|
2771
|
+
tag.setAttribute('data-s', '');
|
|
2772
|
+
return tag;
|
|
2773
|
+
}
|
|
2774
|
+
|
|
2775
|
+
var StyleSheet = /*#__PURE__*/function () {
|
|
2776
|
+
// Using Node instead of HTMLElement since container may be a ShadowRoot
|
|
2777
|
+
function StyleSheet(options) {
|
|
2778
|
+
var _this = this;
|
|
2779
|
+
|
|
2780
|
+
this._insertTag = function (tag) {
|
|
2781
|
+
var before;
|
|
2782
|
+
|
|
2783
|
+
if (_this.tags.length === 0) {
|
|
2784
|
+
if (_this.insertionPoint) {
|
|
2785
|
+
before = _this.insertionPoint.nextSibling;
|
|
2786
|
+
} else if (_this.prepend) {
|
|
2787
|
+
before = _this.container.firstChild;
|
|
2788
|
+
} else {
|
|
2789
|
+
before = _this.before;
|
|
2790
|
+
}
|
|
2791
|
+
} else {
|
|
2792
|
+
before = _this.tags[_this.tags.length - 1].nextSibling;
|
|
2793
|
+
}
|
|
2794
|
+
|
|
2795
|
+
_this.container.insertBefore(tag, before);
|
|
2796
|
+
|
|
2797
|
+
_this.tags.push(tag);
|
|
2798
|
+
};
|
|
2799
|
+
|
|
2800
|
+
this.isSpeedy = options.speedy === undefined ? true : options.speedy;
|
|
2801
|
+
this.tags = [];
|
|
2802
|
+
this.ctr = 0;
|
|
2803
|
+
this.nonce = options.nonce; // key is the value of the data-emotion attribute, it's used to identify different sheets
|
|
2804
|
+
|
|
2805
|
+
this.key = options.key;
|
|
2806
|
+
this.container = options.container;
|
|
2807
|
+
this.prepend = options.prepend;
|
|
2808
|
+
this.insertionPoint = options.insertionPoint;
|
|
2809
|
+
this.before = null;
|
|
2810
|
+
}
|
|
2811
|
+
|
|
2812
|
+
var _proto = StyleSheet.prototype;
|
|
2813
|
+
|
|
2814
|
+
_proto.hydrate = function hydrate(nodes) {
|
|
2815
|
+
nodes.forEach(this._insertTag);
|
|
2816
|
+
};
|
|
2817
|
+
|
|
2818
|
+
_proto.insert = function insert(rule) {
|
|
2819
|
+
// the max length is how many rules we have per style tag, it's 65000 in speedy mode
|
|
2820
|
+
// it's 1 in dev because we insert source maps that map a single rule to a location
|
|
2821
|
+
// and you can only have one source map per style tag
|
|
2822
|
+
if (this.ctr % (this.isSpeedy ? 65000 : 1) === 0) {
|
|
2823
|
+
this._insertTag(createStyleElement(this));
|
|
2824
|
+
}
|
|
2825
|
+
|
|
2826
|
+
var tag = this.tags[this.tags.length - 1];
|
|
2827
|
+
|
|
2828
|
+
if (this.isSpeedy) {
|
|
2829
|
+
var sheet = sheetForTag(tag);
|
|
2830
|
+
|
|
2831
|
+
try {
|
|
2832
|
+
// this is the ultrafast version, works across browsers
|
|
2833
|
+
// the big drawback is that the css won't be editable in devtools
|
|
2834
|
+
sheet.insertRule(rule, sheet.cssRules.length);
|
|
2835
|
+
} catch (e) {
|
|
2836
|
+
}
|
|
2837
|
+
} else {
|
|
2838
|
+
tag.appendChild(document.createTextNode(rule));
|
|
2839
|
+
}
|
|
2840
|
+
|
|
2841
|
+
this.ctr++;
|
|
2842
|
+
};
|
|
2843
|
+
|
|
2844
|
+
_proto.flush = function flush() {
|
|
2845
|
+
this.tags.forEach(function (tag) {
|
|
2846
|
+
var _tag$parentNode;
|
|
2847
|
+
|
|
2848
|
+
return (_tag$parentNode = tag.parentNode) == null ? void 0 : _tag$parentNode.removeChild(tag);
|
|
2849
|
+
});
|
|
2850
|
+
this.tags = [];
|
|
2851
|
+
this.ctr = 0;
|
|
2852
|
+
};
|
|
2853
|
+
|
|
2854
|
+
return StyleSheet;
|
|
2855
|
+
}();
|
|
2856
|
+
|
|
2857
|
+
var MS = '-ms-';
|
|
2858
|
+
var MOZ = '-moz-';
|
|
2859
|
+
var WEBKIT = '-webkit-';
|
|
2860
|
+
|
|
2861
|
+
var COMMENT = 'comm';
|
|
2862
|
+
var RULESET = 'rule';
|
|
2863
|
+
var DECLARATION = 'decl';
|
|
2864
|
+
var IMPORT = '@import';
|
|
2865
|
+
var KEYFRAMES = '@keyframes';
|
|
2866
|
+
var LAYER = '@layer';
|
|
2867
|
+
|
|
2868
|
+
/**
|
|
2869
|
+
* @param {number}
|
|
2870
|
+
* @return {number}
|
|
2871
|
+
*/
|
|
2872
|
+
var abs = Math.abs;
|
|
2873
|
+
|
|
2874
|
+
/**
|
|
2875
|
+
* @param {number}
|
|
2876
|
+
* @return {string}
|
|
2877
|
+
*/
|
|
2878
|
+
var from = String.fromCharCode;
|
|
2879
|
+
|
|
2880
|
+
/**
|
|
2881
|
+
* @param {object}
|
|
2882
|
+
* @return {object}
|
|
2883
|
+
*/
|
|
2884
|
+
var assign = Object.assign;
|
|
2885
|
+
|
|
2886
|
+
/**
|
|
2887
|
+
* @param {string} value
|
|
2888
|
+
* @param {number} length
|
|
2889
|
+
* @return {number}
|
|
2890
|
+
*/
|
|
2891
|
+
function hash (value, length) {
|
|
2892
|
+
return charat(value, 0) ^ 45 ? (((((((length << 2) ^ charat(value, 0)) << 2) ^ charat(value, 1)) << 2) ^ charat(value, 2)) << 2) ^ charat(value, 3) : 0
|
|
2893
|
+
}
|
|
2894
|
+
|
|
2895
|
+
/**
|
|
2896
|
+
* @param {string} value
|
|
2897
|
+
* @return {string}
|
|
2898
|
+
*/
|
|
2899
|
+
function trim (value) {
|
|
2900
|
+
return value.trim()
|
|
2901
|
+
}
|
|
2902
|
+
|
|
2903
|
+
/**
|
|
2904
|
+
* @param {string} value
|
|
2905
|
+
* @param {RegExp} pattern
|
|
2906
|
+
* @return {string?}
|
|
2907
|
+
*/
|
|
2908
|
+
function match (value, pattern) {
|
|
2909
|
+
return (value = pattern.exec(value)) ? value[0] : value
|
|
2910
|
+
}
|
|
2911
|
+
|
|
2912
|
+
/**
|
|
2913
|
+
* @param {string} value
|
|
2914
|
+
* @param {(string|RegExp)} pattern
|
|
2915
|
+
* @param {string} replacement
|
|
2916
|
+
* @return {string}
|
|
2917
|
+
*/
|
|
2918
|
+
function replace (value, pattern, replacement) {
|
|
2919
|
+
return value.replace(pattern, replacement)
|
|
2920
|
+
}
|
|
2921
|
+
|
|
2922
|
+
/**
|
|
2923
|
+
* @param {string} value
|
|
2924
|
+
* @param {string} search
|
|
2925
|
+
* @return {number}
|
|
2926
|
+
*/
|
|
2927
|
+
function indexof (value, search) {
|
|
2928
|
+
return value.indexOf(search)
|
|
2929
|
+
}
|
|
2930
|
+
|
|
2931
|
+
/**
|
|
2932
|
+
* @param {string} value
|
|
2933
|
+
* @param {number} index
|
|
2934
|
+
* @return {number}
|
|
2935
|
+
*/
|
|
2936
|
+
function charat (value, index) {
|
|
2937
|
+
return value.charCodeAt(index) | 0
|
|
2938
|
+
}
|
|
2939
|
+
|
|
2940
|
+
/**
|
|
2941
|
+
* @param {string} value
|
|
2942
|
+
* @param {number} begin
|
|
2943
|
+
* @param {number} end
|
|
2944
|
+
* @return {string}
|
|
2945
|
+
*/
|
|
2946
|
+
function substr (value, begin, end) {
|
|
2947
|
+
return value.slice(begin, end)
|
|
2948
|
+
}
|
|
2949
|
+
|
|
2950
|
+
/**
|
|
2951
|
+
* @param {string} value
|
|
2952
|
+
* @return {number}
|
|
2953
|
+
*/
|
|
2954
|
+
function strlen (value) {
|
|
2955
|
+
return value.length
|
|
2956
|
+
}
|
|
2957
|
+
|
|
2958
|
+
/**
|
|
2959
|
+
* @param {any[]} value
|
|
2960
|
+
* @return {number}
|
|
2961
|
+
*/
|
|
2962
|
+
function sizeof (value) {
|
|
2963
|
+
return value.length
|
|
2964
|
+
}
|
|
2965
|
+
|
|
2966
|
+
/**
|
|
2967
|
+
* @param {any} value
|
|
2968
|
+
* @param {any[]} array
|
|
2969
|
+
* @return {any}
|
|
2970
|
+
*/
|
|
2971
|
+
function append (value, array) {
|
|
2972
|
+
return array.push(value), value
|
|
2973
|
+
}
|
|
2974
|
+
|
|
2975
|
+
/**
|
|
2976
|
+
* @param {string[]} array
|
|
2977
|
+
* @param {function} callback
|
|
2978
|
+
* @return {string}
|
|
2979
|
+
*/
|
|
2980
|
+
function combine (array, callback) {
|
|
2981
|
+
return array.map(callback).join('')
|
|
2982
|
+
}
|
|
2983
|
+
|
|
2984
|
+
var line = 1;
|
|
2985
|
+
var column = 1;
|
|
2986
|
+
var length = 0;
|
|
2987
|
+
var position = 0;
|
|
2988
|
+
var character = 0;
|
|
2989
|
+
var characters = '';
|
|
2990
|
+
|
|
2991
|
+
/**
|
|
2992
|
+
* @param {string} value
|
|
2993
|
+
* @param {object | null} root
|
|
2994
|
+
* @param {object | null} parent
|
|
2995
|
+
* @param {string} type
|
|
2996
|
+
* @param {string[] | string} props
|
|
2997
|
+
* @param {object[] | string} children
|
|
2998
|
+
* @param {number} length
|
|
2999
|
+
*/
|
|
3000
|
+
function node (value, root, parent, type, props, children, length) {
|
|
3001
|
+
return {value: value, root: root, parent: parent, type: type, props: props, children: children, line: line, column: column, length: length, return: ''}
|
|
3002
|
+
}
|
|
3003
|
+
|
|
3004
|
+
/**
|
|
3005
|
+
* @param {object} root
|
|
3006
|
+
* @param {object} props
|
|
3007
|
+
* @return {object}
|
|
3008
|
+
*/
|
|
3009
|
+
function copy (root, props) {
|
|
3010
|
+
return assign(node('', null, null, '', null, null, 0), root, {length: -root.length}, props)
|
|
3011
|
+
}
|
|
3012
|
+
|
|
3013
|
+
/**
|
|
3014
|
+
* @return {number}
|
|
3015
|
+
*/
|
|
3016
|
+
function char () {
|
|
3017
|
+
return character
|
|
3018
|
+
}
|
|
3019
|
+
|
|
3020
|
+
/**
|
|
3021
|
+
* @return {number}
|
|
3022
|
+
*/
|
|
3023
|
+
function prev () {
|
|
3024
|
+
character = position > 0 ? charat(characters, --position) : 0;
|
|
3025
|
+
|
|
3026
|
+
if (column--, character === 10)
|
|
3027
|
+
column = 1, line--;
|
|
3028
|
+
|
|
3029
|
+
return character
|
|
3030
|
+
}
|
|
3031
|
+
|
|
3032
|
+
/**
|
|
3033
|
+
* @return {number}
|
|
3034
|
+
*/
|
|
3035
|
+
function next () {
|
|
3036
|
+
character = position < length ? charat(characters, position++) : 0;
|
|
3037
|
+
|
|
3038
|
+
if (column++, character === 10)
|
|
3039
|
+
column = 1, line++;
|
|
3040
|
+
|
|
3041
|
+
return character
|
|
3042
|
+
}
|
|
3043
|
+
|
|
3044
|
+
/**
|
|
3045
|
+
* @return {number}
|
|
3046
|
+
*/
|
|
3047
|
+
function peek () {
|
|
3048
|
+
return charat(characters, position)
|
|
3049
|
+
}
|
|
3050
|
+
|
|
3051
|
+
/**
|
|
3052
|
+
* @return {number}
|
|
3053
|
+
*/
|
|
3054
|
+
function caret () {
|
|
3055
|
+
return position
|
|
3056
|
+
}
|
|
3057
|
+
|
|
3058
|
+
/**
|
|
3059
|
+
* @param {number} begin
|
|
3060
|
+
* @param {number} end
|
|
3061
|
+
* @return {string}
|
|
3062
|
+
*/
|
|
3063
|
+
function slice (begin, end) {
|
|
3064
|
+
return substr(characters, begin, end)
|
|
3065
|
+
}
|
|
3066
|
+
|
|
3067
|
+
/**
|
|
3068
|
+
* @param {number} type
|
|
3069
|
+
* @return {number}
|
|
3070
|
+
*/
|
|
3071
|
+
function token (type) {
|
|
3072
|
+
switch (type) {
|
|
3073
|
+
// \0 \t \n \r \s whitespace token
|
|
3074
|
+
case 0: case 9: case 10: case 13: case 32:
|
|
3075
|
+
return 5
|
|
3076
|
+
// ! + , / > @ ~ isolate token
|
|
3077
|
+
case 33: case 43: case 44: case 47: case 62: case 64: case 126:
|
|
3078
|
+
// ; { } breakpoint token
|
|
3079
|
+
case 59: case 123: case 125:
|
|
3080
|
+
return 4
|
|
3081
|
+
// : accompanied token
|
|
3082
|
+
case 58:
|
|
3083
|
+
return 3
|
|
3084
|
+
// " ' ( [ opening delimit token
|
|
3085
|
+
case 34: case 39: case 40: case 91:
|
|
3086
|
+
return 2
|
|
3087
|
+
// ) ] closing delimit token
|
|
3088
|
+
case 41: case 93:
|
|
3089
|
+
return 1
|
|
3090
|
+
}
|
|
3091
|
+
|
|
3092
|
+
return 0
|
|
3093
|
+
}
|
|
3094
|
+
|
|
3095
|
+
/**
|
|
3096
|
+
* @param {string} value
|
|
3097
|
+
* @return {any[]}
|
|
3098
|
+
*/
|
|
3099
|
+
function alloc (value) {
|
|
3100
|
+
return line = column = 1, length = strlen(characters = value), position = 0, []
|
|
3101
|
+
}
|
|
3102
|
+
|
|
3103
|
+
/**
|
|
3104
|
+
* @param {any} value
|
|
3105
|
+
* @return {any}
|
|
3106
|
+
*/
|
|
3107
|
+
function dealloc (value) {
|
|
3108
|
+
return characters = '', value
|
|
3109
|
+
}
|
|
3110
|
+
|
|
3111
|
+
/**
|
|
3112
|
+
* @param {number} type
|
|
3113
|
+
* @return {string}
|
|
3114
|
+
*/
|
|
3115
|
+
function delimit (type) {
|
|
3116
|
+
return trim(slice(position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type)))
|
|
3117
|
+
}
|
|
3118
|
+
|
|
3119
|
+
/**
|
|
3120
|
+
* @param {number} type
|
|
3121
|
+
* @return {string}
|
|
3122
|
+
*/
|
|
3123
|
+
function whitespace (type) {
|
|
3124
|
+
while (character = peek())
|
|
3125
|
+
if (character < 33)
|
|
3126
|
+
next();
|
|
3127
|
+
else
|
|
3128
|
+
break
|
|
3129
|
+
|
|
3130
|
+
return token(type) > 2 || token(character) > 3 ? '' : ' '
|
|
3131
|
+
}
|
|
3132
|
+
|
|
3133
|
+
/**
|
|
3134
|
+
* @param {number} index
|
|
3135
|
+
* @param {number} count
|
|
3136
|
+
* @return {string}
|
|
3137
|
+
*/
|
|
3138
|
+
function escaping (index, count) {
|
|
3139
|
+
while (--count && next())
|
|
3140
|
+
// not 0-9 A-F a-f
|
|
3141
|
+
if (character < 48 || character > 102 || (character > 57 && character < 65) || (character > 70 && character < 97))
|
|
3142
|
+
break
|
|
3143
|
+
|
|
3144
|
+
return slice(index, caret() + (count < 6 && peek() == 32 && next() == 32))
|
|
3145
|
+
}
|
|
3146
|
+
|
|
3147
|
+
/**
|
|
3148
|
+
* @param {number} type
|
|
3149
|
+
* @return {number}
|
|
3150
|
+
*/
|
|
3151
|
+
function delimiter (type) {
|
|
3152
|
+
while (next())
|
|
3153
|
+
switch (character) {
|
|
3154
|
+
// ] ) " '
|
|
3155
|
+
case type:
|
|
3156
|
+
return position
|
|
3157
|
+
// " '
|
|
3158
|
+
case 34: case 39:
|
|
3159
|
+
if (type !== 34 && type !== 39)
|
|
3160
|
+
delimiter(character);
|
|
3161
|
+
break
|
|
3162
|
+
// (
|
|
3163
|
+
case 40:
|
|
3164
|
+
if (type === 41)
|
|
3165
|
+
delimiter(type);
|
|
3166
|
+
break
|
|
3167
|
+
// \
|
|
3168
|
+
case 92:
|
|
3169
|
+
next();
|
|
3170
|
+
break
|
|
3171
|
+
}
|
|
3172
|
+
|
|
3173
|
+
return position
|
|
3174
|
+
}
|
|
3175
|
+
|
|
3176
|
+
/**
|
|
3177
|
+
* @param {number} type
|
|
3178
|
+
* @param {number} index
|
|
3179
|
+
* @return {number}
|
|
3180
|
+
*/
|
|
3181
|
+
function commenter (type, index) {
|
|
3182
|
+
while (next())
|
|
3183
|
+
// //
|
|
3184
|
+
if (type + character === 47 + 10)
|
|
3185
|
+
break
|
|
3186
|
+
// /*
|
|
3187
|
+
else if (type + character === 42 + 42 && peek() === 47)
|
|
3188
|
+
break
|
|
3189
|
+
|
|
3190
|
+
return '/*' + slice(index, position - 1) + '*' + from(type === 47 ? type : next())
|
|
3191
|
+
}
|
|
3192
|
+
|
|
3193
|
+
/**
|
|
3194
|
+
* @param {number} index
|
|
3195
|
+
* @return {string}
|
|
3196
|
+
*/
|
|
3197
|
+
function identifier (index) {
|
|
3198
|
+
while (!token(peek()))
|
|
3199
|
+
next();
|
|
3200
|
+
|
|
3201
|
+
return slice(index, position)
|
|
3202
|
+
}
|
|
3203
|
+
|
|
3204
|
+
/**
|
|
3205
|
+
* @param {string} value
|
|
3206
|
+
* @return {object[]}
|
|
3207
|
+
*/
|
|
3208
|
+
function compile (value) {
|
|
3209
|
+
return dealloc(parse('', null, null, null, [''], value = alloc(value), 0, [0], value))
|
|
3210
|
+
}
|
|
3211
|
+
|
|
3212
|
+
/**
|
|
3213
|
+
* @param {string} value
|
|
3214
|
+
* @param {object} root
|
|
3215
|
+
* @param {object?} parent
|
|
3216
|
+
* @param {string[]} rule
|
|
3217
|
+
* @param {string[]} rules
|
|
3218
|
+
* @param {string[]} rulesets
|
|
3219
|
+
* @param {number[]} pseudo
|
|
3220
|
+
* @param {number[]} points
|
|
3221
|
+
* @param {string[]} declarations
|
|
3222
|
+
* @return {object}
|
|
3223
|
+
*/
|
|
3224
|
+
function parse (value, root, parent, rule, rules, rulesets, pseudo, points, declarations) {
|
|
3225
|
+
var index = 0;
|
|
3226
|
+
var offset = 0;
|
|
3227
|
+
var length = pseudo;
|
|
3228
|
+
var atrule = 0;
|
|
3229
|
+
var property = 0;
|
|
3230
|
+
var previous = 0;
|
|
3231
|
+
var variable = 1;
|
|
3232
|
+
var scanning = 1;
|
|
3233
|
+
var ampersand = 1;
|
|
3234
|
+
var character = 0;
|
|
3235
|
+
var type = '';
|
|
3236
|
+
var props = rules;
|
|
3237
|
+
var children = rulesets;
|
|
3238
|
+
var reference = rule;
|
|
3239
|
+
var characters = type;
|
|
3240
|
+
|
|
3241
|
+
while (scanning)
|
|
3242
|
+
switch (previous = character, character = next()) {
|
|
3243
|
+
// (
|
|
3244
|
+
case 40:
|
|
3245
|
+
if (previous != 108 && charat(characters, length - 1) == 58) {
|
|
3246
|
+
if (indexof(characters += replace(delimit(character), '&', '&\f'), '&\f') != -1)
|
|
3247
|
+
ampersand = -1;
|
|
3248
|
+
break
|
|
3249
|
+
}
|
|
3250
|
+
// " ' [
|
|
3251
|
+
case 34: case 39: case 91:
|
|
3252
|
+
characters += delimit(character);
|
|
3253
|
+
break
|
|
3254
|
+
// \t \n \r \s
|
|
3255
|
+
case 9: case 10: case 13: case 32:
|
|
3256
|
+
characters += whitespace(previous);
|
|
3257
|
+
break
|
|
3258
|
+
// \
|
|
3259
|
+
case 92:
|
|
3260
|
+
characters += escaping(caret() - 1, 7);
|
|
3261
|
+
continue
|
|
3262
|
+
// /
|
|
3263
|
+
case 47:
|
|
3264
|
+
switch (peek()) {
|
|
3265
|
+
case 42: case 47:
|
|
3266
|
+
append(comment(commenter(next(), caret()), root, parent), declarations);
|
|
3267
|
+
break
|
|
3268
|
+
default:
|
|
3269
|
+
characters += '/';
|
|
3270
|
+
}
|
|
3271
|
+
break
|
|
3272
|
+
// {
|
|
3273
|
+
case 123 * variable:
|
|
3274
|
+
points[index++] = strlen(characters) * ampersand;
|
|
3275
|
+
// } ; \0
|
|
3276
|
+
case 125 * variable: case 59: case 0:
|
|
3277
|
+
switch (character) {
|
|
3278
|
+
// \0 }
|
|
3279
|
+
case 0: case 125: scanning = 0;
|
|
3280
|
+
// ;
|
|
3281
|
+
case 59 + offset: if (ampersand == -1) characters = replace(characters, /\f/g, '');
|
|
3282
|
+
if (property > 0 && (strlen(characters) - length))
|
|
3283
|
+
append(property > 32 ? declaration(characters + ';', rule, parent, length - 1) : declaration(replace(characters, ' ', '') + ';', rule, parent, length - 2), declarations);
|
|
3284
|
+
break
|
|
3285
|
+
// @ ;
|
|
3286
|
+
case 59: characters += ';';
|
|
3287
|
+
// { rule/at-rule
|
|
3288
|
+
default:
|
|
3289
|
+
append(reference = ruleset(characters, root, parent, index, offset, rules, points, type, props = [], children = [], length), rulesets);
|
|
3290
|
+
|
|
3291
|
+
if (character === 123)
|
|
3292
|
+
if (offset === 0)
|
|
3293
|
+
parse(characters, root, reference, reference, props, rulesets, length, points, children);
|
|
3294
|
+
else
|
|
3295
|
+
switch (atrule === 99 && charat(characters, 3) === 110 ? 100 : atrule) {
|
|
3296
|
+
// d l m s
|
|
3297
|
+
case 100: case 108: case 109: case 115:
|
|
3298
|
+
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);
|
|
3299
|
+
break
|
|
3300
|
+
default:
|
|
3301
|
+
parse(characters, reference, reference, reference, [''], children, 0, points, children);
|
|
3302
|
+
}
|
|
3303
|
+
}
|
|
3304
|
+
|
|
3305
|
+
index = offset = property = 0, variable = ampersand = 1, type = characters = '', length = pseudo;
|
|
3306
|
+
break
|
|
3307
|
+
// :
|
|
3308
|
+
case 58:
|
|
3309
|
+
length = 1 + strlen(characters), property = previous;
|
|
3310
|
+
default:
|
|
3311
|
+
if (variable < 1)
|
|
3312
|
+
if (character == 123)
|
|
3313
|
+
--variable;
|
|
3314
|
+
else if (character == 125 && variable++ == 0 && prev() == 125)
|
|
3315
|
+
continue
|
|
3316
|
+
|
|
3317
|
+
switch (characters += from(character), character * variable) {
|
|
3318
|
+
// &
|
|
3319
|
+
case 38:
|
|
3320
|
+
ampersand = offset > 0 ? 1 : (characters += '\f', -1);
|
|
3321
|
+
break
|
|
3322
|
+
// ,
|
|
3323
|
+
case 44:
|
|
3324
|
+
points[index++] = (strlen(characters) - 1) * ampersand, ampersand = 1;
|
|
3325
|
+
break
|
|
3326
|
+
// @
|
|
3327
|
+
case 64:
|
|
3328
|
+
// -
|
|
3329
|
+
if (peek() === 45)
|
|
3330
|
+
characters += delimit(next());
|
|
3331
|
+
|
|
3332
|
+
atrule = peek(), offset = length = strlen(type = characters += identifier(caret())), character++;
|
|
3333
|
+
break
|
|
3334
|
+
// -
|
|
3335
|
+
case 45:
|
|
3336
|
+
if (previous === 45 && strlen(characters) == 2)
|
|
3337
|
+
variable = 0;
|
|
3338
|
+
}
|
|
3339
|
+
}
|
|
3340
|
+
|
|
3341
|
+
return rulesets
|
|
3342
|
+
}
|
|
3343
|
+
|
|
3344
|
+
/**
|
|
3345
|
+
* @param {string} value
|
|
3346
|
+
* @param {object} root
|
|
3347
|
+
* @param {object?} parent
|
|
3348
|
+
* @param {number} index
|
|
3349
|
+
* @param {number} offset
|
|
3350
|
+
* @param {string[]} rules
|
|
3351
|
+
* @param {number[]} points
|
|
3352
|
+
* @param {string} type
|
|
3353
|
+
* @param {string[]} props
|
|
3354
|
+
* @param {string[]} children
|
|
3355
|
+
* @param {number} length
|
|
3356
|
+
* @return {object}
|
|
3357
|
+
*/
|
|
3358
|
+
function ruleset (value, root, parent, index, offset, rules, points, type, props, children, length) {
|
|
3359
|
+
var post = offset - 1;
|
|
3360
|
+
var rule = offset === 0 ? rules : [''];
|
|
3361
|
+
var size = sizeof(rule);
|
|
3362
|
+
|
|
3363
|
+
for (var i = 0, j = 0, k = 0; i < index; ++i)
|
|
3364
|
+
for (var x = 0, y = substr(value, post + 1, post = abs(j = points[i])), z = value; x < size; ++x)
|
|
3365
|
+
if (z = trim(j > 0 ? rule[x] + ' ' + y : replace(y, /&\f/g, rule[x])))
|
|
3366
|
+
props[k++] = z;
|
|
3367
|
+
|
|
3368
|
+
return node(value, root, parent, offset === 0 ? RULESET : type, props, children, length)
|
|
3369
|
+
}
|
|
3370
|
+
|
|
3371
|
+
/**
|
|
3372
|
+
* @param {number} value
|
|
3373
|
+
* @param {object} root
|
|
3374
|
+
* @param {object?} parent
|
|
3375
|
+
* @return {object}
|
|
3376
|
+
*/
|
|
3377
|
+
function comment (value, root, parent) {
|
|
3378
|
+
return node(value, root, parent, COMMENT, from(char()), substr(value, 2, -2), 0)
|
|
3379
|
+
}
|
|
3380
|
+
|
|
3381
|
+
/**
|
|
3382
|
+
* @param {string} value
|
|
3383
|
+
* @param {object} root
|
|
3384
|
+
* @param {object?} parent
|
|
3385
|
+
* @param {number} length
|
|
3386
|
+
* @return {object}
|
|
3387
|
+
*/
|
|
3388
|
+
function declaration (value, root, parent, length) {
|
|
3389
|
+
return node(value, root, parent, DECLARATION, substr(value, 0, length), substr(value, length + 1, -1), length)
|
|
3390
|
+
}
|
|
3391
|
+
|
|
3392
|
+
/**
|
|
3393
|
+
* @param {object[]} children
|
|
3394
|
+
* @param {function} callback
|
|
3395
|
+
* @return {string}
|
|
3396
|
+
*/
|
|
3397
|
+
function serialize (children, callback) {
|
|
3398
|
+
var output = '';
|
|
3399
|
+
var length = sizeof(children);
|
|
3400
|
+
|
|
3401
|
+
for (var i = 0; i < length; i++)
|
|
3402
|
+
output += callback(children[i], i, children, callback) || '';
|
|
3403
|
+
|
|
3404
|
+
return output
|
|
3405
|
+
}
|
|
3406
|
+
|
|
3407
|
+
/**
|
|
3408
|
+
* @param {object} element
|
|
3409
|
+
* @param {number} index
|
|
3410
|
+
* @param {object[]} children
|
|
3411
|
+
* @param {function} callback
|
|
3412
|
+
* @return {string}
|
|
3413
|
+
*/
|
|
3414
|
+
function stringify (element, index, children, callback) {
|
|
3415
|
+
switch (element.type) {
|
|
3416
|
+
case LAYER: if (element.children.length) break
|
|
3417
|
+
case IMPORT: case DECLARATION: return element.return = element.return || element.value
|
|
3418
|
+
case COMMENT: return ''
|
|
3419
|
+
case KEYFRAMES: return element.return = element.value + '{' + serialize(element.children, callback) + '}'
|
|
3420
|
+
case RULESET: element.value = element.props.join(',');
|
|
3421
|
+
}
|
|
3422
|
+
|
|
3423
|
+
return strlen(children = serialize(element.children, callback)) ? element.return = element.value + '{' + children + '}' : ''
|
|
3424
|
+
}
|
|
3425
|
+
|
|
3426
|
+
/**
|
|
3427
|
+
* @param {function[]} collection
|
|
3428
|
+
* @return {function}
|
|
3429
|
+
*/
|
|
3430
|
+
function middleware (collection) {
|
|
3431
|
+
var length = sizeof(collection);
|
|
3432
|
+
|
|
3433
|
+
return function (element, index, children, callback) {
|
|
3434
|
+
var output = '';
|
|
3435
|
+
|
|
3436
|
+
for (var i = 0; i < length; i++)
|
|
3437
|
+
output += collection[i](element, index, children, callback) || '';
|
|
3438
|
+
|
|
3439
|
+
return output
|
|
3440
|
+
}
|
|
3441
|
+
}
|
|
3442
|
+
|
|
3443
|
+
/**
|
|
3444
|
+
* @param {function} callback
|
|
3445
|
+
* @return {function}
|
|
3446
|
+
*/
|
|
3447
|
+
function rulesheet (callback) {
|
|
3448
|
+
return function (element) {
|
|
3449
|
+
if (!element.root)
|
|
3450
|
+
if (element = element.return)
|
|
3451
|
+
callback(element);
|
|
3452
|
+
}
|
|
3453
|
+
}
|
|
3454
|
+
|
|
3455
|
+
function memoize(fn) {
|
|
3456
|
+
var cache = Object.create(null);
|
|
3457
|
+
return function (arg) {
|
|
3458
|
+
if (cache[arg] === undefined) cache[arg] = fn(arg);
|
|
3459
|
+
return cache[arg];
|
|
3460
|
+
};
|
|
3461
|
+
}
|
|
3462
|
+
|
|
3463
|
+
var identifierWithPointTracking = function identifierWithPointTracking(begin, points, index) {
|
|
3464
|
+
var previous = 0;
|
|
3465
|
+
var character = 0;
|
|
3466
|
+
|
|
3467
|
+
while (true) {
|
|
3468
|
+
previous = character;
|
|
3469
|
+
character = peek(); // &\f
|
|
3470
|
+
|
|
3471
|
+
if (previous === 38 && character === 12) {
|
|
3472
|
+
points[index] = 1;
|
|
3473
|
+
}
|
|
3474
|
+
|
|
3475
|
+
if (token(character)) {
|
|
3476
|
+
break;
|
|
3477
|
+
}
|
|
3478
|
+
|
|
3479
|
+
next();
|
|
3480
|
+
}
|
|
3481
|
+
|
|
3482
|
+
return slice(begin, position);
|
|
3483
|
+
};
|
|
3484
|
+
|
|
3485
|
+
var toRules = function toRules(parsed, points) {
|
|
3486
|
+
// pretend we've started with a comma
|
|
3487
|
+
var index = -1;
|
|
3488
|
+
var character = 44;
|
|
3489
|
+
|
|
3490
|
+
do {
|
|
3491
|
+
switch (token(character)) {
|
|
3492
|
+
case 0:
|
|
3493
|
+
// &\f
|
|
3494
|
+
if (character === 38 && peek() === 12) {
|
|
3495
|
+
// this is not 100% correct, we don't account for literal sequences here - like for example quoted strings
|
|
3496
|
+
// stylis inserts \f after & to know when & where it should replace this sequence with the context selector
|
|
3497
|
+
// and when it should just concatenate the outer and inner selectors
|
|
3498
|
+
// it's very unlikely for this sequence to actually appear in a different context, so we just leverage this fact here
|
|
3499
|
+
points[index] = 1;
|
|
3500
|
+
}
|
|
3501
|
+
|
|
3502
|
+
parsed[index] += identifierWithPointTracking(position - 1, points, index);
|
|
3503
|
+
break;
|
|
3504
|
+
|
|
3505
|
+
case 2:
|
|
3506
|
+
parsed[index] += delimit(character);
|
|
3507
|
+
break;
|
|
3508
|
+
|
|
3509
|
+
case 4:
|
|
3510
|
+
// comma
|
|
3511
|
+
if (character === 44) {
|
|
3512
|
+
// colon
|
|
3513
|
+
parsed[++index] = peek() === 58 ? '&\f' : '';
|
|
3514
|
+
points[index] = parsed[index].length;
|
|
3515
|
+
break;
|
|
3516
|
+
}
|
|
3517
|
+
|
|
3518
|
+
// fallthrough
|
|
3519
|
+
|
|
3520
|
+
default:
|
|
3521
|
+
parsed[index] += from(character);
|
|
3522
|
+
}
|
|
3523
|
+
} while (character = next());
|
|
3524
|
+
|
|
3525
|
+
return parsed;
|
|
3526
|
+
};
|
|
3527
|
+
|
|
3528
|
+
var getRules = function getRules(value, points) {
|
|
3529
|
+
return dealloc(toRules(alloc(value), points));
|
|
3530
|
+
}; // WeakSet would be more appropriate, but only WeakMap is supported in IE11
|
|
3531
|
+
|
|
3532
|
+
|
|
3533
|
+
var fixedElements = /* #__PURE__ */new WeakMap();
|
|
3534
|
+
var compat = function compat(element) {
|
|
3535
|
+
if (element.type !== 'rule' || !element.parent || // positive .length indicates that this rule contains pseudo
|
|
3536
|
+
// negative .length indicates that this rule has been already prefixed
|
|
3537
|
+
element.length < 1) {
|
|
3538
|
+
return;
|
|
3539
|
+
}
|
|
3540
|
+
|
|
3541
|
+
var value = element.value;
|
|
3542
|
+
var parent = element.parent;
|
|
3543
|
+
var isImplicitRule = element.column === parent.column && element.line === parent.line;
|
|
3544
|
+
|
|
3545
|
+
while (parent.type !== 'rule') {
|
|
3546
|
+
parent = parent.parent;
|
|
3547
|
+
if (!parent) return;
|
|
3548
|
+
} // short-circuit for the simplest case
|
|
3549
|
+
|
|
3550
|
+
|
|
3551
|
+
if (element.props.length === 1 && value.charCodeAt(0) !== 58
|
|
3552
|
+
/* colon */
|
|
3553
|
+
&& !fixedElements.get(parent)) {
|
|
3554
|
+
return;
|
|
3555
|
+
} // if this is an implicitly inserted rule (the one eagerly inserted at the each new nested level)
|
|
3556
|
+
// then the props has already been manipulated beforehand as they that array is shared between it and its "rule parent"
|
|
3557
|
+
|
|
3558
|
+
|
|
3559
|
+
if (isImplicitRule) {
|
|
3560
|
+
return;
|
|
3561
|
+
}
|
|
3562
|
+
|
|
3563
|
+
fixedElements.set(element, true);
|
|
3564
|
+
var points = [];
|
|
3565
|
+
var rules = getRules(value, points);
|
|
3566
|
+
var parentRules = parent.props;
|
|
3567
|
+
|
|
3568
|
+
for (var i = 0, k = 0; i < rules.length; i++) {
|
|
3569
|
+
for (var j = 0; j < parentRules.length; j++, k++) {
|
|
3570
|
+
element.props[k] = points[i] ? rules[i].replace(/&\f/g, parentRules[j]) : parentRules[j] + " " + rules[i];
|
|
3571
|
+
}
|
|
3572
|
+
}
|
|
3573
|
+
};
|
|
3574
|
+
var removeLabel = function removeLabel(element) {
|
|
3575
|
+
if (element.type === 'decl') {
|
|
3576
|
+
var value = element.value;
|
|
3577
|
+
|
|
3578
|
+
if ( // charcode for l
|
|
3579
|
+
value.charCodeAt(0) === 108 && // charcode for b
|
|
3580
|
+
value.charCodeAt(2) === 98) {
|
|
3581
|
+
// this ignores label
|
|
3582
|
+
element["return"] = '';
|
|
3583
|
+
element.value = '';
|
|
3584
|
+
}
|
|
3585
|
+
}
|
|
3586
|
+
};
|
|
3587
|
+
|
|
3588
|
+
/* eslint-disable no-fallthrough */
|
|
3589
|
+
|
|
3590
|
+
function prefix(value, length) {
|
|
3591
|
+
switch (hash(value, length)) {
|
|
3592
|
+
// color-adjust
|
|
3593
|
+
case 5103:
|
|
3594
|
+
return WEBKIT + 'print-' + value + value;
|
|
3595
|
+
// animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function)
|
|
3596
|
+
|
|
3597
|
+
case 5737:
|
|
3598
|
+
case 4201:
|
|
3599
|
+
case 3177:
|
|
3600
|
+
case 3433:
|
|
3601
|
+
case 1641:
|
|
3602
|
+
case 4457:
|
|
3603
|
+
case 2921: // text-decoration, filter, clip-path, backface-visibility, column, box-decoration-break
|
|
3604
|
+
|
|
3605
|
+
case 5572:
|
|
3606
|
+
case 6356:
|
|
3607
|
+
case 5844:
|
|
3608
|
+
case 3191:
|
|
3609
|
+
case 6645:
|
|
3610
|
+
case 3005: // mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite,
|
|
3611
|
+
|
|
3612
|
+
case 6391:
|
|
3613
|
+
case 5879:
|
|
3614
|
+
case 5623:
|
|
3615
|
+
case 6135:
|
|
3616
|
+
case 4599:
|
|
3617
|
+
case 4855: // background-clip, columns, column-(count|fill|gap|rule|rule-color|rule-style|rule-width|span|width)
|
|
3618
|
+
|
|
3619
|
+
case 4215:
|
|
3620
|
+
case 6389:
|
|
3621
|
+
case 5109:
|
|
3622
|
+
case 5365:
|
|
3623
|
+
case 5621:
|
|
3624
|
+
case 3829:
|
|
3625
|
+
return WEBKIT + value + value;
|
|
3626
|
+
// appearance, user-select, transform, hyphens, text-size-adjust
|
|
3627
|
+
|
|
3628
|
+
case 5349:
|
|
3629
|
+
case 4246:
|
|
3630
|
+
case 4810:
|
|
3631
|
+
case 6968:
|
|
3632
|
+
case 2756:
|
|
3633
|
+
return WEBKIT + value + MOZ + value + MS + value + value;
|
|
3634
|
+
// flex, flex-direction
|
|
3635
|
+
|
|
3636
|
+
case 6828:
|
|
3637
|
+
case 4268:
|
|
3638
|
+
return WEBKIT + value + MS + value + value;
|
|
3639
|
+
// order
|
|
3640
|
+
|
|
3641
|
+
case 6165:
|
|
3642
|
+
return WEBKIT + value + MS + 'flex-' + value + value;
|
|
3643
|
+
// align-items
|
|
3644
|
+
|
|
3645
|
+
case 5187:
|
|
3646
|
+
return WEBKIT + value + replace(value, /(\w+).+(:[^]+)/, WEBKIT + 'box-$1$2' + MS + 'flex-$1$2') + value;
|
|
3647
|
+
// align-self
|
|
3648
|
+
|
|
3649
|
+
case 5443:
|
|
3650
|
+
return WEBKIT + value + MS + 'flex-item-' + replace(value, /flex-|-self/, '') + value;
|
|
3651
|
+
// align-content
|
|
3652
|
+
|
|
3653
|
+
case 4675:
|
|
3654
|
+
return WEBKIT + value + MS + 'flex-line-pack' + replace(value, /align-content|flex-|-self/, '') + value;
|
|
3655
|
+
// flex-shrink
|
|
3656
|
+
|
|
3657
|
+
case 5548:
|
|
3658
|
+
return WEBKIT + value + MS + replace(value, 'shrink', 'negative') + value;
|
|
3659
|
+
// flex-basis
|
|
3660
|
+
|
|
3661
|
+
case 5292:
|
|
3662
|
+
return WEBKIT + value + MS + replace(value, 'basis', 'preferred-size') + value;
|
|
3663
|
+
// flex-grow
|
|
3664
|
+
|
|
3665
|
+
case 6060:
|
|
3666
|
+
return WEBKIT + 'box-' + replace(value, '-grow', '') + WEBKIT + value + MS + replace(value, 'grow', 'positive') + value;
|
|
3667
|
+
// transition
|
|
3668
|
+
|
|
3669
|
+
case 4554:
|
|
3670
|
+
return WEBKIT + replace(value, /([^-])(transform)/g, '$1' + WEBKIT + '$2') + value;
|
|
3671
|
+
// cursor
|
|
3672
|
+
|
|
3673
|
+
case 6187:
|
|
3674
|
+
return replace(replace(replace(value, /(zoom-|grab)/, WEBKIT + '$1'), /(image-set)/, WEBKIT + '$1'), value, '') + value;
|
|
3675
|
+
// background, background-image
|
|
3676
|
+
|
|
3677
|
+
case 5495:
|
|
3678
|
+
case 3959:
|
|
3679
|
+
return replace(value, /(image-set\([^]*)/, WEBKIT + '$1' + '$`$1');
|
|
3680
|
+
// justify-content
|
|
3681
|
+
|
|
3682
|
+
case 4968:
|
|
3683
|
+
return replace(replace(value, /(.+:)(flex-)?(.*)/, WEBKIT + 'box-pack:$3' + MS + 'flex-pack:$3'), /s.+-b[^;]+/, 'justify') + WEBKIT + value + value;
|
|
3684
|
+
// (margin|padding)-inline-(start|end)
|
|
3685
|
+
|
|
3686
|
+
case 4095:
|
|
3687
|
+
case 3583:
|
|
3688
|
+
case 4068:
|
|
3689
|
+
case 2532:
|
|
3690
|
+
return replace(value, /(.+)-inline(.+)/, WEBKIT + '$1$2') + value;
|
|
3691
|
+
// (min|max)?(width|height|inline-size|block-size)
|
|
3692
|
+
|
|
3693
|
+
case 8116:
|
|
3694
|
+
case 7059:
|
|
3695
|
+
case 5753:
|
|
3696
|
+
case 5535:
|
|
3697
|
+
case 5445:
|
|
3698
|
+
case 5701:
|
|
3699
|
+
case 4933:
|
|
3700
|
+
case 4677:
|
|
3701
|
+
case 5533:
|
|
3702
|
+
case 5789:
|
|
3703
|
+
case 5021:
|
|
3704
|
+
case 4765:
|
|
3705
|
+
// stretch, max-content, min-content, fill-available
|
|
3706
|
+
if (strlen(value) - 1 - length > 6) switch (charat(value, length + 1)) {
|
|
3707
|
+
// (m)ax-content, (m)in-content
|
|
3708
|
+
case 109:
|
|
3709
|
+
// -
|
|
3710
|
+
if (charat(value, length + 4) !== 45) break;
|
|
3711
|
+
// (f)ill-available, (f)it-content
|
|
3712
|
+
|
|
3713
|
+
case 102:
|
|
3714
|
+
return replace(value, /(.+:)(.+)-([^]+)/, '$1' + WEBKIT + '$2-$3' + '$1' + MOZ + (charat(value, length + 3) == 108 ? '$3' : '$2-$3')) + value;
|
|
3715
|
+
// (s)tretch
|
|
3716
|
+
|
|
3717
|
+
case 115:
|
|
3718
|
+
return ~indexof(value, 'stretch') ? prefix(replace(value, 'stretch', 'fill-available'), length) + value : value;
|
|
3719
|
+
}
|
|
3720
|
+
break;
|
|
3721
|
+
// position: sticky
|
|
3722
|
+
|
|
3723
|
+
case 4949:
|
|
3724
|
+
// (s)ticky?
|
|
3725
|
+
if (charat(value, length + 1) !== 115) break;
|
|
3726
|
+
// display: (flex|inline-flex)
|
|
3727
|
+
|
|
3728
|
+
case 6444:
|
|
3729
|
+
switch (charat(value, strlen(value) - 3 - (~indexof(value, '!important') && 10))) {
|
|
3730
|
+
// stic(k)y
|
|
3731
|
+
case 107:
|
|
3732
|
+
return replace(value, ':', ':' + WEBKIT) + value;
|
|
3733
|
+
// (inline-)?fl(e)x
|
|
3734
|
+
|
|
3735
|
+
case 101:
|
|
3736
|
+
return replace(value, /(.+:)([^;!]+)(;|!.+)?/, '$1' + WEBKIT + (charat(value, 14) === 45 ? 'inline-' : '') + 'box$3' + '$1' + WEBKIT + '$2$3' + '$1' + MS + '$2box$3') + value;
|
|
3737
|
+
}
|
|
3738
|
+
|
|
3739
|
+
break;
|
|
3740
|
+
// writing-mode
|
|
3741
|
+
|
|
3742
|
+
case 5936:
|
|
3743
|
+
switch (charat(value, length + 11)) {
|
|
3744
|
+
// vertical-l(r)
|
|
3745
|
+
case 114:
|
|
3746
|
+
return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, 'tb') + value;
|
|
3747
|
+
// vertical-r(l)
|
|
3748
|
+
|
|
3749
|
+
case 108:
|
|
3750
|
+
return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, 'tb-rl') + value;
|
|
3751
|
+
// horizontal(-)tb
|
|
3752
|
+
|
|
3753
|
+
case 45:
|
|
3754
|
+
return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, 'lr') + value;
|
|
3755
|
+
}
|
|
3756
|
+
|
|
3757
|
+
return WEBKIT + value + MS + value + value;
|
|
3758
|
+
}
|
|
3759
|
+
|
|
3760
|
+
return value;
|
|
3761
|
+
}
|
|
3762
|
+
|
|
3763
|
+
var prefixer = function prefixer(element, index, children, callback) {
|
|
3764
|
+
if (element.length > -1) if (!element["return"]) switch (element.type) {
|
|
3765
|
+
case DECLARATION:
|
|
3766
|
+
element["return"] = prefix(element.value, element.length);
|
|
3767
|
+
break;
|
|
3768
|
+
|
|
3769
|
+
case KEYFRAMES:
|
|
3770
|
+
return serialize([copy(element, {
|
|
3771
|
+
value: replace(element.value, '@', '@' + WEBKIT)
|
|
3772
|
+
})], callback);
|
|
3773
|
+
|
|
3774
|
+
case RULESET:
|
|
3775
|
+
if (element.length) return combine(element.props, function (value) {
|
|
3776
|
+
switch (match(value, /(::plac\w+|:read-\w+)/)) {
|
|
3777
|
+
// :read-(only|write)
|
|
3778
|
+
case ':read-only':
|
|
3779
|
+
case ':read-write':
|
|
3780
|
+
return serialize([copy(element, {
|
|
3781
|
+
props: [replace(value, /:(read-\w+)/, ':' + MOZ + '$1')]
|
|
3782
|
+
})], callback);
|
|
3783
|
+
// :placeholder
|
|
3784
|
+
|
|
3785
|
+
case '::placeholder':
|
|
3786
|
+
return serialize([copy(element, {
|
|
3787
|
+
props: [replace(value, /:(plac\w+)/, ':' + WEBKIT + 'input-$1')]
|
|
3788
|
+
}), copy(element, {
|
|
3789
|
+
props: [replace(value, /:(plac\w+)/, ':' + MOZ + '$1')]
|
|
3790
|
+
}), copy(element, {
|
|
3791
|
+
props: [replace(value, /:(plac\w+)/, MS + 'input-$1')]
|
|
3792
|
+
})], callback);
|
|
3793
|
+
}
|
|
3794
|
+
|
|
3795
|
+
return '';
|
|
3796
|
+
});
|
|
3797
|
+
}
|
|
3798
|
+
};
|
|
3799
|
+
|
|
3800
|
+
var defaultStylisPlugins = [prefixer];
|
|
3801
|
+
|
|
3802
|
+
var createCache = function createCache(options) {
|
|
3803
|
+
var key = options.key;
|
|
3804
|
+
|
|
3805
|
+
if (key === 'css') {
|
|
3806
|
+
var ssrStyles = document.querySelectorAll("style[data-emotion]:not([data-s])"); // get SSRed styles out of the way of React's hydration
|
|
3807
|
+
// document.head is a safe place to move them to(though note document.head is not necessarily the last place they will be)
|
|
3808
|
+
// note this very very intentionally targets all style elements regardless of the key to ensure
|
|
3809
|
+
// that creating a cache works inside of render of a React component
|
|
3810
|
+
|
|
3811
|
+
Array.prototype.forEach.call(ssrStyles, function (node) {
|
|
3812
|
+
// we want to only move elements which have a space in the data-emotion attribute value
|
|
3813
|
+
// because that indicates that it is an Emotion 11 server-side rendered style elements
|
|
3814
|
+
// while we will already ignore Emotion 11 client-side inserted styles because of the :not([data-s]) part in the selector
|
|
3815
|
+
// Emotion 10 client-side inserted styles did not have data-s (but importantly did not have a space in their data-emotion attributes)
|
|
3816
|
+
// so checking for the space ensures that loading Emotion 11 after Emotion 10 has inserted some styles
|
|
3817
|
+
// will not result in the Emotion 10 styles being destroyed
|
|
3818
|
+
var dataEmotionAttribute = node.getAttribute('data-emotion');
|
|
3819
|
+
|
|
3820
|
+
if (dataEmotionAttribute.indexOf(' ') === -1) {
|
|
3821
|
+
return;
|
|
3822
|
+
}
|
|
3823
|
+
|
|
3824
|
+
document.head.appendChild(node);
|
|
3825
|
+
node.setAttribute('data-s', '');
|
|
3826
|
+
});
|
|
3827
|
+
}
|
|
3828
|
+
|
|
3829
|
+
var stylisPlugins = options.stylisPlugins || defaultStylisPlugins;
|
|
3830
|
+
|
|
3831
|
+
var inserted = {};
|
|
3832
|
+
var container;
|
|
3833
|
+
var nodesToHydrate = [];
|
|
3834
|
+
|
|
3835
|
+
{
|
|
3836
|
+
container = options.container || document.head;
|
|
3837
|
+
Array.prototype.forEach.call( // this means we will ignore elements which don't have a space in them which
|
|
3838
|
+
// means that the style elements we're looking at are only Emotion 11 server-rendered style elements
|
|
3839
|
+
document.querySelectorAll("style[data-emotion^=\"" + key + " \"]"), function (node) {
|
|
3840
|
+
var attrib = node.getAttribute("data-emotion").split(' ');
|
|
3841
|
+
|
|
3842
|
+
for (var i = 1; i < attrib.length; i++) {
|
|
3843
|
+
inserted[attrib[i]] = true;
|
|
3844
|
+
}
|
|
3845
|
+
|
|
3846
|
+
nodesToHydrate.push(node);
|
|
3847
|
+
});
|
|
3848
|
+
}
|
|
3849
|
+
|
|
3850
|
+
var _insert;
|
|
3851
|
+
|
|
3852
|
+
var omnipresentPlugins = [compat, removeLabel];
|
|
3853
|
+
|
|
3854
|
+
{
|
|
3855
|
+
var currentSheet;
|
|
3856
|
+
var finalizingPlugins = [stringify, rulesheet(function (rule) {
|
|
3857
|
+
currentSheet.insert(rule);
|
|
3858
|
+
})];
|
|
3859
|
+
var serializer = middleware(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins));
|
|
3860
|
+
|
|
3861
|
+
var stylis = function stylis(styles) {
|
|
3862
|
+
return serialize(compile(styles), serializer);
|
|
3863
|
+
};
|
|
3864
|
+
|
|
3865
|
+
_insert = function insert(selector, serialized, sheet, shouldCache) {
|
|
3866
|
+
currentSheet = sheet;
|
|
3867
|
+
|
|
3868
|
+
stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles);
|
|
3869
|
+
|
|
3870
|
+
if (shouldCache) {
|
|
3871
|
+
cache.inserted[serialized.name] = true;
|
|
3872
|
+
}
|
|
3873
|
+
};
|
|
3874
|
+
}
|
|
3875
|
+
|
|
3876
|
+
var cache = {
|
|
3877
|
+
key: key,
|
|
3878
|
+
sheet: new StyleSheet({
|
|
3879
|
+
key: key,
|
|
3880
|
+
container: container,
|
|
3881
|
+
nonce: options.nonce,
|
|
3882
|
+
speedy: options.speedy,
|
|
3883
|
+
prepend: options.prepend,
|
|
3884
|
+
insertionPoint: options.insertionPoint
|
|
3885
|
+
}),
|
|
3886
|
+
nonce: options.nonce,
|
|
3887
|
+
inserted: inserted,
|
|
3888
|
+
registered: {},
|
|
3889
|
+
insert: _insert
|
|
3890
|
+
};
|
|
3891
|
+
cache.sheet.hydrate(nodesToHydrate);
|
|
3892
|
+
return cache;
|
|
3893
|
+
};
|
|
3894
|
+
|
|
3895
|
+
var isBrowser = true;
|
|
3896
|
+
|
|
3897
|
+
function getRegisteredStyles(registered, registeredStyles, classNames) {
|
|
3898
|
+
var rawClassName = '';
|
|
3899
|
+
classNames.split(' ').forEach(function (className) {
|
|
3900
|
+
if (registered[className] !== undefined) {
|
|
3901
|
+
registeredStyles.push(registered[className] + ";");
|
|
3902
|
+
} else if (className) {
|
|
3903
|
+
rawClassName += className + " ";
|
|
3904
|
+
}
|
|
3905
|
+
});
|
|
3906
|
+
return rawClassName;
|
|
3907
|
+
}
|
|
3908
|
+
var registerStyles = function registerStyles(cache, serialized, isStringTag) {
|
|
3909
|
+
var className = cache.key + "-" + serialized.name;
|
|
3910
|
+
|
|
3911
|
+
if ( // we only need to add the styles to the registered cache if the
|
|
3912
|
+
// class name could be used further down
|
|
3913
|
+
// the tree but if it's a string tag, we know it won't
|
|
3914
|
+
// so we don't have to add it to registered cache.
|
|
3915
|
+
// this improves memory usage since we can avoid storing the whole style string
|
|
3916
|
+
(isStringTag === false || // we need to always store it if we're in compat mode and
|
|
3917
|
+
// in node since emotion-server relies on whether a style is in
|
|
3918
|
+
// the registered cache to know whether a style is global or not
|
|
3919
|
+
// also, note that this check will be dead code eliminated in the browser
|
|
3920
|
+
isBrowser === false ) && cache.registered[className] === undefined) {
|
|
3921
|
+
cache.registered[className] = serialized.styles;
|
|
3922
|
+
}
|
|
3923
|
+
};
|
|
3924
|
+
var insertStyles = function insertStyles(cache, serialized, isStringTag) {
|
|
3925
|
+
registerStyles(cache, serialized, isStringTag);
|
|
3926
|
+
var className = cache.key + "-" + serialized.name;
|
|
3927
|
+
|
|
3928
|
+
if (cache.inserted[serialized.name] === undefined) {
|
|
3929
|
+
var current = serialized;
|
|
3930
|
+
|
|
3931
|
+
do {
|
|
3932
|
+
cache.insert(serialized === current ? "." + className : '', current, cache.sheet, true);
|
|
3933
|
+
|
|
3934
|
+
current = current.next;
|
|
3935
|
+
} while (current !== undefined);
|
|
3936
|
+
}
|
|
3937
|
+
};
|
|
3938
|
+
|
|
2712
3939
|
/* eslint-disable */
|
|
2713
3940
|
// Inspired by https://github.com/garycourt/murmurhash-js
|
|
2714
3941
|
// Ported from https://github.com/aappleby/smhasher/blob/61a0530f28277f2e850bfc39600ce61d02b518de/src/MurmurHash2.cpp#L37-L86
|
|
@@ -2814,14 +4041,6 @@ var unitlessKeys = {
|
|
|
2814
4041
|
strokeWidth: 1
|
|
2815
4042
|
};
|
|
2816
4043
|
|
|
2817
|
-
function memoize(fn) {
|
|
2818
|
-
var cache = Object.create(null);
|
|
2819
|
-
return function (arg) {
|
|
2820
|
-
if (cache[arg] === undefined) cache[arg] = fn(arg);
|
|
2821
|
-
return cache[arg];
|
|
2822
|
-
};
|
|
2823
|
-
}
|
|
2824
|
-
|
|
2825
4044
|
var hyphenateRegex = /[A-Z]|^ms/g;
|
|
2826
4045
|
var animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;
|
|
2827
4046
|
|
|
@@ -2917,14 +4136,29 @@ function handleInterpolation(mergedProps, registered, interpolation) {
|
|
|
2917
4136
|
|
|
2918
4137
|
return createStringFromObject(mergedProps, registered, interpolation);
|
|
2919
4138
|
}
|
|
4139
|
+
|
|
4140
|
+
case 'function':
|
|
4141
|
+
{
|
|
4142
|
+
if (mergedProps !== undefined) {
|
|
4143
|
+
var previousCursor = cursor;
|
|
4144
|
+
var result = interpolation(mergedProps);
|
|
4145
|
+
cursor = previousCursor;
|
|
4146
|
+
return handleInterpolation(mergedProps, registered, result);
|
|
4147
|
+
}
|
|
4148
|
+
|
|
4149
|
+
break;
|
|
4150
|
+
}
|
|
2920
4151
|
} // finalize string values (regular strings and functions interpolated into css calls)
|
|
2921
4152
|
|
|
2922
4153
|
|
|
2923
4154
|
var asString = interpolation;
|
|
2924
4155
|
|
|
2925
|
-
{
|
|
4156
|
+
if (registered == null) {
|
|
2926
4157
|
return asString;
|
|
2927
4158
|
}
|
|
4159
|
+
|
|
4160
|
+
var cached = registered[asString];
|
|
4161
|
+
return cached !== undefined ? cached : asString;
|
|
2928
4162
|
}
|
|
2929
4163
|
|
|
2930
4164
|
function createStringFromObject(mergedProps, registered, obj) {
|
|
@@ -2941,12 +4175,14 @@ function createStringFromObject(mergedProps, registered, obj) {
|
|
|
2941
4175
|
if (typeof value !== 'object') {
|
|
2942
4176
|
var asString = value;
|
|
2943
4177
|
|
|
2944
|
-
if (
|
|
4178
|
+
if (registered != null && registered[asString] !== undefined) {
|
|
4179
|
+
string += key + "{" + registered[asString] + "}";
|
|
4180
|
+
} else if (isProcessableValue(asString)) {
|
|
2945
4181
|
string += processStyleName(key) + ":" + processStyleValue(key, asString) + ";";
|
|
2946
4182
|
}
|
|
2947
4183
|
} else {
|
|
2948
4184
|
|
|
2949
|
-
if (Array.isArray(value) && typeof value[0] === 'string' && (registered == null)) {
|
|
4185
|
+
if (Array.isArray(value) && typeof value[0] === 'string' && (registered == null || registered[value[0]] === undefined)) {
|
|
2950
4186
|
for (var _i = 0; _i < value.length; _i++) {
|
|
2951
4187
|
if (isProcessableValue(value[_i])) {
|
|
2952
4188
|
string += processStyleName(key) + ":" + processStyleValue(key, value[_i]) + ";";
|
|
@@ -3029,6 +4265,214 @@ function serializeStyles(args, registered, mergedProps) {
|
|
|
3029
4265
|
};
|
|
3030
4266
|
}
|
|
3031
4267
|
|
|
4268
|
+
var syncFallback = function syncFallback(create) {
|
|
4269
|
+
return create();
|
|
4270
|
+
};
|
|
4271
|
+
|
|
4272
|
+
var useInsertionEffect = React__namespace['useInsertion' + 'Effect'] ? React__namespace['useInsertion' + 'Effect'] : false;
|
|
4273
|
+
var useInsertionEffectAlwaysWithSyncFallback = useInsertionEffect || syncFallback;
|
|
4274
|
+
|
|
4275
|
+
var EmotionCacheContext = /* #__PURE__ */React__namespace.createContext( // we're doing this to avoid preconstruct's dead code elimination in this one case
|
|
4276
|
+
// because this module is primarily intended for the browser and node
|
|
4277
|
+
// but it's also required in react native and similar environments sometimes
|
|
4278
|
+
// and we could have a special build just for that
|
|
4279
|
+
// but this is much easier and the native packages
|
|
4280
|
+
// might use a different theme context in the future anyway
|
|
4281
|
+
typeof HTMLElement !== 'undefined' ? /* #__PURE__ */createCache({
|
|
4282
|
+
key: 'css'
|
|
4283
|
+
}) : null);
|
|
4284
|
+
|
|
4285
|
+
EmotionCacheContext.Provider;
|
|
4286
|
+
|
|
4287
|
+
var withEmotionCache = function withEmotionCache(func) {
|
|
4288
|
+
return /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
4289
|
+
// the cache will never be null in the browser
|
|
4290
|
+
var cache = React.useContext(EmotionCacheContext);
|
|
4291
|
+
return func(props, cache, ref);
|
|
4292
|
+
});
|
|
4293
|
+
};
|
|
4294
|
+
|
|
4295
|
+
var ThemeContext = /* #__PURE__ */React__namespace.createContext({});
|
|
4296
|
+
|
|
4297
|
+
// eslint-disable-next-line no-undef
|
|
4298
|
+
var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23
|
|
4299
|
+
|
|
4300
|
+
var isPropValid = /* #__PURE__ */memoize(function (prop) {
|
|
4301
|
+
return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111
|
|
4302
|
+
/* o */
|
|
4303
|
+
&& prop.charCodeAt(1) === 110
|
|
4304
|
+
/* n */
|
|
4305
|
+
&& prop.charCodeAt(2) < 91;
|
|
4306
|
+
}
|
|
4307
|
+
/* Z+1 */
|
|
4308
|
+
);
|
|
4309
|
+
|
|
4310
|
+
var testOmitPropsOnStringTag = isPropValid;
|
|
4311
|
+
|
|
4312
|
+
var testOmitPropsOnComponent = function testOmitPropsOnComponent(key) {
|
|
4313
|
+
return key !== 'theme';
|
|
4314
|
+
};
|
|
4315
|
+
|
|
4316
|
+
var getDefaultShouldForwardProp = function getDefaultShouldForwardProp(tag) {
|
|
4317
|
+
return typeof tag === 'string' && // 96 is one less than the char code
|
|
4318
|
+
// for "a" so this is checking that
|
|
4319
|
+
// it's a lowercase character
|
|
4320
|
+
tag.charCodeAt(0) > 96 ? testOmitPropsOnStringTag : testOmitPropsOnComponent;
|
|
4321
|
+
};
|
|
4322
|
+
var composeShouldForwardProps = function composeShouldForwardProps(tag, options, isReal) {
|
|
4323
|
+
var shouldForwardProp;
|
|
4324
|
+
|
|
4325
|
+
if (options) {
|
|
4326
|
+
var optionsShouldForwardProp = options.shouldForwardProp;
|
|
4327
|
+
shouldForwardProp = tag.__emotion_forwardProp && optionsShouldForwardProp ? function (propName) {
|
|
4328
|
+
return tag.__emotion_forwardProp(propName) && optionsShouldForwardProp(propName);
|
|
4329
|
+
} : optionsShouldForwardProp;
|
|
4330
|
+
}
|
|
4331
|
+
|
|
4332
|
+
if (typeof shouldForwardProp !== 'function' && isReal) {
|
|
4333
|
+
shouldForwardProp = tag.__emotion_forwardProp;
|
|
4334
|
+
}
|
|
4335
|
+
|
|
4336
|
+
return shouldForwardProp;
|
|
4337
|
+
};
|
|
4338
|
+
|
|
4339
|
+
var Insertion = function Insertion(_ref) {
|
|
4340
|
+
var cache = _ref.cache,
|
|
4341
|
+
serialized = _ref.serialized,
|
|
4342
|
+
isStringTag = _ref.isStringTag;
|
|
4343
|
+
registerStyles(cache, serialized, isStringTag);
|
|
4344
|
+
useInsertionEffectAlwaysWithSyncFallback(function () {
|
|
4345
|
+
return insertStyles(cache, serialized, isStringTag);
|
|
4346
|
+
});
|
|
4347
|
+
|
|
4348
|
+
return null;
|
|
4349
|
+
};
|
|
4350
|
+
|
|
4351
|
+
var createStyled$1 = function createStyled(tag, options) {
|
|
4352
|
+
|
|
4353
|
+
var isReal = tag.__emotion_real === tag;
|
|
4354
|
+
var baseTag = isReal && tag.__emotion_base || tag;
|
|
4355
|
+
var identifierName;
|
|
4356
|
+
var targetClassName;
|
|
4357
|
+
|
|
4358
|
+
if (options !== undefined) {
|
|
4359
|
+
identifierName = options.label;
|
|
4360
|
+
targetClassName = options.target;
|
|
4361
|
+
}
|
|
4362
|
+
|
|
4363
|
+
var shouldForwardProp = composeShouldForwardProps(tag, options, isReal);
|
|
4364
|
+
var defaultShouldForwardProp = shouldForwardProp || getDefaultShouldForwardProp(baseTag);
|
|
4365
|
+
var shouldUseAs = !defaultShouldForwardProp('as');
|
|
4366
|
+
return function () {
|
|
4367
|
+
// eslint-disable-next-line prefer-rest-params
|
|
4368
|
+
var args = arguments;
|
|
4369
|
+
var styles = isReal && tag.__emotion_styles !== undefined ? tag.__emotion_styles.slice(0) : [];
|
|
4370
|
+
|
|
4371
|
+
if (identifierName !== undefined) {
|
|
4372
|
+
styles.push("label:" + identifierName + ";");
|
|
4373
|
+
}
|
|
4374
|
+
|
|
4375
|
+
if (args[0] == null || args[0].raw === undefined) {
|
|
4376
|
+
// eslint-disable-next-line prefer-spread
|
|
4377
|
+
styles.push.apply(styles, args);
|
|
4378
|
+
} else {
|
|
4379
|
+
var templateStringsArr = args[0];
|
|
4380
|
+
|
|
4381
|
+
styles.push(templateStringsArr[0]);
|
|
4382
|
+
var len = args.length;
|
|
4383
|
+
var i = 1;
|
|
4384
|
+
|
|
4385
|
+
for (; i < len; i++) {
|
|
4386
|
+
|
|
4387
|
+
styles.push(args[i], templateStringsArr[i]);
|
|
4388
|
+
}
|
|
4389
|
+
}
|
|
4390
|
+
|
|
4391
|
+
var Styled = withEmotionCache(function (props, cache, ref) {
|
|
4392
|
+
var FinalTag = shouldUseAs && props.as || baseTag;
|
|
4393
|
+
var className = '';
|
|
4394
|
+
var classInterpolations = [];
|
|
4395
|
+
var mergedProps = props;
|
|
4396
|
+
|
|
4397
|
+
if (props.theme == null) {
|
|
4398
|
+
mergedProps = {};
|
|
4399
|
+
|
|
4400
|
+
for (var key in props) {
|
|
4401
|
+
mergedProps[key] = props[key];
|
|
4402
|
+
}
|
|
4403
|
+
|
|
4404
|
+
mergedProps.theme = React__namespace.useContext(ThemeContext);
|
|
4405
|
+
}
|
|
4406
|
+
|
|
4407
|
+
if (typeof props.className === 'string') {
|
|
4408
|
+
className = getRegisteredStyles(cache.registered, classInterpolations, props.className);
|
|
4409
|
+
} else if (props.className != null) {
|
|
4410
|
+
className = props.className + " ";
|
|
4411
|
+
}
|
|
4412
|
+
|
|
4413
|
+
var serialized = serializeStyles(styles.concat(classInterpolations), cache.registered, mergedProps);
|
|
4414
|
+
className += cache.key + "-" + serialized.name;
|
|
4415
|
+
|
|
4416
|
+
if (targetClassName !== undefined) {
|
|
4417
|
+
className += " " + targetClassName;
|
|
4418
|
+
}
|
|
4419
|
+
|
|
4420
|
+
var finalShouldForwardProp = shouldUseAs && shouldForwardProp === undefined ? getDefaultShouldForwardProp(FinalTag) : defaultShouldForwardProp;
|
|
4421
|
+
var newProps = {};
|
|
4422
|
+
|
|
4423
|
+
for (var _key in props) {
|
|
4424
|
+
if (shouldUseAs && _key === 'as') continue;
|
|
4425
|
+
|
|
4426
|
+
if (finalShouldForwardProp(_key)) {
|
|
4427
|
+
newProps[_key] = props[_key];
|
|
4428
|
+
}
|
|
4429
|
+
}
|
|
4430
|
+
|
|
4431
|
+
newProps.className = className;
|
|
4432
|
+
|
|
4433
|
+
if (ref) {
|
|
4434
|
+
newProps.ref = ref;
|
|
4435
|
+
}
|
|
4436
|
+
|
|
4437
|
+
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(Insertion, {
|
|
4438
|
+
cache: cache,
|
|
4439
|
+
serialized: serialized,
|
|
4440
|
+
isStringTag: typeof FinalTag === 'string'
|
|
4441
|
+
}), /*#__PURE__*/React__namespace.createElement(FinalTag, newProps));
|
|
4442
|
+
});
|
|
4443
|
+
Styled.displayName = identifierName !== undefined ? identifierName : "Styled(" + (typeof baseTag === 'string' ? baseTag : baseTag.displayName || baseTag.name || 'Component') + ")";
|
|
4444
|
+
Styled.defaultProps = tag.defaultProps;
|
|
4445
|
+
Styled.__emotion_real = Styled;
|
|
4446
|
+
Styled.__emotion_base = baseTag;
|
|
4447
|
+
Styled.__emotion_styles = styles;
|
|
4448
|
+
Styled.__emotion_forwardProp = shouldForwardProp;
|
|
4449
|
+
Object.defineProperty(Styled, 'toString', {
|
|
4450
|
+
value: function value() {
|
|
4451
|
+
|
|
4452
|
+
return "." + targetClassName;
|
|
4453
|
+
}
|
|
4454
|
+
});
|
|
4455
|
+
|
|
4456
|
+
Styled.withComponent = function (nextTag, nextOptions) {
|
|
4457
|
+
var newStyled = createStyled(nextTag, _extends({}, options, nextOptions, {
|
|
4458
|
+
shouldForwardProp: composeShouldForwardProps(Styled, nextOptions, true)
|
|
4459
|
+
}));
|
|
4460
|
+
return newStyled.apply(void 0, styles);
|
|
4461
|
+
};
|
|
4462
|
+
|
|
4463
|
+
return Styled;
|
|
4464
|
+
};
|
|
4465
|
+
};
|
|
4466
|
+
|
|
4467
|
+
var tags = ['a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base', 'bdi', 'bdo', 'big', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'cite', 'code', 'col', 'colgroup', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'keygen', 'label', 'legend', 'li', 'link', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meta', 'meter', 'nav', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'script', 'section', 'select', 'small', 'source', 'span', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'u', 'ul', 'var', 'video', 'wbr', // SVG
|
|
4468
|
+
'circle', 'clipPath', 'defs', 'ellipse', 'foreignObject', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'svg', 'text', 'tspan'];
|
|
4469
|
+
|
|
4470
|
+
// bind it to avoid mutating the original function
|
|
4471
|
+
var newStyled = createStyled$1.bind(null);
|
|
4472
|
+
tags.forEach(function (tagName) {
|
|
4473
|
+
newStyled[tagName] = newStyled(tagName);
|
|
4474
|
+
});
|
|
4475
|
+
|
|
3032
4476
|
/**
|
|
3033
4477
|
* @mui/styled-engine v7.1.1
|
|
3034
4478
|
*
|
|
@@ -3037,7 +4481,7 @@ function serializeStyles(args, registered, mergedProps) {
|
|
|
3037
4481
|
* LICENSE file in the root directory of this source tree.
|
|
3038
4482
|
*/
|
|
3039
4483
|
function styled$1(tag, options) {
|
|
3040
|
-
const stylesFactory =
|
|
4484
|
+
const stylesFactory = newStyled(tag, options);
|
|
3041
4485
|
if (process.env.NODE_ENV !== 'production') {
|
|
3042
4486
|
return (...styles) => {
|
|
3043
4487
|
const component = typeof tag === 'string' ? `"${tag}"` : 'component';
|