@cronocode/react-box 2.0.2 → 2.0.5
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/box.mjs +3 -3
- package/components/baseSvg.d.ts +1 -1
- package/components/checkbox.d.ts +1 -3
- package/components/label.cjs +1 -0
- package/components/label.d.ts +6 -0
- package/components/label.mjs +7 -0
- package/components/label.test.cjs +1 -0
- package/components/label.test.mjs +2 -0
- package/components/label2.cjs +311 -0
- package/components/label2.mjs +17395 -0
- package/components/radioButton.d.ts +1 -3
- package/components/textarea.d.ts +1 -2
- package/components/textbox.d.ts +1 -2
- package/components/tooltip.cjs +1 -1
- package/core/boxStyles.d.ts +28 -2
- package/core/theme.d.ts +1 -0
- package/core/types.d.ts +27 -23
- package/core.cjs +20 -15
- package/core.mjs +1258 -392
- package/magic-string.es.cjs +10 -0
- package/magic-string.es.mjs +738 -0
- package/package.json +2 -1
- package/utils.cjs +308 -1
- package/utils.mjs +3914 -49
package/core.mjs
CHANGED
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
import { useMemo as
|
|
2
|
-
import { O as
|
|
3
|
-
var
|
|
4
|
-
((
|
|
5
|
-
((
|
|
6
|
-
function t(
|
|
7
|
-
return `${
|
|
1
|
+
import { useMemo as xe, useLayoutEffect as je, useEffect as Me } from "react";
|
|
2
|
+
import { O as we } from "./utils.mjs";
|
|
3
|
+
var d;
|
|
4
|
+
((u) => {
|
|
5
|
+
((o) => {
|
|
6
|
+
function t(e, O) {
|
|
7
|
+
return `${e}${O.replace("/", "-")}`;
|
|
8
8
|
}
|
|
9
|
-
|
|
10
|
-
function
|
|
11
|
-
return [`${
|
|
9
|
+
o.fraction = t;
|
|
10
|
+
function m(e) {
|
|
11
|
+
return [`${e} path`, `${e} circle`, `${e} rect`, `${e} line`];
|
|
12
12
|
}
|
|
13
|
-
|
|
14
|
-
})(
|
|
15
|
-
function t(
|
|
16
|
-
return `${
|
|
13
|
+
o.svg = m;
|
|
14
|
+
})(u.ClassName || (u.ClassName = {})), ((o) => {
|
|
15
|
+
function t(p, h) {
|
|
16
|
+
return `${h / 4}rem`;
|
|
17
17
|
}
|
|
18
|
-
|
|
19
|
-
function
|
|
20
|
-
return `${
|
|
18
|
+
o.rem = t;
|
|
19
|
+
function m(p, h) {
|
|
20
|
+
return `${h}px`;
|
|
21
21
|
}
|
|
22
|
-
|
|
23
|
-
function
|
|
24
|
-
const [
|
|
25
|
-
return `${+
|
|
22
|
+
o.px = m;
|
|
23
|
+
function e(p, h) {
|
|
24
|
+
const [b, x] = h.split("/");
|
|
25
|
+
return `${+b / +x * 100}%`;
|
|
26
26
|
}
|
|
27
|
-
|
|
28
|
-
function
|
|
29
|
-
switch (
|
|
27
|
+
o.fraction = e;
|
|
28
|
+
function O(p, h) {
|
|
29
|
+
switch (h) {
|
|
30
30
|
case "fit":
|
|
31
31
|
return "100%";
|
|
32
32
|
case "fit-screen":
|
|
33
|
-
return
|
|
33
|
+
return p.toLocaleLowerCase().includes("height") ? "100vh" : "100vw";
|
|
34
34
|
default:
|
|
35
|
-
return
|
|
35
|
+
return h;
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
|
|
39
|
-
function
|
|
40
|
-
return (
|
|
38
|
+
o.widthHeight = O;
|
|
39
|
+
function q(p) {
|
|
40
|
+
return (h, b) => `var(--${p}${b});`;
|
|
41
41
|
}
|
|
42
|
-
|
|
43
|
-
function
|
|
44
|
-
return (
|
|
42
|
+
o.variables = q;
|
|
43
|
+
function H(p) {
|
|
44
|
+
return (h, b) => `var(--${p}${b});`;
|
|
45
45
|
}
|
|
46
|
-
|
|
47
|
-
function
|
|
48
|
-
return `repeat(${
|
|
46
|
+
o.svgVariables = H;
|
|
47
|
+
function L(p, h) {
|
|
48
|
+
return `repeat(${h},minmax(0,1fr))`;
|
|
49
49
|
}
|
|
50
|
-
|
|
51
|
-
function
|
|
52
|
-
return
|
|
50
|
+
o.gridColumns = L;
|
|
51
|
+
function G(p, h) {
|
|
52
|
+
return h === "full-row" ? "1/-1" : `span ${h}/span ${h}`;
|
|
53
53
|
}
|
|
54
|
-
|
|
55
|
-
function
|
|
56
|
-
return `${
|
|
54
|
+
o.gridColumn = G;
|
|
55
|
+
function y(p, h) {
|
|
56
|
+
return `${h}ms`;
|
|
57
57
|
}
|
|
58
|
-
|
|
59
|
-
function
|
|
60
|
-
return `${
|
|
58
|
+
o.ms = y;
|
|
59
|
+
function j(p, h) {
|
|
60
|
+
return `${h}deg`;
|
|
61
61
|
}
|
|
62
|
-
|
|
63
|
-
function
|
|
64
|
-
return
|
|
62
|
+
o.rotate = j;
|
|
63
|
+
function C(p, h) {
|
|
64
|
+
return h === "xAxis" ? "-1 1" : "1 -1";
|
|
65
65
|
}
|
|
66
|
-
|
|
67
|
-
})(
|
|
68
|
-
})(
|
|
69
|
-
const
|
|
66
|
+
o.flip = C;
|
|
67
|
+
})(u.Value || (u.Value = {}));
|
|
68
|
+
})(d || (d = {}));
|
|
69
|
+
const M = [
|
|
70
70
|
0,
|
|
71
71
|
1,
|
|
72
72
|
2,
|
|
@@ -139,7 +139,7 @@ const v = [
|
|
|
139
139
|
350,
|
|
140
140
|
384,
|
|
141
141
|
400
|
|
142
|
-
],
|
|
142
|
+
], Oe = [
|
|
143
143
|
-1,
|
|
144
144
|
-2,
|
|
145
145
|
-3,
|
|
@@ -185,7 +185,7 @@ const v = [
|
|
|
185
185
|
-92,
|
|
186
186
|
-96,
|
|
187
187
|
-100
|
|
188
|
-
],
|
|
188
|
+
], T = [...M, ...Oe], fe = ["solid", "dashed", "dotted", "double", "groove", "ridge", "inset", "outset", "none", "hidden"], re = ["auto", "hidden", "scroll", "visible"], _ = [
|
|
189
189
|
"1/2",
|
|
190
190
|
"1/3",
|
|
191
191
|
"2/3",
|
|
@@ -212,7 +212,7 @@ const v = [
|
|
|
212
212
|
"9/12",
|
|
213
213
|
"10/12",
|
|
214
214
|
"11/12"
|
|
215
|
-
],
|
|
215
|
+
], ee = ["fit", "fit-screen", "auto", "fit-content", "max-content", "min-content"], me = ["auto", "flex-start", "flex-end", "center", "baseline", "stretch"], Ce = {
|
|
216
216
|
/** The `display` CSS property sets whether an element is treated as a block or inline box and the layout used for its children, such as flow layout, grid or flex. */
|
|
217
217
|
display: {
|
|
218
218
|
cssNames: ["display"],
|
|
@@ -236,61 +236,61 @@ const v = [
|
|
|
236
236
|
},
|
|
237
237
|
width: {
|
|
238
238
|
cssNames: ["width"],
|
|
239
|
-
values1: { values:
|
|
240
|
-
values2: { values:
|
|
239
|
+
values1: { values: ee, formatValue: d.Value.widthHeight },
|
|
240
|
+
values2: { values: M, formatValue: d.Value.rem },
|
|
241
241
|
values3: {
|
|
242
|
-
values:
|
|
243
|
-
formatValue:
|
|
242
|
+
values: _,
|
|
243
|
+
formatValue: d.Value.fraction
|
|
244
244
|
// formatClassName: BoxStylesFormatters.ClassName.fraction,
|
|
245
245
|
}
|
|
246
246
|
},
|
|
247
247
|
minWidth: {
|
|
248
248
|
cssNames: ["min-width"],
|
|
249
|
-
values1: { values:
|
|
250
|
-
values2: { values:
|
|
249
|
+
values1: { values: ee, formatValue: d.Value.widthHeight },
|
|
250
|
+
values2: { values: M, formatValue: d.Value.rem },
|
|
251
251
|
values3: {
|
|
252
|
-
values:
|
|
253
|
-
formatValue:
|
|
252
|
+
values: _,
|
|
253
|
+
formatValue: d.Value.fraction
|
|
254
254
|
// formatClassName: BoxStylesFormatters.ClassName.fraction,
|
|
255
255
|
}
|
|
256
256
|
},
|
|
257
257
|
maxWidth: {
|
|
258
258
|
cssNames: ["max-width"],
|
|
259
|
-
values1: { values:
|
|
260
|
-
values2: { values:
|
|
259
|
+
values1: { values: ee, formatValue: d.Value.widthHeight },
|
|
260
|
+
values2: { values: M, formatValue: d.Value.rem },
|
|
261
261
|
values3: {
|
|
262
|
-
values:
|
|
263
|
-
formatValue:
|
|
262
|
+
values: _,
|
|
263
|
+
formatValue: d.Value.fraction
|
|
264
264
|
// formatClassName: BoxStylesFormatters.ClassName.fraction,
|
|
265
265
|
}
|
|
266
266
|
},
|
|
267
267
|
height: {
|
|
268
268
|
cssNames: ["height"],
|
|
269
|
-
values1: { values:
|
|
270
|
-
values2: { values:
|
|
269
|
+
values1: { values: ee, formatValue: d.Value.widthHeight },
|
|
270
|
+
values2: { values: M, formatValue: d.Value.rem },
|
|
271
271
|
values3: {
|
|
272
|
-
values:
|
|
273
|
-
formatValue:
|
|
272
|
+
values: _,
|
|
273
|
+
formatValue: d.Value.fraction
|
|
274
274
|
// formatClassName: BoxStylesFormatters.ClassName.fraction,
|
|
275
275
|
}
|
|
276
276
|
},
|
|
277
277
|
minHeight: {
|
|
278
278
|
cssNames: ["min-height"],
|
|
279
|
-
values1: { values:
|
|
280
|
-
values2: { values:
|
|
279
|
+
values1: { values: ee, formatValue: d.Value.widthHeight },
|
|
280
|
+
values2: { values: M, formatValue: d.Value.rem },
|
|
281
281
|
values3: {
|
|
282
|
-
values:
|
|
283
|
-
formatValue:
|
|
282
|
+
values: _,
|
|
283
|
+
formatValue: d.Value.fraction
|
|
284
284
|
// formatClassName: BoxStylesFormatters.ClassName.fraction,
|
|
285
285
|
}
|
|
286
286
|
},
|
|
287
287
|
maxHeight: {
|
|
288
288
|
cssNames: ["max-height"],
|
|
289
|
-
values1: { values:
|
|
290
|
-
values2: { values:
|
|
289
|
+
values1: { values: ee, formatValue: d.Value.widthHeight },
|
|
290
|
+
values2: { values: M, formatValue: d.Value.rem },
|
|
291
291
|
values3: {
|
|
292
|
-
values:
|
|
293
|
-
formatValue:
|
|
292
|
+
values: _,
|
|
293
|
+
formatValue: d.Value.fraction
|
|
294
294
|
// formatClassName: BoxStylesFormatters.ClassName.fraction,
|
|
295
295
|
}
|
|
296
296
|
},
|
|
@@ -302,217 +302,217 @@ const v = [
|
|
|
302
302
|
},
|
|
303
303
|
top: {
|
|
304
304
|
cssNames: ["top"],
|
|
305
|
-
values1: { values:
|
|
305
|
+
values1: { values: T, formatValue: d.Value.rem },
|
|
306
306
|
values2: { values: [] },
|
|
307
307
|
values3: { values: [] }
|
|
308
308
|
},
|
|
309
309
|
right: {
|
|
310
310
|
cssNames: ["right"],
|
|
311
|
-
values1: { values:
|
|
311
|
+
values1: { values: T, formatValue: d.Value.rem },
|
|
312
312
|
values2: { values: [] },
|
|
313
313
|
values3: { values: [] }
|
|
314
314
|
},
|
|
315
315
|
bottom: {
|
|
316
316
|
cssNames: ["bottom"],
|
|
317
|
-
values1: { values:
|
|
317
|
+
values1: { values: T, formatValue: d.Value.rem },
|
|
318
318
|
values2: { values: [] },
|
|
319
319
|
values3: { values: [] }
|
|
320
320
|
},
|
|
321
321
|
left: {
|
|
322
322
|
cssNames: ["left"],
|
|
323
|
-
values1: { values:
|
|
323
|
+
values1: { values: T, formatValue: d.Value.rem },
|
|
324
324
|
values2: { values: [] },
|
|
325
325
|
values3: { values: [] }
|
|
326
326
|
},
|
|
327
327
|
inset: {
|
|
328
328
|
cssNames: ["inset"],
|
|
329
|
-
values1: { values:
|
|
329
|
+
values1: { values: T, formatValue: d.Value.rem },
|
|
330
330
|
values2: { values: [] },
|
|
331
331
|
values3: { values: [] }
|
|
332
332
|
},
|
|
333
333
|
m: {
|
|
334
334
|
cssNames: ["margin"],
|
|
335
|
-
values1: { values:
|
|
335
|
+
values1: { values: T, formatValue: d.Value.rem },
|
|
336
336
|
values2: { values: ["auto"] },
|
|
337
337
|
values3: { values: [] }
|
|
338
338
|
},
|
|
339
339
|
mx: {
|
|
340
340
|
cssNames: ["margin-inline"],
|
|
341
|
-
values1: { values:
|
|
341
|
+
values1: { values: T, formatValue: d.Value.rem },
|
|
342
342
|
values2: { values: ["auto"] },
|
|
343
343
|
values3: { values: [] }
|
|
344
344
|
},
|
|
345
345
|
my: {
|
|
346
346
|
cssNames: ["margin-block"],
|
|
347
|
-
values1: { values:
|
|
347
|
+
values1: { values: T, formatValue: d.Value.rem },
|
|
348
348
|
values2: { values: ["auto"] },
|
|
349
349
|
values3: { values: [] }
|
|
350
350
|
},
|
|
351
351
|
mt: {
|
|
352
352
|
cssNames: ["margin-top"],
|
|
353
|
-
values1: { values:
|
|
353
|
+
values1: { values: T, formatValue: d.Value.rem },
|
|
354
354
|
values2: { values: ["auto"] },
|
|
355
355
|
values3: { values: [] }
|
|
356
356
|
},
|
|
357
357
|
mr: {
|
|
358
358
|
cssNames: ["margin-right"],
|
|
359
|
-
values1: { values:
|
|
359
|
+
values1: { values: T, formatValue: d.Value.rem },
|
|
360
360
|
values2: { values: ["auto"] },
|
|
361
361
|
values3: { values: [] }
|
|
362
362
|
},
|
|
363
363
|
mb: {
|
|
364
364
|
cssNames: ["margin-bottom"],
|
|
365
|
-
values1: { values:
|
|
365
|
+
values1: { values: T, formatValue: d.Value.rem },
|
|
366
366
|
values2: { values: ["auto"] },
|
|
367
367
|
values3: { values: [] }
|
|
368
368
|
},
|
|
369
369
|
ml: {
|
|
370
370
|
cssNames: ["margin-left"],
|
|
371
|
-
values1: { values:
|
|
371
|
+
values1: { values: T, formatValue: d.Value.rem },
|
|
372
372
|
values2: { values: ["auto"] },
|
|
373
373
|
values3: { values: [] }
|
|
374
374
|
},
|
|
375
375
|
p: {
|
|
376
376
|
cssNames: ["padding"],
|
|
377
|
-
values1: { values:
|
|
377
|
+
values1: { values: T, formatValue: d.Value.rem },
|
|
378
378
|
values2: { values: [] },
|
|
379
379
|
values3: { values: [] }
|
|
380
380
|
},
|
|
381
381
|
px: {
|
|
382
382
|
cssNames: ["padding-inline"],
|
|
383
|
-
values1: { values:
|
|
383
|
+
values1: { values: T, formatValue: d.Value.rem },
|
|
384
384
|
values2: { values: [] },
|
|
385
385
|
values3: { values: [] }
|
|
386
386
|
},
|
|
387
387
|
py: {
|
|
388
388
|
cssNames: ["padding-block"],
|
|
389
|
-
values1: { values:
|
|
389
|
+
values1: { values: T, formatValue: d.Value.rem },
|
|
390
390
|
values2: { values: [] },
|
|
391
391
|
values3: { values: [] }
|
|
392
392
|
},
|
|
393
393
|
pt: {
|
|
394
394
|
cssNames: ["padding-top"],
|
|
395
|
-
values1: { values:
|
|
395
|
+
values1: { values: T, formatValue: d.Value.rem },
|
|
396
396
|
values2: { values: [] },
|
|
397
397
|
values3: { values: [] }
|
|
398
398
|
},
|
|
399
399
|
pr: {
|
|
400
400
|
cssNames: ["padding-right"],
|
|
401
|
-
values1: { values:
|
|
401
|
+
values1: { values: T, formatValue: d.Value.rem },
|
|
402
402
|
values2: { values: [] },
|
|
403
403
|
values3: { values: [] }
|
|
404
404
|
},
|
|
405
405
|
pb: {
|
|
406
406
|
cssNames: ["padding-bottom"],
|
|
407
|
-
values1: { values:
|
|
407
|
+
values1: { values: T, formatValue: d.Value.rem },
|
|
408
408
|
values2: { values: [] },
|
|
409
409
|
values3: { values: [] }
|
|
410
410
|
},
|
|
411
411
|
pl: {
|
|
412
412
|
cssNames: ["padding-left"],
|
|
413
|
-
values1: { values:
|
|
413
|
+
values1: { values: T, formatValue: d.Value.rem },
|
|
414
414
|
values2: { values: [] },
|
|
415
415
|
values3: { values: [] }
|
|
416
416
|
},
|
|
417
417
|
b: {
|
|
418
418
|
cssNames: ["border-width"],
|
|
419
|
-
values1: { values:
|
|
419
|
+
values1: { values: M, formatValue: d.Value.px },
|
|
420
420
|
values2: { values: [] },
|
|
421
421
|
values3: { values: [] }
|
|
422
422
|
},
|
|
423
423
|
bx: {
|
|
424
424
|
cssNames: ["border-inline-width"],
|
|
425
|
-
values1: { values:
|
|
425
|
+
values1: { values: T, formatValue: d.Value.px },
|
|
426
426
|
values2: { values: [] },
|
|
427
427
|
values3: { values: [] }
|
|
428
428
|
},
|
|
429
429
|
by: {
|
|
430
430
|
cssNames: ["border-block-width"],
|
|
431
|
-
values1: { values:
|
|
431
|
+
values1: { values: T, formatValue: d.Value.px },
|
|
432
432
|
values2: { values: [] },
|
|
433
433
|
values3: { values: [] }
|
|
434
434
|
},
|
|
435
435
|
bt: {
|
|
436
436
|
cssNames: ["border-top-width"],
|
|
437
|
-
values1: { values:
|
|
437
|
+
values1: { values: T, formatValue: d.Value.px },
|
|
438
438
|
values2: { values: [] },
|
|
439
439
|
values3: { values: [] }
|
|
440
440
|
},
|
|
441
441
|
br: {
|
|
442
442
|
cssNames: ["border-right-width"],
|
|
443
|
-
values1: { values:
|
|
443
|
+
values1: { values: T, formatValue: d.Value.px },
|
|
444
444
|
values2: { values: [] },
|
|
445
445
|
values3: { values: [] }
|
|
446
446
|
},
|
|
447
447
|
bb: {
|
|
448
448
|
cssNames: ["border-bottom-width"],
|
|
449
|
-
values1: { values:
|
|
449
|
+
values1: { values: T, formatValue: d.Value.px },
|
|
450
450
|
values2: { values: [] },
|
|
451
451
|
values3: { values: [] }
|
|
452
452
|
},
|
|
453
453
|
bl: {
|
|
454
454
|
cssNames: ["border-left-width"],
|
|
455
|
-
values1: { values:
|
|
455
|
+
values1: { values: T, formatValue: d.Value.px },
|
|
456
456
|
values2: { values: [] },
|
|
457
457
|
values3: { values: [] }
|
|
458
458
|
},
|
|
459
459
|
borderStyle: {
|
|
460
460
|
cssNames: ["border-style"],
|
|
461
|
-
values1: { values:
|
|
461
|
+
values1: { values: fe },
|
|
462
462
|
values2: { values: [] },
|
|
463
463
|
values3: { values: [] }
|
|
464
464
|
},
|
|
465
465
|
borderRadius: {
|
|
466
466
|
cssNames: ["border-radius"],
|
|
467
|
-
values1: { values:
|
|
467
|
+
values1: { values: M, formatValue: d.Value.rem },
|
|
468
468
|
values2: { values: [] },
|
|
469
469
|
values3: { values: [] }
|
|
470
470
|
},
|
|
471
471
|
borderRadiusTop: {
|
|
472
472
|
cssNames: ["border-top-left-radius", "border-top-right-radius"],
|
|
473
|
-
values1: { values:
|
|
473
|
+
values1: { values: M, formatValue: d.Value.rem },
|
|
474
474
|
values2: { values: [] },
|
|
475
475
|
values3: { values: [] }
|
|
476
476
|
},
|
|
477
477
|
borderRadiusRight: {
|
|
478
478
|
cssNames: ["border-top-right-radius", "border-bottom-right-radius"],
|
|
479
|
-
values1: { values:
|
|
479
|
+
values1: { values: M, formatValue: d.Value.rem },
|
|
480
480
|
values2: { values: [] },
|
|
481
481
|
values3: { values: [] }
|
|
482
482
|
},
|
|
483
483
|
borderRadiusBottom: {
|
|
484
484
|
cssNames: ["border-bottom-left-radius", "border-bottom-right-radius"],
|
|
485
|
-
values1: { values:
|
|
485
|
+
values1: { values: M, formatValue: d.Value.rem },
|
|
486
486
|
values2: { values: [] },
|
|
487
487
|
values3: { values: [] }
|
|
488
488
|
},
|
|
489
489
|
borderRadiusLeft: {
|
|
490
490
|
cssNames: ["border-top-left-radius", "border-bottom-left-radius"],
|
|
491
|
-
values1: { values:
|
|
491
|
+
values1: { values: M, formatValue: d.Value.rem },
|
|
492
492
|
values2: { values: [] },
|
|
493
493
|
values3: { values: [] }
|
|
494
494
|
},
|
|
495
495
|
borderRadiusTopLeft: {
|
|
496
496
|
cssNames: ["border-top-left-radius"],
|
|
497
|
-
values1: { values:
|
|
497
|
+
values1: { values: M, formatValue: d.Value.rem },
|
|
498
498
|
values2: { values: [] },
|
|
499
499
|
values3: { values: [] }
|
|
500
500
|
},
|
|
501
501
|
borderRadiusTopRight: {
|
|
502
502
|
cssNames: ["border-top-right-radius"],
|
|
503
|
-
values1: { values:
|
|
503
|
+
values1: { values: M, formatValue: d.Value.rem },
|
|
504
504
|
values2: { values: [] },
|
|
505
505
|
values3: { values: [] }
|
|
506
506
|
},
|
|
507
507
|
borderRadiusBottomLeft: {
|
|
508
508
|
cssNames: ["border-bottom-left-radius"],
|
|
509
|
-
values1: { values:
|
|
509
|
+
values1: { values: M, formatValue: d.Value.rem },
|
|
510
510
|
values2: { values: [] },
|
|
511
511
|
values3: { values: [] }
|
|
512
512
|
},
|
|
513
513
|
borderRadiusBottomRight: {
|
|
514
514
|
cssNames: ["border-bottom-right-radius"],
|
|
515
|
-
values1: { values:
|
|
515
|
+
values1: { values: M, formatValue: d.Value.rem },
|
|
516
516
|
values2: { values: [] },
|
|
517
517
|
values3: { values: [] }
|
|
518
518
|
},
|
|
@@ -571,19 +571,19 @@ const v = [
|
|
|
571
571
|
},
|
|
572
572
|
overflow: {
|
|
573
573
|
cssNames: ["overflow"],
|
|
574
|
-
values1: { values:
|
|
574
|
+
values1: { values: re },
|
|
575
575
|
values2: { values: [] },
|
|
576
576
|
values3: { values: [] }
|
|
577
577
|
},
|
|
578
578
|
overflowX: {
|
|
579
579
|
cssNames: ["overflow-x"],
|
|
580
|
-
values1: { values:
|
|
580
|
+
values1: { values: re },
|
|
581
581
|
values2: { values: [] },
|
|
582
582
|
values3: { values: [] }
|
|
583
583
|
},
|
|
584
584
|
overflowY: {
|
|
585
585
|
cssNames: ["overflow-y"],
|
|
586
|
-
values1: { values:
|
|
586
|
+
values1: { values: re },
|
|
587
587
|
values2: { values: [] },
|
|
588
588
|
values3: { values: [] }
|
|
589
589
|
},
|
|
@@ -595,7 +595,7 @@ const v = [
|
|
|
595
595
|
},
|
|
596
596
|
fontSize: {
|
|
597
597
|
cssNames: ["font-size"],
|
|
598
|
-
values1: { values:
|
|
598
|
+
values1: { values: M, formatValue: d.Value.px },
|
|
599
599
|
values2: { values: ["inherit"] },
|
|
600
600
|
values3: { values: [] }
|
|
601
601
|
},
|
|
@@ -613,13 +613,13 @@ const v = [
|
|
|
613
613
|
},
|
|
614
614
|
letterSpacing: {
|
|
615
615
|
cssNames: ["letter-spacing"],
|
|
616
|
-
values1: { values:
|
|
616
|
+
values1: { values: M, formatValue: d.Value.px },
|
|
617
617
|
values2: { values: [] },
|
|
618
618
|
values3: { values: [] }
|
|
619
619
|
},
|
|
620
620
|
lineHeight: {
|
|
621
621
|
cssNames: ["line-height"],
|
|
622
|
-
values1: { values:
|
|
622
|
+
values1: { values: M, formatValue: d.Value.px },
|
|
623
623
|
values2: { values: ["font-size"], formatValue: () => "1" },
|
|
624
624
|
values3: { values: [] }
|
|
625
625
|
},
|
|
@@ -708,91 +708,91 @@ const v = [
|
|
|
708
708
|
},
|
|
709
709
|
gap: {
|
|
710
710
|
cssNames: ["gap"],
|
|
711
|
-
values1: { values:
|
|
711
|
+
values1: { values: M, formatValue: d.Value.rem },
|
|
712
712
|
values2: { values: [] },
|
|
713
713
|
values3: { values: [] }
|
|
714
714
|
},
|
|
715
715
|
rowGap: {
|
|
716
716
|
cssNames: ["row-gap"],
|
|
717
|
-
values1: { values:
|
|
717
|
+
values1: { values: M, formatValue: d.Value.rem },
|
|
718
718
|
values2: { values: [] },
|
|
719
719
|
values3: { values: [] }
|
|
720
720
|
},
|
|
721
721
|
columnGap: {
|
|
722
722
|
cssNames: ["column-gap"],
|
|
723
|
-
values1: { values:
|
|
723
|
+
values1: { values: M, formatValue: d.Value.rem },
|
|
724
724
|
values2: { values: [] },
|
|
725
725
|
values3: { values: [] }
|
|
726
726
|
},
|
|
727
727
|
order: {
|
|
728
728
|
cssNames: ["order"],
|
|
729
|
-
values1: { values:
|
|
729
|
+
values1: { values: M },
|
|
730
730
|
values2: { values: [] },
|
|
731
731
|
values3: { values: [] }
|
|
732
732
|
},
|
|
733
733
|
flexGrow: {
|
|
734
734
|
cssNames: ["flex-grow"],
|
|
735
|
-
values1: { values:
|
|
735
|
+
values1: { values: M },
|
|
736
736
|
values2: { values: [] },
|
|
737
737
|
values3: { values: [] }
|
|
738
738
|
},
|
|
739
739
|
flexShrink: {
|
|
740
740
|
cssNames: ["flex-shrink"],
|
|
741
|
-
values1: { values:
|
|
741
|
+
values1: { values: M },
|
|
742
742
|
values2: { values: [] },
|
|
743
743
|
values3: { values: [] }
|
|
744
744
|
},
|
|
745
745
|
alignSelf: {
|
|
746
746
|
cssNames: ["align-self"],
|
|
747
|
-
values1: { values:
|
|
747
|
+
values1: { values: me },
|
|
748
748
|
values2: { values: [] },
|
|
749
749
|
values3: { values: [] }
|
|
750
750
|
},
|
|
751
751
|
justifySelf: {
|
|
752
752
|
cssNames: ["justify-self"],
|
|
753
|
-
values1: { values:
|
|
753
|
+
values1: { values: me },
|
|
754
754
|
values2: { values: [] },
|
|
755
755
|
values3: { values: [] }
|
|
756
756
|
},
|
|
757
757
|
gridColumns: {
|
|
758
758
|
cssNames: ["grid-template-columns"],
|
|
759
|
-
values1: { values:
|
|
759
|
+
values1: { values: M, formatValue: d.Value.gridColumns },
|
|
760
760
|
values2: { values: [] },
|
|
761
761
|
values3: { values: [] }
|
|
762
762
|
},
|
|
763
763
|
colSpan: {
|
|
764
764
|
cssNames: ["grid-column"],
|
|
765
|
-
values1: { values:
|
|
766
|
-
values2: { values: ["full-row"], formatValue:
|
|
765
|
+
values1: { values: M, formatValue: d.Value.gridColumn },
|
|
766
|
+
values2: { values: ["full-row"], formatValue: d.Value.gridColumn },
|
|
767
767
|
values3: { values: [] }
|
|
768
768
|
},
|
|
769
769
|
colStart: {
|
|
770
770
|
cssNames: ["grid-column-start"],
|
|
771
|
-
values1: { values:
|
|
771
|
+
values1: { values: M },
|
|
772
772
|
values2: { values: [] },
|
|
773
773
|
values3: { values: [] }
|
|
774
774
|
},
|
|
775
775
|
colEnd: {
|
|
776
776
|
cssNames: ["grid-column-end"],
|
|
777
|
-
values1: { values:
|
|
777
|
+
values1: { values: M },
|
|
778
778
|
values2: { values: [] },
|
|
779
779
|
values3: { values: [] }
|
|
780
780
|
},
|
|
781
781
|
outline: {
|
|
782
782
|
cssNames: ["outline-width"],
|
|
783
|
-
values1: { values:
|
|
783
|
+
values1: { values: M, formatValue: d.Value.px },
|
|
784
784
|
values2: { values: [] },
|
|
785
785
|
values3: { values: [] }
|
|
786
786
|
},
|
|
787
787
|
outlineStyle: {
|
|
788
788
|
cssNames: ["outline-style"],
|
|
789
|
-
values1: { values:
|
|
789
|
+
values1: { values: fe },
|
|
790
790
|
values2: { values: [] },
|
|
791
791
|
values3: { values: [] }
|
|
792
792
|
},
|
|
793
793
|
outlineOffset: {
|
|
794
794
|
cssNames: ["outline-offset"],
|
|
795
|
-
values1: { values:
|
|
795
|
+
values1: { values: M, formatValue: d.Value.px },
|
|
796
796
|
values2: { values: [] },
|
|
797
797
|
values3: { values: [] }
|
|
798
798
|
},
|
|
@@ -806,7 +806,7 @@ const v = [
|
|
|
806
806
|
cssNames: ["transition-duration"],
|
|
807
807
|
values1: {
|
|
808
808
|
values: [50, 100, 150, 200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700, 750, 800, 850, 900, 950, 1e3],
|
|
809
|
-
formatValue:
|
|
809
|
+
formatValue: d.Value.ms
|
|
810
810
|
},
|
|
811
811
|
values2: { values: [] },
|
|
812
812
|
values3: { values: [] }
|
|
@@ -819,7 +819,7 @@ const v = [
|
|
|
819
819
|
},
|
|
820
820
|
appearance: {
|
|
821
821
|
cssNames: ["appearance"],
|
|
822
|
-
values1: { values: ["none"] },
|
|
822
|
+
values1: { values: ["none", "auto", "menulist-button", "textfield", "button", "checkbox"] },
|
|
823
823
|
values2: { values: [] },
|
|
824
824
|
values3: { values: [] }
|
|
825
825
|
},
|
|
@@ -843,188 +843,224 @@ const v = [
|
|
|
843
843
|
},
|
|
844
844
|
rotate: {
|
|
845
845
|
cssNames: ["rotate"],
|
|
846
|
-
values1: { values: [0, 90, 180, 270, -90, -180, -270], formatValue:
|
|
846
|
+
values1: { values: [0, 90, 180, 270, -90, -180, -270], formatValue: d.Value.rotate },
|
|
847
847
|
values2: { values: [] },
|
|
848
848
|
values3: { values: [] }
|
|
849
849
|
},
|
|
850
850
|
flip: {
|
|
851
851
|
cssNames: ["scale"],
|
|
852
|
-
values1: { values: ["xAxis", "yAxis"], formatValue:
|
|
852
|
+
values1: { values: ["xAxis", "yAxis"], formatValue: d.Value.flip },
|
|
853
|
+
values2: { values: [] },
|
|
854
|
+
values3: { values: [] }
|
|
855
|
+
},
|
|
856
|
+
visibility: {
|
|
857
|
+
cssNames: ["visibility"],
|
|
858
|
+
values1: { values: ["visible", "hidden", "collapse"] },
|
|
859
|
+
values2: { values: [] },
|
|
860
|
+
values3: { values: [] }
|
|
861
|
+
},
|
|
862
|
+
resize: {
|
|
863
|
+
cssNames: ["resize"],
|
|
864
|
+
values1: { values: ["none", "both", "horizontal", "vertical", "block", "inline"] },
|
|
853
865
|
values2: { values: [] },
|
|
854
866
|
values3: { values: [] }
|
|
855
867
|
}
|
|
856
|
-
},
|
|
857
|
-
shadow: { cssNames: ["box-shadow"], formatValue:
|
|
858
|
-
background: { cssNames: ["background"], formatValue:
|
|
859
|
-
backgroundImage: { cssNames: ["background-image"], formatValue:
|
|
860
|
-
color: { cssNames: ["color"], formatValue:
|
|
861
|
-
bgColor: { cssNames: ["background-color"], formatValue:
|
|
862
|
-
borderColor: { cssNames: ["border-color"], formatValue:
|
|
863
|
-
outlineColor: { cssNames: ["outline-color"], formatValue:
|
|
864
|
-
},
|
|
868
|
+
}, be = {
|
|
869
|
+
shadow: { cssNames: ["box-shadow"], formatValue: d.Value.variables("shadow") },
|
|
870
|
+
background: { cssNames: ["background"], formatValue: d.Value.variables("background") },
|
|
871
|
+
backgroundImage: { cssNames: ["background-image"], formatValue: d.Value.variables("backgroundImage") },
|
|
872
|
+
color: { cssNames: ["color"], formatValue: d.Value.variables("color") },
|
|
873
|
+
bgColor: { cssNames: ["background-color"], formatValue: d.Value.variables("color") },
|
|
874
|
+
borderColor: { cssNames: ["border-color"], formatValue: d.Value.variables("color") },
|
|
875
|
+
outlineColor: { cssNames: ["outline-color"], formatValue: d.Value.variables("color") }
|
|
876
|
+
}, pe = {
|
|
865
877
|
fill: {
|
|
866
878
|
cssNames: ["fill"],
|
|
867
|
-
formatValue:
|
|
868
|
-
formatSelector:
|
|
879
|
+
formatValue: d.Value.svgVariables("color"),
|
|
880
|
+
formatSelector: d.ClassName.svg
|
|
869
881
|
},
|
|
870
882
|
stroke: {
|
|
871
883
|
cssNames: ["stroke"],
|
|
872
|
-
formatValue:
|
|
873
|
-
formatSelector:
|
|
884
|
+
formatValue: d.Value.svgVariables("color"),
|
|
885
|
+
formatSelector: d.ClassName.svg
|
|
874
886
|
}
|
|
875
|
-
},
|
|
876
|
-
"
|
|
877
|
-
"
|
|
878
|
-
"
|
|
879
|
-
"
|
|
880
|
-
"
|
|
881
|
-
"
|
|
882
|
-
"
|
|
883
|
-
"
|
|
884
|
-
"
|
|
885
|
-
"
|
|
886
|
-
|
|
887
|
+
}, Ee = ["disabledGroup", "hoverGroup", "focusGroup", "activeGroup"], le = [
|
|
888
|
+
"hover",
|
|
889
|
+
"focus",
|
|
890
|
+
"hasFocus",
|
|
891
|
+
"active",
|
|
892
|
+
"checked",
|
|
893
|
+
"hasChecked",
|
|
894
|
+
"indeterminate",
|
|
895
|
+
"valid",
|
|
896
|
+
"hasValid",
|
|
897
|
+
"invalid",
|
|
898
|
+
"hasInvalid",
|
|
899
|
+
"required",
|
|
900
|
+
"optional",
|
|
901
|
+
"disabled",
|
|
902
|
+
"hasDisabled"
|
|
903
|
+
], te = ["sm", "md", "lg", "xl", "xxl"], $e = {
|
|
887
904
|
sm: 640,
|
|
888
905
|
md: 768,
|
|
889
906
|
lg: 1024,
|
|
890
907
|
xl: 1280,
|
|
891
908
|
xxl: 1536
|
|
892
909
|
};
|
|
893
|
-
function
|
|
894
|
-
const
|
|
895
|
-
Object.keys(
|
|
896
|
-
|
|
897
|
-
}), Object.keys(
|
|
898
|
-
|
|
910
|
+
function ye() {
|
|
911
|
+
const u = { ...Ce };
|
|
912
|
+
Object.keys(be).forEach((t) => {
|
|
913
|
+
u[t] = be[t], u[t].isThemeStyle = !0;
|
|
914
|
+
}), Object.keys(pe).forEach((t) => {
|
|
915
|
+
u[t] = pe[t], u[t].isThemeStyle = !0;
|
|
899
916
|
});
|
|
900
|
-
let
|
|
901
|
-
return
|
|
902
|
-
|
|
903
|
-
|
|
917
|
+
let o = Object.keys(u);
|
|
918
|
+
return le.forEach((t) => {
|
|
919
|
+
o.forEach((m) => {
|
|
920
|
+
u[`${m}${t}`] = { ...u[m], pseudoSuffix: t };
|
|
904
921
|
});
|
|
905
|
-
}),
|
|
906
|
-
|
|
907
|
-
|
|
922
|
+
}), o = Object.keys(u), te.forEach((t) => {
|
|
923
|
+
o.forEach((m) => {
|
|
924
|
+
u[`${t}${m}`] = { ...u[m], breakpoint: t };
|
|
908
925
|
});
|
|
909
|
-
}),
|
|
926
|
+
}), u;
|
|
910
927
|
}
|
|
911
|
-
let
|
|
912
|
-
function
|
|
913
|
-
|
|
928
|
+
let U = ye();
|
|
929
|
+
function Te() {
|
|
930
|
+
U = ye();
|
|
914
931
|
}
|
|
915
|
-
function
|
|
916
|
-
const
|
|
917
|
-
([
|
|
918
|
-
).map(([
|
|
919
|
-
return
|
|
920
|
-
|
|
921
|
-
...
|
|
922
|
-
customPseudoSuffix: t +
|
|
932
|
+
function Se(u, o, t) {
|
|
933
|
+
const m = Object.entries(U).filter(
|
|
934
|
+
([e, O]) => O.pseudoSuffix === u && !O.customPseudoSuffix && !(`${e}${o}` in U)
|
|
935
|
+
).map(([e]) => e);
|
|
936
|
+
return m.forEach((e) => {
|
|
937
|
+
U[`${e}${o}`] = {
|
|
938
|
+
...U[e],
|
|
939
|
+
customPseudoSuffix: t + o
|
|
923
940
|
};
|
|
924
|
-
}),
|
|
941
|
+
}), m.map((e) => `${e}${o}`);
|
|
925
942
|
}
|
|
926
|
-
class
|
|
943
|
+
class ke {
|
|
927
944
|
constructor() {
|
|
928
945
|
this._index = 0, this._cache = {};
|
|
929
946
|
}
|
|
930
|
-
getIdentity(
|
|
931
|
-
return this._cache[
|
|
947
|
+
getIdentity(o) {
|
|
948
|
+
return this._cache[o] || (this._cache[o] = this.getByIndex(this._index++)), this._cache[o];
|
|
932
949
|
}
|
|
933
|
-
getByIndex(
|
|
934
|
-
const { first: t, next:
|
|
935
|
-
if (
|
|
936
|
-
return t[
|
|
937
|
-
const
|
|
938
|
-
return this.getByIndex(
|
|
950
|
+
getByIndex(o) {
|
|
951
|
+
const { first: t, next: m } = Pe, e = o - t.length;
|
|
952
|
+
if (e < 0)
|
|
953
|
+
return t[o];
|
|
954
|
+
const O = Math.floor(e / m.length), q = e - O * m.length;
|
|
955
|
+
return this.getByIndex(O) + m[q];
|
|
939
956
|
}
|
|
940
957
|
}
|
|
941
|
-
const
|
|
958
|
+
const Pe = {
|
|
942
959
|
first: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
|
|
943
960
|
next: "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
|
|
944
961
|
};
|
|
945
|
-
var
|
|
946
|
-
((
|
|
947
|
-
|
|
948
|
-
const
|
|
962
|
+
var ue;
|
|
963
|
+
((u) => {
|
|
964
|
+
u.boxClassName = "_box", u.svgClassName = "_svg", u.cronoStylesElementId = "crono-styles";
|
|
965
|
+
const o = `:root{--borderColor: black;--outlineColor: black;--lineHeight: 1.2;--fontSize: 14px;--transitionTime: 0.25s;--svgTransitionTime: 0.3s;#crono-box {position: absolute;top: 0;left: 0;height: 0;}}
|
|
949
966
|
html{font-size: 16px;font-family: Arial, sans-serif;}
|
|
950
967
|
body{margin: 0;line-height: var(--lineHeight);font-size: var(--fontSize);}
|
|
951
968
|
a,ul{all: unset;}
|
|
952
|
-
.${
|
|
953
|
-
.${
|
|
954
|
-
`, t = new
|
|
955
|
-
let
|
|
956
|
-
|
|
957
|
-
function
|
|
958
|
-
if (
|
|
959
|
-
return
|
|
960
|
-
if (
|
|
961
|
-
return
|
|
969
|
+
.${u.boxClassName}{display: block;border: 0 solid var(--borderColor);outline: 0px solid var(--outlineColor);margin: 0;padding: 0;background-color: initial;transition: all var(--transitionTime);box-sizing: border-box;font-family: inherit;font-size: inherit;}
|
|
970
|
+
.${u.svgClassName}{display: block;border: 0 solid var(--borderColor);outline: 0px solid var(--outlineColor);margin: 0;padding: 0;transition: all var(--svgTransitionTime);}.${u.svgClassName} path,.${u.svgClassName} circle,.${u.svgClassName} rect,.${u.svgClassName} line {transition: all var(--svgTransitionTime);}
|
|
971
|
+
`, t = new ke();
|
|
972
|
+
let m = !0, e = {};
|
|
973
|
+
H();
|
|
974
|
+
function O(h, b, x) {
|
|
975
|
+
if (h in U)
|
|
976
|
+
return G(h, b, x);
|
|
977
|
+
if (Ee.includes(h))
|
|
978
|
+
return h + b;
|
|
962
979
|
}
|
|
963
|
-
|
|
964
|
-
function
|
|
965
|
-
if (
|
|
966
|
-
let
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
}),
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
}),
|
|
980
|
+
u.get = O;
|
|
981
|
+
function q() {
|
|
982
|
+
if (m) {
|
|
983
|
+
let h = j([o]);
|
|
984
|
+
le.forEach((x) => {
|
|
985
|
+
h = j(h, x);
|
|
986
|
+
}), te.forEach((x) => {
|
|
987
|
+
h.push(`@media(min-width: ${$e[x]}px){`), h = j(h, void 0, x), le.forEach((z) => {
|
|
988
|
+
h = j(h, z, x);
|
|
989
|
+
}), h.push("}");
|
|
973
990
|
});
|
|
974
|
-
const
|
|
975
|
-
|
|
991
|
+
const b = p();
|
|
992
|
+
b.innerHTML = h.join(""), m = !1;
|
|
976
993
|
}
|
|
977
994
|
}
|
|
978
|
-
|
|
979
|
-
function
|
|
980
|
-
|
|
981
|
-
(
|
|
995
|
+
u.flush = q;
|
|
996
|
+
function H() {
|
|
997
|
+
Te(), e = Object.keys(U).reduce(
|
|
998
|
+
(b, x) => (b[x] = /* @__PURE__ */ new Set(), b),
|
|
982
999
|
{}
|
|
983
1000
|
);
|
|
984
1001
|
}
|
|
985
|
-
|
|
986
|
-
function
|
|
987
|
-
|
|
988
|
-
|
|
1002
|
+
u.clear = H;
|
|
1003
|
+
function L(h, b, x) {
|
|
1004
|
+
Se(h, b, x).forEach((k) => {
|
|
1005
|
+
e[k] = /* @__PURE__ */ new Set();
|
|
989
1006
|
});
|
|
990
1007
|
}
|
|
991
|
-
|
|
992
|
-
function
|
|
993
|
-
const
|
|
994
|
-
|
|
995
|
-
const
|
|
996
|
-
return process.env.NODE_ENV === "test" ?
|
|
1008
|
+
u.addCustomPseudoClass = L;
|
|
1009
|
+
function G(h, b, x) {
|
|
1010
|
+
const z = (x ?? "") + h;
|
|
1011
|
+
e[z].has(b) || (m = !0, e[z].add(b));
|
|
1012
|
+
const k = `${z}${b}`;
|
|
1013
|
+
return process.env.NODE_ENV === "test" ? k : t.getIdentity(k);
|
|
997
1014
|
}
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1015
|
+
const y = {
|
|
1016
|
+
hover: "hover",
|
|
1017
|
+
focus: "focus-within",
|
|
1018
|
+
hasFocus: "has(:focus-within)",
|
|
1019
|
+
active: "active",
|
|
1020
|
+
checked: "checked",
|
|
1021
|
+
hasChecked: "has(:checked)",
|
|
1022
|
+
indeterminate: "indeterminate",
|
|
1023
|
+
valid: "user-valid",
|
|
1024
|
+
hasValid: "has(:valid)",
|
|
1025
|
+
invalid: "user-invalid",
|
|
1026
|
+
hasInvalid: "has(:user-invalid)",
|
|
1027
|
+
required: "required",
|
|
1028
|
+
optional: "optional",
|
|
1029
|
+
disabled: "disabled",
|
|
1030
|
+
hasDisabled: "has(:disabled)"
|
|
1031
|
+
};
|
|
1032
|
+
function j(h, b, x) {
|
|
1033
|
+
return Object.entries(e).filter(
|
|
1034
|
+
([k, I]) => {
|
|
1035
|
+
var D, A;
|
|
1036
|
+
return ((D = U[k]) == null ? void 0 : D.pseudoSuffix) === b && ((A = U[k]) == null ? void 0 : A.breakpoint) === x && I.size > 0;
|
|
1003
1037
|
}
|
|
1004
|
-
).reduce((
|
|
1005
|
-
var
|
|
1006
|
-
const
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1038
|
+
).reduce((k, [I, D]) => (D.forEach((A) => {
|
|
1039
|
+
var oe;
|
|
1040
|
+
const W = U[I], Y = C(W, A), J = `.${G(I, A)}`, X = z(
|
|
1041
|
+
J,
|
|
1042
|
+
W,
|
|
1043
|
+
Y,
|
|
1044
|
+
b ? y[b] : void 0
|
|
1045
|
+
), P = ((oe = Y.formatValue) == null ? void 0 : oe.call(Y, I, A)) ?? A, ae = U[I].cssNames.map((ne) => `${ne}:${P};`).join("");
|
|
1046
|
+
k.push(`${X.join(",")}{${ae}}`);
|
|
1047
|
+
}), k), h);
|
|
1048
|
+
function z(k, I, D, A) {
|
|
1049
|
+
let W = k;
|
|
1050
|
+
return A && (W = I.customPseudoSuffix ? `.${I.customPseudoSuffix}:${A} ${k}` : `${k}:${A}`), D.formatSelector ? D.formatSelector(W) : [W];
|
|
1015
1051
|
}
|
|
1016
1052
|
}
|
|
1017
|
-
function
|
|
1018
|
-
return
|
|
1053
|
+
function C(h, b) {
|
|
1054
|
+
return h.isThemeStyle ? h : h.values1.values.includes(b) ? h.values1 : h.values2.values.includes(b) ? h.values2 : h.values3;
|
|
1019
1055
|
}
|
|
1020
|
-
function
|
|
1021
|
-
const
|
|
1022
|
-
let
|
|
1023
|
-
return
|
|
1056
|
+
function p() {
|
|
1057
|
+
const b = typeof window < "u" && typeof window.document < "u" ? window.document : global.document;
|
|
1058
|
+
let x = b.getElementById(u.cronoStylesElementId);
|
|
1059
|
+
return x || (x = b.createElement("style"), x.setAttribute("id", u.cronoStylesElementId), x.setAttribute("type", "text/css"), b.head.insertBefore(x, b.head.firstChild)), x;
|
|
1024
1060
|
}
|
|
1025
|
-
|
|
1026
|
-
})(
|
|
1027
|
-
const
|
|
1061
|
+
u.getElement = p;
|
|
1062
|
+
})(ue || (ue = {}));
|
|
1063
|
+
const se = ue, ze = {
|
|
1028
1064
|
button: {
|
|
1029
1065
|
styles: {
|
|
1030
1066
|
display: "inline-block",
|
|
@@ -1065,41 +1101,30 @@ const I = D, H = {
|
|
|
1065
1101
|
borderRadius: 1
|
|
1066
1102
|
}
|
|
1067
1103
|
}
|
|
1068
|
-
}, ie = {
|
|
1069
|
-
Hover: "hover",
|
|
1070
|
-
Focus: "focus",
|
|
1071
|
-
Active: "active",
|
|
1072
|
-
Checked: "checked",
|
|
1073
|
-
Indeterminate: "indeterminate",
|
|
1074
|
-
Valid: "valid",
|
|
1075
|
-
Invalid: "invalid",
|
|
1076
|
-
Required: "required",
|
|
1077
|
-
Optional: "optional",
|
|
1078
|
-
Disabled: "disabled"
|
|
1079
1104
|
};
|
|
1080
|
-
var
|
|
1081
|
-
((
|
|
1082
|
-
|
|
1083
|
-
function
|
|
1084
|
-
|
|
1105
|
+
var ce;
|
|
1106
|
+
((u) => {
|
|
1107
|
+
u.Styles = {};
|
|
1108
|
+
function o(y) {
|
|
1109
|
+
u.Styles = e(ze), m(y);
|
|
1085
1110
|
}
|
|
1086
|
-
|
|
1087
|
-
function t(
|
|
1088
|
-
const { colors:
|
|
1089
|
-
|
|
1090
|
-
const
|
|
1091
|
-
`),
|
|
1092
|
-
`),
|
|
1093
|
-
`),
|
|
1094
|
-
`),
|
|
1095
|
-
|
|
1096
|
-
const
|
|
1111
|
+
u.setup = o;
|
|
1112
|
+
function t(y, j) {
|
|
1113
|
+
const { colors: C = {}, shadows: p = {}, backgrounds: h = {}, backgroundImages: b = {} } = y;
|
|
1114
|
+
C.none = "none", p.none = "none", h.none = "none", b.none = "none";
|
|
1115
|
+
const x = Object.entries(C).map(([P, K]) => `--color${P}: ${K};`).join(`
|
|
1116
|
+
`), z = Object.entries(p).map(([P, K]) => `--shadow${P}: ${K};`).join(`
|
|
1117
|
+
`), k = Object.entries(h).map(([P, K]) => `--background${P}: ${K};`).join(`
|
|
1118
|
+
`), I = Object.entries(b).map(([P, K]) => `--backgroundImage${P}: ${K};`).join(`
|
|
1119
|
+
`), D = [":root {"];
|
|
1120
|
+
x && D.push(` ${x}`), z && D.push(` ${z}`), k && D.push(` ${k}`), I && D.push(` ${I}`), D.push("}");
|
|
1121
|
+
const A = Object.keys(C).map((P) => `'${P}'`).join(" | "), W = Object.keys(h).map((P) => `'${P}'`).join(" | "), Y = Object.keys(b).map((P) => `'${P}'`).join(" | "), J = Object.keys(p).map((P) => `'${P}'`).join(" | "), X = `import '@cronocode/react-box';
|
|
1097
1122
|
|
|
1098
|
-
declare module '${(
|
|
1099
|
-
type ColorType = ${
|
|
1100
|
-
type BackgroundType = ${
|
|
1101
|
-
type BackgroundImageType = ${
|
|
1102
|
-
type ShadowType = ${
|
|
1123
|
+
declare module '${(j == null ? void 0 : j.namespacePath) ?? "@cronocode/react-box/core/types"}' {
|
|
1124
|
+
type ColorType = ${A};
|
|
1125
|
+
type BackgroundType = ${W};
|
|
1126
|
+
type BackgroundImageType = ${Y};
|
|
1127
|
+
type ShadowType = ${J};
|
|
1103
1128
|
|
|
1104
1129
|
namespace Augmented {
|
|
1105
1130
|
interface BoxProps {
|
|
@@ -1120,129 +1145,970 @@ var _;
|
|
|
1120
1145
|
}
|
|
1121
1146
|
`;
|
|
1122
1147
|
return {
|
|
1123
|
-
variables:
|
|
1148
|
+
variables: D.join(`
|
|
1124
1149
|
`),
|
|
1125
|
-
boxDts:
|
|
1150
|
+
boxDts: X
|
|
1126
1151
|
};
|
|
1127
1152
|
}
|
|
1128
|
-
|
|
1129
|
-
function
|
|
1130
|
-
const
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1153
|
+
u.setupAugmentedProps = t;
|
|
1154
|
+
function m(y) {
|
|
1155
|
+
const j = e(y);
|
|
1156
|
+
if (j.components)
|
|
1157
|
+
return Object.entries(j.components).forEach(([C, p]) => {
|
|
1158
|
+
var b;
|
|
1159
|
+
const h = (b = u.Styles.components) == null ? void 0 : b[C];
|
|
1160
|
+
h ? u.Styles.components[C].styles = { ...h.styles, ...p.styles } : u.Styles.components[C] = p;
|
|
1161
|
+
}), j;
|
|
1135
1162
|
}
|
|
1136
|
-
function
|
|
1137
|
-
return
|
|
1163
|
+
function e(y) {
|
|
1164
|
+
return O(y), q(y), L(y), y;
|
|
1138
1165
|
}
|
|
1139
|
-
function
|
|
1140
|
-
|
|
1166
|
+
function O(y) {
|
|
1167
|
+
const { components: j, ...C } = y, p = Object.entries(C);
|
|
1168
|
+
p.length && !y.components && (y.components = {});
|
|
1169
|
+
for (const h of p) {
|
|
1170
|
+
const [b, x] = h;
|
|
1171
|
+
y.components[b] = x, delete y[b];
|
|
1172
|
+
}
|
|
1173
|
+
}
|
|
1174
|
+
function q(y) {
|
|
1175
|
+
if (!y.components)
|
|
1141
1176
|
return;
|
|
1142
|
-
const
|
|
1143
|
-
for (const
|
|
1144
|
-
const
|
|
1145
|
-
delete
|
|
1146
|
-
for (const
|
|
1147
|
-
const [
|
|
1148
|
-
|
|
1177
|
+
const j = Object.keys(y.components);
|
|
1178
|
+
for (const C of j) {
|
|
1179
|
+
const p = y.components[C], h = H(C, p);
|
|
1180
|
+
delete p.children;
|
|
1181
|
+
for (const b of h) {
|
|
1182
|
+
const [x, z] = b;
|
|
1183
|
+
y.components[x] = z;
|
|
1149
1184
|
}
|
|
1150
1185
|
}
|
|
1151
1186
|
}
|
|
1152
|
-
function
|
|
1153
|
-
if (!
|
|
1187
|
+
function H(y, j) {
|
|
1188
|
+
if (!j.children)
|
|
1154
1189
|
return [];
|
|
1155
|
-
const
|
|
1156
|
-
for (const
|
|
1157
|
-
const
|
|
1158
|
-
|
|
1190
|
+
const C = Object.keys(j.children), p = [];
|
|
1191
|
+
for (const h of C) {
|
|
1192
|
+
const b = `${y}.${h}`, x = j.children[h], z = H(b, x);
|
|
1193
|
+
p.push(...z), delete x.children, p.push([b, x]);
|
|
1159
1194
|
}
|
|
1160
|
-
return
|
|
1195
|
+
return p;
|
|
1161
1196
|
}
|
|
1162
|
-
function
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1197
|
+
function L(y) {
|
|
1198
|
+
if (!y.components)
|
|
1199
|
+
return;
|
|
1200
|
+
const j = Object.values(y.components);
|
|
1201
|
+
for (const C of j)
|
|
1202
|
+
G(C.styles), te.forEach((p) => {
|
|
1203
|
+
if (p in C.styles) {
|
|
1204
|
+
const h = C.styles[p];
|
|
1205
|
+
G(h);
|
|
1170
1206
|
}
|
|
1171
|
-
}),
|
|
1172
|
-
|
|
1173
|
-
if (
|
|
1174
|
-
const
|
|
1175
|
-
|
|
1207
|
+
}), C.themes && Object.values(C.themes).forEach((p) => {
|
|
1208
|
+
G(p), te.forEach((h) => {
|
|
1209
|
+
if (h in p) {
|
|
1210
|
+
const b = p[h];
|
|
1211
|
+
G(b);
|
|
1176
1212
|
}
|
|
1177
1213
|
});
|
|
1178
1214
|
});
|
|
1179
1215
|
}
|
|
1180
|
-
function
|
|
1181
|
-
|
|
1182
|
-
if (
|
|
1183
|
-
const
|
|
1184
|
-
Object.entries(
|
|
1185
|
-
|
|
1186
|
-
}), delete
|
|
1216
|
+
function G(y) {
|
|
1217
|
+
le.forEach((j) => {
|
|
1218
|
+
if (j in y) {
|
|
1219
|
+
const C = y[j];
|
|
1220
|
+
Object.entries(C).map(([p, h]) => {
|
|
1221
|
+
y[`${p}${j}`] = h;
|
|
1222
|
+
}), delete y[j];
|
|
1187
1223
|
}
|
|
1188
1224
|
});
|
|
1189
1225
|
}
|
|
1190
|
-
})(
|
|
1191
|
-
const
|
|
1192
|
-
function
|
|
1193
|
-
const { clean:
|
|
1194
|
-
return
|
|
1195
|
-
var
|
|
1196
|
-
if (u)
|
|
1197
|
-
return;
|
|
1198
|
-
let o = M.Styles[n] ?? ((m = M.Styles.components) == null ? void 0 : m[n]);
|
|
1226
|
+
})(ce || (ce = {}));
|
|
1227
|
+
const qe = ce;
|
|
1228
|
+
function De(u) {
|
|
1229
|
+
const { clean: o, theme: t, component: m } = u;
|
|
1230
|
+
return xe(() => {
|
|
1231
|
+
var O, q;
|
|
1199
1232
|
if (o)
|
|
1200
|
-
return
|
|
1201
|
-
|
|
1233
|
+
return;
|
|
1234
|
+
let e = (O = qe.Styles.components) == null ? void 0 : O[m];
|
|
1235
|
+
if (e)
|
|
1236
|
+
return t ? { ...e.styles, ...(q = e.themes) == null ? void 0 : q[t] } : e.styles;
|
|
1237
|
+
}, [m, o, t]);
|
|
1202
1238
|
}
|
|
1203
|
-
const
|
|
1204
|
-
function
|
|
1205
|
-
const t =
|
|
1206
|
-
return
|
|
1207
|
-
const
|
|
1208
|
-
return
|
|
1209
|
-
|
|
1210
|
-
}),
|
|
1211
|
-
if (
|
|
1212
|
-
const
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
}), delete
|
|
1239
|
+
const Ae = typeof window < "u" && typeof window.document < "u", Ie = Ae ? je : Me;
|
|
1240
|
+
function Ge(u, o) {
|
|
1241
|
+
const t = De(u);
|
|
1242
|
+
return Ie(se.flush, [u]), xe(() => {
|
|
1243
|
+
const m = [o ? se.svgClassName : se.boxClassName], e = t ? { ...t, ...u } : { ...u };
|
|
1244
|
+
return ge(e), Object.entries(e).forEach(([O, q]) => {
|
|
1245
|
+
m.push(se.get(O, q));
|
|
1246
|
+
}), te.forEach((O) => {
|
|
1247
|
+
if (O in e) {
|
|
1248
|
+
const q = e[O];
|
|
1249
|
+
ge(q), Object.entries(q).forEach(([H, L]) => {
|
|
1250
|
+
m.push(se.get(H, L, O));
|
|
1251
|
+
}), delete e[O];
|
|
1216
1252
|
}
|
|
1217
|
-
}),
|
|
1218
|
-
}, [
|
|
1253
|
+
}), m;
|
|
1254
|
+
}, [u, t]);
|
|
1219
1255
|
}
|
|
1220
|
-
function
|
|
1221
|
-
|
|
1256
|
+
function ge(u) {
|
|
1257
|
+
R(u, "hover", "hover"), R(u, "focus", "focus"), R(u, "hasFocus", "hasFocus"), R(u, "active", "active"), R(u, "disabled", "disabled"), R(u, "hasDisabled", "hasDisabled"), R(u, "checked", "checked"), R(u, "hasChecked", "hasChecked"), R(u, "valid", "valid"), R(u, "hasValid", "hasValid"), R(u, "invalid", "invalid"), R(u, "hasInvalid", "hasInvalid"), ie(u, "hoverGroup", "hover"), ie(u, "focusGroup", "focus"), ie(u, "activeGroup", "active"), ie(u, "disabledGroup", "disabled");
|
|
1222
1258
|
}
|
|
1223
|
-
function
|
|
1224
|
-
|
|
1259
|
+
function R(u, o, t) {
|
|
1260
|
+
o in u && Ve(u, o, t, u[o]);
|
|
1225
1261
|
}
|
|
1226
|
-
function
|
|
1227
|
-
|
|
1228
|
-
|
|
1262
|
+
function ie(u, o, t) {
|
|
1263
|
+
o in u && we.isObject(u[o]) && Object.entries(u[o]).forEach(([m, e]) => {
|
|
1264
|
+
se.addCustomPseudoClass(t, m, o), Ve(u, o, t + m, e);
|
|
1229
1265
|
});
|
|
1230
1266
|
}
|
|
1231
|
-
function
|
|
1232
|
-
Array.isArray(
|
|
1233
|
-
|
|
1234
|
-
}),
|
|
1235
|
-
|
|
1236
|
-
}), delete
|
|
1267
|
+
function Ve(u, o, t, m) {
|
|
1268
|
+
Array.isArray(m) ? (Object.entries(m[1]).forEach(([e, O]) => {
|
|
1269
|
+
u[`${e}${t}`] = O;
|
|
1270
|
+
}), u[o] = m[0]) : we.isObject(m) && (Object.entries(m).forEach(([e, O]) => {
|
|
1271
|
+
u[`${e}${t}`] = O;
|
|
1272
|
+
}), delete u[o]);
|
|
1237
1273
|
}
|
|
1238
|
-
function
|
|
1239
|
-
return
|
|
1240
|
-
|
|
1241
|
-
}),
|
|
1274
|
+
function Be(...u) {
|
|
1275
|
+
return u.reduce((o, t) => t ? typeof t == "string" ? (o.push(t), o) : Array.isArray(t) ? (o.push(...Be(...t)), o) : (Object.entries(t).forEach(([m, e]) => {
|
|
1276
|
+
e && o.push(m);
|
|
1277
|
+
}), o) : o, []);
|
|
1242
1278
|
}
|
|
1279
|
+
/*!
|
|
1280
|
+
* chai
|
|
1281
|
+
* http://chaijs.com
|
|
1282
|
+
* Copyright(c) 2011-2014 Jake Luer <jake@alogicalparadox.com>
|
|
1283
|
+
* MIT Licensed
|
|
1284
|
+
*/
|
|
1285
|
+
var Fe = function(u, o) {
|
|
1286
|
+
var t = u.Assertion, m = u.AssertionError, e = o.flag;
|
|
1287
|
+
[
|
|
1288
|
+
"to",
|
|
1289
|
+
"be",
|
|
1290
|
+
"been",
|
|
1291
|
+
"is",
|
|
1292
|
+
"and",
|
|
1293
|
+
"has",
|
|
1294
|
+
"have",
|
|
1295
|
+
"with",
|
|
1296
|
+
"that",
|
|
1297
|
+
"which",
|
|
1298
|
+
"at",
|
|
1299
|
+
"of",
|
|
1300
|
+
"same",
|
|
1301
|
+
"but",
|
|
1302
|
+
"does",
|
|
1303
|
+
"still",
|
|
1304
|
+
"also"
|
|
1305
|
+
].forEach(function(s) {
|
|
1306
|
+
t.addProperty(s);
|
|
1307
|
+
}), t.addProperty("not", function() {
|
|
1308
|
+
e(this, "negate", !0);
|
|
1309
|
+
}), t.addProperty("deep", function() {
|
|
1310
|
+
e(this, "deep", !0);
|
|
1311
|
+
}), t.addProperty("nested", function() {
|
|
1312
|
+
e(this, "nested", !0);
|
|
1313
|
+
}), t.addProperty("own", function() {
|
|
1314
|
+
e(this, "own", !0);
|
|
1315
|
+
}), t.addProperty("ordered", function() {
|
|
1316
|
+
e(this, "ordered", !0);
|
|
1317
|
+
}), t.addProperty("any", function() {
|
|
1318
|
+
e(this, "any", !0), e(this, "all", !1);
|
|
1319
|
+
}), t.addProperty("all", function() {
|
|
1320
|
+
e(this, "all", !0), e(this, "any", !1);
|
|
1321
|
+
});
|
|
1322
|
+
function O(s, a) {
|
|
1323
|
+
a && e(this, "message", a), s = s.toLowerCase();
|
|
1324
|
+
var l = e(this, "object"), n = ~["a", "e", "i", "o", "u"].indexOf(s.charAt(0)) ? "an " : "a ";
|
|
1325
|
+
this.assert(
|
|
1326
|
+
s === o.type(l).toLowerCase(),
|
|
1327
|
+
"expected #{this} to be " + n + s,
|
|
1328
|
+
"expected #{this} not to be " + n + s
|
|
1329
|
+
);
|
|
1330
|
+
}
|
|
1331
|
+
t.addChainableMethod("an", O), t.addChainableMethod("a", O);
|
|
1332
|
+
function q(s, a) {
|
|
1333
|
+
return o.isNaN(s) && o.isNaN(a) || s === a;
|
|
1334
|
+
}
|
|
1335
|
+
function H() {
|
|
1336
|
+
e(this, "contains", !0);
|
|
1337
|
+
}
|
|
1338
|
+
function L(s, a) {
|
|
1339
|
+
a && e(this, "message", a);
|
|
1340
|
+
var l = e(this, "object"), n = o.type(l).toLowerCase(), c = e(this, "message"), v = e(this, "negate"), r = e(this, "ssfi"), i = e(this, "deep"), f = i ? "deep " : "", g = i ? e(this, "eql") : q;
|
|
1341
|
+
c = c ? c + ": " : "";
|
|
1342
|
+
var w = !1;
|
|
1343
|
+
switch (n) {
|
|
1344
|
+
case "string":
|
|
1345
|
+
w = l.indexOf(s) !== -1;
|
|
1346
|
+
break;
|
|
1347
|
+
case "weakset":
|
|
1348
|
+
if (i)
|
|
1349
|
+
throw new m(
|
|
1350
|
+
c + "unable to use .deep.include with WeakSet",
|
|
1351
|
+
void 0,
|
|
1352
|
+
r
|
|
1353
|
+
);
|
|
1354
|
+
w = l.has(s);
|
|
1355
|
+
break;
|
|
1356
|
+
case "map":
|
|
1357
|
+
l.forEach(function(E) {
|
|
1358
|
+
w = w || g(E, s);
|
|
1359
|
+
});
|
|
1360
|
+
break;
|
|
1361
|
+
case "set":
|
|
1362
|
+
i ? l.forEach(function(E) {
|
|
1363
|
+
w = w || g(E, s);
|
|
1364
|
+
}) : w = l.has(s);
|
|
1365
|
+
break;
|
|
1366
|
+
case "array":
|
|
1367
|
+
i ? w = l.some(function(E) {
|
|
1368
|
+
return g(E, s);
|
|
1369
|
+
}) : w = l.indexOf(s) !== -1;
|
|
1370
|
+
break;
|
|
1371
|
+
default:
|
|
1372
|
+
if (s !== Object(s))
|
|
1373
|
+
throw new m(
|
|
1374
|
+
c + "the given combination of arguments (" + n + " and " + o.type(s).toLowerCase() + ") is invalid for this assertion. You can use an array, a map, an object, a set, a string, or a weakset instead of a " + o.type(s).toLowerCase(),
|
|
1375
|
+
void 0,
|
|
1376
|
+
r
|
|
1377
|
+
);
|
|
1378
|
+
var $ = Object.keys(s), N = null, V = 0;
|
|
1379
|
+
if ($.forEach(function(E) {
|
|
1380
|
+
var S = new t(l);
|
|
1381
|
+
if (o.transferFlags(this, S, !0), e(S, "lockSsfi", !0), !v || $.length === 1) {
|
|
1382
|
+
S.property(E, s[E]);
|
|
1383
|
+
return;
|
|
1384
|
+
}
|
|
1385
|
+
try {
|
|
1386
|
+
S.property(E, s[E]);
|
|
1387
|
+
} catch (B) {
|
|
1388
|
+
if (!o.checkError.compatibleConstructor(B, m))
|
|
1389
|
+
throw B;
|
|
1390
|
+
N === null && (N = B), V++;
|
|
1391
|
+
}
|
|
1392
|
+
}, this), v && $.length > 1 && V === $.length)
|
|
1393
|
+
throw N;
|
|
1394
|
+
return;
|
|
1395
|
+
}
|
|
1396
|
+
this.assert(
|
|
1397
|
+
w,
|
|
1398
|
+
"expected #{this} to " + f + "include " + o.inspect(s),
|
|
1399
|
+
"expected #{this} to not " + f + "include " + o.inspect(s)
|
|
1400
|
+
);
|
|
1401
|
+
}
|
|
1402
|
+
t.addChainableMethod("include", L, H), t.addChainableMethod("contain", L, H), t.addChainableMethod("contains", L, H), t.addChainableMethod("includes", L, H), t.addProperty("ok", function() {
|
|
1403
|
+
this.assert(
|
|
1404
|
+
e(this, "object"),
|
|
1405
|
+
"expected #{this} to be truthy",
|
|
1406
|
+
"expected #{this} to be falsy"
|
|
1407
|
+
);
|
|
1408
|
+
}), t.addProperty("true", function() {
|
|
1409
|
+
this.assert(
|
|
1410
|
+
e(this, "object") === !0,
|
|
1411
|
+
"expected #{this} to be true",
|
|
1412
|
+
"expected #{this} to be false",
|
|
1413
|
+
!e(this, "negate")
|
|
1414
|
+
);
|
|
1415
|
+
}), t.addProperty("false", function() {
|
|
1416
|
+
this.assert(
|
|
1417
|
+
e(this, "object") === !1,
|
|
1418
|
+
"expected #{this} to be false",
|
|
1419
|
+
"expected #{this} to be true",
|
|
1420
|
+
!!e(this, "negate")
|
|
1421
|
+
);
|
|
1422
|
+
}), t.addProperty("null", function() {
|
|
1423
|
+
this.assert(
|
|
1424
|
+
e(this, "object") === null,
|
|
1425
|
+
"expected #{this} to be null",
|
|
1426
|
+
"expected #{this} not to be null"
|
|
1427
|
+
);
|
|
1428
|
+
}), t.addProperty("undefined", function() {
|
|
1429
|
+
this.assert(
|
|
1430
|
+
e(this, "object") === void 0,
|
|
1431
|
+
"expected #{this} to be undefined",
|
|
1432
|
+
"expected #{this} not to be undefined"
|
|
1433
|
+
);
|
|
1434
|
+
}), t.addProperty("NaN", function() {
|
|
1435
|
+
this.assert(
|
|
1436
|
+
o.isNaN(e(this, "object")),
|
|
1437
|
+
"expected #{this} to be NaN",
|
|
1438
|
+
"expected #{this} not to be NaN"
|
|
1439
|
+
);
|
|
1440
|
+
});
|
|
1441
|
+
function G() {
|
|
1442
|
+
var s = e(this, "object");
|
|
1443
|
+
this.assert(
|
|
1444
|
+
s != null,
|
|
1445
|
+
"expected #{this} to exist",
|
|
1446
|
+
"expected #{this} to not exist"
|
|
1447
|
+
);
|
|
1448
|
+
}
|
|
1449
|
+
t.addProperty("exist", G), t.addProperty("exists", G), t.addProperty("empty", function() {
|
|
1450
|
+
var s = e(this, "object"), a = e(this, "ssfi"), l = e(this, "message"), n;
|
|
1451
|
+
switch (l = l ? l + ": " : "", o.type(s).toLowerCase()) {
|
|
1452
|
+
case "array":
|
|
1453
|
+
case "string":
|
|
1454
|
+
n = s.length;
|
|
1455
|
+
break;
|
|
1456
|
+
case "map":
|
|
1457
|
+
case "set":
|
|
1458
|
+
n = s.size;
|
|
1459
|
+
break;
|
|
1460
|
+
case "weakmap":
|
|
1461
|
+
case "weakset":
|
|
1462
|
+
throw new m(
|
|
1463
|
+
l + ".empty was passed a weak collection",
|
|
1464
|
+
void 0,
|
|
1465
|
+
a
|
|
1466
|
+
);
|
|
1467
|
+
case "function":
|
|
1468
|
+
var c = l + ".empty was passed a function " + o.getName(s);
|
|
1469
|
+
throw new m(c.trim(), void 0, a);
|
|
1470
|
+
default:
|
|
1471
|
+
if (s !== Object(s))
|
|
1472
|
+
throw new m(
|
|
1473
|
+
l + ".empty was passed non-string primitive " + o.inspect(s),
|
|
1474
|
+
void 0,
|
|
1475
|
+
a
|
|
1476
|
+
);
|
|
1477
|
+
n = Object.keys(s).length;
|
|
1478
|
+
}
|
|
1479
|
+
this.assert(
|
|
1480
|
+
n === 0,
|
|
1481
|
+
"expected #{this} to be empty",
|
|
1482
|
+
"expected #{this} not to be empty"
|
|
1483
|
+
);
|
|
1484
|
+
});
|
|
1485
|
+
function y() {
|
|
1486
|
+
var s = e(this, "object"), a = o.type(s);
|
|
1487
|
+
this.assert(
|
|
1488
|
+
a === "Arguments",
|
|
1489
|
+
"expected #{this} to be arguments but got " + a,
|
|
1490
|
+
"expected #{this} to not be arguments"
|
|
1491
|
+
);
|
|
1492
|
+
}
|
|
1493
|
+
t.addProperty("arguments", y), t.addProperty("Arguments", y);
|
|
1494
|
+
function j(s, a) {
|
|
1495
|
+
a && e(this, "message", a);
|
|
1496
|
+
var l = e(this, "object");
|
|
1497
|
+
if (e(this, "deep")) {
|
|
1498
|
+
var n = e(this, "lockSsfi");
|
|
1499
|
+
e(this, "lockSsfi", !0), this.eql(s), e(this, "lockSsfi", n);
|
|
1500
|
+
} else
|
|
1501
|
+
this.assert(
|
|
1502
|
+
s === l,
|
|
1503
|
+
"expected #{this} to equal #{exp}",
|
|
1504
|
+
"expected #{this} to not equal #{exp}",
|
|
1505
|
+
s,
|
|
1506
|
+
this._obj,
|
|
1507
|
+
!0
|
|
1508
|
+
);
|
|
1509
|
+
}
|
|
1510
|
+
t.addMethod("equal", j), t.addMethod("equals", j), t.addMethod("eq", j);
|
|
1511
|
+
function C(s, a) {
|
|
1512
|
+
a && e(this, "message", a);
|
|
1513
|
+
var l = e(this, "eql");
|
|
1514
|
+
this.assert(
|
|
1515
|
+
l(s, e(this, "object")),
|
|
1516
|
+
"expected #{this} to deeply equal #{exp}",
|
|
1517
|
+
"expected #{this} to not deeply equal #{exp}",
|
|
1518
|
+
s,
|
|
1519
|
+
this._obj,
|
|
1520
|
+
!0
|
|
1521
|
+
);
|
|
1522
|
+
}
|
|
1523
|
+
t.addMethod("eql", C), t.addMethod("eqls", C);
|
|
1524
|
+
function p(s, a) {
|
|
1525
|
+
a && e(this, "message", a);
|
|
1526
|
+
var l = e(this, "object"), n = e(this, "doLength"), c = e(this, "message"), v = c ? c + ": " : "", r = e(this, "ssfi"), i = o.type(l).toLowerCase(), f = o.type(s).toLowerCase(), g, w = !0;
|
|
1527
|
+
if (n && i !== "map" && i !== "set" && new t(l, c, r, !0).to.have.property("length"), !n && i === "date" && f !== "date")
|
|
1528
|
+
g = v + "the argument to above must be a date";
|
|
1529
|
+
else if (f !== "number" && (n || i === "number"))
|
|
1530
|
+
g = v + "the argument to above must be a number";
|
|
1531
|
+
else if (!n && i !== "date" && i !== "number") {
|
|
1532
|
+
var $ = i === "string" ? "'" + l + "'" : l;
|
|
1533
|
+
g = v + "expected " + $ + " to be a number or a date";
|
|
1534
|
+
} else
|
|
1535
|
+
w = !1;
|
|
1536
|
+
if (w)
|
|
1537
|
+
throw new m(g, void 0, r);
|
|
1538
|
+
if (n) {
|
|
1539
|
+
var N = "length", V;
|
|
1540
|
+
i === "map" || i === "set" ? (N = "size", V = l.size) : V = l.length, this.assert(
|
|
1541
|
+
V > s,
|
|
1542
|
+
"expected #{this} to have a " + N + " above #{exp} but got #{act}",
|
|
1543
|
+
"expected #{this} to not have a " + N + " above #{exp}",
|
|
1544
|
+
s,
|
|
1545
|
+
V
|
|
1546
|
+
);
|
|
1547
|
+
} else
|
|
1548
|
+
this.assert(
|
|
1549
|
+
l > s,
|
|
1550
|
+
"expected #{this} to be above #{exp}",
|
|
1551
|
+
"expected #{this} to be at most #{exp}",
|
|
1552
|
+
s
|
|
1553
|
+
);
|
|
1554
|
+
}
|
|
1555
|
+
t.addMethod("above", p), t.addMethod("gt", p), t.addMethod("greaterThan", p);
|
|
1556
|
+
function h(s, a) {
|
|
1557
|
+
a && e(this, "message", a);
|
|
1558
|
+
var l = e(this, "object"), n = e(this, "doLength"), c = e(this, "message"), v = c ? c + ": " : "", r = e(this, "ssfi"), i = o.type(l).toLowerCase(), f = o.type(s).toLowerCase(), g, w = !0;
|
|
1559
|
+
if (n && i !== "map" && i !== "set" && new t(l, c, r, !0).to.have.property("length"), !n && i === "date" && f !== "date")
|
|
1560
|
+
g = v + "the argument to least must be a date";
|
|
1561
|
+
else if (f !== "number" && (n || i === "number"))
|
|
1562
|
+
g = v + "the argument to least must be a number";
|
|
1563
|
+
else if (!n && i !== "date" && i !== "number") {
|
|
1564
|
+
var $ = i === "string" ? "'" + l + "'" : l;
|
|
1565
|
+
g = v + "expected " + $ + " to be a number or a date";
|
|
1566
|
+
} else
|
|
1567
|
+
w = !1;
|
|
1568
|
+
if (w)
|
|
1569
|
+
throw new m(g, void 0, r);
|
|
1570
|
+
if (n) {
|
|
1571
|
+
var N = "length", V;
|
|
1572
|
+
i === "map" || i === "set" ? (N = "size", V = l.size) : V = l.length, this.assert(
|
|
1573
|
+
V >= s,
|
|
1574
|
+
"expected #{this} to have a " + N + " at least #{exp} but got #{act}",
|
|
1575
|
+
"expected #{this} to have a " + N + " below #{exp}",
|
|
1576
|
+
s,
|
|
1577
|
+
V
|
|
1578
|
+
);
|
|
1579
|
+
} else
|
|
1580
|
+
this.assert(
|
|
1581
|
+
l >= s,
|
|
1582
|
+
"expected #{this} to be at least #{exp}",
|
|
1583
|
+
"expected #{this} to be below #{exp}",
|
|
1584
|
+
s
|
|
1585
|
+
);
|
|
1586
|
+
}
|
|
1587
|
+
t.addMethod("least", h), t.addMethod("gte", h), t.addMethod("greaterThanOrEqual", h);
|
|
1588
|
+
function b(s, a) {
|
|
1589
|
+
a && e(this, "message", a);
|
|
1590
|
+
var l = e(this, "object"), n = e(this, "doLength"), c = e(this, "message"), v = c ? c + ": " : "", r = e(this, "ssfi"), i = o.type(l).toLowerCase(), f = o.type(s).toLowerCase(), g, w = !0;
|
|
1591
|
+
if (n && i !== "map" && i !== "set" && new t(l, c, r, !0).to.have.property("length"), !n && i === "date" && f !== "date")
|
|
1592
|
+
g = v + "the argument to below must be a date";
|
|
1593
|
+
else if (f !== "number" && (n || i === "number"))
|
|
1594
|
+
g = v + "the argument to below must be a number";
|
|
1595
|
+
else if (!n && i !== "date" && i !== "number") {
|
|
1596
|
+
var $ = i === "string" ? "'" + l + "'" : l;
|
|
1597
|
+
g = v + "expected " + $ + " to be a number or a date";
|
|
1598
|
+
} else
|
|
1599
|
+
w = !1;
|
|
1600
|
+
if (w)
|
|
1601
|
+
throw new m(g, void 0, r);
|
|
1602
|
+
if (n) {
|
|
1603
|
+
var N = "length", V;
|
|
1604
|
+
i === "map" || i === "set" ? (N = "size", V = l.size) : V = l.length, this.assert(
|
|
1605
|
+
V < s,
|
|
1606
|
+
"expected #{this} to have a " + N + " below #{exp} but got #{act}",
|
|
1607
|
+
"expected #{this} to not have a " + N + " below #{exp}",
|
|
1608
|
+
s,
|
|
1609
|
+
V
|
|
1610
|
+
);
|
|
1611
|
+
} else
|
|
1612
|
+
this.assert(
|
|
1613
|
+
l < s,
|
|
1614
|
+
"expected #{this} to be below #{exp}",
|
|
1615
|
+
"expected #{this} to be at least #{exp}",
|
|
1616
|
+
s
|
|
1617
|
+
);
|
|
1618
|
+
}
|
|
1619
|
+
t.addMethod("below", b), t.addMethod("lt", b), t.addMethod("lessThan", b);
|
|
1620
|
+
function x(s, a) {
|
|
1621
|
+
a && e(this, "message", a);
|
|
1622
|
+
var l = e(this, "object"), n = e(this, "doLength"), c = e(this, "message"), v = c ? c + ": " : "", r = e(this, "ssfi"), i = o.type(l).toLowerCase(), f = o.type(s).toLowerCase(), g, w = !0;
|
|
1623
|
+
if (n && i !== "map" && i !== "set" && new t(l, c, r, !0).to.have.property("length"), !n && i === "date" && f !== "date")
|
|
1624
|
+
g = v + "the argument to most must be a date";
|
|
1625
|
+
else if (f !== "number" && (n || i === "number"))
|
|
1626
|
+
g = v + "the argument to most must be a number";
|
|
1627
|
+
else if (!n && i !== "date" && i !== "number") {
|
|
1628
|
+
var $ = i === "string" ? "'" + l + "'" : l;
|
|
1629
|
+
g = v + "expected " + $ + " to be a number or a date";
|
|
1630
|
+
} else
|
|
1631
|
+
w = !1;
|
|
1632
|
+
if (w)
|
|
1633
|
+
throw new m(g, void 0, r);
|
|
1634
|
+
if (n) {
|
|
1635
|
+
var N = "length", V;
|
|
1636
|
+
i === "map" || i === "set" ? (N = "size", V = l.size) : V = l.length, this.assert(
|
|
1637
|
+
V <= s,
|
|
1638
|
+
"expected #{this} to have a " + N + " at most #{exp} but got #{act}",
|
|
1639
|
+
"expected #{this} to have a " + N + " above #{exp}",
|
|
1640
|
+
s,
|
|
1641
|
+
V
|
|
1642
|
+
);
|
|
1643
|
+
} else
|
|
1644
|
+
this.assert(
|
|
1645
|
+
l <= s,
|
|
1646
|
+
"expected #{this} to be at most #{exp}",
|
|
1647
|
+
"expected #{this} to be above #{exp}",
|
|
1648
|
+
s
|
|
1649
|
+
);
|
|
1650
|
+
}
|
|
1651
|
+
t.addMethod("most", x), t.addMethod("lte", x), t.addMethod("lessThanOrEqual", x), t.addMethod("within", function(s, a, l) {
|
|
1652
|
+
l && e(this, "message", l);
|
|
1653
|
+
var n = e(this, "object"), c = e(this, "doLength"), v = e(this, "message"), r = v ? v + ": " : "", i = e(this, "ssfi"), f = o.type(n).toLowerCase(), g = o.type(s).toLowerCase(), w = o.type(a).toLowerCase(), $, N = !0, V = g === "date" && w === "date" ? s.toISOString() + ".." + a.toISOString() : s + ".." + a;
|
|
1654
|
+
if (c && f !== "map" && f !== "set" && new t(n, v, i, !0).to.have.property("length"), !c && f === "date" && (g !== "date" || w !== "date"))
|
|
1655
|
+
$ = r + "the arguments to within must be dates";
|
|
1656
|
+
else if ((g !== "number" || w !== "number") && (c || f === "number"))
|
|
1657
|
+
$ = r + "the arguments to within must be numbers";
|
|
1658
|
+
else if (!c && f !== "date" && f !== "number") {
|
|
1659
|
+
var E = f === "string" ? "'" + n + "'" : n;
|
|
1660
|
+
$ = r + "expected " + E + " to be a number or a date";
|
|
1661
|
+
} else
|
|
1662
|
+
N = !1;
|
|
1663
|
+
if (N)
|
|
1664
|
+
throw new m($, void 0, i);
|
|
1665
|
+
if (c) {
|
|
1666
|
+
var S = "length", B;
|
|
1667
|
+
f === "map" || f === "set" ? (S = "size", B = n.size) : B = n.length, this.assert(
|
|
1668
|
+
B >= s && B <= a,
|
|
1669
|
+
"expected #{this} to have a " + S + " within " + V,
|
|
1670
|
+
"expected #{this} to not have a " + S + " within " + V
|
|
1671
|
+
);
|
|
1672
|
+
} else
|
|
1673
|
+
this.assert(
|
|
1674
|
+
n >= s && n <= a,
|
|
1675
|
+
"expected #{this} to be within " + V,
|
|
1676
|
+
"expected #{this} to not be within " + V
|
|
1677
|
+
);
|
|
1678
|
+
});
|
|
1679
|
+
function z(s, a) {
|
|
1680
|
+
a && e(this, "message", a);
|
|
1681
|
+
var l = e(this, "object"), n = e(this, "ssfi"), c = e(this, "message");
|
|
1682
|
+
try {
|
|
1683
|
+
var v = l instanceof s;
|
|
1684
|
+
} catch (i) {
|
|
1685
|
+
throw i instanceof TypeError ? (c = c ? c + ": " : "", new m(
|
|
1686
|
+
c + "The instanceof assertion needs a constructor but " + o.type(s) + " was given.",
|
|
1687
|
+
void 0,
|
|
1688
|
+
n
|
|
1689
|
+
)) : i;
|
|
1690
|
+
}
|
|
1691
|
+
var r = o.getName(s);
|
|
1692
|
+
r === null && (r = "an unnamed constructor"), this.assert(
|
|
1693
|
+
v,
|
|
1694
|
+
"expected #{this} to be an instance of " + r,
|
|
1695
|
+
"expected #{this} to not be an instance of " + r
|
|
1696
|
+
);
|
|
1697
|
+
}
|
|
1698
|
+
t.addMethod("instanceof", z), t.addMethod("instanceOf", z);
|
|
1699
|
+
function k(s, a, l) {
|
|
1700
|
+
l && e(this, "message", l);
|
|
1701
|
+
var n = e(this, "nested"), c = e(this, "own"), v = e(this, "message"), r = e(this, "object"), i = e(this, "ssfi"), f = typeof s;
|
|
1702
|
+
if (v = v ? v + ": " : "", n) {
|
|
1703
|
+
if (f !== "string")
|
|
1704
|
+
throw new m(
|
|
1705
|
+
v + "the argument to property must be a string when using nested syntax",
|
|
1706
|
+
void 0,
|
|
1707
|
+
i
|
|
1708
|
+
);
|
|
1709
|
+
} else if (f !== "string" && f !== "number" && f !== "symbol")
|
|
1710
|
+
throw new m(
|
|
1711
|
+
v + "the argument to property must be a string, number, or symbol",
|
|
1712
|
+
void 0,
|
|
1713
|
+
i
|
|
1714
|
+
);
|
|
1715
|
+
if (n && c)
|
|
1716
|
+
throw new m(
|
|
1717
|
+
v + 'The "nested" and "own" flags cannot be combined.',
|
|
1718
|
+
void 0,
|
|
1719
|
+
i
|
|
1720
|
+
);
|
|
1721
|
+
if (r == null)
|
|
1722
|
+
throw new m(
|
|
1723
|
+
v + "Target cannot be null or undefined.",
|
|
1724
|
+
void 0,
|
|
1725
|
+
i
|
|
1726
|
+
);
|
|
1727
|
+
var g = e(this, "deep"), w = e(this, "negate"), $ = n ? o.getPathInfo(r, s) : null, N = n ? $.value : r[s], V = g ? e(this, "eql") : (B, Q) => B === Q, E = "";
|
|
1728
|
+
g && (E += "deep "), c && (E += "own "), n && (E += "nested "), E += "property ";
|
|
1729
|
+
var S;
|
|
1730
|
+
c ? S = Object.prototype.hasOwnProperty.call(r, s) : n ? S = $.exists : S = o.hasProperty(r, s), (!w || arguments.length === 1) && this.assert(
|
|
1731
|
+
S,
|
|
1732
|
+
"expected #{this} to have " + E + o.inspect(s),
|
|
1733
|
+
"expected #{this} to not have " + E + o.inspect(s)
|
|
1734
|
+
), arguments.length > 1 && this.assert(
|
|
1735
|
+
S && V(a, N),
|
|
1736
|
+
"expected #{this} to have " + E + o.inspect(s) + " of #{exp}, but got #{act}",
|
|
1737
|
+
"expected #{this} to not have " + E + o.inspect(s) + " of #{act}",
|
|
1738
|
+
a,
|
|
1739
|
+
N
|
|
1740
|
+
), e(this, "object", N);
|
|
1741
|
+
}
|
|
1742
|
+
t.addMethod("property", k);
|
|
1743
|
+
function I(s, a, l) {
|
|
1744
|
+
e(this, "own", !0), k.apply(this, arguments);
|
|
1745
|
+
}
|
|
1746
|
+
t.addMethod("ownProperty", I), t.addMethod("haveOwnProperty", I);
|
|
1747
|
+
function D(s, a, l) {
|
|
1748
|
+
typeof a == "string" && (l = a, a = null), l && e(this, "message", l);
|
|
1749
|
+
var n = e(this, "object"), c = Object.getOwnPropertyDescriptor(Object(n), s), v = e(this, "eql");
|
|
1750
|
+
c && a ? this.assert(
|
|
1751
|
+
v(a, c),
|
|
1752
|
+
"expected the own property descriptor for " + o.inspect(s) + " on #{this} to match " + o.inspect(a) + ", got " + o.inspect(c),
|
|
1753
|
+
"expected the own property descriptor for " + o.inspect(s) + " on #{this} to not match " + o.inspect(a),
|
|
1754
|
+
a,
|
|
1755
|
+
c,
|
|
1756
|
+
!0
|
|
1757
|
+
) : this.assert(
|
|
1758
|
+
c,
|
|
1759
|
+
"expected #{this} to have an own property descriptor for " + o.inspect(s),
|
|
1760
|
+
"expected #{this} to not have an own property descriptor for " + o.inspect(s)
|
|
1761
|
+
), e(this, "object", c);
|
|
1762
|
+
}
|
|
1763
|
+
t.addMethod("ownPropertyDescriptor", D), t.addMethod("haveOwnPropertyDescriptor", D);
|
|
1764
|
+
function A() {
|
|
1765
|
+
e(this, "doLength", !0);
|
|
1766
|
+
}
|
|
1767
|
+
function W(s, a) {
|
|
1768
|
+
a && e(this, "message", a);
|
|
1769
|
+
var l = e(this, "object"), n = o.type(l).toLowerCase(), c = e(this, "message"), v = e(this, "ssfi"), r = "length", i;
|
|
1770
|
+
switch (n) {
|
|
1771
|
+
case "map":
|
|
1772
|
+
case "set":
|
|
1773
|
+
r = "size", i = l.size;
|
|
1774
|
+
break;
|
|
1775
|
+
default:
|
|
1776
|
+
new t(l, c, v, !0).to.have.property("length"), i = l.length;
|
|
1777
|
+
}
|
|
1778
|
+
this.assert(
|
|
1779
|
+
i == s,
|
|
1780
|
+
"expected #{this} to have a " + r + " of #{exp} but got #{act}",
|
|
1781
|
+
"expected #{this} to not have a " + r + " of #{act}",
|
|
1782
|
+
s,
|
|
1783
|
+
i
|
|
1784
|
+
);
|
|
1785
|
+
}
|
|
1786
|
+
t.addChainableMethod("length", W, A), t.addChainableMethod("lengthOf", W, A);
|
|
1787
|
+
function Y(s, a) {
|
|
1788
|
+
a && e(this, "message", a);
|
|
1789
|
+
var l = e(this, "object");
|
|
1790
|
+
this.assert(
|
|
1791
|
+
s.exec(l),
|
|
1792
|
+
"expected #{this} to match " + s,
|
|
1793
|
+
"expected #{this} not to match " + s
|
|
1794
|
+
);
|
|
1795
|
+
}
|
|
1796
|
+
t.addMethod("match", Y), t.addMethod("matches", Y), t.addMethod("string", function(s, a) {
|
|
1797
|
+
a && e(this, "message", a);
|
|
1798
|
+
var l = e(this, "object"), n = e(this, "message"), c = e(this, "ssfi");
|
|
1799
|
+
new t(l, n, c, !0).is.a("string"), this.assert(
|
|
1800
|
+
~l.indexOf(s),
|
|
1801
|
+
"expected #{this} to contain " + o.inspect(s),
|
|
1802
|
+
"expected #{this} to not contain " + o.inspect(s)
|
|
1803
|
+
);
|
|
1804
|
+
});
|
|
1805
|
+
function J(s) {
|
|
1806
|
+
var a = e(this, "object"), l = o.type(a), n = o.type(s), c = e(this, "ssfi"), v = e(this, "deep"), r, i = "", f, g = !0, w = e(this, "message");
|
|
1807
|
+
w = w ? w + ": " : "";
|
|
1808
|
+
var $ = w + "when testing keys against an object or an array you must give a single Array|Object|String argument or multiple String arguments";
|
|
1809
|
+
if (l === "Map" || l === "Set")
|
|
1810
|
+
i = v ? "deeply " : "", f = [], a.forEach(function(F, Z) {
|
|
1811
|
+
f.push(Z);
|
|
1812
|
+
}), n !== "Array" && (s = Array.prototype.slice.call(arguments));
|
|
1813
|
+
else {
|
|
1814
|
+
switch (f = o.getOwnEnumerableProperties(a), n) {
|
|
1815
|
+
case "Array":
|
|
1816
|
+
if (arguments.length > 1)
|
|
1817
|
+
throw new m($, void 0, c);
|
|
1818
|
+
break;
|
|
1819
|
+
case "Object":
|
|
1820
|
+
if (arguments.length > 1)
|
|
1821
|
+
throw new m($, void 0, c);
|
|
1822
|
+
s = Object.keys(s);
|
|
1823
|
+
break;
|
|
1824
|
+
default:
|
|
1825
|
+
s = Array.prototype.slice.call(arguments);
|
|
1826
|
+
}
|
|
1827
|
+
s = s.map(function(F) {
|
|
1828
|
+
return typeof F == "symbol" ? F : String(F);
|
|
1829
|
+
});
|
|
1830
|
+
}
|
|
1831
|
+
if (!s.length)
|
|
1832
|
+
throw new m(w + "keys required", void 0, c);
|
|
1833
|
+
var N = s.length, V = e(this, "any"), E = e(this, "all"), S = s, B = v ? e(this, "eql") : (F, Z) => F === Z;
|
|
1834
|
+
if (!V && !E && (E = !0), V && (g = S.some(function(F) {
|
|
1835
|
+
return f.some(function(Z) {
|
|
1836
|
+
return B(F, Z);
|
|
1837
|
+
});
|
|
1838
|
+
})), E && (g = S.every(function(F) {
|
|
1839
|
+
return f.some(function(Z) {
|
|
1840
|
+
return B(F, Z);
|
|
1841
|
+
});
|
|
1842
|
+
}), e(this, "contains") || (g = g && s.length == f.length)), N > 1) {
|
|
1843
|
+
s = s.map(function(F) {
|
|
1844
|
+
return o.inspect(F);
|
|
1845
|
+
});
|
|
1846
|
+
var Q = s.pop();
|
|
1847
|
+
E && (r = s.join(", ") + ", and " + Q), V && (r = s.join(", ") + ", or " + Q);
|
|
1848
|
+
} else
|
|
1849
|
+
r = o.inspect(s[0]);
|
|
1850
|
+
r = (N > 1 ? "keys " : "key ") + r, r = (e(this, "contains") ? "contain " : "have ") + r, this.assert(
|
|
1851
|
+
g,
|
|
1852
|
+
"expected #{this} to " + i + r,
|
|
1853
|
+
"expected #{this} to not " + i + r,
|
|
1854
|
+
S.slice(0).sort(o.compareByInspect),
|
|
1855
|
+
f.sort(o.compareByInspect),
|
|
1856
|
+
!0
|
|
1857
|
+
);
|
|
1858
|
+
}
|
|
1859
|
+
t.addMethod("keys", J), t.addMethod("key", J);
|
|
1860
|
+
function X(s, a, l) {
|
|
1861
|
+
l && e(this, "message", l);
|
|
1862
|
+
var n = e(this, "object"), c = e(this, "ssfi"), v = e(this, "message"), r = e(this, "negate") || !1;
|
|
1863
|
+
new t(n, v, c, !0).is.a("function"), (s instanceof RegExp || typeof s == "string") && (a = s, s = null);
|
|
1864
|
+
var i;
|
|
1865
|
+
try {
|
|
1866
|
+
n();
|
|
1867
|
+
} catch (Q) {
|
|
1868
|
+
i = Q;
|
|
1869
|
+
}
|
|
1870
|
+
var f = s === void 0 && a === void 0, g = !!(s && a), w = !1, $ = !1;
|
|
1871
|
+
if (f || !f && !r) {
|
|
1872
|
+
var N = "an error";
|
|
1873
|
+
s instanceof Error ? N = "#{exp}" : s && (N = o.checkError.getConstructorName(s)), this.assert(
|
|
1874
|
+
i,
|
|
1875
|
+
"expected #{this} to throw " + N,
|
|
1876
|
+
"expected #{this} to not throw an error but #{act} was thrown",
|
|
1877
|
+
s && s.toString(),
|
|
1878
|
+
i instanceof Error ? i.toString() : typeof i == "string" ? i : i && o.checkError.getConstructorName(i)
|
|
1879
|
+
);
|
|
1880
|
+
}
|
|
1881
|
+
if (s && i) {
|
|
1882
|
+
if (s instanceof Error) {
|
|
1883
|
+
var V = o.checkError.compatibleInstance(i, s);
|
|
1884
|
+
V === r && (g && r ? w = !0 : this.assert(
|
|
1885
|
+
r,
|
|
1886
|
+
"expected #{this} to throw #{exp} but #{act} was thrown",
|
|
1887
|
+
"expected #{this} to not throw #{exp}" + (i && !r ? " but #{act} was thrown" : ""),
|
|
1888
|
+
s.toString(),
|
|
1889
|
+
i.toString()
|
|
1890
|
+
));
|
|
1891
|
+
}
|
|
1892
|
+
var E = o.checkError.compatibleConstructor(i, s);
|
|
1893
|
+
E === r && (g && r ? w = !0 : this.assert(
|
|
1894
|
+
r,
|
|
1895
|
+
"expected #{this} to throw #{exp} but #{act} was thrown",
|
|
1896
|
+
"expected #{this} to not throw #{exp}" + (i ? " but #{act} was thrown" : ""),
|
|
1897
|
+
s instanceof Error ? s.toString() : s && o.checkError.getConstructorName(s),
|
|
1898
|
+
i instanceof Error ? i.toString() : i && o.checkError.getConstructorName(i)
|
|
1899
|
+
));
|
|
1900
|
+
}
|
|
1901
|
+
if (i && a !== void 0 && a !== null) {
|
|
1902
|
+
var S = "including";
|
|
1903
|
+
a instanceof RegExp && (S = "matching");
|
|
1904
|
+
var B = o.checkError.compatibleMessage(i, a);
|
|
1905
|
+
B === r && (g && r ? $ = !0 : this.assert(
|
|
1906
|
+
r,
|
|
1907
|
+
"expected #{this} to throw error " + S + " #{exp} but got #{act}",
|
|
1908
|
+
"expected #{this} to throw error not " + S + " #{exp}",
|
|
1909
|
+
a,
|
|
1910
|
+
o.checkError.getMessage(i)
|
|
1911
|
+
));
|
|
1912
|
+
}
|
|
1913
|
+
w && $ && this.assert(
|
|
1914
|
+
r,
|
|
1915
|
+
"expected #{this} to throw #{exp} but #{act} was thrown",
|
|
1916
|
+
"expected #{this} to not throw #{exp}" + (i ? " but #{act} was thrown" : ""),
|
|
1917
|
+
s instanceof Error ? s.toString() : s && o.checkError.getConstructorName(s),
|
|
1918
|
+
i instanceof Error ? i.toString() : i && o.checkError.getConstructorName(i)
|
|
1919
|
+
), e(this, "object", i);
|
|
1920
|
+
}
|
|
1921
|
+
t.addMethod("throw", X), t.addMethod("throws", X), t.addMethod("Throw", X);
|
|
1922
|
+
function P(s, a) {
|
|
1923
|
+
a && e(this, "message", a);
|
|
1924
|
+
var l = e(this, "object"), n = e(this, "itself"), c = typeof l == "function" && !n ? l.prototype[s] : l[s];
|
|
1925
|
+
this.assert(
|
|
1926
|
+
typeof c == "function",
|
|
1927
|
+
"expected #{this} to respond to " + o.inspect(s),
|
|
1928
|
+
"expected #{this} to not respond to " + o.inspect(s)
|
|
1929
|
+
);
|
|
1930
|
+
}
|
|
1931
|
+
t.addMethod("respondTo", P), t.addMethod("respondsTo", P), t.addProperty("itself", function() {
|
|
1932
|
+
e(this, "itself", !0);
|
|
1933
|
+
});
|
|
1934
|
+
function K(s, a) {
|
|
1935
|
+
a && e(this, "message", a);
|
|
1936
|
+
var l = e(this, "object"), n = s(l);
|
|
1937
|
+
this.assert(
|
|
1938
|
+
n,
|
|
1939
|
+
"expected #{this} to satisfy " + o.objDisplay(s),
|
|
1940
|
+
"expected #{this} to not satisfy" + o.objDisplay(s),
|
|
1941
|
+
!e(this, "negate"),
|
|
1942
|
+
n
|
|
1943
|
+
);
|
|
1944
|
+
}
|
|
1945
|
+
t.addMethod("satisfy", K), t.addMethod("satisfies", K);
|
|
1946
|
+
function ae(s, a, l) {
|
|
1947
|
+
l && e(this, "message", l);
|
|
1948
|
+
var n = e(this, "object"), c = e(this, "message"), v = e(this, "ssfi");
|
|
1949
|
+
if (new t(n, c, v, !0).is.a("number"), typeof s != "number" || typeof a != "number") {
|
|
1950
|
+
c = c ? c + ": " : "";
|
|
1951
|
+
var r = a === void 0 ? ", and a delta is required" : "";
|
|
1952
|
+
throw new m(
|
|
1953
|
+
c + "the arguments to closeTo or approximately must be numbers" + r,
|
|
1954
|
+
void 0,
|
|
1955
|
+
v
|
|
1956
|
+
);
|
|
1957
|
+
}
|
|
1958
|
+
this.assert(
|
|
1959
|
+
Math.abs(n - s) <= a,
|
|
1960
|
+
"expected #{this} to be close to " + s + " +/- " + a,
|
|
1961
|
+
"expected #{this} not to be close to " + s + " +/- " + a
|
|
1962
|
+
);
|
|
1963
|
+
}
|
|
1964
|
+
t.addMethod("closeTo", ae), t.addMethod("approximately", ae);
|
|
1965
|
+
function oe(s, a, l, n, c) {
|
|
1966
|
+
if (!n) {
|
|
1967
|
+
if (s.length !== a.length)
|
|
1968
|
+
return !1;
|
|
1969
|
+
a = a.slice();
|
|
1970
|
+
}
|
|
1971
|
+
return s.every(function(v, r) {
|
|
1972
|
+
if (c)
|
|
1973
|
+
return l ? l(v, a[r]) : v === a[r];
|
|
1974
|
+
if (!l) {
|
|
1975
|
+
var i = a.indexOf(v);
|
|
1976
|
+
return i === -1 ? !1 : (n || a.splice(i, 1), !0);
|
|
1977
|
+
}
|
|
1978
|
+
return a.some(function(f, g) {
|
|
1979
|
+
return l(v, f) ? (n || a.splice(g, 1), !0) : !1;
|
|
1980
|
+
});
|
|
1981
|
+
});
|
|
1982
|
+
}
|
|
1983
|
+
t.addMethod("members", function(s, a) {
|
|
1984
|
+
a && e(this, "message", a);
|
|
1985
|
+
var l = e(this, "object"), n = e(this, "message"), c = e(this, "ssfi");
|
|
1986
|
+
new t(l, n, c, !0).to.be.an("array"), new t(s, n, c, !0).to.be.an("array");
|
|
1987
|
+
var v = e(this, "contains"), r = e(this, "ordered"), i, f, g;
|
|
1988
|
+
v ? (i = r ? "an ordered superset" : "a superset", f = "expected #{this} to be " + i + " of #{exp}", g = "expected #{this} to not be " + i + " of #{exp}") : (i = r ? "ordered members" : "members", f = "expected #{this} to have the same " + i + " as #{exp}", g = "expected #{this} to not have the same " + i + " as #{exp}");
|
|
1989
|
+
var w = e(this, "deep") ? e(this, "eql") : void 0;
|
|
1990
|
+
this.assert(
|
|
1991
|
+
oe(s, l, w, v, r),
|
|
1992
|
+
f,
|
|
1993
|
+
g,
|
|
1994
|
+
s,
|
|
1995
|
+
l,
|
|
1996
|
+
!0
|
|
1997
|
+
);
|
|
1998
|
+
});
|
|
1999
|
+
function ne(s, a) {
|
|
2000
|
+
a && e(this, "message", a);
|
|
2001
|
+
var l = e(this, "object"), n = e(this, "message"), c = e(this, "ssfi"), v = e(this, "contains"), r = e(this, "deep"), i = e(this, "eql");
|
|
2002
|
+
new t(s, n, c, !0).to.be.an("array"), v ? this.assert(
|
|
2003
|
+
s.some(function(f) {
|
|
2004
|
+
return l.indexOf(f) > -1;
|
|
2005
|
+
}),
|
|
2006
|
+
"expected #{this} to contain one of #{exp}",
|
|
2007
|
+
"expected #{this} to not contain one of #{exp}",
|
|
2008
|
+
s,
|
|
2009
|
+
l
|
|
2010
|
+
) : r ? this.assert(
|
|
2011
|
+
s.some(function(f) {
|
|
2012
|
+
return i(l, f);
|
|
2013
|
+
}),
|
|
2014
|
+
"expected #{this} to deeply equal one of #{exp}",
|
|
2015
|
+
"expected #{this} to deeply equal one of #{exp}",
|
|
2016
|
+
s,
|
|
2017
|
+
l
|
|
2018
|
+
) : this.assert(
|
|
2019
|
+
s.indexOf(l) > -1,
|
|
2020
|
+
"expected #{this} to be one of #{exp}",
|
|
2021
|
+
"expected #{this} to not be one of #{exp}",
|
|
2022
|
+
s,
|
|
2023
|
+
l
|
|
2024
|
+
);
|
|
2025
|
+
}
|
|
2026
|
+
t.addMethod("oneOf", ne);
|
|
2027
|
+
function de(s, a, l) {
|
|
2028
|
+
l && e(this, "message", l);
|
|
2029
|
+
var n = e(this, "object"), c = e(this, "message"), v = e(this, "ssfi");
|
|
2030
|
+
new t(n, c, v, !0).is.a("function");
|
|
2031
|
+
var r;
|
|
2032
|
+
a ? (new t(s, c, v, !0).to.have.property(a), r = s[a]) : (new t(s, c, v, !0).is.a("function"), r = s()), n();
|
|
2033
|
+
var i = a == null ? s() : s[a], f = a == null ? r : "." + a;
|
|
2034
|
+
e(this, "deltaMsgObj", f), e(this, "initialDeltaValue", r), e(this, "finalDeltaValue", i), e(this, "deltaBehavior", "change"), e(this, "realDelta", i !== r), this.assert(
|
|
2035
|
+
r !== i,
|
|
2036
|
+
"expected " + f + " to change",
|
|
2037
|
+
"expected " + f + " to not change"
|
|
2038
|
+
);
|
|
2039
|
+
}
|
|
2040
|
+
t.addMethod("change", de), t.addMethod("changes", de);
|
|
2041
|
+
function he(s, a, l) {
|
|
2042
|
+
l && e(this, "message", l);
|
|
2043
|
+
var n = e(this, "object"), c = e(this, "message"), v = e(this, "ssfi");
|
|
2044
|
+
new t(n, c, v, !0).is.a("function");
|
|
2045
|
+
var r;
|
|
2046
|
+
a ? (new t(s, c, v, !0).to.have.property(a), r = s[a]) : (new t(s, c, v, !0).is.a("function"), r = s()), new t(r, c, v, !0).is.a("number"), n();
|
|
2047
|
+
var i = a == null ? s() : s[a], f = a == null ? r : "." + a;
|
|
2048
|
+
e(this, "deltaMsgObj", f), e(this, "initialDeltaValue", r), e(this, "finalDeltaValue", i), e(this, "deltaBehavior", "increase"), e(this, "realDelta", i - r), this.assert(
|
|
2049
|
+
i - r > 0,
|
|
2050
|
+
"expected " + f + " to increase",
|
|
2051
|
+
"expected " + f + " to not increase"
|
|
2052
|
+
);
|
|
2053
|
+
}
|
|
2054
|
+
t.addMethod("increase", he), t.addMethod("increases", he);
|
|
2055
|
+
function ve(s, a, l) {
|
|
2056
|
+
l && e(this, "message", l);
|
|
2057
|
+
var n = e(this, "object"), c = e(this, "message"), v = e(this, "ssfi");
|
|
2058
|
+
new t(n, c, v, !0).is.a("function");
|
|
2059
|
+
var r;
|
|
2060
|
+
a ? (new t(s, c, v, !0).to.have.property(a), r = s[a]) : (new t(s, c, v, !0).is.a("function"), r = s()), new t(r, c, v, !0).is.a("number"), n();
|
|
2061
|
+
var i = a == null ? s() : s[a], f = a == null ? r : "." + a;
|
|
2062
|
+
e(this, "deltaMsgObj", f), e(this, "initialDeltaValue", r), e(this, "finalDeltaValue", i), e(this, "deltaBehavior", "decrease"), e(this, "realDelta", r - i), this.assert(
|
|
2063
|
+
i - r < 0,
|
|
2064
|
+
"expected " + f + " to decrease",
|
|
2065
|
+
"expected " + f + " to not decrease"
|
|
2066
|
+
);
|
|
2067
|
+
}
|
|
2068
|
+
t.addMethod("decrease", ve), t.addMethod("decreases", ve);
|
|
2069
|
+
function Ne(s, a) {
|
|
2070
|
+
a && e(this, "message", a);
|
|
2071
|
+
var l = e(this, "deltaMsgObj"), n = e(this, "initialDeltaValue"), c = e(this, "finalDeltaValue"), v = e(this, "deltaBehavior"), r = e(this, "realDelta"), i;
|
|
2072
|
+
v === "change" ? i = Math.abs(c - n) === Math.abs(s) : i = r === Math.abs(s), this.assert(
|
|
2073
|
+
i,
|
|
2074
|
+
"expected " + l + " to " + v + " by " + s,
|
|
2075
|
+
"expected " + l + " to not " + v + " by " + s
|
|
2076
|
+
);
|
|
2077
|
+
}
|
|
2078
|
+
t.addMethod("by", Ne), t.addProperty("extensible", function() {
|
|
2079
|
+
var s = e(this, "object"), a = s === Object(s) && Object.isExtensible(s);
|
|
2080
|
+
this.assert(
|
|
2081
|
+
a,
|
|
2082
|
+
"expected #{this} to be extensible",
|
|
2083
|
+
"expected #{this} to not be extensible"
|
|
2084
|
+
);
|
|
2085
|
+
}), t.addProperty("sealed", function() {
|
|
2086
|
+
var s = e(this, "object"), a = s === Object(s) ? Object.isSealed(s) : !0;
|
|
2087
|
+
this.assert(
|
|
2088
|
+
a,
|
|
2089
|
+
"expected #{this} to be sealed",
|
|
2090
|
+
"expected #{this} to not be sealed"
|
|
2091
|
+
);
|
|
2092
|
+
}), t.addProperty("frozen", function() {
|
|
2093
|
+
var s = e(this, "object"), a = s === Object(s) ? Object.isFrozen(s) : !0;
|
|
2094
|
+
this.assert(
|
|
2095
|
+
a,
|
|
2096
|
+
"expected #{this} to be frozen",
|
|
2097
|
+
"expected #{this} to not be frozen"
|
|
2098
|
+
);
|
|
2099
|
+
}), t.addProperty("finite", function(s) {
|
|
2100
|
+
var a = e(this, "object");
|
|
2101
|
+
this.assert(
|
|
2102
|
+
typeof a == "number" && isFinite(a),
|
|
2103
|
+
"expected #{this} to be a finite number",
|
|
2104
|
+
"expected #{this} to not be a finite number"
|
|
2105
|
+
);
|
|
2106
|
+
});
|
|
2107
|
+
};
|
|
1243
2108
|
export {
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
2109
|
+
se as S,
|
|
2110
|
+
qe as T,
|
|
2111
|
+
Fe as a,
|
|
2112
|
+
Be as c,
|
|
2113
|
+
Ge as u
|
|
1248
2114
|
};
|