@carbonplan/components 11.1.4 → 11.2.0-develop.0

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.
@@ -1,2875 +1,2 @@
1
- import React, { forwardRef, cloneElement, useRef, useState, useEffect, useCallback } from 'react';
2
- import { Box, Link as Link$2, Flex, Grid, IconButton, Container, useColorMode, useThemeUI, Text, Styled, Input as Input$1, Slider as Slider$1 } from 'theme-ui';
3
- import { transparentize } from '@theme-ui/color';
4
- import NextLink from 'next/link';
5
- import { Arrow, Sun } from '@carbonplan/icons';
6
- import { PoopSad } from '@carbonplan/emoji';
7
- import Head from 'next/head';
8
- import { keyframes } from '@emotion/react';
9
-
10
- function _extends() {
11
- _extends = Object.assign || function (target) {
12
- for (var i = 1; i < arguments.length; i++) {
13
- var source = arguments[i];
14
-
15
- for (var key in source) {
16
- if (Object.prototype.hasOwnProperty.call(source, key)) {
17
- target[key] = source[key];
18
- }
19
- }
20
- }
21
-
22
- return target;
23
- };
24
-
25
- return _extends.apply(this, arguments);
26
- }
27
-
28
- function _objectWithoutPropertiesLoose(source, excluded) {
29
- if (source == null) return {};
30
- var target = {};
31
- var sourceKeys = Object.keys(source);
32
- var key, i;
33
-
34
- for (i = 0; i < sourceKeys.length; i++) {
35
- key = sourceKeys[i];
36
- if (excluded.indexOf(key) >= 0) continue;
37
- target[key] = source[key];
38
- }
39
-
40
- return target;
41
- }
42
-
43
- const _excluded$g = ["sx", "children"];
44
-
45
- const Badge = _ref => {
46
- let {
47
- sx,
48
- children
49
- } = _ref,
50
- props = _objectWithoutPropertiesLoose(_ref, _excluded$g);
51
-
52
- const color = sx && sx.color ? sx.color : 'primary';
53
- return /*#__PURE__*/React.createElement(Box, _extends({
54
- sx: _extends({
55
- display: 'inline-block',
56
- width: 'fit-content',
57
- height: ['24px', '24px', '24px', '26px'],
58
- borderRadius: '5px',
59
- backgroundColor: color == 'primary' || color == 'secondary' ? 'muted' : transparentize(color, 0.7),
60
- textAlign: 'center',
61
- userSelect: 'none',
62
- fontSize: [2, 2, 2, 3]
63
- }, sx)
64
- }, props), /*#__PURE__*/React.createElement(Box, {
65
- sx: {
66
- letterSpacing: '0.02em',
67
- fontFamily: 'mono',
68
- mt: ['1px', '1px', '1px', '0px'],
69
- px: [1, 1, 1, '5px'],
70
- color: color
71
- }
72
- }, children));
73
- };
74
-
75
- const _excluded$f = ["href", "children", "internal", "tracking"];
76
-
77
- const event = ({
78
- action,
79
- category,
80
- label,
81
- value
82
- }) => {
83
- if (typeof window.gtag !== 'function') {
84
- console.warn(`Missing window.gtag, skipping analytics action: '${action}'.`);
85
- return;
86
- }
87
-
88
- window.gtag('event', action, {
89
- event_category: category,
90
- event_label: label,
91
- value: value
92
- });
93
- };
94
-
95
- const Link = (_ref, ref) => {
96
- let {
97
- href,
98
- children,
99
- internal = false,
100
- tracking = false
101
- } = _ref,
102
- props = _objectWithoutPropertiesLoose(_ref, _excluded$f);
103
-
104
- if (internal || href && href.startsWith('/')) {
105
- return /*#__PURE__*/React.createElement(NextLink, {
106
- href: href,
107
- passHref: true
108
- }, /*#__PURE__*/React.createElement(Link$2, _extends({
109
- ref: ref
110
- }, props), children));
111
- } else if (tracking) {
112
- let action;
113
- let category;
114
-
115
- if (href && href.includes('pdf')) {
116
- action = 'PDF';
117
- category = 'download';
118
- } else {
119
- action = 'website';
120
- category = 'external';
121
- }
122
-
123
- const track = e => {
124
- event({
125
- action: action,
126
- category: category,
127
- label: href
128
- });
129
- };
130
-
131
- return /*#__PURE__*/React.createElement(Link$2, _extends({
132
- ref: ref,
133
- onClick: track,
134
- onContextMenu: track,
135
- href: href
136
- }, props), children);
137
- } else {
138
- return /*#__PURE__*/React.createElement(Link$2, _extends({
139
- ref: ref,
140
- href: href
141
- }, props), children);
142
- }
143
- };
144
-
145
- var Link$1 = forwardRef(Link);
146
-
147
- const getSizeStyles = size => {
148
- if (!['xs', 'sm', 'md', 'lg', 'xl'].includes(size)) {
149
- throw new Error('Size must be xs, sm, md, lg, or xl');
150
- }
151
-
152
- let fontSize, fontFamily, letterSpacing, lineHeight;
153
-
154
- if (size === 'xs') {
155
- fontSize = [2, 2, 2, 3];
156
- fontFamily = 'body';
157
- letterSpacing = 'body';
158
- lineHeight = [1.2];
159
- }
160
-
161
- if (size === 'sm') {
162
- fontSize = [3, 3, 3, 4];
163
- fontFamily = 'body';
164
- letterSpacing = 'body';
165
- lineHeight = [1.2];
166
- }
167
-
168
- if (size === 'md') {
169
- fontSize = [4, 4, 4, 5];
170
- fontFamily = 'body';
171
- letterSpacing = 'body';
172
- lineHeight = [1.2];
173
- }
174
-
175
- if (size === 'lg') {
176
- fontSize = [5, 5, 6, 7];
177
- fontFamily = 'heading';
178
- letterSpacing = 'heading';
179
- lineHeight = [1.2, 1.2, 1.25, 1.25];
180
- }
181
-
182
- if (size === 'xl') {
183
- fontSize = [6, 7, 8, 9];
184
- fontFamily = 'heading';
185
- letterSpacing = 'heading';
186
- lineHeight = [1.25];
187
- }
188
-
189
- return {
190
- fontSize,
191
- fontFamily,
192
- letterSpacing,
193
- lineHeight
194
- };
195
- };
196
-
197
- const _excluded$e = ["size", "prefix", "suffix", "inverted", "sx", "children", "align", "href", "internal", "tracking"];
198
-
199
- const Button = (_ref, ref) => {
200
- let {
201
- size = 'sm',
202
- prefix,
203
- suffix,
204
- inverted,
205
- sx,
206
- children,
207
- align,
208
- href,
209
- internal,
210
- tracking
211
- } = _ref,
212
- props = _objectWithoutPropertiesLoose(_ref, _excluded$e);
213
-
214
- if (!['xs', 'sm', 'md', 'lg', 'xl'].includes(size)) {
215
- throw new Error('Size must be xs, sm, md, lg, or xl');
216
- }
217
-
218
- let offset, margin, height, width, strokeWidth;
219
- const color = sx && sx.color ? sx.color : null;
220
- const baseColor = color || (inverted ? 'secondary' : 'primary');
221
- const hoverColor = color ? 'primary' : inverted ? 'primary' : 'secondary';
222
-
223
- if (size === 'xs') {
224
- margin = ['6px', '6px', '6px', '6px'];
225
- height = [12, 12, 12, 13];
226
- width = [12, 12, 12, 13];
227
- strokeWidth = [1.5, 1.5, 1.5, 1.5];
228
- offset = {
229
- transform: 'translateY(0.25px)'
230
- };
231
- }
232
-
233
- if (size === 'sm') {
234
- margin = ['7px', '7px', '7px', '7px'];
235
- height = [13, 13, 13, 18];
236
- width = [13, 13, 13, 18];
237
- strokeWidth = [1.5, 1.5, 1.5, 2];
238
- offset = {
239
- transform: 'translateY(0.25px)'
240
- };
241
- }
242
-
243
- if (size === 'md') {
244
- margin = ['8px', '8px', '8px', '8px'];
245
- height = [18, 18, 18, 24];
246
- width = [18, 18, 18, 24];
247
- strokeWidth = [2, 2, 2, 3];
248
- }
249
-
250
- if (size === 'lg') {
251
- margin = ['10px', '10px', '12px', '16px'];
252
- height = [24, 24, 34, 46];
253
- width = [24, 24, 34, 46];
254
- strokeWidth = [3, 3, 4, 5];
255
- }
256
-
257
- if (size === 'xl') {
258
- margin = ['12px', '16px', '18px', '20px'];
259
- height = [34, 46, 56, 68];
260
- width = [34, 46, 56, 68];
261
- strokeWidth = [4, 5, 6, 7];
262
- }
263
-
264
- let prefixHover, suffixHover, prefixAlign, suffixAlign, prefixOffset, suffixOffset;
265
-
266
- if (align) {
267
- prefixAlign = align;
268
- suffixAlign = align;
269
- } else {
270
- if (prefix && suffix) {
271
- prefixAlign = 'initial';
272
- suffixAlign = 'initial';
273
- } else if (prefix) {
274
- prefixAlign = 'initial';
275
- } else if (suffix) {
276
- suffixAlign = 'middle';
277
- }
278
- }
279
-
280
- if (prefixAlign === 'middle') {
281
- prefixOffset = {};
282
- } else {
283
- prefixOffset = offset;
284
- }
285
-
286
- if (suffixAlign === 'middle') {
287
- suffixOffset = {};
288
- } else {
289
- suffixOffset = offset;
290
- }
291
-
292
- if (prefix) {
293
- prefixHover = {
294
- '&:hover > #prefix-span > #prefix': _extends({
295
- color: hoverColor
296
- }, prefix.type.hover)
297
- };
298
- prefix = cloneElement(prefix, {
299
- id: 'prefix',
300
- sx: _extends({
301
- position: 'relative',
302
- height: height,
303
- width: width,
304
- mr: children ? margin : [0],
305
- strokeWidth: strokeWidth,
306
- verticalAlign: prefixAlign,
307
- transition: 'color 0.15s, transform 0.15s'
308
- }, prefix.props.sx)
309
- });
310
- }
311
-
312
- if (suffix) {
313
- suffixHover = {
314
- '&:hover > #suffix-span >#suffix': _extends({
315
- color: hoverColor
316
- }, suffix.type.hover)
317
- };
318
- suffix = cloneElement(suffix, {
319
- id: 'suffix',
320
- sx: _extends({
321
- height: height,
322
- width: width,
323
- ml: children ? margin : [0],
324
- strokeWidth: strokeWidth,
325
- verticalAlign: suffixAlign,
326
- transition: 'color 0.15s, transform 0.15s'
327
- }, suffix.props.sx)
328
- });
329
- }
330
-
331
- let sizeStyles = getSizeStyles(size);
332
-
333
- const style = _extends({}, sizeStyles, {
334
- lineHeight: 1.05,
335
- border: 'none',
336
- background: 'transparent',
337
- display: 'block',
338
- color: baseColor,
339
- padding: [0],
340
- textAlign: 'left',
341
- cursor: 'pointer',
342
- width: 'fit-content',
343
- '@media (hover: hover) and (pointer: fine)': _extends({
344
- '&:hover': {
345
- color: hoverColor
346
- }
347
- }, suffixHover, prefixHover)
348
- }, sx);
349
-
350
- const Inner = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Box, {
351
- as: "span",
352
- id: "prefix-span",
353
- sx: _extends({
354
- display: 'inline-block'
355
- }, prefixOffset)
356
- }, prefix && prefix), /*#__PURE__*/React.createElement(Box, {
357
- as: "span",
358
- sx: {
359
- transition: 'color 0.15s'
360
- }
361
- }, children), /*#__PURE__*/React.createElement(Box, {
362
- as: "span",
363
- id: "suffix-span",
364
- sx: _extends({
365
- display: 'inline-block'
366
- }, suffixOffset)
367
- }, suffix && suffix));
368
-
369
- if (href) {
370
- return /*#__PURE__*/React.createElement(Link$1, _extends({
371
- ref: ref,
372
- href: href,
373
- internal: internal,
374
- tracking: tracking,
375
- sx: _extends({}, style, {
376
- textDecoration: 'none'
377
- })
378
- }, props), Inner);
379
- } else {
380
- return /*#__PURE__*/React.createElement(Box, _extends({
381
- ref: ref,
382
- as: "button",
383
- sx: style
384
- }, props), Inner);
385
- }
386
- };
387
-
388
- var button = forwardRef(Button);
389
-
390
- const _excluded$d = ["label", "children", "inverted", "color", "href", "internal", "tracking", "sx"];
391
-
392
- const Callout = (_ref, ref) => {
393
- let {
394
- label,
395
- children,
396
- inverted,
397
- color,
398
- href,
399
- internal,
400
- tracking,
401
- sx
402
- } = _ref,
403
- props = _objectWithoutPropertiesLoose(_ref, _excluded$d);
404
-
405
- const baseColor = color || (inverted ? 'secondary' : 'primary');
406
- const hoverColor = color ? 'primary' : inverted ? 'primary' : 'secondary';
407
-
408
- const style = _extends({
409
- border: 'none',
410
- padding: [0],
411
- fontSize: [3, 3, 3, 4],
412
- color: baseColor,
413
- background: 'transparent',
414
- textDecoration: 'none',
415
- fontFamily: 'body',
416
- lineHeight: 'h3',
417
- letterSpacing: 'body',
418
- width: 'fit-content',
419
- cursor: 'pointer',
420
- textAlign: 'left',
421
- mb: [1],
422
- '@media (hover: hover) and (pointer: fine)': {
423
- '&:hover > #container > #arrow': {
424
- transform: 'rotate(45deg)',
425
- fill: hoverColor
426
- },
427
- '&:hover': {
428
- color: hoverColor
429
- }
430
- }
431
- }, sx);
432
-
433
- const Inner = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Box, {
434
- sx: {
435
- transition: '0.15s',
436
- letterSpacing: 'body',
437
- pb: ['6px']
438
- }
439
- }, children), /*#__PURE__*/React.createElement(Box, {
440
- sx: {
441
- transition: '0.15s',
442
- display: 'inline-block',
443
- textTransform: 'uppercase',
444
- letterSpacing: 'smallcaps',
445
- fontFamily: 'heading',
446
- fontSize: [2, 2, 2, 3]
447
- }
448
- }, label), /*#__PURE__*/React.createElement(Box, {
449
- as: "span",
450
- id: "container",
451
- sx: {
452
- ml: [2],
453
- display: 'inline-block'
454
- }
455
- }, /*#__PURE__*/React.createElement(Arrow, {
456
- id: "arrow",
457
- sx: {
458
- transition: 'fill 0.15s, transform 0.15s',
459
- position: 'relative',
460
- top: ['2px'],
461
- color: baseColor,
462
- height: [15, 15, 15, 17],
463
- width: [15, 15, 15, 17]
464
- }
465
- })));
466
-
467
- if (href) {
468
- return /*#__PURE__*/React.createElement(Link$1, _extends({
469
- ref: ref,
470
- href: href,
471
- internal: internal,
472
- tracking: tracking,
473
- sx: style
474
- }, props), Inner);
475
- } else {
476
- return /*#__PURE__*/React.createElement(Box, _extends({
477
- ref: ref,
478
- as: "button",
479
- sx: style
480
- }, props), Inner);
481
- }
482
- };
483
-
484
- var callout = forwardRef(Callout);
485
-
486
- const _excluded$c = ["colormap", "label", "clim", "setClim", "setClimStep", "discrete", "units", "width", "height", "format", "horizontal", "bottom", "sx", "sxClim"];
487
- const styles$1 = {
488
- clim: setClim => {
489
- return {
490
- fontFamily: 'mono',
491
- fontSize: ['9px', 0, 0, 1],
492
- letterSpacing: 'smallcaps',
493
- textTransform: 'uppercase',
494
- '@media (hover: hover) and (pointer: fine)': {
495
- '&:hover': {
496
- borderBottom: setClim ? ({
497
- colors
498
- }) => `solid 1px ${colors.primary} !important` : 'unset'
499
- }
500
- },
501
- '&:focus': {
502
- outline: 'none',
503
- borderBottom: setClim ? ({
504
- colors
505
- }) => `solid 1px ${colors.primary} !important` : 'unset'
506
- },
507
- transition: 'border 0.15s',
508
- userSelect: setClim ? 'none !important' : 'unset',
509
- width: 'fit-content',
510
- minWidth: 'fit-content'
511
- };
512
- }
513
- };
514
- const DIMENSIONS = {
515
- width: ['10px', '16px', '16px', '17px'],
516
- height: ['80px', '110px', '110px', '130px']
517
- };
518
-
519
- const Gradient = ({
520
- colormap,
521
- discrete,
522
- horizontal,
523
- width,
524
- height
525
- }) => {
526
- const step = 1 / colormap.length * 100;
527
- const values = colormap.map((d, i) => {
528
- return `rgb(${d}) ${i * step}% ${discrete && i < colormap.length - 1 ? `${(i + 1) * step}%` : ''}`;
529
- });
530
- const css = `linear-gradient(to ${horizontal ? 'right' : 'top'}, ${values.join(',')})`;
531
- return /*#__PURE__*/React.createElement(Box, {
532
- sx: _extends({}, horizontal ? {
533
- width: width || DIMENSIONS.height,
534
- height: height || DIMENSIONS.width
535
- } : {
536
- width: width || DIMENSIONS.width,
537
- minHeight: height || DIMENSIONS.height
538
- }, {
539
- mt: horizontal ? ['1px', '1px', '1px', 0] : 0,
540
- border: ({
541
- colors
542
- }) => `solid 1px ${colors.hinted}`,
543
- background: css
544
- })
545
- });
546
- };
547
-
548
- const Label = ({
549
- label,
550
- units,
551
- horizontal
552
- }) => /*#__PURE__*/React.createElement(Box, {
553
- sx: !horizontal && {
554
- width: ['13px', '17px', '17px', '19px'],
555
- alignSelf: 'flex-end'
556
- }
557
- }, /*#__PURE__*/React.createElement(Box, {
558
- sx: _extends({
559
- mb: horizontal ? 0 : ['-4px', '-4px', '-4px', '-3px'],
560
- fontFamily: 'mono',
561
- fontSize: ['9px', 0, 0, 1],
562
- letterSpacing: 'smallcaps',
563
- textTransform: 'uppercase'
564
- }, horizontal ? {} : {
565
- writingMode: 'vertical-rl',
566
- transform: 'rotate(180deg)',
567
- whiteSpace: 'nowrap',
568
- display: 'inline-block',
569
- overflow: 'visible'
570
- })
571
- }, label, ' ', /*#__PURE__*/React.createElement(Box, {
572
- as: "span",
573
- sx: {
574
- textTransform: 'none',
575
- color: 'secondary',
576
- display: 'inline-block'
577
- }
578
- }, units)));
579
-
580
- const Colorbar = _ref => {
581
- let {
582
- colormap,
583
- label,
584
- clim,
585
- setClim,
586
- setClimStep = 1,
587
- discrete,
588
- units,
589
- width,
590
- height,
591
- format = d => d,
592
- horizontal = false,
593
- bottom = false,
594
- sx,
595
- sxClim
596
- } = _ref,
597
- props = _objectWithoutPropertiesLoose(_ref, _excluded$c);
598
-
599
- if (!Array.isArray(colormap)) {
600
- throw new Error(`expected array for colormap, got '${colormap}'.`);
601
- }
602
-
603
- const climRef = [useRef(), useRef()];
604
- const [climMinDragging, setClimMinDragging] = useState(false);
605
- const [climMaxDragging, setClimMaxDragging] = useState(false);
606
- let x,
607
- y,
608
- dx,
609
- dy = 0;
610
- let id = null;
611
- let init = [0, 0];
612
- let scale = setClimStep;
613
-
614
- const draggingFunction = e => {
615
- if (id === 'min' && !climMinDragging) setClimMinDragging(true);
616
- if (id === 'max' && !climMaxDragging) setClimMaxDragging(true);
617
- dx = e.pageX - x;
618
- dy = e.pageY - y;
619
-
620
- if (horizontal) {
621
- if (id === 'min') setClim(prev => [Math.min(init[0] + dx * scale, init[1]), prev[1]]);
622
- if (id === 'max') setClim(prev => [prev[0], Math.max(init[1] + dx * scale, init[0])]);
623
- } else {
624
- if (id === 'min') setClim(prev => [Math.min(init[0] - dy * scale, init[1]), prev[1]]);
625
- if (id === 'max') setClim(prev => [prev[0], Math.max(init[1] - dy * scale, init[0])]);
626
- }
627
- };
628
-
629
- const handleMouseDown = e => {
630
- y = e.pageY;
631
- x = e.pageX;
632
- id = e.target.id;
633
- init = clim;
634
- document.body.setAttribute('style', horizontal ? 'cursor: ew-resize !important' : 'cursor: ns-resize !important');
635
- document.addEventListener('mousemove', draggingFunction);
636
-
637
- const updater = () => {
638
- document.body.setAttribute('style', 'cursor: unset');
639
- document.removeEventListener('mousemove', draggingFunction);
640
- window.removeEventListener('mouseup', updater);
641
- if (id === 'min') setClimMinDragging(false);
642
- if (id === 'max') setClimMaxDragging(false);
643
- };
644
-
645
- window.addEventListener('mouseup', updater);
646
- };
647
-
648
- const increment = e => {
649
- if (climRef[0].current === document.activeElement) {
650
- e.preventDefault();
651
- setClim(prev => [Math.min(prev[0] + scale, prev[1]), prev[1]]);
652
- climRef[0].current.focus();
653
- }
654
-
655
- if (climRef[1].current === document.activeElement) {
656
- e.preventDefault();
657
- setClim(prev => [prev[0], Math.max(prev[1] + scale, prev[0])]);
658
- climRef[1].current.focus();
659
- }
660
- };
661
-
662
- const decrement = e => {
663
- if (climRef[0].current === document.activeElement) {
664
- e.preventDefault();
665
- setClim(prev => [Math.min(prev[0] - scale, prev[1]), prev[1]]);
666
- climRef[0].current.focus();
667
- }
668
-
669
- if (climRef[1].current === document.activeElement) {
670
- e.preventDefault();
671
- setClim(prev => [prev[0], Math.max(prev[1] - scale, prev[0])]);
672
- climRef[1].current.focus();
673
- }
674
- };
675
-
676
- useEffect(() => {
677
- const listener = e => {
678
- if (['ArrowUp', 'ArrowRight'].includes(e.code) || ['ArrowUp', 'ArrowRight'].includes(e.key)) {
679
- increment(e);
680
- }
681
-
682
- if (['ArrowDown', 'ArrowLeft'].includes(e.code) || ['ArrowDown', 'ArrowLeft'].includes(e.key)) {
683
- decrement(e);
684
- }
685
- };
686
-
687
- window.addEventListener('keydown', listener);
688
- return () => {
689
- window.removeEventListener('keydown', listener);
690
- };
691
- }, [clim]);
692
-
693
- const ClimMin = () => {
694
- return /*#__PURE__*/React.createElement(Box, {
695
- id: "min",
696
- ref: climRef[0],
697
- tabIndex: 0,
698
- sx: _extends({}, styles$1.clim(setClim), {
699
- ml: label ? horizontal ? bottom ? '0px' : '10px' : ['2px', '1px', '1px', '2px'] : 0,
700
- mr: horizontal ? ['2px', '1px', '1px', '2px'] : 0,
701
- mb: horizontal ? 0 : ['-2px', '-2px', '-2px', '-3px'],
702
- borderBottom: setClim ? climMinDragging ? ({
703
- colors
704
- }) => `solid 1px ${colors.primary}` : ({
705
- colors
706
- }) => `solid 1px ${colors.secondary}` : 'unset',
707
- cursor: setClim ? horizontal ? 'ew-resize' : 'ns-resize' : 'default'
708
- }, sxClim),
709
- onMouseDown: setClim ? handleMouseDown : () => {},
710
- onClick: () => climRef[0].current.focus()
711
- }, format(clim[0]));
712
- };
713
-
714
- const ClimMax = () => {
715
- return /*#__PURE__*/React.createElement(Box, {
716
- id: "max",
717
- ref: climRef[1],
718
- tabIndex: 0,
719
- sx: _extends({}, styles$1.clim(setClim), {
720
- ml: horizontal ? ['2px', '1px', '1px', '2px'] : ['2px', '1px', '1px', '2px'],
721
- mt: horizontal ? 0 : ['-2px', '-3px', '-3px', '-3px'],
722
- borderBottom: setClim ? climMaxDragging ? ({
723
- colors
724
- }) => `solid 1px ${colors.primary}` : ({
725
- colors
726
- }) => `solid 1px ${colors.secondary}` : 'unset',
727
- cursor: setClim ? horizontal ? 'ew-resize' : 'ns-resize' : 'default'
728
- }, sxClim),
729
- onMouseDown: setClim ? handleMouseDown : () => {},
730
- onClick: () => climRef[1].current.focus()
731
- }, format(clim[1]));
732
- };
733
-
734
- return /*#__PURE__*/React.createElement(Flex, _extends({}, props, {
735
- sx: _extends({
736
- flexDirection: 'row',
737
- alignItems: 'start',
738
- justifyContent: 'flex-start',
739
- gap: ['3px', '6px', '6px', '7px'],
740
- height: !horizontal ? '100%' : 'unset'
741
- }, sx)
742
- }), label && /*#__PURE__*/React.createElement(Label, {
743
- label: label,
744
- units: units,
745
- horizontal: horizontal
746
- }), /*#__PURE__*/React.createElement(Flex, {
747
- sx: {
748
- flexGrow: horizontal ? 1 : 'unset',
749
- flexDirection: 'column',
750
- ml: bottom && label ? '4px' : '0px',
751
- height: !horizontal ? '100%' : 'unset'
752
- }
753
- }, /*#__PURE__*/React.createElement(Flex, {
754
- sx: {
755
- gap: ['3px', '6px', '6px', '7px'],
756
- height: !horizontal ? '100%' : 'unset'
757
- }
758
- }, horizontal && clim && !bottom && /*#__PURE__*/React.createElement(ClimMin, null), /*#__PURE__*/React.createElement(Gradient, {
759
- colormap: colormap,
760
- horizontal: horizontal,
761
- discrete: discrete,
762
- width: width,
763
- height: height
764
- }), horizontal && clim && !bottom && /*#__PURE__*/React.createElement(ClimMax, null)), horizontal && clim && bottom && /*#__PURE__*/React.createElement(Flex, {
765
- sx: {
766
- justifyContent: 'space-between'
767
- }
768
- }, /*#__PURE__*/React.createElement(ClimMin, null), /*#__PURE__*/React.createElement(ClimMax, null))), !horizontal && /*#__PURE__*/React.createElement(Flex, {
769
- sx: {
770
- flexDirection: 'column-reverse',
771
- justifyContent: 'space-between',
772
- height: height || DIMENSIONS.height
773
- }
774
- }, clim && /*#__PURE__*/React.createElement(ClimMin, null), clim && /*#__PURE__*/React.createElement(ClimMax, null)));
775
- };
776
-
777
- const _excluded$b = ["start", "width", "dl", "dr", "children", "sx"];
778
-
779
- const Column = _ref => {
780
- let {
781
- start,
782
- width,
783
- dl,
784
- dr,
785
- children,
786
- sx
787
- } = _ref,
788
- props = _objectWithoutPropertiesLoose(_ref, _excluded$b);
789
-
790
- start = start || 'auto';
791
- width = width || 'auto';
792
-
793
- const makeArray = input => {
794
- if (input && !Array.isArray(input)) {
795
- input = [input];
796
- }
797
-
798
- if (![1, 2, 4].includes(input.length)) {
799
- throw new Error('Array length must be 1, 2, or 4');
800
- }
801
-
802
- if (Array.isArray(input) && input.length == 1) {
803
- input = input.map(d => [d, d, d, d]).flat();
804
- } else if (Array.isArray(input) && input.length == 2) {
805
- input = input.map(d => [d, d]).flat();
806
- }
807
-
808
- return input;
809
- };
810
-
811
- start = makeArray(start);
812
- width = makeArray(width);
813
- const end = start.map((d, i) => {
814
- if (d == 'auto') return 'auto';
815
- return d + width[i];
816
- });
817
- let ml, mr;
818
-
819
- if (dl) {
820
- if (![0.5, 1].includes(dl)) {
821
- throw new Error('dl must be 0.5 or 1');
822
- }
823
-
824
- if (dl === 0.5) {
825
- ml = ['-12px', -3, -3, -4];
826
- }
827
-
828
- if (dl === 1) {
829
- ml = [-4, -5, -5, -6];
830
- }
831
- }
832
-
833
- if (dr) {
834
- if (![0.5, 1].includes(dr)) {
835
- throw new Error('dr must be 0.5 or 1');
836
- }
837
-
838
- if (dr === 0.5) {
839
- mr = ['-12px', -3, -3, -4];
840
- }
841
-
842
- if (dr === 1) {
843
- mr = [-4, -5, -5, -6];
844
- }
845
- }
846
-
847
- return /*#__PURE__*/React.createElement(Box, _extends({}, props, {
848
- sx: _extends({
849
- gridColumnStart: start,
850
- gridColumnEnd: end,
851
- ml: ml,
852
- mr: mr
853
- }, sx)
854
- }), children);
855
- };
856
-
857
- const Meta = ({
858
- title,
859
- description,
860
- card
861
- }) => {
862
- title = title ? title : 'carbonplan';
863
- description = description ? description : 'Data and science for climate action.';
864
- card = card ? card : 'https://images.carbonplan.org/social/homepage.png';
865
- return /*#__PURE__*/React.createElement(Head, null, /*#__PURE__*/React.createElement("title", null, title), /*#__PURE__*/React.createElement("meta", {
866
- name: "description",
867
- content: description
868
- }), /*#__PURE__*/React.createElement("meta", {
869
- name: "viewport",
870
- content: "initial-scale=1.0, width=device-width"
871
- }), /*#__PURE__*/React.createElement("link", {
872
- rel: "canonical",
873
- content: "https://carbonplan.org/"
874
- }), /*#__PURE__*/React.createElement("link", {
875
- rel: "icon",
876
- type: "image/svg+xml",
877
- href: "https://images.carbonplan.org/favicon.svg"
878
- }), /*#__PURE__*/React.createElement("link", {
879
- rel: "preload",
880
- href: "https://fonts.carbonplan.org/relative/relative-book-pro.woff2",
881
- as: "font",
882
- type: "font/woff2",
883
- crossOrigin: "anonymous"
884
- }), /*#__PURE__*/React.createElement("link", {
885
- rel: "preload",
886
- href: "https://fonts.carbonplan.org/relative/relative-medium-pro.woff2",
887
- as: "font",
888
- type: "font/woff2",
889
- crossOrigin: "anonymous"
890
- }), /*#__PURE__*/React.createElement("link", {
891
- rel: "preload",
892
- href: "https://fonts.carbonplan.org/relative/relative-mono-11-pitch-pro.woff2",
893
- as: "font",
894
- type: "font/woff2",
895
- crossOrigin: "anonymous"
896
- }), /*#__PURE__*/React.createElement("link", {
897
- rel: "preload",
898
- href: "https://fonts.carbonplan.org/relative/relative-faux-book-pro.woff2",
899
- as: "font",
900
- type: "font/woff2",
901
- crossOrigin: "anonymous"
902
- }), /*#__PURE__*/React.createElement("link", {
903
- rel: "manifest",
904
- href: "https://images.carbonplan.org/manifest.json"
905
- }), /*#__PURE__*/React.createElement("meta", {
906
- name: "theme-color",
907
- content: "#1b1e23"
908
- }), /*#__PURE__*/React.createElement("link", {
909
- rel: "alternate icon",
910
- type: "image/png",
911
- href: "https://images.carbonplan.org/favicon.png"
912
- }), /*#__PURE__*/React.createElement("link", {
913
- rel: "mask-icon",
914
- href: "https://images.carbonplan.org/safari-pinned-tab.svg",
915
- color: "#000000"
916
- }), /*#__PURE__*/React.createElement("link", {
917
- rel: "apple-touch-icon",
918
- sizes: "180x180",
919
- href: "https://images.carbonplan.org/apple-touch-icon.png"
920
- }), /*#__PURE__*/React.createElement("meta", {
921
- name: "msapplication-TileColor",
922
- content: "#1b1e23"
923
- }), /*#__PURE__*/React.createElement("meta", {
924
- name: "msapplication-TileImage",
925
- content: "https://images.carbonplan.org/mstile-144x144.png"
926
- }), /*#__PURE__*/React.createElement("meta", {
927
- name: "msapplication-config",
928
- content: "https://images.carbonplan.org/browserconfig.xml"
929
- }), /*#__PURE__*/React.createElement("meta", {
930
- property: "og:title",
931
- content: title
932
- }), /*#__PURE__*/React.createElement("meta", {
933
- property: "og:description",
934
- content: description
935
- }), /*#__PURE__*/React.createElement("meta", {
936
- property: "og:image",
937
- content: card
938
- }), /*#__PURE__*/React.createElement("meta", {
939
- property: "og:url",
940
- content: "https://carbonplan.org"
941
- }), /*#__PURE__*/React.createElement("meta", {
942
- name: "twitter:title",
943
- content: title
944
- }), /*#__PURE__*/React.createElement("meta", {
945
- name: "twitter:description",
946
- content: description
947
- }), /*#__PURE__*/React.createElement("meta", {
948
- name: "twitter:image",
949
- content: card
950
- }), /*#__PURE__*/React.createElement("meta", {
951
- name: "twitter:card",
952
- content: "summary_large_image"
953
- }));
954
- };
955
-
956
- const Logo = _ref => {
957
- let props = _extends({}, _ref);
958
-
959
- return /*#__PURE__*/React.createElement(Box, _extends({
960
- as: "svg",
961
- width: "150",
962
- fill: "currentColor",
963
- stroke: "none",
964
- viewBox: "0 0 151.1 28.8"
965
- }, props), /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("path", {
966
- d: "M9.7,20.1c-1.3-1.4-2-3.1-2-5.2c0-2.1,0.7-3.9,2-5.2c1.3-1.4,3-2,5.1-2c1.7,0,3.1,0.4,4.3,1.3 c1.1,0.9,1.8,2.1,2.1,3.5c0,0.1,0,0.2,0,0.3s-0.1,0.2-0.2,0.2h-2.3c-0.2,0-0.3-0.1-0.4-0.2c-0.3-0.8-0.7-1.4-1.3-1.8 c-0.6-0.4-1.4-0.6-2.2-0.6c-1.3,0-2.3,0.4-3,1.2c-0.8,0.8-1.1,1.9-1.1,3.4c0,1.5,0.4,2.6,1.1,3.4c0.8,0.8,1.8,1.2,3,1.2 c0.8,0,1.6-0.2,2.2-0.6c0.6-0.4,1.1-1,1.3-1.8c0.1-0.2,0.2-0.2,0.4-0.3H21c0.1,0,0.2,0.1,0.2,0.2c0,0.1,0,0.2,0,0.3 c-0.3,1.4-1,2.6-2.1,3.5c-1.1,0.9-2.5,1.3-4.3,1.3C12.7,22.1,11,21.4,9.7,20.1z"
967
- })), /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("path", {
968
- d: "M22.5,17.6c0-1.5,0.5-2.6,1.6-3.5c1.1-0.8,2.4-1.2,4.1-1.2c1.1,0,2.4,0.2,3.7,0.6V13c0-0.9-0.3-1.6-0.8-2.1 c-0.5-0.5-1.2-0.8-2.2-0.8c-1.4,0-2.4,0.6-2.9,1.8c-0.1,0.2-0.2,0.2-0.4,0.2h-2.3c-0.1,0-0.2-0.1-0.2-0.2c0-0.1,0-0.2,0-0.3 c0.3-1.2,0.9-2.2,1.9-2.9c1-0.8,2.3-1.1,3.8-1.1C30.6,7.6,32,8.1,33,9c1,0.9,1.5,2.2,1.5,3.8V19c0,1.1,0.2,1.9,0.5,2.6 c0,0.1,0.1,0.1,0.1,0.1c0,0.1-0.1,0.1-0.3,0.1h-2.8c-0.2,0-0.3-0.1-0.3-0.3v-1c-1.1,1.1-2.5,1.6-4.3,1.6c-1.4,0-2.6-0.4-3.6-1.2 C23,20.1,22.5,19,22.5,17.6z M25.4,17.5c0,0.6,0.2,1.1,0.7,1.5c0.4,0.4,1.1,0.5,1.9,0.5c1.1,0,2-0.3,2.8-0.9 c0.8-0.6,1.1-1.5,1.1-2.6c-1.3-0.4-2.5-0.6-3.6-0.6c-0.8,0-1.5,0.2-2.1,0.5C25.7,16.3,25.4,16.8,25.4,17.5z"
969
- })), /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("path", {
970
- d: "M37,21.6V8.2c0-0.2,0.1-0.3,0.3-0.3h2.2c0.2,0,0.3,0.1,0.3,0.3v1.1c1-1.1,2.3-1.6,3.7-1.6 c0.8,0,1.7,0.1,2.5,0.4c0.2,0.1,0.3,0.3,0.3,0.5v2.2c0,0.2-0.1,0.3-0.2,0.3c0,0-0.1,0-0.2-0.1c-1.1-0.5-2-0.8-2.9-0.8 c-0.9,0-1.7,0.4-2.3,1.1c-0.6,0.7-0.9,1.7-0.9,3v7.3c0,0.2-0.1,0.3-0.3,0.3h-2.2C37.1,21.8,37,21.7,37,21.6z"
971
- })), /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("path", {
972
- d: "M47.6,21.6V2.7c0-0.2,0.1-0.3,0.3-0.3H50c0.2,0,0.3,0.1,0.3,0.3v6.5c1.3-1.1,2.7-1.6,4.3-1.6 c1.9,0,3.4,0.7,4.6,2c1.1,1.3,1.7,3.1,1.7,5.3c0,2.2-0.6,4-1.7,5.3c-1.1,1.3-2.7,2-4.6,2c-1.8,0-3.2-0.5-4.3-1.6v1 c0,0.2-0.1,0.3-0.3,0.3h-2.2C47.7,21.8,47.6,21.7,47.6,21.6z M51.2,11.5c-0.7,0.9-1.1,2-1.1,3.3c0,1.4,0.4,2.5,1.1,3.3 s1.7,1.3,2.9,1.3c1.2,0,2.2-0.4,2.9-1.3c0.7-0.9,1.1-2,1.1-3.3c0-1.4-0.4-2.5-1.1-3.3c-0.7-0.9-1.7-1.3-2.9-1.3 C52.9,10.2,51.9,10.7,51.2,11.5z"
973
- })), /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("path", {
974
- d: "M64.3,20.1c-1.4-1.4-2.1-3.1-2.1-5.2c0-2.1,0.7-3.9,2.1-5.2c1.4-1.4,3.1-2,5.2-2c2.1,0,3.8,0.7,5.2,2 c1.4,1.4,2.1,3.1,2.1,5.2c0,2.1-0.7,3.9-2.1,5.2c-1.4,1.4-3.1,2-5.2,2C67.4,22.1,65.7,21.4,64.3,20.1z M66.4,11.5 c-0.8,0.8-1.2,2-1.2,3.4c0,1.4,0.4,2.5,1.2,3.4s1.9,1.3,3.1,1.3c1.3,0,2.3-0.4,3.1-1.3c0.8-0.8,1.2-2,1.2-3.4 c0-1.4-0.4-2.5-1.2-3.4c-0.8-0.8-1.9-1.3-3.1-1.3C68.2,10.2,67.2,10.7,66.4,11.5z"
975
- })), /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("path", {
976
- d: "M78.7,21.6V8.2c0-0.2,0.1-0.3,0.3-0.3h2.2c0.2,0,0.3,0.1,0.3,0.3v1.3c1.3-1.2,2.7-1.8,4.4-1.8 c1.5,0,2.7,0.4,3.5,1.3c0.8,0.9,1.3,2,1.3,3.6v9.1c0,0.2-0.1,0.3-0.3,0.3h-2.2c-0.2,0-0.3-0.1-0.3-0.3v-8.3c0-2-0.9-3.1-2.8-3.1 c-1.1,0-1.9,0.4-2.7,1.2c-0.7,0.8-1.1,2-1.1,3.5v6.6c0,0.2-0.1,0.3-0.3,0.3h-2.2C78.7,21.8,78.7,21.7,78.7,21.6z"
977
- })), /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("path", {
978
- d: "M101.7,27.1V8.2c0-0.2,0.1-0.3,0.3-0.3h2.2c0.2,0,0.3,0.1,0.3,0.3v1c1.1-1.1,2.5-1.6,4.3-1.6 c1.9,0,3.4,0.7,4.6,2s1.7,3.1,1.7,5.3c0,2.2-0.6,4-1.7,5.3c-1.1,1.3-2.7,2-4.6,2c-1.5,0-3-0.5-4.3-1.6v6.6c0,0.2-0.1,0.3-0.3,0.3 H102C101.8,27.3,101.7,27.2,101.7,27.1z M105.3,11.5c-0.7,0.9-1.1,2-1.1,3.3c0,1.4,0.4,2.5,1.1,3.3s1.7,1.3,2.9,1.3 c1.2,0,2.2-0.4,2.9-1.3c0.7-0.9,1.1-2,1.1-3.3c0-1.4-0.4-2.5-1.1-3.3c-0.7-0.9-1.7-1.3-2.9-1.3C107,10.2,106,10.7,105.3,11.5z"
979
- })), /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("path", {
980
- d: "M117.2,21.6V2.7c0-0.2,0.1-0.3,0.3-0.3h2.2c0.2,0,0.3,0.1,0.3,0.3v18.9c0,0.2-0.1,0.3-0.3,0.3h-2.2 C117.3,21.8,117.2,21.7,117.2,21.6z"
981
- })), /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("path", {
982
- d: "M122,17.6c0-1.5,0.5-2.6,1.6-3.5c1.1-0.8,2.4-1.2,4.1-1.2c1.1,0,2.4,0.2,3.7,0.6V13c0-0.9-0.3-1.6-0.8-2.1 c-0.5-0.5-1.2-0.8-2.2-0.8c-1.4,0-2.4,0.6-2.9,1.8c-0.1,0.2-0.2,0.2-0.4,0.2h-2.3c-0.1,0-0.2-0.1-0.2-0.2c0-0.1,0-0.2,0-0.3 c0.3-1.2,0.9-2.2,1.9-2.9c1-0.8,2.3-1.1,3.8-1.1c1.7,0,3.1,0.5,4.2,1.4s1.5,2.2,1.5,3.8V19c0,1.1,0.2,1.9,0.5,2.6 c0,0.1,0.1,0.1,0.1,0.1c0,0.1-0.1,0.1-0.3,0.1h-2.8c-0.2,0-0.3-0.1-0.3-0.3v-1c-1.1,1.1-2.5,1.6-4.3,1.6c-1.4,0-2.6-0.4-3.6-1.2 C122.5,20.1,122,19,122,17.6z M124.9,17.5c0,0.6,0.2,1.1,0.7,1.5c0.4,0.4,1.1,0.5,1.9,0.5c1.1,0,2-0.3,2.8-0.9 c0.8-0.6,1.1-1.5,1.1-2.6c-1.3-0.4-2.5-0.6-3.6-0.6c-0.8,0-1.5,0.2-2.1,0.5C125.2,16.3,124.9,16.8,124.9,17.5z"
983
- })), /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("path", {
984
- d: "M136.9,21.6V8.2c0-0.2,0.1-0.3,0.3-0.3h2.2c0.2,0,0.3,0.1,0.3,0.3v1.3c1.3-1.2,2.7-1.8,4.4-1.8 c1.5,0,2.7,0.4,3.5,1.3c0.8,0.9,1.3,2,1.3,3.6v9.1c0,0.2-0.1,0.3-0.3,0.3h-2.2c-0.2,0-0.3-0.1-0.3-0.3v-8.3c0-2-0.9-3.1-2.8-3.1 c-1.1,0-1.9,0.4-2.7,1.2c-0.7,0.8-1.1,2-1.1,3.5v6.6c0,0.2-0.1,0.3-0.3,0.3h-2.2C137,21.8,136.9,21.7,136.9,21.6z"
985
- })), /*#__PURE__*/React.createElement("path", {
986
- d: "M97.6,14.9c0,4.2-0.6,8.3-1.6,12.3c0,0.1-0.1,0.2-0.2,0.2h-2.4c-0.1,0-0.2-0.1-0.2-0.3c1.1-3.9,1.7-8,1.7-12.2 s-0.6-8.3-1.7-12.2c0-0.1,0.1-0.3,0.2-0.3l2.4,0c0.1,0,0.2,0.1,0.2,0.2C97.1,6.5,97.6,10.6,97.6,14.9z"
987
- }), /*#__PURE__*/React.createElement("path", {
988
- d: "M1.4,14.9C1.4,10.6,2,6.5,3,2.6c0-0.1,0.1-0.2,0.2-0.2l2.4,0c0.1,0,0.2,0.1,0.2,0.3c-1.1,3.9-1.7,8-1.7,12.2 s0.6,8.3,1.7,12.2c0,0.1-0.1,0.3-0.2,0.3H3.3c-0.1,0-0.2-0.1-0.2-0.2C2,23.2,1.4,19.1,1.4,14.9z"
989
- })));
990
- };
991
-
992
- const _excluded$a = ["children", "sx", "columns", "gap"];
993
-
994
- const Row = _ref => {
995
- let {
996
- children,
997
- sx,
998
- columns,
999
- gap
1000
- } = _ref,
1001
- props = _objectWithoutPropertiesLoose(_ref, _excluded$a);
1002
-
1003
- const makeArray = input => {
1004
- if (!Array.isArray(input)) {
1005
- input = [input, input, input, input];
1006
- }
1007
-
1008
- if (Array.isArray(input) && ![1, 2, 4].includes(input.length)) {
1009
- throw new Error('Array length must be 1, 2, or 4');
1010
- }
1011
-
1012
- if (Array.isArray(input) && input.length == 1) {
1013
- input = input.map(d => [d]).flat();
1014
- }
1015
-
1016
- if (Array.isArray(input) && input.length == 2) {
1017
- input = input.map(d => [d, d]).flat();
1018
- }
1019
-
1020
- return input;
1021
- };
1022
-
1023
- let columnGap, rowGap;
1024
-
1025
- if (Number.isInteger(gap) || Array.isArray(gap)) {
1026
- gap = makeArray(gap);
1027
- columnGap = gap;
1028
- rowGap = gap;
1029
- } else {
1030
- columnGap = [4, 5, 5, 6];
1031
- rowGap = [0, 0, 0, 0];
1032
- }
1033
-
1034
- if (Number.isInteger(columns) || Array.isArray(columns)) {
1035
- columns = makeArray(columns);
1036
- } else {
1037
- columns = [6, 8, 12, 12];
1038
- }
1039
-
1040
- return /*#__PURE__*/React.createElement(Grid, _extends({}, props, {
1041
- columns: columns,
1042
- sx: _extends({
1043
- columnGap: columnGap,
1044
- rowGap: rowGap
1045
- }, sx)
1046
- }), children);
1047
- };
1048
-
1049
- const _excluded$9 = ["value", "sx"];
1050
-
1051
- const Menu = _ref => {
1052
- let {
1053
- value,
1054
- sx
1055
- } = _ref,
1056
- props = _objectWithoutPropertiesLoose(_ref, _excluded$9);
1057
-
1058
- return /*#__PURE__*/React.createElement(IconButton, _extends({
1059
- sx: _extends({
1060
- cursor: 'pointer',
1061
- fill: 'none',
1062
- strokeWidth: '2px',
1063
- stroke: 'text',
1064
- '.paren': {
1065
- opacity: '0'
1066
- },
1067
- '@media (hover: hover) and (pointer: fine)': {
1068
- '&:hover .paren': {
1069
- opacity: '1'
1070
- }
1071
- }
1072
- }, sx),
1073
- "aria-label": "Toggle Menu"
1074
- }, props), !value && /*#__PURE__*/React.createElement("svg", {
1075
- style: {
1076
- width: '50px',
1077
- height: '30px',
1078
- transform: 'scale(2)',
1079
- marginTop: '-3px'
1080
- },
1081
- xmlns: "http://www.w3.org/2000/svg",
1082
- viewBox: "0 0 68 36"
1083
- }, /*#__PURE__*/React.createElement("line", {
1084
- x1: "52",
1085
- y1: "29.9",
1086
- x2: "16",
1087
- y2: "29.9"
1088
- }), /*#__PURE__*/React.createElement("line", {
1089
- x1: "52",
1090
- y1: "6.1",
1091
- x2: "16",
1092
- y2: "6.1"
1093
- }), /*#__PURE__*/React.createElement("line", {
1094
- x1: "52",
1095
- y1: "18",
1096
- x2: "16",
1097
- y2: "18"
1098
- }), /*#__PURE__*/React.createElement("path", {
1099
- style: {
1100
- transition: 'all 0.2s'
1101
- },
1102
- className: "paren",
1103
- d: "M6.4,1.2c-6.3,10.3-6.3,23.3,0,33.6"
1104
- }), /*#__PURE__*/React.createElement("path", {
1105
- style: {
1106
- transition: 'all 0.2s'
1107
- },
1108
- className: "paren",
1109
- d: "M61.6,34.8c6.3-10.3,6.3-23.3,0-33.6"
1110
- })), value && /*#__PURE__*/React.createElement("svg", {
1111
- style: {
1112
- width: '50px',
1113
- height: '30px',
1114
- transform: 'scale(2)',
1115
- marginTop: '-3px'
1116
- },
1117
- xmlns: "http://www.w3.org/2000/svg",
1118
- viewBox: "0 0 68 36"
1119
- }, /*#__PURE__*/React.createElement("line", {
1120
- x1: "50.85",
1121
- y1: "29.79",
1122
- x2: "17.15",
1123
- y2: "6.21"
1124
- }), /*#__PURE__*/React.createElement("line", {
1125
- x1: "17.15",
1126
- y1: "29.79",
1127
- x2: "50.85",
1128
- y2: "6.21"
1129
- }), /*#__PURE__*/React.createElement("path", {
1130
- style: {
1131
- transition: 'all 0.2s'
1132
- },
1133
- className: "paren",
1134
- d: "M6.4,1.2c-6.3,10.3-6.3,23.3,0,33.6"
1135
- }), /*#__PURE__*/React.createElement("path", {
1136
- style: {
1137
- transition: 'all 0.2s'
1138
- },
1139
- className: "paren",
1140
- d: "M61.6,34.8c6.3-10.3,6.3-23.3,0-33.6"
1141
- })));
1142
- };
1143
-
1144
- const sx$1 = {
1145
- link: (current, label, first = false) => {
1146
- return {
1147
- width: 'auto',
1148
- color: current === label ? 'secondary' : 'text',
1149
- fontSize: [6, 6, 7, 8],
1150
- fontFamily: 'heading',
1151
- letterSpacing: 'heading',
1152
- borderStyle: 'solid',
1153
- borderColor: 'muted',
1154
- borderWidth: '0px',
1155
- borderBottomWidth: '1px',
1156
- borderTopWidth: first ? '1px' : '0px',
1157
- py: [3, 3, 4, 5],
1158
- textDecoration: 'none',
1159
- display: 'block',
1160
- position: 'relative',
1161
- transition: 'color 0.15s',
1162
- '@media (hover: hover) and (pointer: fine)': {
1163
- '&:hover > #arrow': {
1164
- opacity: 1
1165
- }
1166
- },
1167
- '&:hover': {
1168
- color: current == label ? 'secondary' : 'text'
1169
- }
1170
- };
1171
- }
1172
- };
1173
- const links = [{
1174
- url: 'about',
1175
- display: 'About'
1176
- }, {
1177
- url: 'research',
1178
- display: 'Research'
1179
- }, {
1180
- url: 'blog',
1181
- display: 'Blog'
1182
- }, {
1183
- url: 'press',
1184
- display: 'Press'
1185
- }];
1186
-
1187
- const HoverArrow = () => {
1188
- return /*#__PURE__*/React.createElement(Arrow, {
1189
- id: "arrow",
1190
- sx: {
1191
- pointerEvents: 'none',
1192
- display: 'inline-block',
1193
- position: 'absolute',
1194
- left: ['-60px', '-68px', '-80px', '-104px'],
1195
- top: ['32px', '32px', '46px', '62px'],
1196
- opacity: 0,
1197
- transition: 'opacity 0.2s ease-out',
1198
- transform: 'rotate(45deg)',
1199
- width: [36, 36, 48, 56],
1200
- height: [36, 36, 48, 56]
1201
- }
1202
- });
1203
- };
1204
-
1205
- const Nav = ({
1206
- link,
1207
- mode,
1208
- nav,
1209
- first,
1210
- setExpanded
1211
- }) => {
1212
- const {
1213
- url,
1214
- display
1215
- } = link;
1216
- const href = mode === 'remote' ? 'https://carbonplan.org/' + url : '/' + url;
1217
-
1218
- if (mode === 'homepage' || mode === 'local' && nav === url) {
1219
- return /*#__PURE__*/React.createElement(NextLink, {
1220
- href: href,
1221
- passHref: true
1222
- }, /*#__PURE__*/React.createElement(Link$2, {
1223
- onClick: () => {
1224
- if (nav === url) setExpanded(false);
1225
- },
1226
- sx: sx$1.link(nav, url, first)
1227
- }, /*#__PURE__*/React.createElement(HoverArrow, null), display));
1228
- } else {
1229
- return /*#__PURE__*/React.createElement(Link$2, {
1230
- href: href,
1231
- sx: sx$1.link(nav, url, first)
1232
- }, /*#__PURE__*/React.createElement(HoverArrow, null), display);
1233
- }
1234
- };
1235
-
1236
- const NavGroup = ({
1237
- links,
1238
- nav,
1239
- mode,
1240
- setExpanded
1241
- }) => {
1242
- return links.map((d, i) => {
1243
- return /*#__PURE__*/React.createElement(Nav, {
1244
- key: i,
1245
- link: d,
1246
- mode: mode,
1247
- nav: nav,
1248
- first: i === 0,
1249
- setExpanded: setExpanded
1250
- });
1251
- });
1252
- };
1253
-
1254
- const Header = ({
1255
- status,
1256
- mode,
1257
- nav,
1258
- menuItems
1259
- }) => {
1260
- const [expanded, setExpanded] = useState(false);
1261
-
1262
- const toggle = e => {
1263
- setExpanded(!expanded);
1264
- };
1265
-
1266
- return /*#__PURE__*/React.createElement(Row, {
1267
- sx: {
1268
- pt: ['12px'],
1269
- pb: [3]
1270
- }
1271
- }, /*#__PURE__*/React.createElement(Column, {
1272
- start: [1],
1273
- width: [2]
1274
- }, /*#__PURE__*/React.createElement(Box, {
1275
- sx: {
1276
- pointerEvents: 'all',
1277
- display: 'block',
1278
- width: 'fit-content'
1279
- }
1280
- }, (mode == 'homepage' || mode == 'local') && /*#__PURE__*/React.createElement(NextLink, {
1281
- href: "/",
1282
- passHref: true
1283
- }, /*#__PURE__*/React.createElement(Link$2, {
1284
- "aria-label": "CarbonPlan Homepage",
1285
- sx: {
1286
- display: 'block'
1287
- }
1288
- }, /*#__PURE__*/React.createElement(Logo, {
1289
- id: "logo",
1290
- sx: {
1291
- cursor: 'pointer',
1292
- color: 'primary'
1293
- }
1294
- }))), (mode == null || mode == 'remote') && /*#__PURE__*/React.createElement(Link$2, {
1295
- href: "https://carbonplan.org",
1296
- "aria-label": "CarbonPlan Homepage",
1297
- sx: {
1298
- display: 'block'
1299
- }
1300
- }, /*#__PURE__*/React.createElement(Logo, {
1301
- sx: {
1302
- cursor: 'pointer',
1303
- color: 'primary'
1304
- }
1305
- })))), /*#__PURE__*/React.createElement(Column, {
1306
- start: [4, 9],
1307
- width: [2, 2],
1308
- dr: 1,
1309
- sx: {
1310
- display: [status ? 'flex' : 'none', 'flex', 'flex', 'flex'],
1311
- alignItems: 'center'
1312
- }
1313
- }, /*#__PURE__*/React.createElement(Box, {
1314
- sx: {
1315
- fontSize: [1, 2, 3],
1316
- position: 'relative',
1317
- top: ['-2px', '-3px', '-3px']
1318
- }
1319
- }, status ? `(${status})` : '')), /*#__PURE__*/React.createElement(Column, {
1320
- start: [status ? 6 : 4, 6, 11, 11],
1321
- width: [status ? 1 : 3, 3, 2, 2],
1322
- sx: {
1323
- zIndex: 5000
1324
- }
1325
- }, /*#__PURE__*/React.createElement(Flex, {
1326
- sx: {
1327
- pointerEvents: 'all',
1328
- justifyContent: 'flex-end'
1329
- }
1330
- }, /*#__PURE__*/React.createElement(Box, {
1331
- sx: {
1332
- display: [status ? 'none' : 'flex', 'flex', 'flex', 'flex'],
1333
- mr: '18px',
1334
- gap: '18px',
1335
- opacity: expanded ? 0 : 1,
1336
- transition: 'opacity 0.15s',
1337
- justifyContent: 'space-between',
1338
- alignItems: 'center'
1339
- }
1340
- }, menuItems), /*#__PURE__*/React.createElement(Menu, {
1341
- sx: {
1342
- flexShrink: 0,
1343
- mr: ['-2px']
1344
- },
1345
- value: expanded,
1346
- onClick: toggle
1347
- }))), /*#__PURE__*/React.createElement(Box, {
1348
- sx: {
1349
- opacity: expanded ? 1 : 0,
1350
- pointerEvents: expanded ? 'all' : 'none',
1351
- position: 'fixed',
1352
- top: '0px',
1353
- right: '0px',
1354
- bottom: '0px',
1355
- minWidth: '0px',
1356
- maxHeight: '100vh',
1357
- width: '100vw',
1358
- backgroundColor: 'background',
1359
- zIndex: 4000,
1360
- pt: ['79px'],
1361
- transition: 'opacity 0.25s'
1362
- }
1363
- }, /*#__PURE__*/React.createElement(Container, null, /*#__PURE__*/React.createElement(Row, null, /*#__PURE__*/React.createElement(Column, {
1364
- start: [2, 4, 7, 7],
1365
- width: [5, 4, 5, 5]
1366
- }, /*#__PURE__*/React.createElement(Box, {
1367
- as: "nav",
1368
- sx: {
1369
- display: expanded ? 'inherit' : 'none',
1370
- mt: [5, 5, 5, 6]
1371
- }
1372
- }, /*#__PURE__*/React.createElement(NavGroup, {
1373
- links: links,
1374
- nav: nav,
1375
- mode: mode,
1376
- setExpanded: setExpanded
1377
- })))))));
1378
- };
1379
-
1380
- const Monogram = _ref => {
1381
- let props = _extends({}, _ref);
1382
-
1383
- return /*#__PURE__*/React.createElement(Box, _extends({
1384
- as: "svg",
1385
- width: "80",
1386
- stroke: "none",
1387
- fill: "currentColor",
1388
- viewBox: "0 0 32 32"
1389
- }, props), /*#__PURE__*/React.createElement("path", {
1390
- d: "M21.9395,14.9395 L17.5005,19.3785 L17.5005,7.0005 L14.5005,7.0005 L14.5005,19.3785 L10.0605,14.9395 L7.9395,17.0605 L14.9395,24.0605 C15.2325,24.3535 15.6165,24.5005 16.0005,24.5005 C16.3835,24.5005 16.7675,24.3535 17.0605,24.0605 L24.0605,17.0605 L21.9395,14.9395 Z"
1391
- }), /*#__PURE__*/React.createElement("path", {
1392
- d: "M27.5986,4 L22.8966,4 C26.5556,6.303 28.9996,10.366 28.9996,15 C28.9996,20.4 25.6896,25.039 20.9926,27 L26.5586,27 C29.8886,24.068 31.9996,19.785 31.9996,15 C31.9996,10.734 30.3196,6.868 27.5986,4"
1393
- }), /*#__PURE__*/React.createElement("path", {
1394
- d: "M3,15 C3,10.366 5.444,6.303 9.104,4 L4.401,4 C1.68,6.868 0,10.734 0,15 C0,19.785 2.112,24.068 5.441,27 L11.008,27 C6.311,25.039 3,20.4 3,15"
1395
- }));
1396
- };
1397
-
1398
- const Footer = () => {
1399
- return /*#__PURE__*/React.createElement(Box, {
1400
- sx: {
1401
- mt: [7, 7, 7, 8],
1402
- mb: [7, 7, 7, 8],
1403
- pb: [2, 1, 0, 0]
1404
- }
1405
- }, /*#__PURE__*/React.createElement(Row, {
1406
- sx: {
1407
- mb: [0, 0, 4, 5]
1408
- }
1409
- }, /*#__PURE__*/React.createElement(Column, {
1410
- start: [1, 2],
1411
- width: [3, 3]
1412
- }, /*#__PURE__*/React.createElement(Box, null, /*#__PURE__*/React.createElement(Box, {
1413
- sx: {
1414
- fontSize: [2, 2, 2, 3],
1415
- fontFamily: 'heading',
1416
- letterSpacing: 'mono',
1417
- mb: [2]
1418
- }
1419
- }, "EMAIL"), /*#__PURE__*/React.createElement(Link$2, {
1420
- href: "mailto:hello@carbonplan.org",
1421
- sx: {
1422
- textDecoration: 'none',
1423
- fontSize: [2, 2, 2, 3]
1424
- }
1425
- }, "hello@carbonplan.org"))), /*#__PURE__*/React.createElement(Column, {
1426
- start: [5],
1427
- width: [1],
1428
- dl: 1,
1429
- dr: 1,
1430
- sx: {
1431
- display: ['flex', 'none', 'none', 'none'],
1432
- justifyContent: ['center']
1433
- }
1434
- }, /*#__PURE__*/React.createElement(Monogram, {
1435
- sx: {
1436
- mt: ['-4px'],
1437
- width: '60px',
1438
- height: '60px'
1439
- }
1440
- })), /*#__PURE__*/React.createElement(Column, {
1441
- start: [1, 5, 5, 5],
1442
- width: [3, 3],
1443
- sx: {
1444
- mt: [3, 0, 0, 0]
1445
- }
1446
- }, /*#__PURE__*/React.createElement(Box, null, /*#__PURE__*/React.createElement(Box, {
1447
- sx: {
1448
- fontSize: [2, 2, 2, 3],
1449
- fontFamily: 'heading',
1450
- letterSpacing: 'mono',
1451
- mb: [2]
1452
- }
1453
- }, "FOLLOW"), /*#__PURE__*/React.createElement(Link$2, {
1454
- href: "https://twitter.com/carbonplanorg",
1455
- sx: {
1456
- textDecoration: 'none',
1457
- fontSize: [2, 2, 2, 3]
1458
- }
1459
- }, "@carbonplanorg"))), /*#__PURE__*/React.createElement(Column, {
1460
- start: [1, 9],
1461
- width: [5, 4, 3, 3],
1462
- sx: {
1463
- mt: ['42px', '42px', 0, 0],
1464
- mb: [3, 3, 0, 0]
1465
- }
1466
- }, /*#__PURE__*/React.createElement(Box, null, /*#__PURE__*/React.createElement(Box, {
1467
- sx: {
1468
- fontSize: [2, 2, 2, 3],
1469
- fontFamily: 'body',
1470
- color: 'secondary'
1471
- }
1472
- }, "CarbonPlan is a registered non-profit public benefit corporation in California with 501(c)(3) status.")))), /*#__PURE__*/React.createElement(Row, {
1473
- sx: {
1474
- mb: ['2px'],
1475
- mt: [5, 5, 4]
1476
- }
1477
- }, /*#__PURE__*/React.createElement(Column, {
1478
- start: [1, 1, 2, 2],
1479
- width: [3, 2, 3, 3],
1480
- sx: {
1481
- display: 'flex',
1482
- alignItems: ['flex-start', 'flex-start', 'flex-end']
1483
- }
1484
- }, /*#__PURE__*/React.createElement(Box, {
1485
- sx: {
1486
- bottom: '0px',
1487
- borderStyle: 'solid',
1488
- borderColor: 'muted',
1489
- borderWidth: '0px',
1490
- borderTopWidth: '1px',
1491
- pt: [2]
1492
- }
1493
- }, /*#__PURE__*/React.createElement(Box, {
1494
- sx: {
1495
- color: 'secondary',
1496
- fontSize: [1, 1, 1, 2],
1497
- fontFamily: 'mono',
1498
- letterSpacing: 'mono'
1499
- }
1500
- }, "(c) 2021 CARBONPLAN"))), /*#__PURE__*/React.createElement(Column, {
1501
- start: [4, 3, 5, 5],
1502
- width: [2, 2, 3, 3],
1503
- sx: {
1504
- display: 'flex',
1505
- alignItems: ['flex-start', 'flex-start', 'flex-end'],
1506
- mt: [0, 0, 0, 0]
1507
- }
1508
- }, /*#__PURE__*/React.createElement(Box, {
1509
- sx: {
1510
- bottom: '0px',
1511
- borderStyle: 'solid',
1512
- borderColor: 'muted',
1513
- borderWidth: '0px',
1514
- borderTopWidth: '1px',
1515
- width: ['100%', 'auto', 'auto', 'auto'],
1516
- pt: [2]
1517
- }
1518
- }, /*#__PURE__*/React.createElement(NextLink, {
1519
- href: "/terms",
1520
- passHref: true
1521
- }, /*#__PURE__*/React.createElement(Box, {
1522
- as: "a",
1523
- sx: {
1524
- textDecoration: 'none',
1525
- fontSize: [1, 1, 1, 2],
1526
- color: 'secondary',
1527
- fontFamily: 'mono',
1528
- letterSpacing: 'mono',
1529
- display: 'block'
1530
- }
1531
- }, "READ OUR TERMS")))), /*#__PURE__*/React.createElement(Column, {
1532
- start: [5, 7, 9, 9],
1533
- width: [2, 3, 3, 3],
1534
- sx: {
1535
- display: ['none', 'initial', 'initial', 'initial']
1536
- }
1537
- }, /*#__PURE__*/React.createElement(Monogram, {
1538
- sx: {
1539
- width: 80,
1540
- height: 80,
1541
- mt: [0, '-10px', 4, 5],
1542
- mb: ['-12px']
1543
- }
1544
- }))));
1545
- };
1546
-
1547
- const _excluded$8 = ["sx"];
1548
-
1549
- const Dimmer = _ref => {
1550
- let {
1551
- sx
1552
- } = _ref,
1553
- props = _objectWithoutPropertiesLoose(_ref, _excluded$8);
1554
-
1555
- const [colorMode, setColorMode] = useColorMode();
1556
- const toggle = useCallback(() => {
1557
- setColorMode(colorMode === 'light' ? 'dark' : 'light');
1558
- }, [colorMode]);
1559
- return /*#__PURE__*/React.createElement(IconButton, _extends({
1560
- "aria-label": "Toggle dark mode",
1561
- onClick: toggle,
1562
- role: "checkbox",
1563
- sx: _extends({
1564
- width: 32,
1565
- height: 32,
1566
- display: 'inline-block',
1567
- cursor: 'pointer',
1568
- color: 'secondary'
1569
- }, sx)
1570
- }, props), /*#__PURE__*/React.createElement(Sun, {
1571
- sx: {
1572
- strokeWidth: '1.75',
1573
- transition: 'stroke 0.15s',
1574
- '@media (hover: hover) and (pointer: fine)': {
1575
- '&:hover': {
1576
- stroke: 'primary'
1577
- }
1578
- }
1579
- }
1580
- }));
1581
- };
1582
-
1583
- const GitSha = () => {
1584
- const sha = process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA;
1585
- const owner = process.env.NEXT_PUBLIC_VERCEL_GIT_REPO_OWNER;
1586
- const slug = process.env.NEXT_PUBLIC_VERCEL_GIT_REPO_SLUG;
1587
- const {
1588
- theme
1589
- } = useThemeUI();
1590
- const color = theme.rawColors.secondary;
1591
-
1592
- if (sha && owner && slug) {
1593
- const shortSha = sha.substring(0, 7);
1594
- const href = 'https://github.com/' + owner + '/' + slug + '/tree/' + sha;
1595
- return /*#__PURE__*/React.createElement(Box, {
1596
- sx: {
1597
- display: 'inline-block',
1598
- width: '87px'
1599
- }
1600
- }, /*#__PURE__*/React.createElement(Separator, {
1601
- color: color
1602
- }), /*#__PURE__*/React.createElement(Link$2, {
1603
- href: href,
1604
- sx: {
1605
- whiteSpace: 'nowrap',
1606
- display: 'inline-block',
1607
- ml: [2],
1608
- fontFamily: 'mono',
1609
- letterSpacing: 'body',
1610
- color: color,
1611
- fontSize: [1],
1612
- textTransform: 'uppercase',
1613
- textDecoration: 'none'
1614
- }
1615
- }, shortSha));
1616
- } else {
1617
- // fallback
1618
- return /*#__PURE__*/React.createElement(Box, {
1619
- sx: {
1620
- display: 'inline-block',
1621
- width: '87px'
1622
- }
1623
- }, /*#__PURE__*/React.createElement(Separator, {
1624
- color: color
1625
- }), /*#__PURE__*/React.createElement(Text, {
1626
- sx: {
1627
- whiteSpace: 'nowrap',
1628
- display: 'inline-block',
1629
- ml: [2],
1630
- fontFamily: 'mono',
1631
- letterSpacing: 'body',
1632
- color: color,
1633
- fontSize: [1],
1634
- textTransform: 'uppercase'
1635
- }
1636
- }, color));
1637
- }
1638
- };
1639
-
1640
- const Separator = ({
1641
- color
1642
- }) => {
1643
- return /*#__PURE__*/React.createElement("svg", {
1644
- fill: color,
1645
- opacity: "0.8",
1646
- viewBox: "0 0 24 24",
1647
- width: "24",
1648
- height: "24"
1649
- }, /*#__PURE__*/React.createElement("circle", {
1650
- r: 5,
1651
- cx: 19,
1652
- cy: 19
1653
- }));
1654
- };
1655
-
1656
- const Value = ({
1657
- mode
1658
- }) => {
1659
- const [display, setDisplay] = useState(init(mode));
1660
- useEffect(() => {
1661
- if (mode === 'mouse') {
1662
- const setFromEvent = e => {
1663
- const x = format(e.clientX, 4);
1664
- const y = format(e.clientY, 4);
1665
- setDisplay(`X,Y: ${x},${y}`);
1666
- };
1667
-
1668
- window.addEventListener('mousemove', setFromEvent);
1669
- return () => {
1670
- window.removeEventListener('mousemove', setFromEvent);
1671
- };
1672
- }
1673
-
1674
- if (mode === 'scroll') {
1675
- const setFromEvent = e => {
1676
- const y = scrollFraction(window);
1677
- setDisplay(`SCROLL: 0.${format((y * 100).toFixed(0), 2)}`);
1678
- };
1679
-
1680
- window.addEventListener('scroll', setFromEvent);
1681
- return () => {
1682
- window.removeEventListener('scroll', setFromEvent);
1683
- };
1684
- }
1685
- }, []);
1686
- return /*#__PURE__*/React.createElement(Text, {
1687
- sx: {
1688
- whiteSpace: 'nowrap',
1689
- display: 'inline-block',
1690
- mr: '-6px',
1691
- fontFamily: 'mono',
1692
- letterSpacing: 'body',
1693
- color: 'secondary',
1694
- fontSize: [1],
1695
- textTransform: 'uppercase'
1696
- }
1697
- }, display);
1698
- };
1699
-
1700
- const Metadata = ({
1701
- mode
1702
- }) => {
1703
- return /*#__PURE__*/React.createElement(Box, {
1704
- sx: {
1705
- userSelect: 'none',
1706
- position: 'fixed',
1707
- bottom: '42px',
1708
- right: '24px',
1709
- transformOrigin: 'right',
1710
- transform: 'rotate(90deg)',
1711
- display: ['none', 'none', 'initial']
1712
- }
1713
- }, /*#__PURE__*/React.createElement(Value, {
1714
- mode: mode
1715
- }), /*#__PURE__*/React.createElement(GitSha, null));
1716
- };
1717
-
1718
- function init(mode) {
1719
- if (mode === 'mouse') {
1720
- return `X,Y: ${format(0, 4)},${format(0, 4)}`;
1721
- } else if (mode === 'scroll') {
1722
- return `SCROLL: 0.${format(0 .toFixed(0), 2)}`;
1723
- } else {
1724
- return mode;
1725
- }
1726
- }
1727
-
1728
- function format(num, pad) {
1729
- return num.toString().padStart(pad, '0');
1730
- }
1731
-
1732
- function scrollFraction(window, documnt) {
1733
- return Math.min(window.scrollY / (document.body.offsetHeight - 770), 0.99);
1734
- }
1735
-
1736
- const _excluded$7 = ["duration", "delay", "children"];
1737
- const fade = keyframes({
1738
- from: {
1739
- opacity: 0
1740
- },
1741
- to: {
1742
- opacity: 1
1743
- }
1744
- });
1745
-
1746
- const FadeIn = _ref => {
1747
- let {
1748
- duration = 300,
1749
- delay = 0,
1750
- children
1751
- } = _ref,
1752
- delegated = _objectWithoutPropertiesLoose(_ref, _excluded$7);
1753
-
1754
- return /*#__PURE__*/React.createElement(Box, _extends({}, delegated, {
1755
- sx: {
1756
- animationDuration: duration + 'ms',
1757
- animationDelay: delay + 'ms',
1758
- animationName: fade.toString(),
1759
- animationFillMode: 'backwards'
1760
- }
1761
- }), children);
1762
- };
1763
-
1764
- const getScrollbarWidth = document => {
1765
- const outer = document.createElement('div');
1766
- outer.style.visibility = 'hidden';
1767
- outer.style.width = '100px';
1768
- document.body.appendChild(outer);
1769
- outer.style.overflow = 'scroll';
1770
- const inner = document.createElement('div');
1771
- inner.style.width = '100%';
1772
- outer.appendChild(inner);
1773
- const delta = outer.offsetWidth - inner.offsetWidth;
1774
- outer.parentNode.removeChild(outer);
1775
- return delta;
1776
- };
1777
-
1778
- const Scrollbar = () => {
1779
- useEffect(() => {
1780
- if (typeof document !== 'undefined') {
1781
- const delta = getScrollbarWidth(document);
1782
-
1783
- if (delta > 0) {
1784
- document.body.classList.add('custom-scrollbar');
1785
- document.getElementsByTagName('html')[0].classList.add('custom-scrollbar');
1786
- }
1787
- }
1788
- }, []);
1789
- return null;
1790
- };
1791
-
1792
- const Guide = ({
1793
- color: _color = 'muted'
1794
- }) => {
1795
- const [display, setDisplay] = useState(false);
1796
- useEffect(() => {
1797
- function handler(event) {
1798
- const {
1799
- key,
1800
- keyCode,
1801
- metaKey
1802
- } = event;
1803
-
1804
- if (key === ';' && metaKey) {
1805
- setDisplay(prev => !prev);
1806
- }
1807
- }
1808
-
1809
- document.addEventListener('keydown', handler);
1810
- return () => {
1811
- document.removeEventListener('keydown', handler);
1812
- };
1813
- }, []);
1814
- return /*#__PURE__*/React.createElement(Box, {
1815
- sx: {
1816
- position: 'fixed',
1817
- width: '100%',
1818
- left: 0,
1819
- top: 0,
1820
- zIndex: _color === 'teal' ? 5000 : -1,
1821
- pointerEvents: 'none',
1822
- display: display ? 'initial' : 'none'
1823
- }
1824
- }, /*#__PURE__*/React.createElement(Container, null, /*#__PURE__*/React.createElement(Box, {
1825
- sx: {
1826
- display: ['none', 'none', 'initial', 'initial']
1827
- }
1828
- }, /*#__PURE__*/React.createElement(GuideColumns, {
1829
- indices: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
1830
- color: _color
1831
- })), /*#__PURE__*/React.createElement(Box, {
1832
- sx: {
1833
- display: ['none', 'initial', 'none', 'none']
1834
- }
1835
- }, /*#__PURE__*/React.createElement(GuideColumns, {
1836
- indices: [1, 2, 3, 4, 5, 6, 7, 8],
1837
- color: _color
1838
- })), /*#__PURE__*/React.createElement(Box, {
1839
- sx: {
1840
- display: ['initial', 'none', 'none', 'none']
1841
- }
1842
- }, /*#__PURE__*/React.createElement(GuideColumns, {
1843
- indices: [1, 2, 3, 4, 5, 6],
1844
- color: _color
1845
- }))));
1846
- };
1847
-
1848
- const colorCycle = ['red', 'orange', 'yellow', 'green', 'teal', 'blue', 'purple', 'pink'];
1849
-
1850
- function GuideColumns({
1851
- indices,
1852
- color
1853
- }) {
1854
- const sx = {
1855
- outerGuideColumn: {
1856
- borderStyle: 'solid',
1857
- borderWidth: '0px',
1858
- borderLeftWidth: color === 'teal' ? '0px' : '1px',
1859
- borderRightWidth: color === 'teal' ? '0px' : '1px',
1860
- opacity: color == 'teal' ? 0.4 : 1
1861
- },
1862
- innerGuideColumn: {
1863
- borderStyle: 'solid',
1864
- borderWidth: '0px',
1865
- borderLeftWidth: '0px',
1866
- borderRightWidth: '0px',
1867
- opacity: color == 'teal' ? 0.4 : 1
1868
- }
1869
- };
1870
- return /*#__PURE__*/React.createElement(Row, null, indices.map(i => {
1871
- return /*#__PURE__*/React.createElement(Column, {
1872
- key: i,
1873
- start: [i],
1874
- width: [1, 1],
1875
- dl: 0.5,
1876
- dr: 0.5,
1877
- sx: _extends({
1878
- bg: color === 'teal' ? 'teal' : 'transparent',
1879
- height: '100vh'
1880
- }, sx.innerGuideColumn)
1881
- }, /*#__PURE__*/React.createElement(Box, {
1882
- sx: _extends({
1883
- mx: ['12px', 3, 3, 4],
1884
- bg: color === 'teal' ? 'background' : 'transparent',
1885
- height: '100%',
1886
- borderLeftColor: color === 'rainbow' ? colorCycle[i % 8] : 'muted',
1887
- borderRightColor: color === 'rainbow' ? colorCycle[i % 8] : 'muted'
1888
- }, sx.outerGuideColumn)
1889
- }));
1890
- }));
1891
- }
1892
-
1893
- const _excluded$6 = ["value", "sx"];
1894
-
1895
- const Settings = _ref => {
1896
- let {
1897
- value,
1898
- sx
1899
- } = _ref,
1900
- props = _objectWithoutPropertiesLoose(_ref, _excluded$6);
1901
-
1902
- return /*#__PURE__*/React.createElement(IconButton, _extends({
1903
- sx: _extends({
1904
- cursor: 'pointer',
1905
- fill: 'none',
1906
- strokeWidth: '2px',
1907
- stroke: 'text',
1908
- '.paren': {
1909
- opacity: '0'
1910
- },
1911
- '@media (hover: hover) and (pointer: fine)': {
1912
- '&:hover .paren': {
1913
- opacity: '1'
1914
- }
1915
- }
1916
- }, sx),
1917
- "aria-label": "Toggle Menu"
1918
- }, props), !value && /*#__PURE__*/React.createElement("svg", {
1919
- style: {
1920
- width: '50px',
1921
- height: '30px',
1922
- transform: 'scale(2)',
1923
- marginTop: '-3px'
1924
- },
1925
- xmlns: "http://www.w3.org/2000/svg",
1926
- viewBox: "0 0 68 36"
1927
- }, /*#__PURE__*/React.createElement("line", {
1928
- x1: "24",
1929
- y1: "2.1",
1930
- x2: "24",
1931
- y2: "6.1"
1932
- }), /*#__PURE__*/React.createElement("line", {
1933
- x1: "24",
1934
- y1: "24.1",
1935
- x2: "24",
1936
- y2: "33.9"
1937
- }), /*#__PURE__*/React.createElement("line", {
1938
- x1: "44",
1939
- y1: "2.1",
1940
- x2: "44",
1941
- y2: "12.1"
1942
- }), /*#__PURE__*/React.createElement("line", {
1943
- x1: "44",
1944
- y1: "30.1",
1945
- x2: "44",
1946
- y2: "33.9"
1947
- }), /*#__PURE__*/React.createElement("circle", {
1948
- cx: "24",
1949
- cy: "15.1",
1950
- r: "5"
1951
- }), /*#__PURE__*/React.createElement("circle", {
1952
- cx: "44",
1953
- cy: "21.1",
1954
- r: "5"
1955
- }), /*#__PURE__*/React.createElement("path", {
1956
- style: {
1957
- transition: 'all 0.2s'
1958
- },
1959
- className: "paren",
1960
- d: "M6.4,1.2c-6.3,10.3-6.3,23.3,0,33.6"
1961
- }), /*#__PURE__*/React.createElement("path", {
1962
- style: {
1963
- transition: 'all 0.2s'
1964
- },
1965
- className: "paren",
1966
- d: "M61.6,34.8c6.3-10.3,6.3-23.3,0-33.6"
1967
- })), value && /*#__PURE__*/React.createElement("svg", {
1968
- style: {
1969
- width: '50px',
1970
- height: '30px',
1971
- transform: 'scale(2)',
1972
- marginTop: '-3px'
1973
- },
1974
- xmlns: "http://www.w3.org/2000/svg",
1975
- viewBox: "0 0 68 36"
1976
- }, /*#__PURE__*/React.createElement("line", {
1977
- x1: "50.85",
1978
- y1: "29.79",
1979
- x2: "17.15",
1980
- y2: "6.21"
1981
- }), /*#__PURE__*/React.createElement("line", {
1982
- x1: "17.15",
1983
- y1: "29.79",
1984
- x2: "50.85",
1985
- y2: "6.21"
1986
- }), /*#__PURE__*/React.createElement("path", {
1987
- style: {
1988
- transition: 'all 0.2s'
1989
- },
1990
- className: "paren",
1991
- d: "M6.4,1.2c-6.3,10.3-6.3,23.3,0,33.6"
1992
- }), /*#__PURE__*/React.createElement("path", {
1993
- style: {
1994
- transition: 'all 0.2s'
1995
- },
1996
- className: "paren",
1997
- d: "M61.6,34.8c6.3-10.3,6.3-23.3,0-33.6"
1998
- })));
1999
- };
2000
-
2001
- const Layout = ({
2002
- title,
2003
- description,
2004
- card,
2005
- children,
2006
- status,
2007
- nav,
2008
- settings,
2009
- footer: _footer = true,
2010
- header: _header = true,
2011
- metadata: _metadata = 'mouse',
2012
- links: _links = 'remote',
2013
- dimmer: _dimmer = 'bottom',
2014
- guide: _guide = true,
2015
- scrollbar: _scrollbar = true,
2016
- fade: _fade = true,
2017
- container: _container = true
2018
- }) => {
2019
- let content = children;
2020
-
2021
- if (_fade) {
2022
- content = /*#__PURE__*/React.createElement(FadeIn, {
2023
- duration: 250
2024
- }, content);
2025
- }
2026
-
2027
- if (_container) {
2028
- content = /*#__PURE__*/React.createElement(Box, {
2029
- sx: {
2030
- mb: [8, 8, 9, 10]
2031
- }
2032
- }, /*#__PURE__*/React.createElement(Container, null, content));
2033
- }
2034
-
2035
- const {
2036
- theme
2037
- } = useThemeUI();
2038
- useEffect(() => {
2039
- if (!theme) return;
2040
-
2041
- const handler = e => {
2042
- if (e.matches && settings != null && settings.value && settings != null && settings.onClick) {
2043
- settings == null ? void 0 : settings.onClick();
2044
- }
2045
- };
2046
-
2047
- const query = window.matchMedia(`(min-width: ${theme.breakpoints[1]})`);
2048
- query.onchange = handler;
2049
- return () => {
2050
- query.onchange = null;
2051
- };
2052
- }, [theme == null ? void 0 : theme.breakpoints, settings == null ? void 0 : settings.value, settings == null ? void 0 : settings.onClick]);
2053
- const menuItems = [/*#__PURE__*/React.createElement(Dimmer, {
2054
- key: "dimmer",
2055
- sx: {
2056
- color: 'primary',
2057
- mt: '-2px',
2058
- display: ['block', 'block', _dimmer === 'top' ? 'block' : 'none', _dimmer === 'top' ? 'block' : 'none']
2059
- }
2060
- })];
2061
-
2062
- if (settings) {
2063
- menuItems.push( /*#__PURE__*/React.createElement(Settings, _extends({
2064
- key: "settings",
2065
- sx: {
2066
- mr: ['2px'],
2067
- display: ['inherit', 'inherit', 'none', 'none']
2068
- }
2069
- }, settings)));
2070
- }
2071
-
2072
- return /*#__PURE__*/React.createElement(React.Fragment, null, _guide && /*#__PURE__*/React.createElement(Guide, {
2073
- color: _guide
2074
- }), _scrollbar && /*#__PURE__*/React.createElement(Scrollbar, null), /*#__PURE__*/React.createElement(Meta, {
2075
- card: card,
2076
- description: description,
2077
- title: title
2078
- }), /*#__PURE__*/React.createElement(Flex, {
2079
- sx: {
2080
- flexDirection: 'column',
2081
- minHeight: '100vh'
2082
- }
2083
- }, _header && /*#__PURE__*/React.createElement(Box, {
2084
- as: "header",
2085
- sx: {
2086
- width: '100%',
2087
- borderStyle: 'solid',
2088
- borderColor: 'muted',
2089
- borderWidth: '0px',
2090
- borderBottomWidth: '1px',
2091
- position: 'sticky',
2092
- top: 0,
2093
- bg: 'background',
2094
- height: '56px',
2095
- zIndex: 2000
2096
- }
2097
- }, /*#__PURE__*/React.createElement(Container, null, /*#__PURE__*/React.createElement(Header, {
2098
- mode: _links,
2099
- status: status,
2100
- nav: nav,
2101
- menuItems: menuItems
2102
- }))), /*#__PURE__*/React.createElement(Box, {
2103
- sx: {
2104
- width: '100%',
2105
- flex: '1 1 auto'
2106
- }
2107
- }, content), _footer && /*#__PURE__*/React.createElement(Box, {
2108
- as: "footer",
2109
- sx: {
2110
- width: '100%',
2111
- borderStyle: 'solid',
2112
- borderColor: 'muted',
2113
- borderWidth: '0px',
2114
- borderTopWidth: '1px'
2115
- }
2116
- }, /*#__PURE__*/React.createElement(Container, null, /*#__PURE__*/React.createElement(Footer, null))), _dimmer === 'bottom' && /*#__PURE__*/React.createElement(Box, {
2117
- sx: {
2118
- display: ['none', 'none', 'initial', 'initial'],
2119
- position: ['fixed'],
2120
- right: [13],
2121
- bottom: [17, 17, 15, 15]
2122
- }
2123
- }, /*#__PURE__*/React.createElement(Dimmer, null)), _metadata && /*#__PURE__*/React.createElement(Metadata, {
2124
- mode: _metadata
2125
- })));
2126
- };
2127
-
2128
- const Custom404 = () => {
2129
- return /*#__PURE__*/React.createElement(Layout, {
2130
- footer: false,
2131
- title: '404 / carbonplan'
2132
- }, /*#__PURE__*/React.createElement(Row, {
2133
- sx: {
2134
- mb: [5, 0, 0],
2135
- pt: [0, 0, 6]
2136
- }
2137
- }, /*#__PURE__*/React.createElement(Column, {
2138
- start: [1, 1, 3, 3],
2139
- width: [6, 4, 4, 4]
2140
- }, /*#__PURE__*/React.createElement(Styled.h1, null, "Oops!"), /*#__PURE__*/React.createElement(Box, {
2141
- sx: {
2142
- fontSize: [4, 4, 4, 5],
2143
- lineHeight: 'h3',
2144
- mt: [3, 4, 4],
2145
- mb: [2, 3, 3],
2146
- maxWidth: ['90%', '90%', '400px']
2147
- }
2148
- }, "Sorry but we can't seem to find the page you are looking for."), /*#__PURE__*/React.createElement(Box, {
2149
- sx: {
2150
- color: 'secondary',
2151
- fontFamily: 'mono',
2152
- letterSpacing: 'mono',
2153
- fontSize: [2, 2, 2, 3],
2154
- mt: [4, 5, 5]
2155
- }
2156
- }, "ERROR CODE 404")), /*#__PURE__*/React.createElement(Column, {
2157
- start: [2, 5, 7, 7],
2158
- width: [4, 4, 4, 4]
2159
- }, /*#__PURE__*/React.createElement(Box, {
2160
- sx: {
2161
- width: ['100%'],
2162
- mt: [2, 4, 4, 5],
2163
- fill: 'primary'
2164
- }
2165
- }, /*#__PURE__*/React.createElement(PoopSad, {
2166
- sx: {
2167
- width: '100%',
2168
- height: 'auto'
2169
- }
2170
- })))));
2171
- };
2172
-
2173
- const Expander = ({
2174
- value,
2175
- id,
2176
- onClick,
2177
- sx
2178
- }) => {
2179
- return /*#__PURE__*/React.createElement(IconButton, {
2180
- onClick: onClick,
2181
- id: id,
2182
- role: "checkbox",
2183
- "aria-checked": value,
2184
- "aria-label": "Expand",
2185
- sx: _extends({
2186
- display: 'inline-block',
2187
- width: 24,
2188
- height: 24,
2189
- p: [1],
2190
- cursor: 'pointer',
2191
- fill: 'secondary',
2192
- stroke: 'secondary',
2193
- '@media (hover: hover) and (pointer: fine)': {
2194
- '&:hover': {
2195
- fill: 'primary',
2196
- stroke: 'primary'
2197
- }
2198
- }
2199
- }, sx)
2200
- }, /*#__PURE__*/React.createElement("svg", {
2201
- viewBox: "0 0 16 16"
2202
- }, /*#__PURE__*/React.createElement("path", {
2203
- d: "M8,0 V16 M0,8 H16",
2204
- style: {
2205
- strokeWidth: 2,
2206
- transition: '0.25s all',
2207
- transformOrigin: '8px 8px',
2208
- transform: value ? 'rotate(45deg)' : ''
2209
- }
2210
- })));
2211
- };
2212
-
2213
- const _excluded$5 = ["label", "value", "sx", "children"];
2214
-
2215
- const Tag = _ref => {
2216
- let {
2217
- label,
2218
- value,
2219
- sx,
2220
- children
2221
- } = _ref,
2222
- props = _objectWithoutPropertiesLoose(_ref, _excluded$5);
2223
-
2224
- const color = sx && sx.color ? sx.color : 'primary';
2225
- const isClickable = props && (props.onClick || props.onDoubleClick);
2226
- return /*#__PURE__*/React.createElement(Box, _extends({
2227
- as: isClickable ? 'button' : 'span',
2228
- role: "checkbox",
2229
- "aria-checked": value,
2230
- "aria-label": label,
2231
- sx: _extends({
2232
- display: 'inline-block',
2233
- fontSize: [1, 1, 1, 2],
2234
- fontFamily: 'mono',
2235
- letterSpacing: 'mono',
2236
- cursor: isClickable ? 'pointer' : 'inherit',
2237
- color: color,
2238
- backgroundColor: 'transparent',
2239
- borderStyle: 'solid',
2240
- borderColor: color,
2241
- lineHeight: 'body',
2242
- borderWidth: '0px',
2243
- borderBottomWidth: '1px',
2244
- textTransform: 'uppercase',
2245
- userSelect: 'none',
2246
- transition: 'opacity 0.05s',
2247
- pt: ['1px'],
2248
- pb: ['2px'],
2249
- px: [0],
2250
- m: [0],
2251
- opacity: value == null || value ? 1 : color == 'primary' ? 0.24 : 0.33
2252
- }, sx)
2253
- }, props), children);
2254
- };
2255
-
2256
- const _excluded$4 = ["values", "setValues", "label", "colors", "showAll", "multiSelect"];
2257
- const sx = {
2258
- label: {
2259
- fontFamily: 'mono',
2260
- letterSpacing: 'mono',
2261
- fontSize: [1, 1, 1, 2],
2262
- color: 'secondary',
2263
- userSelect: 'none',
2264
- textTransform: 'uppercase'
2265
- }
2266
- };
2267
-
2268
- const duplicateOptions = (options, defaultValue, overrides = {}) => {
2269
- return Object.keys(options).reduce((o, key) => Object.assign(o, {
2270
- [key]: overrides[key] || defaultValue
2271
- }), {});
2272
- };
2273
-
2274
- const isAll = option => {
2275
- return Object.keys(option).filter(d => option[d]).length == Object.keys(option).length;
2276
- };
2277
-
2278
- const updateValues = ({
2279
- values,
2280
- multiSelect,
2281
- setValues,
2282
- value
2283
- }) => {
2284
- const isAllAlreadySelected = isAll(values);
2285
- const isSelectingAll = value === 'all';
2286
- let updatedToggle;
2287
-
2288
- if (multiSelect) {
2289
- if (isSelectingAll && !isAllAlreadySelected) {
2290
- // select all
2291
- updatedToggle = duplicateOptions(values, true);
2292
- } else if (isSelectingAll && isAllAlreadySelected) {
2293
- // deselect all
2294
- updatedToggle = duplicateOptions(values, false);
2295
- } else {
2296
- // de/select value, inherit other values
2297
- updatedToggle = _extends({}, values, {
2298
- [value]: !values[value]
2299
- });
2300
- }
2301
- } else {
2302
- if (isSelectingAll && !isAllAlreadySelected) {
2303
- // select all
2304
- updatedToggle = duplicateOptions(values, true);
2305
- } else if (isSelectingAll && isAllAlreadySelected) ; else {
2306
- // select only value
2307
- updatedToggle = duplicateOptions(values, false, {
2308
- [value]: true
2309
- });
2310
- }
2311
- }
2312
-
2313
- if (updatedToggle) {
2314
- setValues(updatedToggle);
2315
- }
2316
- };
2317
-
2318
- const Filter = _ref => {
2319
- let {
2320
- values,
2321
- setValues,
2322
- label,
2323
- colors,
2324
- showAll = false,
2325
- multiSelect = false
2326
- } = _ref,
2327
- props = _objectWithoutPropertiesLoose(_ref, _excluded$4);
2328
-
2329
- return /*#__PURE__*/React.createElement(Box, props, label && /*#__PURE__*/React.createElement(Box, {
2330
- sx: sx.label
2331
- }, label), /*#__PURE__*/React.createElement(Box, {
2332
- sx: {
2333
- mt: label ? [3] : 0
2334
- }
2335
- }, showAll && /*#__PURE__*/React.createElement(Tag, {
2336
- onClick: () => updateValues({
2337
- values: values,
2338
- multiSelect,
2339
- setValues: setValues,
2340
- value: 'all'
2341
- }),
2342
- value: isAll(values),
2343
- sx: {
2344
- mr: [2]
2345
- }
2346
- }, "All"), Object.keys(values).map((d, i) => /*#__PURE__*/React.createElement(Tag, {
2347
- onClick: () => updateValues({
2348
- values: values,
2349
- multiSelect,
2350
- setValues: setValues,
2351
- value: d
2352
- }),
2353
- onDoubleClick: () => updateValues({
2354
- values: values,
2355
- multiSelect: false,
2356
- setValues: setValues,
2357
- value: d
2358
- }),
2359
- key: i,
2360
- value: values[d],
2361
- sx: {
2362
- width: 'max-content',
2363
- color: colors ? colors[d] : 'primary',
2364
- mr: [2],
2365
- mb: [1]
2366
- }
2367
- }, d))));
2368
- };
2369
-
2370
- const sizes = {
2371
- xs: [1],
2372
- sm: [3],
2373
- md: [5],
2374
- lg: [7],
2375
- xl: [9]
2376
- };
2377
-
2378
- const Group = ({
2379
- children,
2380
- direction: _direction = 'vertical',
2381
- spacing: _spacing = 'md'
2382
- }) => {
2383
- let marginValue;
2384
-
2385
- if (typeof _spacing === 'string') {
2386
- marginValue = sizes[_spacing];
2387
- } else if (typeof _spacing === 'number') {
2388
- marginValue = [_spacing];
2389
- } else if (Array.isArray(_spacing) && _spacing.every(el => typeof el === 'number')) {
2390
- marginValue = _spacing;
2391
- }
2392
-
2393
- if (!marginValue) {
2394
- throw new Error('Invalid spacing size. Must be numeric value(s) or one of xs, sm, md, lg, or xl');
2395
- }
2396
-
2397
- if (!['horizontal', 'vertical'].includes(_direction)) {
2398
- throw new Error('Invalid direction value. Must be either horizontal or vertical');
2399
- }
2400
-
2401
- const marginProperty = _direction === 'vertical' ? 'mt' : 'ml';
2402
- const additionalStyles = _direction === 'horizontal' ? {
2403
- display: 'inline-block'
2404
- } : {};
2405
- return /*#__PURE__*/React.createElement(Box, null, React.Children.map(children, (child, i) => {
2406
- return /*#__PURE__*/React.createElement(Box, {
2407
- sx: _extends({
2408
- [marginProperty]: i > 0 ? marginValue : 0
2409
- }, additionalStyles)
2410
- }, child);
2411
- }));
2412
- };
2413
-
2414
- const _excluded$3 = ["size", "inverted", "sx"];
2415
-
2416
- const Input = (_ref, ref) => {
2417
- let {
2418
- size = 'sm',
2419
- inverted,
2420
- sx
2421
- } = _ref,
2422
- props = _objectWithoutPropertiesLoose(_ref, _excluded$3);
2423
-
2424
- const defaultColor = inverted ? 'secondary' : 'primary';
2425
-
2426
- const styles = _extends({
2427
- color: defaultColor,
2428
- borderColor: 'secondary',
2429
- borderStyle: 'solid',
2430
- borderWidth: '0px',
2431
- borderBottomWidth: '1px',
2432
- borderRadius: '0px',
2433
- transition: 'border 0.15s',
2434
- borderBottomWidth: '1px',
2435
- width: 'calc(min(15ch, 100%))',
2436
- p: [0],
2437
- py: ['2px'],
2438
- 'input::-webkit-outer-spin-button': {
2439
- WebkitAppearance: 'none',
2440
- margin: 0
2441
- },
2442
- 'input::-webkit-inner-spin-button': {
2443
- WebkitAppearance: 'none',
2444
- margin: 0
2445
- },
2446
- ':focus': {
2447
- borderColor: 'primary'
2448
- },
2449
- ':focus-visible': {
2450
- outline: 'none !important',
2451
- background: 'none !important'
2452
- }
2453
- }, getSizeStyles(size), sx);
2454
-
2455
- return /*#__PURE__*/React.createElement(Input$1, _extends({}, props, {
2456
- ref: ref,
2457
- sx: styles
2458
- }));
2459
- };
2460
-
2461
- var input = forwardRef(Input);
2462
-
2463
- const getProps = test => props => {
2464
- const next = {};
2465
-
2466
- for (const key in props) {
2467
- if (test(key || '')) next[key] = props[key];
2468
- }
2469
-
2470
- return next;
2471
- };
2472
-
2473
- const _excluded$2 = ["children", "size", "sx", "sxSelect"];
2474
-
2475
- const Select = _ref => {
2476
- let {
2477
- children,
2478
- size = 'sm',
2479
- sx,
2480
- sxSelect
2481
- } = _ref,
2482
- props = _objectWithoutPropertiesLoose(_ref, _excluded$2);
2483
-
2484
- const color = sx && sx.color ? sx.color : 'primary';
2485
- const sizeStyles = getSizeStyles(size);
2486
- const ref = useRef(null);
2487
- const {
2488
- onChange
2489
- } = props;
2490
- const omitOnChange = getProps(k => k !== 'onChange')(props);
2491
-
2492
- if (!['xs', 'sm', 'md'].includes(size)) {
2493
- throw new Error('Size must be xs, sm, or md');
2494
- }
2495
-
2496
- let pr, height, width, ml, top;
2497
-
2498
- if (size === 'xs') {
2499
- height = [14, 14, 14, 16];
2500
- width = [14, 14, 14, 14];
2501
- top = ['1px'];
2502
- ml = ['-14px', '-14px', '-14px', '-16px'];
2503
- }
2504
-
2505
- if (size === 'sm') {
2506
- height = [15, 15, 15, 20];
2507
- width = [15, 15, 15, 20];
2508
- top = ['1px'];
2509
- ml = ['-16px', '-16px', '-16px', '-20px'];
2510
- }
2511
-
2512
- if (size === 'md') {
2513
- height = [20, 20, 20, 20];
2514
- width = [20, 20, 20, 20];
2515
- top = ['2px'];
2516
- ml = ['-20px', '-20px', '-20px', '-20px'];
2517
- }
2518
-
2519
- pr = width.map(d => d + 12);
2520
- return /*#__PURE__*/React.createElement(Box, {
2521
- sx: _extends({
2522
- display: 'inline-block'
2523
- }, sx)
2524
- }, /*#__PURE__*/React.createElement(Box, _extends({
2525
- as: "select",
2526
- ref: ref,
2527
- onChange: e => {
2528
- ref.current.blur();
2529
- if (onChange) onChange(e);
2530
- },
2531
- sx: _extends({}, sizeStyles, {
2532
- lineHeight: 'normal',
2533
- cursor: 'pointer',
2534
- WebkitAppearance: 'none',
2535
- MozAppearance: 'none',
2536
- pb: ['5px'],
2537
- bg: 'transparent',
2538
- pr: pr,
2539
- border: 'none',
2540
- borderBottomStyle: 'solid',
2541
- borderBottomWidth: '1px',
2542
- borderBottomColor: 'primary',
2543
- borderRadius: '0px',
2544
- color: 'text',
2545
- width: 'fit-content',
2546
- color: color,
2547
- userSelect: 'none',
2548
- '@media (hover: none) and (pointer: coarse)': {
2549
- '&:focus-visible': {
2550
- outline: 'none !important',
2551
- background: 'transparent !important'
2552
- }
2553
- }
2554
- }, sxSelect)
2555
- }, omitOnChange), children), /*#__PURE__*/React.createElement(Arrow, {
2556
- sx: {
2557
- width: width,
2558
- height: height,
2559
- position: 'relative',
2560
- ml: ml,
2561
- top: top,
2562
- fill: 'secondary',
2563
- transform: 'rotate(135deg)',
2564
- pointerEvents: 'none'
2565
- }
2566
- }));
2567
- };
2568
-
2569
- const _excluded$1 = ["sx"];
2570
-
2571
- const Slider = (_ref, ref) => {
2572
- let {
2573
- sx
2574
- } = _ref,
2575
- props = _objectWithoutPropertiesLoose(_ref, _excluded$1);
2576
-
2577
- const color = sx && sx.color ? sx.color : 'primary';
2578
- const {
2579
- theme: {
2580
- rawColors: colors
2581
- }
2582
- } = useThemeUI();
2583
- return /*#__PURE__*/React.createElement(Slider$1, _extends({
2584
- ref: ref,
2585
- sx: _extends({
2586
- '&::-webkit-slider-thumb': {
2587
- height: [22, 18, 16],
2588
- width: [22, 18, 16],
2589
- boxShadow: `0 0 0 0px ${colors.secondary}`,
2590
- transition: 'box-shadow .15s ease'
2591
- },
2592
- '&::-moz-range-thumb': {
2593
- height: [22, 18, 16],
2594
- width: [22, 18, 16],
2595
- boxShadow: `0 0 0 0px ${colors.secondary}`,
2596
- transition: 'box-shadow .15s ease'
2597
- },
2598
- ':focus-visible': {
2599
- outline: 'none !important',
2600
- background: `${colors.secondary} !important`
2601
- },
2602
- ':focus': {
2603
- color: color,
2604
- '&::-webkit-slider-thumb': {
2605
- boxShadow: `0 0 0 4px ${colors.secondary}`
2606
- },
2607
- '&::-moz-range-thumb': {
2608
- boxShadow: `0 0 0 4px ${colors.secondary}`
2609
- }
2610
- },
2611
- color: color
2612
- }, sx)
2613
- }, props));
2614
- };
2615
-
2616
- var slider = forwardRef(Slider);
2617
-
2618
- const styles = {
2619
- reset: {
2620
- verticalAlign: 'baseline',
2621
- border: 0,
2622
- outline: 0,
2623
- margin: 0,
2624
- padding: 0
2625
- },
2626
- row: {
2627
- borderStyle: 'solid',
2628
- borderWidth: '0px',
2629
- borderTopWidth: '1px',
2630
- borderColor: 'muted',
2631
- pt: [3, 3, 3, '20px'],
2632
- pb: [3, 3, 3, '20px'],
2633
- mb: ['2px']
2634
- },
2635
- header: {
2636
- display: 'block',
2637
- textTransform: 'uppercase',
2638
- letterSpacing: 'smallcaps',
2639
- fontFamily: 'heading',
2640
- fontSize: [2, 2, 2, 3]
2641
- },
2642
- index: {
2643
- display: 'block',
2644
- textTransform: 'uppercase',
2645
- letterSpacing: 'smallcaps',
2646
- fontFamily: 'heading',
2647
- fontSize: [2, 2, 2, 3]
2648
- },
2649
- entry: {
2650
- display: 'block',
2651
- fontSize: [2, 2, 2, 3],
2652
- fontFamily: 'faux',
2653
- letterSpacing: 'faux',
2654
- mb: ['1px'],
2655
- mt: [2, 0, 0, 0]
2656
- }
2657
- };
2658
-
2659
- const Table = ({
2660
- data,
2661
- sx,
2662
- color,
2663
- header,
2664
- columns,
2665
- start,
2666
- width,
2667
- index: _index = true,
2668
- borderBottom: _borderBottom = true,
2669
- borderTop: _borderTop = true
2670
- }) => {
2671
- if (!start || !columns || !width) {
2672
- throw new Error('Must provide columns, start, and width');
2673
- }
2674
-
2675
- return /*#__PURE__*/React.createElement(Box, {
2676
- as: "table",
2677
- sx: _extends({
2678
- display: 'block'
2679
- }, sx)
2680
- }, /*#__PURE__*/React.createElement(Box, {
2681
- as: "tbody",
2682
- sx: {
2683
- display: 'block'
2684
- }
2685
- }, header && /*#__PURE__*/React.createElement(Row, {
2686
- as: "tr",
2687
- sx: _extends({}, styles.reset, styles.header, styles.row, {
2688
- color: color,
2689
- borderTopWidth: !_borderTop ? '0px' : '1px'
2690
- })
2691
- }, /*#__PURE__*/React.createElement(Column, {
2692
- as: "td",
2693
- start: [1],
2694
- width: columns,
2695
- sx: styles.index
2696
- }, header)), data.map((row, i) => {
2697
- return /*#__PURE__*/React.createElement(Row, {
2698
- as: "tr",
2699
- columns: columns,
2700
- key: i,
2701
- sx: _extends({}, styles.reset, styles.row, {
2702
- pb: _borderBottom && i === data.length - 1 ? ['18px', '18px', '18px', '22px'] : [3, 3, 3, '20px'],
2703
- borderBottomWidth: _borderBottom && i === data.length - 1 ? '1px' : '0px',
2704
- borderTopWidth: !_borderTop && i === 0 && !header ? '0px' : '1px'
2705
- })
2706
- }, row.map((column, j) => {
2707
- return /*#__PURE__*/React.createElement(Column, {
2708
- as: "td",
2709
- key: j,
2710
- start: start[j],
2711
- width: width[j],
2712
- sx: j == 0 && _index ? _extends({}, styles.reset, styles.index) : _extends({}, styles.reset, styles.entry)
2713
- }, column);
2714
- }));
2715
- })));
2716
- };
2717
-
2718
- const _excluded = ["value", "onClick", "disabled", "sx"];
2719
-
2720
- const Toggle = (_ref, ref) => {
2721
- let {
2722
- value,
2723
- onClick,
2724
- disabled,
2725
- sx
2726
- } = _ref,
2727
- props = _objectWithoutPropertiesLoose(_ref, _excluded);
2728
-
2729
- const color = sx && sx.color ? sx.color : 'primary';
2730
- value = disabled ? false : value;
2731
- return /*#__PURE__*/React.createElement(Box, _extends({
2732
- ref: ref,
2733
- as: "button",
2734
- onClick: onClick,
2735
- role: "checkbox",
2736
- "aria-checked": value,
2737
- "aria-label": "Toggle",
2738
- sx: _extends({
2739
- border: 'none',
2740
- background: 'none',
2741
- cursor: disabled ? 'default' : 'pointer',
2742
- p: [0],
2743
- m: [0],
2744
- display: 'inline-block'
2745
- }, sx)
2746
- }, props), /*#__PURE__*/React.createElement(Box, {
2747
- sx: {
2748
- width: '50px',
2749
- height: '20px',
2750
- borderRadius: '20px',
2751
- backgroundColor: value ? transparentize(color, color == 'primary' ? 0.5 : 0.45) : 'muted',
2752
- position: 'relative',
2753
- transition: '0.15s',
2754
- display: 'inline-block'
2755
- }
2756
- }, /*#__PURE__*/React.createElement(Box, {
2757
- sx: {
2758
- width: '14px',
2759
- height: '14px',
2760
- borderRadius: '7px',
2761
- position: 'absolute',
2762
- left: value ? '32px' : '4px',
2763
- top: '3px',
2764
- backgroundColor: value ? color : 'secondary',
2765
- transition: '0.15s'
2766
- }
2767
- })));
2768
- };
2769
-
2770
- var toggle = forwardRef(Toggle);
2771
-
2772
- const Tracking = ({
2773
- id
2774
- }) => {
2775
- if (!id) {
2776
- return null;
2777
- }
2778
-
2779
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("script", {
2780
- async: true,
2781
- src: `https://www.googletagmanager.com/gtag/js?id=${id}`
2782
- }), /*#__PURE__*/React.createElement("script", {
2783
- dangerouslySetInnerHTML: {
2784
- __html: `
2785
- window.dataLayer = window.dataLayer || [];
2786
- function gtag(){dataLayer.push(arguments);}
2787
- gtag('js', new Date());
2788
- gtag('config', '${id}', {
2789
- page_path: window.location.pathname,
2790
- });
2791
- `
2792
- }
2793
- }));
2794
- };
2795
-
2796
- const Tray = ({
2797
- expanded,
2798
- sx,
2799
- children
2800
- }) => {
2801
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Box, {
2802
- sx: {
2803
- position: 'fixed',
2804
- top: '56px',
2805
- bottom: '0px',
2806
- left: '0px',
2807
- width: 'calc(100vw)',
2808
- mt: ['56px'],
2809
- bg: 'background',
2810
- zIndex: 1000,
2811
- transition: 'opacity 0.15s',
2812
- opacity: expanded ? 0.9 : 0,
2813
- pointerEvents: expanded ? 'all' : 'none'
2814
- }
2815
- }), /*#__PURE__*/React.createElement(Box, {
2816
- sx: _extends({
2817
- position: 'fixed',
2818
- width: 'calc(100vw)',
2819
- top: '0px',
2820
- mt: ['56px'],
2821
- pb: [6, 7, 7, 8],
2822
- pt: [5, 6, 7, 8],
2823
- bg: 'background',
2824
- zIndex: 1100,
2825
- borderStyle: 'solid',
2826
- borderColor: 'muted',
2827
- borderWidth: '0px',
2828
- borderBottomWidth: '1px',
2829
- transition: 'transform 0.15s',
2830
- ml: [-3, -4, -5, -6],
2831
- pl: [3, 4, 5, 6],
2832
- pr: [3, 4, 5, 6],
2833
- transform: expanded ? 'translateY(0)' : 'translateY(-100%)'
2834
- }, sx)
2835
- }, /*#__PURE__*/React.createElement(Row, null, /*#__PURE__*/React.createElement(Column, {
2836
- start: [1, 1, 1, 1],
2837
- width: [6, 8, 10, 10]
2838
- }, children))));
2839
- };
2840
-
2841
- const defaultOptions = {
2842
- month: 'short',
2843
- day: 'numeric',
2844
- year: 'numeric'
2845
- };
2846
-
2847
- const formatDateElement = (date, element, option) => {
2848
- if (!option) {
2849
- return null;
2850
- }
2851
-
2852
- const format = typeof option === 'string' ? option : defaultOptions[element];
2853
- const result = date.toLocaleString('default', {
2854
- [element]: format
2855
- });
2856
-
2857
- if (format === 'numeric' && ['day', 'month'].includes(element)) {
2858
- return result.padStart(2, '0');
2859
- } else {
2860
- return result;
2861
- }
2862
- };
2863
-
2864
- const formatDate = (date, options = defaultOptions) => {
2865
- var _options$separator;
2866
-
2867
- const d = new Date(date.replace(/-/g, '/'));
2868
- const month = formatDateElement(d, 'month', options.month);
2869
- const day = formatDateElement(d, 'day', options.day);
2870
- const year = formatDateElement(d, 'year', options.year);
2871
- return [month, day, year].filter(Boolean).join((_options$separator = options.separator) != null ? _options$separator : ' ');
2872
- };
2873
-
2874
- export { Badge, button as Button, callout as Callout, Colorbar, Column, Custom404, Dimmer, Expander, FadeIn, Filter, Footer, Group, Guide, Header, input as Input, Layout, Link$1 as Link, Logo, Menu, Meta, Monogram, Row, Scrollbar, Select, Settings, slider as Slider, Table, Tag, toggle as Toggle, Tracking, Tray, formatDate, getScrollbarWidth };
1
+ import e,{forwardRef as t,cloneElement as r,useRef as n,useState as o,useEffect as a,useCallback as l}from"react";import{Box as i,Link as c,Flex as s,Grid as m,IconButton as p,Container as d,useColorMode as x,useThemeUI as h,Text as u,Styled as f,Input as g,Slider as y}from"theme-ui";import{transparentize as E}from"@theme-ui/color";import b from"next/link";import{Arrow as w,Sun as v}from"@carbonplan/icons";import{PoopSad as k}from"@carbonplan/emoji";import C from"next/head";import{keyframes as S}from"@emotion/react";function z(){return z=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},z.apply(this,arguments)}function M(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)t.indexOf(r=a[n])>=0||(o[r]=e[r]);return o}const A=["sx","children"],L=t=>{let{sx:r,children:n}=t,o=M(t,A);const a=r&&r.color?r.color:"primary";return e.createElement(i,z({sx:z({display:"inline-block",width:"fit-content",height:["24px","24px","24px","26px"],borderRadius:"5px",backgroundColor:"primary"==a||"secondary"==a?"muted":E(a,.7),textAlign:"center",userSelect:"none",fontSize:[2,2,2,3]},r)},o),e.createElement(i,{sx:{letterSpacing:"0.02em",fontFamily:"mono",mt:["1px","1px","1px","0px"],px:[1,1,1,"5px"],color:a}},n))},W=["href","children","internal","tracking"];var T=t((t,r)=>{let{href:n,children:o,internal:a=!1,tracking:l=!1}=t,i=M(t,W);if(a||n&&n.startsWith("/"))return e.createElement(b,{href:n,passHref:!0},e.createElement(c,z({ref:r},i),o));if(l){let t,a;n&&n.includes("pdf")?(t="PDF",a="download"):(t="website",a="external");const l=e=>{(({action:e,category:t,label:r,value:n})=>{"function"==typeof window.gtag?window.gtag("event",e,{event_category:t,event_label:r,value:n}):console.warn(`Missing window.gtag, skipping analytics action: '${e}'.`)})({action:t,category:a,label:n})};return e.createElement(c,z({ref:r,onClick:l,onContextMenu:l,href:n},i),o)}return e.createElement(c,z({ref:r,href:n},i),o)});const F=e=>{if(!["xs","sm","md","lg","xl"].includes(e))throw new Error("Size must be xs, sm, md, lg, or xl");let t,r,n,o;return"xs"===e&&(t=[2,2,2,3],r="body",n="body",o=[1.2]),"sm"===e&&(t=[3,3,3,4],r="body",n="body",o=[1.2]),"md"===e&&(t=[4,4,4,5],r="body",n="body",o=[1.2]),"lg"===e&&(t=[5,5,6,7],r="heading",n="heading",o=[1.2,1.2,1.25,1.25]),"xl"===e&&(t=[6,7,8,9],r="heading",n="heading",o=[1.25]),{fontSize:t,fontFamily:r,letterSpacing:n,lineHeight:o}},B=["size","prefix","suffix","inverted","sx","children","align","href","internal","tracking"];var I=t((t,n)=>{let o,a,l,c,s,{size:m="sm",prefix:p,suffix:d,inverted:x,sx:h,children:u,align:f,href:g,internal:y,tracking:E}=t,b=M(t,B);if(!["xs","sm","md","lg","xl"].includes(m))throw new Error("Size must be xs, sm, md, lg, or xl");const w=h&&h.color?h.color:null,v=w||(x?"secondary":"primary"),k=w||x?"primary":"secondary";let C,S,A,L,W,I;"xs"===m&&(a=["6px","6px","6px","6px"],l=[12,12,12,13],c=[12,12,12,13],s=[1.5,1.5,1.5,1.5],o={transform:"translateY(0.25px)"}),"sm"===m&&(a=["7px","7px","7px","7px"],l=[13,13,13,18],c=[13,13,13,18],s=[1.5,1.5,1.5,2],o={transform:"translateY(0.25px)"}),"md"===m&&(a=["8px","8px","8px","8px"],l=[18,18,18,24],c=[18,18,18,24],s=[2,2,2,3]),"lg"===m&&(a=["10px","10px","12px","16px"],l=[24,24,34,46],c=[24,24,34,46],s=[3,3,4,5]),"xl"===m&&(a=["12px","16px","18px","20px"],l=[34,46,56,68],c=[34,46,56,68],s=[4,5,6,7]),f?(A=f,L=f):p&&d?(A="initial",L="initial"):p?A="initial":d&&(L="middle"),W="middle"===A?{}:o,I="middle"===L?{}:o,p&&(C={"&:hover > #prefix-span > #prefix":z({color:k},p.type.hover)},p=r(p,{id:"prefix",sx:z({position:"relative",height:l,width:c,mr:u?a:[0],strokeWidth:s,verticalAlign:A,transition:"color 0.15s, transform 0.15s"},p.props.sx)})),d&&(S={"&:hover > #suffix-span >#suffix":z({color:k},d.type.hover)},d=r(d,{id:"suffix",sx:z({height:l,width:c,ml:u?a:[0],strokeWidth:s,verticalAlign:L,transition:"color 0.15s, transform 0.15s"},d.props.sx)}));const D=z({},F(m),{lineHeight:1.05,border:"none",background:"transparent",display:"block",color:v,padding:[0],textAlign:"left",cursor:"pointer",width:"fit-content","@media (hover: hover) and (pointer: fine)":z({"&:hover":{color:k}},S,C)},h),O=e.createElement(e.Fragment,null,e.createElement(i,{as:"span",id:"prefix-span",sx:z({display:"inline-block"},W)},p&&p),e.createElement(i,{as:"span",sx:{transition:"color 0.15s"}},u),e.createElement(i,{as:"span",id:"suffix-span",sx:z({display:"inline-block"},I)},d&&d));return g?e.createElement(T,z({ref:n,href:g,internal:y,tracking:E,sx:z({},D,{textDecoration:"none"})},b),O):e.createElement(i,z({ref:n,as:"button",sx:D},b),O)});const D=["label","children","inverted","color","href","internal","tracking","sx"];var O=t((t,r)=>{let{label:n,children:o,inverted:a,color:l,href:c,internal:s,tracking:m,sx:p}=t,d=M(t,D);const x=l||(a?"secondary":"primary"),h=l||a?"primary":"secondary",u=z({border:"none",padding:[0],fontSize:[3,3,3,4],color:x,background:"transparent",textDecoration:"none",fontFamily:"body",lineHeight:"h3",letterSpacing:"body",width:"fit-content",cursor:"pointer",textAlign:"left",mb:[1],"@media (hover: hover) and (pointer: fine)":{"&:hover > #container > #arrow":{transform:"rotate(45deg)",fill:h},"&:hover":{color:h}}},p),f=e.createElement(e.Fragment,null,e.createElement(i,{sx:{transition:"0.15s",letterSpacing:"body",pb:["6px"]}},o),e.createElement(i,{sx:{transition:"0.15s",display:"inline-block",textTransform:"uppercase",letterSpacing:"smallcaps",fontFamily:"heading",fontSize:[2,2,2,3]}},n),e.createElement(i,{as:"span",id:"container",sx:{ml:[2],display:"inline-block"}},e.createElement(w,{id:"arrow",sx:{transition:"fill 0.15s, transform 0.15s",position:"relative",top:["2px"],color:x,height:[15,15,15,17],width:[15,15,15,17]}})));return c?e.createElement(T,z({ref:r,href:c,internal:s,tracking:m,sx:u},d),f):e.createElement(i,z({ref:r,as:"button",sx:u},d),f)});const $=["colormap","label","clim","setClim","setClimStep","discrete","units","width","height","format","horizontal","bottom","sx","sxClim"],R=e=>({fontFamily:"mono",fontSize:["9px",0,0,1],letterSpacing:"smallcaps",textTransform:"uppercase","@media (hover: hover) and (pointer: fine)":{"&:hover":{borderBottom:e?({colors:e})=>`solid 1px ${e.primary} !important`:"unset"}},"&:focus":{outline:"none",borderBottom:e?({colors:e})=>`solid 1px ${e.primary} !important`:"unset"},transition:"border 0.15s",userSelect:e?"none !important":"unset",width:"fit-content",minWidth:"fit-content"}),H={width:["10px","16px","16px","17px"],height:["80px","110px","110px","130px"]},_=({colormap:t,discrete:r,horizontal:n,width:o,height:a})=>{const l=1/t.length*100,c=`linear-gradient(to ${n?"right":"top"}, ${t.map((e,n)=>`rgb(${e}) ${n*l}% ${r&&n<t.length-1?(n+1)*l+"%":""}`).join(",")})`;return e.createElement(i,{sx:z({},n?{width:o||H.height,height:a||H.width}:{width:o||H.width,minHeight:a||H.height},{mt:n?["1px","1px","1px",0]:0,border:({colors:e})=>`solid 1px ${e.hinted}`,background:c})})},j=({label:t,units:r,horizontal:n})=>e.createElement(i,{sx:!n&&{width:["13px","17px","17px","19px"],alignSelf:"flex-end"}},e.createElement(i,{sx:z({mb:n?0:["-4px","-4px","-4px","-3px"],fontFamily:"mono",fontSize:["9px",0,0,1],letterSpacing:"smallcaps",textTransform:"uppercase"},n?{}:{writingMode:"vertical-rl",transform:"rotate(180deg)",whiteSpace:"nowrap",display:"inline-block",overflow:"visible"})},t," ",e.createElement(i,{as:"span",sx:{textTransform:"none",color:"secondary",display:"inline-block"}},r))),V=t=>{let{colormap:r,label:l,clim:c,setClim:m,setClimStep:p=1,discrete:d,units:x,width:h,height:u,format:f=(e=>e),horizontal:g=!1,bottom:y=!1,sx:E,sxClim:b}=t,w=M(t,$);if(!Array.isArray(r))throw new Error(`expected array for colormap, got '${r}'.`);const v=[n(),n()],[k,C]=o(!1),[S,A]=o(!1);let L,W,T,F=0,B=null,I=[0,0],D=p;const O=e=>{"min"!==B||k||C(!0),"max"!==B||S||A(!0),T=e.pageX-L,F=e.pageY-W,g?("min"===B&&m(e=>[Math.min(I[0]+T*D,I[1]),e[1]]),"max"===B&&m(e=>[e[0],Math.max(I[1]+T*D,I[0])])):("min"===B&&m(e=>[Math.min(I[0]-F*D,I[1]),e[1]]),"max"===B&&m(e=>[e[0],Math.max(I[1]-F*D,I[0])]))},V=e=>{W=e.pageY,L=e.pageX,B=e.target.id,I=c,document.body.setAttribute("style",g?"cursor: ew-resize !important":"cursor: ns-resize !important"),document.addEventListener("mousemove",O);const t=()=>{document.body.setAttribute("style","cursor: unset"),document.removeEventListener("mousemove",O),window.removeEventListener("mouseup",t),"min"===B&&C(!1),"max"===B&&A(!1)};window.addEventListener("mouseup",t)};a(()=>{const e=e=>{(["ArrowUp","ArrowRight"].includes(e.code)||["ArrowUp","ArrowRight"].includes(e.key))&&(e=>{v[0].current===document.activeElement&&(e.preventDefault(),m(e=>[Math.min(e[0]+D,e[1]),e[1]]),v[0].current.focus()),v[1].current===document.activeElement&&(e.preventDefault(),m(e=>[e[0],Math.max(e[1]+D,e[0])]),v[1].current.focus())})(e),(["ArrowDown","ArrowLeft"].includes(e.code)||["ArrowDown","ArrowLeft"].includes(e.key))&&(e=>{v[0].current===document.activeElement&&(e.preventDefault(),m(e=>[Math.min(e[0]-D,e[1]),e[1]]),v[0].current.focus()),v[1].current===document.activeElement&&(e.preventDefault(),m(e=>[e[0],Math.max(e[1]-D,e[0])]),v[1].current.focus())})(e)};return window.addEventListener("keydown",e),()=>{window.removeEventListener("keydown",e)}},[c]);const N=()=>e.createElement(i,{id:"min",ref:v[0],tabIndex:0,sx:z({},R(m),{ml:l?g?y?"0px":"10px":["2px","1px","1px","2px"]:0,mr:g?["2px","1px","1px","2px"]:0,mb:g?0:["-2px","-2px","-2px","-3px"],borderBottom:m?k?({colors:e})=>`solid 1px ${e.primary}`:({colors:e})=>`solid 1px ${e.secondary}`:"unset",cursor:m?g?"ew-resize":"ns-resize":"default"},b),onMouseDown:m?V:()=>{},onClick:()=>v[0].current.focus()},f(c[0])),P=()=>e.createElement(i,{id:"max",ref:v[1],tabIndex:0,sx:z({},R(m),{ml:["2px","1px","1px","2px"],mt:g?0:["-2px","-3px","-3px","-3px"],borderBottom:m?S?({colors:e})=>`solid 1px ${e.primary}`:({colors:e})=>`solid 1px ${e.secondary}`:"unset",cursor:m?g?"ew-resize":"ns-resize":"default"},b),onMouseDown:m?V:()=>{},onClick:()=>v[1].current.focus()},f(c[1]));return e.createElement(s,z({},w,{sx:z({flexDirection:"row",alignItems:"start",justifyContent:"flex-start",gap:["3px","6px","6px","7px"],height:g?"unset":"100%"},E)}),l&&e.createElement(j,{label:l,units:x,horizontal:g}),e.createElement(s,{sx:{flexGrow:g?1:"unset",flexDirection:"column",ml:y&&l?"4px":"0px",height:g?"unset":"100%"}},e.createElement(s,{sx:{gap:["3px","6px","6px","7px"],height:g?"unset":"100%"}},g&&c&&!y&&e.createElement(N,null),e.createElement(_,{colormap:r,horizontal:g,discrete:d,width:h,height:u}),g&&c&&!y&&e.createElement(P,null)),g&&c&&y&&e.createElement(s,{sx:{justifyContent:"space-between"}},e.createElement(N,null),e.createElement(P,null))),!g&&e.createElement(s,{sx:{flexDirection:"column-reverse",justifyContent:"space-between",height:u||H.height}},c&&e.createElement(N,null),c&&e.createElement(P,null)))},N=["start","width","dl","dr","children","sx"],P=t=>{let{start:r,width:n,dl:o,dr:a,children:l,sx:c}=t,s=M(t,N);r=r||"auto",n=n||"auto";const m=e=>{if(e&&!Array.isArray(e)&&(e=[e]),![1,2,4].includes(e.length))throw new Error("Array length must be 1, 2, or 4");return Array.isArray(e)&&1==e.length?e=e.map(e=>[e,e,e,e]).flat():Array.isArray(e)&&2==e.length&&(e=e.map(e=>[e,e]).flat()),e};r=m(r),n=m(n);const p=r.map((e,t)=>"auto"==e?"auto":e+n[t]);let d,x;if(o){if(![.5,1].includes(o))throw new Error("dl must be 0.5 or 1");.5===o&&(d=["-12px",-3,-3,-4]),1===o&&(d=[-4,-5,-5,-6])}if(a){if(![.5,1].includes(a))throw new Error("dr must be 0.5 or 1");.5===a&&(x=["-12px",-3,-3,-4]),1===a&&(x=[-4,-5,-5,-6])}return e.createElement(i,z({},s,{sx:z({gridColumnStart:r,gridColumnEnd:p,ml:d,mr:x},c)}),l)},G=({title:t,description:r,card:n})=>(r=r||"Data and science for climate action.",n=n||"https://images.carbonplan.org/social/homepage.png",e.createElement(C,null,e.createElement("title",null,t=t||"carbonplan"),e.createElement("meta",{name:"description",content:r}),e.createElement("meta",{name:"viewport",content:"initial-scale=1.0, width=device-width"}),e.createElement("link",{rel:"canonical",content:"https://carbonplan.org/"}),e.createElement("link",{rel:"icon",type:"image/svg+xml",href:"https://images.carbonplan.org/favicon.svg"}),e.createElement("link",{rel:"preload",href:"https://fonts.carbonplan.org/relative/relative-book-pro.woff2",as:"font",type:"font/woff2",crossOrigin:"anonymous"}),e.createElement("link",{rel:"preload",href:"https://fonts.carbonplan.org/relative/relative-medium-pro.woff2",as:"font",type:"font/woff2",crossOrigin:"anonymous"}),e.createElement("link",{rel:"preload",href:"https://fonts.carbonplan.org/relative/relative-mono-11-pitch-pro.woff2",as:"font",type:"font/woff2",crossOrigin:"anonymous"}),e.createElement("link",{rel:"preload",href:"https://fonts.carbonplan.org/relative/relative-faux-book-pro.woff2",as:"font",type:"font/woff2",crossOrigin:"anonymous"}),e.createElement("link",{rel:"manifest",href:"https://images.carbonplan.org/manifest.json"}),e.createElement("meta",{name:"theme-color",content:"#1b1e23"}),e.createElement("link",{rel:"alternate icon",type:"image/png",href:"https://images.carbonplan.org/favicon.png"}),e.createElement("link",{rel:"mask-icon",href:"https://images.carbonplan.org/safari-pinned-tab.svg",color:"#000000"}),e.createElement("link",{rel:"apple-touch-icon",sizes:"180x180",href:"https://images.carbonplan.org/apple-touch-icon.png"}),e.createElement("meta",{name:"msapplication-TileColor",content:"#1b1e23"}),e.createElement("meta",{name:"msapplication-TileImage",content:"https://images.carbonplan.org/mstile-144x144.png"}),e.createElement("meta",{name:"msapplication-config",content:"https://images.carbonplan.org/browserconfig.xml"}),e.createElement("meta",{property:"og:title",content:t}),e.createElement("meta",{property:"og:description",content:r}),e.createElement("meta",{property:"og:image",content:n}),e.createElement("meta",{property:"og:url",content:"https://carbonplan.org"}),e.createElement("meta",{name:"twitter:title",content:t}),e.createElement("meta",{name:"twitter:description",content:r}),e.createElement("meta",{name:"twitter:image",content:n}),e.createElement("meta",{name:"twitter:card",content:"summary_large_image"}))),Y=t=>{let r=z({},t);return e.createElement(i,z({as:"svg",width:"150",fill:"currentColor",stroke:"none",viewBox:"0 0 151.1 28.8"},r),e.createElement("g",null,e.createElement("g",null,e.createElement("path",{d:"M9.7,20.1c-1.3-1.4-2-3.1-2-5.2c0-2.1,0.7-3.9,2-5.2c1.3-1.4,3-2,5.1-2c1.7,0,3.1,0.4,4.3,1.3 c1.1,0.9,1.8,2.1,2.1,3.5c0,0.1,0,0.2,0,0.3s-0.1,0.2-0.2,0.2h-2.3c-0.2,0-0.3-0.1-0.4-0.2c-0.3-0.8-0.7-1.4-1.3-1.8 c-0.6-0.4-1.4-0.6-2.2-0.6c-1.3,0-2.3,0.4-3,1.2c-0.8,0.8-1.1,1.9-1.1,3.4c0,1.5,0.4,2.6,1.1,3.4c0.8,0.8,1.8,1.2,3,1.2 c0.8,0,1.6-0.2,2.2-0.6c0.6-0.4,1.1-1,1.3-1.8c0.1-0.2,0.2-0.2,0.4-0.3H21c0.1,0,0.2,0.1,0.2,0.2c0,0.1,0,0.2,0,0.3 c-0.3,1.4-1,2.6-2.1,3.5c-1.1,0.9-2.5,1.3-4.3,1.3C12.7,22.1,11,21.4,9.7,20.1z"})),e.createElement("g",null,e.createElement("path",{d:"M22.5,17.6c0-1.5,0.5-2.6,1.6-3.5c1.1-0.8,2.4-1.2,4.1-1.2c1.1,0,2.4,0.2,3.7,0.6V13c0-0.9-0.3-1.6-0.8-2.1 c-0.5-0.5-1.2-0.8-2.2-0.8c-1.4,0-2.4,0.6-2.9,1.8c-0.1,0.2-0.2,0.2-0.4,0.2h-2.3c-0.1,0-0.2-0.1-0.2-0.2c0-0.1,0-0.2,0-0.3 c0.3-1.2,0.9-2.2,1.9-2.9c1-0.8,2.3-1.1,3.8-1.1C30.6,7.6,32,8.1,33,9c1,0.9,1.5,2.2,1.5,3.8V19c0,1.1,0.2,1.9,0.5,2.6 c0,0.1,0.1,0.1,0.1,0.1c0,0.1-0.1,0.1-0.3,0.1h-2.8c-0.2,0-0.3-0.1-0.3-0.3v-1c-1.1,1.1-2.5,1.6-4.3,1.6c-1.4,0-2.6-0.4-3.6-1.2 C23,20.1,22.5,19,22.5,17.6z M25.4,17.5c0,0.6,0.2,1.1,0.7,1.5c0.4,0.4,1.1,0.5,1.9,0.5c1.1,0,2-0.3,2.8-0.9 c0.8-0.6,1.1-1.5,1.1-2.6c-1.3-0.4-2.5-0.6-3.6-0.6c-0.8,0-1.5,0.2-2.1,0.5C25.7,16.3,25.4,16.8,25.4,17.5z"})),e.createElement("g",null,e.createElement("path",{d:"M37,21.6V8.2c0-0.2,0.1-0.3,0.3-0.3h2.2c0.2,0,0.3,0.1,0.3,0.3v1.1c1-1.1,2.3-1.6,3.7-1.6 c0.8,0,1.7,0.1,2.5,0.4c0.2,0.1,0.3,0.3,0.3,0.5v2.2c0,0.2-0.1,0.3-0.2,0.3c0,0-0.1,0-0.2-0.1c-1.1-0.5-2-0.8-2.9-0.8 c-0.9,0-1.7,0.4-2.3,1.1c-0.6,0.7-0.9,1.7-0.9,3v7.3c0,0.2-0.1,0.3-0.3,0.3h-2.2C37.1,21.8,37,21.7,37,21.6z"})),e.createElement("g",null,e.createElement("path",{d:"M47.6,21.6V2.7c0-0.2,0.1-0.3,0.3-0.3H50c0.2,0,0.3,0.1,0.3,0.3v6.5c1.3-1.1,2.7-1.6,4.3-1.6 c1.9,0,3.4,0.7,4.6,2c1.1,1.3,1.7,3.1,1.7,5.3c0,2.2-0.6,4-1.7,5.3c-1.1,1.3-2.7,2-4.6,2c-1.8,0-3.2-0.5-4.3-1.6v1 c0,0.2-0.1,0.3-0.3,0.3h-2.2C47.7,21.8,47.6,21.7,47.6,21.6z M51.2,11.5c-0.7,0.9-1.1,2-1.1,3.3c0,1.4,0.4,2.5,1.1,3.3 s1.7,1.3,2.9,1.3c1.2,0,2.2-0.4,2.9-1.3c0.7-0.9,1.1-2,1.1-3.3c0-1.4-0.4-2.5-1.1-3.3c-0.7-0.9-1.7-1.3-2.9-1.3 C52.9,10.2,51.9,10.7,51.2,11.5z"})),e.createElement("g",null,e.createElement("path",{d:"M64.3,20.1c-1.4-1.4-2.1-3.1-2.1-5.2c0-2.1,0.7-3.9,2.1-5.2c1.4-1.4,3.1-2,5.2-2c2.1,0,3.8,0.7,5.2,2 c1.4,1.4,2.1,3.1,2.1,5.2c0,2.1-0.7,3.9-2.1,5.2c-1.4,1.4-3.1,2-5.2,2C67.4,22.1,65.7,21.4,64.3,20.1z M66.4,11.5 c-0.8,0.8-1.2,2-1.2,3.4c0,1.4,0.4,2.5,1.2,3.4s1.9,1.3,3.1,1.3c1.3,0,2.3-0.4,3.1-1.3c0.8-0.8,1.2-2,1.2-3.4 c0-1.4-0.4-2.5-1.2-3.4c-0.8-0.8-1.9-1.3-3.1-1.3C68.2,10.2,67.2,10.7,66.4,11.5z"})),e.createElement("g",null,e.createElement("path",{d:"M78.7,21.6V8.2c0-0.2,0.1-0.3,0.3-0.3h2.2c0.2,0,0.3,0.1,0.3,0.3v1.3c1.3-1.2,2.7-1.8,4.4-1.8 c1.5,0,2.7,0.4,3.5,1.3c0.8,0.9,1.3,2,1.3,3.6v9.1c0,0.2-0.1,0.3-0.3,0.3h-2.2c-0.2,0-0.3-0.1-0.3-0.3v-8.3c0-2-0.9-3.1-2.8-3.1 c-1.1,0-1.9,0.4-2.7,1.2c-0.7,0.8-1.1,2-1.1,3.5v6.6c0,0.2-0.1,0.3-0.3,0.3h-2.2C78.7,21.8,78.7,21.7,78.7,21.6z"})),e.createElement("g",null,e.createElement("path",{d:"M101.7,27.1V8.2c0-0.2,0.1-0.3,0.3-0.3h2.2c0.2,0,0.3,0.1,0.3,0.3v1c1.1-1.1,2.5-1.6,4.3-1.6 c1.9,0,3.4,0.7,4.6,2s1.7,3.1,1.7,5.3c0,2.2-0.6,4-1.7,5.3c-1.1,1.3-2.7,2-4.6,2c-1.5,0-3-0.5-4.3-1.6v6.6c0,0.2-0.1,0.3-0.3,0.3 H102C101.8,27.3,101.7,27.2,101.7,27.1z M105.3,11.5c-0.7,0.9-1.1,2-1.1,3.3c0,1.4,0.4,2.5,1.1,3.3s1.7,1.3,2.9,1.3 c1.2,0,2.2-0.4,2.9-1.3c0.7-0.9,1.1-2,1.1-3.3c0-1.4-0.4-2.5-1.1-3.3c-0.7-0.9-1.7-1.3-2.9-1.3C107,10.2,106,10.7,105.3,11.5z"})),e.createElement("g",null,e.createElement("path",{d:"M117.2,21.6V2.7c0-0.2,0.1-0.3,0.3-0.3h2.2c0.2,0,0.3,0.1,0.3,0.3v18.9c0,0.2-0.1,0.3-0.3,0.3h-2.2 C117.3,21.8,117.2,21.7,117.2,21.6z"})),e.createElement("g",null,e.createElement("path",{d:"M122,17.6c0-1.5,0.5-2.6,1.6-3.5c1.1-0.8,2.4-1.2,4.1-1.2c1.1,0,2.4,0.2,3.7,0.6V13c0-0.9-0.3-1.6-0.8-2.1 c-0.5-0.5-1.2-0.8-2.2-0.8c-1.4,0-2.4,0.6-2.9,1.8c-0.1,0.2-0.2,0.2-0.4,0.2h-2.3c-0.1,0-0.2-0.1-0.2-0.2c0-0.1,0-0.2,0-0.3 c0.3-1.2,0.9-2.2,1.9-2.9c1-0.8,2.3-1.1,3.8-1.1c1.7,0,3.1,0.5,4.2,1.4s1.5,2.2,1.5,3.8V19c0,1.1,0.2,1.9,0.5,2.6 c0,0.1,0.1,0.1,0.1,0.1c0,0.1-0.1,0.1-0.3,0.1h-2.8c-0.2,0-0.3-0.1-0.3-0.3v-1c-1.1,1.1-2.5,1.6-4.3,1.6c-1.4,0-2.6-0.4-3.6-1.2 C122.5,20.1,122,19,122,17.6z M124.9,17.5c0,0.6,0.2,1.1,0.7,1.5c0.4,0.4,1.1,0.5,1.9,0.5c1.1,0,2-0.3,2.8-0.9 c0.8-0.6,1.1-1.5,1.1-2.6c-1.3-0.4-2.5-0.6-3.6-0.6c-0.8,0-1.5,0.2-2.1,0.5C125.2,16.3,124.9,16.8,124.9,17.5z"})),e.createElement("g",null,e.createElement("path",{d:"M136.9,21.6V8.2c0-0.2,0.1-0.3,0.3-0.3h2.2c0.2,0,0.3,0.1,0.3,0.3v1.3c1.3-1.2,2.7-1.8,4.4-1.8 c1.5,0,2.7,0.4,3.5,1.3c0.8,0.9,1.3,2,1.3,3.6v9.1c0,0.2-0.1,0.3-0.3,0.3h-2.2c-0.2,0-0.3-0.1-0.3-0.3v-8.3c0-2-0.9-3.1-2.8-3.1 c-1.1,0-1.9,0.4-2.7,1.2c-0.7,0.8-1.1,2-1.1,3.5v6.6c0,0.2-0.1,0.3-0.3,0.3h-2.2C137,21.8,136.9,21.7,136.9,21.6z"})),e.createElement("path",{d:"M97.6,14.9c0,4.2-0.6,8.3-1.6,12.3c0,0.1-0.1,0.2-0.2,0.2h-2.4c-0.1,0-0.2-0.1-0.2-0.3c1.1-3.9,1.7-8,1.7-12.2 s-0.6-8.3-1.7-12.2c0-0.1,0.1-0.3,0.2-0.3l2.4,0c0.1,0,0.2,0.1,0.2,0.2C97.1,6.5,97.6,10.6,97.6,14.9z"}),e.createElement("path",{d:"M1.4,14.9C1.4,10.6,2,6.5,3,2.6c0-0.1,0.1-0.2,0.2-0.2l2.4,0c0.1,0,0.2,0.1,0.2,0.3c-1.1,3.9-1.7,8-1.7,12.2 s0.6,8.3,1.7,12.2c0,0.1-0.1,0.3-0.2,0.3H3.3c-0.1,0-0.2-0.1-0.2-0.2C2,23.2,1.4,19.1,1.4,14.9z"})))},X=["children","sx","columns","gap"],U=t=>{let{children:r,sx:n,columns:o,gap:a}=t,l=M(t,X);const i=e=>{if(Array.isArray(e)||(e=[e,e,e,e]),Array.isArray(e)&&![1,2,4].includes(e.length))throw new Error("Array length must be 1, 2, or 4");return Array.isArray(e)&&1==e.length&&(e=e.map(e=>[e]).flat()),Array.isArray(e)&&2==e.length&&(e=e.map(e=>[e,e]).flat()),e};let c,s;return Number.isInteger(a)||Array.isArray(a)?(a=i(a),c=a,s=a):(c=[4,5,5,6],s=[0,0,0,0]),o=Number.isInteger(o)||Array.isArray(o)?i(o):[6,8,12,12],e.createElement(m,z({},l,{columns:o,sx:z({columnGap:c,rowGap:s},n)}),r)},K=["value","sx"],Z=t=>{let{value:r,sx:n}=t,o=M(t,K);return e.createElement(p,z({sx:z({cursor:"pointer",fill:"none",strokeWidth:"2px",stroke:"text",".paren":{opacity:"0"},"@media (hover: hover) and (pointer: fine)":{"&:hover .paren":{opacity:"1"}}},n),"aria-label":"Toggle Menu"},o),!r&&e.createElement("svg",{style:{width:"50px",height:"30px",transform:"scale(2)",marginTop:"-3px"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 68 36"},e.createElement("line",{x1:"52",y1:"29.9",x2:"16",y2:"29.9"}),e.createElement("line",{x1:"52",y1:"6.1",x2:"16",y2:"6.1"}),e.createElement("line",{x1:"52",y1:"18",x2:"16",y2:"18"}),e.createElement("path",{style:{transition:"all 0.2s"},className:"paren",d:"M6.4,1.2c-6.3,10.3-6.3,23.3,0,33.6"}),e.createElement("path",{style:{transition:"all 0.2s"},className:"paren",d:"M61.6,34.8c6.3-10.3,6.3-23.3,0-33.6"})),r&&e.createElement("svg",{style:{width:"50px",height:"30px",transform:"scale(2)",marginTop:"-3px"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 68 36"},e.createElement("line",{x1:"50.85",y1:"29.79",x2:"17.15",y2:"6.21"}),e.createElement("line",{x1:"17.15",y1:"29.79",x2:"50.85",y2:"6.21"}),e.createElement("path",{style:{transition:"all 0.2s"},className:"paren",d:"M6.4,1.2c-6.3,10.3-6.3,23.3,0,33.6"}),e.createElement("path",{style:{transition:"all 0.2s"},className:"paren",d:"M61.6,34.8c6.3-10.3,6.3-23.3,0-33.6"})))},q=(e,t,r=!1)=>({width:"auto",color:e===t?"secondary":"text",fontSize:[6,6,7,8],fontFamily:"heading",letterSpacing:"heading",borderStyle:"solid",borderColor:"muted",borderWidth:"0px",borderBottomWidth:"1px",borderTopWidth:r?"1px":"0px",py:[3,3,4,5],textDecoration:"none",display:"block",position:"relative",transition:"color 0.15s","@media (hover: hover) and (pointer: fine)":{"&:hover > #arrow":{opacity:1}},"&:hover":{color:e==t?"secondary":"text"}}),J=[{url:"about",display:"About"},{url:"research",display:"Research"},{url:"blog",display:"Blog"},{url:"press",display:"Press"}],Q=()=>e.createElement(w,{id:"arrow",sx:{pointerEvents:"none",display:"inline-block",position:"absolute",left:["-60px","-68px","-80px","-104px"],top:["32px","32px","46px","62px"],opacity:0,transition:"opacity 0.2s ease-out",transform:"rotate(45deg)",width:[36,36,48,56],height:[36,36,48,56]}}),ee=({link:t,mode:r,nav:n,first:o,setExpanded:a})=>{const{url:l,display:i}=t,s="remote"===r?"https://carbonplan.org/"+l:"/"+l;return"homepage"===r||"local"===r&&n===l?e.createElement(b,{href:s,passHref:!0},e.createElement(c,{onClick:()=>{n===l&&a(!1)},sx:q(n,l,o)},e.createElement(Q,null),i)):e.createElement(c,{href:s,sx:q(n,l,o)},e.createElement(Q,null),i)},te=({links:t,nav:r,mode:n,setExpanded:o})=>t.map((t,a)=>e.createElement(ee,{key:a,link:t,mode:n,nav:r,first:0===a,setExpanded:o})),re=({status:t,mode:r,nav:n,menuItems:a})=>{const[l,m]=o(!1);return e.createElement(U,{sx:{pt:["12px"],pb:[3]}},e.createElement(P,{start:[1],width:[2]},e.createElement(i,{sx:{pointerEvents:"all",display:"block",width:"fit-content"}},("homepage"==r||"local"==r)&&e.createElement(b,{href:"/",passHref:!0},e.createElement(c,{"aria-label":"CarbonPlan Homepage",sx:{display:"block"}},e.createElement(Y,{id:"logo",sx:{cursor:"pointer",color:"primary"}}))),(null==r||"remote"==r)&&e.createElement(c,{href:"https://carbonplan.org","aria-label":"CarbonPlan Homepage",sx:{display:"block"}},e.createElement(Y,{sx:{cursor:"pointer",color:"primary"}})))),e.createElement(P,{start:[4,9],width:[2,2],dr:1,sx:{display:[t?"flex":"none","flex","flex","flex"],alignItems:"center"}},e.createElement(i,{sx:{fontSize:[1,2,3],position:"relative",top:["-2px","-3px","-3px"]}},t?`(${t})`:"")),e.createElement(P,{start:[t?6:4,6,11,11],width:[t?1:3,3,2,2],sx:{zIndex:5e3}},e.createElement(s,{sx:{pointerEvents:"all",justifyContent:"flex-end"}},e.createElement(i,{sx:{display:[t?"none":"flex","flex","flex","flex"],mr:"18px",gap:"18px",opacity:l?0:1,transition:"opacity 0.15s",justifyContent:"space-between",alignItems:"center"}},a),e.createElement(Z,{sx:{flexShrink:0,mr:["-2px"]},value:l,onClick:e=>{m(!l)}}))),e.createElement(i,{sx:{opacity:l?1:0,pointerEvents:l?"all":"none",position:"fixed",top:"0px",right:"0px",bottom:"0px",minWidth:"0px",maxHeight:"100vh",width:"100vw",backgroundColor:"background",zIndex:4e3,pt:["79px"],transition:"opacity 0.25s"}},e.createElement(d,null,e.createElement(U,null,e.createElement(P,{start:[2,4,7,7],width:[5,4,5,5]},e.createElement(i,{as:"nav",sx:{display:l?"inherit":"none",mt:[5,5,5,6]}},e.createElement(te,{links:J,nav:n,mode:r,setExpanded:m})))))))},ne=t=>{let r=z({},t);return e.createElement(i,z({as:"svg",width:"80",stroke:"none",fill:"currentColor",viewBox:"0 0 32 32"},r),e.createElement("path",{d:"M21.9395,14.9395 L17.5005,19.3785 L17.5005,7.0005 L14.5005,7.0005 L14.5005,19.3785 L10.0605,14.9395 L7.9395,17.0605 L14.9395,24.0605 C15.2325,24.3535 15.6165,24.5005 16.0005,24.5005 C16.3835,24.5005 16.7675,24.3535 17.0605,24.0605 L24.0605,17.0605 L21.9395,14.9395 Z"}),e.createElement("path",{d:"M27.5986,4 L22.8966,4 C26.5556,6.303 28.9996,10.366 28.9996,15 C28.9996,20.4 25.6896,25.039 20.9926,27 L26.5586,27 C29.8886,24.068 31.9996,19.785 31.9996,15 C31.9996,10.734 30.3196,6.868 27.5986,4"}),e.createElement("path",{d:"M3,15 C3,10.366 5.444,6.303 9.104,4 L4.401,4 C1.68,6.868 0,10.734 0,15 C0,19.785 2.112,24.068 5.441,27 L11.008,27 C6.311,25.039 3,20.4 3,15"}))},oe=()=>e.createElement(i,{sx:{mt:[7,7,7,8],mb:[7,7,7,8],pb:[2,1,0,0]}},e.createElement(U,{sx:{mb:[0,0,4,5]}},e.createElement(P,{start:[1,2],width:[3,3]},e.createElement(i,null,e.createElement(i,{sx:{fontSize:[2,2,2,3],fontFamily:"heading",letterSpacing:"mono",mb:[2]}},"EMAIL"),e.createElement(c,{href:"mailto:hello@carbonplan.org",sx:{textDecoration:"none",fontSize:[2,2,2,3]}},"hello@carbonplan.org"))),e.createElement(P,{start:[5],width:[1],dl:1,dr:1,sx:{display:["flex","none","none","none"],justifyContent:["center"]}},e.createElement(ne,{sx:{mt:["-4px"],width:"60px",height:"60px"}})),e.createElement(P,{start:[1,5,5,5],width:[3,3],sx:{mt:[3,0,0,0]}},e.createElement(i,null,e.createElement(i,{sx:{fontSize:[2,2,2,3],fontFamily:"heading",letterSpacing:"mono",mb:[2]}},"FOLLOW"),e.createElement(c,{href:"https://twitter.com/carbonplanorg",sx:{textDecoration:"none",fontSize:[2,2,2,3]}},"@carbonplanorg"))),e.createElement(P,{start:[1,9],width:[5,4,3,3],sx:{mt:["42px","42px",0,0],mb:[3,3,0,0]}},e.createElement(i,null,e.createElement(i,{sx:{fontSize:[2,2,2,3],fontFamily:"body",color:"secondary"}},"CarbonPlan is a registered non-profit public benefit corporation in California with 501(c)(3) status.")))),e.createElement(U,{sx:{mb:["2px"],mt:[5,5,4]}},e.createElement(P,{start:[1,1,2,2],width:[3,2,3,3],sx:{display:"flex",alignItems:["flex-start","flex-start","flex-end"]}},e.createElement(i,{sx:{bottom:"0px",borderStyle:"solid",borderColor:"muted",borderWidth:"0px",borderTopWidth:"1px",pt:[2]}},e.createElement(i,{sx:{color:"secondary",fontSize:[1,1,1,2],fontFamily:"mono",letterSpacing:"mono"}},"(c) 2021 CARBONPLAN"))),e.createElement(P,{start:[4,3,5,5],width:[2,2,3,3],sx:{display:"flex",alignItems:["flex-start","flex-start","flex-end"],mt:[0,0,0,0]}},e.createElement(i,{sx:{bottom:"0px",borderStyle:"solid",borderColor:"muted",borderWidth:"0px",borderTopWidth:"1px",width:["100%","auto","auto","auto"],pt:[2]}},e.createElement(b,{href:"/terms",passHref:!0},e.createElement(i,{as:"a",sx:{textDecoration:"none",fontSize:[1,1,1,2],color:"secondary",fontFamily:"mono",letterSpacing:"mono",display:"block"}},"READ OUR TERMS")))),e.createElement(P,{start:[5,7,9,9],width:[2,3,3,3],sx:{display:["none","initial","initial","initial"]}},e.createElement(ne,{sx:{width:80,height:80,mt:[0,"-10px",4,5],mb:["-12px"]}})))),ae=["sx"],le=t=>{let{sx:r}=t,n=M(t,ae);const[o,a]=x(),i=l(()=>{a("light"===o?"dark":"light")},[o]);return e.createElement(p,z({"aria-label":"Toggle dark mode",onClick:i,role:"checkbox",sx:z({width:32,height:32,display:"inline-block",cursor:"pointer",color:"secondary"},r)},n),e.createElement(v,{sx:{strokeWidth:"1.75",transition:"stroke 0.15s","@media (hover: hover) and (pointer: fine)":{"&:hover":{stroke:"primary"}}}}))},ie=()=>{const t=process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA,r=process.env.NEXT_PUBLIC_VERCEL_GIT_REPO_OWNER,n=process.env.NEXT_PUBLIC_VERCEL_GIT_REPO_SLUG,{theme:o}=h(),a=o.rawColors.secondary;if(t&&r&&n){const o=t.substring(0,7),l="https://github.com/"+r+"/"+n+"/tree/"+t;return e.createElement(i,{sx:{display:"inline-block",width:"87px"}},e.createElement(ce,{color:a}),e.createElement(c,{href:l,sx:{whiteSpace:"nowrap",display:"inline-block",ml:[2],fontFamily:"mono",letterSpacing:"body",color:a,fontSize:[1],textTransform:"uppercase",textDecoration:"none"}},o))}return e.createElement(i,{sx:{display:"inline-block",width:"87px"}},e.createElement(ce,{color:a}),e.createElement(u,{sx:{whiteSpace:"nowrap",display:"inline-block",ml:[2],fontFamily:"mono",letterSpacing:"body",color:a,fontSize:[1],textTransform:"uppercase"}},a))},ce=({color:t})=>e.createElement("svg",{fill:t,opacity:"0.8",viewBox:"0 0 24 24",width:"24",height:"24"},e.createElement("circle",{r:5,cx:19,cy:19})),se=({mode:t})=>{const[r,n]=o(function(e){return"mouse"===e?`X,Y: ${pe(0,4)},${pe(0,4)}`:"scroll"===e?`SCROLL: 0.${pe((0).toFixed(0),2)}`:e}(t));return a(()=>{if("mouse"===t){const e=e=>{const t=pe(e.clientX,4),r=pe(e.clientY,4);n(`X,Y: ${t},${r}`)};return window.addEventListener("mousemove",e),()=>{window.removeEventListener("mousemove",e)}}if("scroll"===t){const e=e=>{const t=function(e,t){return Math.min(e.scrollY/(document.body.offsetHeight-770),.99)}(window);n(`SCROLL: 0.${pe((100*t).toFixed(0),2)}`)};return window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}}},[]),e.createElement(u,{sx:{whiteSpace:"nowrap",display:"inline-block",mr:"-6px",fontFamily:"mono",letterSpacing:"body",color:"secondary",fontSize:[1],textTransform:"uppercase"}},r)},me=({mode:t})=>e.createElement(i,{sx:{userSelect:"none",position:"fixed",bottom:"42px",right:"24px",transformOrigin:"right",transform:"rotate(90deg)",display:["none","none","initial"]}},e.createElement(se,{mode:t}),e.createElement(ie,null));function pe(e,t){return e.toString().padStart(t,"0")}const de=["duration","delay","children"],xe=S({from:{opacity:0},to:{opacity:1}}),he=t=>{let{duration:r=300,delay:n=0,children:o}=t,a=M(t,de);return e.createElement(i,z({},a,{sx:{animationDuration:r+"ms",animationDelay:n+"ms",animationName:xe.toString(),animationFillMode:"backwards"}}),o)},ue=e=>{const t=e.createElement("div");t.style.visibility="hidden",t.style.width="100px",e.body.appendChild(t),t.style.overflow="scroll";const r=e.createElement("div");r.style.width="100%",t.appendChild(r);const n=t.offsetWidth-r.offsetWidth;return t.parentNode.removeChild(t),n},fe=()=>(a(()=>{"undefined"!=typeof document&&ue(document)>0&&(document.body.classList.add("custom-scrollbar"),document.getElementsByTagName("html")[0].classList.add("custom-scrollbar"))},[]),null),ge=({color:t="muted"})=>{const[r,n]=o(!1);return a(()=>{function e(e){const{key:t,metaKey:r}=e;";"===t&&r&&n(e=>!e)}return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[]),e.createElement(i,{sx:{position:"fixed",width:"100%",left:0,top:0,zIndex:"teal"===t?5e3:-1,pointerEvents:"none",display:r?"initial":"none"}},e.createElement(d,null,e.createElement(i,{sx:{display:["none","none","initial","initial"]}},e.createElement(Ee,{indices:[1,2,3,4,5,6,7,8,9,10,11,12],color:t})),e.createElement(i,{sx:{display:["none","initial","none","none"]}},e.createElement(Ee,{indices:[1,2,3,4,5,6,7,8],color:t})),e.createElement(i,{sx:{display:["initial","none","none","none"]}},e.createElement(Ee,{indices:[1,2,3,4,5,6],color:t}))))},ye=["red","orange","yellow","green","teal","blue","purple","pink"];function Ee({indices:t,color:r}){const n={outerGuideColumn:{borderStyle:"solid",borderWidth:"0px",borderLeftWidth:"teal"===r?"0px":"1px",borderRightWidth:"teal"===r?"0px":"1px",opacity:"teal"==r?.4:1},innerGuideColumn:{borderStyle:"solid",borderWidth:"0px",borderLeftWidth:"0px",borderRightWidth:"0px",opacity:"teal"==r?.4:1}};return e.createElement(U,null,t.map(t=>e.createElement(P,{key:t,start:[t],width:[1,1],dl:.5,dr:.5,sx:z({bg:"teal"===r?"teal":"transparent",height:"100vh"},n.innerGuideColumn)},e.createElement(i,{sx:z({mx:["12px",3,3,4],bg:"teal"===r?"background":"transparent",height:"100%",borderLeftColor:"rainbow"===r?ye[t%8]:"muted",borderRightColor:"rainbow"===r?ye[t%8]:"muted"},n.outerGuideColumn)}))))}const be=["value","sx"],we=t=>{let{value:r,sx:n}=t,o=M(t,be);return e.createElement(p,z({sx:z({cursor:"pointer",fill:"none",strokeWidth:"2px",stroke:"text",".paren":{opacity:"0"},"@media (hover: hover) and (pointer: fine)":{"&:hover .paren":{opacity:"1"}}},n),"aria-label":"Toggle Menu"},o),!r&&e.createElement("svg",{style:{width:"50px",height:"30px",transform:"scale(2)",marginTop:"-3px"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 68 36"},e.createElement("line",{x1:"24",y1:"2.1",x2:"24",y2:"6.1"}),e.createElement("line",{x1:"24",y1:"24.1",x2:"24",y2:"33.9"}),e.createElement("line",{x1:"44",y1:"2.1",x2:"44",y2:"12.1"}),e.createElement("line",{x1:"44",y1:"30.1",x2:"44",y2:"33.9"}),e.createElement("circle",{cx:"24",cy:"15.1",r:"5"}),e.createElement("circle",{cx:"44",cy:"21.1",r:"5"}),e.createElement("path",{style:{transition:"all 0.2s"},className:"paren",d:"M6.4,1.2c-6.3,10.3-6.3,23.3,0,33.6"}),e.createElement("path",{style:{transition:"all 0.2s"},className:"paren",d:"M61.6,34.8c6.3-10.3,6.3-23.3,0-33.6"})),r&&e.createElement("svg",{style:{width:"50px",height:"30px",transform:"scale(2)",marginTop:"-3px"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 68 36"},e.createElement("line",{x1:"50.85",y1:"29.79",x2:"17.15",y2:"6.21"}),e.createElement("line",{x1:"17.15",y1:"29.79",x2:"50.85",y2:"6.21"}),e.createElement("path",{style:{transition:"all 0.2s"},className:"paren",d:"M6.4,1.2c-6.3,10.3-6.3,23.3,0,33.6"}),e.createElement("path",{style:{transition:"all 0.2s"},className:"paren",d:"M61.6,34.8c6.3-10.3,6.3-23.3,0-33.6"})))},ve=({title:t,description:r,card:n,children:o,status:l,nav:c,settings:m,footer:p=!0,header:x=!0,metadata:u="mouse",links:f="remote",dimmer:g="bottom",guide:y=!0,scrollbar:E=!0,fade:b=!0,container:w=!0})=>{let v=o;b&&(v=e.createElement(he,{duration:250},v)),w&&(v=e.createElement(i,{sx:{mb:[8,8,9,10]}},e.createElement(d,null,v)));const{theme:k}=h();a(()=>{if(!k)return;const e=window.matchMedia(`(min-width: ${k.breakpoints[1]})`);return e.onchange=e=>{e.matches&&null!=m&&m.value&&null!=m&&m.onClick&&(null==m||m.onClick())},()=>{e.onchange=null}},[null==k?void 0:k.breakpoints,null==m?void 0:m.value,null==m?void 0:m.onClick]);const C=[e.createElement(le,{key:"dimmer",sx:{color:"primary",mt:"-2px",display:["block","block","top"===g?"block":"none","top"===g?"block":"none"]}})];return m&&C.push(e.createElement(we,z({key:"settings",sx:{mr:["2px"],display:["inherit","inherit","none","none"]}},m))),e.createElement(e.Fragment,null,y&&e.createElement(ge,{color:y}),E&&e.createElement(fe,null),e.createElement(G,{card:n,description:r,title:t}),e.createElement(s,{sx:{flexDirection:"column",minHeight:"100vh"}},x&&e.createElement(i,{as:"header",sx:{width:"100%",borderStyle:"solid",borderColor:"muted",borderWidth:"0px",borderBottomWidth:"1px",position:"sticky",top:0,bg:"background",height:"56px",zIndex:2e3}},e.createElement(d,null,e.createElement(re,{mode:f,status:l,nav:c,menuItems:C}))),e.createElement(i,{sx:{width:"100%",flex:"1 1 auto"}},v),p&&e.createElement(i,{as:"footer",sx:{width:"100%",borderStyle:"solid",borderColor:"muted",borderWidth:"0px",borderTopWidth:"1px"}},e.createElement(d,null,e.createElement(oe,null))),"bottom"===g&&e.createElement(i,{sx:{display:["none","none","initial","initial"],position:["fixed"],right:[13],bottom:[17,17,15,15]}},e.createElement(le,null)),u&&e.createElement(me,{mode:u})))},ke=()=>e.createElement(ve,{footer:!1,title:"404 / carbonplan"},e.createElement(U,{sx:{mb:[5,0,0],pt:[0,0,6]}},e.createElement(P,{start:[1,1,3,3],width:[6,4,4,4]},e.createElement(f.h1,null,"Oops!"),e.createElement(i,{sx:{fontSize:[4,4,4,5],lineHeight:"h3",mt:[3,4,4],mb:[2,3,3],maxWidth:["90%","90%","400px"]}},"Sorry but we can't seem to find the page you are looking for."),e.createElement(i,{sx:{color:"secondary",fontFamily:"mono",letterSpacing:"mono",fontSize:[2,2,2,3],mt:[4,5,5]}},"ERROR CODE 404")),e.createElement(P,{start:[2,5,7,7],width:[4,4,4,4]},e.createElement(i,{sx:{width:["100%"],mt:[2,4,4,5],fill:"primary"}},e.createElement(k,{sx:{width:"100%",height:"auto"}}))))),Ce=({value:t,id:r,onClick:n,sx:o})=>e.createElement(p,{onClick:n,id:r,role:"checkbox","aria-checked":t,"aria-label":"Expand",sx:z({display:"inline-block",width:24,height:24,p:[1],cursor:"pointer",fill:"secondary",stroke:"secondary","@media (hover: hover) and (pointer: fine)":{"&:hover":{fill:"primary",stroke:"primary"}}},o)},e.createElement("svg",{viewBox:"0 0 16 16"},e.createElement("path",{d:"M8,0 V16 M0,8 H16",style:{strokeWidth:2,transition:"0.25s all",transformOrigin:"8px 8px",transform:t?"rotate(45deg)":""}}))),Se=["label","value","sx","children"],ze=t=>{let{label:r,value:n,sx:o,children:a}=t,l=M(t,Se);const c=o&&o.color?o.color:"primary",s=l&&(l.onClick||l.onDoubleClick);return e.createElement(i,z({as:s?"button":"span",role:"checkbox","aria-checked":n,"aria-label":r,sx:z({display:"inline-block",fontSize:[1,1,1,2],fontFamily:"mono",letterSpacing:"mono",cursor:s?"pointer":"inherit",color:c,backgroundColor:"transparent",borderStyle:"solid",borderColor:c,lineHeight:"body",borderWidth:"0px",borderBottomWidth:"1px",textTransform:"uppercase",userSelect:"none",transition:"opacity 0.05s",pt:["1px"],pb:["2px"],px:[0],m:[0],opacity:null==n||n?1:"primary"==c?.24:.33},o)},l),a)},Me=["values","setValues","label","colors","showAll","multiSelect"],Ae={label:{fontFamily:"mono",letterSpacing:"mono",fontSize:[1,1,1,2],color:"secondary",userSelect:"none",textTransform:"uppercase"}},Le=(e,t,r={})=>Object.keys(e).reduce((e,n)=>Object.assign(e,{[n]:r[n]||t}),{}),We=e=>Object.keys(e).filter(t=>e[t]).length==Object.keys(e).length,Te=({values:e,multiSelect:t,setValues:r,value:n})=>{const o=We(e),a="all"===n;let l;t?l=a&&!o?Le(e,!0):a&&o?Le(e,!1):z({},e,{[n]:!e[n]}):a&&!o?l=Le(e,!0):a&&o||(l=Le(e,!1,{[n]:!0})),l&&r(l)},Fe=t=>{let{values:r,setValues:n,label:o,colors:a,showAll:l=!1,multiSelect:c=!1}=t,s=M(t,Me);return e.createElement(i,s,o&&e.createElement(i,{sx:Ae.label},o),e.createElement(i,{sx:{mt:o?[3]:0}},l&&e.createElement(ze,{onClick:()=>Te({values:r,multiSelect:c,setValues:n,value:"all"}),value:We(r),sx:{mr:[2]}},"All"),Object.keys(r).map((t,o)=>e.createElement(ze,{onClick:()=>Te({values:r,multiSelect:c,setValues:n,value:t}),onDoubleClick:()=>Te({values:r,multiSelect:!1,setValues:n,value:t}),key:o,value:r[t],sx:{width:"max-content",color:a?a[t]:"primary",mr:[2],mb:[1]}},t))))},Be={xs:[1],sm:[3],md:[5],lg:[7],xl:[9]},Ie=({children:t,direction:r="vertical",spacing:n="md"})=>{let o;if("string"==typeof n?o=Be[n]:"number"==typeof n?o=[n]:Array.isArray(n)&&n.every(e=>"number"==typeof e)&&(o=n),!o)throw new Error("Invalid spacing size. Must be numeric value(s) or one of xs, sm, md, lg, or xl");if(!["horizontal","vertical"].includes(r))throw new Error("Invalid direction value. Must be either horizontal or vertical");const a="vertical"===r?"mt":"ml",l="horizontal"===r?{display:"inline-block"}:{};return e.createElement(i,null,e.Children.map(t,(t,r)=>e.createElement(i,{sx:z({[a]:r>0?o:0},l)},t)))},De=({children:t,variant:r="h1"})=>{let n;return"h1"===r&&(n=[4,"27px","42px","54px"]),"h2"===r&&(n=[4,4,"14px","54px"]),e.createElement(e.Fragment,null,e.createElement(P,{start:[1,4,8,8],width:[1,1,1,1]},e.createElement(i,{sx:{mt:n,fontFamily:"faux",letterSpacing:"faux",fontSize:[2,2,2,3],textAlign:"right"}},"/")),e.createElement(P,{start:[2,5,9,9],width:[3,3,2,2]},e.createElement(i,{sx:{mt:n,fontFamily:"faux",letterSpacing:"faux",fontSize:[2,2,2,3],height:["100%","0px","0px","0px"]}},t)))},Oe=({children:t,sidenote:r,description:n,descriptionStart:o=[1,3,5,5],descriptionWidth:a=[5,5,5,4],sx:l})=>{const c=o.map(e=>e-1);return c[0]=6,e.createElement(U,{sx:{mt:[5,6,7,8],mb:[5,6,7,8]}},e.createElement(P,{start:[1,1,2,2],width:c},e.createElement(i,{as:"h1",variant:"styles.h1",sx:z({my:[0,0,0,0]},l)},t)),r&&e.createElement(De,null,r),n&&e.createElement(P,{start:o,width:a},e.createElement(i,{sx:{mt:[4,"5px","20px","31px"],fontSize:[2,2,2,3]}},n)))},$e=["size","inverted","sx"];var Re=t((t,r)=>{let{size:n="sm",inverted:o,sx:a}=t,l=M(t,$e);const i=z({color:o?"secondary":"primary",borderColor:"secondary",borderStyle:"solid",borderWidth:"0px",borderBottomWidth:"1px",borderRadius:"0px",transition:"border 0.15s",borderBottomWidth:"1px",width:"calc(min(15ch, 100%))",p:[0],py:["2px"],"input::-webkit-outer-spin-button":{WebkitAppearance:"none",margin:0},"input::-webkit-inner-spin-button":{WebkitAppearance:"none",margin:0},":focus":{borderColor:"primary"},":focus-visible":{outline:"none !important",background:"none !important"}},F(n),a);return e.createElement(g,z({},l,{ref:r,sx:i}))});const He=["children","size","sx","sxSelect"],_e=t=>{let{children:r,size:o="sm",sx:a,sxSelect:l}=t,c=M(t,He);const s=a&&a.color?a.color:"primary",m=F(o),p=n(null),{onChange:d}=c,x=(h=e=>"onChange"!==e,e=>{const t={};for(const r in e)h(r||"")&&(t[r]=e[r]);return t})(c);var h;if(!["xs","sm","md"].includes(o))throw new Error("Size must be xs, sm, or md");let u,f,g,y,E;return"xs"===o&&(f=[14,14,14,16],g=[14,14,14,14],E=["1px"],y=["-14px","-14px","-14px","-16px"]),"sm"===o&&(f=[15,15,15,20],g=[15,15,15,20],E=["1px"],y=["-16px","-16px","-16px","-20px"]),"md"===o&&(f=[20,20,20,20],g=[20,20,20,20],E=["2px"],y=["-20px","-20px","-20px","-20px"]),u=g.map(e=>e+12),e.createElement(i,{sx:z({display:"inline-block"},a)},e.createElement(i,z({as:"select",ref:p,onChange:e=>{p.current.blur(),d&&d(e)},sx:z({},m,{lineHeight:"normal",cursor:"pointer",WebkitAppearance:"none",MozAppearance:"none",pb:["5px"],bg:"transparent",pr:u,border:"none",borderBottomStyle:"solid",borderBottomWidth:"1px",borderBottomColor:"primary",borderRadius:"0px",color:"text",width:"fit-content",color:s,userSelect:"none","@media (hover: none) and (pointer: coarse)":{"&:focus-visible":{outline:"none !important",background:"transparent !important"}}},l)},x),r),e.createElement(w,{sx:{width:g,height:f,position:"relative",ml:y,top:E,fill:"secondary",transform:"rotate(135deg)",pointerEvents:"none"}}))},je=["sx"];var Ve=t((t,r)=>{let{sx:n}=t,o=M(t,je);const a=n&&n.color?n.color:"primary",{theme:{rawColors:l}}=h();return e.createElement(y,z({ref:r,sx:z({"&::-webkit-slider-thumb":{height:[22,18,16],width:[22,18,16],boxShadow:`0 0 0 0px ${l.secondary}`,transition:"box-shadow .15s ease"},"&::-moz-range-thumb":{height:[22,18,16],width:[22,18,16],boxShadow:`0 0 0 0px ${l.secondary}`,transition:"box-shadow .15s ease"},":focus-visible":{outline:"none !important",background:`${l.secondary} !important`},":focus":{color:a,"&::-webkit-slider-thumb":{boxShadow:`0 0 0 4px ${l.secondary}`},"&::-moz-range-thumb":{boxShadow:`0 0 0 4px ${l.secondary}`}},color:a},n)},o))});const Ne={reset:{verticalAlign:"baseline",border:0,outline:0,margin:0,padding:0},row:{borderStyle:"solid",borderWidth:"0px",borderTopWidth:"1px",borderColor:"muted",pt:[3,3,3,"20px"],pb:[3,3,3,"20px"],mb:["2px"]},header:{display:"block",textTransform:"uppercase",letterSpacing:"smallcaps",fontFamily:"heading",fontSize:[2,2,2,3]},index:{display:"block",textTransform:"uppercase",letterSpacing:"smallcaps",fontFamily:"heading",fontSize:[2,2,2,3]},entry:{display:"block",fontSize:[2,2,2,3],fontFamily:"faux",letterSpacing:"faux",mb:["1px"],mt:[2,0,0,0]}},Pe=({data:t,sx:r,color:n,header:o,columns:a,start:l,width:c,index:s=!0,borderBottom:m=!0,borderTop:p=!0})=>{if(!l||!a||!c)throw new Error("Must provide columns, start, and width");return e.createElement(i,{as:"table",sx:z({display:"block"},r)},e.createElement(i,{as:"tbody",sx:{display:"block"}},o&&e.createElement(U,{as:"tr",sx:z({},Ne.reset,Ne.header,Ne.row,{color:n,borderTopWidth:p?"1px":"0px"})},e.createElement(P,{as:"td",start:[1],width:a,sx:Ne.index},o)),t.map((r,n)=>e.createElement(U,{as:"tr",columns:a,key:n,sx:z({},Ne.reset,Ne.row,{pb:m&&n===t.length-1?["18px","18px","18px","22px"]:[3,3,3,"20px"],borderBottomWidth:m&&n===t.length-1?"1px":"0px",borderTopWidth:p||0!==n||o?"1px":"0px"})},r.map((t,r)=>e.createElement(P,{as:"td",key:r,start:l[r],width:c[r],sx:z({},Ne.reset,0==r&&s?Ne.index:Ne.entry)},t))))))},Ge=["value","onClick","disabled","sx"];var Ye=t((t,r)=>{let{value:n,onClick:o,disabled:a,sx:l}=t,c=M(t,Ge);const s=l&&l.color?l.color:"primary";return n=!a&&n,e.createElement(i,z({ref:r,as:"button",onClick:o,role:"checkbox","aria-checked":n,"aria-label":"Toggle",sx:z({border:"none",background:"none",cursor:a?"default":"pointer",p:[0],m:[0],display:"inline-block"},l)},c),e.createElement(i,{sx:{width:"50px",height:"20px",borderRadius:"20px",backgroundColor:n?E(s,"primary"==s?.5:.45):"muted",position:"relative",transition:"0.15s",display:"inline-block"}},e.createElement(i,{sx:{width:"14px",height:"14px",borderRadius:"7px",position:"absolute",left:n?"32px":"4px",top:"3px",backgroundColor:n?s:"secondary",transition:"0.15s"}})))});const Xe=({id:t})=>t?e.createElement(e.Fragment,null,e.createElement("script",{async:!0,src:`https://www.googletagmanager.com/gtag/js?id=${t}`}),e.createElement("script",{dangerouslySetInnerHTML:{__html:`\n window.dataLayer = window.dataLayer || [];\n function gtag(){dataLayer.push(arguments);}\n gtag('js', new Date());\n gtag('config', '${t}', {\n page_path: window.location.pathname,\n });\n `}})):null,Ue=({expanded:t,sx:r,children:n})=>e.createElement(e.Fragment,null,e.createElement(i,{sx:{position:"fixed",top:"56px",bottom:"0px",left:"0px",width:"calc(100vw)",mt:["56px"],bg:"background",zIndex:1e3,transition:"opacity 0.15s",opacity:t?.9:0,pointerEvents:t?"all":"none"}}),e.createElement(i,{sx:z({position:"fixed",width:"calc(100vw)",top:"0px",mt:["56px"],pb:[6,7,7,8],pt:[5,6,7,8],bg:"background",zIndex:1100,borderStyle:"solid",borderColor:"muted",borderWidth:"0px",borderBottomWidth:"1px",transition:"transform 0.15s",ml:[-3,-4,-5,-6],pl:[3,4,5,6],pr:[3,4,5,6],transform:t?"translateY(0)":"translateY(-100%)"},r)},e.createElement(U,null,e.createElement(P,{start:[1,1,1,1],width:[6,8,10,10]},n)))),Ke={month:"short",day:"numeric",year:"numeric"},Ze=(e,t,r)=>{if(!r)return null;const n="string"==typeof r?r:Ke[t],o=e.toLocaleString("default",{[t]:n});return"numeric"===n&&["day","month"].includes(t)?o.padStart(2,"0"):o},qe=(e,t=Ke)=>{var r;const n=new Date(e.replace(/-/g,"/"));return[Ze(n,"month",t.month),Ze(n,"day",t.day),Ze(n,"year",t.year)].filter(Boolean).join(null!=(r=t.separator)?r:" ")};export{L as Badge,I as Button,O as Callout,V as Colorbar,P as Column,ke as Custom404,le as Dimmer,Ce as Expander,he as FadeIn,Fe as Filter,oe as Footer,Ie as Group,ge as Guide,re as Header,Oe as Heading,Re as Input,ve as Layout,T as Link,Y as Logo,Z as Menu,G as Meta,ne as Monogram,U as Row,fe as Scrollbar,_e as Select,we as Settings,De as Sidenote,Ve as Slider,Pe as Table,ze as Tag,Ye as Toggle,Xe as Tracking,Ue as Tray,qe as formatDate,ue as getScrollbarWidth};
2875
2
  //# sourceMappingURL=index.modern.js.map