css-in-props 2.10.77 → 2.10.81
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 +4489 -0
- package/dist/index.cjs.js.map +7 -0
- package/package.json +8 -3
- package/src/{transform/emotion.js → emotion.js} +2 -5
- package/src/index.js +1 -1
- package/src/registry.js +1 -2
- package/src/set.js +2 -1
- package/src/{transform/classname.js → transform.js} +2 -2
- package/src/transform/index.js +0 -5
- package/src/transform/subProps.js +0 -68
|
@@ -0,0 +1,4489 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp2 = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __esm = (fn, res) => function __init() {
|
|
9
|
+
return fn && (res = (0, fn[__getOwnPropNames2(fn)[0]])(fn = 0)), res;
|
|
10
|
+
};
|
|
11
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
12
|
+
return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
13
|
+
};
|
|
14
|
+
var __export2 = (target, all) => {
|
|
15
|
+
for (var name in all)
|
|
16
|
+
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
17
|
+
};
|
|
18
|
+
var __copyProps2 = (to, from2, except, desc) => {
|
|
19
|
+
if (from2 && typeof from2 === "object" || typeof from2 === "function") {
|
|
20
|
+
for (let key of __getOwnPropNames2(from2))
|
|
21
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
22
|
+
__defProp2(to, key, { get: () => from2[key], enumerable: !(desc = __getOwnPropDesc2(from2, key)) || desc.enumerable });
|
|
23
|
+
}
|
|
24
|
+
return to;
|
|
25
|
+
};
|
|
26
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps2(
|
|
27
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
28
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
29
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
30
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
31
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target,
|
|
32
|
+
mod
|
|
33
|
+
));
|
|
34
|
+
var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
|
|
35
|
+
|
|
36
|
+
// ../../node_modules/@domql/globals/index.js
|
|
37
|
+
var window3, document3;
|
|
38
|
+
var init_globals = __esm({
|
|
39
|
+
"../../node_modules/@domql/globals/index.js"() {
|
|
40
|
+
"use strict";
|
|
41
|
+
window3 = globalThis;
|
|
42
|
+
document3 = window3.document;
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
// ../../node_modules/@domql/tags/htmlTags.js
|
|
47
|
+
var init_htmlTags = __esm({
|
|
48
|
+
"../../node_modules/@domql/tags/htmlTags.js"() {
|
|
49
|
+
"use strict";
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
// ../../node_modules/@domql/tags/index.js
|
|
54
|
+
var init_tags = __esm({
|
|
55
|
+
"../../node_modules/@domql/tags/index.js"() {
|
|
56
|
+
"use strict";
|
|
57
|
+
init_htmlTags();
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
// ../../node_modules/@domql/utils/types.js
|
|
62
|
+
var isObject3, isString3, isFunction3, isArray3, isObjectLike3;
|
|
63
|
+
var init_types = __esm({
|
|
64
|
+
"../../node_modules/@domql/utils/types.js"() {
|
|
65
|
+
"use strict";
|
|
66
|
+
init_globals();
|
|
67
|
+
init_tags();
|
|
68
|
+
isObject3 = (arg) => {
|
|
69
|
+
if (arg === null)
|
|
70
|
+
return false;
|
|
71
|
+
return typeof arg === "object" && arg.constructor === Object;
|
|
72
|
+
};
|
|
73
|
+
isString3 = (arg) => typeof arg === "string";
|
|
74
|
+
isFunction3 = (arg) => typeof arg === "function";
|
|
75
|
+
isArray3 = (arg) => Array.isArray(arg);
|
|
76
|
+
isObjectLike3 = (arg) => {
|
|
77
|
+
if (arg === null)
|
|
78
|
+
return false;
|
|
79
|
+
return typeof arg === "object";
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
// ../../node_modules/@domql/utils/object.js
|
|
85
|
+
var exec2, map2, merge3, deepMerge3, clone2, deepCloneExclude2, mergeArrayExclude2, deepClone2, deepStringify2, deepDestringify2, overwrite2, diff2, overwriteObj2, overwriteDeep2, mergeIfExisted2, mergeArray2, mergeAndCloneIfArray2, flattenRecursive2, isEqualDeep2;
|
|
86
|
+
var init_object = __esm({
|
|
87
|
+
"../../node_modules/@domql/utils/object.js"() {
|
|
88
|
+
"use strict";
|
|
89
|
+
init_types();
|
|
90
|
+
exec2 = (param, element, state) => {
|
|
91
|
+
if (isFunction3(param))
|
|
92
|
+
return param(element, state || element.state);
|
|
93
|
+
return param;
|
|
94
|
+
};
|
|
95
|
+
map2 = (obj2, extention, element) => {
|
|
96
|
+
for (const e in extention) {
|
|
97
|
+
obj2[e] = exec2(extention[e], element);
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
merge3 = (element, obj2) => {
|
|
101
|
+
for (const e in obj2) {
|
|
102
|
+
const elementProp = element[e];
|
|
103
|
+
const objProp2 = obj2[e];
|
|
104
|
+
if (elementProp === void 0) {
|
|
105
|
+
element[e] = objProp2;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return element;
|
|
109
|
+
};
|
|
110
|
+
deepMerge3 = (element, extend) => {
|
|
111
|
+
for (const e in extend) {
|
|
112
|
+
const elementProp = element[e];
|
|
113
|
+
const extendProp = extend[e];
|
|
114
|
+
if (e === "parent" || e === "props")
|
|
115
|
+
continue;
|
|
116
|
+
if (elementProp === void 0) {
|
|
117
|
+
element[e] = extendProp;
|
|
118
|
+
} else if (isObjectLike3(elementProp) && isObject3(extendProp)) {
|
|
119
|
+
deepMerge3(elementProp, extendProp);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return element;
|
|
123
|
+
};
|
|
124
|
+
clone2 = (obj2) => {
|
|
125
|
+
const o = {};
|
|
126
|
+
for (const prop2 in obj2) {
|
|
127
|
+
if (prop2 === "node")
|
|
128
|
+
continue;
|
|
129
|
+
o[prop2] = obj2[prop2];
|
|
130
|
+
}
|
|
131
|
+
return o;
|
|
132
|
+
};
|
|
133
|
+
deepCloneExclude2 = (obj2, exclude = []) => {
|
|
134
|
+
if (isArray3(obj2)) {
|
|
135
|
+
return obj2.map((x) => deepCloneExclude2(x, exclude));
|
|
136
|
+
}
|
|
137
|
+
const o = {};
|
|
138
|
+
for (const k in obj2) {
|
|
139
|
+
if (exclude.indexOf(k) > -1)
|
|
140
|
+
continue;
|
|
141
|
+
let v = obj2[k];
|
|
142
|
+
if (k === "extend" && isArray3(v)) {
|
|
143
|
+
v = mergeArrayExclude2(v, exclude);
|
|
144
|
+
}
|
|
145
|
+
if (isArray3(v)) {
|
|
146
|
+
o[k] = v.map((x) => deepCloneExclude2(x, exclude));
|
|
147
|
+
} else if (isObject3(v)) {
|
|
148
|
+
o[k] = deepCloneExclude2(v, exclude);
|
|
149
|
+
} else
|
|
150
|
+
o[k] = v;
|
|
151
|
+
}
|
|
152
|
+
return o;
|
|
153
|
+
};
|
|
154
|
+
mergeArrayExclude2 = (arr, excl = []) => {
|
|
155
|
+
return arr.reduce((acc, curr) => deepMerge3(acc, deepCloneExclude2(curr, excl)), {});
|
|
156
|
+
};
|
|
157
|
+
deepClone2 = (obj2) => {
|
|
158
|
+
if (isArray3(obj2)) {
|
|
159
|
+
return obj2.map(deepClone2);
|
|
160
|
+
}
|
|
161
|
+
const o = {};
|
|
162
|
+
for (const prop2 in obj2) {
|
|
163
|
+
let objProp2 = obj2[prop2];
|
|
164
|
+
if (prop2 === "extend" && isArray3(objProp2)) {
|
|
165
|
+
objProp2 = mergeArray2(objProp2);
|
|
166
|
+
}
|
|
167
|
+
if (isArray3(objProp2)) {
|
|
168
|
+
o[prop2] = objProp2.map((v) => isObject3(v) ? deepClone2(v) : v);
|
|
169
|
+
} else if (isObject3(objProp2)) {
|
|
170
|
+
o[prop2] = deepClone2(objProp2);
|
|
171
|
+
} else
|
|
172
|
+
o[prop2] = objProp2;
|
|
173
|
+
}
|
|
174
|
+
return o;
|
|
175
|
+
};
|
|
176
|
+
deepStringify2 = (obj2, stringified2 = {}) => {
|
|
177
|
+
for (const prop2 in obj2) {
|
|
178
|
+
const objProp2 = obj2[prop2];
|
|
179
|
+
if (isFunction3(objProp2)) {
|
|
180
|
+
stringified2[prop2] = objProp2.toString();
|
|
181
|
+
} else if (isObject3(objProp2)) {
|
|
182
|
+
stringified2[prop2] = {};
|
|
183
|
+
deepStringify2(objProp2[prop2], stringified2[prop2]);
|
|
184
|
+
} else if (isArray3(objProp2)) {
|
|
185
|
+
stringified2[prop2] = [];
|
|
186
|
+
objProp2.map((v, i) => deepStringify2(v, stringified2[prop2][i]));
|
|
187
|
+
} else
|
|
188
|
+
stringified2[prop2] = objProp2;
|
|
189
|
+
}
|
|
190
|
+
return stringified2;
|
|
191
|
+
};
|
|
192
|
+
deepDestringify2 = (obj, stringified = {}) => {
|
|
193
|
+
for (const prop in obj) {
|
|
194
|
+
const objProp = obj[prop];
|
|
195
|
+
if (isString3(objProp)) {
|
|
196
|
+
if (objProp.includes("=>") || objProp.includes("function") || objProp[0] === "(") {
|
|
197
|
+
try {
|
|
198
|
+
const evalProp = eval(objProp);
|
|
199
|
+
stringified[prop] = evalProp;
|
|
200
|
+
} catch (e) {
|
|
201
|
+
if (e)
|
|
202
|
+
stringified[prop] = objProp;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
} else
|
|
206
|
+
stringified[prop] = objProp;
|
|
207
|
+
if (isObject3(objProp))
|
|
208
|
+
deepDestringify2(stringified[prop], stringified[prop]);
|
|
209
|
+
}
|
|
210
|
+
return stringified;
|
|
211
|
+
};
|
|
212
|
+
overwrite2 = (element, params, options) => {
|
|
213
|
+
const { ref } = element;
|
|
214
|
+
const changes = {};
|
|
215
|
+
for (const e in params) {
|
|
216
|
+
if (e === "props")
|
|
217
|
+
continue;
|
|
218
|
+
const elementProp = element[e];
|
|
219
|
+
const paramsProp = params[e];
|
|
220
|
+
if (paramsProp) {
|
|
221
|
+
ref.__cache[e] = changes[e] = elementProp;
|
|
222
|
+
ref[e] = paramsProp;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
return changes;
|
|
226
|
+
};
|
|
227
|
+
diff2 = (obj2, original, cache) => {
|
|
228
|
+
const changes = cache || {};
|
|
229
|
+
for (const e in obj2) {
|
|
230
|
+
if (e === "ref")
|
|
231
|
+
continue;
|
|
232
|
+
const originalProp = original[e];
|
|
233
|
+
const objProp2 = obj2[e];
|
|
234
|
+
if (isObjectLike3(originalProp) && isObjectLike3(objProp2)) {
|
|
235
|
+
changes[e] = {};
|
|
236
|
+
diff2(originalProp, objProp2, changes[e]);
|
|
237
|
+
} else if (objProp2 !== void 0) {
|
|
238
|
+
changes[e] = objProp2;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
return changes;
|
|
242
|
+
};
|
|
243
|
+
overwriteObj2 = (params, obj2) => {
|
|
244
|
+
const changes = {};
|
|
245
|
+
for (const e in params) {
|
|
246
|
+
const objProp2 = obj2[e];
|
|
247
|
+
const paramsProp = params[e];
|
|
248
|
+
if (paramsProp) {
|
|
249
|
+
obj2[e] = changes[e] = objProp2;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
return changes;
|
|
253
|
+
};
|
|
254
|
+
overwriteDeep2 = (params, obj2) => {
|
|
255
|
+
for (const e in params) {
|
|
256
|
+
const objProp2 = obj2[e];
|
|
257
|
+
const paramsProp = params[e];
|
|
258
|
+
if (isObjectLike3(objProp2) && isObjectLike3(paramsProp)) {
|
|
259
|
+
overwriteDeep2(objProp2, paramsProp);
|
|
260
|
+
} else if (paramsProp !== void 0) {
|
|
261
|
+
obj2[e] = paramsProp;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
return obj2;
|
|
265
|
+
};
|
|
266
|
+
mergeIfExisted2 = (a, b) => {
|
|
267
|
+
if (isObjectLike3(a) && isObjectLike3(b))
|
|
268
|
+
return deepMerge3(a, b);
|
|
269
|
+
return a || b;
|
|
270
|
+
};
|
|
271
|
+
mergeArray2 = (arr) => {
|
|
272
|
+
return arr.reduce((a, c) => deepMerge3(a, deepClone2(c)), {});
|
|
273
|
+
};
|
|
274
|
+
mergeAndCloneIfArray2 = (obj2) => {
|
|
275
|
+
return isArray3(obj2) ? mergeArray2(obj2) : deepClone2(obj2);
|
|
276
|
+
};
|
|
277
|
+
flattenRecursive2 = (param, prop2, stack = []) => {
|
|
278
|
+
const objectized = mergeAndCloneIfArray2(param);
|
|
279
|
+
stack.push(objectized);
|
|
280
|
+
const extendOfExtend = objectized[prop2];
|
|
281
|
+
if (extendOfExtend)
|
|
282
|
+
flattenRecursive2(extendOfExtend, prop2, stack);
|
|
283
|
+
delete objectized[prop2];
|
|
284
|
+
return stack;
|
|
285
|
+
};
|
|
286
|
+
isEqualDeep2 = (param, element) => {
|
|
287
|
+
if (param === element)
|
|
288
|
+
return true;
|
|
289
|
+
if (!param || !element)
|
|
290
|
+
return false;
|
|
291
|
+
for (const prop2 in param) {
|
|
292
|
+
const paramProp = param[prop2];
|
|
293
|
+
const elementProp = element[prop2];
|
|
294
|
+
if (isObjectLike3(paramProp)) {
|
|
295
|
+
const isEqual = isEqualDeep2(paramProp, elementProp);
|
|
296
|
+
if (!isEqual)
|
|
297
|
+
return false;
|
|
298
|
+
} else {
|
|
299
|
+
const isEqual = paramProp === elementProp;
|
|
300
|
+
if (!isEqual)
|
|
301
|
+
return false;
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
return true;
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
});
|
|
308
|
+
|
|
309
|
+
// ../../node_modules/@domql/utils/function.js
|
|
310
|
+
var init_function = __esm({
|
|
311
|
+
"../../node_modules/@domql/utils/function.js"() {
|
|
312
|
+
"use strict";
|
|
313
|
+
}
|
|
314
|
+
});
|
|
315
|
+
|
|
316
|
+
// ../../node_modules/@domql/utils/array.js
|
|
317
|
+
var init_array = __esm({
|
|
318
|
+
"../../node_modules/@domql/utils/array.js"() {
|
|
319
|
+
"use strict";
|
|
320
|
+
}
|
|
321
|
+
});
|
|
322
|
+
|
|
323
|
+
// ../../node_modules/@domql/utils/node.js
|
|
324
|
+
var createID2;
|
|
325
|
+
var init_node = __esm({
|
|
326
|
+
"../../node_modules/@domql/utils/node.js"() {
|
|
327
|
+
"use strict";
|
|
328
|
+
createID2 = function() {
|
|
329
|
+
let index = 0;
|
|
330
|
+
function newId() {
|
|
331
|
+
index++;
|
|
332
|
+
return index;
|
|
333
|
+
}
|
|
334
|
+
return newId;
|
|
335
|
+
}();
|
|
336
|
+
}
|
|
337
|
+
});
|
|
338
|
+
|
|
339
|
+
// ../../node_modules/@domql/utils/log.js
|
|
340
|
+
var init_log = __esm({
|
|
341
|
+
"../../node_modules/@domql/utils/log.js"() {
|
|
342
|
+
"use strict";
|
|
343
|
+
}
|
|
344
|
+
});
|
|
345
|
+
|
|
346
|
+
// ../../node_modules/@domql/utils/index.js
|
|
347
|
+
var init_utils = __esm({
|
|
348
|
+
"../../node_modules/@domql/utils/index.js"() {
|
|
349
|
+
"use strict";
|
|
350
|
+
init_types();
|
|
351
|
+
init_object();
|
|
352
|
+
init_function();
|
|
353
|
+
init_array();
|
|
354
|
+
init_node();
|
|
355
|
+
init_log();
|
|
356
|
+
}
|
|
357
|
+
});
|
|
358
|
+
|
|
359
|
+
// ../../uikit/Atoms/node_modules/@symbo.ls/scratch/dist/index.cjs.js
|
|
360
|
+
var require_index_cjs = __commonJS({
|
|
361
|
+
"../../uikit/Atoms/node_modules/@symbo.ls/scratch/dist/index.cjs.js"(exports, module) {
|
|
362
|
+
"use strict";
|
|
363
|
+
var __defProp = Object.defineProperty;
|
|
364
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
365
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
366
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
367
|
+
var __export = (target, all) => {
|
|
368
|
+
for (var name in all)
|
|
369
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
370
|
+
};
|
|
371
|
+
var __copyProps = (to, from2, except, desc) => {
|
|
372
|
+
if (from2 && typeof from2 === "object" || typeof from2 === "function") {
|
|
373
|
+
for (let key of __getOwnPropNames(from2))
|
|
374
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
375
|
+
__defProp(to, key, { get: () => from2[key], enumerable: !(desc = __getOwnPropDesc(from2, key)) || desc.enumerable });
|
|
376
|
+
}
|
|
377
|
+
return to;
|
|
378
|
+
};
|
|
379
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
380
|
+
var src_exports = {};
|
|
381
|
+
__export(src_exports, {
|
|
382
|
+
ANIMATION: () => ANIMATION,
|
|
383
|
+
BREAKPOINTS: () => BREAKPOINTS,
|
|
384
|
+
CASES: () => CASES,
|
|
385
|
+
COLOR: () => COLOR,
|
|
386
|
+
CONFIG: () => CONFIG,
|
|
387
|
+
CSS_VARS: () => CSS_VARS,
|
|
388
|
+
DEVICES: () => DEVICES,
|
|
389
|
+
DOCUMENT: () => DOCUMENT,
|
|
390
|
+
FACTORY: () => FACTORY,
|
|
391
|
+
FONT: () => FONT,
|
|
392
|
+
FONT_FACE: () => FONT_FACE,
|
|
393
|
+
FONT_FAMILY: () => FONT_FAMILY,
|
|
394
|
+
FONT_FAMILY_TYPES: () => FONT_FAMILY_TYPES,
|
|
395
|
+
GRADIENT: () => GRADIENT,
|
|
396
|
+
ICONS: () => ICONS,
|
|
397
|
+
MEDIA: () => MEDIA,
|
|
398
|
+
RESET: () => RESET,
|
|
399
|
+
SEQUENCE: () => SEQUENCE,
|
|
400
|
+
SPACING: () => SPACING,
|
|
401
|
+
SVG: () => SVG,
|
|
402
|
+
SVG_DATA: () => SVG_DATA,
|
|
403
|
+
THEME: () => THEME,
|
|
404
|
+
TIMING: () => TIMING,
|
|
405
|
+
TYPOGRAPHY: () => TYPOGRAPHY,
|
|
406
|
+
UNIT: () => UNIT,
|
|
407
|
+
VALUE_TRANSFORMERS: () => VALUE_TRANSFORMERS,
|
|
408
|
+
activateConfig: () => activateConfig,
|
|
409
|
+
appendIconsSprite: () => appendIconsSprite,
|
|
410
|
+
appendSVGSprite: () => appendSVGSprite,
|
|
411
|
+
applyDocument: () => applyDocument,
|
|
412
|
+
applyHeadings: () => applyHeadings,
|
|
413
|
+
applyReset: () => applyReset,
|
|
414
|
+
applySequenceVars: () => applySequenceVars,
|
|
415
|
+
applySpacingSequence: () => applySpacingSequence,
|
|
416
|
+
applyTimingSequence: () => applyTimingSequence,
|
|
417
|
+
applyTypographySequence: () => applyTypographySequence,
|
|
418
|
+
arrayze: () => arrayze,
|
|
419
|
+
changeLightness: () => changeLightness,
|
|
420
|
+
colorStringToRgbaArray: () => colorStringToRgbaArray,
|
|
421
|
+
convertSvgToSymbol: () => convertSvgToSymbol,
|
|
422
|
+
deepMerge: () => deepMerge2,
|
|
423
|
+
findHeadingLetter: () => findHeadingLetter,
|
|
424
|
+
findHeadings: () => findHeadings,
|
|
425
|
+
generateSequence: () => generateSequence,
|
|
426
|
+
generateSprite: () => generateSprite,
|
|
427
|
+
generateSubSequence: () => generateSubSequence,
|
|
428
|
+
getActiveConfig: () => getActiveConfig,
|
|
429
|
+
getColor: () => getColor,
|
|
430
|
+
getColorShade: () => getColorShade,
|
|
431
|
+
getDefaultOrFirstKey: () => getDefaultOrFirstKey,
|
|
432
|
+
getFontFace: () => getFontFace,
|
|
433
|
+
getFontFaceEach: () => getFontFaceEach,
|
|
434
|
+
getFontFaceEachString: () => getFontFaceEachString,
|
|
435
|
+
getFontFaceString: () => getFontFaceString,
|
|
436
|
+
getFontFamily: () => getFontFamily,
|
|
437
|
+
getFontFormat: () => getFontFormat,
|
|
438
|
+
getFontSizeByKey: () => getFontSizeByKey,
|
|
439
|
+
getMediaColor: () => getMediaColor,
|
|
440
|
+
getMediaTheme: () => getMediaTheme,
|
|
441
|
+
getSequenceValue: () => getSequenceValue,
|
|
442
|
+
getSequenceValuePropertyPair: () => getSequenceValuePropertyPair,
|
|
443
|
+
getSpacingBasedOnRatio: () => getSpacingBasedOnRatio,
|
|
444
|
+
getSpacingByKey: () => getSpacingByKey,
|
|
445
|
+
getTheme: () => getTheme,
|
|
446
|
+
getTimingByKey: () => getTimingByKey,
|
|
447
|
+
getTimingFunction: () => getTimingFunction,
|
|
448
|
+
hexToRgb: () => hexToRgb,
|
|
449
|
+
hexToRgbArray: () => hexToRgbArray,
|
|
450
|
+
hexToRgba: () => hexToRgba,
|
|
451
|
+
hslToRgb: () => hslToRgb,
|
|
452
|
+
isArray: () => isArray2,
|
|
453
|
+
isFunction: () => isFunction2,
|
|
454
|
+
isObject: () => isObject2,
|
|
455
|
+
isObjectLike: () => isObjectLike2,
|
|
456
|
+
isString: () => isString2,
|
|
457
|
+
merge: () => merge2,
|
|
458
|
+
mixTwoColors: () => mixTwoColors,
|
|
459
|
+
mixTwoRgb: () => mixTwoRgb,
|
|
460
|
+
mixTwoRgba: () => mixTwoRgba,
|
|
461
|
+
numToLetterMap: () => numToLetterMap,
|
|
462
|
+
opacify: () => opacify,
|
|
463
|
+
rgbArrayToHex: () => rgbArrayToHex,
|
|
464
|
+
rgbToHSL: () => rgbToHSL,
|
|
465
|
+
rgbToHex: () => rgbToHex,
|
|
466
|
+
runThroughMedia: () => runThroughMedia,
|
|
467
|
+
set: () => set,
|
|
468
|
+
setActiveConfig: () => setActiveConfig,
|
|
469
|
+
setColor: () => setColor,
|
|
470
|
+
setCustomFont: () => setCustomFont,
|
|
471
|
+
setCustomFontMedia: () => setCustomFontMedia,
|
|
472
|
+
setEach: () => setEach,
|
|
473
|
+
setFont: () => setFont,
|
|
474
|
+
setFontFamily: () => setFontFamily,
|
|
475
|
+
setGradient: () => setGradient,
|
|
476
|
+
setIcon: () => setIcon,
|
|
477
|
+
setInCustomFontMedia: () => setInCustomFontMedia,
|
|
478
|
+
setMediaTheme: () => setMediaTheme,
|
|
479
|
+
setSVG: () => setSVG,
|
|
480
|
+
setTheme: () => setTheme,
|
|
481
|
+
setValue: () => setValue,
|
|
482
|
+
setVariables: () => setVariables
|
|
483
|
+
});
|
|
484
|
+
module.exports = __toCommonJS(src_exports);
|
|
485
|
+
var window2 = globalThis;
|
|
486
|
+
var document2 = window2.document;
|
|
487
|
+
var isObject = (arg) => {
|
|
488
|
+
if (arg === null)
|
|
489
|
+
return false;
|
|
490
|
+
return typeof arg === "object" && arg.constructor === Object;
|
|
491
|
+
};
|
|
492
|
+
var isString = (arg) => typeof arg === "string";
|
|
493
|
+
var isNumber = (arg) => typeof arg === "number";
|
|
494
|
+
var isFunction = (arg) => typeof arg === "function";
|
|
495
|
+
var isBoolean = (arg) => arg === true || arg === false;
|
|
496
|
+
var isNull = (arg) => arg === null;
|
|
497
|
+
var isArray = (arg) => Array.isArray(arg);
|
|
498
|
+
var isObjectLike = (arg) => {
|
|
499
|
+
if (arg === null)
|
|
500
|
+
return false;
|
|
501
|
+
return typeof arg === "object";
|
|
502
|
+
};
|
|
503
|
+
var isDefined = (arg) => {
|
|
504
|
+
return isObject(arg) || isObjectLike(arg) || isString(arg) || isNumber(arg) || isFunction(arg) || isArray(arg) || isObjectLike(arg) || isBoolean(arg) || isNull(arg);
|
|
505
|
+
};
|
|
506
|
+
var exec = (param, element, state) => {
|
|
507
|
+
if (isFunction(param))
|
|
508
|
+
return param(element, state || element.state);
|
|
509
|
+
return param;
|
|
510
|
+
};
|
|
511
|
+
var map = (obj2, extention, element) => {
|
|
512
|
+
for (const e in extention) {
|
|
513
|
+
obj2[e] = exec(extention[e], element);
|
|
514
|
+
}
|
|
515
|
+
};
|
|
516
|
+
var merge = (element, obj2) => {
|
|
517
|
+
for (const e in obj2) {
|
|
518
|
+
const elementProp = element[e];
|
|
519
|
+
const objProp2 = obj2[e];
|
|
520
|
+
if (elementProp === void 0) {
|
|
521
|
+
element[e] = objProp2;
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
return element;
|
|
525
|
+
};
|
|
526
|
+
var deepMerge = (element, extend) => {
|
|
527
|
+
for (const e in extend) {
|
|
528
|
+
const elementProp = element[e];
|
|
529
|
+
const extendProp = extend[e];
|
|
530
|
+
if (e === "parent" || e === "props")
|
|
531
|
+
continue;
|
|
532
|
+
if (elementProp === void 0) {
|
|
533
|
+
element[e] = extendProp;
|
|
534
|
+
} else if (isObjectLike(elementProp) && isObject(extendProp)) {
|
|
535
|
+
deepMerge(elementProp, extendProp);
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
return element;
|
|
539
|
+
};
|
|
540
|
+
var clone = (obj2) => {
|
|
541
|
+
const o = {};
|
|
542
|
+
for (const prop2 in obj2) {
|
|
543
|
+
if (prop2 === "node")
|
|
544
|
+
continue;
|
|
545
|
+
o[prop2] = obj2[prop2];
|
|
546
|
+
}
|
|
547
|
+
return o;
|
|
548
|
+
};
|
|
549
|
+
var deepCloneExclude = (obj2, exclude = []) => {
|
|
550
|
+
if (isArray(obj2)) {
|
|
551
|
+
return obj2.map((x) => deepCloneExclude(x, exclude));
|
|
552
|
+
}
|
|
553
|
+
const o = {};
|
|
554
|
+
for (const k in obj2) {
|
|
555
|
+
if (exclude.indexOf(k) > -1)
|
|
556
|
+
continue;
|
|
557
|
+
let v = obj2[k];
|
|
558
|
+
if (k === "extend" && isArray(v)) {
|
|
559
|
+
v = mergeArrayExclude(v, exclude);
|
|
560
|
+
}
|
|
561
|
+
if (isArray(v)) {
|
|
562
|
+
o[k] = v.map((x) => deepCloneExclude(x, exclude));
|
|
563
|
+
} else if (isObject(v)) {
|
|
564
|
+
o[k] = deepCloneExclude(v, exclude);
|
|
565
|
+
} else
|
|
566
|
+
o[k] = v;
|
|
567
|
+
}
|
|
568
|
+
return o;
|
|
569
|
+
};
|
|
570
|
+
var mergeArrayExclude = (arr, excl = []) => {
|
|
571
|
+
return arr.reduce((acc, curr) => deepMerge(acc, deepCloneExclude(curr, excl)), {});
|
|
572
|
+
};
|
|
573
|
+
var deepClone = (obj2) => {
|
|
574
|
+
if (isArray(obj2)) {
|
|
575
|
+
return obj2.map(deepClone);
|
|
576
|
+
}
|
|
577
|
+
const o = {};
|
|
578
|
+
for (const prop2 in obj2) {
|
|
579
|
+
let objProp2 = obj2[prop2];
|
|
580
|
+
if (prop2 === "extend" && isArray(objProp2)) {
|
|
581
|
+
objProp2 = mergeArray(objProp2);
|
|
582
|
+
}
|
|
583
|
+
if (isArray(objProp2)) {
|
|
584
|
+
o[prop2] = objProp2.map((v) => isObject(v) ? deepClone(v) : v);
|
|
585
|
+
} else if (isObject(objProp2)) {
|
|
586
|
+
o[prop2] = deepClone(objProp2);
|
|
587
|
+
} else
|
|
588
|
+
o[prop2] = objProp2;
|
|
589
|
+
}
|
|
590
|
+
return o;
|
|
591
|
+
};
|
|
592
|
+
var deepStringify = (obj2, stringified2 = {}) => {
|
|
593
|
+
for (const prop2 in obj2) {
|
|
594
|
+
const objProp2 = obj2[prop2];
|
|
595
|
+
if (isFunction(objProp2)) {
|
|
596
|
+
stringified2[prop2] = objProp2.toString();
|
|
597
|
+
} else if (isObject(objProp2)) {
|
|
598
|
+
stringified2[prop2] = {};
|
|
599
|
+
deepStringify(objProp2[prop2], stringified2[prop2]);
|
|
600
|
+
} else if (isArray(objProp2)) {
|
|
601
|
+
stringified2[prop2] = [];
|
|
602
|
+
objProp2.map((v, i) => deepStringify(v, stringified2[prop2][i]));
|
|
603
|
+
} else
|
|
604
|
+
stringified2[prop2] = objProp2;
|
|
605
|
+
}
|
|
606
|
+
return stringified2;
|
|
607
|
+
};
|
|
608
|
+
var deepDestringify = (obj, stringified = {}) => {
|
|
609
|
+
for (const prop in obj) {
|
|
610
|
+
const objProp = obj[prop];
|
|
611
|
+
if (isString(objProp)) {
|
|
612
|
+
if (objProp.includes("=>") || objProp.includes("function") || objProp[0] === "(") {
|
|
613
|
+
try {
|
|
614
|
+
const evalProp = eval(objProp);
|
|
615
|
+
stringified[prop] = evalProp;
|
|
616
|
+
} catch (e) {
|
|
617
|
+
if (e)
|
|
618
|
+
stringified[prop] = objProp;
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
} else
|
|
622
|
+
stringified[prop] = objProp;
|
|
623
|
+
if (isObject(objProp))
|
|
624
|
+
deepDestringify(stringified[prop], stringified[prop]);
|
|
625
|
+
}
|
|
626
|
+
return stringified;
|
|
627
|
+
};
|
|
628
|
+
var overwrite = (element, params, options) => {
|
|
629
|
+
const { ref } = element;
|
|
630
|
+
const changes = {};
|
|
631
|
+
for (const e in params) {
|
|
632
|
+
if (e === "props")
|
|
633
|
+
continue;
|
|
634
|
+
const elementProp = element[e];
|
|
635
|
+
const paramsProp = params[e];
|
|
636
|
+
if (paramsProp) {
|
|
637
|
+
ref.__cache[e] = changes[e] = elementProp;
|
|
638
|
+
ref[e] = paramsProp;
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
return changes;
|
|
642
|
+
};
|
|
643
|
+
var diff = (obj2, original, cache) => {
|
|
644
|
+
const changes = cache || {};
|
|
645
|
+
for (const e in obj2) {
|
|
646
|
+
if (e === "ref")
|
|
647
|
+
continue;
|
|
648
|
+
const originalProp = original[e];
|
|
649
|
+
const objProp2 = obj2[e];
|
|
650
|
+
if (isObjectLike(originalProp) && isObjectLike(objProp2)) {
|
|
651
|
+
changes[e] = {};
|
|
652
|
+
diff(originalProp, objProp2, changes[e]);
|
|
653
|
+
} else if (objProp2 !== void 0) {
|
|
654
|
+
changes[e] = objProp2;
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
return changes;
|
|
658
|
+
};
|
|
659
|
+
var overwriteObj = (params, obj2) => {
|
|
660
|
+
const changes = {};
|
|
661
|
+
for (const e in params) {
|
|
662
|
+
const objProp2 = obj2[e];
|
|
663
|
+
const paramsProp = params[e];
|
|
664
|
+
if (paramsProp) {
|
|
665
|
+
obj2[e] = changes[e] = objProp2;
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
return changes;
|
|
669
|
+
};
|
|
670
|
+
var overwriteDeep = (params, obj2) => {
|
|
671
|
+
for (const e in params) {
|
|
672
|
+
const objProp2 = obj2[e];
|
|
673
|
+
const paramsProp = params[e];
|
|
674
|
+
if (isObjectLike(objProp2) && isObjectLike(paramsProp)) {
|
|
675
|
+
overwriteDeep(objProp2, paramsProp);
|
|
676
|
+
} else if (paramsProp !== void 0) {
|
|
677
|
+
obj2[e] = paramsProp;
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
return obj2;
|
|
681
|
+
};
|
|
682
|
+
var mergeIfExisted = (a, b) => {
|
|
683
|
+
if (isObjectLike(a) && isObjectLike(b))
|
|
684
|
+
return deepMerge(a, b);
|
|
685
|
+
return a || b;
|
|
686
|
+
};
|
|
687
|
+
var mergeArray = (arr) => {
|
|
688
|
+
return arr.reduce((a, c) => deepMerge(a, deepClone(c)), {});
|
|
689
|
+
};
|
|
690
|
+
var mergeAndCloneIfArray = (obj2) => {
|
|
691
|
+
return isArray(obj2) ? mergeArray(obj2) : deepClone(obj2);
|
|
692
|
+
};
|
|
693
|
+
var flattenRecursive = (param, prop2, stack = []) => {
|
|
694
|
+
const objectized = mergeAndCloneIfArray(param);
|
|
695
|
+
stack.push(objectized);
|
|
696
|
+
const extendOfExtend = objectized[prop2];
|
|
697
|
+
if (extendOfExtend)
|
|
698
|
+
flattenRecursive(extendOfExtend, prop2, stack);
|
|
699
|
+
delete objectized[prop2];
|
|
700
|
+
return stack;
|
|
701
|
+
};
|
|
702
|
+
var isEqualDeep = (param, element) => {
|
|
703
|
+
if (param === element)
|
|
704
|
+
return true;
|
|
705
|
+
if (!param || !element)
|
|
706
|
+
return false;
|
|
707
|
+
for (const prop2 in param) {
|
|
708
|
+
const paramProp = param[prop2];
|
|
709
|
+
const elementProp = element[prop2];
|
|
710
|
+
if (isObjectLike(paramProp)) {
|
|
711
|
+
const isEqual = isEqualDeep(paramProp, elementProp);
|
|
712
|
+
if (!isEqual)
|
|
713
|
+
return false;
|
|
714
|
+
} else {
|
|
715
|
+
const isEqual = paramProp === elementProp;
|
|
716
|
+
if (!isEqual)
|
|
717
|
+
return false;
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
return true;
|
|
721
|
+
};
|
|
722
|
+
var createID = function() {
|
|
723
|
+
let index = 0;
|
|
724
|
+
function newId() {
|
|
725
|
+
index++;
|
|
726
|
+
return index;
|
|
727
|
+
}
|
|
728
|
+
return newId;
|
|
729
|
+
}();
|
|
730
|
+
var defaultConfig_exports = {};
|
|
731
|
+
__export(defaultConfig_exports, {
|
|
732
|
+
ANIMATION: () => ANIMATION,
|
|
733
|
+
BREAKPOINTS: () => BREAKPOINTS,
|
|
734
|
+
CASES: () => CASES,
|
|
735
|
+
COLOR: () => COLOR,
|
|
736
|
+
DEVICES: () => DEVICES,
|
|
737
|
+
DOCUMENT: () => DOCUMENT,
|
|
738
|
+
FONT: () => FONT,
|
|
739
|
+
FONT_FACE: () => FONT_FACE,
|
|
740
|
+
FONT_FAMILY: () => FONT_FAMILY,
|
|
741
|
+
FONT_FAMILY_TYPES: () => FONT_FAMILY_TYPES,
|
|
742
|
+
GRADIENT: () => GRADIENT,
|
|
743
|
+
ICONS: () => ICONS,
|
|
744
|
+
MEDIA: () => MEDIA,
|
|
745
|
+
RESET: () => RESET,
|
|
746
|
+
SEQUENCE: () => SEQUENCE,
|
|
747
|
+
SPACING: () => SPACING,
|
|
748
|
+
SVG: () => SVG,
|
|
749
|
+
SVG_DATA: () => SVG_DATA,
|
|
750
|
+
THEME: () => THEME,
|
|
751
|
+
TIMING: () => TIMING,
|
|
752
|
+
TYPOGRAPHY: () => TYPOGRAPHY,
|
|
753
|
+
UNIT: () => UNIT
|
|
754
|
+
});
|
|
755
|
+
var SEQUENCE = {
|
|
756
|
+
"minor-second": 1.067,
|
|
757
|
+
"major-second": 1.125,
|
|
758
|
+
"minor-third": 1.2,
|
|
759
|
+
"major-third": 1.25,
|
|
760
|
+
"perfect-fourth": 1.333,
|
|
761
|
+
"augmented-fourth": 1.414,
|
|
762
|
+
"perfect-fifth": 1.5,
|
|
763
|
+
"minor-sixth": 1.6,
|
|
764
|
+
phi: 1.618,
|
|
765
|
+
// golden-ratio
|
|
766
|
+
"major-sixth": 1.667,
|
|
767
|
+
"square-root-3": 1.732,
|
|
768
|
+
// theodorus
|
|
769
|
+
"minor-seventh": 1.778,
|
|
770
|
+
"major-seventh": 1.875,
|
|
771
|
+
octave: 2,
|
|
772
|
+
"square-root-5": 2.23,
|
|
773
|
+
// pythagoras
|
|
774
|
+
"major-tenth": 2.5,
|
|
775
|
+
"major-eleventh": 2.667,
|
|
776
|
+
"major-twelfth": 3,
|
|
777
|
+
pi: 3.14,
|
|
778
|
+
// archimedes
|
|
779
|
+
"double-octave": 4
|
|
780
|
+
};
|
|
781
|
+
var UNIT = {
|
|
782
|
+
default: "em"
|
|
783
|
+
};
|
|
784
|
+
var defaultProps = {
|
|
785
|
+
browserDefault: 16,
|
|
786
|
+
base: 16,
|
|
787
|
+
type: "font-size",
|
|
788
|
+
ratio: SEQUENCE["minor-third"],
|
|
789
|
+
range: [-3, 12],
|
|
790
|
+
h1Matches: 6,
|
|
791
|
+
lineHeight: 1.5,
|
|
792
|
+
unit: "em",
|
|
793
|
+
templates: {},
|
|
794
|
+
sequence: {},
|
|
795
|
+
scales: {},
|
|
796
|
+
vars: {}
|
|
797
|
+
};
|
|
798
|
+
var TYPOGRAPHY = defaultProps;
|
|
799
|
+
var FONT = {};
|
|
800
|
+
var isString2 = (arg) => typeof arg === "string";
|
|
801
|
+
var isArray2 = (arg) => Array.isArray(arg);
|
|
802
|
+
var isObject2 = (arg) => {
|
|
803
|
+
if (arg === null)
|
|
804
|
+
return false;
|
|
805
|
+
return typeof arg === "object" && arg.constructor === Object;
|
|
806
|
+
};
|
|
807
|
+
var isObjectLike2 = (arg) => {
|
|
808
|
+
if (arg === null)
|
|
809
|
+
return false;
|
|
810
|
+
return typeof arg === "object";
|
|
811
|
+
};
|
|
812
|
+
var merge2 = (obj2, original) => {
|
|
813
|
+
for (const e in original) {
|
|
814
|
+
const objProp2 = obj2[e];
|
|
815
|
+
const originalProp = original[e];
|
|
816
|
+
if (objProp2 === void 0) {
|
|
817
|
+
obj2[e] = originalProp;
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
return obj2;
|
|
821
|
+
};
|
|
822
|
+
var deepMerge2 = (obj2, obj22) => {
|
|
823
|
+
for (const e in obj22) {
|
|
824
|
+
const objProp2 = obj2[e];
|
|
825
|
+
const obj2Prop = obj22[e];
|
|
826
|
+
if (objProp2 === void 0) {
|
|
827
|
+
obj2[e] = obj2Prop;
|
|
828
|
+
} else if (isObjectLike2(objProp2) && isObject2(obj2Prop)) {
|
|
829
|
+
deepMerge2(objProp2, obj2Prop);
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
return obj2;
|
|
833
|
+
};
|
|
834
|
+
var arrayze = (val) => {
|
|
835
|
+
if (isString2(val))
|
|
836
|
+
return val.split(" ");
|
|
837
|
+
if (isObject2(val))
|
|
838
|
+
return Object.keys(val).map((v) => val[v]);
|
|
839
|
+
if (isArray2(val))
|
|
840
|
+
return val;
|
|
841
|
+
};
|
|
842
|
+
var isFunction2 = (arg) => typeof arg === "function";
|
|
843
|
+
var ENV = "development";
|
|
844
|
+
var colorStringToRgbaArray = (color) => {
|
|
845
|
+
if (color === "")
|
|
846
|
+
return;
|
|
847
|
+
if (color.toLowerCase() === "transparent")
|
|
848
|
+
return [0, 0, 0, 0];
|
|
849
|
+
if (color[0] === "#") {
|
|
850
|
+
if (color.length < 7) {
|
|
851
|
+
color = "#" + color[1] + color[1] + color[2] + color[2] + color[3] + color[3] + (color.length > 4 ? color[4] + color[4] : "");
|
|
852
|
+
}
|
|
853
|
+
return [
|
|
854
|
+
parseInt(color.substr(1, 2), 16),
|
|
855
|
+
parseInt(color.substr(3, 2), 16),
|
|
856
|
+
parseInt(color.substr(5, 2), 16),
|
|
857
|
+
color.length > 7 ? parseInt(color.substr(7, 2), 16) / 255 : 1
|
|
858
|
+
];
|
|
859
|
+
}
|
|
860
|
+
if (color.indexOf("rgb") === -1) {
|
|
861
|
+
if (document2 && window2) {
|
|
862
|
+
const elem = document2.body.appendChild(document2.createElement("fictum"));
|
|
863
|
+
const flag = "rgb(1, 2, 3)";
|
|
864
|
+
elem.style.color = flag;
|
|
865
|
+
if (elem.style.color !== flag)
|
|
866
|
+
return;
|
|
867
|
+
elem.style.color = color;
|
|
868
|
+
if (elem.style.color === flag || elem.style.color === "")
|
|
869
|
+
return;
|
|
870
|
+
color = window2.getComputedStyle(elem).color;
|
|
871
|
+
document2.body.removeChild(elem);
|
|
872
|
+
} else
|
|
873
|
+
console.warn("Color conversion failed, no document or window object found");
|
|
874
|
+
}
|
|
875
|
+
if (color.indexOf("rgb") === 0) {
|
|
876
|
+
if (color.indexOf("rgba") === -1)
|
|
877
|
+
color = `${color}, 1`;
|
|
878
|
+
return color.match(/[\.\d]+/g).map((a) => +a);
|
|
879
|
+
}
|
|
880
|
+
};
|
|
881
|
+
var mixTwoColors = (colorA, colorB, range = 0.5) => {
|
|
882
|
+
colorA = colorStringToRgbaArray(colorA);
|
|
883
|
+
colorB = colorStringToRgbaArray(colorB);
|
|
884
|
+
return mixTwoRgba(colorA, colorB, range);
|
|
885
|
+
};
|
|
886
|
+
var hexToRgb = (hex, alpha = 1) => {
|
|
887
|
+
const [r, g, b] = hex.match(/\w\w/g).map((x) => parseInt(x, 16));
|
|
888
|
+
return `rgb(${r},${g},${b})`;
|
|
889
|
+
};
|
|
890
|
+
var hexToRgbArray = (hex, alpha = 1) => {
|
|
891
|
+
const [r, g, b] = hex.match(/\w\w/g).map((x) => parseInt(x, 16));
|
|
892
|
+
return [r, g, b];
|
|
893
|
+
};
|
|
894
|
+
var rgbToHex = (r, g, b) => {
|
|
895
|
+
return "#" + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);
|
|
896
|
+
};
|
|
897
|
+
var rgbArrayToHex = ([r, g, b]) => {
|
|
898
|
+
return ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);
|
|
899
|
+
};
|
|
900
|
+
var hexToRgba = (hex, alpha = 1) => {
|
|
901
|
+
const [r, g, b] = hex.match(/\w\w/g).map((x) => parseInt(x, 16));
|
|
902
|
+
return `rgba(${r},${g},${b},${alpha})`;
|
|
903
|
+
};
|
|
904
|
+
var mixTwoRgb = (colorA, colorB, range = 0.5) => {
|
|
905
|
+
const arr = [];
|
|
906
|
+
for (let i = 0; i < 3; i++) {
|
|
907
|
+
arr[i] = ~~(colorA[i] + (colorB[i] - colorA[i]) * range);
|
|
908
|
+
}
|
|
909
|
+
return `rgb(${arr})`;
|
|
910
|
+
};
|
|
911
|
+
var changeLightness = (delta, hsl) => {
|
|
912
|
+
const [hue, saturation, lightness] = hsl;
|
|
913
|
+
const newLightness = Math.max(
|
|
914
|
+
0,
|
|
915
|
+
Math.min(100, lightness + parseFloat(delta))
|
|
916
|
+
);
|
|
917
|
+
return [hue, saturation, newLightness];
|
|
918
|
+
};
|
|
919
|
+
var rgbToHSL = (r, g, b) => {
|
|
920
|
+
const a = Math.max(r, g, b);
|
|
921
|
+
const n = a - Math.min(r, g, b);
|
|
922
|
+
const f = 1 - Math.abs(a + a - n - 1);
|
|
923
|
+
const h = n && (a == r ? (g - b) / n : a == g ? 2 + (b - r) / n : 4 + (r - g) / n);
|
|
924
|
+
return [60 * (h < 0 ? h + 6 : h), f ? n / f : 0, (a + a - n) / 2];
|
|
925
|
+
};
|
|
926
|
+
var hslToRgb = (h, s, l, a = s * Math.min(l, 1 - l), f = (n, k = (n + h / 30) % 12) => l - a * Math.max(
|
|
927
|
+
Math.min(k - 3, 9 - k, 1),
|
|
928
|
+
-1
|
|
929
|
+
)) => [f(0), f(8), f(4)];
|
|
930
|
+
var getColorShade = (col, amt) => {
|
|
931
|
+
const num = parseInt(col, 16);
|
|
932
|
+
let r = (num >> 16) + amt;
|
|
933
|
+
if (r > 255)
|
|
934
|
+
r = 255;
|
|
935
|
+
else if (r < 0)
|
|
936
|
+
r = 0;
|
|
937
|
+
let b = (num >> 8 & 255) + amt;
|
|
938
|
+
if (b > 255)
|
|
939
|
+
b = 255;
|
|
940
|
+
else if (b < 0)
|
|
941
|
+
b = 0;
|
|
942
|
+
let g = (num & 255) + amt;
|
|
943
|
+
if (g > 255)
|
|
944
|
+
g = 255;
|
|
945
|
+
else if (g < 0)
|
|
946
|
+
g = 0;
|
|
947
|
+
return (g | b << 8 | r << 16).toString(16);
|
|
948
|
+
};
|
|
949
|
+
var mixTwoRgba = (colorA, colorB, range = 0.5) => {
|
|
950
|
+
const arr = [];
|
|
951
|
+
for (let i = 0; i < 4; i++) {
|
|
952
|
+
const round = i === 3 ? (x) => x : Math.round;
|
|
953
|
+
arr[i] = round(
|
|
954
|
+
colorA[i] + (colorB[i] - colorA[i]) * range
|
|
955
|
+
);
|
|
956
|
+
}
|
|
957
|
+
return `rgba(${arr})`;
|
|
958
|
+
};
|
|
959
|
+
var opacify = (color, opacity) => {
|
|
960
|
+
const arr = colorStringToRgbaArray(color);
|
|
961
|
+
if (!arr) {
|
|
962
|
+
if (ENV === "test" || ENV === "development")
|
|
963
|
+
console.warn(color + "color is not rgba");
|
|
964
|
+
return;
|
|
965
|
+
}
|
|
966
|
+
arr[3] = opacity;
|
|
967
|
+
return `rgba(${arr})`;
|
|
968
|
+
};
|
|
969
|
+
var getDefaultOrFirstKey = (LIBRARY, key) => {
|
|
970
|
+
if (LIBRARY[key])
|
|
971
|
+
return LIBRARY[key].value;
|
|
972
|
+
if (LIBRARY.default)
|
|
973
|
+
return LIBRARY[LIBRARY.default].value;
|
|
974
|
+
const hasValue = Object.keys(LIBRARY)[0];
|
|
975
|
+
return hasValue && LIBRARY[hasValue] && LIBRARY[hasValue].value;
|
|
976
|
+
};
|
|
977
|
+
var getFontFormat = (url) => url.split(/[#?]/)[0].split(".").pop().trim();
|
|
978
|
+
var setInCustomFontMedia = (str) => `@font-face { ${str} }`;
|
|
979
|
+
var setCustomFont = (name, url, weight) => `
|
|
980
|
+
font-family: '${name}';
|
|
981
|
+
font-style: normal;
|
|
982
|
+
${weight && `font-weight: ${weight};`}
|
|
983
|
+
src: url('${url}') format('${getFontFormat(url)}');`;
|
|
984
|
+
var setCustomFontMedia = (name, url, weight) => `@font-face {
|
|
985
|
+
${setCustomFont(name, url, weight)}
|
|
986
|
+
}`;
|
|
987
|
+
var getFontFaceEach = (name, weights) => {
|
|
988
|
+
const keys = Object.keys(weights);
|
|
989
|
+
return keys.map((key) => {
|
|
990
|
+
const { url, fontWeight } = weights[key];
|
|
991
|
+
return setCustomFont(name, url, fontWeight);
|
|
992
|
+
});
|
|
993
|
+
};
|
|
994
|
+
var getFontFace = (LIBRARY) => {
|
|
995
|
+
const keys = Object.keys(LIBRARY);
|
|
996
|
+
return keys.map((key) => getFontFaceEach(key, LIBRARY[key].value));
|
|
997
|
+
};
|
|
998
|
+
var getFontFaceEachString = (name, weights) => {
|
|
999
|
+
const isArr = weights[0];
|
|
1000
|
+
if (isArr)
|
|
1001
|
+
return getFontFaceEach(name, weights).map(setInCustomFontMedia);
|
|
1002
|
+
return setCustomFontMedia(name, weights.url);
|
|
1003
|
+
};
|
|
1004
|
+
var getFontFaceString = (LIBRARY) => {
|
|
1005
|
+
const keys = Object.keys(LIBRARY);
|
|
1006
|
+
return keys.map((key) => getFontFaceEachString(key, LIBRARY[key].value));
|
|
1007
|
+
};
|
|
1008
|
+
var toCamelCase = (str) => {
|
|
1009
|
+
return str.replace(/(?:^\w|[A-Z]|\b\w)/g, function(word, index) {
|
|
1010
|
+
return index === 0 ? word.toLowerCase() : word.toUpperCase();
|
|
1011
|
+
}).replaceAll(/\s+/g, "");
|
|
1012
|
+
};
|
|
1013
|
+
var toDashCase = (val) => val.replace(/[A-Z]/g, (match2, offset) => (offset > 0 ? "-" : "") + match2.toLowerCase()).replace(".", "-");
|
|
1014
|
+
var numToLetterMap = {
|
|
1015
|
+
"-6": "U",
|
|
1016
|
+
"-5": "V",
|
|
1017
|
+
"-4": "W",
|
|
1018
|
+
"-3": "X",
|
|
1019
|
+
"-2": "Y",
|
|
1020
|
+
"-1": "Z",
|
|
1021
|
+
0: "A",
|
|
1022
|
+
1: "B",
|
|
1023
|
+
2: "C",
|
|
1024
|
+
3: "D",
|
|
1025
|
+
4: "E",
|
|
1026
|
+
5: "F",
|
|
1027
|
+
6: "G",
|
|
1028
|
+
7: "H",
|
|
1029
|
+
8: "I",
|
|
1030
|
+
9: "J",
|
|
1031
|
+
10: "K",
|
|
1032
|
+
11: "L",
|
|
1033
|
+
12: "M",
|
|
1034
|
+
13: "N",
|
|
1035
|
+
14: "O",
|
|
1036
|
+
15: "P",
|
|
1037
|
+
16: "Q",
|
|
1038
|
+
17: "R",
|
|
1039
|
+
18: "S",
|
|
1040
|
+
19: "T"
|
|
1041
|
+
};
|
|
1042
|
+
var setSequenceValue = (props, sequenceProps) => {
|
|
1043
|
+
const { key, variable, value, scaling, index } = props;
|
|
1044
|
+
sequenceProps.sequence[key] = {
|
|
1045
|
+
key,
|
|
1046
|
+
decimal: ~~(value * 100) / 100,
|
|
1047
|
+
val: ~~value,
|
|
1048
|
+
scaling,
|
|
1049
|
+
index,
|
|
1050
|
+
variable
|
|
1051
|
+
};
|
|
1052
|
+
sequenceProps.scales[key] = scaling;
|
|
1053
|
+
sequenceProps.vars[variable] = scaling + sequenceProps.unit;
|
|
1054
|
+
};
|
|
1055
|
+
var generateSubSequence = (props, sequenceProps) => {
|
|
1056
|
+
const { key, base, value, ratio, variable, index } = props;
|
|
1057
|
+
const next2 = value * ratio;
|
|
1058
|
+
const diff22 = next2 - value;
|
|
1059
|
+
const smallscale = diff22 / 1.618;
|
|
1060
|
+
const valueRounded = ~~value;
|
|
1061
|
+
const nextRounded = ~~next2;
|
|
1062
|
+
const diffRounded = nextRounded - valueRounded;
|
|
1063
|
+
let arr = [];
|
|
1064
|
+
const first = next2 - smallscale;
|
|
1065
|
+
const second = value + smallscale;
|
|
1066
|
+
const middle = (first + second) / 2;
|
|
1067
|
+
if (diffRounded > 16)
|
|
1068
|
+
arr = [first, middle, second];
|
|
1069
|
+
else
|
|
1070
|
+
arr = [first, second];
|
|
1071
|
+
arr.map((v, k) => {
|
|
1072
|
+
const scaling = ~~(v / base * 1e3) / 1e3;
|
|
1073
|
+
const newVar = variable + (k + 1);
|
|
1074
|
+
const props2 = {
|
|
1075
|
+
key: key + (k + 1),
|
|
1076
|
+
variable: newVar,
|
|
1077
|
+
value: v,
|
|
1078
|
+
scaling,
|
|
1079
|
+
index: index + (k + 1) / 10
|
|
1080
|
+
};
|
|
1081
|
+
return setSequenceValue(props2, sequenceProps);
|
|
1082
|
+
});
|
|
1083
|
+
};
|
|
1084
|
+
var switchSequenceOnNegative = (key, base, ratio) => {
|
|
1085
|
+
return base * Math.pow(ratio, key);
|
|
1086
|
+
};
|
|
1087
|
+
var generateSequence = (sequenceProps) => {
|
|
1088
|
+
const { type, base, ratio, range, subSequence } = sequenceProps;
|
|
1089
|
+
const n = Math.abs(range[0]) + Math.abs(range[1]);
|
|
1090
|
+
const prefix2 = "--" + (type && type.replace(".", "-")) + "-";
|
|
1091
|
+
for (let i = 0; i <= n; i++) {
|
|
1092
|
+
const key = range[1] - i;
|
|
1093
|
+
const letterKey = numToLetterMap[key];
|
|
1094
|
+
const value = switchSequenceOnNegative(key, base, ratio);
|
|
1095
|
+
const scaling = ~~(value / base * 100) / 100;
|
|
1096
|
+
const variable = prefix2 + letterKey;
|
|
1097
|
+
const props = {
|
|
1098
|
+
key: letterKey,
|
|
1099
|
+
variable,
|
|
1100
|
+
value,
|
|
1101
|
+
base,
|
|
1102
|
+
scaling,
|
|
1103
|
+
ratio,
|
|
1104
|
+
index: key
|
|
1105
|
+
};
|
|
1106
|
+
setSequenceValue(props, sequenceProps);
|
|
1107
|
+
if (subSequence)
|
|
1108
|
+
generateSubSequence(props, sequenceProps);
|
|
1109
|
+
}
|
|
1110
|
+
return sequenceProps;
|
|
1111
|
+
};
|
|
1112
|
+
var getSequenceValue = (value = "A", sequenceProps) => {
|
|
1113
|
+
const CONFIG2 = getActiveConfig();
|
|
1114
|
+
const { UNIT: UNIT22 } = CONFIG2;
|
|
1115
|
+
const {
|
|
1116
|
+
sequence,
|
|
1117
|
+
unit = UNIT22.default,
|
|
1118
|
+
useVariable
|
|
1119
|
+
} = sequenceProps;
|
|
1120
|
+
if (isString(value) && value.slice(0, 2) === "--")
|
|
1121
|
+
return `var(${value})`;
|
|
1122
|
+
const prefix2 = `--${toDashCase(sequenceProps.type.replace(".", "-"))}-`;
|
|
1123
|
+
const startsWithDashOrLetterRegex = /^-?[a-zA-Z]/i;
|
|
1124
|
+
const startsWithDashOrLetter = startsWithDashOrLetterRegex.test(value);
|
|
1125
|
+
if (value === "none" || value === "auto" || value === "unset" || value === "inherit" || value === "fit-content" || value === "min-content" || value === "max-content" || value.includes("calc") || !startsWithDashOrLetter)
|
|
1126
|
+
return value;
|
|
1127
|
+
const letterVal = value.toUpperCase();
|
|
1128
|
+
const isNegative = letterVal.slice(0, 1) === "-" ? "-" : "";
|
|
1129
|
+
let absValue = isNegative ? letterVal.slice(1) : letterVal;
|
|
1130
|
+
let mediaName = "";
|
|
1131
|
+
if (absValue.includes("-")) {
|
|
1132
|
+
mediaName = "-" + absValue.split("-")[1].toLowerCase();
|
|
1133
|
+
absValue = absValue.split("-")[0];
|
|
1134
|
+
}
|
|
1135
|
+
const varValue = (v) => `var(${prefix2}${v}${mediaName})`;
|
|
1136
|
+
if (absValue.includes("+")) {
|
|
1137
|
+
const args = absValue.split("+");
|
|
1138
|
+
const [first, second] = args;
|
|
1139
|
+
const joint = `${varValue(first)} + ${varValue(second)}`;
|
|
1140
|
+
return isNegative ? `calc((${joint}) * -1)` : `calc(${joint})`;
|
|
1141
|
+
} else if (absValue.includes("-")) {
|
|
1142
|
+
const args = absValue.split("-");
|
|
1143
|
+
const [first, second] = args;
|
|
1144
|
+
const joint = `${varValue(first)} - ${varValue(second)}`;
|
|
1145
|
+
return isNegative ? `calc((${joint}) * -1)` : `calc(${joint})`;
|
|
1146
|
+
}
|
|
1147
|
+
if (!sequence[absValue] && absValue.length === 2) {
|
|
1148
|
+
if (CONFIG2.verbose)
|
|
1149
|
+
console.warn(absValue, "- value is not found because `subSequence` is set to false");
|
|
1150
|
+
absValue = absValue.slice(0, 1);
|
|
1151
|
+
}
|
|
1152
|
+
if (useVariable || CONFIG2.useVariable) {
|
|
1153
|
+
const varValue2 = `var(${prefix2}${absValue}${mediaName})`;
|
|
1154
|
+
return isNegative ? `calc(${varValue2} * -1)` : varValue2;
|
|
1155
|
+
}
|
|
1156
|
+
const sequenceItem = sequence ? sequence[absValue] : null;
|
|
1157
|
+
if (!sequenceItem)
|
|
1158
|
+
return console.warn("can't find", sequence, absValue);
|
|
1159
|
+
if (unit === "ms" || unit === "s") {
|
|
1160
|
+
return isNegative + sequenceItem.val + unit;
|
|
1161
|
+
}
|
|
1162
|
+
return isNegative + sequenceItem.scaling + unit;
|
|
1163
|
+
};
|
|
1164
|
+
var getSequenceValuePropertyPair = (value, propertyName, sequenceProps) => {
|
|
1165
|
+
if (typeof value !== "string") {
|
|
1166
|
+
console.warn(propertyName, value, "is not a string");
|
|
1167
|
+
return {};
|
|
1168
|
+
}
|
|
1169
|
+
if (value === "-" || value === "")
|
|
1170
|
+
return {};
|
|
1171
|
+
return { [propertyName]: getSequenceValue(value, sequenceProps) };
|
|
1172
|
+
};
|
|
1173
|
+
var findHeadingLetter = (h1Matches, index) => numToLetterMap[h1Matches - index];
|
|
1174
|
+
var findHeadings = (propertyNames) => {
|
|
1175
|
+
const { h1Matches, sequence } = propertyNames;
|
|
1176
|
+
return new Array(6).fill(null).map((_, i) => {
|
|
1177
|
+
const findLetter = findHeadingLetter(h1Matches, i);
|
|
1178
|
+
return sequence[findLetter];
|
|
1179
|
+
});
|
|
1180
|
+
};
|
|
1181
|
+
var setVariables = (result, key) => {
|
|
1182
|
+
const CONFIG2 = getActiveConfig();
|
|
1183
|
+
const { CSS_VARS: CSS_VARS2 } = CONFIG2;
|
|
1184
|
+
if (isObjectLike(result.value)) {
|
|
1185
|
+
} else {
|
|
1186
|
+
CSS_VARS2[result.var] = result.value;
|
|
1187
|
+
}
|
|
1188
|
+
};
|
|
1189
|
+
var applySequenceVars = (props, mediaName, options = {}) => {
|
|
1190
|
+
const CONFIG2 = getActiveConfig();
|
|
1191
|
+
const { UNIT: UNIT22, MEDIA: MEDIA2, TIMING: TIMING2, CSS_VARS: CSS_VARS2 } = CONFIG2;
|
|
1192
|
+
const unit = props.unit || UNIT22.default;
|
|
1193
|
+
const { sequence, scales } = props;
|
|
1194
|
+
for (const key in sequence) {
|
|
1195
|
+
const item = sequence[key];
|
|
1196
|
+
const value = (props.type === TIMING2.type ? sequence[key].val : scales[key]) + unit;
|
|
1197
|
+
if (mediaName) {
|
|
1198
|
+
const query = MEDIA2[mediaName];
|
|
1199
|
+
if (!query) {
|
|
1200
|
+
if (CONFIG2.verbose)
|
|
1201
|
+
console.warn("Can't find query ", query);
|
|
1202
|
+
}
|
|
1203
|
+
let underMediaQuery = CSS_VARS2[`@media ${query}`];
|
|
1204
|
+
if (!underMediaQuery)
|
|
1205
|
+
underMediaQuery = CSS_VARS2[`@media ${query}`] = {};
|
|
1206
|
+
underMediaQuery[item.variable] = `var(${item.variable + "-" + mediaName})`;
|
|
1207
|
+
CSS_VARS2[item.variable + "-" + mediaName] = value;
|
|
1208
|
+
} else {
|
|
1209
|
+
if (options.useDefault === false) {
|
|
1210
|
+
CSS_VARS2[item.variable] = value;
|
|
1211
|
+
} else {
|
|
1212
|
+
CSS_VARS2[item.variable + "-default"] = value;
|
|
1213
|
+
CSS_VARS2[item.variable] = `var(${item.variable + "-default"})`;
|
|
1214
|
+
}
|
|
1215
|
+
}
|
|
1216
|
+
}
|
|
1217
|
+
};
|
|
1218
|
+
var generateSprite = (icons) => {
|
|
1219
|
+
let sprite = '<svg aria-hidden="true" width="0" height="0" style="position:absolute">';
|
|
1220
|
+
for (let key in icons) {
|
|
1221
|
+
sprite += icons[key];
|
|
1222
|
+
}
|
|
1223
|
+
sprite += "</svg>";
|
|
1224
|
+
return sprite;
|
|
1225
|
+
};
|
|
1226
|
+
var parseRootAttributes = (htmlString) => {
|
|
1227
|
+
if (!isString(htmlString)) {
|
|
1228
|
+
return console.warn(`parseRootAttributes: ${htmlString} is not a string`);
|
|
1229
|
+
}
|
|
1230
|
+
let match2 = htmlString.match(/<svg\s+(.*?)>/);
|
|
1231
|
+
if (!match2 || !match2[1]) {
|
|
1232
|
+
return {};
|
|
1233
|
+
}
|
|
1234
|
+
let attrString = match2[1];
|
|
1235
|
+
let attrs = attrString.match(/(\S+)=["']?((?:.(?!["']?\s+(?:\S+)=|\s*\/?[>"']))+.)["']?/gm);
|
|
1236
|
+
return attrs.reduce((acc, attr) => {
|
|
1237
|
+
let [key, value] = attr.split("=");
|
|
1238
|
+
acc[key] = value.replace(/['"]/g, "");
|
|
1239
|
+
return acc;
|
|
1240
|
+
}, {});
|
|
1241
|
+
};
|
|
1242
|
+
var convertSvgToSymbol = (key, code) => {
|
|
1243
|
+
const extractAttrs = parseRootAttributes(code);
|
|
1244
|
+
const { width, height } = extractAttrs;
|
|
1245
|
+
const viewBox = extractAttrs.viewBox || `0 0 ${width || 24} ${height || 24}`;
|
|
1246
|
+
const xmlns = "http://www.w3.org/2000/svg";
|
|
1247
|
+
let symbol = code.replace(
|
|
1248
|
+
"<svg",
|
|
1249
|
+
`<symbol id="${key}" xmlns="${xmlns}" viewBox="${viewBox}"`
|
|
1250
|
+
);
|
|
1251
|
+
symbol = symbol.replace(/width="[^\"]*/, "");
|
|
1252
|
+
symbol = symbol.replace(/height="[^\"]*/, "");
|
|
1253
|
+
symbol = symbol.replace("</svg", "</symbol");
|
|
1254
|
+
return symbol;
|
|
1255
|
+
};
|
|
1256
|
+
var FONT_FAMILY = {};
|
|
1257
|
+
var FONT_FAMILY_TYPES = {
|
|
1258
|
+
serif: "Helvetica, Arial, sans-serif, --system-default",
|
|
1259
|
+
"sans-serif": "Times New Roman, Georgia, serif, --system-default",
|
|
1260
|
+
monospace: "Courier New, monospace, --system-default"
|
|
1261
|
+
};
|
|
1262
|
+
var FONT_FACE = getFontFace(FONT_FAMILY);
|
|
1263
|
+
var MEDIA = {
|
|
1264
|
+
tv: "(min-width: 2780px)",
|
|
1265
|
+
screenL: "(max-width: 1920px)",
|
|
1266
|
+
screenM: "(max-width: 1680px)",
|
|
1267
|
+
screenS: "(max-width: 1440px)",
|
|
1268
|
+
tabletL: "(max-width: 1366px)",
|
|
1269
|
+
tabletM: "(max-width: 1280px)",
|
|
1270
|
+
tabletS: "(max-width: 1024px)",
|
|
1271
|
+
mobileL: "(max-width: 768px)",
|
|
1272
|
+
mobileM: "(max-width: 560px)",
|
|
1273
|
+
mobileS: "(max-width: 480px)",
|
|
1274
|
+
mobileXS: "(max-width: 375px)",
|
|
1275
|
+
light: "(prefers-color-scheme: light)",
|
|
1276
|
+
dark: "(prefers-color-scheme: dark)",
|
|
1277
|
+
print: "print"
|
|
1278
|
+
};
|
|
1279
|
+
var defaultProps2 = {
|
|
1280
|
+
base: TYPOGRAPHY.base,
|
|
1281
|
+
type: "spacing",
|
|
1282
|
+
ratio: SEQUENCE.phi,
|
|
1283
|
+
range: [-5, 15],
|
|
1284
|
+
subSequence: true,
|
|
1285
|
+
unit: "em",
|
|
1286
|
+
sequence: {},
|
|
1287
|
+
scales: {},
|
|
1288
|
+
vars: {}
|
|
1289
|
+
};
|
|
1290
|
+
var SPACING = defaultProps2;
|
|
1291
|
+
var COLOR = {};
|
|
1292
|
+
var GRADIENT = {};
|
|
1293
|
+
var THEME = {};
|
|
1294
|
+
var ICONS = {};
|
|
1295
|
+
var defaultProps3 = {
|
|
1296
|
+
default: 150,
|
|
1297
|
+
base: 150,
|
|
1298
|
+
type: "timing",
|
|
1299
|
+
ratio: SEQUENCE["perfect-fourth"],
|
|
1300
|
+
range: [-3, 12],
|
|
1301
|
+
unit: "ms",
|
|
1302
|
+
sequence: {},
|
|
1303
|
+
scales: {},
|
|
1304
|
+
vars: {}
|
|
1305
|
+
};
|
|
1306
|
+
var TIMING = defaultProps3;
|
|
1307
|
+
var DOCUMENT = {};
|
|
1308
|
+
var BREAKPOINTS = {
|
|
1309
|
+
screenL: 1920,
|
|
1310
|
+
screenM: 1680,
|
|
1311
|
+
screenS: 1440,
|
|
1312
|
+
tabletL: 1366,
|
|
1313
|
+
tabletM: 1280,
|
|
1314
|
+
tabletS: 1024,
|
|
1315
|
+
mobileL: 768,
|
|
1316
|
+
mobileM: 560,
|
|
1317
|
+
mobileS: 480,
|
|
1318
|
+
mobileXS: 375
|
|
1319
|
+
};
|
|
1320
|
+
var DEVICES = {
|
|
1321
|
+
screenL: [1920, 1024],
|
|
1322
|
+
screenM: [1680, 1024],
|
|
1323
|
+
screenS: [1440, 978],
|
|
1324
|
+
tabletL: [1366, 926],
|
|
1325
|
+
tabletM: [1280, 768],
|
|
1326
|
+
tabletS: [1024, 768],
|
|
1327
|
+
mobileL: [768, 375],
|
|
1328
|
+
mobileM: [560, 768],
|
|
1329
|
+
mobileS: [480, 768],
|
|
1330
|
+
mobileXS: [375, 768]
|
|
1331
|
+
};
|
|
1332
|
+
var CASES = {};
|
|
1333
|
+
var ANIMATION = {};
|
|
1334
|
+
var SVG = {};
|
|
1335
|
+
var SVG_DATA = {};
|
|
1336
|
+
var RESET = {};
|
|
1337
|
+
var CSS_VARS = {};
|
|
1338
|
+
var CONFIG = {
|
|
1339
|
+
verbose: false,
|
|
1340
|
+
useVariable: true,
|
|
1341
|
+
useReset: true,
|
|
1342
|
+
CSS_VARS,
|
|
1343
|
+
...defaultConfig_exports
|
|
1344
|
+
};
|
|
1345
|
+
var cachedConfig = deepClone(CONFIG);
|
|
1346
|
+
var FACTORY = {
|
|
1347
|
+
active: "0",
|
|
1348
|
+
0: CONFIG
|
|
1349
|
+
};
|
|
1350
|
+
var activateConfig = (def) => {
|
|
1351
|
+
if (isDefined(def)) {
|
|
1352
|
+
FACTORY.active = def;
|
|
1353
|
+
}
|
|
1354
|
+
return FACTORY[def || FACTORY.active];
|
|
1355
|
+
};
|
|
1356
|
+
var getActiveConfig = (def) => {
|
|
1357
|
+
if (isDefined(def) && !FACTORY[def]) {
|
|
1358
|
+
FACTORY[def] = deepClone(cachedConfig);
|
|
1359
|
+
return FACTORY[def];
|
|
1360
|
+
}
|
|
1361
|
+
return FACTORY[def || FACTORY.active];
|
|
1362
|
+
};
|
|
1363
|
+
var setActiveConfig = (def) => {
|
|
1364
|
+
return FACTORY.active = FACTORY[def];
|
|
1365
|
+
};
|
|
1366
|
+
var getColor = (value, key) => {
|
|
1367
|
+
const CONFIG2 = getActiveConfig();
|
|
1368
|
+
if (!isString(value)) {
|
|
1369
|
+
if (CONFIG2.verbose)
|
|
1370
|
+
console.warn(value, "- type for color is not valid");
|
|
1371
|
+
return;
|
|
1372
|
+
}
|
|
1373
|
+
if (value.slice(0, 2) === "--")
|
|
1374
|
+
return `var(${value})`;
|
|
1375
|
+
if (key && value[key])
|
|
1376
|
+
value = value[key];
|
|
1377
|
+
const [name, alpha, tone] = isArray(value) ? value : value.split(" ");
|
|
1378
|
+
const { COLOR: COLOR2, GRADIENT: GRADIENT2 } = CONFIG2;
|
|
1379
|
+
let val = COLOR2[name] || GRADIENT2[name];
|
|
1380
|
+
if (!val) {
|
|
1381
|
+
if (CONFIG2.verbose)
|
|
1382
|
+
console.warn("Can't find color ", name);
|
|
1383
|
+
return value;
|
|
1384
|
+
}
|
|
1385
|
+
if (key) {
|
|
1386
|
+
if (val[key])
|
|
1387
|
+
val = val[key];
|
|
1388
|
+
else if (CONFIG2.verbose)
|
|
1389
|
+
console.warn(value, " - does not have ", key);
|
|
1390
|
+
}
|
|
1391
|
+
let rgb = val.rgb;
|
|
1392
|
+
if (rgb) {
|
|
1393
|
+
if (tone) {
|
|
1394
|
+
if (!val[tone]) {
|
|
1395
|
+
const toHex = rgbArrayToHex(rgb.split(", ").map((v) => parseFloat(v)));
|
|
1396
|
+
if (tone.slice(0, 1) === "-" || tone.slice(0, 1) === "+") {
|
|
1397
|
+
rgb = hexToRgbArray(getColorShade(toHex, parseFloat(tone))).join(", ");
|
|
1398
|
+
} else {
|
|
1399
|
+
const [r, g, b] = [...rgb.split(", ").map((v) => parseInt(v))];
|
|
1400
|
+
const hsl = rgbToHSL(r, g, b);
|
|
1401
|
+
const [h, s, l] = hsl;
|
|
1402
|
+
const newRgb = hslToRgb(h, s, parseFloat(tone) / 100 * 255);
|
|
1403
|
+
rgb = newRgb;
|
|
1404
|
+
}
|
|
1405
|
+
val[tone] = { rgb, var: `${val.var}-${tone}` };
|
|
1406
|
+
} else
|
|
1407
|
+
rgb = val[tone].rgb;
|
|
1408
|
+
}
|
|
1409
|
+
if (alpha)
|
|
1410
|
+
return `rgba(${rgb}, ${alpha})`;
|
|
1411
|
+
return CONFIG2.useVariable ? `var(${val.var})` : `rgb(${rgb})`;
|
|
1412
|
+
} else
|
|
1413
|
+
return CONFIG2.useVariable ? `var(${val.var})` : val.value;
|
|
1414
|
+
};
|
|
1415
|
+
var getMediaColor = (value, property, globalTheme) => {
|
|
1416
|
+
const CONFIG2 = getActiveConfig();
|
|
1417
|
+
if (!globalTheme)
|
|
1418
|
+
globalTheme = CONFIG2.globalTheme;
|
|
1419
|
+
if (!isString(value)) {
|
|
1420
|
+
if (CONFIG2.verbose)
|
|
1421
|
+
console.warn(value, "- type for color is not valid");
|
|
1422
|
+
return;
|
|
1423
|
+
}
|
|
1424
|
+
if (value.slice(0, 2) === "--")
|
|
1425
|
+
return { [property]: `var(${value})` };
|
|
1426
|
+
const [name] = isArray(value) ? value : value.split(" ");
|
|
1427
|
+
const { COLOR: COLOR2, GRADIENT: GRADIENT2 } = CONFIG2;
|
|
1428
|
+
const val = COLOR2[name] || GRADIENT2[name];
|
|
1429
|
+
const isObj = isObject(val);
|
|
1430
|
+
if (isObj && val.value)
|
|
1431
|
+
return { [property]: getColor(value, globalTheme) };
|
|
1432
|
+
else if (isObj) {
|
|
1433
|
+
if (globalTheme)
|
|
1434
|
+
return { [property]: getColor(value, `@${globalTheme}`) };
|
|
1435
|
+
else {
|
|
1436
|
+
const obj2 = {};
|
|
1437
|
+
for (const mediaName in val) {
|
|
1438
|
+
const query = CONFIG2.MEDIA[mediaName.slice(1)];
|
|
1439
|
+
const media = `@media screen and ${query}`;
|
|
1440
|
+
obj2[media] = { [property]: getColor(value, mediaName) };
|
|
1441
|
+
}
|
|
1442
|
+
return obj2;
|
|
1443
|
+
}
|
|
1444
|
+
} else {
|
|
1445
|
+
if (CONFIG2.verbose)
|
|
1446
|
+
console.warn("Can't find color", value);
|
|
1447
|
+
return { [property]: value };
|
|
1448
|
+
}
|
|
1449
|
+
};
|
|
1450
|
+
var setColor = (val, key, suffix) => {
|
|
1451
|
+
const CONFIG2 = getActiveConfig();
|
|
1452
|
+
if (isString(val) && val.slice(0, 2) === "--")
|
|
1453
|
+
val = getColor(val.slice(2));
|
|
1454
|
+
if (isArray(val)) {
|
|
1455
|
+
return {
|
|
1456
|
+
"@light": setColor(val[0], key, "light"),
|
|
1457
|
+
"@dark": setColor(val[1], key, "dark")
|
|
1458
|
+
};
|
|
1459
|
+
}
|
|
1460
|
+
if (isObject(val)) {
|
|
1461
|
+
const obj2 = {};
|
|
1462
|
+
for (const variant in val)
|
|
1463
|
+
obj2[variant] = setColor(val[variant], key, variant.slice(0, 1) === "@" ? variant.slice(1) : variant);
|
|
1464
|
+
return obj2;
|
|
1465
|
+
}
|
|
1466
|
+
const CSSVar = `--color-${key}` + (suffix ? `-${suffix}` : "");
|
|
1467
|
+
const [r, g, b, a = 1] = colorStringToRgbaArray(val.value || val);
|
|
1468
|
+
const alpha = parseFloat(a.toFixed(2));
|
|
1469
|
+
const rgb = `${r}, ${g}, ${b}`;
|
|
1470
|
+
const value = `rgba(${rgb}, ${alpha})`;
|
|
1471
|
+
if (CONFIG2.useVariable) {
|
|
1472
|
+
CONFIG2.CSS_VARS[CSSVar] = value;
|
|
1473
|
+
}
|
|
1474
|
+
return {
|
|
1475
|
+
var: CSSVar,
|
|
1476
|
+
rgb,
|
|
1477
|
+
alpha,
|
|
1478
|
+
value
|
|
1479
|
+
};
|
|
1480
|
+
};
|
|
1481
|
+
var setGradient = (val, key, suffix) => {
|
|
1482
|
+
const CONFIG2 = getActiveConfig();
|
|
1483
|
+
if (isString(val) && val.slice(0, 2) === "--")
|
|
1484
|
+
val = getColor(val.slice(2));
|
|
1485
|
+
if (isArray(val)) {
|
|
1486
|
+
return {
|
|
1487
|
+
"@light": setGradient(val[0], key, "light"),
|
|
1488
|
+
"@dark": setGradient(val[0], key, "dark")
|
|
1489
|
+
};
|
|
1490
|
+
}
|
|
1491
|
+
if (isObject(val)) {
|
|
1492
|
+
const obj2 = {};
|
|
1493
|
+
for (const variant in val)
|
|
1494
|
+
obj2[variant] = setGradient(val[variant], key, variant.slice(0, 1) === "@" ? variant.slice(1) : variant);
|
|
1495
|
+
return obj2;
|
|
1496
|
+
}
|
|
1497
|
+
const CSSVar = `--gradient-${key}` + (suffix ? `-${suffix}` : "");
|
|
1498
|
+
if (CONFIG2.useVariable) {
|
|
1499
|
+
CONFIG2.CSS_VARS[CSSVar] = val.value || val;
|
|
1500
|
+
}
|
|
1501
|
+
return {
|
|
1502
|
+
var: CSSVar,
|
|
1503
|
+
value: val.value || val
|
|
1504
|
+
};
|
|
1505
|
+
};
|
|
1506
|
+
var setThemeValue = (theme) => {
|
|
1507
|
+
const value = {};
|
|
1508
|
+
const { state, media, helpers, ...rest } = theme;
|
|
1509
|
+
const keys = Object.keys(rest);
|
|
1510
|
+
keys.map((key) => {
|
|
1511
|
+
const conditions = ["color", "Color", "background", "border"];
|
|
1512
|
+
const isColor = conditions.some((k) => key.includes(k));
|
|
1513
|
+
return value[key] = isColor ? getColor(theme[key]) : theme[key];
|
|
1514
|
+
});
|
|
1515
|
+
return value;
|
|
1516
|
+
};
|
|
1517
|
+
var getThemeValue = (theme) => {
|
|
1518
|
+
if (theme.value)
|
|
1519
|
+
return theme.value;
|
|
1520
|
+
theme.value = setThemeValue(theme);
|
|
1521
|
+
return theme.value;
|
|
1522
|
+
};
|
|
1523
|
+
var getTheme = (value, modifier) => {
|
|
1524
|
+
const CONFIG2 = getActiveConfig();
|
|
1525
|
+
if (CONFIG2.useVariable)
|
|
1526
|
+
return getMediaTheme(value, modifier);
|
|
1527
|
+
const { THEME: THEME2 } = CONFIG2;
|
|
1528
|
+
if (isString(value)) {
|
|
1529
|
+
const [theme, subtheme] = value.split(" ");
|
|
1530
|
+
const isOurTheme = THEME2[theme];
|
|
1531
|
+
if (isOurTheme) {
|
|
1532
|
+
if (!subtheme && !modifier)
|
|
1533
|
+
return getThemeValue(isOurTheme);
|
|
1534
|
+
value = [theme, subtheme || modifier];
|
|
1535
|
+
}
|
|
1536
|
+
}
|
|
1537
|
+
if (isObjectLike(value) && value[1]) {
|
|
1538
|
+
const themeName = value[0];
|
|
1539
|
+
const subThemeName = value[1];
|
|
1540
|
+
const { helpers, media, state } = THEME2[themeName];
|
|
1541
|
+
if (media && media[subThemeName])
|
|
1542
|
+
return getThemeValue(media[subThemeName]);
|
|
1543
|
+
if (helpers && helpers[subThemeName])
|
|
1544
|
+
return getThemeValue(helpers[subThemeName]);
|
|
1545
|
+
if (state && state[subThemeName])
|
|
1546
|
+
return getThemeValue(state[subThemeName]);
|
|
1547
|
+
} else if (isObject(value))
|
|
1548
|
+
return setThemeValue(value);
|
|
1549
|
+
};
|
|
1550
|
+
var setInverseTheme = (theme, variant, value) => {
|
|
1551
|
+
if (isObject(variant)) {
|
|
1552
|
+
theme.variants.inverse.value = setThemeValue(variant);
|
|
1553
|
+
} else if (variant === true) {
|
|
1554
|
+
const { color, background } = value;
|
|
1555
|
+
theme.variants.inverse = {
|
|
1556
|
+
value: {
|
|
1557
|
+
color: background,
|
|
1558
|
+
background: color
|
|
1559
|
+
}
|
|
1560
|
+
};
|
|
1561
|
+
}
|
|
1562
|
+
};
|
|
1563
|
+
var setPseudo = (theme, key, variant, themeValue) => {
|
|
1564
|
+
const result = getTheme(variant);
|
|
1565
|
+
themeValue[`&:${key}`] = result;
|
|
1566
|
+
if (isObject(variant) && !variant.value)
|
|
1567
|
+
variant.value = result;
|
|
1568
|
+
};
|
|
1569
|
+
var setSelectors = (theme, value) => {
|
|
1570
|
+
const { state } = theme;
|
|
1571
|
+
if (!state)
|
|
1572
|
+
return;
|
|
1573
|
+
const keys = Object.keys(state);
|
|
1574
|
+
keys.map((key) => {
|
|
1575
|
+
const variant = state[key];
|
|
1576
|
+
setPseudo(theme, key, variant, value);
|
|
1577
|
+
return theme;
|
|
1578
|
+
});
|
|
1579
|
+
return theme;
|
|
1580
|
+
};
|
|
1581
|
+
var setPrefersScheme = (theme, key, variant, themeValue) => {
|
|
1582
|
+
const result = getTheme(variant);
|
|
1583
|
+
themeValue[`@media (prefers-color-scheme: ${key})`] = result;
|
|
1584
|
+
if (isObject(variant) && !variant.value)
|
|
1585
|
+
variant.value = result;
|
|
1586
|
+
};
|
|
1587
|
+
var setMedia = (theme, value) => {
|
|
1588
|
+
const { media } = theme;
|
|
1589
|
+
if (!media)
|
|
1590
|
+
return;
|
|
1591
|
+
const keys = Object.keys(media);
|
|
1592
|
+
keys.map((key) => {
|
|
1593
|
+
const variant = media[key];
|
|
1594
|
+
if (key === "dark" || key === "light")
|
|
1595
|
+
setPrefersScheme(theme, key, variant, value);
|
|
1596
|
+
if (key === "inverse")
|
|
1597
|
+
setInverseTheme(theme, variant, value);
|
|
1598
|
+
return theme;
|
|
1599
|
+
});
|
|
1600
|
+
return theme;
|
|
1601
|
+
};
|
|
1602
|
+
var setHelpers = (theme, value) => {
|
|
1603
|
+
const CONFIG2 = getActiveConfig();
|
|
1604
|
+
const { helpers } = theme;
|
|
1605
|
+
if (!helpers)
|
|
1606
|
+
return;
|
|
1607
|
+
const keys = Object.keys(helpers);
|
|
1608
|
+
keys.map((key) => {
|
|
1609
|
+
const helper = helpers[key];
|
|
1610
|
+
if (isString(helper))
|
|
1611
|
+
helpers[key] = CONFIG2.THEME[helper];
|
|
1612
|
+
else
|
|
1613
|
+
getThemeValue(helpers[key]);
|
|
1614
|
+
return theme;
|
|
1615
|
+
});
|
|
1616
|
+
return theme;
|
|
1617
|
+
};
|
|
1618
|
+
var setTheme = (val, key) => {
|
|
1619
|
+
const CONFIG2 = getActiveConfig();
|
|
1620
|
+
if (CONFIG2.useVariable)
|
|
1621
|
+
return setMediaTheme(val, key);
|
|
1622
|
+
const { state, media, helpers } = val;
|
|
1623
|
+
const value = setThemeValue(val, key);
|
|
1624
|
+
const CSSvar = `--theme-${key}`;
|
|
1625
|
+
setSelectors(val, value);
|
|
1626
|
+
setMedia(val, value);
|
|
1627
|
+
setHelpers(val, value);
|
|
1628
|
+
return { var: CSSvar, value, state, media, helpers };
|
|
1629
|
+
};
|
|
1630
|
+
var setMediaTheme = (val, key, suffix, prefers) => {
|
|
1631
|
+
const CONFIG2 = getActiveConfig();
|
|
1632
|
+
const { CSS_VARS: CSS_VARS2 } = CONFIG2;
|
|
1633
|
+
const theme = { value: val };
|
|
1634
|
+
if (isObjectLike(val)) {
|
|
1635
|
+
for (const param in val) {
|
|
1636
|
+
const symb = param.slice(0, 1);
|
|
1637
|
+
const value = val[param];
|
|
1638
|
+
if (symb === "@" || symb === ":" || symb === ".") {
|
|
1639
|
+
const hasPrefers = symb === "@" && param;
|
|
1640
|
+
theme[param] = setMediaTheme(value, key, param, prefers || hasPrefers);
|
|
1641
|
+
} else {
|
|
1642
|
+
const color = getColor(value, prefers);
|
|
1643
|
+
const metaSuffixes = [...new Set([prefers, suffix].filter((v) => v).map((v) => v.slice(1)))];
|
|
1644
|
+
const varmetaSuffixName = metaSuffixes.length ? "-" + metaSuffixes.join("-") : "";
|
|
1645
|
+
const CSSVar = `--theme-${key}${varmetaSuffixName}-${param}`;
|
|
1646
|
+
if (CONFIG2.useVariable) {
|
|
1647
|
+
CSS_VARS2[CSSVar] = color;
|
|
1648
|
+
theme[param] = `var(${CSSVar})`;
|
|
1649
|
+
} else {
|
|
1650
|
+
theme[param] = color;
|
|
1651
|
+
}
|
|
1652
|
+
theme[`.${param}`] = { [param]: theme[param] };
|
|
1653
|
+
}
|
|
1654
|
+
}
|
|
1655
|
+
if (theme["background"] || theme["color"] || theme["backgroundColor"]) {
|
|
1656
|
+
theme[".inversed"] = {
|
|
1657
|
+
color: theme["background"] || theme["backgroundColor"],
|
|
1658
|
+
background: theme["color"]
|
|
1659
|
+
};
|
|
1660
|
+
}
|
|
1661
|
+
}
|
|
1662
|
+
if (isString(val) && val.slice(0, 2) === "--") {
|
|
1663
|
+
const { THEME: THEME2 } = CONFIG2;
|
|
1664
|
+
const value = THEME2[val.slice(2)];
|
|
1665
|
+
const getReferenced = getMediaTheme(value, prefers);
|
|
1666
|
+
return getReferenced;
|
|
1667
|
+
}
|
|
1668
|
+
return theme;
|
|
1669
|
+
};
|
|
1670
|
+
var recursiveTheme = (val) => {
|
|
1671
|
+
const CONFIG2 = getActiveConfig();
|
|
1672
|
+
const obj2 = {};
|
|
1673
|
+
for (const param in val) {
|
|
1674
|
+
const symb = param.slice(0, 1);
|
|
1675
|
+
if (isObjectLike(val[param])) {
|
|
1676
|
+
if (symb === "@") {
|
|
1677
|
+
const query = CONFIG2.MEDIA[param.slice(1)];
|
|
1678
|
+
const media = `@media screen and ${query}`;
|
|
1679
|
+
obj2[media] = recursiveTheme(val[param]);
|
|
1680
|
+
} else if (symb === ":") {
|
|
1681
|
+
obj2[`&${param}`] = recursiveTheme(val[param]);
|
|
1682
|
+
}
|
|
1683
|
+
} else
|
|
1684
|
+
obj2[param] = val[param];
|
|
1685
|
+
}
|
|
1686
|
+
return obj2;
|
|
1687
|
+
};
|
|
1688
|
+
var findModifierFromArray = (val, modifierArray) => {
|
|
1689
|
+
const currentMod = modifierArray.shift();
|
|
1690
|
+
if (val[currentMod])
|
|
1691
|
+
return findModifierFromArray(val[currentMod], modifierArray);
|
|
1692
|
+
return val;
|
|
1693
|
+
};
|
|
1694
|
+
var findModifier = (val, modifier) => {
|
|
1695
|
+
if (isArray(modifier))
|
|
1696
|
+
return findModifierFromArray(val, modifier);
|
|
1697
|
+
else if (isString(modifier) && val[modifier])
|
|
1698
|
+
return val[modifier];
|
|
1699
|
+
else
|
|
1700
|
+
return val;
|
|
1701
|
+
};
|
|
1702
|
+
var getMediaTheme = (val, mod) => {
|
|
1703
|
+
const CONFIG2 = getActiveConfig();
|
|
1704
|
+
if (isString(val) && val.slice(0, 2) === "--")
|
|
1705
|
+
val = getMediaTheme(val.slice(2));
|
|
1706
|
+
if (!val || !isString(val)) {
|
|
1707
|
+
if (CONFIG2.verbose)
|
|
1708
|
+
console.warn(val, "- theme is not string");
|
|
1709
|
+
return;
|
|
1710
|
+
}
|
|
1711
|
+
const [name, ...modifier] = isArray(val) ? val : val.split(" ");
|
|
1712
|
+
let value = CONFIG2.THEME[name];
|
|
1713
|
+
if (value && (modifier || mod)) {
|
|
1714
|
+
value = findModifier(value, modifier.length ? modifier : mod);
|
|
1715
|
+
}
|
|
1716
|
+
const r = recursiveTheme(value);
|
|
1717
|
+
return r;
|
|
1718
|
+
};
|
|
1719
|
+
var setFont = (val, key) => {
|
|
1720
|
+
const CSSvar = `--font-${key}`;
|
|
1721
|
+
const fontFace = val[0] ? getFontFaceEach(key, val) : setCustomFontMedia(key, val.url);
|
|
1722
|
+
return { var: CSSvar, value: val, fontFace };
|
|
1723
|
+
};
|
|
1724
|
+
var getFontFamily = (key, factory) => {
|
|
1725
|
+
const CONFIG2 = getActiveConfig();
|
|
1726
|
+
const { FONT_FAMILY: FONT_FAMILY2 } = CONFIG2;
|
|
1727
|
+
return getDefaultOrFirstKey(factory || FONT_FAMILY2, key);
|
|
1728
|
+
};
|
|
1729
|
+
var setFontFamily = (val, key) => {
|
|
1730
|
+
const CONFIG2 = getActiveConfig();
|
|
1731
|
+
const { FONT_FAMILY: FONT_FAMILY2, FONT_FAMILY_TYPES: FONT_FAMILY_TYPES2 } = CONFIG2;
|
|
1732
|
+
let { value, type } = val;
|
|
1733
|
+
if (val.isDefault)
|
|
1734
|
+
FONT_FAMILY2.default = key;
|
|
1735
|
+
if (isObject(value))
|
|
1736
|
+
value = arrayze(value);
|
|
1737
|
+
const CSSvar = `--font-family-${key}`;
|
|
1738
|
+
const str = `${value.join(", ")}, ${FONT_FAMILY_TYPES2[type]}`;
|
|
1739
|
+
return { var: CSSvar, value: str, arr: value, type };
|
|
1740
|
+
};
|
|
1741
|
+
var runThroughMedia = (props) => {
|
|
1742
|
+
const CONFIG2 = getActiveConfig();
|
|
1743
|
+
const { TYPOGRAPHY: TYPOGRAPHY2, MEDIA: MEDIA2 } = CONFIG2;
|
|
1744
|
+
for (const prop2 in props) {
|
|
1745
|
+
const mediaProps = props[prop2];
|
|
1746
|
+
if (prop2.slice(0, 1) === "@") {
|
|
1747
|
+
const { type, base, ratio, range, subSequence, h1Matches, unit } = props;
|
|
1748
|
+
merge2(mediaProps, {
|
|
1749
|
+
type,
|
|
1750
|
+
base,
|
|
1751
|
+
ratio,
|
|
1752
|
+
range,
|
|
1753
|
+
subSequence,
|
|
1754
|
+
h1Matches,
|
|
1755
|
+
unit,
|
|
1756
|
+
sequence: {},
|
|
1757
|
+
scales: {},
|
|
1758
|
+
templates: {},
|
|
1759
|
+
vars: {}
|
|
1760
|
+
});
|
|
1761
|
+
generateSequence(mediaProps);
|
|
1762
|
+
const mediaName = prop2.slice(1);
|
|
1763
|
+
applySequenceVars(mediaProps, mediaName);
|
|
1764
|
+
const query = MEDIA2[mediaName];
|
|
1765
|
+
TYPOGRAPHY2.templates[`@media screen and ${query}`] = {
|
|
1766
|
+
fontSize: mediaProps.base / TYPOGRAPHY2.browserDefault + unit
|
|
1767
|
+
};
|
|
1768
|
+
}
|
|
1769
|
+
}
|
|
1770
|
+
};
|
|
1771
|
+
var applyHeadings = (props) => {
|
|
1772
|
+
const CONFIG2 = getActiveConfig();
|
|
1773
|
+
if (props.h1Matches) {
|
|
1774
|
+
const unit = props.unit;
|
|
1775
|
+
const HEADINGS = findHeadings(props);
|
|
1776
|
+
const { templates } = props;
|
|
1777
|
+
for (const k in HEADINGS) {
|
|
1778
|
+
const headerName = `h${parseInt(k) + 1}`;
|
|
1779
|
+
const headerStyle = templates[headerName];
|
|
1780
|
+
templates[headerName] = {
|
|
1781
|
+
fontSize: CONFIG2.useVariable ? `var(${HEADINGS[k].variable})` : `${HEADINGS[k].scaling}${unit}`,
|
|
1782
|
+
margin: headerStyle ? headerStyle.margin : 0,
|
|
1783
|
+
lineHeight: headerStyle ? headerStyle.lineHeight : props.lineHeight,
|
|
1784
|
+
letterSpacing: headerStyle ? headerStyle.letterSpacing : props.letterSpacing,
|
|
1785
|
+
fontWeight: headerStyle ? headerStyle.fontWeight : 900 - k * 100
|
|
1786
|
+
};
|
|
1787
|
+
}
|
|
1788
|
+
}
|
|
1789
|
+
};
|
|
1790
|
+
var applyTypographySequence = () => {
|
|
1791
|
+
const CONFIG2 = getActiveConfig();
|
|
1792
|
+
const { TYPOGRAPHY: TYPOGRAPHY2 } = CONFIG2;
|
|
1793
|
+
generateSequence(TYPOGRAPHY2);
|
|
1794
|
+
applyHeadings(TYPOGRAPHY2);
|
|
1795
|
+
applySequenceVars(TYPOGRAPHY2);
|
|
1796
|
+
runThroughMedia(TYPOGRAPHY2);
|
|
1797
|
+
};
|
|
1798
|
+
var getFontSizeByKey = (value) => {
|
|
1799
|
+
const CONFIG2 = getActiveConfig();
|
|
1800
|
+
const { TYPOGRAPHY: TYPOGRAPHY2 } = CONFIG2;
|
|
1801
|
+
return getSequenceValuePropertyPair(
|
|
1802
|
+
value,
|
|
1803
|
+
"fontSize",
|
|
1804
|
+
TYPOGRAPHY2
|
|
1805
|
+
);
|
|
1806
|
+
};
|
|
1807
|
+
var runThroughMedia2 = (sequenceProps) => {
|
|
1808
|
+
for (const prop2 in sequenceProps) {
|
|
1809
|
+
const mediaProps = sequenceProps[prop2];
|
|
1810
|
+
if (prop2.slice(0, 1) === "@") {
|
|
1811
|
+
const { type, base, ratio, range, subSequence, h1Matches, unit } = sequenceProps;
|
|
1812
|
+
merge2(mediaProps, {
|
|
1813
|
+
type,
|
|
1814
|
+
base,
|
|
1815
|
+
ratio,
|
|
1816
|
+
range,
|
|
1817
|
+
subSequence,
|
|
1818
|
+
h1Matches,
|
|
1819
|
+
unit,
|
|
1820
|
+
sequence: {},
|
|
1821
|
+
scales: {},
|
|
1822
|
+
templates: {},
|
|
1823
|
+
vars: {}
|
|
1824
|
+
});
|
|
1825
|
+
generateSequence(mediaProps);
|
|
1826
|
+
const mediaName = prop2.slice(1);
|
|
1827
|
+
applySequenceVars(mediaProps, mediaName);
|
|
1828
|
+
}
|
|
1829
|
+
}
|
|
1830
|
+
};
|
|
1831
|
+
var applySpacingSequence = () => {
|
|
1832
|
+
const CONFIG2 = getActiveConfig();
|
|
1833
|
+
const { SPACING: SPACING2 } = CONFIG2;
|
|
1834
|
+
generateSequence(SPACING2);
|
|
1835
|
+
applySequenceVars(SPACING2);
|
|
1836
|
+
runThroughMedia2(SPACING2);
|
|
1837
|
+
};
|
|
1838
|
+
var getSequence = (sequenceProps) => {
|
|
1839
|
+
const CONFIG2 = getActiveConfig();
|
|
1840
|
+
const { SPACING: SPACING2 } = CONFIG2;
|
|
1841
|
+
if (!sequenceProps)
|
|
1842
|
+
return SPACING2;
|
|
1843
|
+
const hasGenerated = Object.keys(sequenceProps.sequence).length > 0;
|
|
1844
|
+
return hasGenerated ? sequenceProps : generateSequence(sequenceProps);
|
|
1845
|
+
};
|
|
1846
|
+
var getSpacingByKey = (value, propertyName = "padding", sequenceProps) => {
|
|
1847
|
+
const sequence = getSequence(sequenceProps);
|
|
1848
|
+
const stack = arrayze(value);
|
|
1849
|
+
if (!stack)
|
|
1850
|
+
return;
|
|
1851
|
+
if (isString(value) && value.includes("calc")) {
|
|
1852
|
+
return { [propertyName]: value };
|
|
1853
|
+
}
|
|
1854
|
+
if (stack.length > 1) {
|
|
1855
|
+
let suffix = "";
|
|
1856
|
+
if (propertyName === "borderWidth") {
|
|
1857
|
+
propertyName = "border";
|
|
1858
|
+
suffix = "Width";
|
|
1859
|
+
}
|
|
1860
|
+
const directions = {
|
|
1861
|
+
2: ["Block", "Inline"],
|
|
1862
|
+
3: ["BlockStart", "Inline", "BlockEnd"],
|
|
1863
|
+
4: ["BlockStart", "InlineEnd", "BlockEnd", "InlineStart"]
|
|
1864
|
+
};
|
|
1865
|
+
const wrapSequenceValueByDirection = (direction, i) => getSequenceValuePropertyPair(
|
|
1866
|
+
stack[i],
|
|
1867
|
+
propertyName + direction + suffix,
|
|
1868
|
+
sequence
|
|
1869
|
+
);
|
|
1870
|
+
return directions[stack.length].map((dir, key) => wrapSequenceValueByDirection(dir, key));
|
|
1871
|
+
}
|
|
1872
|
+
return getSequenceValuePropertyPair(
|
|
1873
|
+
value,
|
|
1874
|
+
propertyName,
|
|
1875
|
+
sequence
|
|
1876
|
+
);
|
|
1877
|
+
};
|
|
1878
|
+
var getSpacingBasedOnRatio = (props, propertyName, val) => {
|
|
1879
|
+
const CONFIG2 = getActiveConfig();
|
|
1880
|
+
const { SPACING: SPACING2 } = CONFIG2;
|
|
1881
|
+
const { spacingRatio, unit } = props;
|
|
1882
|
+
const value = val || props[propertyName];
|
|
1883
|
+
if (spacingRatio) {
|
|
1884
|
+
let sequenceProps = SPACING2[spacingRatio];
|
|
1885
|
+
if (!sequenceProps) {
|
|
1886
|
+
const { type, base, range, subSequence } = SPACING2;
|
|
1887
|
+
sequenceProps = SPACING2[spacingRatio] = merge2({
|
|
1888
|
+
ratio: spacingRatio,
|
|
1889
|
+
type: type + "-" + spacingRatio,
|
|
1890
|
+
unit,
|
|
1891
|
+
sequence: {},
|
|
1892
|
+
scales: {},
|
|
1893
|
+
templates: {},
|
|
1894
|
+
vars: {}
|
|
1895
|
+
}, {
|
|
1896
|
+
base,
|
|
1897
|
+
range,
|
|
1898
|
+
subSequence,
|
|
1899
|
+
ratio: SPACING2.ratio,
|
|
1900
|
+
unit: SPACING2.unit
|
|
1901
|
+
});
|
|
1902
|
+
}
|
|
1903
|
+
applySequenceVars(sequenceProps, null, { useDefault: false });
|
|
1904
|
+
return getSpacingByKey(value, propertyName, sequenceProps);
|
|
1905
|
+
}
|
|
1906
|
+
return getSpacingByKey(value, propertyName);
|
|
1907
|
+
};
|
|
1908
|
+
var applyTimingSequence = () => {
|
|
1909
|
+
const CONFIG2 = getActiveConfig();
|
|
1910
|
+
const { TIMING: TIMING2 } = CONFIG2;
|
|
1911
|
+
generateSequence(TIMING2);
|
|
1912
|
+
applySequenceVars(TIMING2);
|
|
1913
|
+
};
|
|
1914
|
+
var getTimingFunction = (value) => {
|
|
1915
|
+
const CONFIG2 = getActiveConfig();
|
|
1916
|
+
const { TIMING: TIMING2 } = CONFIG2;
|
|
1917
|
+
return TIMING2[value] || TIMING2[toCamelCase(value)] || value;
|
|
1918
|
+
};
|
|
1919
|
+
var getTimingByKey = (value, property = "timing") => {
|
|
1920
|
+
const CONFIG2 = getActiveConfig();
|
|
1921
|
+
const { TIMING: TIMING2 } = CONFIG2;
|
|
1922
|
+
return getSequenceValuePropertyPair(
|
|
1923
|
+
value,
|
|
1924
|
+
property,
|
|
1925
|
+
TIMING2
|
|
1926
|
+
);
|
|
1927
|
+
};
|
|
1928
|
+
var applyDocument = () => {
|
|
1929
|
+
const CONFIG2 = getActiveConfig();
|
|
1930
|
+
const { DOCUMENT: DOCUMENT2, FONT_FAMILY: FONT_FAMILY2, THEME: THEME2, TYPOGRAPHY: TYPOGRAPHY2 } = CONFIG2;
|
|
1931
|
+
return merge2(DOCUMENT2, {
|
|
1932
|
+
theme: THEME2.document,
|
|
1933
|
+
fontFamily: getDefaultOrFirstKey(FONT_FAMILY2),
|
|
1934
|
+
fontSize: TYPOGRAPHY2.base,
|
|
1935
|
+
lineHeight: TYPOGRAPHY2.lineHeight
|
|
1936
|
+
});
|
|
1937
|
+
};
|
|
1938
|
+
var DEF_OPTIONS = {
|
|
1939
|
+
document: document2
|
|
1940
|
+
};
|
|
1941
|
+
var setSVG = (val, key) => {
|
|
1942
|
+
const CONFIG2 = getActiveConfig();
|
|
1943
|
+
if (CONFIG2.useSvgSprite) {
|
|
1944
|
+
return convertSvgToSymbol(key, val);
|
|
1945
|
+
}
|
|
1946
|
+
return val;
|
|
1947
|
+
};
|
|
1948
|
+
var appendSVGSprite = (LIBRARY, options = DEF_OPTIONS) => {
|
|
1949
|
+
const CONFIG2 = getActiveConfig();
|
|
1950
|
+
const doc = options.document || document2;
|
|
1951
|
+
const lib = Object.keys(LIBRARY).length ? {} : CONFIG2.SVG;
|
|
1952
|
+
for (let key in LIBRARY)
|
|
1953
|
+
lib[key] = CONFIG2.SVG[key];
|
|
1954
|
+
const SVGsprite = generateSprite(lib);
|
|
1955
|
+
if (!doc) {
|
|
1956
|
+
console.warn("To append SVG sprites it should be run in browser environment");
|
|
1957
|
+
return SVGsprite;
|
|
1958
|
+
}
|
|
1959
|
+
const svgSpriteDOM = doc.createElement("template");
|
|
1960
|
+
svgSpriteDOM.innerHTML = SVGsprite;
|
|
1961
|
+
doc.body.appendChild(svgSpriteDOM.content);
|
|
1962
|
+
};
|
|
1963
|
+
var setIcon = (val, key) => {
|
|
1964
|
+
const CONFIG2 = getActiveConfig();
|
|
1965
|
+
if (CONFIG2.useIconSprite) {
|
|
1966
|
+
return setSVG(val, key);
|
|
1967
|
+
}
|
|
1968
|
+
return val;
|
|
1969
|
+
};
|
|
1970
|
+
var appendIconsSprite = (LIBRARY, options = DEF_OPTIONS) => {
|
|
1971
|
+
const CONFIG2 = getActiveConfig();
|
|
1972
|
+
const doc = options.document || document2;
|
|
1973
|
+
const lib = Object.keys(LIBRARY).length ? {} : CONFIG2.ICONS;
|
|
1974
|
+
for (let key in LIBRARY)
|
|
1975
|
+
lib[key] = CONFIG2.ICONS[key];
|
|
1976
|
+
const SVGsprite = generateSprite(lib);
|
|
1977
|
+
if (!doc) {
|
|
1978
|
+
console.warn("To append SVG Icon sprites it should be run in browser environment");
|
|
1979
|
+
return SVGsprite;
|
|
1980
|
+
}
|
|
1981
|
+
const iconsSpriteDOM = doc.createElement("template");
|
|
1982
|
+
iconsSpriteDOM.innerHTML = SVGsprite;
|
|
1983
|
+
doc.body.appendChild(iconsSpriteDOM.content);
|
|
1984
|
+
};
|
|
1985
|
+
var applyReset = (reset = {}) => {
|
|
1986
|
+
const CONFIG2 = getActiveConfig();
|
|
1987
|
+
const { CSS_VARS: CSS_VARS2, RESET: RESET2, TYPOGRAPHY: TYPOGRAPHY2, DOCUMENT: DOCUMENT2 } = CONFIG2;
|
|
1988
|
+
if (RESET2) {
|
|
1989
|
+
if (RESET2[":root"]) {
|
|
1990
|
+
const configReset = RESET2;
|
|
1991
|
+
const configTemplates = TYPOGRAPHY2.templates;
|
|
1992
|
+
configReset.body = {
|
|
1993
|
+
...getMediaTheme("document", `@${CONFIG2.globalTheme}`),
|
|
1994
|
+
...configTemplates.body
|
|
1995
|
+
};
|
|
1996
|
+
configReset.h1 = configTemplates.h1;
|
|
1997
|
+
configReset.h2 = configTemplates.h2;
|
|
1998
|
+
configReset.h3 = configTemplates.h3;
|
|
1999
|
+
configReset.h4 = configTemplates.h4;
|
|
2000
|
+
configReset.h5 = configTemplates.h5;
|
|
2001
|
+
configReset.h6 = configTemplates.h6;
|
|
2002
|
+
}
|
|
2003
|
+
const { body, ...templates } = TYPOGRAPHY2.templates;
|
|
2004
|
+
return deepMerge(merge(RESET2, reset), {
|
|
2005
|
+
html: {
|
|
2006
|
+
position: "absolute",
|
|
2007
|
+
overflow: "hidden",
|
|
2008
|
+
width: "100%",
|
|
2009
|
+
height: "100%",
|
|
2010
|
+
top: "0",
|
|
2011
|
+
left: "0",
|
|
2012
|
+
margin: "0",
|
|
2013
|
+
WebkitFontSmoothing: "antialiased",
|
|
2014
|
+
transform: "translate3d(0, 0, 1px)",
|
|
2015
|
+
scrollBehavior: "smooth",
|
|
2016
|
+
fontSize: TYPOGRAPHY2.browserDefault + "px",
|
|
2017
|
+
fontFamily: DOCUMENT2.fontFamily,
|
|
2018
|
+
lineHeight: DOCUMENT2.lineHeight
|
|
2019
|
+
},
|
|
2020
|
+
body: {
|
|
2021
|
+
boxSizing: "border-box",
|
|
2022
|
+
height: "100%",
|
|
2023
|
+
margin: 0,
|
|
2024
|
+
fontFamily: DOCUMENT2.fontFamily,
|
|
2025
|
+
fontSize: TYPOGRAPHY2.base / TYPOGRAPHY2.browserDefault + CONFIG2.UNIT.default,
|
|
2026
|
+
...CONFIG2.useDocumentTheme ? getMediaTheme("document", `@${CONFIG2.globalTheme}`) : {},
|
|
2027
|
+
...templates,
|
|
2028
|
+
...body
|
|
2029
|
+
},
|
|
2030
|
+
// form elements
|
|
2031
|
+
fieldset: {
|
|
2032
|
+
border: 0,
|
|
2033
|
+
padding: 0,
|
|
2034
|
+
margin: 0
|
|
2035
|
+
},
|
|
2036
|
+
"select, input": {
|
|
2037
|
+
fontFamily: DOCUMENT2.fontFamily
|
|
2038
|
+
}
|
|
2039
|
+
});
|
|
2040
|
+
}
|
|
2041
|
+
};
|
|
2042
|
+
var setCases = (val, key) => {
|
|
2043
|
+
if (isFunction2(val))
|
|
2044
|
+
return val();
|
|
2045
|
+
return val;
|
|
2046
|
+
};
|
|
2047
|
+
var setSameValue = (val, key) => val;
|
|
2048
|
+
var VALUE_TRANSFORMERS = {
|
|
2049
|
+
color: setColor,
|
|
2050
|
+
gradient: setGradient,
|
|
2051
|
+
font: setFont,
|
|
2052
|
+
font_family: setFontFamily,
|
|
2053
|
+
theme: setTheme,
|
|
2054
|
+
icons: setIcon,
|
|
2055
|
+
svg: setSVG,
|
|
2056
|
+
svg_data: setSameValue,
|
|
2057
|
+
typography: setSameValue,
|
|
2058
|
+
cases: setCases,
|
|
2059
|
+
spacing: setSameValue,
|
|
2060
|
+
media: setSameValue,
|
|
2061
|
+
timing: setSameValue,
|
|
2062
|
+
reset: setSameValue,
|
|
2063
|
+
unit: setSameValue,
|
|
2064
|
+
animation: setSameValue
|
|
2065
|
+
};
|
|
2066
|
+
var setValue = (FACTORY_NAME, value, key) => {
|
|
2067
|
+
const CONFIG2 = getActiveConfig();
|
|
2068
|
+
const factoryName = FACTORY_NAME.toLowerCase();
|
|
2069
|
+
const FACTORY2 = CONFIG2[FACTORY_NAME];
|
|
2070
|
+
if (VALUE_TRANSFORMERS[factoryName]) {
|
|
2071
|
+
const result = VALUE_TRANSFORMERS[factoryName](value, key);
|
|
2072
|
+
FACTORY2[key] = result;
|
|
2073
|
+
return FACTORY2;
|
|
2074
|
+
}
|
|
2075
|
+
if (CONFIG2.verbose)
|
|
2076
|
+
console.warn("Can not find", factoryName, "method in scratch");
|
|
2077
|
+
};
|
|
2078
|
+
var setEach = (factoryName, props) => {
|
|
2079
|
+
const CONFIG2 = getActiveConfig();
|
|
2080
|
+
const FACTORY_NAME = factoryName.toUpperCase();
|
|
2081
|
+
const keys = Object.keys(props);
|
|
2082
|
+
keys.map((key) => setValue(FACTORY_NAME, props[key], key));
|
|
2083
|
+
return CONFIG2[FACTORY_NAME];
|
|
2084
|
+
};
|
|
2085
|
+
var SET_OPTIONS = {};
|
|
2086
|
+
var set = (recivedConfig, options = SET_OPTIONS) => {
|
|
2087
|
+
let CONFIG2 = getActiveConfig();
|
|
2088
|
+
const {
|
|
2089
|
+
version,
|
|
2090
|
+
verbose,
|
|
2091
|
+
useVariable,
|
|
2092
|
+
useReset,
|
|
2093
|
+
useSvgSprite,
|
|
2094
|
+
useFontImport,
|
|
2095
|
+
useIconSprite,
|
|
2096
|
+
globalTheme,
|
|
2097
|
+
useDocumentTheme,
|
|
2098
|
+
...config
|
|
2099
|
+
} = recivedConfig;
|
|
2100
|
+
if (options.newConfig) {
|
|
2101
|
+
FACTORY["active"] = options.newConfig;
|
|
2102
|
+
CONFIG2 = getActiveConfig(options.newConfig);
|
|
2103
|
+
}
|
|
2104
|
+
if (verbose !== void 0)
|
|
2105
|
+
CONFIG2.verbose = verbose;
|
|
2106
|
+
if (useVariable !== void 0)
|
|
2107
|
+
CONFIG2.useVariable = useVariable;
|
|
2108
|
+
if (useReset !== void 0)
|
|
2109
|
+
CONFIG2.useReset = useReset;
|
|
2110
|
+
if (useFontImport !== void 0)
|
|
2111
|
+
CONFIG2.useFontImport = useFontImport;
|
|
2112
|
+
if (useSvgSprite !== void 0)
|
|
2113
|
+
CONFIG2.useSvgSprite = useSvgSprite;
|
|
2114
|
+
if (useIconSprite !== void 0)
|
|
2115
|
+
CONFIG2.useIconSprite = useIconSprite;
|
|
2116
|
+
if (useDocumentTheme !== void 0)
|
|
2117
|
+
CONFIG2.useDocumentTheme = useDocumentTheme;
|
|
2118
|
+
if (globalTheme !== void 0)
|
|
2119
|
+
CONFIG2.globalTheme = globalTheme;
|
|
2120
|
+
if (CONFIG2.verbose)
|
|
2121
|
+
console.log(CONFIG2);
|
|
2122
|
+
const keys = Object.keys(config);
|
|
2123
|
+
keys.map((key) => setEach(key, config[key]));
|
|
2124
|
+
applyTypographySequence();
|
|
2125
|
+
applySpacingSequence();
|
|
2126
|
+
applyTimingSequence();
|
|
2127
|
+
applyDocument();
|
|
2128
|
+
applyReset();
|
|
2129
|
+
return CONFIG2;
|
|
2130
|
+
};
|
|
2131
|
+
}
|
|
2132
|
+
});
|
|
2133
|
+
|
|
2134
|
+
// ../../node_modules/@emotion/cache/node_modules/@emotion/sheet/dist/emotion-sheet.browser.esm.js
|
|
2135
|
+
function sheetForTag(tag) {
|
|
2136
|
+
if (tag.sheet) {
|
|
2137
|
+
return tag.sheet;
|
|
2138
|
+
}
|
|
2139
|
+
for (var i = 0; i < document.styleSheets.length; i++) {
|
|
2140
|
+
if (document.styleSheets[i].ownerNode === tag) {
|
|
2141
|
+
return document.styleSheets[i];
|
|
2142
|
+
}
|
|
2143
|
+
}
|
|
2144
|
+
}
|
|
2145
|
+
function createStyleElement(options) {
|
|
2146
|
+
var tag = document.createElement("style");
|
|
2147
|
+
tag.setAttribute("data-emotion", options.key);
|
|
2148
|
+
if (options.nonce !== void 0) {
|
|
2149
|
+
tag.setAttribute("nonce", options.nonce);
|
|
2150
|
+
}
|
|
2151
|
+
tag.appendChild(document.createTextNode(""));
|
|
2152
|
+
tag.setAttribute("data-s", "");
|
|
2153
|
+
return tag;
|
|
2154
|
+
}
|
|
2155
|
+
var StyleSheet;
|
|
2156
|
+
var init_emotion_sheet_browser_esm = __esm({
|
|
2157
|
+
"../../node_modules/@emotion/cache/node_modules/@emotion/sheet/dist/emotion-sheet.browser.esm.js"() {
|
|
2158
|
+
StyleSheet = /* @__PURE__ */ function() {
|
|
2159
|
+
function StyleSheet2(options) {
|
|
2160
|
+
var _this = this;
|
|
2161
|
+
this._insertTag = function(tag) {
|
|
2162
|
+
var before;
|
|
2163
|
+
if (_this.tags.length === 0) {
|
|
2164
|
+
if (_this.insertionPoint) {
|
|
2165
|
+
before = _this.insertionPoint.nextSibling;
|
|
2166
|
+
} else if (_this.prepend) {
|
|
2167
|
+
before = _this.container.firstChild;
|
|
2168
|
+
} else {
|
|
2169
|
+
before = _this.before;
|
|
2170
|
+
}
|
|
2171
|
+
} else {
|
|
2172
|
+
before = _this.tags[_this.tags.length - 1].nextSibling;
|
|
2173
|
+
}
|
|
2174
|
+
_this.container.insertBefore(tag, before);
|
|
2175
|
+
_this.tags.push(tag);
|
|
2176
|
+
};
|
|
2177
|
+
this.isSpeedy = options.speedy === void 0 ? false : options.speedy;
|
|
2178
|
+
this.tags = [];
|
|
2179
|
+
this.ctr = 0;
|
|
2180
|
+
this.nonce = options.nonce;
|
|
2181
|
+
this.key = options.key;
|
|
2182
|
+
this.container = options.container;
|
|
2183
|
+
this.prepend = options.prepend;
|
|
2184
|
+
this.insertionPoint = options.insertionPoint;
|
|
2185
|
+
this.before = null;
|
|
2186
|
+
}
|
|
2187
|
+
var _proto = StyleSheet2.prototype;
|
|
2188
|
+
_proto.hydrate = function hydrate(nodes) {
|
|
2189
|
+
nodes.forEach(this._insertTag);
|
|
2190
|
+
};
|
|
2191
|
+
_proto.insert = function insert(rule) {
|
|
2192
|
+
if (this.ctr % (this.isSpeedy ? 65e3 : 1) === 0) {
|
|
2193
|
+
this._insertTag(createStyleElement(this));
|
|
2194
|
+
}
|
|
2195
|
+
var tag = this.tags[this.tags.length - 1];
|
|
2196
|
+
if (true) {
|
|
2197
|
+
var isImportRule3 = rule.charCodeAt(0) === 64 && rule.charCodeAt(1) === 105;
|
|
2198
|
+
if (isImportRule3 && this._alreadyInsertedOrderInsensitiveRule) {
|
|
2199
|
+
console.error("You're attempting to insert the following rule:\n" + rule + "\n\n`@import` rules must be before all other types of rules in a stylesheet but other rules have already been inserted. Please ensure that `@import` rules are before all other rules.");
|
|
2200
|
+
}
|
|
2201
|
+
this._alreadyInsertedOrderInsensitiveRule = this._alreadyInsertedOrderInsensitiveRule || !isImportRule3;
|
|
2202
|
+
}
|
|
2203
|
+
if (this.isSpeedy) {
|
|
2204
|
+
var sheet = sheetForTag(tag);
|
|
2205
|
+
try {
|
|
2206
|
+
sheet.insertRule(rule, sheet.cssRules.length);
|
|
2207
|
+
} catch (e) {
|
|
2208
|
+
if (!/:(-moz-placeholder|-moz-focus-inner|-moz-focusring|-ms-input-placeholder|-moz-read-write|-moz-read-only|-ms-clear|-ms-expand|-ms-reveal){/.test(rule)) {
|
|
2209
|
+
console.error('There was a problem inserting the following rule: "' + rule + '"', e);
|
|
2210
|
+
}
|
|
2211
|
+
}
|
|
2212
|
+
} else {
|
|
2213
|
+
tag.appendChild(document.createTextNode(rule));
|
|
2214
|
+
}
|
|
2215
|
+
this.ctr++;
|
|
2216
|
+
};
|
|
2217
|
+
_proto.flush = function flush() {
|
|
2218
|
+
this.tags.forEach(function(tag) {
|
|
2219
|
+
return tag.parentNode && tag.parentNode.removeChild(tag);
|
|
2220
|
+
});
|
|
2221
|
+
this.tags = [];
|
|
2222
|
+
this.ctr = 0;
|
|
2223
|
+
if (true) {
|
|
2224
|
+
this._alreadyInsertedOrderInsensitiveRule = false;
|
|
2225
|
+
}
|
|
2226
|
+
};
|
|
2227
|
+
return StyleSheet2;
|
|
2228
|
+
}();
|
|
2229
|
+
}
|
|
2230
|
+
});
|
|
2231
|
+
|
|
2232
|
+
// ../../node_modules/stylis/src/Enum.js
|
|
2233
|
+
var MS, MOZ, WEBKIT, COMMENT, RULESET, DECLARATION, IMPORT, KEYFRAMES;
|
|
2234
|
+
var init_Enum = __esm({
|
|
2235
|
+
"../../node_modules/stylis/src/Enum.js"() {
|
|
2236
|
+
MS = "-ms-";
|
|
2237
|
+
MOZ = "-moz-";
|
|
2238
|
+
WEBKIT = "-webkit-";
|
|
2239
|
+
COMMENT = "comm";
|
|
2240
|
+
RULESET = "rule";
|
|
2241
|
+
DECLARATION = "decl";
|
|
2242
|
+
IMPORT = "@import";
|
|
2243
|
+
KEYFRAMES = "@keyframes";
|
|
2244
|
+
}
|
|
2245
|
+
});
|
|
2246
|
+
|
|
2247
|
+
// ../../node_modules/stylis/src/Utility.js
|
|
2248
|
+
function hash(value, length2) {
|
|
2249
|
+
return charat(value, 0) ^ 45 ? (((length2 << 2 ^ charat(value, 0)) << 2 ^ charat(value, 1)) << 2 ^ charat(value, 2)) << 2 ^ charat(value, 3) : 0;
|
|
2250
|
+
}
|
|
2251
|
+
function trim(value) {
|
|
2252
|
+
return value.trim();
|
|
2253
|
+
}
|
|
2254
|
+
function match(value, pattern) {
|
|
2255
|
+
return (value = pattern.exec(value)) ? value[0] : value;
|
|
2256
|
+
}
|
|
2257
|
+
function replace(value, pattern, replacement) {
|
|
2258
|
+
return value.replace(pattern, replacement);
|
|
2259
|
+
}
|
|
2260
|
+
function indexof(value, search) {
|
|
2261
|
+
return value.indexOf(search);
|
|
2262
|
+
}
|
|
2263
|
+
function charat(value, index) {
|
|
2264
|
+
return value.charCodeAt(index) | 0;
|
|
2265
|
+
}
|
|
2266
|
+
function substr(value, begin, end) {
|
|
2267
|
+
return value.slice(begin, end);
|
|
2268
|
+
}
|
|
2269
|
+
function strlen(value) {
|
|
2270
|
+
return value.length;
|
|
2271
|
+
}
|
|
2272
|
+
function sizeof(value) {
|
|
2273
|
+
return value.length;
|
|
2274
|
+
}
|
|
2275
|
+
function append(value, array) {
|
|
2276
|
+
return array.push(value), value;
|
|
2277
|
+
}
|
|
2278
|
+
function combine(array, callback) {
|
|
2279
|
+
return array.map(callback).join("");
|
|
2280
|
+
}
|
|
2281
|
+
var abs, from, assign;
|
|
2282
|
+
var init_Utility = __esm({
|
|
2283
|
+
"../../node_modules/stylis/src/Utility.js"() {
|
|
2284
|
+
abs = Math.abs;
|
|
2285
|
+
from = String.fromCharCode;
|
|
2286
|
+
assign = Object.assign;
|
|
2287
|
+
}
|
|
2288
|
+
});
|
|
2289
|
+
|
|
2290
|
+
// ../../node_modules/stylis/src/Tokenizer.js
|
|
2291
|
+
function node(value, root, parent, type, props, children, length2) {
|
|
2292
|
+
return { value, root, parent, type, props, children, line, column, length: length2, return: "" };
|
|
2293
|
+
}
|
|
2294
|
+
function copy(root, props) {
|
|
2295
|
+
return assign(node("", null, null, "", null, null, 0), root, { length: -root.length }, props);
|
|
2296
|
+
}
|
|
2297
|
+
function char() {
|
|
2298
|
+
return character;
|
|
2299
|
+
}
|
|
2300
|
+
function prev() {
|
|
2301
|
+
character = position > 0 ? charat(characters, --position) : 0;
|
|
2302
|
+
if (column--, character === 10)
|
|
2303
|
+
column = 1, line--;
|
|
2304
|
+
return character;
|
|
2305
|
+
}
|
|
2306
|
+
function next() {
|
|
2307
|
+
character = position < length ? charat(characters, position++) : 0;
|
|
2308
|
+
if (column++, character === 10)
|
|
2309
|
+
column = 1, line++;
|
|
2310
|
+
return character;
|
|
2311
|
+
}
|
|
2312
|
+
function peek() {
|
|
2313
|
+
return charat(characters, position);
|
|
2314
|
+
}
|
|
2315
|
+
function caret() {
|
|
2316
|
+
return position;
|
|
2317
|
+
}
|
|
2318
|
+
function slice(begin, end) {
|
|
2319
|
+
return substr(characters, begin, end);
|
|
2320
|
+
}
|
|
2321
|
+
function token(type) {
|
|
2322
|
+
switch (type) {
|
|
2323
|
+
case 0:
|
|
2324
|
+
case 9:
|
|
2325
|
+
case 10:
|
|
2326
|
+
case 13:
|
|
2327
|
+
case 32:
|
|
2328
|
+
return 5;
|
|
2329
|
+
case 33:
|
|
2330
|
+
case 43:
|
|
2331
|
+
case 44:
|
|
2332
|
+
case 47:
|
|
2333
|
+
case 62:
|
|
2334
|
+
case 64:
|
|
2335
|
+
case 126:
|
|
2336
|
+
case 59:
|
|
2337
|
+
case 123:
|
|
2338
|
+
case 125:
|
|
2339
|
+
return 4;
|
|
2340
|
+
case 58:
|
|
2341
|
+
return 3;
|
|
2342
|
+
case 34:
|
|
2343
|
+
case 39:
|
|
2344
|
+
case 40:
|
|
2345
|
+
case 91:
|
|
2346
|
+
return 2;
|
|
2347
|
+
case 41:
|
|
2348
|
+
case 93:
|
|
2349
|
+
return 1;
|
|
2350
|
+
}
|
|
2351
|
+
return 0;
|
|
2352
|
+
}
|
|
2353
|
+
function alloc(value) {
|
|
2354
|
+
return line = column = 1, length = strlen(characters = value), position = 0, [];
|
|
2355
|
+
}
|
|
2356
|
+
function dealloc(value) {
|
|
2357
|
+
return characters = "", value;
|
|
2358
|
+
}
|
|
2359
|
+
function delimit(type) {
|
|
2360
|
+
return trim(slice(position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type)));
|
|
2361
|
+
}
|
|
2362
|
+
function whitespace(type) {
|
|
2363
|
+
while (character = peek())
|
|
2364
|
+
if (character < 33)
|
|
2365
|
+
next();
|
|
2366
|
+
else
|
|
2367
|
+
break;
|
|
2368
|
+
return token(type) > 2 || token(character) > 3 ? "" : " ";
|
|
2369
|
+
}
|
|
2370
|
+
function escaping(index, count) {
|
|
2371
|
+
while (--count && next())
|
|
2372
|
+
if (character < 48 || character > 102 || character > 57 && character < 65 || character > 70 && character < 97)
|
|
2373
|
+
break;
|
|
2374
|
+
return slice(index, caret() + (count < 6 && peek() == 32 && next() == 32));
|
|
2375
|
+
}
|
|
2376
|
+
function delimiter(type) {
|
|
2377
|
+
while (next())
|
|
2378
|
+
switch (character) {
|
|
2379
|
+
case type:
|
|
2380
|
+
return position;
|
|
2381
|
+
case 34:
|
|
2382
|
+
case 39:
|
|
2383
|
+
if (type !== 34 && type !== 39)
|
|
2384
|
+
delimiter(character);
|
|
2385
|
+
break;
|
|
2386
|
+
case 40:
|
|
2387
|
+
if (type === 41)
|
|
2388
|
+
delimiter(type);
|
|
2389
|
+
break;
|
|
2390
|
+
case 92:
|
|
2391
|
+
next();
|
|
2392
|
+
break;
|
|
2393
|
+
}
|
|
2394
|
+
return position;
|
|
2395
|
+
}
|
|
2396
|
+
function commenter(type, index) {
|
|
2397
|
+
while (next())
|
|
2398
|
+
if (type + character === 47 + 10)
|
|
2399
|
+
break;
|
|
2400
|
+
else if (type + character === 42 + 42 && peek() === 47)
|
|
2401
|
+
break;
|
|
2402
|
+
return "/*" + slice(index, position - 1) + "*" + from(type === 47 ? type : next());
|
|
2403
|
+
}
|
|
2404
|
+
function identifier(index) {
|
|
2405
|
+
while (!token(peek()))
|
|
2406
|
+
next();
|
|
2407
|
+
return slice(index, position);
|
|
2408
|
+
}
|
|
2409
|
+
var line, column, length, position, character, characters;
|
|
2410
|
+
var init_Tokenizer = __esm({
|
|
2411
|
+
"../../node_modules/stylis/src/Tokenizer.js"() {
|
|
2412
|
+
init_Utility();
|
|
2413
|
+
line = 1;
|
|
2414
|
+
column = 1;
|
|
2415
|
+
length = 0;
|
|
2416
|
+
position = 0;
|
|
2417
|
+
character = 0;
|
|
2418
|
+
characters = "";
|
|
2419
|
+
}
|
|
2420
|
+
});
|
|
2421
|
+
|
|
2422
|
+
// ../../node_modules/stylis/src/Parser.js
|
|
2423
|
+
function compile(value) {
|
|
2424
|
+
return dealloc(parse("", null, null, null, [""], value = alloc(value), 0, [0], value));
|
|
2425
|
+
}
|
|
2426
|
+
function parse(value, root, parent, rule, rules, rulesets, pseudo, points, declarations) {
|
|
2427
|
+
var index = 0;
|
|
2428
|
+
var offset = 0;
|
|
2429
|
+
var length2 = pseudo;
|
|
2430
|
+
var atrule = 0;
|
|
2431
|
+
var property = 0;
|
|
2432
|
+
var previous = 0;
|
|
2433
|
+
var variable = 1;
|
|
2434
|
+
var scanning = 1;
|
|
2435
|
+
var ampersand = 1;
|
|
2436
|
+
var character2 = 0;
|
|
2437
|
+
var type = "";
|
|
2438
|
+
var props = rules;
|
|
2439
|
+
var children = rulesets;
|
|
2440
|
+
var reference = rule;
|
|
2441
|
+
var characters2 = type;
|
|
2442
|
+
while (scanning)
|
|
2443
|
+
switch (previous = character2, character2 = next()) {
|
|
2444
|
+
case 40:
|
|
2445
|
+
if (previous != 108 && charat(characters2, length2 - 1) == 58) {
|
|
2446
|
+
if (indexof(characters2 += replace(delimit(character2), "&", "&\f"), "&\f") != -1)
|
|
2447
|
+
ampersand = -1;
|
|
2448
|
+
break;
|
|
2449
|
+
}
|
|
2450
|
+
case 34:
|
|
2451
|
+
case 39:
|
|
2452
|
+
case 91:
|
|
2453
|
+
characters2 += delimit(character2);
|
|
2454
|
+
break;
|
|
2455
|
+
case 9:
|
|
2456
|
+
case 10:
|
|
2457
|
+
case 13:
|
|
2458
|
+
case 32:
|
|
2459
|
+
characters2 += whitespace(previous);
|
|
2460
|
+
break;
|
|
2461
|
+
case 92:
|
|
2462
|
+
characters2 += escaping(caret() - 1, 7);
|
|
2463
|
+
continue;
|
|
2464
|
+
case 47:
|
|
2465
|
+
switch (peek()) {
|
|
2466
|
+
case 42:
|
|
2467
|
+
case 47:
|
|
2468
|
+
append(comment(commenter(next(), caret()), root, parent), declarations);
|
|
2469
|
+
break;
|
|
2470
|
+
default:
|
|
2471
|
+
characters2 += "/";
|
|
2472
|
+
}
|
|
2473
|
+
break;
|
|
2474
|
+
case 123 * variable:
|
|
2475
|
+
points[index++] = strlen(characters2) * ampersand;
|
|
2476
|
+
case 125 * variable:
|
|
2477
|
+
case 59:
|
|
2478
|
+
case 0:
|
|
2479
|
+
switch (character2) {
|
|
2480
|
+
case 0:
|
|
2481
|
+
case 125:
|
|
2482
|
+
scanning = 0;
|
|
2483
|
+
case 59 + offset:
|
|
2484
|
+
if (property > 0 && strlen(characters2) - length2)
|
|
2485
|
+
append(property > 32 ? declaration(characters2 + ";", rule, parent, length2 - 1) : declaration(replace(characters2, " ", "") + ";", rule, parent, length2 - 2), declarations);
|
|
2486
|
+
break;
|
|
2487
|
+
case 59:
|
|
2488
|
+
characters2 += ";";
|
|
2489
|
+
default:
|
|
2490
|
+
append(reference = ruleset(characters2, root, parent, index, offset, rules, points, type, props = [], children = [], length2), rulesets);
|
|
2491
|
+
if (character2 === 123)
|
|
2492
|
+
if (offset === 0)
|
|
2493
|
+
parse(characters2, root, reference, reference, props, rulesets, length2, points, children);
|
|
2494
|
+
else
|
|
2495
|
+
switch (atrule === 99 && charat(characters2, 3) === 110 ? 100 : atrule) {
|
|
2496
|
+
case 100:
|
|
2497
|
+
case 109:
|
|
2498
|
+
case 115:
|
|
2499
|
+
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);
|
|
2500
|
+
break;
|
|
2501
|
+
default:
|
|
2502
|
+
parse(characters2, reference, reference, reference, [""], children, 0, points, children);
|
|
2503
|
+
}
|
|
2504
|
+
}
|
|
2505
|
+
index = offset = property = 0, variable = ampersand = 1, type = characters2 = "", length2 = pseudo;
|
|
2506
|
+
break;
|
|
2507
|
+
case 58:
|
|
2508
|
+
length2 = 1 + strlen(characters2), property = previous;
|
|
2509
|
+
default:
|
|
2510
|
+
if (variable < 1) {
|
|
2511
|
+
if (character2 == 123)
|
|
2512
|
+
--variable;
|
|
2513
|
+
else if (character2 == 125 && variable++ == 0 && prev() == 125)
|
|
2514
|
+
continue;
|
|
2515
|
+
}
|
|
2516
|
+
switch (characters2 += from(character2), character2 * variable) {
|
|
2517
|
+
case 38:
|
|
2518
|
+
ampersand = offset > 0 ? 1 : (characters2 += "\f", -1);
|
|
2519
|
+
break;
|
|
2520
|
+
case 44:
|
|
2521
|
+
points[index++] = (strlen(characters2) - 1) * ampersand, ampersand = 1;
|
|
2522
|
+
break;
|
|
2523
|
+
case 64:
|
|
2524
|
+
if (peek() === 45)
|
|
2525
|
+
characters2 += delimit(next());
|
|
2526
|
+
atrule = peek(), offset = length2 = strlen(type = characters2 += identifier(caret())), character2++;
|
|
2527
|
+
break;
|
|
2528
|
+
case 45:
|
|
2529
|
+
if (previous === 45 && strlen(characters2) == 2)
|
|
2530
|
+
variable = 0;
|
|
2531
|
+
}
|
|
2532
|
+
}
|
|
2533
|
+
return rulesets;
|
|
2534
|
+
}
|
|
2535
|
+
function ruleset(value, root, parent, index, offset, rules, points, type, props, children, length2) {
|
|
2536
|
+
var post = offset - 1;
|
|
2537
|
+
var rule = offset === 0 ? rules : [""];
|
|
2538
|
+
var size = sizeof(rule);
|
|
2539
|
+
for (var i = 0, j = 0, k = 0; i < index; ++i)
|
|
2540
|
+
for (var x = 0, y = substr(value, post + 1, post = abs(j = points[i])), z = value; x < size; ++x)
|
|
2541
|
+
if (z = trim(j > 0 ? rule[x] + " " + y : replace(y, /&\f/g, rule[x])))
|
|
2542
|
+
props[k++] = z;
|
|
2543
|
+
return node(value, root, parent, offset === 0 ? RULESET : type, props, children, length2);
|
|
2544
|
+
}
|
|
2545
|
+
function comment(value, root, parent) {
|
|
2546
|
+
return node(value, root, parent, COMMENT, from(char()), substr(value, 2, -2), 0);
|
|
2547
|
+
}
|
|
2548
|
+
function declaration(value, root, parent, length2) {
|
|
2549
|
+
return node(value, root, parent, DECLARATION, substr(value, 0, length2), substr(value, length2 + 1, -1), length2);
|
|
2550
|
+
}
|
|
2551
|
+
var init_Parser = __esm({
|
|
2552
|
+
"../../node_modules/stylis/src/Parser.js"() {
|
|
2553
|
+
init_Enum();
|
|
2554
|
+
init_Utility();
|
|
2555
|
+
init_Tokenizer();
|
|
2556
|
+
}
|
|
2557
|
+
});
|
|
2558
|
+
|
|
2559
|
+
// ../../node_modules/stylis/src/Prefixer.js
|
|
2560
|
+
var init_Prefixer = __esm({
|
|
2561
|
+
"../../node_modules/stylis/src/Prefixer.js"() {
|
|
2562
|
+
}
|
|
2563
|
+
});
|
|
2564
|
+
|
|
2565
|
+
// ../../node_modules/stylis/src/Serializer.js
|
|
2566
|
+
function serialize(children, callback) {
|
|
2567
|
+
var output = "";
|
|
2568
|
+
var length2 = sizeof(children);
|
|
2569
|
+
for (var i = 0; i < length2; i++)
|
|
2570
|
+
output += callback(children[i], i, children, callback) || "";
|
|
2571
|
+
return output;
|
|
2572
|
+
}
|
|
2573
|
+
function stringify(element, index, children, callback) {
|
|
2574
|
+
switch (element.type) {
|
|
2575
|
+
case IMPORT:
|
|
2576
|
+
case DECLARATION:
|
|
2577
|
+
return element.return = element.return || element.value;
|
|
2578
|
+
case COMMENT:
|
|
2579
|
+
return "";
|
|
2580
|
+
case KEYFRAMES:
|
|
2581
|
+
return element.return = element.value + "{" + serialize(element.children, callback) + "}";
|
|
2582
|
+
case RULESET:
|
|
2583
|
+
element.value = element.props.join(",");
|
|
2584
|
+
}
|
|
2585
|
+
return strlen(children = serialize(element.children, callback)) ? element.return = element.value + "{" + children + "}" : "";
|
|
2586
|
+
}
|
|
2587
|
+
var init_Serializer = __esm({
|
|
2588
|
+
"../../node_modules/stylis/src/Serializer.js"() {
|
|
2589
|
+
init_Enum();
|
|
2590
|
+
init_Utility();
|
|
2591
|
+
}
|
|
2592
|
+
});
|
|
2593
|
+
|
|
2594
|
+
// ../../node_modules/stylis/src/Middleware.js
|
|
2595
|
+
function middleware(collection) {
|
|
2596
|
+
var length2 = sizeof(collection);
|
|
2597
|
+
return function(element, index, children, callback) {
|
|
2598
|
+
var output = "";
|
|
2599
|
+
for (var i = 0; i < length2; i++)
|
|
2600
|
+
output += collection[i](element, index, children, callback) || "";
|
|
2601
|
+
return output;
|
|
2602
|
+
};
|
|
2603
|
+
}
|
|
2604
|
+
var init_Middleware = __esm({
|
|
2605
|
+
"../../node_modules/stylis/src/Middleware.js"() {
|
|
2606
|
+
init_Utility();
|
|
2607
|
+
}
|
|
2608
|
+
});
|
|
2609
|
+
|
|
2610
|
+
// ../../node_modules/stylis/index.js
|
|
2611
|
+
var init_stylis = __esm({
|
|
2612
|
+
"../../node_modules/stylis/index.js"() {
|
|
2613
|
+
init_Enum();
|
|
2614
|
+
init_Utility();
|
|
2615
|
+
init_Parser();
|
|
2616
|
+
init_Prefixer();
|
|
2617
|
+
init_Tokenizer();
|
|
2618
|
+
init_Serializer();
|
|
2619
|
+
init_Middleware();
|
|
2620
|
+
}
|
|
2621
|
+
});
|
|
2622
|
+
|
|
2623
|
+
// ../../node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.esm.js
|
|
2624
|
+
var init_emotion_weak_memoize_esm = __esm({
|
|
2625
|
+
"../../node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.esm.js"() {
|
|
2626
|
+
}
|
|
2627
|
+
});
|
|
2628
|
+
|
|
2629
|
+
// ../../node_modules/@emotion/memoize/dist/emotion-memoize.esm.js
|
|
2630
|
+
function memoize(fn) {
|
|
2631
|
+
var cache = /* @__PURE__ */ Object.create(null);
|
|
2632
|
+
return function(arg) {
|
|
2633
|
+
if (cache[arg] === void 0)
|
|
2634
|
+
cache[arg] = fn(arg);
|
|
2635
|
+
return cache[arg];
|
|
2636
|
+
};
|
|
2637
|
+
}
|
|
2638
|
+
var emotion_memoize_esm_default;
|
|
2639
|
+
var init_emotion_memoize_esm = __esm({
|
|
2640
|
+
"../../node_modules/@emotion/memoize/dist/emotion-memoize.esm.js"() {
|
|
2641
|
+
emotion_memoize_esm_default = memoize;
|
|
2642
|
+
}
|
|
2643
|
+
});
|
|
2644
|
+
|
|
2645
|
+
// ../../node_modules/@emotion/cache/dist/emotion-cache.browser.esm.js
|
|
2646
|
+
function prefix(value, length2) {
|
|
2647
|
+
switch (hash(value, length2)) {
|
|
2648
|
+
case 5103:
|
|
2649
|
+
return WEBKIT + "print-" + value + value;
|
|
2650
|
+
case 5737:
|
|
2651
|
+
case 4201:
|
|
2652
|
+
case 3177:
|
|
2653
|
+
case 3433:
|
|
2654
|
+
case 1641:
|
|
2655
|
+
case 4457:
|
|
2656
|
+
case 2921:
|
|
2657
|
+
case 5572:
|
|
2658
|
+
case 6356:
|
|
2659
|
+
case 5844:
|
|
2660
|
+
case 3191:
|
|
2661
|
+
case 6645:
|
|
2662
|
+
case 3005:
|
|
2663
|
+
case 6391:
|
|
2664
|
+
case 5879:
|
|
2665
|
+
case 5623:
|
|
2666
|
+
case 6135:
|
|
2667
|
+
case 4599:
|
|
2668
|
+
case 4855:
|
|
2669
|
+
case 4215:
|
|
2670
|
+
case 6389:
|
|
2671
|
+
case 5109:
|
|
2672
|
+
case 5365:
|
|
2673
|
+
case 5621:
|
|
2674
|
+
case 3829:
|
|
2675
|
+
return WEBKIT + value + value;
|
|
2676
|
+
case 5349:
|
|
2677
|
+
case 4246:
|
|
2678
|
+
case 4810:
|
|
2679
|
+
case 6968:
|
|
2680
|
+
case 2756:
|
|
2681
|
+
return WEBKIT + value + MOZ + value + MS + value + value;
|
|
2682
|
+
case 6828:
|
|
2683
|
+
case 4268:
|
|
2684
|
+
return WEBKIT + value + MS + value + value;
|
|
2685
|
+
case 6165:
|
|
2686
|
+
return WEBKIT + value + MS + "flex-" + value + value;
|
|
2687
|
+
case 5187:
|
|
2688
|
+
return WEBKIT + value + replace(value, /(\w+).+(:[^]+)/, WEBKIT + "box-$1$2" + MS + "flex-$1$2") + value;
|
|
2689
|
+
case 5443:
|
|
2690
|
+
return WEBKIT + value + MS + "flex-item-" + replace(value, /flex-|-self/, "") + value;
|
|
2691
|
+
case 4675:
|
|
2692
|
+
return WEBKIT + value + MS + "flex-line-pack" + replace(value, /align-content|flex-|-self/, "") + value;
|
|
2693
|
+
case 5548:
|
|
2694
|
+
return WEBKIT + value + MS + replace(value, "shrink", "negative") + value;
|
|
2695
|
+
case 5292:
|
|
2696
|
+
return WEBKIT + value + MS + replace(value, "basis", "preferred-size") + value;
|
|
2697
|
+
case 6060:
|
|
2698
|
+
return WEBKIT + "box-" + replace(value, "-grow", "") + WEBKIT + value + MS + replace(value, "grow", "positive") + value;
|
|
2699
|
+
case 4554:
|
|
2700
|
+
return WEBKIT + replace(value, /([^-])(transform)/g, "$1" + WEBKIT + "$2") + value;
|
|
2701
|
+
case 6187:
|
|
2702
|
+
return replace(replace(replace(value, /(zoom-|grab)/, WEBKIT + "$1"), /(image-set)/, WEBKIT + "$1"), value, "") + value;
|
|
2703
|
+
case 5495:
|
|
2704
|
+
case 3959:
|
|
2705
|
+
return replace(value, /(image-set\([^]*)/, WEBKIT + "$1$`$1");
|
|
2706
|
+
case 4968:
|
|
2707
|
+
return replace(replace(value, /(.+:)(flex-)?(.*)/, WEBKIT + "box-pack:$3" + MS + "flex-pack:$3"), /s.+-b[^;]+/, "justify") + WEBKIT + value + value;
|
|
2708
|
+
case 4095:
|
|
2709
|
+
case 3583:
|
|
2710
|
+
case 4068:
|
|
2711
|
+
case 2532:
|
|
2712
|
+
return replace(value, /(.+)-inline(.+)/, WEBKIT + "$1$2") + value;
|
|
2713
|
+
case 8116:
|
|
2714
|
+
case 7059:
|
|
2715
|
+
case 5753:
|
|
2716
|
+
case 5535:
|
|
2717
|
+
case 5445:
|
|
2718
|
+
case 5701:
|
|
2719
|
+
case 4933:
|
|
2720
|
+
case 4677:
|
|
2721
|
+
case 5533:
|
|
2722
|
+
case 5789:
|
|
2723
|
+
case 5021:
|
|
2724
|
+
case 4765:
|
|
2725
|
+
if (strlen(value) - 1 - length2 > 6)
|
|
2726
|
+
switch (charat(value, length2 + 1)) {
|
|
2727
|
+
case 109:
|
|
2728
|
+
if (charat(value, length2 + 4) !== 45)
|
|
2729
|
+
break;
|
|
2730
|
+
case 102:
|
|
2731
|
+
return replace(value, /(.+:)(.+)-([^]+)/, "$1" + WEBKIT + "$2-$3$1" + MOZ + (charat(value, length2 + 3) == 108 ? "$3" : "$2-$3")) + value;
|
|
2732
|
+
case 115:
|
|
2733
|
+
return ~indexof(value, "stretch") ? prefix(replace(value, "stretch", "fill-available"), length2) + value : value;
|
|
2734
|
+
}
|
|
2735
|
+
break;
|
|
2736
|
+
case 4949:
|
|
2737
|
+
if (charat(value, length2 + 1) !== 115)
|
|
2738
|
+
break;
|
|
2739
|
+
case 6444:
|
|
2740
|
+
switch (charat(value, strlen(value) - 3 - (~indexof(value, "!important") && 10))) {
|
|
2741
|
+
case 107:
|
|
2742
|
+
return replace(value, ":", ":" + WEBKIT) + value;
|
|
2743
|
+
case 101:
|
|
2744
|
+
return replace(value, /(.+:)([^;!]+)(;|!.+)?/, "$1" + WEBKIT + (charat(value, 14) === 45 ? "inline-" : "") + "box$3$1" + WEBKIT + "$2$3$1" + MS + "$2box$3") + value;
|
|
2745
|
+
}
|
|
2746
|
+
break;
|
|
2747
|
+
case 5936:
|
|
2748
|
+
switch (charat(value, length2 + 11)) {
|
|
2749
|
+
case 114:
|
|
2750
|
+
return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, "tb") + value;
|
|
2751
|
+
case 108:
|
|
2752
|
+
return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, "tb-rl") + value;
|
|
2753
|
+
case 45:
|
|
2754
|
+
return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, "lr") + value;
|
|
2755
|
+
}
|
|
2756
|
+
return WEBKIT + value + MS + value + value;
|
|
2757
|
+
}
|
|
2758
|
+
return value;
|
|
2759
|
+
}
|
|
2760
|
+
var identifierWithPointTracking, toRules, getRules, fixedElements, compat, removeLabel, ignoreFlag, isIgnoringComment, createUnsafeSelectorsAlarm, isImportRule, isPrependedWithRegularRules, nullifyElement, incorrectImportAlarm, prefixer, defaultStylisPlugins, createCache, emotion_cache_browser_esm_default;
|
|
2761
|
+
var init_emotion_cache_browser_esm = __esm({
|
|
2762
|
+
"../../node_modules/@emotion/cache/dist/emotion-cache.browser.esm.js"() {
|
|
2763
|
+
init_emotion_sheet_browser_esm();
|
|
2764
|
+
init_stylis();
|
|
2765
|
+
init_emotion_weak_memoize_esm();
|
|
2766
|
+
init_emotion_memoize_esm();
|
|
2767
|
+
identifierWithPointTracking = function identifierWithPointTracking2(begin, points, index) {
|
|
2768
|
+
var previous = 0;
|
|
2769
|
+
var character2 = 0;
|
|
2770
|
+
while (true) {
|
|
2771
|
+
previous = character2;
|
|
2772
|
+
character2 = peek();
|
|
2773
|
+
if (previous === 38 && character2 === 12) {
|
|
2774
|
+
points[index] = 1;
|
|
2775
|
+
}
|
|
2776
|
+
if (token(character2)) {
|
|
2777
|
+
break;
|
|
2778
|
+
}
|
|
2779
|
+
next();
|
|
2780
|
+
}
|
|
2781
|
+
return slice(begin, position);
|
|
2782
|
+
};
|
|
2783
|
+
toRules = function toRules2(parsed, points) {
|
|
2784
|
+
var index = -1;
|
|
2785
|
+
var character2 = 44;
|
|
2786
|
+
do {
|
|
2787
|
+
switch (token(character2)) {
|
|
2788
|
+
case 0:
|
|
2789
|
+
if (character2 === 38 && peek() === 12) {
|
|
2790
|
+
points[index] = 1;
|
|
2791
|
+
}
|
|
2792
|
+
parsed[index] += identifierWithPointTracking(position - 1, points, index);
|
|
2793
|
+
break;
|
|
2794
|
+
case 2:
|
|
2795
|
+
parsed[index] += delimit(character2);
|
|
2796
|
+
break;
|
|
2797
|
+
case 4:
|
|
2798
|
+
if (character2 === 44) {
|
|
2799
|
+
parsed[++index] = peek() === 58 ? "&\f" : "";
|
|
2800
|
+
points[index] = parsed[index].length;
|
|
2801
|
+
break;
|
|
2802
|
+
}
|
|
2803
|
+
default:
|
|
2804
|
+
parsed[index] += from(character2);
|
|
2805
|
+
}
|
|
2806
|
+
} while (character2 = next());
|
|
2807
|
+
return parsed;
|
|
2808
|
+
};
|
|
2809
|
+
getRules = function getRules2(value, points) {
|
|
2810
|
+
return dealloc(toRules(alloc(value), points));
|
|
2811
|
+
};
|
|
2812
|
+
fixedElements = /* @__PURE__ */ new WeakMap();
|
|
2813
|
+
compat = function compat2(element) {
|
|
2814
|
+
if (element.type !== "rule" || !element.parent || // positive .length indicates that this rule contains pseudo
|
|
2815
|
+
// negative .length indicates that this rule has been already prefixed
|
|
2816
|
+
element.length < 1) {
|
|
2817
|
+
return;
|
|
2818
|
+
}
|
|
2819
|
+
var value = element.value, parent = element.parent;
|
|
2820
|
+
var isImplicitRule = element.column === parent.column && element.line === parent.line;
|
|
2821
|
+
while (parent.type !== "rule") {
|
|
2822
|
+
parent = parent.parent;
|
|
2823
|
+
if (!parent)
|
|
2824
|
+
return;
|
|
2825
|
+
}
|
|
2826
|
+
if (element.props.length === 1 && value.charCodeAt(0) !== 58 && !fixedElements.get(parent)) {
|
|
2827
|
+
return;
|
|
2828
|
+
}
|
|
2829
|
+
if (isImplicitRule) {
|
|
2830
|
+
return;
|
|
2831
|
+
}
|
|
2832
|
+
fixedElements.set(element, true);
|
|
2833
|
+
var points = [];
|
|
2834
|
+
var rules = getRules(value, points);
|
|
2835
|
+
var parentRules = parent.props;
|
|
2836
|
+
for (var i = 0, k = 0; i < rules.length; i++) {
|
|
2837
|
+
for (var j = 0; j < parentRules.length; j++, k++) {
|
|
2838
|
+
element.props[k] = points[i] ? rules[i].replace(/&\f/g, parentRules[j]) : parentRules[j] + " " + rules[i];
|
|
2839
|
+
}
|
|
2840
|
+
}
|
|
2841
|
+
};
|
|
2842
|
+
removeLabel = function removeLabel2(element) {
|
|
2843
|
+
if (element.type === "decl") {
|
|
2844
|
+
var value = element.value;
|
|
2845
|
+
if (
|
|
2846
|
+
// charcode for l
|
|
2847
|
+
value.charCodeAt(0) === 108 && // charcode for b
|
|
2848
|
+
value.charCodeAt(2) === 98
|
|
2849
|
+
) {
|
|
2850
|
+
element["return"] = "";
|
|
2851
|
+
element.value = "";
|
|
2852
|
+
}
|
|
2853
|
+
}
|
|
2854
|
+
};
|
|
2855
|
+
ignoreFlag = "emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason";
|
|
2856
|
+
isIgnoringComment = function isIgnoringComment2(element) {
|
|
2857
|
+
return element.type === "comm" && element.children.indexOf(ignoreFlag) > -1;
|
|
2858
|
+
};
|
|
2859
|
+
createUnsafeSelectorsAlarm = function createUnsafeSelectorsAlarm2(cache) {
|
|
2860
|
+
return function(element, index, children) {
|
|
2861
|
+
if (element.type !== "rule" || cache.compat)
|
|
2862
|
+
return;
|
|
2863
|
+
var unsafePseudoClasses = element.value.match(/(:first|:nth|:nth-last)-child/g);
|
|
2864
|
+
if (unsafePseudoClasses) {
|
|
2865
|
+
var isNested = element.parent === children[0];
|
|
2866
|
+
var commentContainer = isNested ? children[0].children : (
|
|
2867
|
+
// global rule at the root level
|
|
2868
|
+
children
|
|
2869
|
+
);
|
|
2870
|
+
for (var i = commentContainer.length - 1; i >= 0; i--) {
|
|
2871
|
+
var node2 = commentContainer[i];
|
|
2872
|
+
if (node2.line < element.line) {
|
|
2873
|
+
break;
|
|
2874
|
+
}
|
|
2875
|
+
if (node2.column < element.column) {
|
|
2876
|
+
if (isIgnoringComment(node2)) {
|
|
2877
|
+
return;
|
|
2878
|
+
}
|
|
2879
|
+
break;
|
|
2880
|
+
}
|
|
2881
|
+
}
|
|
2882
|
+
unsafePseudoClasses.forEach(function(unsafePseudoClass) {
|
|
2883
|
+
console.error('The pseudo class "' + unsafePseudoClass + '" is potentially unsafe when doing server-side rendering. Try changing it to "' + unsafePseudoClass.split("-child")[0] + '-of-type".');
|
|
2884
|
+
});
|
|
2885
|
+
}
|
|
2886
|
+
};
|
|
2887
|
+
};
|
|
2888
|
+
isImportRule = function isImportRule2(element) {
|
|
2889
|
+
return element.type.charCodeAt(1) === 105 && element.type.charCodeAt(0) === 64;
|
|
2890
|
+
};
|
|
2891
|
+
isPrependedWithRegularRules = function isPrependedWithRegularRules2(index, children) {
|
|
2892
|
+
for (var i = index - 1; i >= 0; i--) {
|
|
2893
|
+
if (!isImportRule(children[i])) {
|
|
2894
|
+
return true;
|
|
2895
|
+
}
|
|
2896
|
+
}
|
|
2897
|
+
return false;
|
|
2898
|
+
};
|
|
2899
|
+
nullifyElement = function nullifyElement2(element) {
|
|
2900
|
+
element.type = "";
|
|
2901
|
+
element.value = "";
|
|
2902
|
+
element["return"] = "";
|
|
2903
|
+
element.children = "";
|
|
2904
|
+
element.props = "";
|
|
2905
|
+
};
|
|
2906
|
+
incorrectImportAlarm = function incorrectImportAlarm2(element, index, children) {
|
|
2907
|
+
if (!isImportRule(element)) {
|
|
2908
|
+
return;
|
|
2909
|
+
}
|
|
2910
|
+
if (element.parent) {
|
|
2911
|
+
console.error("`@import` rules can't be nested inside other rules. Please move it to the top level and put it before regular rules. Keep in mind that they can only be used within global styles.");
|
|
2912
|
+
nullifyElement(element);
|
|
2913
|
+
} else if (isPrependedWithRegularRules(index, children)) {
|
|
2914
|
+
console.error("`@import` rules can't be after other rules. Please put your `@import` rules before your other rules.");
|
|
2915
|
+
nullifyElement(element);
|
|
2916
|
+
}
|
|
2917
|
+
};
|
|
2918
|
+
prefixer = function prefixer2(element, index, children, callback) {
|
|
2919
|
+
if (element.length > -1) {
|
|
2920
|
+
if (!element["return"])
|
|
2921
|
+
switch (element.type) {
|
|
2922
|
+
case DECLARATION:
|
|
2923
|
+
element["return"] = prefix(element.value, element.length);
|
|
2924
|
+
break;
|
|
2925
|
+
case KEYFRAMES:
|
|
2926
|
+
return serialize([copy(element, {
|
|
2927
|
+
value: replace(element.value, "@", "@" + WEBKIT)
|
|
2928
|
+
})], callback);
|
|
2929
|
+
case RULESET:
|
|
2930
|
+
if (element.length)
|
|
2931
|
+
return combine(element.props, function(value) {
|
|
2932
|
+
switch (match(value, /(::plac\w+|:read-\w+)/)) {
|
|
2933
|
+
case ":read-only":
|
|
2934
|
+
case ":read-write":
|
|
2935
|
+
return serialize([copy(element, {
|
|
2936
|
+
props: [replace(value, /:(read-\w+)/, ":" + MOZ + "$1")]
|
|
2937
|
+
})], callback);
|
|
2938
|
+
case "::placeholder":
|
|
2939
|
+
return serialize([copy(element, {
|
|
2940
|
+
props: [replace(value, /:(plac\w+)/, ":" + WEBKIT + "input-$1")]
|
|
2941
|
+
}), copy(element, {
|
|
2942
|
+
props: [replace(value, /:(plac\w+)/, ":" + MOZ + "$1")]
|
|
2943
|
+
}), copy(element, {
|
|
2944
|
+
props: [replace(value, /:(plac\w+)/, MS + "input-$1")]
|
|
2945
|
+
})], callback);
|
|
2946
|
+
}
|
|
2947
|
+
return "";
|
|
2948
|
+
});
|
|
2949
|
+
}
|
|
2950
|
+
}
|
|
2951
|
+
};
|
|
2952
|
+
defaultStylisPlugins = [prefixer];
|
|
2953
|
+
createCache = function createCache2(options) {
|
|
2954
|
+
var key = options.key;
|
|
2955
|
+
if (!key) {
|
|
2956
|
+
throw new Error("You have to configure `key` for your cache. Please make sure it's unique (and not equal to 'css') as it's used for linking styles to your cache.\nIf multiple caches share the same key they might \"fight\" for each other's style elements.");
|
|
2957
|
+
}
|
|
2958
|
+
if (key === "css") {
|
|
2959
|
+
var ssrStyles = document.querySelectorAll("style[data-emotion]:not([data-s])");
|
|
2960
|
+
Array.prototype.forEach.call(ssrStyles, function(node2) {
|
|
2961
|
+
var dataEmotionAttribute = node2.getAttribute("data-emotion");
|
|
2962
|
+
if (dataEmotionAttribute.indexOf(" ") === -1) {
|
|
2963
|
+
return;
|
|
2964
|
+
}
|
|
2965
|
+
document.head.appendChild(node2);
|
|
2966
|
+
node2.setAttribute("data-s", "");
|
|
2967
|
+
});
|
|
2968
|
+
}
|
|
2969
|
+
var stylisPlugins = options.stylisPlugins || defaultStylisPlugins;
|
|
2970
|
+
if (true) {
|
|
2971
|
+
if (/[^a-z-]/.test(key)) {
|
|
2972
|
+
throw new Error('Emotion key must only contain lower case alphabetical characters and - but "' + key + '" was passed');
|
|
2973
|
+
}
|
|
2974
|
+
}
|
|
2975
|
+
var inserted = {};
|
|
2976
|
+
var container;
|
|
2977
|
+
var nodesToHydrate = [];
|
|
2978
|
+
{
|
|
2979
|
+
container = options.container || document.head;
|
|
2980
|
+
Array.prototype.forEach.call(
|
|
2981
|
+
// this means we will ignore elements which don't have a space in them which
|
|
2982
|
+
// means that the style elements we're looking at are only Emotion 11 server-rendered style elements
|
|
2983
|
+
document.querySelectorAll('style[data-emotion^="' + key + ' "]'),
|
|
2984
|
+
function(node2) {
|
|
2985
|
+
var attrib = node2.getAttribute("data-emotion").split(" ");
|
|
2986
|
+
for (var i = 1; i < attrib.length; i++) {
|
|
2987
|
+
inserted[attrib[i]] = true;
|
|
2988
|
+
}
|
|
2989
|
+
nodesToHydrate.push(node2);
|
|
2990
|
+
}
|
|
2991
|
+
);
|
|
2992
|
+
}
|
|
2993
|
+
var _insert;
|
|
2994
|
+
var omnipresentPlugins = [compat, removeLabel];
|
|
2995
|
+
if (true) {
|
|
2996
|
+
omnipresentPlugins.push(createUnsafeSelectorsAlarm({
|
|
2997
|
+
get compat() {
|
|
2998
|
+
return cache.compat;
|
|
2999
|
+
}
|
|
3000
|
+
}), incorrectImportAlarm);
|
|
3001
|
+
}
|
|
3002
|
+
{
|
|
3003
|
+
var currentSheet;
|
|
3004
|
+
var finalizingPlugins = [stringify, true ? function(element) {
|
|
3005
|
+
if (!element.root) {
|
|
3006
|
+
if (element["return"]) {
|
|
3007
|
+
currentSheet.insert(element["return"]);
|
|
3008
|
+
} else if (element.value && element.type !== COMMENT) {
|
|
3009
|
+
currentSheet.insert(element.value + "{}");
|
|
3010
|
+
}
|
|
3011
|
+
}
|
|
3012
|
+
} : rulesheet(function(rule) {
|
|
3013
|
+
currentSheet.insert(rule);
|
|
3014
|
+
})];
|
|
3015
|
+
var serializer = middleware(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins));
|
|
3016
|
+
var stylis = function stylis2(styles) {
|
|
3017
|
+
return serialize(compile(styles), serializer);
|
|
3018
|
+
};
|
|
3019
|
+
_insert = function insert(selector, serialized, sheet, shouldCache) {
|
|
3020
|
+
currentSheet = sheet;
|
|
3021
|
+
if (serialized.map !== void 0) {
|
|
3022
|
+
currentSheet = {
|
|
3023
|
+
insert: function insert2(rule) {
|
|
3024
|
+
sheet.insert(rule + serialized.map);
|
|
3025
|
+
}
|
|
3026
|
+
};
|
|
3027
|
+
}
|
|
3028
|
+
stylis(selector ? selector + "{" + serialized.styles + "}" : serialized.styles);
|
|
3029
|
+
if (shouldCache) {
|
|
3030
|
+
cache.inserted[serialized.name] = true;
|
|
3031
|
+
}
|
|
3032
|
+
};
|
|
3033
|
+
}
|
|
3034
|
+
var cache = {
|
|
3035
|
+
key,
|
|
3036
|
+
sheet: new StyleSheet({
|
|
3037
|
+
key,
|
|
3038
|
+
container,
|
|
3039
|
+
nonce: options.nonce,
|
|
3040
|
+
speedy: options.speedy,
|
|
3041
|
+
prepend: options.prepend,
|
|
3042
|
+
insertionPoint: options.insertionPoint
|
|
3043
|
+
}),
|
|
3044
|
+
nonce: options.nonce,
|
|
3045
|
+
inserted,
|
|
3046
|
+
registered: {},
|
|
3047
|
+
insert: _insert
|
|
3048
|
+
};
|
|
3049
|
+
cache.sheet.hydrate(nodesToHydrate);
|
|
3050
|
+
return cache;
|
|
3051
|
+
};
|
|
3052
|
+
emotion_cache_browser_esm_default = createCache;
|
|
3053
|
+
}
|
|
3054
|
+
});
|
|
3055
|
+
|
|
3056
|
+
// ../../node_modules/@emotion/css/node_modules/@emotion/hash/dist/emotion-hash.esm.js
|
|
3057
|
+
function murmur2(str) {
|
|
3058
|
+
var h = 0;
|
|
3059
|
+
var k, i = 0, len = str.length;
|
|
3060
|
+
for (; len >= 4; ++i, len -= 4) {
|
|
3061
|
+
k = str.charCodeAt(i) & 255 | (str.charCodeAt(++i) & 255) << 8 | (str.charCodeAt(++i) & 255) << 16 | (str.charCodeAt(++i) & 255) << 24;
|
|
3062
|
+
k = /* Math.imul(k, m): */
|
|
3063
|
+
(k & 65535) * 1540483477 + ((k >>> 16) * 59797 << 16);
|
|
3064
|
+
k ^= /* k >>> r: */
|
|
3065
|
+
k >>> 24;
|
|
3066
|
+
h = /* Math.imul(k, m): */
|
|
3067
|
+
(k & 65535) * 1540483477 + ((k >>> 16) * 59797 << 16) ^ /* Math.imul(h, m): */
|
|
3068
|
+
(h & 65535) * 1540483477 + ((h >>> 16) * 59797 << 16);
|
|
3069
|
+
}
|
|
3070
|
+
switch (len) {
|
|
3071
|
+
case 3:
|
|
3072
|
+
h ^= (str.charCodeAt(i + 2) & 255) << 16;
|
|
3073
|
+
case 2:
|
|
3074
|
+
h ^= (str.charCodeAt(i + 1) & 255) << 8;
|
|
3075
|
+
case 1:
|
|
3076
|
+
h ^= str.charCodeAt(i) & 255;
|
|
3077
|
+
h = /* Math.imul(h, m): */
|
|
3078
|
+
(h & 65535) * 1540483477 + ((h >>> 16) * 59797 << 16);
|
|
3079
|
+
}
|
|
3080
|
+
h ^= h >>> 13;
|
|
3081
|
+
h = /* Math.imul(h, m): */
|
|
3082
|
+
(h & 65535) * 1540483477 + ((h >>> 16) * 59797 << 16);
|
|
3083
|
+
return ((h ^ h >>> 15) >>> 0).toString(36);
|
|
3084
|
+
}
|
|
3085
|
+
var emotion_hash_esm_default;
|
|
3086
|
+
var init_emotion_hash_esm = __esm({
|
|
3087
|
+
"../../node_modules/@emotion/css/node_modules/@emotion/hash/dist/emotion-hash.esm.js"() {
|
|
3088
|
+
emotion_hash_esm_default = murmur2;
|
|
3089
|
+
}
|
|
3090
|
+
});
|
|
3091
|
+
|
|
3092
|
+
// ../../node_modules/@emotion/css/node_modules/@emotion/unitless/dist/emotion-unitless.esm.js
|
|
3093
|
+
var unitlessKeys, emotion_unitless_esm_default;
|
|
3094
|
+
var init_emotion_unitless_esm = __esm({
|
|
3095
|
+
"../../node_modules/@emotion/css/node_modules/@emotion/unitless/dist/emotion-unitless.esm.js"() {
|
|
3096
|
+
unitlessKeys = {
|
|
3097
|
+
animationIterationCount: 1,
|
|
3098
|
+
borderImageOutset: 1,
|
|
3099
|
+
borderImageSlice: 1,
|
|
3100
|
+
borderImageWidth: 1,
|
|
3101
|
+
boxFlex: 1,
|
|
3102
|
+
boxFlexGroup: 1,
|
|
3103
|
+
boxOrdinalGroup: 1,
|
|
3104
|
+
columnCount: 1,
|
|
3105
|
+
columns: 1,
|
|
3106
|
+
flex: 1,
|
|
3107
|
+
flexGrow: 1,
|
|
3108
|
+
flexPositive: 1,
|
|
3109
|
+
flexShrink: 1,
|
|
3110
|
+
flexNegative: 1,
|
|
3111
|
+
flexOrder: 1,
|
|
3112
|
+
gridRow: 1,
|
|
3113
|
+
gridRowEnd: 1,
|
|
3114
|
+
gridRowSpan: 1,
|
|
3115
|
+
gridRowStart: 1,
|
|
3116
|
+
gridColumn: 1,
|
|
3117
|
+
gridColumnEnd: 1,
|
|
3118
|
+
gridColumnSpan: 1,
|
|
3119
|
+
gridColumnStart: 1,
|
|
3120
|
+
msGridRow: 1,
|
|
3121
|
+
msGridRowSpan: 1,
|
|
3122
|
+
msGridColumn: 1,
|
|
3123
|
+
msGridColumnSpan: 1,
|
|
3124
|
+
fontWeight: 1,
|
|
3125
|
+
lineHeight: 1,
|
|
3126
|
+
opacity: 1,
|
|
3127
|
+
order: 1,
|
|
3128
|
+
orphans: 1,
|
|
3129
|
+
tabSize: 1,
|
|
3130
|
+
widows: 1,
|
|
3131
|
+
zIndex: 1,
|
|
3132
|
+
zoom: 1,
|
|
3133
|
+
WebkitLineClamp: 1,
|
|
3134
|
+
// SVG-related properties
|
|
3135
|
+
fillOpacity: 1,
|
|
3136
|
+
floodOpacity: 1,
|
|
3137
|
+
stopOpacity: 1,
|
|
3138
|
+
strokeDasharray: 1,
|
|
3139
|
+
strokeDashoffset: 1,
|
|
3140
|
+
strokeMiterlimit: 1,
|
|
3141
|
+
strokeOpacity: 1,
|
|
3142
|
+
strokeWidth: 1
|
|
3143
|
+
};
|
|
3144
|
+
emotion_unitless_esm_default = unitlessKeys;
|
|
3145
|
+
}
|
|
3146
|
+
});
|
|
3147
|
+
|
|
3148
|
+
// ../../node_modules/@emotion/css/node_modules/@emotion/serialize/dist/emotion-serialize.browser.esm.js
|
|
3149
|
+
function handleInterpolation(mergedProps, registered, interpolation) {
|
|
3150
|
+
if (interpolation == null) {
|
|
3151
|
+
return "";
|
|
3152
|
+
}
|
|
3153
|
+
if (interpolation.__emotion_styles !== void 0) {
|
|
3154
|
+
if (interpolation.toString() === "NO_COMPONENT_SELECTOR") {
|
|
3155
|
+
throw new Error(noComponentSelectorMessage);
|
|
3156
|
+
}
|
|
3157
|
+
return interpolation;
|
|
3158
|
+
}
|
|
3159
|
+
switch (typeof interpolation) {
|
|
3160
|
+
case "boolean": {
|
|
3161
|
+
return "";
|
|
3162
|
+
}
|
|
3163
|
+
case "object": {
|
|
3164
|
+
if (interpolation.anim === 1) {
|
|
3165
|
+
cursor = {
|
|
3166
|
+
name: interpolation.name,
|
|
3167
|
+
styles: interpolation.styles,
|
|
3168
|
+
next: cursor
|
|
3169
|
+
};
|
|
3170
|
+
return interpolation.name;
|
|
3171
|
+
}
|
|
3172
|
+
if (interpolation.styles !== void 0) {
|
|
3173
|
+
var next2 = interpolation.next;
|
|
3174
|
+
if (next2 !== void 0) {
|
|
3175
|
+
while (next2 !== void 0) {
|
|
3176
|
+
cursor = {
|
|
3177
|
+
name: next2.name,
|
|
3178
|
+
styles: next2.styles,
|
|
3179
|
+
next: cursor
|
|
3180
|
+
};
|
|
3181
|
+
next2 = next2.next;
|
|
3182
|
+
}
|
|
3183
|
+
}
|
|
3184
|
+
var styles = interpolation.styles + ";";
|
|
3185
|
+
if (interpolation.map !== void 0) {
|
|
3186
|
+
styles += interpolation.map;
|
|
3187
|
+
}
|
|
3188
|
+
return styles;
|
|
3189
|
+
}
|
|
3190
|
+
return createStringFromObject(mergedProps, registered, interpolation);
|
|
3191
|
+
}
|
|
3192
|
+
case "function": {
|
|
3193
|
+
if (mergedProps !== void 0) {
|
|
3194
|
+
var previousCursor = cursor;
|
|
3195
|
+
var result = interpolation(mergedProps);
|
|
3196
|
+
cursor = previousCursor;
|
|
3197
|
+
return handleInterpolation(mergedProps, registered, result);
|
|
3198
|
+
} else if (true) {
|
|
3199
|
+
console.error("Functions that are interpolated in css calls will be stringified.\nIf you want to have a css call based on props, create a function that returns a css call like this\nlet dynamicStyle = (props) => css`color: ${props.color}`\nIt can be called directly with props or interpolated in a styled call like this\nlet SomeComponent = styled('div')`${dynamicStyle}`");
|
|
3200
|
+
}
|
|
3201
|
+
break;
|
|
3202
|
+
}
|
|
3203
|
+
case "string":
|
|
3204
|
+
if (true) {
|
|
3205
|
+
var matched = [];
|
|
3206
|
+
var replaced = interpolation.replace(animationRegex, function(match2, p1, p2) {
|
|
3207
|
+
var fakeVarName = "animation" + matched.length;
|
|
3208
|
+
matched.push("const " + fakeVarName + " = keyframes`" + p2.replace(/^@keyframes animation-\w+/, "") + "`");
|
|
3209
|
+
return "${" + fakeVarName + "}";
|
|
3210
|
+
});
|
|
3211
|
+
if (matched.length) {
|
|
3212
|
+
console.error("`keyframes` output got interpolated into plain string, please wrap it with `css`.\n\nInstead of doing this:\n\n" + [].concat(matched, ["`" + replaced + "`"]).join("\n") + "\n\nYou should wrap it with `css` like this:\n\n" + ("css`" + replaced + "`"));
|
|
3213
|
+
}
|
|
3214
|
+
}
|
|
3215
|
+
break;
|
|
3216
|
+
}
|
|
3217
|
+
if (registered == null) {
|
|
3218
|
+
return interpolation;
|
|
3219
|
+
}
|
|
3220
|
+
var cached = registered[interpolation];
|
|
3221
|
+
return cached !== void 0 ? cached : interpolation;
|
|
3222
|
+
}
|
|
3223
|
+
function createStringFromObject(mergedProps, registered, obj2) {
|
|
3224
|
+
var string = "";
|
|
3225
|
+
if (Array.isArray(obj2)) {
|
|
3226
|
+
for (var i = 0; i < obj2.length; i++) {
|
|
3227
|
+
string += handleInterpolation(mergedProps, registered, obj2[i]) + ";";
|
|
3228
|
+
}
|
|
3229
|
+
} else {
|
|
3230
|
+
for (var _key in obj2) {
|
|
3231
|
+
var value = obj2[_key];
|
|
3232
|
+
if (typeof value !== "object") {
|
|
3233
|
+
if (registered != null && registered[value] !== void 0) {
|
|
3234
|
+
string += _key + "{" + registered[value] + "}";
|
|
3235
|
+
} else if (isProcessableValue(value)) {
|
|
3236
|
+
string += processStyleName(_key) + ":" + processStyleValue(_key, value) + ";";
|
|
3237
|
+
}
|
|
3238
|
+
} else {
|
|
3239
|
+
if (_key === "NO_COMPONENT_SELECTOR" && true) {
|
|
3240
|
+
throw new Error(noComponentSelectorMessage);
|
|
3241
|
+
}
|
|
3242
|
+
if (Array.isArray(value) && typeof value[0] === "string" && (registered == null || registered[value[0]] === void 0)) {
|
|
3243
|
+
for (var _i = 0; _i < value.length; _i++) {
|
|
3244
|
+
if (isProcessableValue(value[_i])) {
|
|
3245
|
+
string += processStyleName(_key) + ":" + processStyleValue(_key, value[_i]) + ";";
|
|
3246
|
+
}
|
|
3247
|
+
}
|
|
3248
|
+
} else {
|
|
3249
|
+
var interpolated = handleInterpolation(mergedProps, registered, value);
|
|
3250
|
+
switch (_key) {
|
|
3251
|
+
case "animation":
|
|
3252
|
+
case "animationName": {
|
|
3253
|
+
string += processStyleName(_key) + ":" + interpolated + ";";
|
|
3254
|
+
break;
|
|
3255
|
+
}
|
|
3256
|
+
default: {
|
|
3257
|
+
if (_key === "undefined") {
|
|
3258
|
+
console.error(UNDEFINED_AS_OBJECT_KEY_ERROR);
|
|
3259
|
+
}
|
|
3260
|
+
string += _key + "{" + interpolated + "}";
|
|
3261
|
+
}
|
|
3262
|
+
}
|
|
3263
|
+
}
|
|
3264
|
+
}
|
|
3265
|
+
}
|
|
3266
|
+
}
|
|
3267
|
+
return string;
|
|
3268
|
+
}
|
|
3269
|
+
var ILLEGAL_ESCAPE_SEQUENCE_ERROR, UNDEFINED_AS_OBJECT_KEY_ERROR, hyphenateRegex, animationRegex, isCustomProperty, isProcessableValue, processStyleName, processStyleValue, contentValuePattern, contentValues, oldProcessStyleValue, msPattern, hyphenPattern, hyphenatedCache, noComponentSelectorMessage, labelPattern, sourceMapPattern, cursor, serializeStyles;
|
|
3270
|
+
var init_emotion_serialize_browser_esm = __esm({
|
|
3271
|
+
"../../node_modules/@emotion/css/node_modules/@emotion/serialize/dist/emotion-serialize.browser.esm.js"() {
|
|
3272
|
+
init_emotion_hash_esm();
|
|
3273
|
+
init_emotion_unitless_esm();
|
|
3274
|
+
init_emotion_memoize_esm();
|
|
3275
|
+
ILLEGAL_ESCAPE_SEQUENCE_ERROR = `You have illegal escape sequence in your template literal, most likely inside content's property value.
|
|
3276
|
+
Because you write your CSS inside a JavaScript string you actually have to do double escaping, so for example "content: '\\00d7';" should become "content: '\\\\00d7';".
|
|
3277
|
+
You can read more about this here:
|
|
3278
|
+
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences`;
|
|
3279
|
+
UNDEFINED_AS_OBJECT_KEY_ERROR = "You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key).";
|
|
3280
|
+
hyphenateRegex = /[A-Z]|^ms/g;
|
|
3281
|
+
animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;
|
|
3282
|
+
isCustomProperty = function isCustomProperty2(property) {
|
|
3283
|
+
return property.charCodeAt(1) === 45;
|
|
3284
|
+
};
|
|
3285
|
+
isProcessableValue = function isProcessableValue2(value) {
|
|
3286
|
+
return value != null && typeof value !== "boolean";
|
|
3287
|
+
};
|
|
3288
|
+
processStyleName = /* @__PURE__ */ emotion_memoize_esm_default(function(styleName) {
|
|
3289
|
+
return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, "-$&").toLowerCase();
|
|
3290
|
+
});
|
|
3291
|
+
processStyleValue = function processStyleValue2(key, value) {
|
|
3292
|
+
switch (key) {
|
|
3293
|
+
case "animation":
|
|
3294
|
+
case "animationName": {
|
|
3295
|
+
if (typeof value === "string") {
|
|
3296
|
+
return value.replace(animationRegex, function(match2, p1, p2) {
|
|
3297
|
+
cursor = {
|
|
3298
|
+
name: p1,
|
|
3299
|
+
styles: p2,
|
|
3300
|
+
next: cursor
|
|
3301
|
+
};
|
|
3302
|
+
return p1;
|
|
3303
|
+
});
|
|
3304
|
+
}
|
|
3305
|
+
}
|
|
3306
|
+
}
|
|
3307
|
+
if (emotion_unitless_esm_default[key] !== 1 && !isCustomProperty(key) && typeof value === "number" && value !== 0) {
|
|
3308
|
+
return value + "px";
|
|
3309
|
+
}
|
|
3310
|
+
return value;
|
|
3311
|
+
};
|
|
3312
|
+
if (true) {
|
|
3313
|
+
contentValuePattern = /(var|attr|counters?|url|element|(((repeating-)?(linear|radial))|conic)-gradient)\(|(no-)?(open|close)-quote/;
|
|
3314
|
+
contentValues = ["normal", "none", "initial", "inherit", "unset"];
|
|
3315
|
+
oldProcessStyleValue = processStyleValue;
|
|
3316
|
+
msPattern = /^-ms-/;
|
|
3317
|
+
hyphenPattern = /-(.)/g;
|
|
3318
|
+
hyphenatedCache = {};
|
|
3319
|
+
processStyleValue = function processStyleValue3(key, value) {
|
|
3320
|
+
if (key === "content") {
|
|
3321
|
+
if (typeof value !== "string" || contentValues.indexOf(value) === -1 && !contentValuePattern.test(value) && (value.charAt(0) !== value.charAt(value.length - 1) || value.charAt(0) !== '"' && value.charAt(0) !== "'")) {
|
|
3322
|
+
throw new Error("You seem to be using a value for 'content' without quotes, try replacing it with `content: '\"" + value + "\"'`");
|
|
3323
|
+
}
|
|
3324
|
+
}
|
|
3325
|
+
var processed = oldProcessStyleValue(key, value);
|
|
3326
|
+
if (processed !== "" && !isCustomProperty(key) && key.indexOf("-") !== -1 && hyphenatedCache[key] === void 0) {
|
|
3327
|
+
hyphenatedCache[key] = true;
|
|
3328
|
+
console.error("Using kebab-case for css properties in objects is not supported. Did you mean " + key.replace(msPattern, "ms-").replace(hyphenPattern, function(str, _char) {
|
|
3329
|
+
return _char.toUpperCase();
|
|
3330
|
+
}) + "?");
|
|
3331
|
+
}
|
|
3332
|
+
return processed;
|
|
3333
|
+
};
|
|
3334
|
+
}
|
|
3335
|
+
noComponentSelectorMessage = "Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";
|
|
3336
|
+
labelPattern = /label:\s*([^\s;\n{]+)\s*(;|$)/g;
|
|
3337
|
+
if (true) {
|
|
3338
|
+
sourceMapPattern = /\/\*#\ssourceMappingURL=data:application\/json;\S+\s+\*\//g;
|
|
3339
|
+
}
|
|
3340
|
+
serializeStyles = function serializeStyles2(args, registered, mergedProps) {
|
|
3341
|
+
if (args.length === 1 && typeof args[0] === "object" && args[0] !== null && args[0].styles !== void 0) {
|
|
3342
|
+
return args[0];
|
|
3343
|
+
}
|
|
3344
|
+
var stringMode = true;
|
|
3345
|
+
var styles = "";
|
|
3346
|
+
cursor = void 0;
|
|
3347
|
+
var strings = args[0];
|
|
3348
|
+
if (strings == null || strings.raw === void 0) {
|
|
3349
|
+
stringMode = false;
|
|
3350
|
+
styles += handleInterpolation(mergedProps, registered, strings);
|
|
3351
|
+
} else {
|
|
3352
|
+
if (strings[0] === void 0) {
|
|
3353
|
+
console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);
|
|
3354
|
+
}
|
|
3355
|
+
styles += strings[0];
|
|
3356
|
+
}
|
|
3357
|
+
for (var i = 1; i < args.length; i++) {
|
|
3358
|
+
styles += handleInterpolation(mergedProps, registered, args[i]);
|
|
3359
|
+
if (stringMode) {
|
|
3360
|
+
if (strings[i] === void 0) {
|
|
3361
|
+
console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);
|
|
3362
|
+
}
|
|
3363
|
+
styles += strings[i];
|
|
3364
|
+
}
|
|
3365
|
+
}
|
|
3366
|
+
var sourceMap;
|
|
3367
|
+
if (true) {
|
|
3368
|
+
styles = styles.replace(sourceMapPattern, function(match3) {
|
|
3369
|
+
sourceMap = match3;
|
|
3370
|
+
return "";
|
|
3371
|
+
});
|
|
3372
|
+
}
|
|
3373
|
+
labelPattern.lastIndex = 0;
|
|
3374
|
+
var identifierName = "";
|
|
3375
|
+
var match2;
|
|
3376
|
+
while ((match2 = labelPattern.exec(styles)) !== null) {
|
|
3377
|
+
identifierName += "-" + // $FlowFixMe we know it's not null
|
|
3378
|
+
match2[1];
|
|
3379
|
+
}
|
|
3380
|
+
var name = emotion_hash_esm_default(styles) + identifierName;
|
|
3381
|
+
if (true) {
|
|
3382
|
+
return {
|
|
3383
|
+
name,
|
|
3384
|
+
styles,
|
|
3385
|
+
map: sourceMap,
|
|
3386
|
+
next: cursor,
|
|
3387
|
+
toString: function toString() {
|
|
3388
|
+
return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
|
|
3389
|
+
}
|
|
3390
|
+
};
|
|
3391
|
+
}
|
|
3392
|
+
return {
|
|
3393
|
+
name,
|
|
3394
|
+
styles,
|
|
3395
|
+
next: cursor
|
|
3396
|
+
};
|
|
3397
|
+
};
|
|
3398
|
+
}
|
|
3399
|
+
});
|
|
3400
|
+
|
|
3401
|
+
// ../../node_modules/@emotion/css/node_modules/@emotion/utils/dist/emotion-utils.browser.esm.js
|
|
3402
|
+
function getRegisteredStyles(registered, registeredStyles, classNames) {
|
|
3403
|
+
var rawClassName = "";
|
|
3404
|
+
classNames.split(" ").forEach(function(className) {
|
|
3405
|
+
if (registered[className] !== void 0) {
|
|
3406
|
+
registeredStyles.push(registered[className] + ";");
|
|
3407
|
+
} else {
|
|
3408
|
+
rawClassName += className + " ";
|
|
3409
|
+
}
|
|
3410
|
+
});
|
|
3411
|
+
return rawClassName;
|
|
3412
|
+
}
|
|
3413
|
+
var isBrowser, registerStyles, insertStyles;
|
|
3414
|
+
var init_emotion_utils_browser_esm = __esm({
|
|
3415
|
+
"../../node_modules/@emotion/css/node_modules/@emotion/utils/dist/emotion-utils.browser.esm.js"() {
|
|
3416
|
+
isBrowser = true;
|
|
3417
|
+
registerStyles = function registerStyles2(cache, serialized, isStringTag) {
|
|
3418
|
+
var className = cache.key + "-" + serialized.name;
|
|
3419
|
+
if (
|
|
3420
|
+
// we only need to add the styles to the registered cache if the
|
|
3421
|
+
// class name could be used further down
|
|
3422
|
+
// the tree but if it's a string tag, we know it won't
|
|
3423
|
+
// so we don't have to add it to registered cache.
|
|
3424
|
+
// this improves memory usage since we can avoid storing the whole style string
|
|
3425
|
+
(isStringTag === false || // we need to always store it if we're in compat mode and
|
|
3426
|
+
// in node since emotion-server relies on whether a style is in
|
|
3427
|
+
// the registered cache to know whether a style is global or not
|
|
3428
|
+
// also, note that this check will be dead code eliminated in the browser
|
|
3429
|
+
isBrowser === false) && cache.registered[className] === void 0
|
|
3430
|
+
) {
|
|
3431
|
+
cache.registered[className] = serialized.styles;
|
|
3432
|
+
}
|
|
3433
|
+
};
|
|
3434
|
+
insertStyles = function insertStyles2(cache, serialized, isStringTag) {
|
|
3435
|
+
registerStyles(cache, serialized, isStringTag);
|
|
3436
|
+
var className = cache.key + "-" + serialized.name;
|
|
3437
|
+
if (cache.inserted[serialized.name] === void 0) {
|
|
3438
|
+
var current = serialized;
|
|
3439
|
+
do {
|
|
3440
|
+
var maybeStyles = cache.insert(serialized === current ? "." + className : "", current, cache.sheet, true);
|
|
3441
|
+
current = current.next;
|
|
3442
|
+
} while (current !== void 0);
|
|
3443
|
+
}
|
|
3444
|
+
};
|
|
3445
|
+
}
|
|
3446
|
+
});
|
|
3447
|
+
|
|
3448
|
+
// ../../node_modules/@emotion/css/create-instance/dist/emotion-css-create-instance.esm.js
|
|
3449
|
+
function insertWithoutScoping(cache, serialized) {
|
|
3450
|
+
if (cache.inserted[serialized.name] === void 0) {
|
|
3451
|
+
return cache.insert("", serialized, cache.sheet, true);
|
|
3452
|
+
}
|
|
3453
|
+
}
|
|
3454
|
+
function merge4(registered, css2, className) {
|
|
3455
|
+
var registeredStyles = [];
|
|
3456
|
+
var rawClassName = getRegisteredStyles(registered, registeredStyles, className);
|
|
3457
|
+
if (registeredStyles.length < 2) {
|
|
3458
|
+
return className;
|
|
3459
|
+
}
|
|
3460
|
+
return rawClassName + css2(registeredStyles);
|
|
3461
|
+
}
|
|
3462
|
+
var createEmotion, classnames, emotion_css_create_instance_esm_default;
|
|
3463
|
+
var init_emotion_css_create_instance_esm = __esm({
|
|
3464
|
+
"../../node_modules/@emotion/css/create-instance/dist/emotion-css-create-instance.esm.js"() {
|
|
3465
|
+
init_emotion_cache_browser_esm();
|
|
3466
|
+
init_emotion_serialize_browser_esm();
|
|
3467
|
+
init_emotion_utils_browser_esm();
|
|
3468
|
+
createEmotion = function createEmotion2(options) {
|
|
3469
|
+
var cache = emotion_cache_browser_esm_default(options);
|
|
3470
|
+
cache.sheet.speedy = function(value) {
|
|
3471
|
+
if (this.ctr !== 0) {
|
|
3472
|
+
throw new Error("speedy must be changed before any rules are inserted");
|
|
3473
|
+
}
|
|
3474
|
+
this.isSpeedy = value;
|
|
3475
|
+
};
|
|
3476
|
+
cache.compat = true;
|
|
3477
|
+
var css2 = function css3() {
|
|
3478
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
3479
|
+
args[_key] = arguments[_key];
|
|
3480
|
+
}
|
|
3481
|
+
var serialized = serializeStyles(args, cache.registered, void 0);
|
|
3482
|
+
insertStyles(cache, serialized, false);
|
|
3483
|
+
return cache.key + "-" + serialized.name;
|
|
3484
|
+
};
|
|
3485
|
+
var keyframes2 = function keyframes3() {
|
|
3486
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
3487
|
+
args[_key2] = arguments[_key2];
|
|
3488
|
+
}
|
|
3489
|
+
var serialized = serializeStyles(args, cache.registered);
|
|
3490
|
+
var animation = "animation-" + serialized.name;
|
|
3491
|
+
insertWithoutScoping(cache, {
|
|
3492
|
+
name: serialized.name,
|
|
3493
|
+
styles: "@keyframes " + animation + "{" + serialized.styles + "}"
|
|
3494
|
+
});
|
|
3495
|
+
return animation;
|
|
3496
|
+
};
|
|
3497
|
+
var injectGlobal = function injectGlobal2() {
|
|
3498
|
+
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
3499
|
+
args[_key3] = arguments[_key3];
|
|
3500
|
+
}
|
|
3501
|
+
var serialized = serializeStyles(args, cache.registered);
|
|
3502
|
+
insertWithoutScoping(cache, serialized);
|
|
3503
|
+
};
|
|
3504
|
+
var cx = function cx2() {
|
|
3505
|
+
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
|
3506
|
+
args[_key4] = arguments[_key4];
|
|
3507
|
+
}
|
|
3508
|
+
return merge4(cache.registered, css2, classnames(args));
|
|
3509
|
+
};
|
|
3510
|
+
return {
|
|
3511
|
+
css: css2,
|
|
3512
|
+
cx,
|
|
3513
|
+
injectGlobal,
|
|
3514
|
+
keyframes: keyframes2,
|
|
3515
|
+
hydrate: function hydrate(ids) {
|
|
3516
|
+
ids.forEach(function(key) {
|
|
3517
|
+
cache.inserted[key] = true;
|
|
3518
|
+
});
|
|
3519
|
+
},
|
|
3520
|
+
flush: function flush() {
|
|
3521
|
+
cache.registered = {};
|
|
3522
|
+
cache.inserted = {};
|
|
3523
|
+
cache.sheet.flush();
|
|
3524
|
+
},
|
|
3525
|
+
// $FlowFixMe
|
|
3526
|
+
sheet: cache.sheet,
|
|
3527
|
+
cache,
|
|
3528
|
+
getRegisteredStyles: getRegisteredStyles.bind(null, cache.registered),
|
|
3529
|
+
merge: merge4.bind(null, cache.registered, css2)
|
|
3530
|
+
};
|
|
3531
|
+
};
|
|
3532
|
+
classnames = function classnames2(args) {
|
|
3533
|
+
var cls = "";
|
|
3534
|
+
for (var i = 0; i < args.length; i++) {
|
|
3535
|
+
var arg = args[i];
|
|
3536
|
+
if (arg == null)
|
|
3537
|
+
continue;
|
|
3538
|
+
var toAdd = void 0;
|
|
3539
|
+
switch (typeof arg) {
|
|
3540
|
+
case "boolean":
|
|
3541
|
+
break;
|
|
3542
|
+
case "object": {
|
|
3543
|
+
if (Array.isArray(arg)) {
|
|
3544
|
+
toAdd = classnames2(arg);
|
|
3545
|
+
} else {
|
|
3546
|
+
toAdd = "";
|
|
3547
|
+
for (var k in arg) {
|
|
3548
|
+
if (arg[k] && k) {
|
|
3549
|
+
toAdd && (toAdd += " ");
|
|
3550
|
+
toAdd += k;
|
|
3551
|
+
}
|
|
3552
|
+
}
|
|
3553
|
+
}
|
|
3554
|
+
break;
|
|
3555
|
+
}
|
|
3556
|
+
default: {
|
|
3557
|
+
toAdd = arg;
|
|
3558
|
+
}
|
|
3559
|
+
}
|
|
3560
|
+
if (toAdd) {
|
|
3561
|
+
cls && (cls += " ");
|
|
3562
|
+
cls += toAdd;
|
|
3563
|
+
}
|
|
3564
|
+
}
|
|
3565
|
+
return cls;
|
|
3566
|
+
};
|
|
3567
|
+
emotion_css_create_instance_esm_default = createEmotion;
|
|
3568
|
+
}
|
|
3569
|
+
});
|
|
3570
|
+
|
|
3571
|
+
// src/index.js
|
|
3572
|
+
var src_exports2 = {};
|
|
3573
|
+
__export2(src_exports2, {
|
|
3574
|
+
registry: () => registry,
|
|
3575
|
+
setClassname: () => setClassname,
|
|
3576
|
+
transformClassname: () => transformClassname
|
|
3577
|
+
});
|
|
3578
|
+
module.exports = __toCommonJS2(src_exports2);
|
|
3579
|
+
|
|
3580
|
+
// src/transform.js
|
|
3581
|
+
init_utils();
|
|
3582
|
+
|
|
3583
|
+
// ../../uikit/Atoms/Block.js
|
|
3584
|
+
var import_scratch = __toESM(require_index_cjs());
|
|
3585
|
+
var transfromGap = (gap) => (0, import_scratch.isString)(gap) && {
|
|
3586
|
+
gap: gap.split(" ").map((v) => (0, import_scratch.getSpacingByKey)(v, "gap").gap).join(" ")
|
|
3587
|
+
};
|
|
3588
|
+
var Block = {
|
|
3589
|
+
class: {
|
|
3590
|
+
boxSizing: ({ props }) => props.boxSizing ? { boxSizing: props.boxSizing } : {
|
|
3591
|
+
boxSizing: "border-box"
|
|
3592
|
+
},
|
|
3593
|
+
display: ({ props }) => props.display && { display: props.display },
|
|
3594
|
+
hide: ({ props }) => props.hide && { display: "none" },
|
|
3595
|
+
width: ({ props }) => props.width && (0, import_scratch.getSpacingBasedOnRatio)(props, "width"),
|
|
3596
|
+
height: ({ props }) => props.height && (0, import_scratch.getSpacingBasedOnRatio)(props, "height"),
|
|
3597
|
+
boxSize: ({ props }) => {
|
|
3598
|
+
if (typeof props.boxSize !== "string")
|
|
3599
|
+
return;
|
|
3600
|
+
const [height, width] = props.boxSize.split(" ");
|
|
3601
|
+
return {
|
|
3602
|
+
...(0, import_scratch.getSpacingByKey)(height, "height"),
|
|
3603
|
+
...(0, import_scratch.getSpacingByKey)(width || height, "width")
|
|
3604
|
+
};
|
|
3605
|
+
},
|
|
3606
|
+
maxWidth: ({ props }) => props.maxWidth && (0, import_scratch.getSpacingBasedOnRatio)(props, "maxWidth"),
|
|
3607
|
+
minWidth: ({ props }) => props.minWidth && (0, import_scratch.getSpacingBasedOnRatio)(props, "minWidth"),
|
|
3608
|
+
widthRange: ({ props }) => {
|
|
3609
|
+
if (typeof props.widthRange !== "string")
|
|
3610
|
+
return;
|
|
3611
|
+
const [minWidth, maxWidth] = props.widthRange.split(" ");
|
|
3612
|
+
return {
|
|
3613
|
+
...(0, import_scratch.getSpacingByKey)(minWidth, "minWidth"),
|
|
3614
|
+
...(0, import_scratch.getSpacingByKey)(maxWidth || minWidth, "maxWidth")
|
|
3615
|
+
};
|
|
3616
|
+
},
|
|
3617
|
+
maxHeight: ({ props }) => props.maxHeight && (0, import_scratch.getSpacingBasedOnRatio)(props, "maxHeight"),
|
|
3618
|
+
minHeight: ({ props }) => props.minHeight && (0, import_scratch.getSpacingBasedOnRatio)(props, "minHeight"),
|
|
3619
|
+
heightRange: ({ props }) => {
|
|
3620
|
+
if (typeof props.heightRange !== "string")
|
|
3621
|
+
return;
|
|
3622
|
+
const [minHeight, maxHeight] = props.heightRange.split(" ");
|
|
3623
|
+
return {
|
|
3624
|
+
...(0, import_scratch.getSpacingByKey)(minHeight, "minHeight"),
|
|
3625
|
+
...(0, import_scratch.getSpacingByKey)(maxHeight || minHeight, "maxHeight")
|
|
3626
|
+
};
|
|
3627
|
+
},
|
|
3628
|
+
direction: ({ props }) => props.direction && { direction: props.direction },
|
|
3629
|
+
aspectRatio: ({ props }) => props.aspectRatio && { aspectRatio: props.aspectRatio },
|
|
3630
|
+
borderWidth: ({ props }) => props.borderWidth ? (0, import_scratch.getSpacingBasedOnRatio)(props, "borderWidth") : null,
|
|
3631
|
+
padding: ({ props }) => props.padding ? (0, import_scratch.getSpacingBasedOnRatio)(props, "padding") : null,
|
|
3632
|
+
paddingInline: ({ props }) => {
|
|
3633
|
+
if (typeof props.paddingInline !== "string")
|
|
3634
|
+
return;
|
|
3635
|
+
const [paddingInlineStart, paddingInlineEnd] = props.paddingInline.split(" ");
|
|
3636
|
+
return {
|
|
3637
|
+
...(0, import_scratch.getSpacingByKey)(paddingInlineStart, "paddingInlineStart"),
|
|
3638
|
+
...(0, import_scratch.getSpacingByKey)(paddingInlineEnd || paddingInlineStart, "paddingInlineEnd")
|
|
3639
|
+
};
|
|
3640
|
+
},
|
|
3641
|
+
paddingBlock: ({ props }) => {
|
|
3642
|
+
if (typeof props.paddingBlock !== "string")
|
|
3643
|
+
return;
|
|
3644
|
+
const [paddingBlockStart, paddingBlockEnd] = props.paddingBlock.split(" ");
|
|
3645
|
+
return {
|
|
3646
|
+
...(0, import_scratch.getSpacingByKey)(paddingBlockStart, "paddingBlockStart"),
|
|
3647
|
+
...(0, import_scratch.getSpacingByKey)(paddingBlockEnd || paddingBlockStart, "paddingBlockEnd")
|
|
3648
|
+
};
|
|
3649
|
+
},
|
|
3650
|
+
paddingInlineStart: ({ props }) => props.paddingInlineStart ? (0, import_scratch.getSpacingBasedOnRatio)(props, "paddingInlineStart") : null,
|
|
3651
|
+
paddingInlineEnd: ({ props }) => props.paddingInlineEnd ? (0, import_scratch.getSpacingBasedOnRatio)(props, "paddingInlineEnd") : null,
|
|
3652
|
+
paddingBlockStart: ({ props }) => props.paddingBlockStart ? (0, import_scratch.getSpacingBasedOnRatio)(props, "paddingBlockStart") : null,
|
|
3653
|
+
paddingBlockEnd: ({ props }) => props.paddingBlockEnd ? (0, import_scratch.getSpacingBasedOnRatio)(props, "paddingBlockEnd") : null,
|
|
3654
|
+
margin: ({ props }) => props.margin ? (0, import_scratch.getSpacingBasedOnRatio)(props, "margin") : null,
|
|
3655
|
+
marginInline: ({ props }) => {
|
|
3656
|
+
if (typeof props.marginInline !== "string")
|
|
3657
|
+
return;
|
|
3658
|
+
const [marginInlineStart, marginInlineEnd] = props.marginInline.split(" ");
|
|
3659
|
+
return {
|
|
3660
|
+
...(0, import_scratch.getSpacingByKey)(marginInlineStart, "marginInlineStart"),
|
|
3661
|
+
...(0, import_scratch.getSpacingByKey)(marginInlineEnd || marginInlineStart, "marginInlineEnd")
|
|
3662
|
+
};
|
|
3663
|
+
},
|
|
3664
|
+
marginBlock: ({ props }) => {
|
|
3665
|
+
if (typeof props.marginBlock !== "string")
|
|
3666
|
+
return;
|
|
3667
|
+
const [marginBlockStart, marginBlockEnd] = props.marginBlock.split(" ");
|
|
3668
|
+
return {
|
|
3669
|
+
...(0, import_scratch.getSpacingByKey)(marginBlockStart, "marginBlockStart"),
|
|
3670
|
+
...(0, import_scratch.getSpacingByKey)(marginBlockEnd || marginBlockStart, "marginBlockEnd")
|
|
3671
|
+
};
|
|
3672
|
+
},
|
|
3673
|
+
marginInlineStart: ({ props }) => props.marginInlineStart ? (0, import_scratch.getSpacingBasedOnRatio)(props, "marginInlineStart") : null,
|
|
3674
|
+
marginInlineEnd: ({ props }) => props.marginInlineEnd ? (0, import_scratch.getSpacingBasedOnRatio)(props, "marginInlineEnd") : null,
|
|
3675
|
+
marginBlockStart: ({ props }) => props.marginBlockStart ? (0, import_scratch.getSpacingBasedOnRatio)(props, "marginBlockStart") : null,
|
|
3676
|
+
marginBlockEnd: ({ props }) => props.marginBlockEnd ? (0, import_scratch.getSpacingBasedOnRatio)(props, "marginBlockEnd") : null,
|
|
3677
|
+
gap: ({ props }) => props.gap ? transfromGap(props.gap) : null,
|
|
3678
|
+
gridArea: ({ props }) => props.gridArea && { gridArea: props.gridArea },
|
|
3679
|
+
flex: ({ props }) => props.flex && { flex: props.flex },
|
|
3680
|
+
flexDirection: ({ props }) => props.flexDirection && { flexDirection: props.flexDirection },
|
|
3681
|
+
alignItems: ({ props }) => props.alignItems && { alignItems: props.alignItems },
|
|
3682
|
+
alignContent: ({ props }) => props.alignContent && { alignContent: props.alignContent },
|
|
3683
|
+
justifyContent: ({ props }) => props.justifyContent && { justifyContent: props.justifyContent },
|
|
3684
|
+
justifyItems: ({ props }) => props.justifyItems && { justifyItems: props.justifyItems },
|
|
3685
|
+
alignSelf: ({ props }) => props.alignSelf && { alignSelf: props.alignSelf },
|
|
3686
|
+
order: ({ props }) => props.order && { order: props.order },
|
|
3687
|
+
flexWrap: ({ props }) => props.flexWrap && {
|
|
3688
|
+
display: "flex",
|
|
3689
|
+
flexFlow: props.flexWrap
|
|
3690
|
+
},
|
|
3691
|
+
flexFlow: ({ props }) => props.flexFlow && {
|
|
3692
|
+
display: "flex",
|
|
3693
|
+
flexFlow: props.flexFlow
|
|
3694
|
+
},
|
|
3695
|
+
flexAlign: ({ props }) => {
|
|
3696
|
+
if (typeof props.flexAlign !== "string")
|
|
3697
|
+
return;
|
|
3698
|
+
const [alignItems, justifyContent] = props.flexAlign.split(" ");
|
|
3699
|
+
return {
|
|
3700
|
+
display: "flex",
|
|
3701
|
+
alignItems,
|
|
3702
|
+
justifyContent
|
|
3703
|
+
};
|
|
3704
|
+
},
|
|
3705
|
+
gridColumn: ({ props }) => props.gridColumn && { gridColumn: props.gridColumn },
|
|
3706
|
+
gridColumnStart: ({ props }) => props.columnStart ? { gridColumnStart: props.columnStart } : null,
|
|
3707
|
+
gridRow: ({ props }) => props.gridRow && { gridRow: props.gridRow },
|
|
3708
|
+
gridRowStart: ({ props }) => props.rowStart ? { gridRowStart: props.rowStart } : null,
|
|
3709
|
+
size: ({ props }) => {
|
|
3710
|
+
if (typeof props.heightRange !== "string")
|
|
3711
|
+
return;
|
|
3712
|
+
const [minHeight, maxHeight] = props.heightRange.split(" ");
|
|
3713
|
+
return {
|
|
3714
|
+
...(0, import_scratch.getSpacingByKey)(minHeight, "minHeight"),
|
|
3715
|
+
...(0, import_scratch.getSpacingByKey)(maxHeight || minHeight, "maxHeight")
|
|
3716
|
+
};
|
|
3717
|
+
},
|
|
3718
|
+
columns: ({ props }) => props.columns && { columns: props.columns }
|
|
3719
|
+
}
|
|
3720
|
+
};
|
|
3721
|
+
|
|
3722
|
+
// ../../uikit/Atoms/Grid.js
|
|
3723
|
+
var import_scratch2 = __toESM(require_index_cjs());
|
|
3724
|
+
|
|
3725
|
+
// ../../uikit/Atoms/Media.js
|
|
3726
|
+
init_utils();
|
|
3727
|
+
|
|
3728
|
+
// ../../uikit/Atoms/Theme.js
|
|
3729
|
+
var import_scratch5 = __toESM(require_index_cjs());
|
|
3730
|
+
|
|
3731
|
+
// ../../uikit/Atoms/Shape/style.js
|
|
3732
|
+
var import_scratch4 = __toESM(require_index_cjs());
|
|
3733
|
+
|
|
3734
|
+
// ../../uikit/Atoms/Timing.js
|
|
3735
|
+
init_utils();
|
|
3736
|
+
var import_scratch3 = __toESM(require_index_cjs());
|
|
3737
|
+
var transformTransition = (transition) => {
|
|
3738
|
+
const arr = transition.split(" ");
|
|
3739
|
+
if (!arr.length)
|
|
3740
|
+
return transition;
|
|
3741
|
+
return arr.map((v) => {
|
|
3742
|
+
if (v.slice(0, 2) === "--")
|
|
3743
|
+
return `var(${v})`;
|
|
3744
|
+
if (v.length < 3 || v.includes("ms")) {
|
|
3745
|
+
const mapWithSequence = (0, import_scratch3.getTimingByKey)(v);
|
|
3746
|
+
return mapWithSequence.timing || v;
|
|
3747
|
+
}
|
|
3748
|
+
if ((0, import_scratch3.getTimingFunction)(v))
|
|
3749
|
+
return (0, import_scratch3.getTimingFunction)(v);
|
|
3750
|
+
return v;
|
|
3751
|
+
}).join(" ");
|
|
3752
|
+
};
|
|
3753
|
+
var transformDuration = (duration, props, propertyName) => {
|
|
3754
|
+
if (!isString3(duration))
|
|
3755
|
+
return;
|
|
3756
|
+
return duration.split(",").map((v) => (0, import_scratch3.getTimingByKey)(v).timing || v).join(",");
|
|
3757
|
+
};
|
|
3758
|
+
var splitTransition = (transition) => {
|
|
3759
|
+
const arr = transition.split(",");
|
|
3760
|
+
if (!arr.length)
|
|
3761
|
+
return;
|
|
3762
|
+
return arr.map(transformTransition).join(",");
|
|
3763
|
+
};
|
|
3764
|
+
var Timing = {
|
|
3765
|
+
class: {
|
|
3766
|
+
transition: ({ props }) => props.transition && {
|
|
3767
|
+
transition: splitTransition(props.transition)
|
|
3768
|
+
},
|
|
3769
|
+
willChange: ({ props }) => props.willChange && {
|
|
3770
|
+
willChange: props.willChange
|
|
3771
|
+
},
|
|
3772
|
+
transitionDuration: ({ props }) => props.transitionDuration && {
|
|
3773
|
+
transitionDuration: transformDuration(props.transitionDuration)
|
|
3774
|
+
},
|
|
3775
|
+
transitionDelay: ({ props }) => props.transitionDelay && {
|
|
3776
|
+
transitionDelay: transformDuration(props.transitionDelay)
|
|
3777
|
+
},
|
|
3778
|
+
transitionTimingFunction: ({ props }) => props.transitionTimingFunction && {
|
|
3779
|
+
transitionTimingFunction: (0, import_scratch3.getTimingFunction)(props.transitionTimingFunction)
|
|
3780
|
+
},
|
|
3781
|
+
transitionProperty: ({ props }) => props.transitionProperty && {
|
|
3782
|
+
transitionProperty: props.transitionProperty,
|
|
3783
|
+
willChange: props.transitionProperty
|
|
3784
|
+
}
|
|
3785
|
+
}
|
|
3786
|
+
};
|
|
3787
|
+
|
|
3788
|
+
// ../../uikit/Atoms/Shape/style.js
|
|
3789
|
+
var depth = {
|
|
3790
|
+
4: { boxShadow: `rgba(0,0,0,.10) 0 2${import_scratch4.UNIT.default} 4${import_scratch4.UNIT.default}` },
|
|
3791
|
+
6: { boxShadow: `rgba(0,0,0,.10) 0 3${import_scratch4.UNIT.default} 6${import_scratch4.UNIT.default}` },
|
|
3792
|
+
10: { boxShadow: `rgba(0,0,0,.10) 0 4${import_scratch4.UNIT.default} 10${import_scratch4.UNIT.default}` },
|
|
3793
|
+
16: { boxShadow: `rgba(0,0,0,.10) 0 8${import_scratch4.UNIT.default} 16${import_scratch4.UNIT.default}` },
|
|
3794
|
+
26: { boxShadow: `rgba(0,0,0,.10) 0 14${import_scratch4.UNIT.default} 26${import_scratch4.UNIT.default}` },
|
|
3795
|
+
42: { boxShadow: `rgba(0,0,0,.10) 0 20${import_scratch4.UNIT.default} 42${import_scratch4.UNIT.default}` }
|
|
3796
|
+
};
|
|
3797
|
+
var getComputedBackgroundColor = ({ props }) => {
|
|
3798
|
+
return (0, import_scratch4.getColor)(props.borderColor) || (0, import_scratch4.getColor)(props.backgroundColor) || (0, import_scratch4.getColor)(props.background);
|
|
3799
|
+
};
|
|
3800
|
+
var inheritTransition = (el) => {
|
|
3801
|
+
const exec3 = Timing.class.transition(el);
|
|
3802
|
+
return exec3 && exec3["transition"];
|
|
3803
|
+
};
|
|
3804
|
+
var SHAPES = {
|
|
3805
|
+
rectangle: {},
|
|
3806
|
+
circle: { borderRadius: "100%" },
|
|
3807
|
+
bubble: {},
|
|
3808
|
+
tv: {
|
|
3809
|
+
borderRadius: "1.15em/2.5em"
|
|
3810
|
+
},
|
|
3811
|
+
tooltip: (el) => ({
|
|
3812
|
+
position: el.props.position || "relative",
|
|
3813
|
+
"&:before": {
|
|
3814
|
+
content: '""',
|
|
3815
|
+
display: "block",
|
|
3816
|
+
width: "0px",
|
|
3817
|
+
height: "0px",
|
|
3818
|
+
border: `.35em solid`,
|
|
3819
|
+
borderColor: getComputedBackgroundColor(el),
|
|
3820
|
+
transition: inheritTransition(el),
|
|
3821
|
+
transitionProperty: "border-color",
|
|
3822
|
+
position: "absolute",
|
|
3823
|
+
borderRadius: ".15em"
|
|
3824
|
+
}
|
|
3825
|
+
}),
|
|
3826
|
+
tooltipDirection: {
|
|
3827
|
+
top: {
|
|
3828
|
+
"&:before": {
|
|
3829
|
+
top: "0",
|
|
3830
|
+
left: "50%",
|
|
3831
|
+
transform: "translate(-50%, -50%) rotate(45deg)"
|
|
3832
|
+
}
|
|
3833
|
+
},
|
|
3834
|
+
right: {
|
|
3835
|
+
"&:before": {
|
|
3836
|
+
top: "50%",
|
|
3837
|
+
right: "0",
|
|
3838
|
+
transform: "translate(50%, -50%) rotate(45deg)"
|
|
3839
|
+
}
|
|
3840
|
+
},
|
|
3841
|
+
bottom: {
|
|
3842
|
+
"&:before": {
|
|
3843
|
+
bottom: "0",
|
|
3844
|
+
left: "50%",
|
|
3845
|
+
transform: "translate(-50%, 50%) rotate(45deg)"
|
|
3846
|
+
}
|
|
3847
|
+
},
|
|
3848
|
+
left: {
|
|
3849
|
+
"&:before": {
|
|
3850
|
+
top: "50%",
|
|
3851
|
+
left: "0",
|
|
3852
|
+
transform: "translate(-50%, -50%) rotate(45deg)"
|
|
3853
|
+
}
|
|
3854
|
+
}
|
|
3855
|
+
},
|
|
3856
|
+
tag: (el) => ({
|
|
3857
|
+
position: "relative",
|
|
3858
|
+
"&:before": {
|
|
3859
|
+
content: '""',
|
|
3860
|
+
display: "block",
|
|
3861
|
+
background: getComputedBackgroundColor(el),
|
|
3862
|
+
transition: inheritTransition(el),
|
|
3863
|
+
transitionProperty: "background",
|
|
3864
|
+
borderRadius: ".25em",
|
|
3865
|
+
position: "absolute",
|
|
3866
|
+
zIndex: "-1",
|
|
3867
|
+
aspectRatio: "1/1",
|
|
3868
|
+
top: "50%",
|
|
3869
|
+
transformOrigin: "50% 50%",
|
|
3870
|
+
height: "73%"
|
|
3871
|
+
}
|
|
3872
|
+
}),
|
|
3873
|
+
tagDirection: {
|
|
3874
|
+
top: {
|
|
3875
|
+
"&:before": {
|
|
3876
|
+
bottom: "100%",
|
|
3877
|
+
left: "50%",
|
|
3878
|
+
transform: "translate(-50%, 50%) rotate(45deg)"
|
|
3879
|
+
}
|
|
3880
|
+
},
|
|
3881
|
+
right: {
|
|
3882
|
+
"&:before": {
|
|
3883
|
+
top: "50%",
|
|
3884
|
+
left: "100%",
|
|
3885
|
+
transform: "translate(-50%, -50%) rotate(45deg)"
|
|
3886
|
+
}
|
|
3887
|
+
},
|
|
3888
|
+
bottom: {
|
|
3889
|
+
"&:before": {
|
|
3890
|
+
top: "100%",
|
|
3891
|
+
left: "50%",
|
|
3892
|
+
transform: "translate(-50%, -50%) rotate(45deg)"
|
|
3893
|
+
}
|
|
3894
|
+
},
|
|
3895
|
+
left: {
|
|
3896
|
+
"&:before": {
|
|
3897
|
+
top: "50%",
|
|
3898
|
+
right: "100%",
|
|
3899
|
+
transform: "translate(50%, -50%) rotate(45deg)"
|
|
3900
|
+
}
|
|
3901
|
+
}
|
|
3902
|
+
},
|
|
3903
|
+
hexagon: (el) => ({
|
|
3904
|
+
position: "relative",
|
|
3905
|
+
"&:before, &:after": {
|
|
3906
|
+
content: '""',
|
|
3907
|
+
display: "block",
|
|
3908
|
+
position: "absolute",
|
|
3909
|
+
zIndex: "-1",
|
|
3910
|
+
borderRadius: ".25em",
|
|
3911
|
+
aspectRatio: "1/1",
|
|
3912
|
+
top: "50%",
|
|
3913
|
+
transformOrigin: "50% 50%",
|
|
3914
|
+
height: "73%",
|
|
3915
|
+
background: getComputedBackgroundColor(el),
|
|
3916
|
+
transition: inheritTransition(el),
|
|
3917
|
+
transitionProperty: "background"
|
|
3918
|
+
},
|
|
3919
|
+
"&:before": {
|
|
3920
|
+
left: "0",
|
|
3921
|
+
transform: "translate3d(-50%, -50%, 1px) rotate(45deg)"
|
|
3922
|
+
},
|
|
3923
|
+
"&:after": {
|
|
3924
|
+
left: "100%",
|
|
3925
|
+
transform: "translate3d(-50%, -50%, 1px) rotate(45deg)"
|
|
3926
|
+
}
|
|
3927
|
+
}),
|
|
3928
|
+
chevron: (el) => ({
|
|
3929
|
+
position: "relative",
|
|
3930
|
+
// overflow: 'hidden',
|
|
3931
|
+
"&:before, &:after": {
|
|
3932
|
+
content: '""',
|
|
3933
|
+
display: "block",
|
|
3934
|
+
position: "absolute",
|
|
3935
|
+
zIndex: "-1",
|
|
3936
|
+
aspectRatio: "1/1",
|
|
3937
|
+
top: "50%",
|
|
3938
|
+
transformOrigin: "50% 50%",
|
|
3939
|
+
transition: inheritTransition(el),
|
|
3940
|
+
transitionProperty: "background"
|
|
3941
|
+
},
|
|
3942
|
+
"&:before": {
|
|
3943
|
+
background: `linear-gradient(225deg, ${getComputedBackgroundColor(el)} 25%, transparent 25%), linear-gradient(315deg, ${getComputedBackgroundColor(el)} 25%, transparent 25%)`
|
|
3944
|
+
},
|
|
3945
|
+
"&:after": {
|
|
3946
|
+
background: getComputedBackgroundColor(el),
|
|
3947
|
+
borderRadius: ".25em"
|
|
3948
|
+
}
|
|
3949
|
+
}),
|
|
3950
|
+
chevronDirection: {
|
|
3951
|
+
left: {
|
|
3952
|
+
"&:before": {
|
|
3953
|
+
height: "100%",
|
|
3954
|
+
left: "100%",
|
|
3955
|
+
transform: "translate3d(-1%, -50%, 1px) scale(-1, 1)"
|
|
3956
|
+
},
|
|
3957
|
+
"&:after": {
|
|
3958
|
+
height: "73%",
|
|
3959
|
+
left: "0",
|
|
3960
|
+
transform: "translate3d(-50%, -50%, 1px) rotate(45deg)"
|
|
3961
|
+
}
|
|
3962
|
+
},
|
|
3963
|
+
right: {
|
|
3964
|
+
"&:before": {
|
|
3965
|
+
height: "100%",
|
|
3966
|
+
left: "0",
|
|
3967
|
+
transform: "translate3d(-99%, -50%, 1px)"
|
|
3968
|
+
},
|
|
3969
|
+
"&:after": {
|
|
3970
|
+
height: "73%",
|
|
3971
|
+
left: "100%",
|
|
3972
|
+
transform: "translate3d(-50%, -50%, 1px) rotate(45deg)"
|
|
3973
|
+
}
|
|
3974
|
+
}
|
|
3975
|
+
}
|
|
3976
|
+
};
|
|
3977
|
+
|
|
3978
|
+
// ../../uikit/Atoms/Theme.js
|
|
3979
|
+
var isBorderStyle = (str) => ["none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset", "initial"].some((v) => str.includes(v));
|
|
3980
|
+
var transformBorder = (border) => {
|
|
3981
|
+
const arr = border.split(", ");
|
|
3982
|
+
return arr.map((v) => {
|
|
3983
|
+
v = v.trim();
|
|
3984
|
+
if (v.slice(0, 2) === "--")
|
|
3985
|
+
return `var(${v})`;
|
|
3986
|
+
else if (isBorderStyle(v))
|
|
3987
|
+
return v || "solid";
|
|
3988
|
+
else if (v.slice(-2) === "px" || v.slice(-2) === "em")
|
|
3989
|
+
return v;
|
|
3990
|
+
else if ((0, import_scratch5.getColor)(v).length > 2)
|
|
3991
|
+
return (0, import_scratch5.getColor)(v);
|
|
3992
|
+
return (0, import_scratch5.getSpacingByKey)(v, "border").border;
|
|
3993
|
+
}).join(" ");
|
|
3994
|
+
};
|
|
3995
|
+
var transformTextStroke = (stroke) => ({
|
|
3996
|
+
WebkitTextStroke: stroke.split(", ").map((v) => {
|
|
3997
|
+
if (v.slice(0, 2) === "--")
|
|
3998
|
+
return `var(${v})`;
|
|
3999
|
+
if (v.includes("px"))
|
|
4000
|
+
return v;
|
|
4001
|
+
else if ((0, import_scratch5.getColor)(v))
|
|
4002
|
+
return (0, import_scratch5.getColor)(v);
|
|
4003
|
+
}).join(" ")
|
|
4004
|
+
});
|
|
4005
|
+
var transformShadow = (shadows) => shadows.split("|").map((shadow) => {
|
|
4006
|
+
return shadow.split(", ").map((v) => {
|
|
4007
|
+
v = v.trim();
|
|
4008
|
+
if (v.slice(0, 2) === "--")
|
|
4009
|
+
return `var(${v})`;
|
|
4010
|
+
if ((0, import_scratch5.getColor)(v).length > 2)
|
|
4011
|
+
return (0, import_scratch5.getColor)(v);
|
|
4012
|
+
if (v.includes("px") || v.slice(-2) === "em")
|
|
4013
|
+
return v;
|
|
4014
|
+
const arr = v.split(" ");
|
|
4015
|
+
if (!arr.length)
|
|
4016
|
+
return v;
|
|
4017
|
+
return arr.map((v2) => (0, import_scratch5.getSpacingByKey)(v2, "shadow").shadow).join(" ");
|
|
4018
|
+
}).join(" ");
|
|
4019
|
+
}).join(",");
|
|
4020
|
+
var transformBackgroundImage = (backgroundImage, ctx, globalTheme) => ({
|
|
4021
|
+
backgroundImage: backgroundImage.split(", ").map((v) => {
|
|
4022
|
+
if (v.slice(0, 2) === "--")
|
|
4023
|
+
return `var(${v})`;
|
|
4024
|
+
if (v.includes("url") || v.includes("gradient"))
|
|
4025
|
+
return v;
|
|
4026
|
+
else if (ctx.system.GRADIENT[backgroundImage]) {
|
|
4027
|
+
return (0, import_scratch5.getMediaColor)(backgroundImage, "backgroundImage", globalTheme);
|
|
4028
|
+
}
|
|
4029
|
+
return `url(${v})`;
|
|
4030
|
+
}).join(" ")
|
|
4031
|
+
});
|
|
4032
|
+
var getSystemTheme = (element, state) => {
|
|
4033
|
+
const { context } = element;
|
|
4034
|
+
const rootState = element.__root ? element.__root.state : element.state;
|
|
4035
|
+
return rootState.globalTheme || context.system.globalTheme;
|
|
4036
|
+
};
|
|
4037
|
+
var Theme = {
|
|
4038
|
+
class: {
|
|
4039
|
+
depth: ({ props }) => depth[props.depth],
|
|
4040
|
+
theme: (element) => {
|
|
4041
|
+
const { props } = element;
|
|
4042
|
+
const globalTheme = getSystemTheme(element);
|
|
4043
|
+
if (!props.theme)
|
|
4044
|
+
return;
|
|
4045
|
+
return (0, import_scratch5.getMediaTheme)(props.theme, `@${props.themeModifier || globalTheme}`);
|
|
4046
|
+
},
|
|
4047
|
+
color: (element) => {
|
|
4048
|
+
const { props } = element;
|
|
4049
|
+
const globalTheme = getSystemTheme(element);
|
|
4050
|
+
if (!props.color)
|
|
4051
|
+
return;
|
|
4052
|
+
return (0, import_scratch5.getMediaColor)(props.color, "color", globalTheme);
|
|
4053
|
+
},
|
|
4054
|
+
background: (element) => {
|
|
4055
|
+
const { props } = element;
|
|
4056
|
+
const globalTheme = getSystemTheme(element);
|
|
4057
|
+
if (!props.background)
|
|
4058
|
+
return;
|
|
4059
|
+
return (0, import_scratch5.getMediaColor)(props.background, "background", globalTheme);
|
|
4060
|
+
},
|
|
4061
|
+
backgroundColor: (element) => {
|
|
4062
|
+
const { props } = element;
|
|
4063
|
+
const globalTheme = getSystemTheme(element);
|
|
4064
|
+
if (!props.backgroundColor)
|
|
4065
|
+
return;
|
|
4066
|
+
return (0, import_scratch5.getMediaColor)(props.backgroundColor, "backgroundColor", globalTheme);
|
|
4067
|
+
},
|
|
4068
|
+
backgroundImage: (element) => {
|
|
4069
|
+
const { props, context } = element;
|
|
4070
|
+
const globalTheme = getSystemTheme(element);
|
|
4071
|
+
if (!props.backgroundImage)
|
|
4072
|
+
return;
|
|
4073
|
+
return transformBackgroundImage(props.backgroundImage, context, globalTheme);
|
|
4074
|
+
},
|
|
4075
|
+
backgroundSize: ({ props }) => props.backgroundSize ? { backgroundSize: props.backgroundSize } : null,
|
|
4076
|
+
backgroundPosition: ({ props }) => props.backgroundPosition ? { backgroundPosition: props.backgroundPosition } : null,
|
|
4077
|
+
textStroke: ({ props }) => props.textStroke ? transformTextStroke(props.textStroke) : null,
|
|
4078
|
+
outline: ({ props }) => props.outline && {
|
|
4079
|
+
outline: transformBorder(props.outline)
|
|
4080
|
+
},
|
|
4081
|
+
border: ({ props }) => props.border && {
|
|
4082
|
+
border: transformBorder(props.border)
|
|
4083
|
+
},
|
|
4084
|
+
borderColor: ({ props }) => props.borderColor && (0, import_scratch5.getMediaColor)(props.borderColor, "borderColor"),
|
|
4085
|
+
borderStyle: ({ props }) => props.borderStyle && { borderStyle: props.borderStyle },
|
|
4086
|
+
borderLeft: ({ props }) => props.borderLeft && {
|
|
4087
|
+
borderLeft: transformBorder(props.borderLeft)
|
|
4088
|
+
},
|
|
4089
|
+
borderTop: ({ props }) => props.borderTop && {
|
|
4090
|
+
borderTop: transformBorder(props.borderTop)
|
|
4091
|
+
},
|
|
4092
|
+
borderRight: ({ props }) => props.borderRight && {
|
|
4093
|
+
borderRight: transformBorder(props.borderRight)
|
|
4094
|
+
},
|
|
4095
|
+
borderBottom: ({ props }) => props.borderBottom && {
|
|
4096
|
+
borderBottom: transformBorder(props.borderBottom)
|
|
4097
|
+
},
|
|
4098
|
+
boxShadow: ({ props }) => props.boxShadow && {
|
|
4099
|
+
boxShadow: transformShadow(props.boxShadow)
|
|
4100
|
+
},
|
|
4101
|
+
textShadow: ({ props }) => props.textShadow && {
|
|
4102
|
+
textShadow: transformShadow(props.textShadow)
|
|
4103
|
+
},
|
|
4104
|
+
opacity: ({ props }) => props.opacity && { opacity: props.opacity },
|
|
4105
|
+
visibility: ({ props }) => props.visibility && { visibility: props.visibility }
|
|
4106
|
+
}
|
|
4107
|
+
};
|
|
4108
|
+
|
|
4109
|
+
// ../../uikit/Atoms/Media.js
|
|
4110
|
+
var keySetters = {
|
|
4111
|
+
"@": (key, props, result, element, isSubtree) => applyMediaProps(key, props, isSubtree ? result : result.media, element),
|
|
4112
|
+
":": (key, props, result, element, isSubtree) => applySelectorProps(key, props, isSubtree ? result : result.selector, element),
|
|
4113
|
+
"[": (key, props, result, element, isSubtree) => applySelectorProps(key, props, isSubtree ? result : result.selector, element),
|
|
4114
|
+
"&": (key, props, result, element, isSubtree) => applySelectorProps(key, props, isSubtree ? result : result.selector, element),
|
|
4115
|
+
$: (key, props, result, element, isSubtree) => applyCaseProps(key, props, isSubtree ? result : result.case, element),
|
|
4116
|
+
".": (key, props, result, element, isSubtree) => applyConditionalCaseProps(key, props, isSubtree ? result : result.case, element),
|
|
4117
|
+
"!": (key, props, result, element, isSubtree) => applyConditionalFalsyProps(key, props, isSubtree ? result : result.case, element)
|
|
4118
|
+
};
|
|
4119
|
+
var execClass = (key, props, result, element) => {
|
|
4120
|
+
const { class: className } = element;
|
|
4121
|
+
const classnameExec = className[key];
|
|
4122
|
+
if (typeof classnameExec !== "function")
|
|
4123
|
+
return;
|
|
4124
|
+
let classExec = classnameExec({
|
|
4125
|
+
props,
|
|
4126
|
+
context: element.context,
|
|
4127
|
+
state: element.state
|
|
4128
|
+
});
|
|
4129
|
+
if (isArray3(classExec)) {
|
|
4130
|
+
classExec = classExec.reduce((a, c) => merge3(a, c), {});
|
|
4131
|
+
}
|
|
4132
|
+
for (const finalProp in classExec) {
|
|
4133
|
+
result[finalProp] = classExec[finalProp];
|
|
4134
|
+
}
|
|
4135
|
+
return classExec;
|
|
4136
|
+
};
|
|
4137
|
+
var convertPropsToClass = (props, result, element) => {
|
|
4138
|
+
const propsClassObj = {};
|
|
4139
|
+
for (const key in props) {
|
|
4140
|
+
const setter = keySetters[key.slice(0, 1)];
|
|
4141
|
+
if (setter) {
|
|
4142
|
+
setter(key, props[key], propsClassObj, element, true);
|
|
4143
|
+
continue;
|
|
4144
|
+
} else {
|
|
4145
|
+
execClass(key, props, propsClassObj, element);
|
|
4146
|
+
}
|
|
4147
|
+
}
|
|
4148
|
+
return propsClassObj;
|
|
4149
|
+
};
|
|
4150
|
+
var applyMediaProps = (key, props, result, element) => {
|
|
4151
|
+
const { context } = element;
|
|
4152
|
+
if (!context.system || !context.system.MEDIA)
|
|
4153
|
+
return;
|
|
4154
|
+
const globalTheme = getSystemTheme(element);
|
|
4155
|
+
const { MEDIA: MEDIA2 } = context.system;
|
|
4156
|
+
const mediaName = MEDIA2[key.slice(1)];
|
|
4157
|
+
const generatedClass = convertPropsToClass(props, result, element);
|
|
4158
|
+
const name = key.slice(1);
|
|
4159
|
+
const isTheme = ["dark", "light"].includes(name);
|
|
4160
|
+
const matchesGlobal = name === globalTheme;
|
|
4161
|
+
if (globalTheme && isTheme) {
|
|
4162
|
+
if (matchesGlobal)
|
|
4163
|
+
return merge3(result, generatedClass);
|
|
4164
|
+
return;
|
|
4165
|
+
}
|
|
4166
|
+
const mediaKey = `@media screen and ${mediaName}`;
|
|
4167
|
+
result[mediaKey] = generatedClass;
|
|
4168
|
+
return result[mediaKey];
|
|
4169
|
+
};
|
|
4170
|
+
var applySelectorProps = (key, props, result, element) => {
|
|
4171
|
+
const selectorKey = `&${key}`;
|
|
4172
|
+
result[selectorKey] = convertPropsToClass(props, result, element);
|
|
4173
|
+
return result[selectorKey];
|
|
4174
|
+
};
|
|
4175
|
+
var applyCaseProps = (key, props, result, element) => {
|
|
4176
|
+
const { CASES: CASES2 } = element.context && element.context.system;
|
|
4177
|
+
const caseKey = key.slice(1);
|
|
4178
|
+
const isPropTrue = element.props[caseKey];
|
|
4179
|
+
if (!CASES2[caseKey] && !isPropTrue)
|
|
4180
|
+
return;
|
|
4181
|
+
return merge3(result, convertPropsToClass(props, result, element));
|
|
4182
|
+
};
|
|
4183
|
+
var applyConditionalCaseProps = (key, props, result, element) => {
|
|
4184
|
+
const caseKey = key.slice(1);
|
|
4185
|
+
const isPropTrue = element.props[caseKey] || element.state[caseKey] === true;
|
|
4186
|
+
if (!isPropTrue)
|
|
4187
|
+
return;
|
|
4188
|
+
return merge3(result, convertPropsToClass(props, result, element));
|
|
4189
|
+
};
|
|
4190
|
+
var applyConditionalFalsyProps = (key, props, result, element) => {
|
|
4191
|
+
const caseKey = key.slice(1);
|
|
4192
|
+
const isPropTrue = element.props[caseKey] || element.state[caseKey] === true;
|
|
4193
|
+
if (!isPropTrue)
|
|
4194
|
+
return merge3(result, convertPropsToClass(props, result, element));
|
|
4195
|
+
};
|
|
4196
|
+
var applyTrueProps = (props, result, element) => merge3(result, convertPropsToClass(props, result, element));
|
|
4197
|
+
var beforeClassAssign = (element, s) => {
|
|
4198
|
+
const { props, class: className } = element;
|
|
4199
|
+
const CLASS_NAMES = {
|
|
4200
|
+
media: {},
|
|
4201
|
+
selector: {},
|
|
4202
|
+
case: {}
|
|
4203
|
+
};
|
|
4204
|
+
for (const key in props) {
|
|
4205
|
+
const setter = keySetters[key.slice(0, 1)];
|
|
4206
|
+
if (setter)
|
|
4207
|
+
setter(key, props[key], CLASS_NAMES, element);
|
|
4208
|
+
}
|
|
4209
|
+
merge3(className, CLASS_NAMES);
|
|
4210
|
+
};
|
|
4211
|
+
var initUpdate = (element) => {
|
|
4212
|
+
const { props, context, class: className } = element;
|
|
4213
|
+
const globalTheme = context.system.globalTheme;
|
|
4214
|
+
const parentProps = element.parent.props;
|
|
4215
|
+
if (parentProps && parentProps.spacingRatio && parentProps.inheritSpacingRatio) {
|
|
4216
|
+
element.setProps({
|
|
4217
|
+
spacingRatio: parentProps.spacingRatio,
|
|
4218
|
+
inheritSpacingRatio: true
|
|
4219
|
+
}, {
|
|
4220
|
+
preventRecursive: true,
|
|
4221
|
+
ignoreInitUpdate: true
|
|
4222
|
+
});
|
|
4223
|
+
}
|
|
4224
|
+
if (globalTheme) {
|
|
4225
|
+
const CLASS_NAMES = {
|
|
4226
|
+
media: {},
|
|
4227
|
+
selector: {},
|
|
4228
|
+
case: {}
|
|
4229
|
+
};
|
|
4230
|
+
for (const key in props) {
|
|
4231
|
+
const setter = keySetters[key.slice(0, 1)];
|
|
4232
|
+
if (key === "theme") {
|
|
4233
|
+
props.update({
|
|
4234
|
+
themeModifier: globalTheme
|
|
4235
|
+
}, { preventRecursive: true, ignoreInitUpdate: true, preventDefineUpdate: "$setStateCollection" });
|
|
4236
|
+
} else if (key === "true")
|
|
4237
|
+
applyTrueProps(props[key], CLASS_NAMES, element);
|
|
4238
|
+
if (setter)
|
|
4239
|
+
setter(key, props[key], CLASS_NAMES, element);
|
|
4240
|
+
}
|
|
4241
|
+
if (Object.keys(CLASS_NAMES.media).length) {
|
|
4242
|
+
className.media = CLASS_NAMES.media;
|
|
4243
|
+
}
|
|
4244
|
+
className.selector = CLASS_NAMES.selector;
|
|
4245
|
+
className.case = CLASS_NAMES.case;
|
|
4246
|
+
}
|
|
4247
|
+
};
|
|
4248
|
+
var Media = {
|
|
4249
|
+
on: { beforeClassAssign, initUpdate }
|
|
4250
|
+
};
|
|
4251
|
+
|
|
4252
|
+
// ../../uikit/Atoms/Interaction.js
|
|
4253
|
+
var Interaction = {
|
|
4254
|
+
class: {
|
|
4255
|
+
userSelect: ({ props }) => props.userSelect && { userSelect: props.userSelect },
|
|
4256
|
+
pointerEvents: ({ props }) => props.pointerEvents && { pointerEvents: props.pointerEvents },
|
|
4257
|
+
cursor: ({ props }) => props.cursor && { cursor: props.cursor }
|
|
4258
|
+
}
|
|
4259
|
+
};
|
|
4260
|
+
|
|
4261
|
+
// ../../uikit/Atoms/Overflow.js
|
|
4262
|
+
var Overflow = {
|
|
4263
|
+
class: {
|
|
4264
|
+
overflow: ({ props }) => props.overflow && { overflow: props.overflow }
|
|
4265
|
+
}
|
|
4266
|
+
};
|
|
4267
|
+
|
|
4268
|
+
// ../../uikit/Atoms/Collection.js
|
|
4269
|
+
init_utils();
|
|
4270
|
+
|
|
4271
|
+
// ../../uikit/Atoms/Position.js
|
|
4272
|
+
var import_scratch6 = __toESM(require_index_cjs());
|
|
4273
|
+
var Position = {
|
|
4274
|
+
props: {},
|
|
4275
|
+
class: {
|
|
4276
|
+
position: ({ props }) => props.position && { position: props.position },
|
|
4277
|
+
inset: ({ props }) => {
|
|
4278
|
+
const { inset } = props;
|
|
4279
|
+
if (typeof inset !== "string")
|
|
4280
|
+
return;
|
|
4281
|
+
return { inset: inset.split(" ").map((v) => (0, import_scratch6.getSpacingByKey)(v, "k").k).join(" ") };
|
|
4282
|
+
},
|
|
4283
|
+
left: ({ props }) => (0, import_scratch6.getSpacingByKey)(props.left, "left"),
|
|
4284
|
+
top: ({ props }) => (0, import_scratch6.getSpacingByKey)(props.top, "top"),
|
|
4285
|
+
right: ({ props }) => (0, import_scratch6.getSpacingByKey)(props.right, "right"),
|
|
4286
|
+
bottom: ({ props }) => (0, import_scratch6.getSpacingByKey)(props.bottom, "bottom")
|
|
4287
|
+
}
|
|
4288
|
+
};
|
|
4289
|
+
|
|
4290
|
+
// ../../uikit/Atoms/Pseudo.js
|
|
4291
|
+
var Pseudo = {
|
|
4292
|
+
class: {
|
|
4293
|
+
content: ({ props }) => props.content && { content: props.content }
|
|
4294
|
+
}
|
|
4295
|
+
};
|
|
4296
|
+
|
|
4297
|
+
// ../../uikit/Atoms/Shape/index.js
|
|
4298
|
+
init_utils();
|
|
4299
|
+
var import_scratch7 = __toESM(require_index_cjs());
|
|
4300
|
+
var transformBorderRadius = (radius, props, propertyName) => {
|
|
4301
|
+
if (!isString3(radius))
|
|
4302
|
+
return;
|
|
4303
|
+
return {
|
|
4304
|
+
borderRadius: radius.split(" ").map((v, k) => (0, import_scratch7.getSpacingBasedOnRatio)(props, propertyName, v)[propertyName]).join(" ")
|
|
4305
|
+
};
|
|
4306
|
+
};
|
|
4307
|
+
var Shape = {
|
|
4308
|
+
extend: Pseudo,
|
|
4309
|
+
class: {
|
|
4310
|
+
shape: (element) => {
|
|
4311
|
+
const { props } = element;
|
|
4312
|
+
const { shape } = props;
|
|
4313
|
+
return shape ? exec2(SHAPES[shape], element) : null;
|
|
4314
|
+
},
|
|
4315
|
+
shapeDirection: ({ props }) => {
|
|
4316
|
+
const { shape, shapeDirection } = props;
|
|
4317
|
+
if (!shape || !shapeDirection)
|
|
4318
|
+
return;
|
|
4319
|
+
const shapeDir = SHAPES[shape + "Direction"];
|
|
4320
|
+
return shape && shapeDir ? shapeDir[shapeDirection || "left"] : null;
|
|
4321
|
+
},
|
|
4322
|
+
shapeDirectionColor: (el) => {
|
|
4323
|
+
const { props } = el;
|
|
4324
|
+
const { background, backgroundColor } = props;
|
|
4325
|
+
const borderColor = (0, import_scratch7.getMediaColor)(background || backgroundColor, "borderColor");
|
|
4326
|
+
return props.shapeDirection ? borderColor : null;
|
|
4327
|
+
},
|
|
4328
|
+
round: ({ props, key, ...el }) => transformBorderRadius(props.round || props.borderRadius, props, "round"),
|
|
4329
|
+
borderRadius: ({ props, key, ...el }) => transformBorderRadius(props.borderRadius || props.round, props, "borderRadius")
|
|
4330
|
+
}
|
|
4331
|
+
};
|
|
4332
|
+
|
|
4333
|
+
// ../../uikit/Atoms/Text.js
|
|
4334
|
+
var import_scratch8 = __toESM(require_index_cjs());
|
|
4335
|
+
var Text = {
|
|
4336
|
+
text: ({ key, props, state }) => {
|
|
4337
|
+
if (props.text === true)
|
|
4338
|
+
return state && state[key] || props && props[key];
|
|
4339
|
+
return props.text;
|
|
4340
|
+
},
|
|
4341
|
+
class: {
|
|
4342
|
+
fontSize: ({ props }) => props.fontSize ? (0, import_scratch8.getFontSizeByKey)(props.fontSize) : null,
|
|
4343
|
+
fontFamily: ({ props }) => props.fontFamily && { fontFamily: (0, import_scratch8.getFontFamily)(props.fontFamily) || props.fontFamily },
|
|
4344
|
+
lineHeight: ({ props }) => props.lineHeight && { lineHeight: props.lineHeight },
|
|
4345
|
+
// lineHeight: ({ props }) => props.lineHeight && getSpacingBasedOnRatio(props, 'lineHeight', null, ''),
|
|
4346
|
+
textDecoration: ({ props }) => props.textDecoration && { textDecoration: props.textDecoration },
|
|
4347
|
+
textTransform: ({ props }) => props.textTransform && { textTransform: props.textTransform },
|
|
4348
|
+
whiteSpace: ({ props }) => props.whiteSpace && { whiteSpace: props.whiteSpace },
|
|
4349
|
+
letterSpacing: ({ props }) => props.letterSpacing && { letterSpacing: props.letterSpacing },
|
|
4350
|
+
textAlign: ({ props }) => props.textAlign && { textAlign: props.textAlign },
|
|
4351
|
+
fontWeight: ({ props }) => props.fontWeight && {
|
|
4352
|
+
fontWeight: props.fontWeight,
|
|
4353
|
+
fontVariationSettings: '"wght" ' + props.fontWeight
|
|
4354
|
+
}
|
|
4355
|
+
}
|
|
4356
|
+
};
|
|
4357
|
+
|
|
4358
|
+
// ../../uikit/Atoms/Transform.js
|
|
4359
|
+
var Transform = {
|
|
4360
|
+
class: {
|
|
4361
|
+
transform: ({ props }) => props.transform && { transform: props.transform },
|
|
4362
|
+
transformOrigin: ({ props }) => props.transformOrigin && { transformOrigin: props.transformOrigin }
|
|
4363
|
+
}
|
|
4364
|
+
};
|
|
4365
|
+
|
|
4366
|
+
// ../../uikit/Atoms/XYZ.js
|
|
4367
|
+
var XYZ = {
|
|
4368
|
+
class: {
|
|
4369
|
+
zIndex: ({ props }) => props.zIndex && { zIndex: props.zIndex }
|
|
4370
|
+
}
|
|
4371
|
+
};
|
|
4372
|
+
|
|
4373
|
+
// ../../uikit/Atoms/Animation.js
|
|
4374
|
+
var import_scratch9 = __toESM(require_index_cjs());
|
|
4375
|
+
init_utils();
|
|
4376
|
+
|
|
4377
|
+
// ../../node_modules/@symbo.ls/create-emotion/index.js
|
|
4378
|
+
init_emotion_css_create_instance_esm();
|
|
4379
|
+
var createEmotion3 = (key = "smbls", container) => {
|
|
4380
|
+
return emotion_css_create_instance_esm_default({ key, container });
|
|
4381
|
+
};
|
|
4382
|
+
var emotion = createEmotion3();
|
|
4383
|
+
|
|
4384
|
+
// ../../uikit/Atoms/Animation.js
|
|
4385
|
+
var { keyframes } = emotion;
|
|
4386
|
+
var applyAnimationProps = (animation, element) => {
|
|
4387
|
+
if (isObject3(animation))
|
|
4388
|
+
return { animationName: keyframes(animation) };
|
|
4389
|
+
const { ANIMATION: ANIMATION2 } = element.context && element.context.system;
|
|
4390
|
+
const record = ANIMATION2[animation];
|
|
4391
|
+
return keyframes(record);
|
|
4392
|
+
};
|
|
4393
|
+
var Animation = {
|
|
4394
|
+
class: {
|
|
4395
|
+
animation: (el) => el.props.animation && {
|
|
4396
|
+
animationName: applyAnimationProps(el.props.animation, el),
|
|
4397
|
+
animationDuration: (0, import_scratch9.getTimingByKey)(el.props.animationDuration || "A").timing,
|
|
4398
|
+
animationDelay: (0, import_scratch9.getTimingByKey)(el.props.animationDelay || "0s").timing,
|
|
4399
|
+
animationTimingFunction: (0, import_scratch9.getTimingFunction)(el.props.animationTimingFunction || "ease"),
|
|
4400
|
+
animationFillMode: el.props.animationFillMode || "both",
|
|
4401
|
+
animationPlayState: el.props.animationPlayState,
|
|
4402
|
+
animationDirection: el.props.animationDirection
|
|
4403
|
+
},
|
|
4404
|
+
animationName: (el) => el.props.animationName && {
|
|
4405
|
+
animationName: applyAnimationProps(el.props.animationName, el)
|
|
4406
|
+
},
|
|
4407
|
+
animationDuration: ({ props }) => props.animationDuration && {
|
|
4408
|
+
animationDuration: (0, import_scratch9.getTimingByKey)(props.animationDuration).timing
|
|
4409
|
+
},
|
|
4410
|
+
animationDelay: ({ props }) => props.animationDelay && {
|
|
4411
|
+
animationDelay: (0, import_scratch9.getTimingByKey)(props.animationDelay).timing
|
|
4412
|
+
},
|
|
4413
|
+
animationTimingFunction: ({ props }) => props.animationTimingFunction && {
|
|
4414
|
+
animationTimingFunction: (0, import_scratch9.getTimingFunction)(props.animationTimingFunction)
|
|
4415
|
+
},
|
|
4416
|
+
animationFillMode: ({ props }) => props.animationFillMode && {
|
|
4417
|
+
animationFillMode: props.animationFillMode
|
|
4418
|
+
},
|
|
4419
|
+
animationPlayState: ({ props }) => props.animationPlayState && {
|
|
4420
|
+
animationPlayState: props.animationPlayState
|
|
4421
|
+
},
|
|
4422
|
+
animationIterationCount: ({ props }) => props.animationIterationCount && {
|
|
4423
|
+
animationIterationCount: props.animationIterationCount || 1
|
|
4424
|
+
},
|
|
4425
|
+
animationDirection: ({ props }) => props.animationDirection && {
|
|
4426
|
+
animationDirection: props.animationDirection
|
|
4427
|
+
}
|
|
4428
|
+
}
|
|
4429
|
+
};
|
|
4430
|
+
|
|
4431
|
+
// src/registry.js
|
|
4432
|
+
init_utils();
|
|
4433
|
+
var registry = mergeArray2([
|
|
4434
|
+
Shape,
|
|
4435
|
+
Position,
|
|
4436
|
+
Theme,
|
|
4437
|
+
Block,
|
|
4438
|
+
Text,
|
|
4439
|
+
Overflow,
|
|
4440
|
+
Timing,
|
|
4441
|
+
Transform,
|
|
4442
|
+
Media,
|
|
4443
|
+
Interaction,
|
|
4444
|
+
XYZ,
|
|
4445
|
+
Animation
|
|
4446
|
+
]).class;
|
|
4447
|
+
|
|
4448
|
+
// src/transform.js
|
|
4449
|
+
var transformClassname = (props, registry2 = registry) => {
|
|
4450
|
+
const CLASS_NAMES = {};
|
|
4451
|
+
if (!isObject3(props))
|
|
4452
|
+
return;
|
|
4453
|
+
for (const key in props) {
|
|
4454
|
+
const setter = keySetters[key.slice(0, 1)];
|
|
4455
|
+
const reg = registry2;
|
|
4456
|
+
const hasCSS = reg[key];
|
|
4457
|
+
if (setter)
|
|
4458
|
+
setter(key, props[key], CLASS_NAMES);
|
|
4459
|
+
else if (isFunction3(hasCSS)) {
|
|
4460
|
+
const stack = hasCSS(props);
|
|
4461
|
+
const exec3 = isArray3(stack) ? stack.reduce((a, c) => {
|
|
4462
|
+
return merge3(a, c);
|
|
4463
|
+
}, {}) : stack;
|
|
4464
|
+
merge3(CLASS_NAMES, exec3);
|
|
4465
|
+
}
|
|
4466
|
+
}
|
|
4467
|
+
return CLASS_NAMES;
|
|
4468
|
+
};
|
|
4469
|
+
|
|
4470
|
+
// src/emotion.js
|
|
4471
|
+
init_utils();
|
|
4472
|
+
|
|
4473
|
+
// ../emotion/index.js
|
|
4474
|
+
init_emotion_css_create_instance_esm();
|
|
4475
|
+
var createEmotion4 = (key = "smbls", container) => {
|
|
4476
|
+
const cleanKey = key.replaceAll(/\./g, "-");
|
|
4477
|
+
return emotion_css_create_instance_esm_default({ key: cleanKey, container });
|
|
4478
|
+
};
|
|
4479
|
+
var emotion2 = createEmotion4();
|
|
4480
|
+
|
|
4481
|
+
// src/emotion.js
|
|
4482
|
+
var { css } = emotion2;
|
|
4483
|
+
var transformEmotion = (props, callback) => isFunction3(callback) ? callback(props) : css(props);
|
|
4484
|
+
|
|
4485
|
+
// src/set.js
|
|
4486
|
+
var setClassname = (props, emotionCss) => {
|
|
4487
|
+
const transform = transformClassname(props);
|
|
4488
|
+
return transformEmotion(transform, emotionCss);
|
|
4489
|
+
};
|