@google/gemini-cli 0.1.10-dev.15 → 0.1.11

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.
Files changed (143) hide show
  1. package/README.md +16 -2
  2. package/dist/google-gemini-cli-0.1.10.tgz +0 -0
  3. package/dist/package.json +7 -8
  4. package/dist/src/config/auth.js +6 -5
  5. package/dist/src/config/auth.js.map +1 -1
  6. package/dist/src/config/config.d.ts +0 -1
  7. package/dist/src/config/config.js +63 -50
  8. package/dist/src/config/config.js.map +1 -1
  9. package/dist/src/config/extension.d.ts +1 -0
  10. package/dist/src/config/extension.js +34 -6
  11. package/dist/src/config/extension.js.map +1 -1
  12. package/dist/src/config/sandboxConfig.d.ts +1 -1
  13. package/dist/src/config/sandboxConfig.js +1 -1
  14. package/dist/src/config/sandboxConfig.js.map +1 -1
  15. package/dist/src/config/settings.d.ts +7 -2
  16. package/dist/src/config/settings.js +101 -3
  17. package/dist/src/config/settings.js.map +1 -1
  18. package/dist/src/gemini.js +36 -22
  19. package/dist/src/gemini.js.map +1 -1
  20. package/dist/src/generated/git-commit.d.ts +1 -1
  21. package/dist/src/generated/git-commit.js +1 -1
  22. package/dist/src/nonInteractiveCli.d.ts +1 -1
  23. package/dist/src/nonInteractiveCli.js +4 -2
  24. package/dist/src/nonInteractiveCli.js.map +1 -1
  25. package/dist/src/services/CommandService.d.ts +13 -0
  26. package/dist/src/services/CommandService.js +30 -0
  27. package/dist/src/services/CommandService.js.map +1 -0
  28. package/dist/src/ui/App.js +76 -17
  29. package/dist/src/ui/App.js.map +1 -1
  30. package/dist/src/ui/commands/clearCommand.d.ts +7 -0
  31. package/dist/src/ui/commands/clearCommand.js +15 -0
  32. package/dist/src/ui/commands/clearCommand.js.map +1 -0
  33. package/dist/src/ui/commands/helpCommand.d.ts +7 -0
  34. package/dist/src/ui/commands/helpCommand.js +18 -0
  35. package/dist/src/ui/commands/helpCommand.js.map +1 -0
  36. package/dist/src/ui/commands/memoryCommand.d.ts +7 -0
  37. package/dist/src/ui/commands/memoryCommand.js +81 -0
  38. package/dist/src/ui/commands/memoryCommand.js.map +1 -0
  39. package/dist/src/ui/commands/types.d.ts +63 -0
  40. package/dist/src/{gemini.test.d.ts → ui/commands/types.js} +1 -0
  41. package/dist/src/ui/commands/types.js.map +1 -0
  42. package/dist/src/ui/components/AuthDialog.js +36 -8
  43. package/dist/src/ui/components/AuthDialog.js.map +1 -1
  44. package/dist/src/ui/components/Help.d.ts +1 -1
  45. package/dist/src/ui/components/Help.js +3 -2
  46. package/dist/src/ui/components/Help.js.map +1 -1
  47. package/dist/src/ui/components/InputPrompt.d.ts +2 -1
  48. package/dist/src/ui/components/InputPrompt.js +106 -157
  49. package/dist/src/ui/components/InputPrompt.js.map +1 -1
  50. package/dist/src/ui/components/LoadingIndicator.js +2 -1
  51. package/dist/src/ui/components/LoadingIndicator.js.map +1 -1
  52. package/dist/src/ui/components/ThemeDialog.js +10 -9
  53. package/dist/src/ui/components/ThemeDialog.js.map +1 -1
  54. package/dist/src/ui/components/messages/CompressionMessage.js +1 -1
  55. package/dist/src/ui/components/shared/MaxSizedBox.js +1 -1
  56. package/dist/src/ui/components/shared/MaxSizedBox.js.map +1 -1
  57. package/dist/src/ui/components/shared/text-buffer.d.ts +2 -1
  58. package/dist/src/ui/components/shared/text-buffer.js +3 -3
  59. package/dist/src/ui/components/shared/text-buffer.js.map +1 -1
  60. package/dist/src/ui/contexts/SessionContext.d.ts +4 -1
  61. package/dist/src/ui/contexts/SessionContext.js +12 -2
  62. package/dist/src/ui/contexts/SessionContext.js.map +1 -1
  63. package/dist/src/ui/hooks/atCommandProcessor.js +5 -7
  64. package/dist/src/ui/hooks/atCommandProcessor.js.map +1 -1
  65. package/dist/src/ui/hooks/slashCommandProcessor.d.ts +6 -10
  66. package/dist/src/ui/hooks/slashCommandProcessor.js +217 -121
  67. package/dist/src/ui/hooks/slashCommandProcessor.js.map +1 -1
  68. package/dist/src/ui/hooks/useCompletion.d.ts +2 -2
  69. package/dist/src/ui/hooks/useCompletion.js +106 -56
  70. package/dist/src/ui/hooks/useCompletion.js.map +1 -1
  71. package/dist/src/ui/hooks/useGeminiStream.d.ts +3 -3
  72. package/dist/src/ui/hooks/useGeminiStream.js +45 -28
  73. package/dist/src/ui/hooks/useGeminiStream.js.map +1 -1
  74. package/dist/src/ui/hooks/useKeypress.js +74 -4
  75. package/dist/src/ui/hooks/useKeypress.js.map +1 -1
  76. package/dist/src/ui/types.d.ts +10 -0
  77. package/dist/src/ui/utils/InlineMarkdownRenderer.d.ts +16 -0
  78. package/dist/src/ui/utils/InlineMarkdownRenderer.js +104 -0
  79. package/dist/src/ui/utils/InlineMarkdownRenderer.js.map +1 -0
  80. package/dist/src/ui/utils/MarkdownDisplay.js +1 -80
  81. package/dist/src/ui/utils/MarkdownDisplay.js.map +1 -1
  82. package/dist/src/ui/utils/TableRenderer.js +50 -32
  83. package/dist/src/ui/utils/TableRenderer.js.map +1 -1
  84. package/dist/src/ui/utils/errorParsing.d.ts +2 -10
  85. package/dist/src/ui/utils/errorParsing.js +34 -23
  86. package/dist/src/ui/utils/errorParsing.js.map +1 -1
  87. package/dist/src/utils/sandbox-macos-permissive-proxied.sb +1 -1
  88. package/dist/src/utils/sandbox-macos-restrictive-proxied.sb +1 -1
  89. package/dist/src/utils/userStartupWarnings.d.ts +6 -0
  90. package/dist/src/utils/userStartupWarnings.js +33 -0
  91. package/dist/src/utils/userStartupWarnings.js.map +1 -0
  92. package/dist/tsconfig.tsbuildinfo +1 -1
  93. package/package.json +8 -9
  94. package/dist/src/gemini.test.js +0 -122
  95. package/dist/src/gemini.test.js.map +0 -1
  96. package/dist/src/ui/App.test.d.ts +0 -6
  97. package/dist/src/ui/App.test.js +0 -299
  98. package/dist/src/ui/App.test.js.map +0 -1
  99. package/dist/src/ui/components/AuthDialog.test.d.ts +0 -6
  100. package/dist/src/ui/components/AuthDialog.test.js +0 -69
  101. package/dist/src/ui/components/AuthDialog.test.js.map +0 -1
  102. package/dist/src/ui/components/HistoryItemDisplay.test.d.ts +0 -6
  103. package/dist/src/ui/components/HistoryItemDisplay.test.js +0 -81
  104. package/dist/src/ui/components/HistoryItemDisplay.test.js.map +0 -1
  105. package/dist/src/ui/components/InputPrompt.test.d.ts +0 -6
  106. package/dist/src/ui/components/InputPrompt.test.js +0 -154
  107. package/dist/src/ui/components/InputPrompt.test.js.map +0 -1
  108. package/dist/src/ui/components/LoadingIndicator.test.d.ts +0 -6
  109. package/dist/src/ui/components/LoadingIndicator.test.js +0 -141
  110. package/dist/src/ui/components/LoadingIndicator.test.js.map +0 -1
  111. package/dist/src/ui/components/ModelStatsDisplay.test.d.ts +0 -6
  112. package/dist/src/ui/components/ModelStatsDisplay.test.js +0 -217
  113. package/dist/src/ui/components/ModelStatsDisplay.test.js.map +0 -1
  114. package/dist/src/ui/components/SessionSummaryDisplay.test.d.ts +0 -6
  115. package/dist/src/ui/components/SessionSummaryDisplay.test.js +0 -60
  116. package/dist/src/ui/components/SessionSummaryDisplay.test.js.map +0 -1
  117. package/dist/src/ui/components/StatsDisplay.test.d.ts +0 -6
  118. package/dist/src/ui/components/StatsDisplay.test.js +0 -275
  119. package/dist/src/ui/components/StatsDisplay.test.js.map +0 -1
  120. package/dist/src/ui/components/ToolStatsDisplay.test.d.ts +0 -6
  121. package/dist/src/ui/components/ToolStatsDisplay.test.js +0 -160
  122. package/dist/src/ui/components/ToolStatsDisplay.test.js.map +0 -1
  123. package/dist/src/ui/components/messages/DiffRenderer.test.d.ts +0 -6
  124. package/dist/src/ui/components/messages/DiffRenderer.test.js +0 -239
  125. package/dist/src/ui/components/messages/DiffRenderer.test.js.map +0 -1
  126. package/dist/src/ui/components/messages/ToolConfirmationMessage.test.d.ts +0 -6
  127. package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js +0 -37
  128. package/dist/src/ui/components/messages/ToolConfirmationMessage.test.js.map +0 -1
  129. package/dist/src/ui/components/messages/ToolMessage.test.d.ts +0 -6
  130. package/dist/src/ui/components/messages/ToolMessage.test.js +0 -116
  131. package/dist/src/ui/components/messages/ToolMessage.test.js.map +0 -1
  132. package/dist/src/ui/components/shared/MaxSizedBox.test.d.ts +0 -6
  133. package/dist/src/ui/components/shared/MaxSizedBox.test.js +0 -134
  134. package/dist/src/ui/components/shared/MaxSizedBox.test.js.map +0 -1
  135. package/dist/src/ui/contexts/SessionContext.test.d.ts +0 -6
  136. package/dist/src/ui/contexts/SessionContext.test.js +0 -96
  137. package/dist/src/ui/contexts/SessionContext.test.js.map +0 -1
  138. package/dist/src/ui/hooks/useGeminiStream.test.d.ts +0 -6
  139. package/dist/src/ui/hooks/useGeminiStream.test.js +0 -775
  140. package/dist/src/ui/hooks/useGeminiStream.test.js.map +0 -1
  141. package/dist/src/ui/utils/MarkdownDisplay.test.d.ts +0 -6
  142. package/dist/src/ui/utils/MarkdownDisplay.test.js +0 -176
  143. package/dist/src/ui/utils/MarkdownDisplay.test.js.map +0 -1
@@ -3,41 +3,52 @@
3
3
  * Copyright 2025 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- import { AuthType } from '@google/gemini-cli-core';
7
- const RATE_LIMIT_ERROR_MESSAGE_GOOGLE = '\nPlease wait and try again later. To increase your limits, upgrade to a plan with higher limits, or use /auth to switch to using a paid API key from AI Studio at https://aistudio.google.com/apikey';
6
+ import { AuthType, UserTierId, DEFAULT_GEMINI_FLASH_MODEL, DEFAULT_GEMINI_MODEL, isProQuotaExceededError, isGenericQuotaExceededError, isApiError, isStructuredError, } from '@google/gemini-cli-core';
7
+ // Free Tier message functions
8
+ const getRateLimitErrorMessageGoogleFree = (fallbackModel = DEFAULT_GEMINI_FLASH_MODEL) => `\nPossible quota limitations in place or slow response times detected. Switching to the ${fallbackModel} model for the rest of this session.`;
9
+ const getRateLimitErrorMessageGoogleProQuotaFree = (currentModel = DEFAULT_GEMINI_MODEL, fallbackModel = DEFAULT_GEMINI_FLASH_MODEL) => `\nYou have reached your daily ${currentModel} quota limit. You will be switched to the ${fallbackModel} model for the rest of this session. To increase your limits, upgrade to a Gemini Code Assist Standard or Enterprise plan with higher limits at https://goo.gle/set-up-gemini-code-assist, or use /auth to switch to using a paid API key from AI Studio at https://aistudio.google.com/apikey`;
10
+ const getRateLimitErrorMessageGoogleGenericQuotaFree = () => `\nYou have reached your daily quota limit. To increase your limits, upgrade to a Gemini Code Assist Standard or Enterprise plan with higher limits at https://goo.gle/set-up-gemini-code-assist, or use /auth to switch to using a paid API key from AI Studio at https://aistudio.google.com/apikey`;
11
+ // Legacy/Standard Tier message functions
12
+ const getRateLimitErrorMessageGooglePaid = (fallbackModel = DEFAULT_GEMINI_FLASH_MODEL) => `\nPossible quota limitations in place or slow response times detected. Switching to the ${fallbackModel} model for the rest of this session. We appreciate you for choosing Gemini Code Assist and the Gemini CLI.`;
13
+ const getRateLimitErrorMessageGoogleProQuotaPaid = (currentModel = DEFAULT_GEMINI_MODEL, fallbackModel = DEFAULT_GEMINI_FLASH_MODEL) => `\nYou have reached your daily ${currentModel} quota limit. You will be switched to the ${fallbackModel} model for the rest of this session. We appreciate you for choosing Gemini Code Assist and the Gemini CLI. To continue accessing the ${currentModel} model today, consider using /auth to switch to using a paid API key from AI Studio at https://aistudio.google.com/apikey`;
14
+ const getRateLimitErrorMessageGoogleGenericQuotaPaid = (currentModel = DEFAULT_GEMINI_MODEL) => `\nYou have reached your daily quota limit. We appreciate you for choosing Gemini Code Assist and the Gemini CLI. To continue accessing the ${currentModel} model today, consider using /auth to switch to using a paid API key from AI Studio at https://aistudio.google.com/apikey`;
8
15
  const RATE_LIMIT_ERROR_MESSAGE_USE_GEMINI = '\nPlease wait and try again later. To increase your limits, request a quota increase through AI Studio, or switch to another /auth method';
9
16
  const RATE_LIMIT_ERROR_MESSAGE_VERTEX = '\nPlease wait and try again later. To increase your limits, request a quota increase through Vertex, or switch to another /auth method';
10
- const RATE_LIMIT_ERROR_MESSAGE_DEFAULT = 'Your request has been rate limited. Please wait and try again later.';
11
- function isApiError(error) {
12
- return (typeof error === 'object' &&
13
- error !== null &&
14
- 'error' in error &&
15
- typeof error.error === 'object' &&
16
- 'message' in error.error);
17
- }
18
- function isStructuredError(error) {
19
- return (typeof error === 'object' &&
20
- error !== null &&
21
- 'message' in error &&
22
- typeof error.message === 'string');
23
- }
24
- function getRateLimitMessage(authType) {
17
+ const getRateLimitErrorMessageDefault = (fallbackModel = DEFAULT_GEMINI_FLASH_MODEL) => `\nPossible quota limitations in place or slow response times detected. Switching to the ${fallbackModel} model for the rest of this session.`;
18
+ function getRateLimitMessage(authType, error, userTier, currentModel, fallbackModel) {
25
19
  switch (authType) {
26
- case AuthType.LOGIN_WITH_GOOGLE:
27
- return RATE_LIMIT_ERROR_MESSAGE_GOOGLE;
20
+ case AuthType.LOGIN_WITH_GOOGLE: {
21
+ // Determine if user is on a paid tier (Legacy or Standard) - default to FREE if not specified
22
+ const isPaidTier = userTier === UserTierId.LEGACY || userTier === UserTierId.STANDARD;
23
+ if (isProQuotaExceededError(error)) {
24
+ return isPaidTier
25
+ ? getRateLimitErrorMessageGoogleProQuotaPaid(currentModel || DEFAULT_GEMINI_MODEL, fallbackModel)
26
+ : getRateLimitErrorMessageGoogleProQuotaFree(currentModel || DEFAULT_GEMINI_MODEL, fallbackModel);
27
+ }
28
+ else if (isGenericQuotaExceededError(error)) {
29
+ return isPaidTier
30
+ ? getRateLimitErrorMessageGoogleGenericQuotaPaid(currentModel || DEFAULT_GEMINI_MODEL)
31
+ : getRateLimitErrorMessageGoogleGenericQuotaFree();
32
+ }
33
+ else {
34
+ return isPaidTier
35
+ ? getRateLimitErrorMessageGooglePaid(fallbackModel)
36
+ : getRateLimitErrorMessageGoogleFree(fallbackModel);
37
+ }
38
+ }
28
39
  case AuthType.USE_GEMINI:
29
40
  return RATE_LIMIT_ERROR_MESSAGE_USE_GEMINI;
30
41
  case AuthType.USE_VERTEX_AI:
31
42
  return RATE_LIMIT_ERROR_MESSAGE_VERTEX;
32
43
  default:
33
- return RATE_LIMIT_ERROR_MESSAGE_DEFAULT;
44
+ return getRateLimitErrorMessageDefault(fallbackModel);
34
45
  }
35
46
  }
36
- export function parseAndFormatApiError(error, authType) {
47
+ export function parseAndFormatApiError(error, authType, userTier, currentModel, fallbackModel) {
37
48
  if (isStructuredError(error)) {
38
49
  let text = `[API Error: ${error.message}]`;
39
50
  if (error.status === 429) {
40
- text += getRateLimitMessage(authType);
51
+ text += getRateLimitMessage(authType, error, userTier, currentModel, fallbackModel);
41
52
  }
42
53
  return text;
43
54
  }
@@ -64,7 +75,7 @@ export function parseAndFormatApiError(error, authType) {
64
75
  }
65
76
  let text = `[API Error: ${finalMessage} (Status: ${parsedError.error.status})]`;
66
77
  if (parsedError.error.code === 429) {
67
- text += getRateLimitMessage(authType);
78
+ text += getRateLimitMessage(authType, parsedError, userTier, currentModel, fallbackModel);
68
79
  }
69
80
  return text;
70
81
  }
@@ -1 +1 @@
1
- {"version":3,"file":"errorParsing.js","sourceRoot":"","sources":["../../../../src/ui/utils/errorParsing.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAmB,MAAM,yBAAyB,CAAC;AAEpE,MAAM,+BAA+B,GACnC,uMAAuM,CAAC;AAC1M,MAAM,mCAAmC,GACvC,2IAA2I,CAAC;AAC9I,MAAM,+BAA+B,GACnC,wIAAwI,CAAC;AAC3I,MAAM,gCAAgC,GACpC,sEAAsE,CAAC;AAWzE,SAAS,UAAU,CAAC,KAAc;IAChC,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,OAAO,IAAI,KAAK;QAChB,OAAQ,KAAkB,CAAC,KAAK,KAAK,QAAQ;QAC7C,SAAS,IAAK,KAAkB,CAAC,KAAK,CACvC,CAAC;AACJ,CAAC;AAED,SAAS,iBAAiB,CAAC,KAAc;IACvC,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,SAAS,IAAI,KAAK;QACl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BACH,8DAA8D;oBAC9D,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAY,CAAC;oBACxD,IAAI,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;wBAC5B,YAAY,GAAG,WAAW,CAAC,KAAK,CAAC,OAAO,CAAC;oBAC3C,CAAC;gBACH,CAAC;gBAAC,OAAO,EAAE,EAAE,CAAC;oBACZ,kEAAkE;gBACpE,CAAC;gBACD,IAAI,IAAI,GAAG,eAAe,YAAY,aAAa,WAAW,CAAC,KAAK,CAAC,MAAM,IAAI,CAAC;gBAChF,IAAI,WAAW,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,EAAE,CAAC;oBACnC,IAAI,IAAI,mBAAmB,CACzB,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,aAAa,CACd,CAAC;gBACJ,CAAC;gBACD,OAAO,IAAI,CAAC;YACd,CAAC;QACH,CAAC;QAAC,OAAO,EAAE,EAAE,CAAC;YACZ,kEAAkE;QACpE,CAAC;QACD,OAAO,eAAe,KAAK,GAAG,CAAC;IACjC,CAAC;IAED,OAAO,yCAAyC,CAAC;AACnD,CAAC"}
@@ -24,7 +24,7 @@
24
24
 
25
25
  ;; deny all outbound network traffic EXCEPT through proxy on localhost:8877
26
26
  ;; set `GEMINI_SANDBOX_PROXY_COMMAND=<command>` to run proxy alongside sandbox
27
- ;; proxy must listen on :::8877 (see scripts/example-proxy.js)
27
+ ;; proxy must listen on :::8877 (see docs/examples/proxy-script.md)
28
28
  (deny network-outbound)
29
29
  (allow network-outbound (remote tcp "localhost:8877"))
30
30
 
@@ -88,5 +88,5 @@
88
88
 
89
89
  ;; allow outbound network traffic through proxy on localhost:8877
90
90
  ;; set `GEMINI_SANDBOX_PROXY_COMMAND=<command>` to run proxy alongside sandbox
91
- ;; proxy must listen on :::8877 (see scripts/example-proxy.js)
91
+ ;; proxy must listen on :::8877 (see docs/examples/proxy-script.md)
92
92
  (allow network-outbound (remote tcp "localhost:8877"))
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ export declare function getUserStartupWarnings(workspaceRoot: string): Promise<string[]>;
@@ -0,0 +1,33 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import fs from 'fs/promises';
7
+ import * as os from 'os';
8
+ // Individual warning checks
9
+ const homeDirectoryCheck = {
10
+ id: 'home-directory',
11
+ check: async (workspaceRoot) => {
12
+ try {
13
+ const [workspaceRealPath, homeRealPath] = await Promise.all([
14
+ fs.realpath(workspaceRoot),
15
+ fs.realpath(os.homedir()),
16
+ ]);
17
+ if (workspaceRealPath === homeRealPath) {
18
+ return 'You are running Gemini CLI in your home directory. It is recommended to run in a project-specific directory.';
19
+ }
20
+ return null;
21
+ }
22
+ catch (_err) {
23
+ return 'Could not verify the current directory due to a file system error.';
24
+ }
25
+ },
26
+ };
27
+ // All warning checks
28
+ const WARNING_CHECKS = [homeDirectoryCheck];
29
+ export async function getUserStartupWarnings(workspaceRoot) {
30
+ const results = await Promise.all(WARNING_CHECKS.map((check) => check.check(workspaceRoot)));
31
+ return results.filter((msg) => msg !== null);
32
+ }
33
+ //# sourceMappingURL=userStartupWarnings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"userStartupWarnings.js","sourceRoot":"","sources":["../../../src/utils/userStartupWarnings.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,MAAM,aAAa,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAOzB,4BAA4B;AAC5B,MAAM,kBAAkB,GAAiB;IACvC,EAAE,EAAE,gBAAgB;IACpB,KAAK,EAAE,KAAK,EAAE,aAAqB,EAAE,EAAE;QACrC,IAAI,CAAC;YACH,MAAM,CAAC,iBAAiB,EAAE,YAAY,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;gBAC1D,EAAE,CAAC,QAAQ,CAAC,aAAa,CAAC;gBAC1B,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC;aAC1B,CAAC,CAAC;YAEH,IAAI,iBAAiB,KAAK,YAAY,EAAE,CAAC;gBACvC,OAAO,8GAA8G,CAAC;YACxH,CAAC;YACD,OAAO,IAAI,CAAC;QACd,CAAC;QAAC,OAAO,IAAa,EAAE,CAAC;YACvB,OAAO,oEAAoE,CAAC;QAC9E,CAAC;IACH,CAAC;CACF,CAAC;AAEF,qBAAqB;AACrB,MAAM,cAAc,GAA4B,CAAC,kBAAkB,CAAC,CAAC;AAErE,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,aAAqB;IAErB,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,GAAG,CAC/B,cAAc,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAC1D,CAAC;IACF,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,KAAK,IAAI,CAAC,CAAC;AAC/C,CAAC"}