@psnext/design-system 1.0.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.
- package/README.md +126 -0
- package/dist/AiChatPanel.cjs +1603 -0
- package/dist/AiChatPanel.cjs.map +1 -0
- package/dist/AiChatPanel.js +1526 -0
- package/dist/AiChatPanel.js.map +1 -0
- package/dist/BodhiLogo.cjs +240 -0
- package/dist/BodhiLogo.cjs.map +1 -0
- package/dist/BodhiLogo.js +194 -0
- package/dist/BodhiLogo.js.map +1 -0
- package/dist/Skeleton.cjs +19 -0
- package/dist/Skeleton.cjs.map +1 -0
- package/dist/Skeleton.js +14 -0
- package/dist/Skeleton.js.map +1 -0
- package/dist/SustainLogo.cjs +415 -0
- package/dist/SustainLogo.cjs.map +1 -0
- package/dist/SustainLogo.js +378 -0
- package/dist/SustainLogo.js.map +1 -0
- package/dist/contexts/index.cjs +60 -0
- package/dist/contexts/index.cjs.map +1 -0
- package/dist/contexts/index.d.cts +23 -0
- package/dist/contexts/index.d.cts.map +1 -0
- package/dist/contexts/index.d.ts +23 -0
- package/dist/contexts/index.d.ts.map +1 -0
- package/dist/contexts/index.js +58 -0
- package/dist/contexts/index.js.map +1 -0
- package/dist/index.cjs +273 -0
- package/dist/index.d.cts +1440 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.ts +1440 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -0
- package/dist/index2.d.cts +16 -0
- package/dist/index2.d.cts.map +1 -0
- package/dist/index2.d.ts +16 -0
- package/dist/index2.d.ts.map +1 -0
- package/dist/layouts/index.cjs +13 -0
- package/dist/layouts/index.d.cts +133 -0
- package/dist/layouts/index.d.cts.map +1 -0
- package/dist/layouts/index.d.ts +133 -0
- package/dist/layouts/index.d.ts.map +1 -0
- package/dist/layouts/index.js +2 -0
- package/dist/layouts.cjs +3245 -0
- package/dist/layouts.cjs.map +1 -0
- package/dist/layouts.js +3180 -0
- package/dist/layouts.js.map +1 -0
- package/dist/patterns/index.cjs +7375 -0
- package/dist/patterns/index.cjs.map +1 -0
- package/dist/patterns/index.d.cts +418 -0
- package/dist/patterns/index.d.cts.map +1 -0
- package/dist/patterns/index.d.ts +418 -0
- package/dist/patterns/index.d.ts.map +1 -0
- package/dist/patterns/index.js +7344 -0
- package/dist/patterns/index.js.map +1 -0
- package/dist/primitives/index.cjs +256 -0
- package/dist/primitives/index.d.cts +2 -0
- package/dist/primitives/index.d.ts +2 -0
- package/dist/primitives/index.js +5 -0
- package/dist/primitives.cjs +4292 -0
- package/dist/primitives.cjs.map +1 -0
- package/dist/primitives.js +2807 -0
- package/dist/primitives.js.map +1 -0
- package/dist/styles/base/colors.css +300 -0
- package/dist/styles/base/component-tokens.css +240 -0
- package/dist/styles/base/elevation.css +7 -0
- package/dist/styles/base/fonts.css +14 -0
- package/dist/styles/base/global.css +305 -0
- package/dist/styles/base/radius.css +22 -0
- package/dist/styles/base/semantic-aliases.css +53 -0
- package/dist/styles/base/spacing.css +33 -0
- package/dist/styles/base/typography.css +48 -0
- package/dist/styles/generated/bodhi-vars.css +34 -0
- package/dist/styles/generated/dark.css +87 -0
- package/dist/styles/generated/light.css +87 -0
- package/dist/styles/generated/slingshot-vars.css +34 -0
- package/dist/styles/generated/sustain-vars.css +34 -0
- package/dist/styles/index.css +32 -0
- package/dist/styles/theme.css +65 -0
- package/dist/styles/themes/bodhi.css +166 -0
- package/dist/styles/themes/slingshot.css +144 -0
- package/dist/styles/themes/sustain.css +130 -0
- package/package.json +131 -0
|
@@ -0,0 +1,378 @@
|
|
|
1
|
+
import { r as cn } from "./BodhiLogo.js";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
5
|
+
//#region src/primitives/Tooltip/Tooltip.tsx
|
|
6
|
+
/**
|
|
7
|
+
* Strip all Figma Make internal props (_fg*) so they never reach a DOM element.
|
|
8
|
+
* We explicitly destructure the known ones AND filter any others dynamically.
|
|
9
|
+
*/
|
|
10
|
+
function cleanProps(raw) {
|
|
11
|
+
const result = {};
|
|
12
|
+
for (const key of Object.keys(raw)) if (!key.startsWith("_fg")) result[key] = raw[key];
|
|
13
|
+
return result;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Recursively strip _fg* props from React children.
|
|
17
|
+
* Needed because <TooltipTrigger asChild> clones children via Radix's Slot,
|
|
18
|
+
* and Figma injects _fg* props directly onto those child elements too.
|
|
19
|
+
*
|
|
20
|
+
* IMPORTANT: Radix's Slot uses React.Children.only() which requires a single
|
|
21
|
+
* child element — NOT an array. So we must NOT use React.Children.map() which
|
|
22
|
+
* always returns an array. Instead we handle single vs multiple children explicitly.
|
|
23
|
+
*/
|
|
24
|
+
function stripFigmaFromChild(child) {
|
|
25
|
+
if (!React.isValidElement(child)) return child;
|
|
26
|
+
const childProps = child.props;
|
|
27
|
+
if (!Object.keys(childProps).some((k) => k.startsWith("_fg"))) return child;
|
|
28
|
+
const cleaned = cleanProps(childProps);
|
|
29
|
+
if (cleaned.children) cleaned.children = stripFigmaFromChild(cleaned.children);
|
|
30
|
+
return React.cloneElement(child, cleaned);
|
|
31
|
+
}
|
|
32
|
+
function TooltipProvider({ delayDuration = 0, _fgT, _fgS, _fgB, children, ...rest }) {
|
|
33
|
+
return /* @__PURE__ */ jsx(TooltipPrimitive.Provider, {
|
|
34
|
+
"data-slot": "tooltip-provider",
|
|
35
|
+
delayDuration,
|
|
36
|
+
...cleanProps(rest),
|
|
37
|
+
children
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
function Tooltip({ _fgT, _fgS, _fgB, ...rest }) {
|
|
41
|
+
return /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsx(TooltipPrimitive.Root, {
|
|
42
|
+
"data-slot": "tooltip",
|
|
43
|
+
...cleanProps(rest)
|
|
44
|
+
}) });
|
|
45
|
+
}
|
|
46
|
+
function TooltipTrigger({ _fgT, _fgS, _fgB, children, ...rest }) {
|
|
47
|
+
return /* @__PURE__ */ jsx(TooltipPrimitive.Trigger, {
|
|
48
|
+
"data-slot": "tooltip-trigger",
|
|
49
|
+
...cleanProps(rest),
|
|
50
|
+
children: stripFigmaFromChild(children)
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
function TooltipContent({ className, sideOffset = 0, children, style: callerStyle, _fgT, _fgS, _fgB, ...rest }) {
|
|
54
|
+
const mergedStyle = {
|
|
55
|
+
backgroundColor: "var(--tooltip-bg)",
|
|
56
|
+
color: "var(--tooltip-foreground)",
|
|
57
|
+
borderRadius: "var(--radius)",
|
|
58
|
+
fontFamily: "var(--font-body)",
|
|
59
|
+
...callerStyle
|
|
60
|
+
};
|
|
61
|
+
return /* @__PURE__ */ jsx(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsxs(TooltipPrimitive.Content, {
|
|
62
|
+
"data-slot": "tooltip-content",
|
|
63
|
+
sideOffset,
|
|
64
|
+
className: cn("animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) px-3 py-1.5 text-xs text-balance", className),
|
|
65
|
+
style: mergedStyle,
|
|
66
|
+
...cleanProps(rest),
|
|
67
|
+
children: [children, /* @__PURE__ */ jsx(TooltipPrimitive.Arrow, {
|
|
68
|
+
className: "z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]",
|
|
69
|
+
style: {
|
|
70
|
+
fill: callerStyle?.backgroundColor || "var(--tooltip-bg)",
|
|
71
|
+
backgroundColor: callerStyle?.backgroundColor || "var(--tooltip-bg)"
|
|
72
|
+
}
|
|
73
|
+
})]
|
|
74
|
+
}) });
|
|
75
|
+
}
|
|
76
|
+
//#endregion
|
|
77
|
+
//#region src/primitives/SlingshotLogo/SlingshotLogo.tsx
|
|
78
|
+
function SlingshotLogo({ isDarkMode = false }) {
|
|
79
|
+
return /* @__PURE__ */ jsxs("svg", {
|
|
80
|
+
width: "133",
|
|
81
|
+
height: "36",
|
|
82
|
+
viewBox: "0 0 133 36",
|
|
83
|
+
fill: "none",
|
|
84
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
85
|
+
style: {
|
|
86
|
+
"--slingshot-primary-red": "var(--color-red-500)",
|
|
87
|
+
"--slingshot-accent-white": isDarkMode ? "#E5E7EB" : "white",
|
|
88
|
+
"--slingshot-text-dark": isDarkMode ? "#FFFFFF" : "#030712"
|
|
89
|
+
},
|
|
90
|
+
children: [
|
|
91
|
+
/* @__PURE__ */ jsx("path", {
|
|
92
|
+
d: "M18 0C8.07 0 0 8.07 0 18s8.07 18 18 18 18-8.07 18-18S27.92 0 18 0",
|
|
93
|
+
fill: "var(--slingshot-primary-red)"
|
|
94
|
+
}),
|
|
95
|
+
/* @__PURE__ */ jsx("path", {
|
|
96
|
+
"fill-rule": "evenodd",
|
|
97
|
+
"clip-rule": "evenodd",
|
|
98
|
+
d: "M31.43 23.58a1.27 1.27 0 1 1-2.33-.97 1.27 1.27 0 0 1 2.33.97",
|
|
99
|
+
fill: "var(--slingshot-accent-white)"
|
|
100
|
+
}),
|
|
101
|
+
/* @__PURE__ */ jsx("path", {
|
|
102
|
+
"fill-rule": "evenodd",
|
|
103
|
+
"clip-rule": "evenodd",
|
|
104
|
+
d: "M23.55 31.44a1.27 1.27 0 1 1-.96-2.35 1.27 1.27 0 0 1 .96 2.35",
|
|
105
|
+
fill: "var(--slingshot-accent-white)"
|
|
106
|
+
}),
|
|
107
|
+
/* @__PURE__ */ jsx("path", {
|
|
108
|
+
"fill-rule": "evenodd",
|
|
109
|
+
"clip-rule": "evenodd",
|
|
110
|
+
d: "M12.42 31.43a1.27 1.27 0 1 1 .98-2.34 1.27 1.27 0 0 1-.98 2.34",
|
|
111
|
+
fill: "var(--slingshot-accent-white)"
|
|
112
|
+
}),
|
|
113
|
+
/* @__PURE__ */ jsx("path", {
|
|
114
|
+
"fill-rule": "evenodd",
|
|
115
|
+
"clip-rule": "evenodd",
|
|
116
|
+
d: "M4.55 23.55",
|
|
117
|
+
fill: "var(--slingshot-accent-white)"
|
|
118
|
+
}),
|
|
119
|
+
/* @__PURE__ */ jsx("path", {
|
|
120
|
+
"fill-rule": "evenodd",
|
|
121
|
+
"clip-rule": "evenodd",
|
|
122
|
+
d: "M4.57 12.42a1.27 1.27 0 1 1 .69 1.66 1.27 1.27 0 0 1-.7-1.66",
|
|
123
|
+
fill: "var(--slingshot-accent-white)"
|
|
124
|
+
}),
|
|
125
|
+
/* @__PURE__ */ jsx("path", {
|
|
126
|
+
"fill-rule": "evenodd",
|
|
127
|
+
"clip-rule": "evenodd",
|
|
128
|
+
d: "M12.45 4.55a1.27 1.27 0 1 1-.7 1.66c-.26-.65.05-1.39.7-1.66",
|
|
129
|
+
fill: "var(--slingshot-accent-white)"
|
|
130
|
+
}),
|
|
131
|
+
/* @__PURE__ */ jsx("path", {
|
|
132
|
+
"fill-rule": "evenodd",
|
|
133
|
+
"clip-rule": "evenodd",
|
|
134
|
+
d: "M23.58 4.57",
|
|
135
|
+
fill: "var(--slingshot-accent-white)"
|
|
136
|
+
}),
|
|
137
|
+
/* @__PURE__ */ jsx("path", {
|
|
138
|
+
"fill-rule": "evenodd",
|
|
139
|
+
"clip-rule": "evenodd",
|
|
140
|
+
d: "M31.45 12.45a1.27 1.27 0 1 1-1.66-.7c.65-.26 1.39.05 1.66.7",
|
|
141
|
+
fill: "var(--slingshot-accent-white)"
|
|
142
|
+
}),
|
|
143
|
+
/* @__PURE__ */ jsx("path", {
|
|
144
|
+
"fill-rule": "evenodd",
|
|
145
|
+
"clip-rule": "evenodd",
|
|
146
|
+
d: "M19.33 20.43c-.99 1.36-1.7 3.56-.39 4.86.89.89.22 2.35-.97 2.35-1.2 0-1.86-1.46-.98-2.35 1.3-1.3.6-3.5-.38-4.86a9 9 0 0 0-1.04-1.1c-1.37-.99-3.56-1.69-4.86-.39-.89.89-2.36.22-2.36-.97 0-1.2 1.47-1.86 2.36-.98 1.3 1.3 3.5.6 4.86-.38.23-.17.94-.82 1.1-1.04.98-1.36 1.69-3.56.38-4.86-.88-.89-.22-2.36.98-2.36s1.86 1.47.97 2.36c-1.3 1.3-.6 3.5.39 4.86.17.23.82.94 1.04 1.1 1.36.99 3.55 1.69 4.86.38.89-.88 2.35-.21 2.35.98 0 1.2-1.46 1.86-2.35.98-1.3-1.3-3.5-.6-4.86.38-.24.17-.94.82-1.1 1.04",
|
|
147
|
+
fill: "var(--slingshot-accent-white)"
|
|
148
|
+
}),
|
|
149
|
+
/* @__PURE__ */ jsx("path", {
|
|
150
|
+
"fill-rule": "evenodd",
|
|
151
|
+
"clip-rule": "evenodd",
|
|
152
|
+
d: "M24.92 11.08a1.9 1.9 0 1 1-2.7 2.7 1.9 1.9 0 0 1 2.7-2.7",
|
|
153
|
+
fill: "var(--slingshot-accent-white)"
|
|
154
|
+
}),
|
|
155
|
+
/* @__PURE__ */ jsx("path", {
|
|
156
|
+
"fill-rule": "evenodd",
|
|
157
|
+
"clip-rule": "evenodd",
|
|
158
|
+
d: "M24.92 24.92a1.9 1.9 0 1 1-2.7-2.7 1.9 1.9 0 0 1 2.7 2.7",
|
|
159
|
+
fill: "var(--slingshot-accent-white)"
|
|
160
|
+
}),
|
|
161
|
+
/* @__PURE__ */ jsx("path", {
|
|
162
|
+
"fill-rule": "evenodd",
|
|
163
|
+
"clip-rule": "evenodd",
|
|
164
|
+
d: "M11.08 24.92a1.9 1.9 0 1 1 2.69-2.7 1.9 1.9 0 0 1-2.7 2.7",
|
|
165
|
+
fill: "var(--slingshot-accent-white)"
|
|
166
|
+
}),
|
|
167
|
+
/* @__PURE__ */ jsx("path", {
|
|
168
|
+
"fill-rule": "evenodd",
|
|
169
|
+
"clip-rule": "evenodd",
|
|
170
|
+
d: "M11.08 11.08a1.9 1.9 0 1 1 2.7 2.69 1.9 1.9 0 0 1-2.7-2.69",
|
|
171
|
+
fill: "var(--slingshot-accent-white)"
|
|
172
|
+
}),
|
|
173
|
+
/* @__PURE__ */ jsx("path", {
|
|
174
|
+
"fill-rule": "evenodd",
|
|
175
|
+
"clip-rule": "evenodd",
|
|
176
|
+
d: "M66.2 2.12a.5.5 0 0 0 .49-.5.5.5 0 0 0-.49-.5.5.5 0 0 0-.49.5c0 .28.22.5.5.5",
|
|
177
|
+
fill: "var(--slingshot-text-dark)"
|
|
178
|
+
}),
|
|
179
|
+
/* @__PURE__ */ jsx("path", {
|
|
180
|
+
"fill-rule": "evenodd",
|
|
181
|
+
"clip-rule": "evenodd",
|
|
182
|
+
d: "M65.81 9.68h.77V3.06h-.77z",
|
|
183
|
+
fill: "var(--slingshot-text-dark)"
|
|
184
|
+
}),
|
|
185
|
+
/* @__PURE__ */ jsx("path", {
|
|
186
|
+
"fill-rule": "evenodd",
|
|
187
|
+
"clip-rule": "evenodd",
|
|
188
|
+
d: "M50.65 6.35c0-1.38 1.06-2.51 2.37-2.51 1.3 0 2.37 1.13 2.37 2.51v.1c-.05 1.37-1.1 2.44-2.37 2.44-1.28 0-2.37-1.14-2.37-2.54m2.37 3.32c.92 0 1.77-.42 2.37-1.15v1.16h.76V3.06h-.76V4.2a3 3 0 0 0-2.37-1.14 3.2 3.2 0 0 0-3.13 3.3c0 1.8 1.4 3.31 3.13 3.31",
|
|
189
|
+
fill: "var(--slingshot-text-dark)"
|
|
190
|
+
}),
|
|
191
|
+
/* @__PURE__ */ jsx("path", {
|
|
192
|
+
"fill-rule": "evenodd",
|
|
193
|
+
"clip-rule": "evenodd",
|
|
194
|
+
d: "M61.28 8.9c-1.28 0-2.32-1.08-2.37-2.44v-.1c0-1.4 1.06-2.52 2.37-2.52 1.3 0 2.37 1.13 2.37 2.51 0 1.39-1.06 2.54-2.37 2.54m3.13-2.55c0-1.81-1.4-3.29-3.13-3.29-.92 0-1.78.41-2.37 1.14V3.06h-.76v9h.76V8.52c.6.74 1.45 1.15 2.37 1.15 1.73 0 3.13-1.49 3.13-3.32",
|
|
195
|
+
fill: "var(--slingshot-text-dark)"
|
|
196
|
+
}),
|
|
197
|
+
/* @__PURE__ */ jsx("path", {
|
|
198
|
+
"fill-rule": "evenodd",
|
|
199
|
+
"clip-rule": "evenodd",
|
|
200
|
+
d: "M78.66 3.06c-.72 0-1.4.3-1.9.83v-.83h-.74v6.62h.74V5.76a1.95 1.95 0 0 1 1.9-1.93c1.03 0 1.9.86 1.9 1.93v3.92h.74V5.76c0-1.49-1.18-2.7-2.64-2.7",
|
|
201
|
+
fill: "var(--slingshot-text-dark)"
|
|
202
|
+
}),
|
|
203
|
+
/* @__PURE__ */ jsx("path", {
|
|
204
|
+
"fill-rule": "evenodd",
|
|
205
|
+
"clip-rule": "evenodd",
|
|
206
|
+
d: "m85.24 8.92-.08.02q-.11.04-.37.05-.44.02-.43-.67v-4.5h.9v-.76h-.9V.84h-.78v2.22h-.9v.76h.9v4.52q0 .74.27 1.02.27.3.77.31.38 0 .62-.1l.04-.01z",
|
|
207
|
+
fill: "var(--slingshot-text-dark)"
|
|
208
|
+
}),
|
|
209
|
+
/* @__PURE__ */ jsx("path", {
|
|
210
|
+
"fill-rule": "evenodd",
|
|
211
|
+
"clip-rule": "evenodd",
|
|
212
|
+
d: "M71.35 3.83c1.12 0 2.07.82 2.3 1.97h-4.64a2.4 2.4 0 0 1 2.34-1.97m1.98 3.94a2.3 2.3 0 0 1-1.98 1.14 2.46 2.46 0 0 1-2.4-2.36h5.14c.21 0 .38-.15.38-.35v-.06c-.14-1.75-1.48-3.08-3.12-3.08a3.24 3.24 0 0 0-3.15 3.32c0 1.83 1.41 3.3 3.15 3.3 1.06 0 2.03-.56 2.6-1.5z",
|
|
213
|
+
fill: "var(--slingshot-text-dark)"
|
|
214
|
+
}),
|
|
215
|
+
/* @__PURE__ */ jsx("path", {
|
|
216
|
+
"fill-rule": "evenodd",
|
|
217
|
+
"clip-rule": "evenodd",
|
|
218
|
+
d: "M48.13 6.48s-.2-.16-.4-.25c-.22-.09-.53-.2-1.16-.36q-.13-.02-.25-.06-.64-.16-1-.43-.34-.28-.31-.61.01-.39.4-.67.46-.34 1.18-.3c.54.02.95.3 1.39.62l.04.03.55-.53-.26-.2c-.44-.3-.97-.62-1.69-.65q-.94-.04-1.6.38c-.47.32-.77.79-.77 1.28 0 .37.07.72.43 1.08.43.42 1.1.65 1.72.77.53.1 1.02.3 1.27.51.3.28.4.48.4.76q-.04.43-.5.73c-.3.23-.72.35-1.17.33a3 3 0 0 1-1.81-.78l-.05-.04-.54.51.05.05q1.09.95 2.32 1.02A2.6 2.6 0 0 0 48 9.21q.76-.54.8-1.32a1.7 1.7 0 0 0-.68-1.41",
|
|
219
|
+
fill: "var(--slingshot-text-dark)"
|
|
220
|
+
}),
|
|
221
|
+
/* @__PURE__ */ jsx("path", {
|
|
222
|
+
d: "M127.12 20.6h-1.22v-2.7h1.22v-3.84h3.1v3.83h2.15v2.71h-2.16v3.35c0 1.74.2 2.75 1.35 2.75l.56-.04v2.75c-.33.04-.96.07-1.3.07-2.4 0-3.7-1.82-3.7-4.4z",
|
|
223
|
+
fill: "var(--slingshot-text-dark)"
|
|
224
|
+
}),
|
|
225
|
+
/* @__PURE__ */ jsx("path", {
|
|
226
|
+
d: "M116.04 23.47a3.1 3.1 0 0 0 3.1 3.19 3.14 3.14 0 0 0 0-6.28c-1.71 0-3.1 1.44-3.1 3.1m-2.85-.04c0-3.02 2.33-5.9 5.97-5.9a5.84 5.84 0 0 1 5.92 5.96 5.8 5.8 0 0 1-5.99 5.99c-3.68 0-5.9-3.04-5.9-6.05",
|
|
227
|
+
fill: "var(--slingshot-text-dark)"
|
|
228
|
+
}),
|
|
229
|
+
/* @__PURE__ */ jsx("path", {
|
|
230
|
+
d: "m98.89 18.68-1.53 1.83a3 3 0 0 0-1.82-.73c-.67 0-1.19.41-1.19.94s.3.73 1.75 1.26c2.56.92 3.35 1.7 3.35 3.49 0 2.36-1.9 4.03-4.6 4.03a5.4 5.4 0 0 1-4.18-1.86l1.6-1.92q1.28 1.32 2.6 1.33c.78 0 1.4-.53 1.4-1.24 0-.62-.26-.9-1.7-1.42-2.66-.97-3.2-1.7-3.2-3.33 0-2.18 1.73-3.57 3.93-3.57q2-.01 3.59 1.19",
|
|
231
|
+
fill: "var(--slingshot-text-dark)"
|
|
232
|
+
}),
|
|
233
|
+
/* @__PURE__ */ jsx("path", {
|
|
234
|
+
d: "M65.46 29.14V17.9h3.1v1.4a4.2 4.2 0 0 1 3.43-1.77c2.22 0 4.09 1.3 4.09 4.34v7.27h-3.1v-6.17c0-1.88-.52-2.76-2.09-2.76s-2.33 1-2.33 3.1v5.83z",
|
|
235
|
+
fill: "var(--slingshot-text-dark)"
|
|
236
|
+
}),
|
|
237
|
+
/* @__PURE__ */ jsx("path", {
|
|
238
|
+
d: "M60.17 17.9h3.1v11.23h-3.1zm-.29-3.45c0-1.03.83-1.88 1.84-1.88s1.84.85 1.84 1.88-.83 1.88-1.84 1.88a1.87 1.87 0 0 1-1.84-1.88",
|
|
239
|
+
fill: "var(--slingshot-text-dark)"
|
|
240
|
+
}),
|
|
241
|
+
/* @__PURE__ */ jsx("path", {
|
|
242
|
+
d: "m52.22 18.68-1.53 1.83a3 3 0 0 0-1.82-.73c-.67 0-1.19.41-1.19.94s.3.73 1.75 1.26c2.56.92 3.35 1.7 3.35 3.49 0 2.36-1.9 4.03-4.6 4.03A5.4 5.4 0 0 1 44 27.64l1.6-1.92q1.28 1.32 2.6 1.33c.78 0 1.39-.53 1.39-1.24 0-.62-.25-.9-1.68-1.42-2.68-.97-3.21-1.7-3.21-3.33 0-2.18 1.72-3.57 3.92-3.57q2.02-.01 3.6 1.19",
|
|
243
|
+
fill: "var(--slingshot-text-dark)"
|
|
244
|
+
}),
|
|
245
|
+
/* @__PURE__ */ jsx("path", {
|
|
246
|
+
d: "M57.17 23.6c0 1.75.3 2.76 1.44 2.76q.2 0 .43-.05v2.75c-.34.05-.74.07-1.04.07-2.74 0-3.92-1.95-3.92-4.54V12.7h3.1z",
|
|
247
|
+
fill: "var(--slingshot-text-dark)"
|
|
248
|
+
}),
|
|
249
|
+
/* @__PURE__ */ jsx("path", {
|
|
250
|
+
d: "M104.03 19.36a4 4 0 0 1 3.43-1.83c1.58 0 2.59.6 3.33 1.53.58.76.76 1.77.76 3v7.07h-3.1v-6.17c0-2-.56-2.75-2.09-2.75q-2.34 0-2.33 3.17v5.75h-3.1V12.57h3.1z",
|
|
251
|
+
fill: "var(--slingshot-text-dark)"
|
|
252
|
+
}),
|
|
253
|
+
/* @__PURE__ */ jsx("path", {
|
|
254
|
+
"fill-rule": "evenodd",
|
|
255
|
+
"clip-rule": "evenodd",
|
|
256
|
+
d: "m89.41 28-.03 1.78q-.08 1.21-.3 1.85c-.7 2.09-2.88 3.53-5.55 3.53-3.19 0-5.61-2.04-5.86-4.7h3.32q.49 2.03 2.6 2.02c1.63 0 2.57-.86 2.72-2.63v-1.77c-4.29 2.94-8.66-.68-8.66-4.59a5.5 5.5 0 0 1 4.98-5.64c1.46 0 2.74.25 3.68 1.47v-1.47h3.1zm-6.04-7.67a3.14 3.14 0 0 0-3.07 3.12 3.1 3.1 0 0 0 3.07 3.16 3.15 3.15 0 0 0 0-6.28",
|
|
257
|
+
fill: "var(--slingshot-text-dark)"
|
|
258
|
+
})
|
|
259
|
+
]
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
//#endregion
|
|
263
|
+
//#region src/primitives/SustainLogo/SustainLogo.tsx
|
|
264
|
+
function SustainLogo({ isDarkMode = false }) {
|
|
265
|
+
return /* @__PURE__ */ jsxs("svg", {
|
|
266
|
+
width: "113",
|
|
267
|
+
height: "37",
|
|
268
|
+
viewBox: "0 0 113 37",
|
|
269
|
+
fill: "none",
|
|
270
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
271
|
+
style: {
|
|
272
|
+
"--sustain-circle-bg": isDarkMode ? "#1a1a1a" : "white",
|
|
273
|
+
"--sustain-primary-red": "var(--color-red-500)",
|
|
274
|
+
"--sustain-accent-white": isDarkMode ? "#E5E7EB" : "#030712",
|
|
275
|
+
"--sustain-text-dark": isDarkMode ? "#FFFFFF" : "#030712"
|
|
276
|
+
},
|
|
277
|
+
children: [
|
|
278
|
+
/* @__PURE__ */ jsx("path", {
|
|
279
|
+
d: "M35.6 18.28c0 9.74-7.9 18.03-17.66 18.03S.28 28.02.28 18.28 8.18.64 17.94.64s17.67 7.9 17.67 17.64",
|
|
280
|
+
fill: "var(--sustain-circle-bg)"
|
|
281
|
+
}),
|
|
282
|
+
/* @__PURE__ */ jsx("path", {
|
|
283
|
+
d: "M33.08 18.73q1.5 0 2.92.3a18 18 0 0 1-.48 3.43q-1.19-.26-2.45-.27v.1a1.15 1.15 0 0 0-2.17.54c0 .64.5 1.15 1.14 1.15.51 0 .94-.33 1.1-.78q1.09 0 2.1.24-.44 1.48-1.13 2.86-.52-.09-1.04-.08a7.1 7.1 0 0 0-7.1 7.1c0 3.9.02.7.08 1.04a18 18 0 0 1-2.87 1.14q-.16-.74-.21-1.53c.34-.2.57-.57.57-1 0-.63-.51-1.14-1.15-1.14s-1.15.5-1.15 1.15c0 .63.31.9.74 1.07q.06.87.24 1.72-1.66.4-3.43.48-.3-1.43-.3-2.92a14.6 14.6 0 0 1 14.59-14.58z",
|
|
284
|
+
fill: "var(--sustain-primary-red)"
|
|
285
|
+
}),
|
|
286
|
+
/* @__PURE__ */ jsx("path", {
|
|
287
|
+
d: "M2.9 18.73a14.6 14.6 0 0 1 14.28 17.5 18 18 0 0 1-3.43-.48q.19-.8.24-1.67c.47-.14.81-.58.81-1.1 0-.64-.5-1.15-1.15-1.15-.63 0-1.14.5-1.14 1.15 0 .4.2.73.5.95q-.05.79-.22 1.55-1.49-.45-2.86-1.14.07-.51.07-1.02c0-3.92-3.2-7.1-7.1-7.1-3.92 0-.69.02-1.01.07Q1.2 24.92.75 23.42a10 10 0 0 1 2.04-.22 1.15 1.15 0 1 0 1.1-1.52c-.64 0-.8.23-1 .57v-.06q-1.24 0-2.4.27A18 18 0 0 1 0 19.04q1.41-.27 2.88-.28z",
|
|
288
|
+
fill: "var(--sustain-primary-red)"
|
|
289
|
+
}),
|
|
290
|
+
/* @__PURE__ */ jsx("path", {
|
|
291
|
+
d: "M33.08 27.2q.26-.01.54.04A18 18 0 0 1 27 33.85q-.03-.27-.03-.53c0-3.36 2.73-6.11 6.1-6.11",
|
|
292
|
+
fill: "var(--sustain-primary-red)"
|
|
293
|
+
}),
|
|
294
|
+
/* @__PURE__ */ jsx("path", {
|
|
295
|
+
d: "M2.9 27.2A6.1 6.1 0 0 1 9 33.33c0 3.37 0 .34-.02.5a18 18 0 0 1-6.58-6.58q.24-.02.5-.03",
|
|
296
|
+
fill: "var(--sustain-primary-red)"
|
|
297
|
+
}),
|
|
298
|
+
/* @__PURE__ */ jsx("path", {
|
|
299
|
+
"fill-rule": "evenodd",
|
|
300
|
+
"clip-rule": "evenodd",
|
|
301
|
+
d: "M18 6.74a15.7 15.7 0 0 0 11.8 11.34A15.6 15.6 0 0 0 18 29.42 15.6 15.6 0 0 0 6.17 18.08 15.6 15.6 0 0 0 18 6.74m0 6.56a4.94 4.94 0 0 1-4.93 4.94 4.94 4.94 0 0 1 4.94 4.94 4.96 4.96 0 0 1 4.93-4.94 4.94 4.94 0 0 1-4.93-4.94",
|
|
302
|
+
fill: "var(--sustain-primary-red)"
|
|
303
|
+
}),
|
|
304
|
+
/* @__PURE__ */ jsx("path", {
|
|
305
|
+
d: "M18.73.25q1.76.07 3.42.47a11 11 0 0 0-.2 1.68c-.43.17-.72.59-.72 1.07s.5 1.15 1.14 1.15a1.14 1.14 0 0 0 .57-2.14q.02-.77.17-1.5 1.5.44 2.9 1.13-.05.36-.05.73c0 3.92 3.2 7.1 7.1 7.1 3.92 0 .6-.02.9-.05q.72 1.36 1.2 2.86-1.02.21-2.08.21c-.2-.35-.58-.6-1.02-.6-.64 0-1.15.52-1.15 1.16s.51 1.14 1.15 1.14c.48 0 .88-.28 1.06-.69q1.2 0 2.33-.26.42 1.66.54 3.42-1.42.28-2.91.3A14.6 14.6 0 0 1 18.72.25z",
|
|
306
|
+
fill: "var(--sustain-primary-red)"
|
|
307
|
+
}),
|
|
308
|
+
/* @__PURE__ */ jsx("path", {
|
|
309
|
+
d: "M17.26.25q.22 1.25.22 2.6c0 8.03-6.6 14.6-14.64 14.6-2.74 0-2.55-.11-2.81-.3q.1-1.77.54-3.4 1.1.23 2.27.23c.17.41.58.7 1.06.7.64 0 1.15-.51 1.15-1.15s-.51-1.15-1.15-1.15-.8.24-1 .6q-1.05 0-2.05-.21.47-1.5 1.2-2.87.43.05.86.06c3.91 0 7.1-3.19 7.1-7.1s0-.48-.04-.72q1.38-.69 2.89-1.15.14.74.17 1.53a1.14 1.14 0 0 0 .64 2.1 1.15 1.15 0 0 0 .35-2.24q-.03-.85-.2-1.65a18 18 0 0 1 3.42-.47z",
|
|
310
|
+
fill: "var(--sustain-primary-red)"
|
|
311
|
+
}),
|
|
312
|
+
/* @__PURE__ */ jsx("path", {
|
|
313
|
+
d: "M9 2.84C9 6.2 6.27 8.95 2.9 8.95h-.32A18 18 0 0 1 9 2.65v.2z",
|
|
314
|
+
fill: "var(--sustain-primary-red)"
|
|
315
|
+
}),
|
|
316
|
+
/* @__PURE__ */ jsx("path", {
|
|
317
|
+
d: "M26.98 2.62a18 18 0 0 1 6.45 6.3h-.35a6.1 6.1 0 0 1-6.11-6.1V2.6z",
|
|
318
|
+
fill: "var(--sustain-primary-red)"
|
|
319
|
+
}),
|
|
320
|
+
/* @__PURE__ */ jsx("path", {
|
|
321
|
+
"fill-rule": "evenodd",
|
|
322
|
+
"clip-rule": "evenodd",
|
|
323
|
+
d: "M66.27 5.17a.5.5 0 0 0 .49-.5.5.5 0 0 0-.5-.5.5.5 0 0 0-.48.5c0 .28.22.5.49.5",
|
|
324
|
+
fill: "var(--sustain-accent-white)"
|
|
325
|
+
}),
|
|
326
|
+
/* @__PURE__ */ jsx("path", {
|
|
327
|
+
"fill-rule": "evenodd",
|
|
328
|
+
"clip-rule": "evenodd",
|
|
329
|
+
d: "M65.88 12.73h.76V6.1h-.76z",
|
|
330
|
+
fill: "var(--sustain-accent-white)"
|
|
331
|
+
}),
|
|
332
|
+
/* @__PURE__ */ jsx("path", {
|
|
333
|
+
"fill-rule": "evenodd",
|
|
334
|
+
"clip-rule": "evenodd",
|
|
335
|
+
d: "M50.72 9.4c0-1.38 1.06-2.5 2.37-2.5 1.3 0 2.37 1.12 2.37 2.5v.1c-.05 1.37-1.1 2.44-2.37 2.44-1.28 0-2.37-1.14-2.37-2.54m2.37 3.32c.92 0 1.77-.41 2.37-1.15v1.16h.76V6.1h-.76v1.14a3 3 0 0 0-2.37-1.14 3.2 3.2 0 0 0-3.13 3.3c0 1.8 1.4 3.31 3.13 3.31",
|
|
336
|
+
fill: "var(--sustain-accent-white)"
|
|
337
|
+
}),
|
|
338
|
+
/* @__PURE__ */ jsx("path", {
|
|
339
|
+
"fill-rule": "evenodd",
|
|
340
|
+
"clip-rule": "evenodd",
|
|
341
|
+
d: "M61.35 11.94c-1.28 0-2.32-1.07-2.37-2.43v-.1c0-1.4 1.06-2.52 2.37-2.52 1.3 0 2.37 1.13 2.37 2.51 0 1.39-1.07 2.54-2.37 2.54m3.13-2.54c0-1.81-1.4-3.29-3.13-3.29-.93 0-1.78.41-2.37 1.14V6.1h-.76v9h.76v-3.53c.6.73 1.45 1.14 2.37 1.14 1.72 0 3.13-1.49 3.13-3.32",
|
|
342
|
+
fill: "var(--sustain-accent-white)"
|
|
343
|
+
}),
|
|
344
|
+
/* @__PURE__ */ jsx("path", {
|
|
345
|
+
"fill-rule": "evenodd",
|
|
346
|
+
"clip-rule": "evenodd",
|
|
347
|
+
d: "M78.73 6.11c-.72 0-1.4.3-1.9.84V6.1h-.74v6.62h.73V8.8a1.95 1.95 0 0 1 1.9-1.93c1.03 0 1.9.86 1.9 1.93v3.92h.75V8.8c0-1.49-1.19-2.7-2.64-2.7",
|
|
348
|
+
fill: "var(--sustain-accent-white)"
|
|
349
|
+
}),
|
|
350
|
+
/* @__PURE__ */ jsx("path", {
|
|
351
|
+
"fill-rule": "evenodd",
|
|
352
|
+
"clip-rule": "evenodd",
|
|
353
|
+
d: "m85.3 11.97-.07.02q-.11.04-.37.05-.44.02-.44-.67v-4.5h.9V6.1h-.9V3.89h-.78V6.1h-.9v.76h.9v4.53q0 .74.28 1.01.27.3.77.31.37 0 .61-.1l.05-.01z",
|
|
354
|
+
fill: "var(--sustain-accent-white)"
|
|
355
|
+
}),
|
|
356
|
+
/* @__PURE__ */ jsx("path", {
|
|
357
|
+
"fill-rule": "evenodd",
|
|
358
|
+
"clip-rule": "evenodd",
|
|
359
|
+
d: "M71.42 6.88c1.11 0 2.07.83 2.3 1.97h-4.65a2.4 2.4 0 0 1 2.34-1.97m1.98 3.94a2.3 2.3 0 0 1-1.99 1.14 2.46 2.46 0 0 1-2.39-2.36h5.14c.2 0 .37-.15.37-.35v-.06c-.13-1.75-1.47-3.08-3.12-3.08a3.24 3.24 0 0 0-3.14 3.32c0 1.83 1.41 3.3 3.14 3.3 1.06 0 2.04-.56 2.61-1.5z",
|
|
360
|
+
fill: "var(--sustain-accent-white)"
|
|
361
|
+
}),
|
|
362
|
+
/* @__PURE__ */ jsx("path", {
|
|
363
|
+
"fill-rule": "evenodd",
|
|
364
|
+
"clip-rule": "evenodd",
|
|
365
|
+
d: "M48.2 9.53s-.2-.16-.41-.25c-.22-.09-.52-.2-1.16-.35q-.12-.04-.25-.06-.63-.17-1-.44-.33-.28-.3-.61.01-.39.4-.67.45-.34 1.18-.3c.54.02.95.3 1.39.62l.04.03.55-.53-.26-.2c-.44-.3-.97-.62-1.69-.65q-.95-.04-1.6.38c-.47.32-.77.79-.77 1.28-.01.37.07.72.43 1.08.43.43 1.1.65 1.72.77.53.1 1.02.3 1.26.51.3.28.4.48.4.77q-.02.42-.48.72c-.3.23-.73.35-1.18.33a3.2 3.2 0 0 1-1.82-.78l-.04-.04-.54.51.05.05q1.09.95 2.31 1.02a2.6 2.6 0 0 0 1.64-.46q.77-.54.81-1.32a1.7 1.7 0 0 0-.68-1.41",
|
|
366
|
+
fill: "var(--sustain-accent-white)"
|
|
367
|
+
}),
|
|
368
|
+
/* @__PURE__ */ jsx("path", {
|
|
369
|
+
d: "m52.1 23-1.35 1.6a2.7 2.7 0 0 0-1.62-.65c-.6 0-1.06.36-1.06.82 0 .48.26.64 1.56 1.1 2.28.8 2.98 1.48 2.98 3.04 0 2.06-1.7 3.52-4.1 3.52a4.8 4.8 0 0 1-3.72-1.62l1.42-1.68q1.15 1.15 2.32 1.16c.7 0 1.24-.46 1.24-1.08 0-.54-.22-.78-1.5-1.24-2.38-.84-2.86-1.48-2.86-2.9 0-1.9 1.54-3.12 3.5-3.12q1.8 0 3.2 1.04m2.43-.69h2.76v5.56q0 2.22 1.98 2.22 2 0 2-2.22v-5.56H64v6.02c0 2.62-1.7 4.08-4.74 4.08s-4.74-1.46-4.74-4.08zm18.8.68-1.35 1.6a2.7 2.7 0 0 0-1.62-.64c-.6 0-1.06.36-1.06.82 0 .48.26.64 1.56 1.1 2.28.8 2.98 1.48 2.98 3.04 0 2.06-1.7 3.52-4.1 3.52a4.8 4.8 0 0 1-3.72-1.62l1.42-1.68q1.15 1.15 2.32 1.16c.7 0 1.24-.46 1.24-1.08 0-.54-.22-.78-1.5-1.24-2.38-.84-2.86-1.48-2.86-2.9 0-1.9 1.54-3.12 3.5-3.12q1.8 0 3.2 1.04m2.45 1.68H74.7v-2.36h1.08v-3.34h2.76v3.34h1.92v2.36h-1.92v2.92c0 1.52.18 2.4 1.2 2.4q.28 0 .5-.04v2.4c-.3.04-.86.06-1.16.06-2.14 0-3.3-1.58-3.3-3.84zM90 27.23a2.76 2.76 0 0 0-2.74-2.76 2.7 2.7 0 0 0-2.74 2.74c0 1.52 1.2 2.74 2.74 2.74A2.8 2.8 0 0 0 90 27.23m-.3-3.66v-1.26h2.76v9.8H89.7v-1.28a3.9 3.9 0 0 1-3.2 1.58c-2.76 0-4.82-2.26-4.82-5.22 0-2.92 2.04-5.2 4.76-5.2q1.91.01 3.26 1.58m5.31-1.26h2.76v9.8h-2.76zm-.26-4.14c0-.9.74-1.64 1.64-1.64s1.64.74 1.64 1.64-.74 1.64-1.64 1.64-1.64-.74-1.64-1.64m5.58 13.94v-9.8h2.76v1.22a3.7 3.7 0 0 1 3.06-1.54c1.98 0 3.64 1.14 3.64 3.78v6.34h-2.76v-5.38c0-1.64-.46-2.4-1.86-2.4-1.38 0-2.08.86-2.08 2.7v5.08z",
|
|
370
|
+
fill: "var(--sustain-accent-white)"
|
|
371
|
+
})
|
|
372
|
+
]
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
//#endregion
|
|
376
|
+
export { TooltipProvider as a, TooltipContent as i, SlingshotLogo as n, TooltipTrigger as o, Tooltip as r, SustainLogo as t };
|
|
377
|
+
|
|
378
|
+
//# sourceMappingURL=SustainLogo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SustainLogo.js","names":[],"sources":["../src/primitives/Tooltip/Tooltip.tsx","../src/primitives/SlingshotLogo/SlingshotLogo.tsx","../src/primitives/SustainLogo/SustainLogo.tsx"],"sourcesContent":["\"use client\";\n\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport * as React from \"react\";\n\nimport { cn } from \"../../utils\";\n\n/**\n * Figma Make internal props that may be injected onto any component.\n * They are stripped at runtime and must never reach a DOM element.\n */\ntype FigmaProps = {\n _fgT?: unknown;\n _fgS?: unknown;\n _fgB?: unknown;\n};\n\n/**\n * Strip all Figma Make internal props (_fg*) so they never reach a DOM element.\n * We explicitly destructure the known ones AND filter any others dynamically.\n */\nfunction cleanProps(raw: Record<string, any>): Record<string, any> {\n const result: Record<string, any> = {};\n for (const key of Object.keys(raw)) {\n if (!key.startsWith(\"_fg\")) {\n result[key] = raw[key];\n }\n }\n return result;\n}\n\n/**\n * Recursively strip _fg* props from React children.\n * Needed because <TooltipTrigger asChild> clones children via Radix's Slot,\n * and Figma injects _fg* props directly onto those child elements too.\n *\n * IMPORTANT: Radix's Slot uses React.Children.only() which requires a single\n * child element — NOT an array. So we must NOT use React.Children.map() which\n * always returns an array. Instead we handle single vs multiple children explicitly.\n */\nfunction stripFigmaFromChild(child: React.ReactNode): React.ReactNode {\n if (!React.isValidElement(child)) return child;\n const childProps = child.props as Record<string, any>;\n const hasFg = Object.keys(childProps).some((k) => k.startsWith(\"_fg\"));\n if (!hasFg) return child;\n const cleaned = cleanProps(childProps);\n if (cleaned.children) {\n cleaned.children = stripFigmaFromChild(cleaned.children);\n }\n return React.cloneElement(child, cleaned);\n}\n\nfunction TooltipProvider({\n delayDuration = 0,\n _fgT,\n _fgS,\n _fgB,\n children,\n ...rest\n}: React.ComponentProps<typeof TooltipPrimitive.Provider> & FigmaProps) {\n return (\n <TooltipPrimitive.Provider\n data-slot=\"tooltip-provider\"\n delayDuration={delayDuration}\n {...cleanProps(rest)}\n >\n {children}\n </TooltipPrimitive.Provider>\n );\n}\n\nfunction Tooltip({\n _fgT,\n _fgS,\n _fgB,\n ...rest\n}: React.ComponentProps<typeof TooltipPrimitive.Root> & FigmaProps) {\n return (\n <TooltipProvider>\n <TooltipPrimitive.Root data-slot=\"tooltip\" {...cleanProps(rest)} />\n </TooltipProvider>\n );\n}\n\nfunction TooltipTrigger({\n _fgT,\n _fgS,\n _fgB,\n children,\n ...rest\n}: React.ComponentProps<typeof TooltipPrimitive.Trigger> & FigmaProps) {\n return (\n <TooltipPrimitive.Trigger data-slot=\"tooltip-trigger\" {...cleanProps(rest)}>\n {stripFigmaFromChild(children)}\n </TooltipPrimitive.Trigger>\n );\n}\n\nfunction TooltipContent({\n className,\n sideOffset = 0,\n children,\n style: callerStyle,\n _fgT,\n _fgS,\n _fgB,\n ...rest\n}: React.ComponentProps<typeof TooltipPrimitive.Content> & FigmaProps) {\n const mergedStyle = {\n backgroundColor: \"var(--tooltip-bg)\",\n color: \"var(--tooltip-foreground)\",\n borderRadius: \"var(--radius)\",\n fontFamily: \"var(--font-body)\",\n ...callerStyle,\n };\n\n return (\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Content\n data-slot=\"tooltip-content\"\n sideOffset={sideOffset}\n className={cn(\n \"animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) px-3 py-1.5 text-xs text-balance\",\n className,\n )}\n style={mergedStyle}\n {...cleanProps(rest)}\n >\n {children}\n <TooltipPrimitive.Arrow\n className=\"z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]\"\n style={{\n fill: callerStyle?.backgroundColor || \"var(--tooltip-bg)\",\n backgroundColor: callerStyle?.backgroundColor || \"var(--tooltip-bg)\",\n }}\n />\n </TooltipPrimitive.Content>\n </TooltipPrimitive.Portal>\n );\n}\n\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };\n","interface SlingshotLogoProps {\n isDarkMode?: boolean;\n}\n\nexport function SlingshotLogo({ isDarkMode = false }: SlingshotLogoProps) {\n return (\n <svg\n width=\"133\"\n height=\"36\"\n viewBox=\"0 0 133 36\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n style={\n {\n \"--slingshot-primary-red\": \"var(--color-red-500)\",\n \"--slingshot-accent-white\": isDarkMode ? \"#E5E7EB\" : \"white\",\n \"--slingshot-text-dark\": isDarkMode ? \"#FFFFFF\" : \"#030712\",\n } as React.CSSProperties\n }\n >\n <path\n d=\"M18 0C8.07 0 0 8.07 0 18s8.07 18 18 18 18-8.07 18-18S27.92 0 18 0\"\n fill=\"var(--slingshot-primary-red)\"\n />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M31.43 23.58a1.27 1.27 0 1 1-2.33-.97 1.27 1.27 0 0 1 2.33.97\"\n fill=\"var(--slingshot-accent-white)\"\n />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M23.55 31.44a1.27 1.27 0 1 1-.96-2.35 1.27 1.27 0 0 1 .96 2.35\"\n fill=\"var(--slingshot-accent-white)\"\n />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M12.42 31.43a1.27 1.27 0 1 1 .98-2.34 1.27 1.27 0 0 1-.98 2.34\"\n fill=\"var(--slingshot-accent-white)\"\n />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M4.55 23.55\"\n fill=\"var(--slingshot-accent-white)\"\n />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M4.57 12.42a1.27 1.27 0 1 1 .69 1.66 1.27 1.27 0 0 1-.7-1.66\"\n fill=\"var(--slingshot-accent-white)\"\n />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M12.45 4.55a1.27 1.27 0 1 1-.7 1.66c-.26-.65.05-1.39.7-1.66\"\n fill=\"var(--slingshot-accent-white)\"\n />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M23.58 4.57\"\n fill=\"var(--slingshot-accent-white)\"\n />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M31.45 12.45a1.27 1.27 0 1 1-1.66-.7c.65-.26 1.39.05 1.66.7\"\n fill=\"var(--slingshot-accent-white)\"\n />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M19.33 20.43c-.99 1.36-1.7 3.56-.39 4.86.89.89.22 2.35-.97 2.35-1.2 0-1.86-1.46-.98-2.35 1.3-1.3.6-3.5-.38-4.86a9 9 0 0 0-1.04-1.1c-1.37-.99-3.56-1.69-4.86-.39-.89.89-2.36.22-2.36-.97 0-1.2 1.47-1.86 2.36-.98 1.3 1.3 3.5.6 4.86-.38.23-.17.94-.82 1.1-1.04.98-1.36 1.69-3.56.38-4.86-.88-.89-.22-2.36.98-2.36s1.86 1.47.97 2.36c-1.3 1.3-.6 3.5.39 4.86.17.23.82.94 1.04 1.1 1.36.99 3.55 1.69 4.86.38.89-.88 2.35-.21 2.35.98 0 1.2-1.46 1.86-2.35.98-1.3-1.3-3.5-.6-4.86.38-.24.17-.94.82-1.1 1.04\"\n fill=\"var(--slingshot-accent-white)\"\n />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M24.92 11.08a1.9 1.9 0 1 1-2.7 2.7 1.9 1.9 0 0 1 2.7-2.7\"\n fill=\"var(--slingshot-accent-white)\"\n />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M24.92 24.92a1.9 1.9 0 1 1-2.7-2.7 1.9 1.9 0 0 1 2.7 2.7\"\n fill=\"var(--slingshot-accent-white)\"\n />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M11.08 24.92a1.9 1.9 0 1 1 2.69-2.7 1.9 1.9 0 0 1-2.7 2.7\"\n fill=\"var(--slingshot-accent-white)\"\n />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M11.08 11.08a1.9 1.9 0 1 1 2.7 2.69 1.9 1.9 0 0 1-2.7-2.69\"\n fill=\"var(--slingshot-accent-white)\"\n />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M66.2 2.12a.5.5 0 0 0 .49-.5.5.5 0 0 0-.49-.5.5.5 0 0 0-.49.5c0 .28.22.5.5.5\"\n fill=\"var(--slingshot-text-dark)\"\n />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M65.81 9.68h.77V3.06h-.77z\"\n fill=\"var(--slingshot-text-dark)\"\n />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M50.65 6.35c0-1.38 1.06-2.51 2.37-2.51 1.3 0 2.37 1.13 2.37 2.51v.1c-.05 1.37-1.1 2.44-2.37 2.44-1.28 0-2.37-1.14-2.37-2.54m2.37 3.32c.92 0 1.77-.42 2.37-1.15v1.16h.76V3.06h-.76V4.2a3 3 0 0 0-2.37-1.14 3.2 3.2 0 0 0-3.13 3.3c0 1.8 1.4 3.31 3.13 3.31\"\n fill=\"var(--slingshot-text-dark)\"\n />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M61.28 8.9c-1.28 0-2.32-1.08-2.37-2.44v-.1c0-1.4 1.06-2.52 2.37-2.52 1.3 0 2.37 1.13 2.37 2.51 0 1.39-1.06 2.54-2.37 2.54m3.13-2.55c0-1.81-1.4-3.29-3.13-3.29-.92 0-1.78.41-2.37 1.14V3.06h-.76v9h.76V8.52c.6.74 1.45 1.15 2.37 1.15 1.73 0 3.13-1.49 3.13-3.32\"\n fill=\"var(--slingshot-text-dark)\"\n />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M78.66 3.06c-.72 0-1.4.3-1.9.83v-.83h-.74v6.62h.74V5.76a1.95 1.95 0 0 1 1.9-1.93c1.03 0 1.9.86 1.9 1.93v3.92h.74V5.76c0-1.49-1.18-2.7-2.64-2.7\"\n fill=\"var(--slingshot-text-dark)\"\n />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"m85.24 8.92-.08.02q-.11.04-.37.05-.44.02-.43-.67v-4.5h.9v-.76h-.9V.84h-.78v2.22h-.9v.76h.9v4.52q0 .74.27 1.02.27.3.77.31.38 0 .62-.1l.04-.01z\"\n fill=\"var(--slingshot-text-dark)\"\n />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M71.35 3.83c1.12 0 2.07.82 2.3 1.97h-4.64a2.4 2.4 0 0 1 2.34-1.97m1.98 3.94a2.3 2.3 0 0 1-1.98 1.14 2.46 2.46 0 0 1-2.4-2.36h5.14c.21 0 .38-.15.38-.35v-.06c-.14-1.75-1.48-3.08-3.12-3.08a3.24 3.24 0 0 0-3.15 3.32c0 1.83 1.41 3.3 3.15 3.3 1.06 0 2.03-.56 2.6-1.5z\"\n fill=\"var(--slingshot-text-dark)\"\n />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M48.13 6.48s-.2-.16-.4-.25c-.22-.09-.53-.2-1.16-.36q-.13-.02-.25-.06-.64-.16-1-.43-.34-.28-.31-.61.01-.39.4-.67.46-.34 1.18-.3c.54.02.95.3 1.39.62l.04.03.55-.53-.26-.2c-.44-.3-.97-.62-1.69-.65q-.94-.04-1.6.38c-.47.32-.77.79-.77 1.28 0 .37.07.72.43 1.08.43.42 1.1.65 1.72.77.53.1 1.02.3 1.27.51.3.28.4.48.4.76q-.04.43-.5.73c-.3.23-.72.35-1.17.33a3 3 0 0 1-1.81-.78l-.05-.04-.54.51.05.05q1.09.95 2.32 1.02A2.6 2.6 0 0 0 48 9.21q.76-.54.8-1.32a1.7 1.7 0 0 0-.68-1.41\"\n fill=\"var(--slingshot-text-dark)\"\n />\n <path\n d=\"M127.12 20.6h-1.22v-2.7h1.22v-3.84h3.1v3.83h2.15v2.71h-2.16v3.35c0 1.74.2 2.75 1.35 2.75l.56-.04v2.75c-.33.04-.96.07-1.3.07-2.4 0-3.7-1.82-3.7-4.4z\"\n fill=\"var(--slingshot-text-dark)\"\n />\n <path\n d=\"M116.04 23.47a3.1 3.1 0 0 0 3.1 3.19 3.14 3.14 0 0 0 0-6.28c-1.71 0-3.1 1.44-3.1 3.1m-2.85-.04c0-3.02 2.33-5.9 5.97-5.9a5.84 5.84 0 0 1 5.92 5.96 5.8 5.8 0 0 1-5.99 5.99c-3.68 0-5.9-3.04-5.9-6.05\"\n fill=\"var(--slingshot-text-dark)\"\n />\n <path\n d=\"m98.89 18.68-1.53 1.83a3 3 0 0 0-1.82-.73c-.67 0-1.19.41-1.19.94s.3.73 1.75 1.26c2.56.92 3.35 1.7 3.35 3.49 0 2.36-1.9 4.03-4.6 4.03a5.4 5.4 0 0 1-4.18-1.86l1.6-1.92q1.28 1.32 2.6 1.33c.78 0 1.4-.53 1.4-1.24 0-.62-.26-.9-1.7-1.42-2.66-.97-3.2-1.7-3.2-3.33 0-2.18 1.73-3.57 3.93-3.57q2-.01 3.59 1.19\"\n fill=\"var(--slingshot-text-dark)\"\n />\n <path\n d=\"M65.46 29.14V17.9h3.1v1.4a4.2 4.2 0 0 1 3.43-1.77c2.22 0 4.09 1.3 4.09 4.34v7.27h-3.1v-6.17c0-1.88-.52-2.76-2.09-2.76s-2.33 1-2.33 3.1v5.83z\"\n fill=\"var(--slingshot-text-dark)\"\n />\n <path\n d=\"M60.17 17.9h3.1v11.23h-3.1zm-.29-3.45c0-1.03.83-1.88 1.84-1.88s1.84.85 1.84 1.88-.83 1.88-1.84 1.88a1.87 1.87 0 0 1-1.84-1.88\"\n fill=\"var(--slingshot-text-dark)\"\n />\n <path\n d=\"m52.22 18.68-1.53 1.83a3 3 0 0 0-1.82-.73c-.67 0-1.19.41-1.19.94s.3.73 1.75 1.26c2.56.92 3.35 1.7 3.35 3.49 0 2.36-1.9 4.03-4.6 4.03A5.4 5.4 0 0 1 44 27.64l1.6-1.92q1.28 1.32 2.6 1.33c.78 0 1.39-.53 1.39-1.24 0-.62-.25-.9-1.68-1.42-2.68-.97-3.21-1.7-3.21-3.33 0-2.18 1.72-3.57 3.92-3.57q2.02-.01 3.6 1.19\"\n fill=\"var(--slingshot-text-dark)\"\n />\n <path\n d=\"M57.17 23.6c0 1.75.3 2.76 1.44 2.76q.2 0 .43-.05v2.75c-.34.05-.74.07-1.04.07-2.74 0-3.92-1.95-3.92-4.54V12.7h3.1z\"\n fill=\"var(--slingshot-text-dark)\"\n />\n <path\n d=\"M104.03 19.36a4 4 0 0 1 3.43-1.83c1.58 0 2.59.6 3.33 1.53.58.76.76 1.77.76 3v7.07h-3.1v-6.17c0-2-.56-2.75-2.09-2.75q-2.34 0-2.33 3.17v5.75h-3.1V12.57h3.1z\"\n fill=\"var(--slingshot-text-dark)\"\n />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"m89.41 28-.03 1.78q-.08 1.21-.3 1.85c-.7 2.09-2.88 3.53-5.55 3.53-3.19 0-5.61-2.04-5.86-4.7h3.32q.49 2.03 2.6 2.02c1.63 0 2.57-.86 2.72-2.63v-1.77c-4.29 2.94-8.66-.68-8.66-4.59a5.5 5.5 0 0 1 4.98-5.64c1.46 0 2.74.25 3.68 1.47v-1.47h3.1zm-6.04-7.67a3.14 3.14 0 0 0-3.07 3.12 3.1 3.1 0 0 0 3.07 3.16 3.15 3.15 0 0 0 0-6.28\"\n fill=\"var(--slingshot-text-dark)\"\n />\n </svg>\n );\n}\n\nexport default SlingshotLogo;\n","interface SustainLogoProps {\n isDarkMode?: boolean;\n}\n\nexport function SustainLogo({ isDarkMode = false }: SustainLogoProps) {\n return (\n <svg\n width=\"113\"\n height=\"37\"\n viewBox=\"0 0 113 37\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n style={\n {\n \"--sustain-circle-bg\": isDarkMode ? \"#1a1a1a\" : \"white\",\n \"--sustain-primary-red\": \"var(--color-red-500)\",\n \"--sustain-accent-white\": isDarkMode ? \"#E5E7EB\" : \"#030712\",\n \"--sustain-text-dark\": isDarkMode ? \"#FFFFFF\" : \"#030712\",\n } as React.CSSProperties\n }\n >\n <path\n d=\"M35.6 18.28c0 9.74-7.9 18.03-17.66 18.03S.28 28.02.28 18.28 8.18.64 17.94.64s17.67 7.9 17.67 17.64\"\n fill=\"var(--sustain-circle-bg)\"\n />\n <path\n d=\"M33.08 18.73q1.5 0 2.92.3a18 18 0 0 1-.48 3.43q-1.19-.26-2.45-.27v.1a1.15 1.15 0 0 0-2.17.54c0 .64.5 1.15 1.14 1.15.51 0 .94-.33 1.1-.78q1.09 0 2.1.24-.44 1.48-1.13 2.86-.52-.09-1.04-.08a7.1 7.1 0 0 0-7.1 7.1c0 3.9.02.7.08 1.04a18 18 0 0 1-2.87 1.14q-.16-.74-.21-1.53c.34-.2.57-.57.57-1 0-.63-.51-1.14-1.15-1.14s-1.15.5-1.15 1.15c0 .63.31.9.74 1.07q.06.87.24 1.72-1.66.4-3.43.48-.3-1.43-.3-2.92a14.6 14.6 0 0 1 14.59-14.58z\"\n fill=\"var(--sustain-primary-red)\"\n />\n <path\n d=\"M2.9 18.73a14.6 14.6 0 0 1 14.28 17.5 18 18 0 0 1-3.43-.48q.19-.8.24-1.67c.47-.14.81-.58.81-1.1 0-.64-.5-1.15-1.15-1.15-.63 0-1.14.5-1.14 1.15 0 .4.2.73.5.95q-.05.79-.22 1.55-1.49-.45-2.86-1.14.07-.51.07-1.02c0-3.92-3.2-7.1-7.1-7.1-3.92 0-.69.02-1.01.07Q1.2 24.92.75 23.42a10 10 0 0 1 2.04-.22 1.15 1.15 0 1 0 1.1-1.52c-.64 0-.8.23-1 .57v-.06q-1.24 0-2.4.27A18 18 0 0 1 0 19.04q1.41-.27 2.88-.28z\"\n fill=\"var(--sustain-primary-red)\"\n />\n <path\n d=\"M33.08 27.2q.26-.01.54.04A18 18 0 0 1 27 33.85q-.03-.27-.03-.53c0-3.36 2.73-6.11 6.1-6.11\"\n fill=\"var(--sustain-primary-red)\"\n />\n <path\n d=\"M2.9 27.2A6.1 6.1 0 0 1 9 33.33c0 3.37 0 .34-.02.5a18 18 0 0 1-6.58-6.58q.24-.02.5-.03\"\n fill=\"var(--sustain-primary-red)\"\n />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M18 6.74a15.7 15.7 0 0 0 11.8 11.34A15.6 15.6 0 0 0 18 29.42 15.6 15.6 0 0 0 6.17 18.08 15.6 15.6 0 0 0 18 6.74m0 6.56a4.94 4.94 0 0 1-4.93 4.94 4.94 4.94 0 0 1 4.94 4.94 4.96 4.96 0 0 1 4.93-4.94 4.94 4.94 0 0 1-4.93-4.94\"\n fill=\"var(--sustain-primary-red)\"\n />\n <path\n d=\"M18.73.25q1.76.07 3.42.47a11 11 0 0 0-.2 1.68c-.43.17-.72.59-.72 1.07s.5 1.15 1.14 1.15a1.14 1.14 0 0 0 .57-2.14q.02-.77.17-1.5 1.5.44 2.9 1.13-.05.36-.05.73c0 3.92 3.2 7.1 7.1 7.1 3.92 0 .6-.02.9-.05q.72 1.36 1.2 2.86-1.02.21-2.08.21c-.2-.35-.58-.6-1.02-.6-.64 0-1.15.52-1.15 1.16s.51 1.14 1.15 1.14c.48 0 .88-.28 1.06-.69q1.2 0 2.33-.26.42 1.66.54 3.42-1.42.28-2.91.3A14.6 14.6 0 0 1 18.72.25z\"\n fill=\"var(--sustain-primary-red)\"\n />\n <path\n d=\"M17.26.25q.22 1.25.22 2.6c0 8.03-6.6 14.6-14.64 14.6-2.74 0-2.55-.11-2.81-.3q.1-1.77.54-3.4 1.1.23 2.27.23c.17.41.58.7 1.06.7.64 0 1.15-.51 1.15-1.15s-.51-1.15-1.15-1.15-.8.24-1 .6q-1.05 0-2.05-.21.47-1.5 1.2-2.87.43.05.86.06c3.91 0 7.1-3.19 7.1-7.1s0-.48-.04-.72q1.38-.69 2.89-1.15.14.74.17 1.53a1.14 1.14 0 0 0 .64 2.1 1.15 1.15 0 0 0 .35-2.24q-.03-.85-.2-1.65a18 18 0 0 1 3.42-.47z\"\n fill=\"var(--sustain-primary-red)\"\n />\n <path\n d=\"M9 2.84C9 6.2 6.27 8.95 2.9 8.95h-.32A18 18 0 0 1 9 2.65v.2z\"\n fill=\"var(--sustain-primary-red)\"\n />\n <path\n d=\"M26.98 2.62a18 18 0 0 1 6.45 6.3h-.35a6.1 6.1 0 0 1-6.11-6.1V2.6z\"\n fill=\"var(--sustain-primary-red)\"\n />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M66.27 5.17a.5.5 0 0 0 .49-.5.5.5 0 0 0-.5-.5.5.5 0 0 0-.48.5c0 .28.22.5.49.5\"\n fill=\"var(--sustain-accent-white)\"\n />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M65.88 12.73h.76V6.1h-.76z\"\n fill=\"var(--sustain-accent-white)\"\n />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M50.72 9.4c0-1.38 1.06-2.5 2.37-2.5 1.3 0 2.37 1.12 2.37 2.5v.1c-.05 1.37-1.1 2.44-2.37 2.44-1.28 0-2.37-1.14-2.37-2.54m2.37 3.32c.92 0 1.77-.41 2.37-1.15v1.16h.76V6.1h-.76v1.14a3 3 0 0 0-2.37-1.14 3.2 3.2 0 0 0-3.13 3.3c0 1.8 1.4 3.31 3.13 3.31\"\n fill=\"var(--sustain-accent-white)\"\n />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M61.35 11.94c-1.28 0-2.32-1.07-2.37-2.43v-.1c0-1.4 1.06-2.52 2.37-2.52 1.3 0 2.37 1.13 2.37 2.51 0 1.39-1.07 2.54-2.37 2.54m3.13-2.54c0-1.81-1.4-3.29-3.13-3.29-.93 0-1.78.41-2.37 1.14V6.1h-.76v9h.76v-3.53c.6.73 1.45 1.14 2.37 1.14 1.72 0 3.13-1.49 3.13-3.32\"\n fill=\"var(--sustain-accent-white)\"\n />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M78.73 6.11c-.72 0-1.4.3-1.9.84V6.1h-.74v6.62h.73V8.8a1.95 1.95 0 0 1 1.9-1.93c1.03 0 1.9.86 1.9 1.93v3.92h.75V8.8c0-1.49-1.19-2.7-2.64-2.7\"\n fill=\"var(--sustain-accent-white)\"\n />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"m85.3 11.97-.07.02q-.11.04-.37.05-.44.02-.44-.67v-4.5h.9V6.1h-.9V3.89h-.78V6.1h-.9v.76h.9v4.53q0 .74.28 1.01.27.3.77.31.37 0 .61-.1l.05-.01z\"\n fill=\"var(--sustain-accent-white)\"\n />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M71.42 6.88c1.11 0 2.07.83 2.3 1.97h-4.65a2.4 2.4 0 0 1 2.34-1.97m1.98 3.94a2.3 2.3 0 0 1-1.99 1.14 2.46 2.46 0 0 1-2.39-2.36h5.14c.2 0 .37-.15.37-.35v-.06c-.13-1.75-1.47-3.08-3.12-3.08a3.24 3.24 0 0 0-3.14 3.32c0 1.83 1.41 3.3 3.14 3.3 1.06 0 2.04-.56 2.61-1.5z\"\n fill=\"var(--sustain-accent-white)\"\n />\n <path\n fill-rule=\"evenodd\"\n clip-rule=\"evenodd\"\n d=\"M48.2 9.53s-.2-.16-.41-.25c-.22-.09-.52-.2-1.16-.35q-.12-.04-.25-.06-.63-.17-1-.44-.33-.28-.3-.61.01-.39.4-.67.45-.34 1.18-.3c.54.02.95.3 1.39.62l.04.03.55-.53-.26-.2c-.44-.3-.97-.62-1.69-.65q-.95-.04-1.6.38c-.47.32-.77.79-.77 1.28-.01.37.07.72.43 1.08.43.43 1.1.65 1.72.77.53.1 1.02.3 1.26.51.3.28.4.48.4.77q-.02.42-.48.72c-.3.23-.73.35-1.18.33a3.2 3.2 0 0 1-1.82-.78l-.04-.04-.54.51.05.05q1.09.95 2.31 1.02a2.6 2.6 0 0 0 1.64-.46q.77-.54.81-1.32a1.7 1.7 0 0 0-.68-1.41\"\n fill=\"var(--sustain-accent-white)\"\n />\n <path\n d=\"m52.1 23-1.35 1.6a2.7 2.7 0 0 0-1.62-.65c-.6 0-1.06.36-1.06.82 0 .48.26.64 1.56 1.1 2.28.8 2.98 1.48 2.98 3.04 0 2.06-1.7 3.52-4.1 3.52a4.8 4.8 0 0 1-3.72-1.62l1.42-1.68q1.15 1.15 2.32 1.16c.7 0 1.24-.46 1.24-1.08 0-.54-.22-.78-1.5-1.24-2.38-.84-2.86-1.48-2.86-2.9 0-1.9 1.54-3.12 3.5-3.12q1.8 0 3.2 1.04m2.43-.69h2.76v5.56q0 2.22 1.98 2.22 2 0 2-2.22v-5.56H64v6.02c0 2.62-1.7 4.08-4.74 4.08s-4.74-1.46-4.74-4.08zm18.8.68-1.35 1.6a2.7 2.7 0 0 0-1.62-.64c-.6 0-1.06.36-1.06.82 0 .48.26.64 1.56 1.1 2.28.8 2.98 1.48 2.98 3.04 0 2.06-1.7 3.52-4.1 3.52a4.8 4.8 0 0 1-3.72-1.62l1.42-1.68q1.15 1.15 2.32 1.16c.7 0 1.24-.46 1.24-1.08 0-.54-.22-.78-1.5-1.24-2.38-.84-2.86-1.48-2.86-2.9 0-1.9 1.54-3.12 3.5-3.12q1.8 0 3.2 1.04m2.45 1.68H74.7v-2.36h1.08v-3.34h2.76v3.34h1.92v2.36h-1.92v2.92c0 1.52.18 2.4 1.2 2.4q.28 0 .5-.04v2.4c-.3.04-.86.06-1.16.06-2.14 0-3.3-1.58-3.3-3.84zM90 27.23a2.76 2.76 0 0 0-2.74-2.76 2.7 2.7 0 0 0-2.74 2.74c0 1.52 1.2 2.74 2.74 2.74A2.8 2.8 0 0 0 90 27.23m-.3-3.66v-1.26h2.76v9.8H89.7v-1.28a3.9 3.9 0 0 1-3.2 1.58c-2.76 0-4.82-2.26-4.82-5.22 0-2.92 2.04-5.2 4.76-5.2q1.91.01 3.26 1.58m5.31-1.26h2.76v9.8h-2.76zm-.26-4.14c0-.9.74-1.64 1.64-1.64s1.64.74 1.64 1.64-.74 1.64-1.64 1.64-1.64-.74-1.64-1.64m5.58 13.94v-9.8h2.76v1.22a3.7 3.7 0 0 1 3.06-1.54c1.98 0 3.64 1.14 3.64 3.78v6.34h-2.76v-5.38c0-1.64-.46-2.4-1.86-2.4-1.38 0-2.08.86-2.08 2.7v5.08z\"\n fill=\"var(--sustain-accent-white)\"\n />\n </svg>\n );\n}\n\nexport default SustainLogo;\n"],"mappings":";;;;;;;;;AAqBA,SAAS,WAAW,KAA+C;CACjE,MA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AAC,QAAD;IACE,aAAU;IACV,aAAU;IACV,GAAE;IACF,MAAK;GACN,CAAA;GACD,oBAAC,QAAD;IACE,aAAU;IACV,aAAU;IACV,GAAE;IACF,MAAK;GACN,CAAA;GACD,oBAAC,QAAD;IACE,GAAE;IACF,MAAK;GACN,CAAA;EACE;;AAET"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
let react = require("react");
|
|
3
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
4
|
+
//#region src/contexts/theme-context.tsx
|
|
5
|
+
const ThemeContext = (0, react.createContext)(void 0);
|
|
6
|
+
function ThemeProvider({ children }) {
|
|
7
|
+
const [currentTheme, setCurrentTheme] = (0, react.useState)(() => {
|
|
8
|
+
if (typeof window === "undefined") return "slingshot";
|
|
9
|
+
return localStorage.getItem("ds-theme") ?? "slingshot";
|
|
10
|
+
});
|
|
11
|
+
const [themeMode, setThemeMode] = (0, react.useState)(() => {
|
|
12
|
+
if (typeof window === "undefined") return "light";
|
|
13
|
+
return localStorage.getItem("ds-theme-mode") ?? "light";
|
|
14
|
+
});
|
|
15
|
+
(0, react.useEffect)(() => {
|
|
16
|
+
const root = document.documentElement;
|
|
17
|
+
root.classList.remove("theme-slingshot", "theme-bodhi", "theme-sustain");
|
|
18
|
+
root.classList.remove("light", "dark");
|
|
19
|
+
root.classList.add(`theme-${currentTheme}`);
|
|
20
|
+
root.classList.add(themeMode);
|
|
21
|
+
if (typeof window !== "undefined") {
|
|
22
|
+
localStorage.setItem("ds-theme", currentTheme);
|
|
23
|
+
localStorage.setItem("ds-theme-mode", themeMode);
|
|
24
|
+
}
|
|
25
|
+
}, [currentTheme, themeMode]);
|
|
26
|
+
const setTheme = (0, react.useCallback)((theme) => {
|
|
27
|
+
setCurrentTheme(theme);
|
|
28
|
+
}, []);
|
|
29
|
+
const toggleMode = (0, react.useCallback)(() => {
|
|
30
|
+
setThemeMode((prev) => prev === "light" ? "dark" : "light");
|
|
31
|
+
}, []);
|
|
32
|
+
const isDarkMode = themeMode === "dark";
|
|
33
|
+
const value = (0, react.useMemo)(() => ({
|
|
34
|
+
currentTheme,
|
|
35
|
+
themeMode,
|
|
36
|
+
setTheme,
|
|
37
|
+
toggleMode,
|
|
38
|
+
isDarkMode
|
|
39
|
+
}), [
|
|
40
|
+
currentTheme,
|
|
41
|
+
themeMode,
|
|
42
|
+
setTheme,
|
|
43
|
+
toggleMode,
|
|
44
|
+
isDarkMode
|
|
45
|
+
]);
|
|
46
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ThemeContext.Provider, {
|
|
47
|
+
value,
|
|
48
|
+
children
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
function useTheme() {
|
|
52
|
+
const context = (0, react.useContext)(ThemeContext);
|
|
53
|
+
if (context === void 0) throw new Error("useTheme must be used within a ThemeProvider");
|
|
54
|
+
return context;
|
|
55
|
+
}
|
|
56
|
+
//#endregion
|
|
57
|
+
exports.ThemeProvider = ThemeProvider;
|
|
58
|
+
exports.useTheme = useTheme;
|
|
59
|
+
|
|
60
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","names":[],"sources":["../../src/contexts/theme-context.tsx"],"sourcesContent":["import {\n type ReactNode,\n createContext,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useState,\n} from \"react\";\n\nexport type ThemeName = \"slingshot\" | \"bodhi\" | \"sustain\";\nexport type ThemeMode = \"light\" | \"dark\";\n\ninterface ThemeContextType {\n currentTheme: ThemeName;\n themeMode: ThemeMode;\n setTheme: (theme: ThemeName) => void;\n toggleMode: () => void;\n isDarkMode: boolean;\n}\n\nconst ThemeContext = createContext<ThemeContextType | undefined>(undefined);\n\ninterface ThemeProviderProps {\n children: ReactNode;\n}\n\nexport function ThemeProvider({ children }: ThemeProviderProps) {\n // Lazily initialize from localStorage, falling back to defaults.\n // Note: first-paint theme flash is mitigated at the app level (anti-flash\n // inline <script> in the app's index.html), not here.\n const [currentTheme, setCurrentTheme] = useState<ThemeName>(() => {\n if (typeof window === \"undefined\") return \"slingshot\"; // Default theme - Slingshot\n return (localStorage.getItem(\"ds-theme\") as ThemeName | null) ?? \"slingshot\";\n });\n const [themeMode, setThemeMode] = useState<ThemeMode>(() => {\n if (typeof window === \"undefined\") return \"light\";\n return (localStorage.getItem(\"ds-theme-mode\") as ThemeMode | null) ?? \"light\";\n });\n\n useEffect(() => {\n // Apply theme and mode classes to document\n const root = document.documentElement;\n\n // Remove all theme classes\n root.classList.remove(\"theme-slingshot\", \"theme-bodhi\", \"theme-sustain\");\n root.classList.remove(\"light\", \"dark\");\n\n // Add current theme and mode classes (themeMode is already \"light\" or \"dark\")\n root.classList.add(`theme-${currentTheme}`);\n root.classList.add(themeMode);\n\n // Persist current theme and mode\n if (typeof window !== \"undefined\") {\n localStorage.setItem(\"ds-theme\", currentTheme);\n localStorage.setItem(\"ds-theme-mode\", themeMode);\n }\n }, [currentTheme, themeMode]);\n\n const setTheme = useCallback((theme: ThemeName) => {\n setCurrentTheme(theme);\n }, []);\n\n const toggleMode = useCallback(() => {\n setThemeMode((prev) => (prev === \"light\" ? \"dark\" : \"light\"));\n }, []);\n\n const isDarkMode = themeMode === \"dark\";\n\n const value = useMemo(\n () => ({\n currentTheme,\n themeMode,\n setTheme,\n toggleMode,\n isDarkMode,\n }),\n [currentTheme, themeMode, setTheme, toggleMode, isDarkMode],\n );\n\n return <ThemeContext.Provider value={value}>{children}</ThemeContext.Provider>;\n}\n\nexport function useTheme() {\n const context = useContext(ThemeContext);\n if (context === undefined) {\n throw new Error(\"useTheme must be used within a ThemeProvider\");\n }\n return context;\n}\n"],"mappings":";;;;AAqBA,MAAM,gBAAA,GAAA,MAAA,eAA2D,KAAA,CAAS;AAM1E,SAAgB,cAAc,EAAE,YAAgC;CAI9D,MAAM,CAAC,cAAc,oBAAA,GAAA,MAAA,gBAA6C;E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
|
3
|
+
|
|
4
|
+
//#region src/contexts/theme-context.d.ts
|
|
5
|
+
type ThemeName = "slingshot" | "bodhi" | "sustain";
|
|
6
|
+
type ThemeMode = "light" | "dark";
|
|
7
|
+
interface ThemeContextType {
|
|
8
|
+
currentTheme: ThemeName;
|
|
9
|
+
themeMode: ThemeMode;
|
|
10
|
+
setTheme: (theme: ThemeName) => void;
|
|
11
|
+
toggleMode: () => void;
|
|
12
|
+
isDarkMode: boolean;
|
|
13
|
+
}
|
|
14
|
+
interface ThemeProviderProps {
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
}
|
|
17
|
+
declare function ThemeProvider({
|
|
18
|
+
children
|
|
19
|
+
}: ThemeProviderProps): react_jsx_runtime0.JSX.Element;
|
|
20
|
+
declare function useTheme(): ThemeContextType;
|
|
21
|
+
//#endregion
|
|
22
|
+
export { ThemeMode, ThemeName, ThemeProvider, useTheme };
|
|
23
|
+
//# sourceMappingURL=index.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/contexts/theme-context.tsx"],"mappings":";;;;KAUY,SAAA;KACA,SAAA;UAEF,gBAAA;EAHE,YAAS,EAIL,SAJK;EACT,SAAA,EAIC,SAJQ;EAEX,QAAA,EAAA,CAAA,KAAA,EAGU,SAHM,EAAA,GAAA,IAAA;EAAA,UAAA,EAAA,GAAA,GAAA,IAAA;YACV,EAAA,OAAA;;UASN,kBAAA,CAPU;EAAS,QAAA,EAQjB,SARiB;AAAA;AAWb,iBAAA,aAAA,CAAa;EAAA;AAAA,CAAA,EAAe,kBAAf,CAAA,EAAiC,kBAAA,CAAA,GAAA,CAAA,OAAjC;AAAA,iBAwDb,QAAA,CAAA,CAxDa,EAwDL,gBAxDK"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/contexts/theme-context.d.ts
|
|
5
|
+
type ThemeName = "slingshot" | "bodhi" | "sustain";
|
|
6
|
+
type ThemeMode = "light" | "dark";
|
|
7
|
+
interface ThemeContextType {
|
|
8
|
+
currentTheme: ThemeName;
|
|
9
|
+
themeMode: ThemeMode;
|
|
10
|
+
setTheme: (theme: ThemeName) => void;
|
|
11
|
+
toggleMode: () => void;
|
|
12
|
+
isDarkMode: boolean;
|
|
13
|
+
}
|
|
14
|
+
interface ThemeProviderProps {
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
}
|
|
17
|
+
declare function ThemeProvider({
|
|
18
|
+
children
|
|
19
|
+
}: ThemeProviderProps): react_jsx_runtime0.JSX.Element;
|
|
20
|
+
declare function useTheme(): ThemeContextType;
|
|
21
|
+
//#endregion
|
|
22
|
+
export { ThemeMode, ThemeName, ThemeProvider, useTheme };
|
|
23
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/contexts/theme-context.tsx"],"mappings":";;;;KAUY,SAAA;KACA,SAAA;UAEF,gBAAA;EAHE,YAAS,EAIL,SAJK;EACT,SAAA,EAIC,SAJQ;EAEX,QAAA,EAAA,CAAA,KAAA,EAGU,SAHM,EAAA,GAAA,IAAA;EAAA,UAAA,EAAA,GAAA,GAAA,IAAA;YACV,EAAA,OAAA;;UASN,kBAAA,CAPU;EAAS,QAAA,EAQjB,SARiB;AAAA;AAWb,iBAAA,aAAA,CAAa;EAAA;AAAA,CAAA,EAAe,kBAAf,CAAA,EAAiC,kBAAA,CAAA,GAAA,CAAA,OAAjC;AAAA,iBAwDb,QAAA,CAAA,CAxDa,EAwDL,gBAxDK"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { createContext, useCallback, useContext, useEffect, useMemo, useState } from "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
//#region src/contexts/theme-context.tsx
|
|
4
|
+
const ThemeContext = createContext(void 0);
|
|
5
|
+
function ThemeProvider({ children }) {
|
|
6
|
+
const [currentTheme, setCurrentTheme] = useState(() => {
|
|
7
|
+
if (typeof window === "undefined") return "slingshot";
|
|
8
|
+
return localStorage.getItem("ds-theme") ?? "slingshot";
|
|
9
|
+
});
|
|
10
|
+
const [themeMode, setThemeMode] = useState(() => {
|
|
11
|
+
if (typeof window === "undefined") return "light";
|
|
12
|
+
return localStorage.getItem("ds-theme-mode") ?? "light";
|
|
13
|
+
});
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
const root = document.documentElement;
|
|
16
|
+
root.classList.remove("theme-slingshot", "theme-bodhi", "theme-sustain");
|
|
17
|
+
root.classList.remove("light", "dark");
|
|
18
|
+
root.classList.add(`theme-${currentTheme}`);
|
|
19
|
+
root.classList.add(themeMode);
|
|
20
|
+
if (typeof window !== "undefined") {
|
|
21
|
+
localStorage.setItem("ds-theme", currentTheme);
|
|
22
|
+
localStorage.setItem("ds-theme-mode", themeMode);
|
|
23
|
+
}
|
|
24
|
+
}, [currentTheme, themeMode]);
|
|
25
|
+
const setTheme = useCallback((theme) => {
|
|
26
|
+
setCurrentTheme(theme);
|
|
27
|
+
}, []);
|
|
28
|
+
const toggleMode = useCallback(() => {
|
|
29
|
+
setThemeMode((prev) => prev === "light" ? "dark" : "light");
|
|
30
|
+
}, []);
|
|
31
|
+
const isDarkMode = themeMode === "dark";
|
|
32
|
+
const value = useMemo(() => ({
|
|
33
|
+
currentTheme,
|
|
34
|
+
themeMode,
|
|
35
|
+
setTheme,
|
|
36
|
+
toggleMode,
|
|
37
|
+
isDarkMode
|
|
38
|
+
}), [
|
|
39
|
+
currentTheme,
|
|
40
|
+
themeMode,
|
|
41
|
+
setTheme,
|
|
42
|
+
toggleMode,
|
|
43
|
+
isDarkMode
|
|
44
|
+
]);
|
|
45
|
+
return /* @__PURE__ */ jsx(ThemeContext.Provider, {
|
|
46
|
+
value,
|
|
47
|
+
children
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
function useTheme() {
|
|
51
|
+
const context = useContext(ThemeContext);
|
|
52
|
+
if (context === void 0) throw new Error("useTheme must be used within a ThemeProvider");
|
|
53
|
+
return context;
|
|
54
|
+
}
|
|
55
|
+
//#endregion
|
|
56
|
+
export { ThemeProvider, useTheme };
|
|
57
|
+
|
|
58
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/contexts/theme-context.tsx"],"sourcesContent":["import {\n type ReactNode,\n createContext,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useState,\n} from \"react\";\n\nexport type ThemeName = \"slingshot\" | \"bodhi\" | \"sustain\";\nexport type ThemeMode = \"light\" | \"dark\";\n\ninterface ThemeContextType {\n currentTheme: ThemeName;\n themeMode: ThemeMode;\n setTheme: (theme: ThemeName) => void;\n toggleMode: () => void;\n isDarkMode: boolean;\n}\n\nconst ThemeContext = createContext<ThemeContextType | undefined>(undefined);\n\ninterface ThemeProviderProps {\n children: ReactNode;\n}\n\nexport function ThemeProvider({ children }: ThemeProviderProps) {\n // Lazily initialize from localStorage, falling back to defaults.\n // Note: first-paint theme flash is mitigated at the app level (anti-flash\n // inline <script> in the app's index.html), not here.\n const [currentTheme, setCurrentTheme] = useState<ThemeName>(() => {\n if (typeof window === \"undefined\") return \"slingshot\"; // Default theme - Slingshot\n return (localStorage.getItem(\"ds-theme\") as ThemeName | null) ?? \"slingshot\";\n });\n const [themeMode, setThemeMode] = useState<ThemeMode>(() => {\n if (typeof window === \"undefined\") return \"light\";\n return (localStorage.getItem(\"ds-theme-mode\") as ThemeMode | null) ?? \"light\";\n });\n\n useEffect(() => {\n // Apply theme and mode classes to document\n const root = document.documentElement;\n\n // Remove all theme classes\n root.classList.remove(\"theme-slingshot\", \"theme-bodhi\", \"theme-sustain\");\n root.classList.remove(\"light\", \"dark\");\n\n // Add current theme and mode classes (themeMode is already \"light\" or \"dark\")\n root.classList.add(`theme-${currentTheme}`);\n root.classList.add(themeMode);\n\n // Persist current theme and mode\n if (typeof window !== \"undefined\") {\n localStorage.setItem(\"ds-theme\", currentTheme);\n localStorage.setItem(\"ds-theme-mode\", themeMode);\n }\n }, [currentTheme, themeMode]);\n\n const setTheme = useCallback((theme: ThemeName) => {\n setCurrentTheme(theme);\n }, []);\n\n const toggleMode = useCallback(() => {\n setThemeMode((prev) => (prev === \"light\" ? \"dark\" : \"light\"));\n }, []);\n\n const isDarkMode = themeMode === \"dark\";\n\n const value = useMemo(\n () => ({\n currentTheme,\n themeMode,\n setTheme,\n toggleMode,\n isDarkMode,\n }),\n [currentTheme, themeMode, setTheme, toggleMode, isDarkMode],\n );\n\n return <ThemeContext.Provider value={value}>{children}</ThemeContext.Provider>;\n}\n\nexport function useTheme() {\n const context = useContext(ThemeContext);\n if (context === undefined) {\n throw new Error(\"useTheme must be used within a ThemeProvider\");\n }\n return context;\n}\n"],"mappings":";;;AAqBA,MAAM,eAAe,cAA4C,KAAA,CAAS;AAM1E,SAAgB,cAAc,EAAE,YAAgC;CAI9D,MAAM,CAAC,cAAc,mBAAmB,eAA0B;EAChE,IAAI,OAAO,WAAW,aAAa,OAAO;EAC1C,OAAQ,aAAa,QAAQ,UAAU,KAA0B;CACnE,CAAC;CACD,MAAM,CAAC,WAAW,gBAAgB,eAA0B;EAC1D,IAAI,OAAO,WAAW,aAAa,OAAO;EAC1C,OAAQ,aAAa,QAAQ,eAAe,KAA0B;CACxE,CAAC;CAED,gBAAgB;EAEd,MAAM,OAAO,SAAS;EAGtB,KAAK,UAAU,OAAO,mBAAmB,eAAe,eAAe;EACvE,KAAK,UAAU,OAAO,SAAS,MAAM;EAGrC,KAAK,UAAU,IAAI,SAAS,cAAc;EAC1C,KAAK,UAAU,IAAI,SAAS;EAG5B,IAAI,OAAO,WAAW,aAAa;GACjC,aAAa,QAAQ,YAAY,YAAY;GAC7C,aAAa,QAAQ,iBAAiB,SAAS;EACjD;CACF,GAAG,CAAC,cAAc,SAAS,CAAC;CAE5B,MAAM,WAAW,aAAa,UAAqB;EACjD,gBAAgB,KAAK;CACvB,GAAG,CAAC,CAAC;CAEL,MAAM,aAAa,kBAAkB;EACnC,cAAc,SAAU,SAAS,UAAU,SAAS,OAAQ;CAC9D,GAAG,CAAC,CAAC;CAEL,MAAM,aAAa,cAAc;CAEjC,MAAM,QAAQ,eACL;EACL;EACA;EACA;EACA;EACA;CACF,IACA;EAAC;EAAc;EAAW;EAAU;EAAY;CAAU,CAC5D;CAEA,OAAO,oBAAC,aAAa,UAAd;EAA8B;EAAQ;CAAgC,CAAA;AAC/E;AAEA,SAAgB,WAAW;CACzB,MAAM,UAAU,WAAW,YAAY;CACvC,IAAI,YAAY,KAAA,GACd,MAAM,IAAI,MAAM,8CAA8C;CAEhE,OAAO;AACT"}
|