@gobolt/genesis 0.3.1 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -74920,27 +74920,423 @@ const Message$1 = ({ message: message2, handle, isThinking = false }) => {
74920
74920
  const isBot = handle === "bot";
74921
74921
  return /* @__PURE__ */ jsxRuntime.jsxs(MessageContainer, { $isBot: isBot, children: [
74922
74922
  /* @__PURE__ */ jsxRuntime.jsx(IconContainer, { children: isBot ? /* @__PURE__ */ jsxRuntime.jsx(BotIcon, {}) : /* @__PURE__ */ jsxRuntime.jsx(UserIcon, {}) }),
74923
- /* @__PURE__ */ jsxRuntime.jsx(TextContainer, { $isBot: isBot, children: isThinking ? /* @__PURE__ */ jsxRuntime.jsx(ThinkingIndicator, {}) : handle === "bot" ? /* @__PURE__ */ jsxRuntime.jsx(
74924
- Markdown,
74923
+ /* @__PURE__ */ jsxRuntime.jsx(TextContainer, { $isBot: isBot, children: isThinking ? /* @__PURE__ */ jsxRuntime.jsx(ThinkingIndicator, {}) : handle === "bot" ? /* @__PURE__ */ jsxRuntime.jsx(Markdown, { children: message2 }) : /* @__PURE__ */ jsxRuntime.jsx(MessageText, { children: message2 }) })
74924
+ ] });
74925
+ };
74926
+ const getStateColors = (colors2, type4, state) => {
74927
+ const filled = {
74928
+ color: colors2.inputs.onsurface.active,
74929
+ borderColor: colors2[TYPE.secondary].active.borderColor,
74930
+ ringColor: colors2[type4].focussed.ringColor
74931
+ };
74932
+ const success = {
74933
+ color: colors2.status.success.default,
74934
+ borderColor: colors2.status.success.default,
74935
+ ringColor: colors2.status.success.ringColor
74936
+ };
74937
+ const error2 = {
74938
+ color: colors2.status.error.default,
74939
+ borderColor: colors2.status.error.default,
74940
+ ringColor: colors2.status.error.ringColor
74941
+ };
74942
+ const themeState = state !== STATE.error && state !== STATE.success && state !== STATE.filled ? {
74943
+ color: colors2.inputs.onsurface.active,
74944
+ backgroundColor: colors2.inputs.surface.active,
74945
+ borderColor: colors2.inputs.surface.border,
74946
+ ringColor: colors2[type4][state].ringColor
74947
+ } : null;
74948
+ const stateMap = {
74949
+ filled,
74950
+ error: error2,
74951
+ success,
74952
+ themeState
74953
+ };
74954
+ const getValidKey = (state2) => {
74955
+ const validStates = [STATE.filled, STATE.error, STATE.success];
74956
+ return validStates.includes(state2) ? state2 : "themeState";
74957
+ };
74958
+ const css = stateMap[getValidKey(state)];
74959
+ return css;
74960
+ };
74961
+ const getGenesisInputClass = ({ colors: colors2, borderRadius: borderRadius2, components: components2, shadows: shadows2 }, type4, state, hasBeforeAddon, hasAfterAddon, size) => {
74962
+ const stateColors = getStateColors(colors2, type4, state);
74963
+ const getBorderRadius = (hasBeforeAddon2, hasAfterAddon2) => {
74964
+ if (hasAfterAddon2 && !hasBeforeAddon2) {
74965
+ return `${borderRadius2.BorderRadiusMd}px 0px 0px ${borderRadius2.BorderRadiusMd}px`;
74966
+ }
74967
+ if (hasBeforeAddon2 && !hasAfterAddon2) {
74968
+ return `0px ${borderRadius2.BorderRadiusMd}px ${borderRadius2.BorderRadiusMd}px 0px`;
74969
+ }
74970
+ return `0px`;
74971
+ };
74972
+ return `
74973
+ &.ant-input {
74974
+ font-family: 'Inter', sans-serif;
74975
+ color: ${stateColors.color};
74976
+ border-color: ${stateColors.borderColor};
74977
+ box-shadow: ${shadows2.inputs[1]} !important;
74978
+ height: ${size === "normal" || size === "large" ? "40px" : "32px"} !important;
74979
+ }
74980
+
74981
+ /* Increase specificity for focus states */
74982
+ &.ant-input.ant-input:focus,
74983
+ &.ant-input.ant-input:focus-visible,
74984
+ &.ant-input.ant-input-focused {
74985
+ outline: none !important;
74986
+ border-color: ${colors2[type4].focussed.borderColor} !important;
74987
+ box-shadow: 0 0 0 1px #fff, 0 0 0 3px ${colors2[type4].focussed.ringColor} !important;
74988
+ }
74989
+
74990
+ &.ant-input-outlined {
74991
+ border: 1px solid ${stateColors.borderColor};
74992
+
74993
+ &:hover {
74994
+ border-color: ${stateColors.borderColor};
74995
+ }
74996
+ }
74997
+
74998
+ .ant-input-group & {
74999
+ &:focus-within {
75000
+ outline: none;
75001
+ color: ${stateColors.color};
75002
+ box-shadow: none;
75003
+ border-color: ${colors2[type4].focussed.borderColor};
75004
+ }
75005
+ }
75006
+
75007
+ .ant-input-group:focus-within {
75008
+ outline: none;
75009
+ box-shadow: 0 0 0 1px #fff, 0 0 0 3px ${colors2[type4].focussed.ringColor};
75010
+ border-radius: ${borderRadius2.BorderRadiusMd}px;
75011
+ transition: box-shadow 0.2s ease-in-out;
75012
+
75013
+ /* Hide focus styles on inner input when parent is focused */
75014
+ .ant-input:focus-within {
75015
+ box-shadow: none;
75016
+ border-radius: 0;
75017
+ border-radius: ${getBorderRadius(hasBeforeAddon, hasAfterAddon)};
75018
+ border-color: #ddd;
75019
+ }
75020
+ }
75021
+
75022
+ /* Remove inner input focus styles when in a group */
75023
+ .ant-input-group .ant-input:focus,
75024
+ .ant-input-group .ant-input:focus-visible,
75025
+ .ant-input-group .ant-input:focus-within {
75026
+ outline: none;
75027
+ box-shadow: none;
75028
+ border-color: ${colors2[type4].focussed.borderColor};
75029
+ }
75030
+
75031
+ /* Single focus ring on group */
75032
+ .ant-input-group:focus-within {
75033
+ outline: none;
75034
+ box-shadow: 0 0 0 1px #fff, 0 0 0 3px ${colors2[type4].focussed.ringColor};
75035
+ border-radius: ${borderRadius2.BorderRadiusMd}px;
75036
+ transition: box-shadow 0.2s ease-in-out;
75037
+ }
75038
+
75039
+ /* Remove focus styles for standalone inputs */
75040
+ &:not(.ant-input-group):focus-visible {
75041
+ outline: none;
75042
+ color: ${stateColors.color};
75043
+ box-shadow: 0 0 0 1px #fff, 0 0 0 3px ${colors2[type4].focussed.ringColor};
75044
+ border-radius: ${borderRadius2.BorderRadiusMd}px;
75045
+ border-color: ${colors2[type4].focussed.borderColor};
75046
+ transition: box-shadow 0.2s ease-in-out;
75047
+ }
75048
+
75049
+ &:not(.ant-input-group .ant-input):focus-visible {
75050
+ outline: none;
75051
+ color: ${stateColors.color};
75052
+ box-shadow: 0 0 0 1px #fff, 0 0 0 3px ${colors2[type4].focussed.ringColor};
75053
+ border-radius: ${borderRadius2.BorderRadiusMd}px;
75054
+ border-color: ${colors2[type4].focussed.borderColor};
75055
+ transition: box-shadow 0.2s ease-in-out;
75056
+ }
75057
+
75058
+ &.ant-input-group-wrapper {
75059
+ .ant-input-group {
75060
+ display: flex;
75061
+ align-items: center;
75062
+ height: ${size === "normal" || size === "large" ? "40px" : "32px"};
75063
+
75064
+ .ant-input {
75065
+ height: 100% !important;
75066
+ }
75067
+
75068
+ .ant-input-group-addon {
75069
+ padding: 0 ${components2.input.suffixPrefixHorPadding};
75070
+ height: 100%;
75071
+ display: flex;
75072
+ align-items: center;
75073
+ min-width: fit-content;
75074
+ width: auto;
75075
+
75076
+ > * {
75077
+ width: 100%;
75078
+ }
75079
+
75080
+ .ant-select {
75081
+ height: 100%;
75082
+
75083
+ .ant-select-selector {
75084
+ height: 100%;
75085
+ display: flex;
75086
+ align-items: center;
75087
+ }
75088
+ }
75089
+ }
75090
+ }
75091
+ }
75092
+ `;
75093
+ };
75094
+ const Input$1 = styled(Input$2)`
75095
+ ${({ theme, state, type: type4 = TYPE.primary, size = "normal", ...rest }) => {
75096
+ const hasBeforeAddon = !!rest.addonBefore;
75097
+ const hasAfterAddon = !!rest.addonAfter;
75098
+ return getGenesisInputClass(
75099
+ theme,
75100
+ type4,
75101
+ state,
75102
+ hasBeforeAddon,
75103
+ hasAfterAddon,
75104
+ size
75105
+ );
75106
+ }}
75107
+ `;
75108
+ const DropdownChevron = (properties) => {
75109
+ const { theme } = useGenesis();
75110
+ return /* @__PURE__ */ jsxRuntime.jsx(
75111
+ "svg",
75112
+ {
75113
+ xmlns: "http://www.w3.org/2000/svg",
75114
+ width: 20,
75115
+ height: 20,
75116
+ fill: "none",
75117
+ ...properties,
75118
+ children: /* @__PURE__ */ jsxRuntime.jsx(
75119
+ "path",
75120
+ {
75121
+ fill: "#222",
75122
+ fillRule: "evenodd",
75123
+ d: "M5.293 7.293a1 1 0 0 1 1.414 0L10 10.586l3.293-3.293a1 1 0 1 1 1.414 1.414l-4 4a1 1 0 0 1-1.414 0l-4-4a1 1 0 0 1 0-1.414Z",
75124
+ clipRule: "evenodd"
75125
+ }
75126
+ )
75127
+ }
75128
+ );
75129
+ };
75130
+ const Input2 = ({
75131
+ state = STATE.active,
75132
+ size = "normal",
75133
+ onChange,
75134
+ value: value2,
75135
+ ...rest
75136
+ }) => {
75137
+ const { type: type4, ...validRest } = rest;
75138
+ const addonAfter = React.isValidElement(rest.addonAfter) && rest.addonAfter.type === Select$1 ? React.cloneElement(rest.addonAfter, {
75139
+ suffixIcon: /* @__PURE__ */ jsxRuntime.jsx(DropdownChevron, {})
75140
+ }) : rest.addonAfter;
75141
+ const handleChange = React.useCallback(
75142
+ (e2) => {
75143
+ if (onChange) {
75144
+ onChange({
75145
+ event: "inputChange",
75146
+ payload: {
75147
+ value: e2.target.value
75148
+ }
75149
+ });
75150
+ }
75151
+ },
75152
+ [onChange]
75153
+ );
75154
+ return /* @__PURE__ */ jsxRuntime.jsx(
75155
+ Input$1,
75156
+ {
75157
+ ...validRest,
75158
+ size,
75159
+ state,
75160
+ disabled: state === "disabled" || rest.disabled,
75161
+ addonAfter,
75162
+ style: {
75163
+ height: size === "normal" || size === "large" ? "40px" : "32px"
75164
+ },
75165
+ onChange: handleChange,
75166
+ value: value2
75167
+ }
75168
+ );
75169
+ };
75170
+ const getVariant = (typography2, variant, breakpoint) => {
75171
+ return `
75172
+ font-size: ${typography2[breakpoint][variant].fontSize}px !important;
75173
+ line-height: ${typography2[breakpoint][variant].lineHeight};
75174
+ letter-spacing: ${typography2[breakpoint][variant].letterSpacing}px;
75175
+ font-weight: ${typography2[breakpoint][variant].fontWeight};
75176
+ `;
75177
+ };
75178
+ const getColor = (color2, colors2, $themeType) => {
75179
+ if (color2) {
75180
+ return color2;
75181
+ }
75182
+ return colors2[$themeType].active.color;
75183
+ };
75184
+ const getFontFamily = (variant) => {
75185
+ return `
75186
+ ${variant.includes("digits") ? "'Roboto Mono', sans-serif" : "'Inter', sans-serif"} !important;
75187
+ `;
75188
+ };
75189
+ const getGenesisTypographyClass = ({ colors: colors2, typography: typography2 }, $themeType, variant, state, breakpoint, color2, $isFullWidth) => `
75190
+ &.ant-typography {
75191
+ font-family: ${getFontFamily(variant)};
75192
+ color: ${getColor(color2, colors2, $themeType)} !important;
75193
+ ${getVariant(typography2, variant, breakpoint)}
75194
+ margin-bottom: 0 !important;
75195
+ width: ${$isFullWidth ? "100%" : "auto"};
75196
+ line-height: 1;
75197
+
75198
+ &:disabled {
75199
+ color: ${colors2.status.disabled.default} !important;
75200
+ userSelect: none;
75201
+ cursor: not-allowed;
75202
+ }
75203
+ }
75204
+ `;
75205
+ const Headline = styled(Typography$1.Title)`
75206
+ ${({
75207
+ theme,
75208
+ $themeType,
75209
+ variant,
75210
+ state,
75211
+ breakpoint,
75212
+ color: color2,
75213
+ $isFullWidth
75214
+ }) => {
75215
+ return getGenesisTypographyClass(
75216
+ theme,
75217
+ $themeType,
75218
+ variant,
75219
+ state,
75220
+ breakpoint,
75221
+ color2,
75222
+ $isFullWidth
75223
+ );
75224
+ }}
75225
+ `;
75226
+ const Paragraph = styled(
75227
+ Typography$1.Paragraph
75228
+ )`
75229
+ ${({
75230
+ theme,
75231
+ $themeType,
75232
+ variant,
75233
+ state,
75234
+ breakpoint,
75235
+ color: color2,
75236
+ $isFullWidth
75237
+ }) => {
75238
+ return getGenesisTypographyClass(
75239
+ theme,
75240
+ $themeType,
75241
+ variant,
75242
+ state,
75243
+ breakpoint,
75244
+ color2,
75245
+ $isFullWidth
75246
+ );
75247
+ }}
75248
+ `;
75249
+ const Text = styled(Typography$1.Text)`
75250
+ ${({
75251
+ theme,
75252
+ $themeType,
75253
+ variant,
75254
+ state,
75255
+ breakpoint,
75256
+ color: color2,
75257
+ $isFullWidth
75258
+ }) => {
75259
+ return getGenesisTypographyClass(
75260
+ theme,
75261
+ $themeType,
75262
+ variant,
75263
+ state,
75264
+ breakpoint,
75265
+ color2,
75266
+ $isFullWidth
75267
+ );
75268
+ }}
75269
+ `;
75270
+ const Typography = ({
75271
+ children,
75272
+ themeType = TYPE.secondary,
75273
+ variant = TYPOGRAPHY_VARIANT.body1,
75274
+ state = STATE.active,
75275
+ color: color2,
75276
+ isText = false,
75277
+ isFullWidth,
75278
+ style: style2,
75279
+ isDisabled,
75280
+ ...rest
75281
+ }) => {
75282
+ const { breakpoint } = useGenesis();
75283
+ if (variant.startsWith("display") || variant.startsWith("heading")) {
75284
+ const level = variant.split("heading")[1] || variant.split("display")[1];
75285
+ return /* @__PURE__ */ jsxRuntime.jsx(
75286
+ Headline,
74925
75287
  {
74926
- components: {
74927
- p: ({ children }) => /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mb-2 last:mb-0", children }),
74928
- ul: ({ children }) => /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "list-disc pl-4 mb-2", children }),
74929
- ol: ({ children }) => /* @__PURE__ */ jsxRuntime.jsx("ol", { className: "list-decimal pl-4 mb-2", children }),
74930
- li: ({ children }) => /* @__PURE__ */ jsxRuntime.jsx("li", { className: "mb-1", children }),
74931
- code: ({ children }) => /* @__PURE__ */ jsxRuntime.jsx("code", { className: "bg-gray-200 rounded px-1 py-0.5", children }),
74932
- pre: ({ children }) => /* @__PURE__ */ jsxRuntime.jsx("pre", { className: "bg-gray-200 rounded p-2 mb-2 overflow-x-auto", children })
74933
- },
74934
- children: message2
75288
+ state,
75289
+ $themeType: themeType,
75290
+ variant,
75291
+ breakpoint,
75292
+ color: color2,
75293
+ level: Number.parseInt(level),
75294
+ $isFullWidth: isFullWidth,
75295
+ style: style2,
75296
+ disabled: isDisabled,
75297
+ ...rest,
75298
+ children
74935
75299
  }
74936
- ) : /* @__PURE__ */ jsxRuntime.jsx(MessageText, { children: message2 }) })
74937
- ] });
75300
+ );
75301
+ }
75302
+ if (isText) {
75303
+ return /* @__PURE__ */ jsxRuntime.jsx(
75304
+ Text,
75305
+ {
75306
+ state,
75307
+ $themeType: themeType,
75308
+ variant,
75309
+ breakpoint,
75310
+ color: color2,
75311
+ $isFullWidth: isFullWidth,
75312
+ style: style2,
75313
+ disabled: isDisabled,
75314
+ ...rest,
75315
+ children
75316
+ }
75317
+ );
75318
+ }
75319
+ return /* @__PURE__ */ jsxRuntime.jsx(
75320
+ Paragraph,
75321
+ {
75322
+ state,
75323
+ $themeType: themeType,
75324
+ variant,
75325
+ breakpoint,
75326
+ color: color2,
75327
+ $isFullWidth: isFullWidth,
75328
+ style: style2,
75329
+ disabled: isDisabled,
75330
+ ...rest,
75331
+ children
75332
+ }
75333
+ );
74938
75334
  };
74939
75335
  const ChatContainer = styled.div`
74940
75336
  display: flex;
74941
75337
  flex-direction: column;
74942
75338
  position: relative;
74943
- width: 540px;
75339
+ width: 600px;
74944
75340
  overflow: hidden;
74945
75341
  `;
74946
75342
  const HeroContainer = styled.div`
@@ -75004,21 +75400,40 @@ const Chat = ({
75004
75400
  const [isLocked, setIsLocked] = React.useState(false);
75005
75401
  React.useEffect(() => {
75006
75402
  if (isSimulated) return;
75007
- console.log("Connecting to socket server at:", socketUrl);
75008
- socketRef.current = lookup(socketUrl, {
75009
- extraHeaders: {
75010
- "Access-Control-Allow-Origin": "*"
75011
- }
75403
+ const socketUrlToUse = window.location.hostname === "localhost" && window.location.port === "6006" ? "http://localhost:3000" : socketUrl;
75404
+ console.log("Connecting to socket server at:", socketUrlToUse);
75405
+ socketRef.current = lookup(socketUrlToUse, {
75406
+ transports: ["polling", "websocket"],
75407
+ reconnection: true,
75408
+ reconnectionAttempts: 5,
75409
+ reconnectionDelay: 1e3,
75410
+ withCredentials: true,
75411
+ forceNew: true,
75412
+ autoConnect: true,
75413
+ timeout: 1e4
75012
75414
  });
75013
75415
  const socket = socketRef.current;
75014
75416
  socket.on("connect", () => {
75015
75417
  console.log("Socket connected successfully");
75418
+ setServerError("");
75419
+ setServerStatus("ready");
75420
+ serverReadyRef.current = true;
75016
75421
  });
75017
75422
  socket.on("connect_error", (error2) => {
75018
75423
  console.error("Socket connection error:", error2);
75019
- setServerError("Failed to connect to server");
75424
+ setServerError(`Connection error: ${error2.message}`);
75020
75425
  setServerStatus("error");
75021
75426
  serverReadyRef.current = false;
75427
+ setMessages((prev2) => prev2.filter((msg) => !msg.isThinking));
75428
+ setIsLocked(false);
75429
+ });
75430
+ socket.on("disconnect", (reason) => {
75431
+ console.log("Socket disconnected:", reason);
75432
+ setServerError(`Disconnected: ${reason}`);
75433
+ setServerStatus("error");
75434
+ serverReadyRef.current = false;
75435
+ setMessages((prev2) => prev2.filter((msg) => !msg.isThinking));
75436
+ setIsLocked(false);
75022
75437
  });
75023
75438
  socket.on("new connection", () => {
75024
75439
  console.log("New connection established");
@@ -75032,16 +75447,20 @@ const Chat = ({
75032
75447
  socket.on("message", (newMessage) => {
75033
75448
  setMessages((prev2) => {
75034
75449
  if (newMessage.sender === "bot") {
75035
- let replaced = false;
75036
- const updated = prev2.map((msg) => {
75037
- if (msg.isThinking && !replaced) {
75038
- replaced = true;
75039
- return { ...newMessage, isThinking: false };
75450
+ if (newMessage.content === "Processing your message...") {
75451
+ const hasThinkingMessage = prev2.some((msg) => msg.isThinking);
75452
+ if (hasThinkingMessage) {
75453
+ return prev2;
75040
75454
  }
75041
- return msg;
75042
- });
75043
- setIsLocked(false);
75044
- return replaced ? updated : [...prev2, newMessage];
75455
+ return [...prev2, { ...newMessage, isThinking: true }];
75456
+ }
75457
+ const thinkingMessage = prev2.find((msg) => msg.isThinking);
75458
+ if (thinkingMessage) {
75459
+ return prev2.map(
75460
+ (msg) => msg.isThinking ? { ...newMessage, isThinking: false } : msg
75461
+ );
75462
+ }
75463
+ return [...prev2, { ...newMessage, isThinking: false }];
75045
75464
  }
75046
75465
  const lastUserMsg = [...prev2].reverse().find((msg) => msg.sender === "user");
75047
75466
  if (lastUserMsg && lastUserMsg.content === newMessage.content) {
@@ -75049,6 +75468,7 @@ const Chat = ({
75049
75468
  }
75050
75469
  return [...prev2, newMessage];
75051
75470
  });
75471
+ setIsLocked(false);
75052
75472
  });
75053
75473
  socket.on("update-bot-message", (updatedData) => {
75054
75474
  console.log("Received bot message update:", updatedData);
@@ -75068,8 +75488,10 @@ const Chat = ({
75068
75488
  const timeoutId = setTimeout(() => {
75069
75489
  if (!serverReadyRef.current) {
75070
75490
  console.log("Server status check failed");
75071
- setServerError("Please check the server");
75491
+ setServerError("Server status check failed - please check the server");
75072
75492
  setServerStatus("error");
75493
+ setMessages((prev2) => prev2.filter((msg) => !msg.isThinking));
75494
+ setIsLocked(false);
75073
75495
  }
75074
75496
  }, 2e3);
75075
75497
  return () => {
@@ -75096,41 +75518,48 @@ const Chat = ({
75096
75518
  }
75097
75519
  };
75098
75520
  const sendMessage = () => {
75099
- var _a;
75521
+ var _a, _b;
75100
75522
  if (!message2.trim() || isLocked) return;
75523
+ const timestamp = Date.now();
75101
75524
  const userMessage = {
75102
75525
  content: message2,
75103
75526
  sender: handle,
75104
- id: `id_${Date.now()}`,
75105
- timestamp: (/* @__PURE__ */ new Date()).toISOString()
75106
- };
75107
- const thinkingMessage = {
75108
- content: "",
75109
- sender: "bot",
75110
- id: `id_${Date.now()}_thinking`,
75111
- isThinking: true,
75527
+ id: `user_${timestamp}_${Math.random().toString(36).substr(2, 9)}`,
75112
75528
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
75113
75529
  };
75114
75530
  setIsLocked(true);
75115
- setMessages((prev2) => [...prev2, thinkingMessage]);
75116
- if (!((_a = socketRef.current) == null ? void 0 : _a.connected)) {
75531
+ setMessages((prev2) => [...prev2, userMessage]);
75532
+ if ((_a = socketRef.current) == null ? void 0 : _a.connected) {
75533
+ const botMessageId = `bot_${timestamp}`;
75534
+ const thinkingMessage = {
75535
+ content: "",
75536
+ sender: "bot",
75537
+ id: botMessageId,
75538
+ isThinking: true,
75539
+ timestamp: (/* @__PURE__ */ new Date()).toISOString()
75540
+ };
75541
+ setMessages((prev2) => [...prev2, thinkingMessage]);
75542
+ }
75543
+ if (!((_b = socketRef.current) == null ? void 0 : _b.connected)) {
75117
75544
  setServerError("Not connected to server");
75118
75545
  setIsLocked(false);
75119
75546
  return;
75120
75547
  }
75121
- socketRef.current.emit("message", userMessage);
75122
- setTimeout(() => {
75123
- setMessages(
75124
- (prev2) => prev2.map(
75125
- (msg) => msg.isThinking ? { ...msg, content: "Processing your message..." } : msg
75126
- )
75127
- );
75128
- }, 300);
75129
- setTimeout(() => {
75130
- setMessages((prev2) => prev2.filter((msg) => !msg.isThinking));
75131
- setServerError("No response from server");
75132
- setIsLocked(false);
75133
- }, 1e4);
75548
+ socketRef.current.emit("message", userMessage);
75549
+ if (socketRef.current.connected) {
75550
+ setTimeout(() => {
75551
+ setMessages(
75552
+ (prev2) => prev2.map(
75553
+ (msg) => msg.isThinking ? { ...msg, content: "Processing your message..." } : msg
75554
+ )
75555
+ );
75556
+ }, 300);
75557
+ setTimeout(() => {
75558
+ setMessages((prev2) => prev2.filter((msg) => !msg.isThinking));
75559
+ setServerError("No response from server");
75560
+ setIsLocked(false);
75561
+ }, 1e4);
75562
+ }
75134
75563
  setMessage("");
75135
75564
  };
75136
75565
  const toggleChat = () => {
@@ -75139,15 +75568,22 @@ const Chat = ({
75139
75568
  const handleInputChange = (e2) => {
75140
75569
  setMessage(e2.payload.value);
75141
75570
  };
75571
+ if (serverStatus === "error") {
75572
+ return /* @__PURE__ */ jsxRuntime.jsx(ErrorMessage, { children: "Network error" });
75573
+ }
75574
+ const uniqueMessages = messages2.filter(
75575
+ (msg, index2, self2) => index2 === self2.findIndex((t2) => t2.id === msg.id)
75576
+ );
75577
+ console.log("uniqueMessages", uniqueMessages);
75142
75578
  return /* @__PURE__ */ jsxRuntime.jsxs(ChatContainer, { children: [
75143
75579
  /* @__PURE__ */ jsxRuntime.jsx(HeroContainer, { $isVisible: !isChatOpen, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
75144
- title && /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "heading3", children: title }),
75580
+ title ? /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "heading3", children: title }) : null,
75145
75581
  /* @__PURE__ */ jsxRuntime.jsx(Subtitle, { children: "Click the Chat Icon below to begin" }),
75146
- serverError && /* @__PURE__ */ jsxRuntime.jsx(ErrorMessage, { children: serverError })
75582
+ serverError ? /* @__PURE__ */ jsxRuntime.jsx(ErrorMessage, { children: serverError }) : null
75147
75583
  ] }) }),
75148
75584
  isChatOpen ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
75149
- /* @__PURE__ */ jsxRuntime.jsx(HeroContainer, { $isVisible: true, children: /* @__PURE__ */ jsxRuntime.jsx("div", { children: title && /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "heading2", children: title }) }) }),
75150
- /* @__PURE__ */ jsxRuntime.jsx(MessageList, { ref: messageListRef, children: messages2.map((msg) => /* @__PURE__ */ jsxRuntime.jsx(
75585
+ /* @__PURE__ */ jsxRuntime.jsx(HeroContainer, { $isVisible: true, children: /* @__PURE__ */ jsxRuntime.jsx("div", { children: title ? /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "heading2", children: title }) : null }) }),
75586
+ /* @__PURE__ */ jsxRuntime.jsx(MessageList, { ref: messageListRef, children: uniqueMessages.map((msg) => /* @__PURE__ */ jsxRuntime.jsx(
75151
75587
  Message$1,
75152
75588
  {
75153
75589
  message: msg.content,
@@ -75300,305 +75736,61 @@ const Form$1 = styled(Form$2)`
75300
75736
  const FormItem = Form$1.Item;
75301
75737
  const Form2 = Object.assign(
75302
75738
  ({ children, ...properties }) => {
75303
- const { breakpoint } = useGenesis();
75304
- return /* @__PURE__ */ jsxRuntime.jsx(Form$1, { role: "form", ...properties, children });
75305
- },
75306
- {
75307
- Item: FormItem,
75308
- useForm: Form$1.useForm
75309
- }
75310
- );
75311
- const Outline = (properties) => /* @__PURE__ */ jsxRuntime.jsxs(
75312
- "svg",
75313
- {
75314
- xmlns: "http://www.w3.org/2000/svg",
75315
- width: 24,
75316
- height: 24,
75317
- fill: "none",
75318
- ...properties,
75319
- children: [
75320
- /* @__PURE__ */ jsxRuntime.jsx(
75321
- "path",
75322
- {
75323
- fill: "#101010",
75324
- d: "M12.6 15.383a2.47 2.47 0 0 1 .18-.926c.054-.139.123-.278.207-.419.086-.143.173-.272.261-.39.09-.119.194-.24.314-.366.119-.127.231-.24.336-.34a17.157 17.157 0 0 1 1.087-.9c.034-.024.059-.044.076-.058.317-.246.552-.522.707-.829.154-.306.231-.616.231-.928 0-.413-.11-.73-.331-.953-.219-.224-.538-.336-.958-.336-.184 0-.372.043-.566.131a1.404 1.404 0 0 0-.48.346.89.89 0 0 1 .577.31.9.9 0 0 1 .235.619c0 .26-.092.481-.276.665a.901.901 0 0 1-.662.272.922.922 0 0 1-.84-.521 1.49 1.49 0 0 1-.177-.71c0-.204.04-.406.118-.606.078-.199.194-.384.348-.556.155-.174.337-.327.548-.46.211-.133.458-.238.741-.314.284-.076.584-.114.903-.114.396 0 .755.04 1.075.12.322.078.59.185.803.32.213.132.39.29.533.474.142.182.245.372.308.571.062.198.093.406.093.624 0 .213-.023.414-.07.604a2.076 2.076 0 0 1-.463.908 2.718 2.718 0 0 1-.346.343 5.695 5.695 0 0 1-.392.296 8.39 8.39 0 0 1-.407.266c-.125.075-.262.16-.41.255-.147.094-.271.18-.373.258a9.965 9.965 0 0 1-.369.264 34.1 34.1 0 0 0-.334.234c-.08.057-.17.133-.272.229-.1.095-.19.2-.273.313.223-.068.444-.102.662-.102h1.524a.307.307 0 0 0 .22-.094.617.617 0 0 0 .146-.246c.035-.1.06-.2.076-.302.018-.102.026-.2.026-.296v-.469h1.055v2.813h-5.39ZM7.418 9.611 7.216 11.1c.326-.102.68-.18 1.063-.232.385-.055.715-.082.99-.082.374 0 .702.058.985.173.283.113.513.275.688.486.176.211.308.46.396.747.088.285.132.607.132.964a2.168 2.168 0 0 1-.404 1.28c-.143.208-.32.39-.53.545a2.6 2.6 0 0 1-.804.375 3.77 3.77 0 0 1-1.075.144 3.46 3.46 0 0 1-.902-.114 2.57 2.57 0 0 1-1.29-.77 1.869 1.869 0 0 1-.348-.56A1.649 1.649 0 0 1 6 13.449c0-.252.059-.488.176-.709a.915.915 0 0 1 .343-.378.909.909 0 0 1 .498-.143c.26 0 .48.091.662.275a.897.897 0 0 1 .275.662.911.911 0 0 1-.234.621.895.895 0 0 1-.577.308c.128.144.289.26.48.349.193.086.382.129.565.129.42 0 .74-.112.958-.335.221-.224.332-.543.332-.955 0-.529-.11-.907-.332-1.133-.22-.227-.6-.34-1.136-.34-.242 0-.534.022-.876.067l-.938-.234.041-.024.48-3.492h.886c.039.01.14.037.301.082.164.043.279.072.343.085a5.676 5.676 0 0 0 .879.067c.824 0 1.527-.078 2.11-.234l.116.352a2.005 2.005 0 0 1-.36.662 1.748 1.748 0 0 1-.539.44 2.544 2.544 0 0 1-.63.23 3.194 3.194 0 0 1-.697.074c-.76 0-1.33-.088-1.708-.264Z"
75325
- }
75326
- ),
75327
- /* @__PURE__ */ jsxRuntime.jsx(
75328
- "path",
75329
- {
75330
- fill: "#101010",
75331
- fillRule: "evenodd",
75332
- d: "M19 6H5a1 1 0 0 0-1 1v9a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1ZM5 4a3 3 0 0 0-3 3v9a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3V7a3 3 0 0 0-3-3H5Z",
75333
- clipRule: "evenodd"
75334
- }
75335
- )
75336
- ]
75337
- }
75338
- );
75339
- const Solid = (properties) => /* @__PURE__ */ jsxRuntime.jsx(
75340
- "svg",
75341
- {
75342
- xmlns: "http://www.w3.org/2000/svg",
75343
- width: 24,
75344
- height: 24,
75345
- fill: "none",
75346
- ...properties,
75347
- children: /* @__PURE__ */ jsxRuntime.jsx(
75348
- "path",
75349
- {
75350
- fill: "#101010",
75351
- d: "M19 4a3 3 0 0 1 3 3v9a3 3 0 0 1-3 3H5a3 3 0 0 1-3-3V7a3 3 0 0 1 3-3h14ZM6.718 8.117l-.48 3.492-.042.024.938.234c.342-.045.634-.067.876-.067.537 0 .916.113 1.136.34.221.226.332.604.332 1.133 0 .412-.11.73-.332.956-.218.222-.538.334-.958.334-.183 0-.372-.043-.565-.13a1.438 1.438 0 0 1-.48-.348.895.895 0 0 0 .577-.308.911.911 0 0 0 .234-.62c0-.26-.092-.481-.275-.663a.896.896 0 0 0-.662-.275.909.909 0 0 0-.498.143.915.915 0 0 0-.343.378 1.49 1.49 0 0 0-.176.71c0 .204.04.406.117.606.078.199.195.385.349.56a2.57 2.57 0 0 0 1.289.77c.283.076.584.114.902.114a3.77 3.77 0 0 0 1.075-.144 2.6 2.6 0 0 0 .803-.375c.211-.156.388-.337.53-.544a2.168 2.168 0 0 0 .405-1.28c0-.358-.044-.68-.132-.965a2.122 2.122 0 0 0-.396-.747 1.697 1.697 0 0 0-.688-.486 2.598 2.598 0 0 0-.984-.173c-.276 0-.606.027-.99.082-.384.053-.738.13-1.064.232l.202-1.489c.379.176.948.264 1.708.264.246 0 .478-.024.697-.073.219-.05.429-.126.63-.232.203-.105.383-.252.54-.44.155-.187.276-.407.36-.661l-.118-.352c-.582.156-1.285.235-2.109.235a5.676 5.676 0 0 1-.879-.068 8.84 8.84 0 0 1-.343-.085 17.89 17.89 0 0 0-.301-.082h-.885ZM15.178 8c-.318 0-.618.038-.902.114-.283.076-.53.18-.74.314a2.526 2.526 0 0 0-.549.46c-.154.172-.27.357-.348.556-.079.2-.117.402-.117.607 0 .252.058.488.175.709a.933.933 0 0 0 .841.521c.26 0 .48-.09.662-.272a.906.906 0 0 0 .276-.665.9.9 0 0 0-.235-.618.89.89 0 0 0-.577-.311c.129-.144.29-.26.48-.346.194-.088.382-.132.566-.132.42 0 .74.113.958.337.22.223.331.54.331.953 0 .312-.077.622-.231.928-.155.307-.39.583-.707.83l-.076.058c-.134.104-.255.197-.36.281a17.157 17.157 0 0 0-.727.618c-.105.1-.217.213-.336.34a4.22 4.22 0 0 0-.314.366 4.665 4.665 0 0 0-.26.39 2.753 2.753 0 0 0-.34.864 2.47 2.47 0 0 0-.047.48h5.39V12.57h-1.055v.47c0 .095-.008.193-.026.295a1.678 1.678 0 0 1-.076.302.617.617 0 0 1-.146.246.307.307 0 0 1-.22.094h-1.524c-.218 0-.44.034-.662.102.082-.113.173-.218.273-.313.101-.096.192-.172.272-.229a34.1 34.1 0 0 1 .334-.234c.143-.098.266-.186.37-.264.1-.078.225-.164.371-.258.149-.096.286-.18.41-.255a8.39 8.39 0 0 0 .408-.266c.146-.102.277-.2.392-.296.118-.096.233-.21.346-.343a2.076 2.076 0 0 0 .463-.908c.047-.19.07-.39.07-.604 0-.218-.031-.426-.093-.624-.063-.199-.166-.39-.308-.57a2.02 2.02 0 0 0-.533-.476 2.676 2.676 0 0 0-.803-.319c-.32-.08-.679-.12-1.075-.12Z"
75352
- }
75353
- )
75354
- }
75355
- );
75356
- const UnitNumber = ({ variant }) => {
75357
- return variant === "outline" ? /* @__PURE__ */ jsxRuntime.jsx(Outline, {}) : /* @__PURE__ */ jsxRuntime.jsx(Solid, {});
75358
- };
75359
- const getStateColors = (colors2, type4, state) => {
75360
- const filled = {
75361
- color: colors2.inputs.onsurface.active,
75362
- borderColor: colors2[TYPE.secondary].active.borderColor,
75363
- ringColor: colors2[type4].focussed.ringColor
75364
- };
75365
- const success = {
75366
- color: colors2.status.success.default,
75367
- borderColor: colors2.status.success.default,
75368
- ringColor: colors2.status.success.ringColor
75369
- };
75370
- const error2 = {
75371
- color: colors2.status.error.default,
75372
- borderColor: colors2.status.error.default,
75373
- ringColor: colors2.status.error.ringColor
75374
- };
75375
- const themeState = state !== STATE.error && state !== STATE.success && state !== STATE.filled ? {
75376
- color: colors2.inputs.onsurface.active,
75377
- backgroundColor: colors2.inputs.surface.active,
75378
- borderColor: colors2.inputs.surface.border,
75379
- ringColor: colors2[type4][state].ringColor
75380
- } : null;
75381
- const stateMap = {
75382
- filled,
75383
- error: error2,
75384
- success,
75385
- themeState
75386
- };
75387
- const getValidKey = (state2) => {
75388
- const validStates = [STATE.filled, STATE.error, STATE.success];
75389
- return validStates.includes(state2) ? state2 : "themeState";
75390
- };
75391
- const css = stateMap[getValidKey(state)];
75392
- return css;
75393
- };
75394
- const getGenesisInputClass = ({ colors: colors2, borderRadius: borderRadius2, components: components2, shadows: shadows2 }, type4, state, hasBeforeAddon, hasAfterAddon, size) => {
75395
- const stateColors = getStateColors(colors2, type4, state);
75396
- const getBorderRadius = (hasBeforeAddon2, hasAfterAddon2) => {
75397
- if (hasAfterAddon2 && !hasBeforeAddon2) {
75398
- return `${borderRadius2.BorderRadiusMd}px 0px 0px ${borderRadius2.BorderRadiusMd}px`;
75399
- }
75400
- if (hasBeforeAddon2 && !hasAfterAddon2) {
75401
- return `0px ${borderRadius2.BorderRadiusMd}px ${borderRadius2.BorderRadiusMd}px 0px`;
75402
- }
75403
- return `0px`;
75404
- };
75405
- return `
75406
- &.ant-input {
75407
- font-family: 'Inter', sans-serif;
75408
- color: ${stateColors.color};
75409
- border-color: ${stateColors.borderColor};
75410
- box-shadow: ${shadows2.inputs[1]} !important;
75411
- height: ${size === "normal" || size === "large" ? "40px" : "32px"} !important;
75412
- }
75413
-
75414
- /* Increase specificity for focus states */
75415
- &.ant-input.ant-input:focus,
75416
- &.ant-input.ant-input:focus-visible,
75417
- &.ant-input.ant-input-focused {
75418
- outline: none !important;
75419
- border-color: ${colors2[type4].focussed.borderColor} !important;
75420
- box-shadow: 0 0 0 1px #fff, 0 0 0 3px ${colors2[type4].focussed.ringColor} !important;
75421
- }
75422
-
75423
- &.ant-input-outlined {
75424
- border: 1px solid ${stateColors.borderColor};
75425
-
75426
- &:hover {
75427
- border-color: ${stateColors.borderColor};
75428
- }
75429
- }
75430
-
75431
- .ant-input-group & {
75432
- &:focus-within {
75433
- outline: none;
75434
- color: ${stateColors.color};
75435
- box-shadow: none;
75436
- border-color: ${colors2[type4].focussed.borderColor};
75437
- }
75438
- }
75439
-
75440
- .ant-input-group:focus-within {
75441
- outline: none;
75442
- box-shadow: 0 0 0 1px #fff, 0 0 0 3px ${colors2[type4].focussed.ringColor};
75443
- border-radius: ${borderRadius2.BorderRadiusMd}px;
75444
- transition: box-shadow 0.2s ease-in-out;
75445
-
75446
- /* Hide focus styles on inner input when parent is focused */
75447
- .ant-input:focus-within {
75448
- box-shadow: none;
75449
- border-radius: 0;
75450
- border-radius: ${getBorderRadius(hasBeforeAddon, hasAfterAddon)};
75451
- border-color: #ddd;
75452
- }
75453
- }
75454
-
75455
- /* Remove inner input focus styles when in a group */
75456
- .ant-input-group .ant-input:focus,
75457
- .ant-input-group .ant-input:focus-visible,
75458
- .ant-input-group .ant-input:focus-within {
75459
- outline: none;
75460
- box-shadow: none;
75461
- border-color: ${colors2[type4].focussed.borderColor};
75462
- }
75463
-
75464
- /* Single focus ring on group */
75465
- .ant-input-group:focus-within {
75466
- outline: none;
75467
- box-shadow: 0 0 0 1px #fff, 0 0 0 3px ${colors2[type4].focussed.ringColor};
75468
- border-radius: ${borderRadius2.BorderRadiusMd}px;
75469
- transition: box-shadow 0.2s ease-in-out;
75470
- }
75471
-
75472
- /* Remove focus styles for standalone inputs */
75473
- &:not(.ant-input-group):focus-visible {
75474
- outline: none;
75475
- color: ${stateColors.color};
75476
- box-shadow: 0 0 0 1px #fff, 0 0 0 3px ${colors2[type4].focussed.ringColor};
75477
- border-radius: ${borderRadius2.BorderRadiusMd}px;
75478
- border-color: ${colors2[type4].focussed.borderColor};
75479
- transition: box-shadow 0.2s ease-in-out;
75480
- }
75481
-
75482
- &:not(.ant-input-group .ant-input):focus-visible {
75483
- outline: none;
75484
- color: ${stateColors.color};
75485
- box-shadow: 0 0 0 1px #fff, 0 0 0 3px ${colors2[type4].focussed.ringColor};
75486
- border-radius: ${borderRadius2.BorderRadiusMd}px;
75487
- border-color: ${colors2[type4].focussed.borderColor};
75488
- transition: box-shadow 0.2s ease-in-out;
75489
- }
75490
-
75491
- &.ant-input-group-wrapper {
75492
- .ant-input-group {
75493
- display: flex;
75494
- align-items: center;
75495
- height: ${size === "normal" || size === "large" ? "40px" : "32px"};
75496
-
75497
- .ant-input {
75498
- height: 100% !important;
75499
- }
75500
-
75501
- .ant-input-group-addon {
75502
- padding: 0 ${components2.input.suffixPrefixHorPadding};
75503
- height: 100%;
75504
- display: flex;
75505
- align-items: center;
75506
- min-width: fit-content;
75507
- width: auto;
75508
-
75509
- > * {
75510
- width: 100%;
75511
- }
75512
-
75513
- .ant-select {
75514
- height: 100%;
75515
-
75516
- .ant-select-selector {
75517
- height: 100%;
75518
- display: flex;
75519
- align-items: center;
75520
- }
75521
- }
75522
- }
75523
- }
75524
- }
75525
- `;
75526
- };
75527
- const Input$1 = styled(Input$2)`
75528
- ${({ theme, state, type: type4 = TYPE.primary, size = "normal", ...rest }) => {
75529
- const hasBeforeAddon = !!rest.addonBefore;
75530
- const hasAfterAddon = !!rest.addonAfter;
75531
- return getGenesisInputClass(
75532
- theme,
75533
- type4,
75534
- state,
75535
- hasBeforeAddon,
75536
- hasAfterAddon,
75537
- size
75538
- );
75539
- }}
75540
- `;
75541
- const DropdownChevron = (properties) => {
75542
- const { theme } = useGenesis();
75543
- return /* @__PURE__ */ jsxRuntime.jsx(
75544
- "svg",
75545
- {
75546
- xmlns: "http://www.w3.org/2000/svg",
75547
- width: 20,
75548
- height: 20,
75549
- fill: "none",
75550
- ...properties,
75551
- children: /* @__PURE__ */ jsxRuntime.jsx(
75739
+ const { breakpoint } = useGenesis();
75740
+ return /* @__PURE__ */ jsxRuntime.jsx(Form$1, { role: "form", ...properties, children });
75741
+ },
75742
+ {
75743
+ Item: FormItem,
75744
+ useForm: Form$1.useForm
75745
+ }
75746
+ );
75747
+ const Outline = (properties) => /* @__PURE__ */ jsxRuntime.jsxs(
75748
+ "svg",
75749
+ {
75750
+ xmlns: "http://www.w3.org/2000/svg",
75751
+ width: 24,
75752
+ height: 24,
75753
+ fill: "none",
75754
+ ...properties,
75755
+ children: [
75756
+ /* @__PURE__ */ jsxRuntime.jsx(
75552
75757
  "path",
75553
75758
  {
75554
- fill: "#222",
75759
+ fill: "#101010",
75760
+ d: "M12.6 15.383a2.47 2.47 0 0 1 .18-.926c.054-.139.123-.278.207-.419.086-.143.173-.272.261-.39.09-.119.194-.24.314-.366.119-.127.231-.24.336-.34a17.157 17.157 0 0 1 1.087-.9c.034-.024.059-.044.076-.058.317-.246.552-.522.707-.829.154-.306.231-.616.231-.928 0-.413-.11-.73-.331-.953-.219-.224-.538-.336-.958-.336-.184 0-.372.043-.566.131a1.404 1.404 0 0 0-.48.346.89.89 0 0 1 .577.31.9.9 0 0 1 .235.619c0 .26-.092.481-.276.665a.901.901 0 0 1-.662.272.922.922 0 0 1-.84-.521 1.49 1.49 0 0 1-.177-.71c0-.204.04-.406.118-.606.078-.199.194-.384.348-.556.155-.174.337-.327.548-.46.211-.133.458-.238.741-.314.284-.076.584-.114.903-.114.396 0 .755.04 1.075.12.322.078.59.185.803.32.213.132.39.29.533.474.142.182.245.372.308.571.062.198.093.406.093.624 0 .213-.023.414-.07.604a2.076 2.076 0 0 1-.463.908 2.718 2.718 0 0 1-.346.343 5.695 5.695 0 0 1-.392.296 8.39 8.39 0 0 1-.407.266c-.125.075-.262.16-.41.255-.147.094-.271.18-.373.258a9.965 9.965 0 0 1-.369.264 34.1 34.1 0 0 0-.334.234c-.08.057-.17.133-.272.229-.1.095-.19.2-.273.313.223-.068.444-.102.662-.102h1.524a.307.307 0 0 0 .22-.094.617.617 0 0 0 .146-.246c.035-.1.06-.2.076-.302.018-.102.026-.2.026-.296v-.469h1.055v2.813h-5.39ZM7.418 9.611 7.216 11.1c.326-.102.68-.18 1.063-.232.385-.055.715-.082.99-.082.374 0 .702.058.985.173.283.113.513.275.688.486.176.211.308.46.396.747.088.285.132.607.132.964a2.168 2.168 0 0 1-.404 1.28c-.143.208-.32.39-.53.545a2.6 2.6 0 0 1-.804.375 3.77 3.77 0 0 1-1.075.144 3.46 3.46 0 0 1-.902-.114 2.57 2.57 0 0 1-1.29-.77 1.869 1.869 0 0 1-.348-.56A1.649 1.649 0 0 1 6 13.449c0-.252.059-.488.176-.709a.915.915 0 0 1 .343-.378.909.909 0 0 1 .498-.143c.26 0 .48.091.662.275a.897.897 0 0 1 .275.662.911.911 0 0 1-.234.621.895.895 0 0 1-.577.308c.128.144.289.26.48.349.193.086.382.129.565.129.42 0 .74-.112.958-.335.221-.224.332-.543.332-.955 0-.529-.11-.907-.332-1.133-.22-.227-.6-.34-1.136-.34-.242 0-.534.022-.876.067l-.938-.234.041-.024.48-3.492h.886c.039.01.14.037.301.082.164.043.279.072.343.085a5.676 5.676 0 0 0 .879.067c.824 0 1.527-.078 2.11-.234l.116.352a2.005 2.005 0 0 1-.36.662 1.748 1.748 0 0 1-.539.44 2.544 2.544 0 0 1-.63.23 3.194 3.194 0 0 1-.697.074c-.76 0-1.33-.088-1.708-.264Z"
75761
+ }
75762
+ ),
75763
+ /* @__PURE__ */ jsxRuntime.jsx(
75764
+ "path",
75765
+ {
75766
+ fill: "#101010",
75555
75767
  fillRule: "evenodd",
75556
- d: "M5.293 7.293a1 1 0 0 1 1.414 0L10 10.586l3.293-3.293a1 1 0 1 1 1.414 1.414l-4 4a1 1 0 0 1-1.414 0l-4-4a1 1 0 0 1 0-1.414Z",
75768
+ d: "M19 6H5a1 1 0 0 0-1 1v9a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1ZM5 4a3 3 0 0 0-3 3v9a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3V7a3 3 0 0 0-3-3H5Z",
75557
75769
  clipRule: "evenodd"
75558
75770
  }
75559
75771
  )
75560
- }
75561
- );
75562
- };
75563
- const Input2 = ({
75564
- state = STATE.active,
75565
- size = "normal",
75566
- onChange,
75567
- value: value2,
75568
- ...rest
75569
- }) => {
75570
- const { type: type4, ...validRest } = rest;
75571
- const addonAfter = React.isValidElement(rest.addonAfter) && rest.addonAfter.type === Select$1 ? React.cloneElement(rest.addonAfter, {
75572
- suffixIcon: /* @__PURE__ */ jsxRuntime.jsx(DropdownChevron, {})
75573
- }) : rest.addonAfter;
75574
- const handleChange = React.useCallback(
75575
- (e2) => {
75576
- if (onChange) {
75577
- onChange({
75578
- event: "inputChange",
75579
- payload: {
75580
- value: e2.target.value
75581
- }
75582
- });
75772
+ ]
75773
+ }
75774
+ );
75775
+ const Solid = (properties) => /* @__PURE__ */ jsxRuntime.jsx(
75776
+ "svg",
75777
+ {
75778
+ xmlns: "http://www.w3.org/2000/svg",
75779
+ width: 24,
75780
+ height: 24,
75781
+ fill: "none",
75782
+ ...properties,
75783
+ children: /* @__PURE__ */ jsxRuntime.jsx(
75784
+ "path",
75785
+ {
75786
+ fill: "#101010",
75787
+ d: "M19 4a3 3 0 0 1 3 3v9a3 3 0 0 1-3 3H5a3 3 0 0 1-3-3V7a3 3 0 0 1 3-3h14ZM6.718 8.117l-.48 3.492-.042.024.938.234c.342-.045.634-.067.876-.067.537 0 .916.113 1.136.34.221.226.332.604.332 1.133 0 .412-.11.73-.332.956-.218.222-.538.334-.958.334-.183 0-.372-.043-.565-.13a1.438 1.438 0 0 1-.48-.348.895.895 0 0 0 .577-.308.911.911 0 0 0 .234-.62c0-.26-.092-.481-.275-.663a.896.896 0 0 0-.662-.275.909.909 0 0 0-.498.143.915.915 0 0 0-.343.378 1.49 1.49 0 0 0-.176.71c0 .204.04.406.117.606.078.199.195.385.349.56a2.57 2.57 0 0 0 1.289.77c.283.076.584.114.902.114a3.77 3.77 0 0 0 1.075-.144 2.6 2.6 0 0 0 .803-.375c.211-.156.388-.337.53-.544a2.168 2.168 0 0 0 .405-1.28c0-.358-.044-.68-.132-.965a2.122 2.122 0 0 0-.396-.747 1.697 1.697 0 0 0-.688-.486 2.598 2.598 0 0 0-.984-.173c-.276 0-.606.027-.99.082-.384.053-.738.13-1.064.232l.202-1.489c.379.176.948.264 1.708.264.246 0 .478-.024.697-.073.219-.05.429-.126.63-.232.203-.105.383-.252.54-.44.155-.187.276-.407.36-.661l-.118-.352c-.582.156-1.285.235-2.109.235a5.676 5.676 0 0 1-.879-.068 8.84 8.84 0 0 1-.343-.085 17.89 17.89 0 0 0-.301-.082h-.885ZM15.178 8c-.318 0-.618.038-.902.114-.283.076-.53.18-.74.314a2.526 2.526 0 0 0-.549.46c-.154.172-.27.357-.348.556-.079.2-.117.402-.117.607 0 .252.058.488.175.709a.933.933 0 0 0 .841.521c.26 0 .48-.09.662-.272a.906.906 0 0 0 .276-.665.9.9 0 0 0-.235-.618.89.89 0 0 0-.577-.311c.129-.144.29-.26.48-.346.194-.088.382-.132.566-.132.42 0 .74.113.958.337.22.223.331.54.331.953 0 .312-.077.622-.231.928-.155.307-.39.583-.707.83l-.076.058c-.134.104-.255.197-.36.281a17.157 17.157 0 0 0-.727.618c-.105.1-.217.213-.336.34a4.22 4.22 0 0 0-.314.366 4.665 4.665 0 0 0-.26.39 2.753 2.753 0 0 0-.34.864 2.47 2.47 0 0 0-.047.48h5.39V12.57h-1.055v.47c0 .095-.008.193-.026.295a1.678 1.678 0 0 1-.076.302.617.617 0 0 1-.146.246.307.307 0 0 1-.22.094h-1.524c-.218 0-.44.034-.662.102.082-.113.173-.218.273-.313.101-.096.192-.172.272-.229a34.1 34.1 0 0 1 .334-.234c.143-.098.266-.186.37-.264.1-.078.225-.164.371-.258.149-.096.286-.18.41-.255a8.39 8.39 0 0 0 .408-.266c.146-.102.277-.2.392-.296.118-.096.233-.21.346-.343a2.076 2.076 0 0 0 .463-.908c.047-.19.07-.39.07-.604 0-.218-.031-.426-.093-.624-.063-.199-.166-.39-.308-.57a2.02 2.02 0 0 0-.533-.476 2.676 2.676 0 0 0-.803-.319c-.32-.08-.679-.12-1.075-.12Z"
75583
75788
  }
75584
- },
75585
- [onChange]
75586
- );
75587
- return /* @__PURE__ */ jsxRuntime.jsx(
75588
- Input$1,
75589
- {
75590
- ...validRest,
75591
- size,
75592
- state,
75593
- disabled: state === "disabled" || rest.disabled,
75594
- addonAfter,
75595
- style: {
75596
- height: size === "normal" || size === "large" ? "40px" : "32px"
75597
- },
75598
- onChange: handleChange,
75599
- value: value2
75600
- }
75601
- );
75789
+ )
75790
+ }
75791
+ );
75792
+ const UnitNumber = ({ variant }) => {
75793
+ return variant === "outline" ? /* @__PURE__ */ jsxRuntime.jsx(Outline, {}) : /* @__PURE__ */ jsxRuntime.jsx(Solid, {});
75602
75794
  };
75603
75795
  function r(e2) {
75604
75796
  var t2, f, n2 = "";
@@ -79012,171 +79204,6 @@ const Table$1 = styled(ForwardTable)`
79012
79204
  return getGenesisClass$3(theme, $isMainContentCell);
79013
79205
  }}
79014
79206
  `;
79015
- const getVariant = (typography2, variant, breakpoint) => {
79016
- return `
79017
- font-size: ${typography2[breakpoint][variant].fontSize}px !important;
79018
- line-height: ${typography2[breakpoint][variant].lineHeight};
79019
- letter-spacing: ${typography2[breakpoint][variant].letterSpacing}px;
79020
- font-weight: ${typography2[breakpoint][variant].fontWeight};
79021
- `;
79022
- };
79023
- const getColor = (color2, colors2, $themeType) => {
79024
- if (color2) {
79025
- return color2;
79026
- }
79027
- return colors2[$themeType].active.color;
79028
- };
79029
- const getFontFamily = (variant) => {
79030
- return `
79031
- ${variant.includes("digits") ? "'Roboto Mono', sans-serif" : "'Inter', sans-serif"} !important;
79032
- `;
79033
- };
79034
- const getGenesisTypographyClass = ({ colors: colors2, typography: typography2 }, $themeType, variant, state, breakpoint, color2, $isFullWidth) => `
79035
- &.ant-typography {
79036
- font-family: ${getFontFamily(variant)};
79037
- color: ${getColor(color2, colors2, $themeType)} !important;
79038
- ${getVariant(typography2, variant, breakpoint)}
79039
- margin-bottom: 0 !important;
79040
- width: ${$isFullWidth ? "100%" : "auto"};
79041
- line-height: 1;
79042
-
79043
- &:disabled {
79044
- color: ${colors2.status.disabled.default} !important;
79045
- userSelect: none;
79046
- cursor: not-allowed;
79047
- }
79048
- }
79049
- `;
79050
- const Headline = styled(Typography$1.Title)`
79051
- ${({
79052
- theme,
79053
- $themeType,
79054
- variant,
79055
- state,
79056
- breakpoint,
79057
- color: color2,
79058
- $isFullWidth
79059
- }) => {
79060
- return getGenesisTypographyClass(
79061
- theme,
79062
- $themeType,
79063
- variant,
79064
- state,
79065
- breakpoint,
79066
- color2,
79067
- $isFullWidth
79068
- );
79069
- }}
79070
- `;
79071
- const Paragraph = styled(
79072
- Typography$1.Paragraph
79073
- )`
79074
- ${({
79075
- theme,
79076
- $themeType,
79077
- variant,
79078
- state,
79079
- breakpoint,
79080
- color: color2,
79081
- $isFullWidth
79082
- }) => {
79083
- return getGenesisTypographyClass(
79084
- theme,
79085
- $themeType,
79086
- variant,
79087
- state,
79088
- breakpoint,
79089
- color2,
79090
- $isFullWidth
79091
- );
79092
- }}
79093
- `;
79094
- const Text = styled(Typography$1.Text)`
79095
- ${({
79096
- theme,
79097
- $themeType,
79098
- variant,
79099
- state,
79100
- breakpoint,
79101
- color: color2,
79102
- $isFullWidth
79103
- }) => {
79104
- return getGenesisTypographyClass(
79105
- theme,
79106
- $themeType,
79107
- variant,
79108
- state,
79109
- breakpoint,
79110
- color2,
79111
- $isFullWidth
79112
- );
79113
- }}
79114
- `;
79115
- const Typography = ({
79116
- children,
79117
- themeType = TYPE.secondary,
79118
- variant = TYPOGRAPHY_VARIANT.body1,
79119
- state = STATE.active,
79120
- color: color2,
79121
- isText = false,
79122
- isFullWidth,
79123
- style: style2,
79124
- isDisabled,
79125
- ...rest
79126
- }) => {
79127
- const { breakpoint } = useGenesis();
79128
- if (variant.startsWith("display") || variant.startsWith("heading")) {
79129
- const level = variant.split("heading")[1] || variant.split("display")[1];
79130
- return /* @__PURE__ */ jsxRuntime.jsx(
79131
- Headline,
79132
- {
79133
- state,
79134
- $themeType: themeType,
79135
- variant,
79136
- breakpoint,
79137
- color: color2,
79138
- level: Number.parseInt(level),
79139
- $isFullWidth: isFullWidth,
79140
- style: style2,
79141
- disabled: isDisabled,
79142
- ...rest,
79143
- children
79144
- }
79145
- );
79146
- }
79147
- if (isText) {
79148
- return /* @__PURE__ */ jsxRuntime.jsx(
79149
- Text,
79150
- {
79151
- state,
79152
- $themeType: themeType,
79153
- variant,
79154
- breakpoint,
79155
- color: color2,
79156
- $isFullWidth: isFullWidth,
79157
- style: style2,
79158
- disabled: isDisabled,
79159
- ...rest,
79160
- children
79161
- }
79162
- );
79163
- }
79164
- return /* @__PURE__ */ jsxRuntime.jsx(
79165
- Paragraph,
79166
- {
79167
- state,
79168
- $themeType: themeType,
79169
- variant,
79170
- breakpoint,
79171
- color: color2,
79172
- $isFullWidth: isFullWidth,
79173
- style: style2,
79174
- disabled: isDisabled,
79175
- ...rest,
79176
- children
79177
- }
79178
- );
79179
- };
79180
79207
  const NumberButton = styled.button`
79181
79208
  background: ${({ $active, theme }) => $active ? theme.colors.primary.default.backgroundColor : "transparent"};
79182
79209
  color: ${({ $active, theme }) => $active ? "#fff" : theme.colors.onsurface["copy-light"] || "#6C6C6C"};