@blade-hq/agent-react 2612.0.0-beta.9 → 2612.0.0-beta.90

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 (185) hide show
  1. package/README.md +56 -0
  2. package/dist/SessionPluginConfigForm-FROO3XEW.js +9 -0
  3. package/dist/SessionPluginConfigForm-FROO3XEW.js.map +1 -0
  4. package/dist/chat/AgentLoopBlock.d.ts +0 -2
  5. package/dist/chat/AskUserQuestionBlock.d.ts +3 -20
  6. package/dist/chat/AssistantTurnBlock.d.ts +3 -10
  7. package/dist/chat/AttachmentPreviewDialog.d.ts +0 -1
  8. package/dist/chat/ChatLoadingIndicator.d.ts +15 -0
  9. package/dist/chat/ChatPanel.d.ts +3 -1
  10. package/dist/chat/ContextAttachmentPills.d.ts +4 -0
  11. package/dist/chat/CurrentPlanPanel.d.ts +0 -3
  12. package/dist/chat/FileDeliveryCards.d.ts +12 -10
  13. package/dist/chat/FinalArtifactCards.d.ts +0 -1
  14. package/dist/chat/ImageLightbox.d.ts +1 -1
  15. package/dist/chat/LiteMessageList.d.ts +5 -3
  16. package/dist/chat/MessageFileAttachmentList.d.ts +0 -5
  17. package/dist/chat/QuestionnaireQuestionBlock.d.ts +11 -0
  18. package/dist/chat/SessionReplayBar.d.ts +0 -1
  19. package/dist/chat/TextAttachmentPills.d.ts +0 -3
  20. package/dist/chat/TurnNavRail.d.ts +1 -7
  21. package/dist/chat/WorkflowRunBlock.d.ts +21 -4
  22. package/dist/chat/ai-elements/shimmer.d.ts +2 -2
  23. package/dist/chat/chat-column-width.d.ts +21 -0
  24. package/dist/chat/customization.d.ts +1 -1
  25. package/dist/chat/index.d.ts +6 -3
  26. package/dist/chat/markdown/ExternalAnchor.d.ts +2 -2
  27. package/dist/chat/message-list-blocks.d.ts +0 -1
  28. package/dist/chat/runtime/actions.d.ts +7 -3
  29. package/dist/chat/runtime/background-task-dismissals.d.ts +0 -1
  30. package/dist/chat/runtime/composer-channels.d.ts +0 -3
  31. package/dist/chat/runtime/environment.d.ts +2 -0
  32. package/dist/chat/runtime/input-cache-reset.d.ts +0 -5
  33. package/dist/chat/runtime/input-services.d.ts +10 -0
  34. package/dist/chat/runtime/session-source.d.ts +0 -5
  35. package/dist/chat/runtime/use-chat-actions.d.ts +1 -5
  36. package/dist/chat/turn-locate-channel.d.ts +53 -0
  37. package/dist/chat.css +23 -18
  38. package/dist/chunk-2GP2S3IR.js +9629 -0
  39. package/dist/chunk-2GP2S3IR.js.map +1 -0
  40. package/dist/{chunk-4OG6AJXY.js → chunk-3XWKS2YP.js} +3955 -26107
  41. package/dist/chunk-3XWKS2YP.js.map +1 -0
  42. package/dist/{chunk-HJ7KNUWM.js → chunk-5FK33U4M.js} +4181 -16595
  43. package/dist/chunk-5FK33U4M.js.map +1 -0
  44. package/dist/chunk-A5WYUMNB.js +1340 -0
  45. package/dist/chunk-A5WYUMNB.js.map +1 -0
  46. package/dist/chunk-JBVJMUJA.js +805 -0
  47. package/dist/chunk-JBVJMUJA.js.map +1 -0
  48. package/dist/chunk-NRAHM3CD.js +14861 -0
  49. package/dist/chunk-NRAHM3CD.js.map +1 -0
  50. package/dist/chunk-NS55ESUC.js +9488 -0
  51. package/dist/chunk-NS55ESUC.js.map +1 -0
  52. package/dist/chunk-PRDGUQTE.js +4157 -0
  53. package/dist/chunk-PRDGUQTE.js.map +1 -0
  54. package/dist/chunk-T42PKMOI.js +2417 -0
  55. package/dist/chunk-T42PKMOI.js.map +1 -0
  56. package/dist/chunk-WMWYGB2C.js +964 -0
  57. package/dist/chunk-WMWYGB2C.js.map +1 -0
  58. package/dist/components/AccountConnectorRules.d.ts +7 -0
  59. package/dist/components/AccountConnectors.d.ts +13 -0
  60. package/dist/components/ActionApprovals.d.ts +16 -0
  61. package/dist/components/BrowserConnectionDialog.d.ts +8 -0
  62. package/dist/components/ChatInput.d.ts +1 -15
  63. package/dist/components/ConfigConnection.d.ts +16 -0
  64. package/dist/components/ConnectorAuthorizationProgress.d.ts +6 -0
  65. package/dist/components/ConnectorConnection.d.ts +4 -0
  66. package/dist/components/ConnectorDetail.d.ts +46 -0
  67. package/dist/components/ConnectorPanel.d.ts +3 -1
  68. package/dist/components/ConnectorRulesPanel.d.ts +10 -0
  69. package/dist/components/ConnectorRuntimeDiagnostics.d.ts +5 -0
  70. package/dist/components/DeviceConnection.d.ts +17 -0
  71. package/dist/components/FeishuCapabilitySelection.d.ts +14 -0
  72. package/dist/components/FeishuPermissionStatus.d.ts +7 -0
  73. package/dist/components/LlmAdvancedSettings.d.ts +0 -1
  74. package/dist/components/ManagedConnection.d.ts +12 -0
  75. package/dist/components/McpAppFrame.d.ts +17 -0
  76. package/dist/components/PackEventNotice.d.ts +3 -0
  77. package/dist/components/PlanUpdateBlock.d.ts +0 -1
  78. package/dist/components/SessionPluginConfigForm.d.ts +4 -1
  79. package/dist/components/SessionPluginIcon.d.ts +1 -0
  80. package/dist/components/action-approval-format.d.ts +35 -0
  81. package/dist/components/plugin-connector.d.ts +1 -0
  82. package/dist/connectors.d.ts +6 -0
  83. package/dist/connectors.js +19 -0
  84. package/dist/connectors.js.map +1 -0
  85. package/dist/embed/blade-chat-element.d.ts +0 -8
  86. package/dist/embed/entry.d.ts +21 -19
  87. package/dist/hooks/use-capabilities.d.ts +3 -0
  88. package/dist/hooks/use-message-pin.d.ts +1 -1
  89. package/dist/hooks/use-turn-navigation.d.ts +19 -0
  90. package/dist/index.d.ts +9 -0
  91. package/dist/index.js +31 -3
  92. package/dist/internal.d.ts +7 -4
  93. package/dist/internal.js +671 -103
  94. package/dist/internal.js.map +1 -1
  95. package/dist/lib/message-shortcuts.d.ts +5 -0
  96. package/dist/questions.d.ts +7 -0
  97. package/dist/questions.js +910 -0
  98. package/dist/questions.js.map +1 -0
  99. package/dist/rich-input/ChatInput.d.ts +1 -1
  100. package/dist/rich-input/ConnectButton.d.ts +7 -5
  101. package/dist/rich-input/FileCompletionMenu.d.ts +1 -2
  102. package/dist/rich-input/InputActionSubmenu.d.ts +10 -0
  103. package/dist/rich-input/ModelSelector.d.ts +3 -1
  104. package/dist/rich-input/SkillActionMenu.d.ts +10 -0
  105. package/dist/rich-input/SkillStatusBar.d.ts +0 -6
  106. package/dist/rich-input/extensions/skill-mention.d.ts +3 -20
  107. package/dist/rich-input/index.d.ts +3 -2
  108. package/dist/rich-input/lib/composer-content.d.ts +5 -1
  109. package/dist/rich-input/lib/plugin-suggestions.d.ts +4 -4
  110. package/dist/rich-input/lib/reference-candidates.d.ts +0 -1
  111. package/dist/rich-input/lib/skill-suggestions.d.ts +1 -1
  112. package/dist/rich-input/lib/user-home.d.ts +0 -17
  113. package/dist/rich-input/model/resolve-model.d.ts +2 -2
  114. package/dist/rich-input/services.d.ts +1 -1
  115. package/dist/rich-input/voice/VoiceWaveform.d.ts +0 -3
  116. package/dist/rich-input.js +1711 -2140
  117. package/dist/rich-input.js.map +1 -1
  118. package/dist/style.css +16 -55
  119. package/dist/style.full.css +41 -77
  120. package/dist/tool-details.d.ts +8 -0
  121. package/dist/tool-details.js +25 -0
  122. package/dist/tool-details.js.map +1 -0
  123. package/node_modules/@modelcontextprotocol/ext-apps/LICENSE +216 -0
  124. package/node_modules/@modelcontextprotocol/ext-apps/README.md +284 -0
  125. package/node_modules/@modelcontextprotocol/ext-apps/dist/docs/patterns.d.ts +9 -0
  126. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/app-bridge.d.ts +1348 -0
  127. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/app-bridge.examples.d.ts +9 -0
  128. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/app-bridge.js +39 -0
  129. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/app-bridge.test.d.ts +1 -0
  130. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/app-with-deps.js +82 -0
  131. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/app.d.ts +1214 -0
  132. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/app.examples.d.ts +9 -0
  133. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/app.js +39 -0
  134. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/app.test.d.ts +1 -0
  135. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/constants.d.ts +65 -0
  136. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/events.d.ts +47 -0
  137. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/events.test.d.ts +1 -0
  138. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/generated/schema.d.ts +1047 -0
  139. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/generated/schema.json +6170 -0
  140. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/generated/schema.test.d.ts +41 -0
  141. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/interop-v1.test.d.ts +1 -0
  142. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/legacy-handlers.d.ts +66 -0
  143. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/legacy-handlers.test.d.ts +1 -0
  144. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/message-transport.d.ts +126 -0
  145. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/message-transport.examples.d.ts +9 -0
  146. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/message-transport.test.d.ts +1 -0
  147. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/react/index.d.ts +37 -0
  148. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/react/index.examples.d.ts +6 -0
  149. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/react/index.js +39 -0
  150. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/react/react-with-deps.js +82 -0
  151. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/react/useApp.d.ts +115 -0
  152. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/react/useApp.examples.d.ts +6 -0
  153. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/react/useAutoResize.d.ts +54 -0
  154. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/react/useAutoResize.examples.d.ts +6 -0
  155. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/react/useDocumentTheme.d.ts +44 -0
  156. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/react/useDocumentTheme.examples.d.ts +6 -0
  157. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/react/useHostStyles.d.ts +113 -0
  158. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/react/useHostStyles.examples.d.ts +6 -0
  159. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/server/index.d.ts +381 -0
  160. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/server/index.examples.d.ts +9 -0
  161. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/server/index.js +1 -0
  162. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/server/index.test.d.ts +1 -0
  163. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/spec.types.d.ts +698 -0
  164. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/standard-schema.d.ts +23 -0
  165. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/styles.d.ts +184 -0
  166. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/styles.examples.d.ts +9 -0
  167. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/types.d.ts +33 -0
  168. package/node_modules/@modelcontextprotocol/ext-apps/dist/src/wire-compat.test.d.ts +1 -0
  169. package/node_modules/@modelcontextprotocol/ext-apps/package.json +144 -0
  170. package/node_modules/@standard-schema/spec/LICENSE +21 -0
  171. package/node_modules/@standard-schema/spec/README.md +198 -0
  172. package/node_modules/@standard-schema/spec/dist/index.cjs +18 -0
  173. package/node_modules/@standard-schema/spec/dist/index.d.cts +119 -0
  174. package/node_modules/@standard-schema/spec/dist/index.d.ts +119 -0
  175. package/node_modules/@standard-schema/spec/dist/index.js +0 -0
  176. package/node_modules/@standard-schema/spec/package.json +52 -0
  177. package/package.json +19 -3
  178. package/public-api.md +100 -4
  179. package/dist/chat-OCLOVB3H.css +0 -175
  180. package/dist/chunk-3DRBRQXN.js +0 -258
  181. package/dist/chunk-3DRBRQXN.js.map +0 -1
  182. package/dist/chunk-4OG6AJXY.js.map +0 -1
  183. package/dist/chunk-HJ7KNUWM.js.map +0 -1
  184. package/dist/lib/agent-computer-command.d.ts +0 -32
  185. package/dist/rich-input/extensions/workflow-mention.d.ts +0 -10
@@ -0,0 +1,4157 @@
1
+ import {
2
+ ConfigConnection,
3
+ ConnectorRulesPanel,
4
+ Dialog,
5
+ DialogContent,
6
+ DialogTitle,
7
+ clsx
8
+ } from "./chunk-2GP2S3IR.js";
9
+ import {
10
+ Check,
11
+ ChevronDown,
12
+ Circle,
13
+ CircleDot,
14
+ ListChecks,
15
+ LoaderCircle
16
+ } from "./chunk-WMWYGB2C.js";
17
+
18
+ // src/context.tsx
19
+ import { createContext, useContext } from "react";
20
+ import { jsx } from "react/jsx-runtime";
21
+ var BladeClientContext = createContext(null);
22
+ var EMPTY_HOST = {};
23
+ var BladeHostContext = createContext(EMPTY_HOST);
24
+ function BladeProvider({ client, host, children }) {
25
+ return /* @__PURE__ */ jsx(BladeClientContext.Provider, { value: client, children: /* @__PURE__ */ jsx(BladeHostContext.Provider, { value: host ?? EMPTY_HOST, children }) });
26
+ }
27
+ function useBladeClient() {
28
+ const client = useContext(BladeClientContext);
29
+ if (!client) {
30
+ throw new Error("useBladeClient \u5FC5\u987B\u5728 <BladeProvider> \u5185\u4F7F\u7528");
31
+ }
32
+ return client;
33
+ }
34
+ function useOptionalBladeClient() {
35
+ return useContext(BladeClientContext);
36
+ }
37
+ function useBladeHost() {
38
+ return useContext(BladeHostContext);
39
+ }
40
+
41
+ // src/chat/display-utils.ts
42
+ var TOOL_NAME_ALIASES = {
43
+ agent: "Agent",
44
+ ask_user_question: "AskUserQuestion",
45
+ bash: "Bash",
46
+ bg_bash: "BgBash",
47
+ code_mode_run: "CodeMode",
48
+ edit: "Edit",
49
+ exit_plan_mode: "ExitPlanMode",
50
+ file_edit: "Edit",
51
+ file_read: "Read",
52
+ file_write: "Write",
53
+ finish_task: "FinishTask",
54
+ glob: "Glob",
55
+ grep: "Grep",
56
+ ls: "Ls",
57
+ multi_edit: "MultiEdit",
58
+ read: "Read",
59
+ read_skill: "ReadSkill",
60
+ update_plan: "UpdatePlan",
61
+ web_fetch: "WebFetch",
62
+ web_search: "WebSearch",
63
+ write: "Write"
64
+ };
65
+ var TOOL_DISPLAY_LABELS = {
66
+ Bash: "\u6267\u884C\u547D\u4EE4",
67
+ BgBash: "\u540E\u53F0\u6267\u884C\u547D\u4EE4",
68
+ CodeMode: "\u6267\u884C\u7A0B\u5E8F",
69
+ Read: "\u8BFB\u53D6\u6587\u4EF6",
70
+ Write: "\u5199\u5165\u6587\u4EF6",
71
+ Edit: "\u7F16\u8F91\u6587\u4EF6",
72
+ MultiEdit: "\u7F16\u8F91\u6587\u4EF6",
73
+ Ls: "\u5217\u51FA\u76EE\u5F55",
74
+ Glob: "\u5339\u914D\u6587\u4EF6",
75
+ Grep: "\u641C\u7D22\u6587\u672C",
76
+ WebSearch: "\u641C\u7D22\u7F51\u9875",
77
+ WebFetch: "\u6574\u7406\u7F51\u9875\u5185\u5BB9",
78
+ Agent: "\u6D3E\u751F\u5B50\u667A\u80FD\u4F53",
79
+ AskUserQuestion: "\u5411\u7528\u6237\u63D0\u95EE",
80
+ ReadSkill: "\u8BFB\u53D6\u6280\u80FD",
81
+ UpdatePlan: "\u66F4\u65B0\u4EFB\u52A1\u8FDB\u5EA6",
82
+ FinishTask: "\u4EFB\u52A1\u5B8C\u6210",
83
+ ExitPlanMode: "\u63D0\u4EA4\u8BA1\u5212",
84
+ CD: "\u5207\u6362\u5DE5\u4F5C\u76EE\u5F55",
85
+ RenderHtml: "\u751F\u6210\u9875\u9762",
86
+ submit_result: "\u63D0\u4EA4\u7ED3\u679C",
87
+ ListSessions: "\u5217\u51FA\u5386\u53F2\u4F1A\u8BDD",
88
+ GetSessionHistory: "\u8BFB\u53D6\u4F1A\u8BDD\u5386\u53F2"
89
+ };
90
+ var TOOL_SUMMARY_TEMPLATES = {
91
+ Bash: (n) => `\u6267\u884C ${n} \u6761\u547D\u4EE4`,
92
+ BgBash: (n) => `\u542F\u52A8 ${n} \u4E2A\u540E\u53F0\u4EFB\u52A1`,
93
+ CodeMode: (n) => `\u6267\u884C ${n} \u6B21\u7A0B\u5E8F`,
94
+ Read: (n) => `\u8BFB\u53D6 ${n} \u4E2A\u6587\u4EF6`,
95
+ Write: (n) => `\u5199\u5165 ${n} \u4E2A\u6587\u4EF6`,
96
+ Edit: (n) => `\u7F16\u8F91 ${n} \u4E2A\u6587\u4EF6`,
97
+ MultiEdit: (n) => `\u7F16\u8F91 ${n} \u4E2A\u6587\u4EF6`,
98
+ Ls: (n) => `\u67E5\u770B ${n} \u4E2A\u76EE\u5F55`,
99
+ Glob: (n) => `\u5339\u914D ${n} \u7EC4\u6587\u4EF6`,
100
+ Grep: (n) => `\u641C\u7D22 ${n} \u6B21\u6587\u672C`,
101
+ WebSearch: (n) => `\u641C\u7D22 ${n} \u6B21\u7F51\u9875`,
102
+ WebFetch: (n) => `\u6574\u7406 ${n} \u6B21\u7F51\u9875`,
103
+ ReadSkill: (n) => `\u8BFB\u53D6 ${n} \u4E2A\u6280\u80FD`,
104
+ Agent: (n) => `\u8C03\u7528 ${n} \u4E2A\u5B50\u667A\u80FD\u4F53`
105
+ };
106
+ var OUTPUT_TOOL_ICONS = {
107
+ Write: "\u{1F4C4}",
108
+ Edit: "\u{1F4DD}",
109
+ MultiEdit: "\u{1F4DD}"
110
+ };
111
+ var PRIORITY_FILE_KEYS = [
112
+ "file_path",
113
+ "filePath",
114
+ "output_file",
115
+ "outputFile",
116
+ "output_path",
117
+ "outputPath",
118
+ "path",
119
+ "filepath",
120
+ "target_file",
121
+ "destination",
122
+ "filename"
123
+ ];
124
+ var INDIVIDUAL_SUMMARY_TOOL_NAMES = /* @__PURE__ */ new Set(["Bash", "BgBash"]);
125
+ function safeParseJson(value) {
126
+ if (!value) return null;
127
+ try {
128
+ return JSON.parse(value);
129
+ } catch {
130
+ return null;
131
+ }
132
+ }
133
+ function isPlainObject(value) {
134
+ return Boolean(value) && typeof value === "object" && !Array.isArray(value);
135
+ }
136
+ function getStringArgValue(args, key) {
137
+ const value = args?.[key];
138
+ return typeof value === "string" ? value.trim() : "";
139
+ }
140
+ function getCommandDescription(args) {
141
+ return getStringArgValue(args, "description");
142
+ }
143
+ function getToolDescription(toolCall) {
144
+ const args = safeParseJson(toolCall.arguments);
145
+ if (!isPlainObject(args)) return null;
146
+ return getCommandDescription(args) || null;
147
+ }
148
+ function formatFileName(filePath) {
149
+ return filePath.split(/[\\/]/).pop() ?? filePath;
150
+ }
151
+ var SKILL_ENTRY_FILE_NAMES = /* @__PURE__ */ new Set(["skill.md", "command.md"]);
152
+ var NON_SKILL_DIR_NAMES = /* @__PURE__ */ new Set([".", "..", ".agent", ".agents", ".claude", "skill_data", "skills"]);
153
+ function getSkillNameFromFilePath(filePath) {
154
+ if (!filePath) return null;
155
+ const segments = filePath.split(/[\\/]+/).filter(Boolean);
156
+ const fileName = segments.pop();
157
+ if (!fileName || !SKILL_ENTRY_FILE_NAMES.has(fileName.toLowerCase())) return null;
158
+ const dirName = segments.pop();
159
+ if (!dirName || NON_SKILL_DIR_NAMES.has(dirName.toLowerCase())) return null;
160
+ return dirName;
161
+ }
162
+ function formatToolFileName(filePath) {
163
+ return getSkillNameFromFilePath(filePath) ?? formatFileName(filePath);
164
+ }
165
+ function isInternalStatusFile(filePath) {
166
+ const fileName = formatFileName(filePath).toLowerCase();
167
+ return fileName === "phase.json";
168
+ }
169
+ function formatToolName(name) {
170
+ const trimmed = name.trim();
171
+ if (!trimmed) return name;
172
+ if (trimmed === "code:run" || trimmed === "code__run") return "CodeMode";
173
+ const stripped = trimmed.split(":").pop()?.split("/").pop()?.split(".").pop()?.trim() || trimmed;
174
+ const normalized = stripped.replace(/([a-z0-9])([A-Z])/g, "$1_$2").replace(/[^a-zA-Z0-9]+/g, "_").replace(/^_+|_+$/g, "").toLowerCase();
175
+ return TOOL_NAME_ALIASES[normalized] ?? stripped;
176
+ }
177
+ function getToolDisplayLabel(toolCall) {
178
+ const normalized = formatToolName(toolCall.name);
179
+ const args = safeParseJson(toolCall.arguments);
180
+ const displayName = toolCall.display_name?.trim() ?? "";
181
+ const explicitLabel = displayName === toolCall.name ? "" : displayName;
182
+ const baseLabel = explicitLabel || TOOL_DISPLAY_LABELS[normalized] || displayName || normalized;
183
+ const metaDisplayName = getStringArgValue(args, "_meta_display_name");
184
+ if (metaDisplayName) {
185
+ return metaDisplayName;
186
+ }
187
+ const description = getCommandDescription(args);
188
+ if (normalized === "BgBash") {
189
+ return description ? `\u540E\u53F0\u6267\u884C\uFF1A${description}` : "\u540E\u53F0\u6267\u884C\u547D\u4EE4";
190
+ }
191
+ if (normalized === "ReadSkill") {
192
+ const skillName = getStringArgValue(args, "skill") || getStringArgValue(args, "skill_name");
193
+ return skillName ? `${baseLabel}\u300C${skillName}\u300D` : baseLabel;
194
+ }
195
+ if (normalized === "Read") {
196
+ const skillName = getSkillNameFromFilePath(
197
+ getStringArgValue(args, "file_path") || getStringArgValue(args, "path")
198
+ );
199
+ if (skillName) return `\u8BFB\u53D6\u6280\u80FD\u300C${skillName}\u300D`;
200
+ }
201
+ if (normalized === "FinishTask") {
202
+ const title = args && typeof args.title === "string" ? args.title : "";
203
+ return title ? `${baseLabel}\uFF1A${title}` : baseLabel;
204
+ }
205
+ return description || baseLabel;
206
+ }
207
+ function getToolTone(status) {
208
+ if (status === "error" || status === "cancelled") return "failed";
209
+ if (status === "awaiting_answer") return "awaiting";
210
+ if (status === "pending") return "running";
211
+ return "done";
212
+ }
213
+ function getToolStatusLabel(status) {
214
+ if (status === "pending") return "\u8FD0\u884C\u4E2D";
215
+ if (status === "awaiting_answer") return "\u7B49\u5F85\u56DE\u7B54";
216
+ if (status === "error") return "\u9519\u8BEF";
217
+ if (status === "cancelled") return "\u5DF2\u53D6\u6D88";
218
+ return "\u5B8C\u6210";
219
+ }
220
+ function extractToolFilePath(toolCall) {
221
+ return extractToolFilePaths(toolCall)[0] ?? null;
222
+ }
223
+ function extractToolFilePaths(toolCall) {
224
+ const formattedName = formatToolName(toolCall.name);
225
+ const argsValue = safeParseJson(toolCall.arguments);
226
+ if (formattedName === "Read" || formattedName === "Write" || formattedName === "Edit" || formattedName === "MultiEdit") {
227
+ const paths = [];
228
+ const collect = (value, depth = 0, allowPlainString = false) => {
229
+ if (depth > 4) return;
230
+ if (typeof value === "string") {
231
+ const path = value.trim();
232
+ if (path && (allowPlainString || path.includes("/") || path.includes("\\") || /\.[a-z0-9]{1,8}$/i.test(path))) {
233
+ if (!isInternalStatusFile(path) && !paths.includes(path)) paths.push(path);
234
+ }
235
+ return;
236
+ }
237
+ if (Array.isArray(value)) {
238
+ for (const item of value) collect(item, depth + 1, allowPlainString);
239
+ return;
240
+ }
241
+ if (!isPlainObject(value)) return;
242
+ for (const key of PRIORITY_FILE_KEYS) collect(value[key], depth + 1, true);
243
+ for (const [key, nested] of Object.entries(value)) {
244
+ if (!PRIORITY_FILE_KEYS.includes(key) && nested && typeof nested === "object") collect(nested, depth + 1, false);
245
+ }
246
+ };
247
+ collect(argsValue);
248
+ const collectPatchHeaders = (value) => {
249
+ if (typeof value === "string") {
250
+ for (const match of value.matchAll(/^\*\*\*\s+(?:Update|Delete|Add) File:\s*(.+)$/gm)) {
251
+ const path = match[1].trim();
252
+ if (path && !isInternalStatusFile(path) && !paths.includes(path)) paths.push(path);
253
+ }
254
+ } else if (Array.isArray(value)) {
255
+ for (const item of value) collectPatchHeaders(item);
256
+ } else if (isPlainObject(value)) {
257
+ for (const [key, nested] of Object.entries(value)) {
258
+ if (key.toLowerCase().includes("patch") || key.toLowerCase().includes("diff")) collectPatchHeaders(nested);
259
+ }
260
+ }
261
+ };
262
+ collectPatchHeaders(argsValue);
263
+ return paths;
264
+ }
265
+ return [];
266
+ }
267
+ function getToolOutputTag(toolCall) {
268
+ const toolName = formatToolName(toolCall.name);
269
+ const filePath = extractToolFilePath(toolCall);
270
+ const icon = OUTPUT_TOOL_ICONS[toolName];
271
+ if (!icon || !filePath) return null;
272
+ return {
273
+ key: `${toolCall.id}-${filePath}`,
274
+ label: `${icon} ${filePath.split("/").pop() ?? filePath}`,
275
+ tone: "file"
276
+ };
277
+ }
278
+ function isSuccessfulToolCall(toolCall) {
279
+ if (toolCall.status === "error" || toolCall.status === "cancelled") return false;
280
+ if (toolCall.status === "awaiting_answer") return false;
281
+ if (toolCall.status === "pending") return false;
282
+ return toolCall.status === "done" || toolCall.result != null || toolCall.status == null;
283
+ }
284
+ function countSuccessfulToolCalls(toolCalls) {
285
+ return toolCalls.filter(isSuccessfulToolCall).length;
286
+ }
287
+ function countPendingToolCalls(toolCalls) {
288
+ return toolCalls.filter(
289
+ (toolCall) => toolCall.status === "pending" || toolCall.status === "awaiting_answer"
290
+ ).length;
291
+ }
292
+ function formatToolCallCount(count) {
293
+ return `\u5DF2\u6267\u884C ${count} \u6B21\u5DE5\u5177\u8C03\u7528`;
294
+ }
295
+ function summarizeToolCalls(toolCalls) {
296
+ const outputTagMap = /* @__PURE__ */ new Map();
297
+ const counts = /* @__PURE__ */ new Map();
298
+ const individualTags = [];
299
+ for (const toolCall of toolCalls.filter(isSuccessfulToolCall)) {
300
+ const normalized = formatToolName(toolCall.name);
301
+ const args = safeParseJson(toolCall.arguments);
302
+ if (normalized === "Agent" || normalized === "FinishTask") continue;
303
+ if (INDIVIDUAL_SUMMARY_TOOL_NAMES.has(normalized)) {
304
+ if (normalized === "Bash") {
305
+ individualTags.push({
306
+ key: `${individualTags.length}-${toolCall.id}`,
307
+ label: getCommandDescription(args) || "\u6267\u884C\u547D\u4EE4\u884C\u64CD\u4F5C",
308
+ tone: "action"
309
+ });
310
+ continue;
311
+ }
312
+ if (normalized === "BgBash") {
313
+ individualTags.push({
314
+ key: `${individualTags.length}-${toolCall.id}`,
315
+ label: getCommandDescription(args) || "\u540E\u53F0\u6267\u884C\u547D\u4EE4",
316
+ tone: "action"
317
+ });
318
+ continue;
319
+ }
320
+ }
321
+ const outputTag = getToolOutputTag(toolCall);
322
+ if (outputTag) {
323
+ const fileLabel = outputTag.label.replace(/^[^\s]+\s+/, "");
324
+ const existing = outputTagMap.get(fileLabel);
325
+ if (existing?.label.startsWith("\u{1F4C4}")) {
326
+ continue;
327
+ }
328
+ outputTagMap.set(fileLabel, {
329
+ ...outputTag,
330
+ key: fileLabel,
331
+ label: normalized === "Write" || existing?.label.startsWith("\u{1F4DD}") ? `\u{1F4C4} ${fileLabel}` : outputTag.label
332
+ });
333
+ continue;
334
+ }
335
+ counts.set(normalized, (counts.get(normalized) ?? 0) + 1);
336
+ }
337
+ const aggregatedCountTags = [];
338
+ for (const [normalized, count] of counts.entries()) {
339
+ const template = TOOL_SUMMARY_TEMPLATES[normalized];
340
+ const label = template ? template(count) : `${TOOL_DISPLAY_LABELS[normalized] ?? normalized} \xD7${count}`;
341
+ aggregatedCountTags.push({
342
+ key: `${normalized}-${count}`,
343
+ label,
344
+ tone: "action"
345
+ });
346
+ }
347
+ const outputTags = [...outputTagMap.values()].sort(
348
+ (left, right) => left.label.localeCompare(right.label)
349
+ );
350
+ const sortedCountTags = aggregatedCountTags.sort(
351
+ (left, right) => left.label.localeCompare(right.label)
352
+ );
353
+ const merged = [...individualTags, ...outputTags, ...sortedCountTags];
354
+ if (merged.length <= 5) return merged;
355
+ return [
356
+ ...merged.slice(0, 5),
357
+ {
358
+ key: `overflow-${merged.length - 5}`,
359
+ label: `+${merged.length - 5} \u66F4\u591A`,
360
+ tone: "action"
361
+ }
362
+ ];
363
+ }
364
+ function getMessageText(message) {
365
+ if (typeof message.content === "string") return message.content;
366
+ return message.content.filter((part) => part.type === "text").map((part) => part.text).join("");
367
+ }
368
+ function hasNaturalLanguageText(message) {
369
+ return getMessageText(message).trim().length > 0;
370
+ }
371
+ function findAnchorMessageIndex(messages) {
372
+ for (let index = messages.length - 1; index >= 0; index -= 1) {
373
+ if (hasNaturalLanguageText(messages[index])) {
374
+ return index;
375
+ }
376
+ }
377
+ return Math.max(messages.length - 1, 0);
378
+ }
379
+ function getCollapsedTurnSegments(messages) {
380
+ if (messages.length === 0) {
381
+ return { anchorIndex: 0, summaryMessages: [], visibleMessages: [] };
382
+ }
383
+ const anchorIndex = findAnchorMessageIndex(messages);
384
+ return {
385
+ anchorIndex,
386
+ summaryMessages: messages.slice(0, anchorIndex),
387
+ visibleMessages: messages.slice(anchorIndex)
388
+ };
389
+ }
390
+ function getLatestPendingToolName(toolCalls) {
391
+ for (let index = toolCalls.length - 1; index >= 0; index -= 1) {
392
+ if (toolCalls[index].status === "pending" || toolCalls[index].status === "awaiting_answer") {
393
+ return formatToolName(toolCalls[index].name);
394
+ }
395
+ }
396
+ return null;
397
+ }
398
+ function getFinishTaskTitle(toolCalls) {
399
+ for (let index = toolCalls.length - 1; index >= 0; index -= 1) {
400
+ if (formatToolName(toolCalls[index].name) !== "FinishTask") continue;
401
+ const args = safeParseJson(toolCalls[index].arguments);
402
+ if (!isPlainObject(args)) continue;
403
+ const title = typeof args.title === "string" ? args.title.trim() : "";
404
+ if (title) return title;
405
+ }
406
+ return null;
407
+ }
408
+ function getTextContentSegments(messages) {
409
+ return messages.map((message) => {
410
+ if (typeof message.content === "string") return message.content;
411
+ return message.content.filter((part) => part.type === "text").map((part) => part.text).join("");
412
+ }).map((text) => text.trim()).filter(Boolean);
413
+ }
414
+ function getLastTextSegment(messages) {
415
+ const texts = getTextContentSegments(messages);
416
+ return texts[texts.length - 1] ?? "";
417
+ }
418
+ function countMessageLines(message) {
419
+ const text = typeof message.content === "string" ? message.content : "";
420
+ const reasoningLines = message.reasoning ? message.reasoning.split("\n").length : 0;
421
+ const textLines = text.trim() ? text.trim().split("\n").length : 0;
422
+ const toolLines = message.tool_calls?.length ?? 0;
423
+ return reasoningLines + textLines + toolLines;
424
+ }
425
+
426
+ // src/components/PlanUpdateBlock.tsx
427
+ import { useEffect, useRef, useState } from "react";
428
+
429
+ // ../../node_modules/.pnpm/tailwind-merge@3.5.0/node_modules/tailwind-merge/dist/bundle-mjs.mjs
430
+ var concatArrays = (array1, array2) => {
431
+ const combinedArray = new Array(array1.length + array2.length);
432
+ for (let i = 0; i < array1.length; i++) {
433
+ combinedArray[i] = array1[i];
434
+ }
435
+ for (let i = 0; i < array2.length; i++) {
436
+ combinedArray[array1.length + i] = array2[i];
437
+ }
438
+ return combinedArray;
439
+ };
440
+ var createClassValidatorObject = (classGroupId, validator) => ({
441
+ classGroupId,
442
+ validator
443
+ });
444
+ var createClassPartObject = (nextPart = /* @__PURE__ */ new Map(), validators = null, classGroupId) => ({
445
+ nextPart,
446
+ validators,
447
+ classGroupId
448
+ });
449
+ var CLASS_PART_SEPARATOR = "-";
450
+ var EMPTY_CONFLICTS = [];
451
+ var ARBITRARY_PROPERTY_PREFIX = "arbitrary..";
452
+ var createClassGroupUtils = (config) => {
453
+ const classMap = createClassMap(config);
454
+ const {
455
+ conflictingClassGroups,
456
+ conflictingClassGroupModifiers
457
+ } = config;
458
+ const getClassGroupId = (className) => {
459
+ if (className.startsWith("[") && className.endsWith("]")) {
460
+ return getGroupIdForArbitraryProperty(className);
461
+ }
462
+ const classParts = className.split(CLASS_PART_SEPARATOR);
463
+ const startIndex = classParts[0] === "" && classParts.length > 1 ? 1 : 0;
464
+ return getGroupRecursive(classParts, startIndex, classMap);
465
+ };
466
+ const getConflictingClassGroupIds = (classGroupId, hasPostfixModifier) => {
467
+ if (hasPostfixModifier) {
468
+ const modifierConflicts = conflictingClassGroupModifiers[classGroupId];
469
+ const baseConflicts = conflictingClassGroups[classGroupId];
470
+ if (modifierConflicts) {
471
+ if (baseConflicts) {
472
+ return concatArrays(baseConflicts, modifierConflicts);
473
+ }
474
+ return modifierConflicts;
475
+ }
476
+ return baseConflicts || EMPTY_CONFLICTS;
477
+ }
478
+ return conflictingClassGroups[classGroupId] || EMPTY_CONFLICTS;
479
+ };
480
+ return {
481
+ getClassGroupId,
482
+ getConflictingClassGroupIds
483
+ };
484
+ };
485
+ var getGroupRecursive = (classParts, startIndex, classPartObject) => {
486
+ const classPathsLength = classParts.length - startIndex;
487
+ if (classPathsLength === 0) {
488
+ return classPartObject.classGroupId;
489
+ }
490
+ const currentClassPart = classParts[startIndex];
491
+ const nextClassPartObject = classPartObject.nextPart.get(currentClassPart);
492
+ if (nextClassPartObject) {
493
+ const result = getGroupRecursive(classParts, startIndex + 1, nextClassPartObject);
494
+ if (result) return result;
495
+ }
496
+ const validators = classPartObject.validators;
497
+ if (validators === null) {
498
+ return void 0;
499
+ }
500
+ const classRest = startIndex === 0 ? classParts.join(CLASS_PART_SEPARATOR) : classParts.slice(startIndex).join(CLASS_PART_SEPARATOR);
501
+ const validatorsLength = validators.length;
502
+ for (let i = 0; i < validatorsLength; i++) {
503
+ const validatorObj = validators[i];
504
+ if (validatorObj.validator(classRest)) {
505
+ return validatorObj.classGroupId;
506
+ }
507
+ }
508
+ return void 0;
509
+ };
510
+ var getGroupIdForArbitraryProperty = (className) => className.slice(1, -1).indexOf(":") === -1 ? void 0 : (() => {
511
+ const content = className.slice(1, -1);
512
+ const colonIndex = content.indexOf(":");
513
+ const property = content.slice(0, colonIndex);
514
+ return property ? ARBITRARY_PROPERTY_PREFIX + property : void 0;
515
+ })();
516
+ var createClassMap = (config) => {
517
+ const {
518
+ theme,
519
+ classGroups
520
+ } = config;
521
+ return processClassGroups(classGroups, theme);
522
+ };
523
+ var processClassGroups = (classGroups, theme) => {
524
+ const classMap = createClassPartObject();
525
+ for (const classGroupId in classGroups) {
526
+ const group = classGroups[classGroupId];
527
+ processClassesRecursively(group, classMap, classGroupId, theme);
528
+ }
529
+ return classMap;
530
+ };
531
+ var processClassesRecursively = (classGroup, classPartObject, classGroupId, theme) => {
532
+ const len = classGroup.length;
533
+ for (let i = 0; i < len; i++) {
534
+ const classDefinition = classGroup[i];
535
+ processClassDefinition(classDefinition, classPartObject, classGroupId, theme);
536
+ }
537
+ };
538
+ var processClassDefinition = (classDefinition, classPartObject, classGroupId, theme) => {
539
+ if (typeof classDefinition === "string") {
540
+ processStringDefinition(classDefinition, classPartObject, classGroupId);
541
+ return;
542
+ }
543
+ if (typeof classDefinition === "function") {
544
+ processFunctionDefinition(classDefinition, classPartObject, classGroupId, theme);
545
+ return;
546
+ }
547
+ processObjectDefinition(classDefinition, classPartObject, classGroupId, theme);
548
+ };
549
+ var processStringDefinition = (classDefinition, classPartObject, classGroupId) => {
550
+ const classPartObjectToEdit = classDefinition === "" ? classPartObject : getPart(classPartObject, classDefinition);
551
+ classPartObjectToEdit.classGroupId = classGroupId;
552
+ };
553
+ var processFunctionDefinition = (classDefinition, classPartObject, classGroupId, theme) => {
554
+ if (isThemeGetter(classDefinition)) {
555
+ processClassesRecursively(classDefinition(theme), classPartObject, classGroupId, theme);
556
+ return;
557
+ }
558
+ if (classPartObject.validators === null) {
559
+ classPartObject.validators = [];
560
+ }
561
+ classPartObject.validators.push(createClassValidatorObject(classGroupId, classDefinition));
562
+ };
563
+ var processObjectDefinition = (classDefinition, classPartObject, classGroupId, theme) => {
564
+ const entries = Object.entries(classDefinition);
565
+ const len = entries.length;
566
+ for (let i = 0; i < len; i++) {
567
+ const [key, value] = entries[i];
568
+ processClassesRecursively(value, getPart(classPartObject, key), classGroupId, theme);
569
+ }
570
+ };
571
+ var getPart = (classPartObject, path) => {
572
+ let current = classPartObject;
573
+ const parts = path.split(CLASS_PART_SEPARATOR);
574
+ const len = parts.length;
575
+ for (let i = 0; i < len; i++) {
576
+ const part = parts[i];
577
+ let next = current.nextPart.get(part);
578
+ if (!next) {
579
+ next = createClassPartObject();
580
+ current.nextPart.set(part, next);
581
+ }
582
+ current = next;
583
+ }
584
+ return current;
585
+ };
586
+ var isThemeGetter = (func) => "isThemeGetter" in func && func.isThemeGetter === true;
587
+ var createLruCache = (maxCacheSize) => {
588
+ if (maxCacheSize < 1) {
589
+ return {
590
+ get: () => void 0,
591
+ set: () => {
592
+ }
593
+ };
594
+ }
595
+ let cacheSize = 0;
596
+ let cache = /* @__PURE__ */ Object.create(null);
597
+ let previousCache = /* @__PURE__ */ Object.create(null);
598
+ const update = (key, value) => {
599
+ cache[key] = value;
600
+ cacheSize++;
601
+ if (cacheSize > maxCacheSize) {
602
+ cacheSize = 0;
603
+ previousCache = cache;
604
+ cache = /* @__PURE__ */ Object.create(null);
605
+ }
606
+ };
607
+ return {
608
+ get(key) {
609
+ let value = cache[key];
610
+ if (value !== void 0) {
611
+ return value;
612
+ }
613
+ if ((value = previousCache[key]) !== void 0) {
614
+ update(key, value);
615
+ return value;
616
+ }
617
+ },
618
+ set(key, value) {
619
+ if (key in cache) {
620
+ cache[key] = value;
621
+ } else {
622
+ update(key, value);
623
+ }
624
+ }
625
+ };
626
+ };
627
+ var IMPORTANT_MODIFIER = "!";
628
+ var MODIFIER_SEPARATOR = ":";
629
+ var EMPTY_MODIFIERS = [];
630
+ var createResultObject = (modifiers, hasImportantModifier, baseClassName, maybePostfixModifierPosition, isExternal) => ({
631
+ modifiers,
632
+ hasImportantModifier,
633
+ baseClassName,
634
+ maybePostfixModifierPosition,
635
+ isExternal
636
+ });
637
+ var createParseClassName = (config) => {
638
+ const {
639
+ prefix,
640
+ experimentalParseClassName
641
+ } = config;
642
+ let parseClassName = (className) => {
643
+ const modifiers = [];
644
+ let bracketDepth = 0;
645
+ let parenDepth = 0;
646
+ let modifierStart = 0;
647
+ let postfixModifierPosition;
648
+ const len = className.length;
649
+ for (let index = 0; index < len; index++) {
650
+ const currentCharacter = className[index];
651
+ if (bracketDepth === 0 && parenDepth === 0) {
652
+ if (currentCharacter === MODIFIER_SEPARATOR) {
653
+ modifiers.push(className.slice(modifierStart, index));
654
+ modifierStart = index + 1;
655
+ continue;
656
+ }
657
+ if (currentCharacter === "/") {
658
+ postfixModifierPosition = index;
659
+ continue;
660
+ }
661
+ }
662
+ if (currentCharacter === "[") bracketDepth++;
663
+ else if (currentCharacter === "]") bracketDepth--;
664
+ else if (currentCharacter === "(") parenDepth++;
665
+ else if (currentCharacter === ")") parenDepth--;
666
+ }
667
+ const baseClassNameWithImportantModifier = modifiers.length === 0 ? className : className.slice(modifierStart);
668
+ let baseClassName = baseClassNameWithImportantModifier;
669
+ let hasImportantModifier = false;
670
+ if (baseClassNameWithImportantModifier.endsWith(IMPORTANT_MODIFIER)) {
671
+ baseClassName = baseClassNameWithImportantModifier.slice(0, -1);
672
+ hasImportantModifier = true;
673
+ } else if (
674
+ /**
675
+ * In Tailwind CSS v3 the important modifier was at the start of the base class name. This is still supported for legacy reasons.
676
+ * @see https://github.com/dcastil/tailwind-merge/issues/513#issuecomment-2614029864
677
+ */
678
+ baseClassNameWithImportantModifier.startsWith(IMPORTANT_MODIFIER)
679
+ ) {
680
+ baseClassName = baseClassNameWithImportantModifier.slice(1);
681
+ hasImportantModifier = true;
682
+ }
683
+ const maybePostfixModifierPosition = postfixModifierPosition && postfixModifierPosition > modifierStart ? postfixModifierPosition - modifierStart : void 0;
684
+ return createResultObject(modifiers, hasImportantModifier, baseClassName, maybePostfixModifierPosition);
685
+ };
686
+ if (prefix) {
687
+ const fullPrefix = prefix + MODIFIER_SEPARATOR;
688
+ const parseClassNameOriginal = parseClassName;
689
+ parseClassName = (className) => className.startsWith(fullPrefix) ? parseClassNameOriginal(className.slice(fullPrefix.length)) : createResultObject(EMPTY_MODIFIERS, false, className, void 0, true);
690
+ }
691
+ if (experimentalParseClassName) {
692
+ const parseClassNameOriginal = parseClassName;
693
+ parseClassName = (className) => experimentalParseClassName({
694
+ className,
695
+ parseClassName: parseClassNameOriginal
696
+ });
697
+ }
698
+ return parseClassName;
699
+ };
700
+ var createSortModifiers = (config) => {
701
+ const modifierWeights = /* @__PURE__ */ new Map();
702
+ config.orderSensitiveModifiers.forEach((mod, index) => {
703
+ modifierWeights.set(mod, 1e6 + index);
704
+ });
705
+ return (modifiers) => {
706
+ const result = [];
707
+ let currentSegment = [];
708
+ for (let i = 0; i < modifiers.length; i++) {
709
+ const modifier = modifiers[i];
710
+ const isArbitrary = modifier[0] === "[";
711
+ const isOrderSensitive = modifierWeights.has(modifier);
712
+ if (isArbitrary || isOrderSensitive) {
713
+ if (currentSegment.length > 0) {
714
+ currentSegment.sort();
715
+ result.push(...currentSegment);
716
+ currentSegment = [];
717
+ }
718
+ result.push(modifier);
719
+ } else {
720
+ currentSegment.push(modifier);
721
+ }
722
+ }
723
+ if (currentSegment.length > 0) {
724
+ currentSegment.sort();
725
+ result.push(...currentSegment);
726
+ }
727
+ return result;
728
+ };
729
+ };
730
+ var createConfigUtils = (config) => ({
731
+ cache: createLruCache(config.cacheSize),
732
+ parseClassName: createParseClassName(config),
733
+ sortModifiers: createSortModifiers(config),
734
+ ...createClassGroupUtils(config)
735
+ });
736
+ var SPLIT_CLASSES_REGEX = /\s+/;
737
+ var mergeClassList = (classList, configUtils) => {
738
+ const {
739
+ parseClassName,
740
+ getClassGroupId,
741
+ getConflictingClassGroupIds,
742
+ sortModifiers
743
+ } = configUtils;
744
+ const classGroupsInConflict = [];
745
+ const classNames = classList.trim().split(SPLIT_CLASSES_REGEX);
746
+ let result = "";
747
+ for (let index = classNames.length - 1; index >= 0; index -= 1) {
748
+ const originalClassName = classNames[index];
749
+ const {
750
+ isExternal,
751
+ modifiers,
752
+ hasImportantModifier,
753
+ baseClassName,
754
+ maybePostfixModifierPosition
755
+ } = parseClassName(originalClassName);
756
+ if (isExternal) {
757
+ result = originalClassName + (result.length > 0 ? " " + result : result);
758
+ continue;
759
+ }
760
+ let hasPostfixModifier = !!maybePostfixModifierPosition;
761
+ let classGroupId = getClassGroupId(hasPostfixModifier ? baseClassName.substring(0, maybePostfixModifierPosition) : baseClassName);
762
+ if (!classGroupId) {
763
+ if (!hasPostfixModifier) {
764
+ result = originalClassName + (result.length > 0 ? " " + result : result);
765
+ continue;
766
+ }
767
+ classGroupId = getClassGroupId(baseClassName);
768
+ if (!classGroupId) {
769
+ result = originalClassName + (result.length > 0 ? " " + result : result);
770
+ continue;
771
+ }
772
+ hasPostfixModifier = false;
773
+ }
774
+ const variantModifier = modifiers.length === 0 ? "" : modifiers.length === 1 ? modifiers[0] : sortModifiers(modifiers).join(":");
775
+ const modifierId = hasImportantModifier ? variantModifier + IMPORTANT_MODIFIER : variantModifier;
776
+ const classId = modifierId + classGroupId;
777
+ if (classGroupsInConflict.indexOf(classId) > -1) {
778
+ continue;
779
+ }
780
+ classGroupsInConflict.push(classId);
781
+ const conflictGroups = getConflictingClassGroupIds(classGroupId, hasPostfixModifier);
782
+ for (let i = 0; i < conflictGroups.length; ++i) {
783
+ const group = conflictGroups[i];
784
+ classGroupsInConflict.push(modifierId + group);
785
+ }
786
+ result = originalClassName + (result.length > 0 ? " " + result : result);
787
+ }
788
+ return result;
789
+ };
790
+ var twJoin = (...classLists) => {
791
+ let index = 0;
792
+ let argument;
793
+ let resolvedValue;
794
+ let string = "";
795
+ while (index < classLists.length) {
796
+ if (argument = classLists[index++]) {
797
+ if (resolvedValue = toValue(argument)) {
798
+ string && (string += " ");
799
+ string += resolvedValue;
800
+ }
801
+ }
802
+ }
803
+ return string;
804
+ };
805
+ var toValue = (mix) => {
806
+ if (typeof mix === "string") {
807
+ return mix;
808
+ }
809
+ let resolvedValue;
810
+ let string = "";
811
+ for (let k = 0; k < mix.length; k++) {
812
+ if (mix[k]) {
813
+ if (resolvedValue = toValue(mix[k])) {
814
+ string && (string += " ");
815
+ string += resolvedValue;
816
+ }
817
+ }
818
+ }
819
+ return string;
820
+ };
821
+ var createTailwindMerge = (createConfigFirst, ...createConfigRest) => {
822
+ let configUtils;
823
+ let cacheGet;
824
+ let cacheSet;
825
+ let functionToCall;
826
+ const initTailwindMerge = (classList) => {
827
+ const config = createConfigRest.reduce((previousConfig, createConfigCurrent) => createConfigCurrent(previousConfig), createConfigFirst());
828
+ configUtils = createConfigUtils(config);
829
+ cacheGet = configUtils.cache.get;
830
+ cacheSet = configUtils.cache.set;
831
+ functionToCall = tailwindMerge;
832
+ return tailwindMerge(classList);
833
+ };
834
+ const tailwindMerge = (classList) => {
835
+ const cachedResult = cacheGet(classList);
836
+ if (cachedResult) {
837
+ return cachedResult;
838
+ }
839
+ const result = mergeClassList(classList, configUtils);
840
+ cacheSet(classList, result);
841
+ return result;
842
+ };
843
+ functionToCall = initTailwindMerge;
844
+ return (...args) => functionToCall(twJoin(...args));
845
+ };
846
+ var fallbackThemeArr = [];
847
+ var fromTheme = (key) => {
848
+ const themeGetter = (theme) => theme[key] || fallbackThemeArr;
849
+ themeGetter.isThemeGetter = true;
850
+ return themeGetter;
851
+ };
852
+ var arbitraryValueRegex = /^\[(?:(\w[\w-]*):)?(.+)\]$/i;
853
+ var arbitraryVariableRegex = /^\((?:(\w[\w-]*):)?(.+)\)$/i;
854
+ var fractionRegex = /^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/;
855
+ var tshirtUnitRegex = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/;
856
+ var lengthUnitRegex = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/;
857
+ var colorFunctionRegex = /^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/;
858
+ var shadowRegex = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/;
859
+ var imageRegex = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;
860
+ var isFraction = (value) => fractionRegex.test(value);
861
+ var isNumber = (value) => !!value && !Number.isNaN(Number(value));
862
+ var isInteger = (value) => !!value && Number.isInteger(Number(value));
863
+ var isPercent = (value) => value.endsWith("%") && isNumber(value.slice(0, -1));
864
+ var isTshirtSize = (value) => tshirtUnitRegex.test(value);
865
+ var isAny = () => true;
866
+ var isLengthOnly = (value) => (
867
+ // `colorFunctionRegex` check is necessary because color functions can have percentages in them which which would be incorrectly classified as lengths.
868
+ // For example, `hsl(0 0% 0%)` would be classified as a length without this check.
869
+ // I could also use lookbehind assertion in `lengthUnitRegex` but that isn't supported widely enough.
870
+ lengthUnitRegex.test(value) && !colorFunctionRegex.test(value)
871
+ );
872
+ var isNever = () => false;
873
+ var isShadow = (value) => shadowRegex.test(value);
874
+ var isImage = (value) => imageRegex.test(value);
875
+ var isAnyNonArbitrary = (value) => !isArbitraryValue(value) && !isArbitraryVariable(value);
876
+ var isArbitrarySize = (value) => getIsArbitraryValue(value, isLabelSize, isNever);
877
+ var isArbitraryValue = (value) => arbitraryValueRegex.test(value);
878
+ var isArbitraryLength = (value) => getIsArbitraryValue(value, isLabelLength, isLengthOnly);
879
+ var isArbitraryNumber = (value) => getIsArbitraryValue(value, isLabelNumber, isNumber);
880
+ var isArbitraryWeight = (value) => getIsArbitraryValue(value, isLabelWeight, isAny);
881
+ var isArbitraryFamilyName = (value) => getIsArbitraryValue(value, isLabelFamilyName, isNever);
882
+ var isArbitraryPosition = (value) => getIsArbitraryValue(value, isLabelPosition, isNever);
883
+ var isArbitraryImage = (value) => getIsArbitraryValue(value, isLabelImage, isImage);
884
+ var isArbitraryShadow = (value) => getIsArbitraryValue(value, isLabelShadow, isShadow);
885
+ var isArbitraryVariable = (value) => arbitraryVariableRegex.test(value);
886
+ var isArbitraryVariableLength = (value) => getIsArbitraryVariable(value, isLabelLength);
887
+ var isArbitraryVariableFamilyName = (value) => getIsArbitraryVariable(value, isLabelFamilyName);
888
+ var isArbitraryVariablePosition = (value) => getIsArbitraryVariable(value, isLabelPosition);
889
+ var isArbitraryVariableSize = (value) => getIsArbitraryVariable(value, isLabelSize);
890
+ var isArbitraryVariableImage = (value) => getIsArbitraryVariable(value, isLabelImage);
891
+ var isArbitraryVariableShadow = (value) => getIsArbitraryVariable(value, isLabelShadow, true);
892
+ var isArbitraryVariableWeight = (value) => getIsArbitraryVariable(value, isLabelWeight, true);
893
+ var getIsArbitraryValue = (value, testLabel, testValue) => {
894
+ const result = arbitraryValueRegex.exec(value);
895
+ if (result) {
896
+ if (result[1]) {
897
+ return testLabel(result[1]);
898
+ }
899
+ return testValue(result[2]);
900
+ }
901
+ return false;
902
+ };
903
+ var getIsArbitraryVariable = (value, testLabel, shouldMatchNoLabel = false) => {
904
+ const result = arbitraryVariableRegex.exec(value);
905
+ if (result) {
906
+ if (result[1]) {
907
+ return testLabel(result[1]);
908
+ }
909
+ return shouldMatchNoLabel;
910
+ }
911
+ return false;
912
+ };
913
+ var isLabelPosition = (label) => label === "position" || label === "percentage";
914
+ var isLabelImage = (label) => label === "image" || label === "url";
915
+ var isLabelSize = (label) => label === "length" || label === "size" || label === "bg-size";
916
+ var isLabelLength = (label) => label === "length";
917
+ var isLabelNumber = (label) => label === "number";
918
+ var isLabelFamilyName = (label) => label === "family-name";
919
+ var isLabelWeight = (label) => label === "number" || label === "weight";
920
+ var isLabelShadow = (label) => label === "shadow";
921
+ var getDefaultConfig = () => {
922
+ const themeColor = fromTheme("color");
923
+ const themeFont = fromTheme("font");
924
+ const themeText = fromTheme("text");
925
+ const themeFontWeight = fromTheme("font-weight");
926
+ const themeTracking = fromTheme("tracking");
927
+ const themeLeading = fromTheme("leading");
928
+ const themeBreakpoint = fromTheme("breakpoint");
929
+ const themeContainer = fromTheme("container");
930
+ const themeSpacing = fromTheme("spacing");
931
+ const themeRadius = fromTheme("radius");
932
+ const themeShadow = fromTheme("shadow");
933
+ const themeInsetShadow = fromTheme("inset-shadow");
934
+ const themeTextShadow = fromTheme("text-shadow");
935
+ const themeDropShadow = fromTheme("drop-shadow");
936
+ const themeBlur = fromTheme("blur");
937
+ const themePerspective = fromTheme("perspective");
938
+ const themeAspect = fromTheme("aspect");
939
+ const themeEase = fromTheme("ease");
940
+ const themeAnimate = fromTheme("animate");
941
+ const scaleBreak = () => ["auto", "avoid", "all", "avoid-page", "page", "left", "right", "column"];
942
+ const scalePosition = () => [
943
+ "center",
944
+ "top",
945
+ "bottom",
946
+ "left",
947
+ "right",
948
+ "top-left",
949
+ // Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378
950
+ "left-top",
951
+ "top-right",
952
+ // Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378
953
+ "right-top",
954
+ "bottom-right",
955
+ // Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378
956
+ "right-bottom",
957
+ "bottom-left",
958
+ // Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378
959
+ "left-bottom"
960
+ ];
961
+ const scalePositionWithArbitrary = () => [...scalePosition(), isArbitraryVariable, isArbitraryValue];
962
+ const scaleOverflow = () => ["auto", "hidden", "clip", "visible", "scroll"];
963
+ const scaleOverscroll = () => ["auto", "contain", "none"];
964
+ const scaleUnambiguousSpacing = () => [isArbitraryVariable, isArbitraryValue, themeSpacing];
965
+ const scaleInset = () => [isFraction, "full", "auto", ...scaleUnambiguousSpacing()];
966
+ const scaleGridTemplateColsRows = () => [isInteger, "none", "subgrid", isArbitraryVariable, isArbitraryValue];
967
+ const scaleGridColRowStartAndEnd = () => ["auto", {
968
+ span: ["full", isInteger, isArbitraryVariable, isArbitraryValue]
969
+ }, isInteger, isArbitraryVariable, isArbitraryValue];
970
+ const scaleGridColRowStartOrEnd = () => [isInteger, "auto", isArbitraryVariable, isArbitraryValue];
971
+ const scaleGridAutoColsRows = () => ["auto", "min", "max", "fr", isArbitraryVariable, isArbitraryValue];
972
+ const scaleAlignPrimaryAxis = () => ["start", "end", "center", "between", "around", "evenly", "stretch", "baseline", "center-safe", "end-safe"];
973
+ const scaleAlignSecondaryAxis = () => ["start", "end", "center", "stretch", "center-safe", "end-safe"];
974
+ const scaleMargin = () => ["auto", ...scaleUnambiguousSpacing()];
975
+ const scaleSizing = () => [isFraction, "auto", "full", "dvw", "dvh", "lvw", "lvh", "svw", "svh", "min", "max", "fit", ...scaleUnambiguousSpacing()];
976
+ const scaleSizingInline = () => [isFraction, "screen", "full", "dvw", "lvw", "svw", "min", "max", "fit", ...scaleUnambiguousSpacing()];
977
+ const scaleSizingBlock = () => [isFraction, "screen", "full", "lh", "dvh", "lvh", "svh", "min", "max", "fit", ...scaleUnambiguousSpacing()];
978
+ const scaleColor = () => [themeColor, isArbitraryVariable, isArbitraryValue];
979
+ const scaleBgPosition = () => [...scalePosition(), isArbitraryVariablePosition, isArbitraryPosition, {
980
+ position: [isArbitraryVariable, isArbitraryValue]
981
+ }];
982
+ const scaleBgRepeat = () => ["no-repeat", {
983
+ repeat: ["", "x", "y", "space", "round"]
984
+ }];
985
+ const scaleBgSize = () => ["auto", "cover", "contain", isArbitraryVariableSize, isArbitrarySize, {
986
+ size: [isArbitraryVariable, isArbitraryValue]
987
+ }];
988
+ const scaleGradientStopPosition = () => [isPercent, isArbitraryVariableLength, isArbitraryLength];
989
+ const scaleRadius = () => [
990
+ // Deprecated since Tailwind CSS v4.0.0
991
+ "",
992
+ "none",
993
+ "full",
994
+ themeRadius,
995
+ isArbitraryVariable,
996
+ isArbitraryValue
997
+ ];
998
+ const scaleBorderWidth = () => ["", isNumber, isArbitraryVariableLength, isArbitraryLength];
999
+ const scaleLineStyle = () => ["solid", "dashed", "dotted", "double"];
1000
+ const scaleBlendMode = () => ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"];
1001
+ const scaleMaskImagePosition = () => [isNumber, isPercent, isArbitraryVariablePosition, isArbitraryPosition];
1002
+ const scaleBlur = () => [
1003
+ // Deprecated since Tailwind CSS v4.0.0
1004
+ "",
1005
+ "none",
1006
+ themeBlur,
1007
+ isArbitraryVariable,
1008
+ isArbitraryValue
1009
+ ];
1010
+ const scaleRotate = () => ["none", isNumber, isArbitraryVariable, isArbitraryValue];
1011
+ const scaleScale = () => ["none", isNumber, isArbitraryVariable, isArbitraryValue];
1012
+ const scaleSkew = () => [isNumber, isArbitraryVariable, isArbitraryValue];
1013
+ const scaleTranslate = () => [isFraction, "full", ...scaleUnambiguousSpacing()];
1014
+ return {
1015
+ cacheSize: 500,
1016
+ theme: {
1017
+ animate: ["spin", "ping", "pulse", "bounce"],
1018
+ aspect: ["video"],
1019
+ blur: [isTshirtSize],
1020
+ breakpoint: [isTshirtSize],
1021
+ color: [isAny],
1022
+ container: [isTshirtSize],
1023
+ "drop-shadow": [isTshirtSize],
1024
+ ease: ["in", "out", "in-out"],
1025
+ font: [isAnyNonArbitrary],
1026
+ "font-weight": ["thin", "extralight", "light", "normal", "medium", "semibold", "bold", "extrabold", "black"],
1027
+ "inset-shadow": [isTshirtSize],
1028
+ leading: ["none", "tight", "snug", "normal", "relaxed", "loose"],
1029
+ perspective: ["dramatic", "near", "normal", "midrange", "distant", "none"],
1030
+ radius: [isTshirtSize],
1031
+ shadow: [isTshirtSize],
1032
+ spacing: ["px", isNumber],
1033
+ text: [isTshirtSize],
1034
+ "text-shadow": [isTshirtSize],
1035
+ tracking: ["tighter", "tight", "normal", "wide", "wider", "widest"]
1036
+ },
1037
+ classGroups: {
1038
+ // --------------
1039
+ // --- Layout ---
1040
+ // --------------
1041
+ /**
1042
+ * Aspect Ratio
1043
+ * @see https://tailwindcss.com/docs/aspect-ratio
1044
+ */
1045
+ aspect: [{
1046
+ aspect: ["auto", "square", isFraction, isArbitraryValue, isArbitraryVariable, themeAspect]
1047
+ }],
1048
+ /**
1049
+ * Container
1050
+ * @see https://tailwindcss.com/docs/container
1051
+ * @deprecated since Tailwind CSS v4.0.0
1052
+ */
1053
+ container: ["container"],
1054
+ /**
1055
+ * Columns
1056
+ * @see https://tailwindcss.com/docs/columns
1057
+ */
1058
+ columns: [{
1059
+ columns: [isNumber, isArbitraryValue, isArbitraryVariable, themeContainer]
1060
+ }],
1061
+ /**
1062
+ * Break After
1063
+ * @see https://tailwindcss.com/docs/break-after
1064
+ */
1065
+ "break-after": [{
1066
+ "break-after": scaleBreak()
1067
+ }],
1068
+ /**
1069
+ * Break Before
1070
+ * @see https://tailwindcss.com/docs/break-before
1071
+ */
1072
+ "break-before": [{
1073
+ "break-before": scaleBreak()
1074
+ }],
1075
+ /**
1076
+ * Break Inside
1077
+ * @see https://tailwindcss.com/docs/break-inside
1078
+ */
1079
+ "break-inside": [{
1080
+ "break-inside": ["auto", "avoid", "avoid-page", "avoid-column"]
1081
+ }],
1082
+ /**
1083
+ * Box Decoration Break
1084
+ * @see https://tailwindcss.com/docs/box-decoration-break
1085
+ */
1086
+ "box-decoration": [{
1087
+ "box-decoration": ["slice", "clone"]
1088
+ }],
1089
+ /**
1090
+ * Box Sizing
1091
+ * @see https://tailwindcss.com/docs/box-sizing
1092
+ */
1093
+ box: [{
1094
+ box: ["border", "content"]
1095
+ }],
1096
+ /**
1097
+ * Display
1098
+ * @see https://tailwindcss.com/docs/display
1099
+ */
1100
+ display: ["block", "inline-block", "inline", "flex", "inline-flex", "table", "inline-table", "table-caption", "table-cell", "table-column", "table-column-group", "table-footer-group", "table-header-group", "table-row-group", "table-row", "flow-root", "grid", "inline-grid", "contents", "list-item", "hidden"],
1101
+ /**
1102
+ * Screen Reader Only
1103
+ * @see https://tailwindcss.com/docs/display#screen-reader-only
1104
+ */
1105
+ sr: ["sr-only", "not-sr-only"],
1106
+ /**
1107
+ * Floats
1108
+ * @see https://tailwindcss.com/docs/float
1109
+ */
1110
+ float: [{
1111
+ float: ["right", "left", "none", "start", "end"]
1112
+ }],
1113
+ /**
1114
+ * Clear
1115
+ * @see https://tailwindcss.com/docs/clear
1116
+ */
1117
+ clear: [{
1118
+ clear: ["left", "right", "both", "none", "start", "end"]
1119
+ }],
1120
+ /**
1121
+ * Isolation
1122
+ * @see https://tailwindcss.com/docs/isolation
1123
+ */
1124
+ isolation: ["isolate", "isolation-auto"],
1125
+ /**
1126
+ * Object Fit
1127
+ * @see https://tailwindcss.com/docs/object-fit
1128
+ */
1129
+ "object-fit": [{
1130
+ object: ["contain", "cover", "fill", "none", "scale-down"]
1131
+ }],
1132
+ /**
1133
+ * Object Position
1134
+ * @see https://tailwindcss.com/docs/object-position
1135
+ */
1136
+ "object-position": [{
1137
+ object: scalePositionWithArbitrary()
1138
+ }],
1139
+ /**
1140
+ * Overflow
1141
+ * @see https://tailwindcss.com/docs/overflow
1142
+ */
1143
+ overflow: [{
1144
+ overflow: scaleOverflow()
1145
+ }],
1146
+ /**
1147
+ * Overflow X
1148
+ * @see https://tailwindcss.com/docs/overflow
1149
+ */
1150
+ "overflow-x": [{
1151
+ "overflow-x": scaleOverflow()
1152
+ }],
1153
+ /**
1154
+ * Overflow Y
1155
+ * @see https://tailwindcss.com/docs/overflow
1156
+ */
1157
+ "overflow-y": [{
1158
+ "overflow-y": scaleOverflow()
1159
+ }],
1160
+ /**
1161
+ * Overscroll Behavior
1162
+ * @see https://tailwindcss.com/docs/overscroll-behavior
1163
+ */
1164
+ overscroll: [{
1165
+ overscroll: scaleOverscroll()
1166
+ }],
1167
+ /**
1168
+ * Overscroll Behavior X
1169
+ * @see https://tailwindcss.com/docs/overscroll-behavior
1170
+ */
1171
+ "overscroll-x": [{
1172
+ "overscroll-x": scaleOverscroll()
1173
+ }],
1174
+ /**
1175
+ * Overscroll Behavior Y
1176
+ * @see https://tailwindcss.com/docs/overscroll-behavior
1177
+ */
1178
+ "overscroll-y": [{
1179
+ "overscroll-y": scaleOverscroll()
1180
+ }],
1181
+ /**
1182
+ * Position
1183
+ * @see https://tailwindcss.com/docs/position
1184
+ */
1185
+ position: ["static", "fixed", "absolute", "relative", "sticky"],
1186
+ /**
1187
+ * Inset
1188
+ * @see https://tailwindcss.com/docs/top-right-bottom-left
1189
+ */
1190
+ inset: [{
1191
+ inset: scaleInset()
1192
+ }],
1193
+ /**
1194
+ * Inset Inline
1195
+ * @see https://tailwindcss.com/docs/top-right-bottom-left
1196
+ */
1197
+ "inset-x": [{
1198
+ "inset-x": scaleInset()
1199
+ }],
1200
+ /**
1201
+ * Inset Block
1202
+ * @see https://tailwindcss.com/docs/top-right-bottom-left
1203
+ */
1204
+ "inset-y": [{
1205
+ "inset-y": scaleInset()
1206
+ }],
1207
+ /**
1208
+ * Inset Inline Start
1209
+ * @see https://tailwindcss.com/docs/top-right-bottom-left
1210
+ * @todo class group will be renamed to `inset-s` in next major release
1211
+ */
1212
+ start: [{
1213
+ "inset-s": scaleInset(),
1214
+ /**
1215
+ * @deprecated since Tailwind CSS v4.2.0 in favor of `inset-s-*` utilities.
1216
+ * @see https://github.com/tailwindlabs/tailwindcss/pull/19613
1217
+ */
1218
+ start: scaleInset()
1219
+ }],
1220
+ /**
1221
+ * Inset Inline End
1222
+ * @see https://tailwindcss.com/docs/top-right-bottom-left
1223
+ * @todo class group will be renamed to `inset-e` in next major release
1224
+ */
1225
+ end: [{
1226
+ "inset-e": scaleInset(),
1227
+ /**
1228
+ * @deprecated since Tailwind CSS v4.2.0 in favor of `inset-e-*` utilities.
1229
+ * @see https://github.com/tailwindlabs/tailwindcss/pull/19613
1230
+ */
1231
+ end: scaleInset()
1232
+ }],
1233
+ /**
1234
+ * Inset Block Start
1235
+ * @see https://tailwindcss.com/docs/top-right-bottom-left
1236
+ */
1237
+ "inset-bs": [{
1238
+ "inset-bs": scaleInset()
1239
+ }],
1240
+ /**
1241
+ * Inset Block End
1242
+ * @see https://tailwindcss.com/docs/top-right-bottom-left
1243
+ */
1244
+ "inset-be": [{
1245
+ "inset-be": scaleInset()
1246
+ }],
1247
+ /**
1248
+ * Top
1249
+ * @see https://tailwindcss.com/docs/top-right-bottom-left
1250
+ */
1251
+ top: [{
1252
+ top: scaleInset()
1253
+ }],
1254
+ /**
1255
+ * Right
1256
+ * @see https://tailwindcss.com/docs/top-right-bottom-left
1257
+ */
1258
+ right: [{
1259
+ right: scaleInset()
1260
+ }],
1261
+ /**
1262
+ * Bottom
1263
+ * @see https://tailwindcss.com/docs/top-right-bottom-left
1264
+ */
1265
+ bottom: [{
1266
+ bottom: scaleInset()
1267
+ }],
1268
+ /**
1269
+ * Left
1270
+ * @see https://tailwindcss.com/docs/top-right-bottom-left
1271
+ */
1272
+ left: [{
1273
+ left: scaleInset()
1274
+ }],
1275
+ /**
1276
+ * Visibility
1277
+ * @see https://tailwindcss.com/docs/visibility
1278
+ */
1279
+ visibility: ["visible", "invisible", "collapse"],
1280
+ /**
1281
+ * Z-Index
1282
+ * @see https://tailwindcss.com/docs/z-index
1283
+ */
1284
+ z: [{
1285
+ z: [isInteger, "auto", isArbitraryVariable, isArbitraryValue]
1286
+ }],
1287
+ // ------------------------
1288
+ // --- Flexbox and Grid ---
1289
+ // ------------------------
1290
+ /**
1291
+ * Flex Basis
1292
+ * @see https://tailwindcss.com/docs/flex-basis
1293
+ */
1294
+ basis: [{
1295
+ basis: [isFraction, "full", "auto", themeContainer, ...scaleUnambiguousSpacing()]
1296
+ }],
1297
+ /**
1298
+ * Flex Direction
1299
+ * @see https://tailwindcss.com/docs/flex-direction
1300
+ */
1301
+ "flex-direction": [{
1302
+ flex: ["row", "row-reverse", "col", "col-reverse"]
1303
+ }],
1304
+ /**
1305
+ * Flex Wrap
1306
+ * @see https://tailwindcss.com/docs/flex-wrap
1307
+ */
1308
+ "flex-wrap": [{
1309
+ flex: ["nowrap", "wrap", "wrap-reverse"]
1310
+ }],
1311
+ /**
1312
+ * Flex
1313
+ * @see https://tailwindcss.com/docs/flex
1314
+ */
1315
+ flex: [{
1316
+ flex: [isNumber, isFraction, "auto", "initial", "none", isArbitraryValue]
1317
+ }],
1318
+ /**
1319
+ * Flex Grow
1320
+ * @see https://tailwindcss.com/docs/flex-grow
1321
+ */
1322
+ grow: [{
1323
+ grow: ["", isNumber, isArbitraryVariable, isArbitraryValue]
1324
+ }],
1325
+ /**
1326
+ * Flex Shrink
1327
+ * @see https://tailwindcss.com/docs/flex-shrink
1328
+ */
1329
+ shrink: [{
1330
+ shrink: ["", isNumber, isArbitraryVariable, isArbitraryValue]
1331
+ }],
1332
+ /**
1333
+ * Order
1334
+ * @see https://tailwindcss.com/docs/order
1335
+ */
1336
+ order: [{
1337
+ order: [isInteger, "first", "last", "none", isArbitraryVariable, isArbitraryValue]
1338
+ }],
1339
+ /**
1340
+ * Grid Template Columns
1341
+ * @see https://tailwindcss.com/docs/grid-template-columns
1342
+ */
1343
+ "grid-cols": [{
1344
+ "grid-cols": scaleGridTemplateColsRows()
1345
+ }],
1346
+ /**
1347
+ * Grid Column Start / End
1348
+ * @see https://tailwindcss.com/docs/grid-column
1349
+ */
1350
+ "col-start-end": [{
1351
+ col: scaleGridColRowStartAndEnd()
1352
+ }],
1353
+ /**
1354
+ * Grid Column Start
1355
+ * @see https://tailwindcss.com/docs/grid-column
1356
+ */
1357
+ "col-start": [{
1358
+ "col-start": scaleGridColRowStartOrEnd()
1359
+ }],
1360
+ /**
1361
+ * Grid Column End
1362
+ * @see https://tailwindcss.com/docs/grid-column
1363
+ */
1364
+ "col-end": [{
1365
+ "col-end": scaleGridColRowStartOrEnd()
1366
+ }],
1367
+ /**
1368
+ * Grid Template Rows
1369
+ * @see https://tailwindcss.com/docs/grid-template-rows
1370
+ */
1371
+ "grid-rows": [{
1372
+ "grid-rows": scaleGridTemplateColsRows()
1373
+ }],
1374
+ /**
1375
+ * Grid Row Start / End
1376
+ * @see https://tailwindcss.com/docs/grid-row
1377
+ */
1378
+ "row-start-end": [{
1379
+ row: scaleGridColRowStartAndEnd()
1380
+ }],
1381
+ /**
1382
+ * Grid Row Start
1383
+ * @see https://tailwindcss.com/docs/grid-row
1384
+ */
1385
+ "row-start": [{
1386
+ "row-start": scaleGridColRowStartOrEnd()
1387
+ }],
1388
+ /**
1389
+ * Grid Row End
1390
+ * @see https://tailwindcss.com/docs/grid-row
1391
+ */
1392
+ "row-end": [{
1393
+ "row-end": scaleGridColRowStartOrEnd()
1394
+ }],
1395
+ /**
1396
+ * Grid Auto Flow
1397
+ * @see https://tailwindcss.com/docs/grid-auto-flow
1398
+ */
1399
+ "grid-flow": [{
1400
+ "grid-flow": ["row", "col", "dense", "row-dense", "col-dense"]
1401
+ }],
1402
+ /**
1403
+ * Grid Auto Columns
1404
+ * @see https://tailwindcss.com/docs/grid-auto-columns
1405
+ */
1406
+ "auto-cols": [{
1407
+ "auto-cols": scaleGridAutoColsRows()
1408
+ }],
1409
+ /**
1410
+ * Grid Auto Rows
1411
+ * @see https://tailwindcss.com/docs/grid-auto-rows
1412
+ */
1413
+ "auto-rows": [{
1414
+ "auto-rows": scaleGridAutoColsRows()
1415
+ }],
1416
+ /**
1417
+ * Gap
1418
+ * @see https://tailwindcss.com/docs/gap
1419
+ */
1420
+ gap: [{
1421
+ gap: scaleUnambiguousSpacing()
1422
+ }],
1423
+ /**
1424
+ * Gap X
1425
+ * @see https://tailwindcss.com/docs/gap
1426
+ */
1427
+ "gap-x": [{
1428
+ "gap-x": scaleUnambiguousSpacing()
1429
+ }],
1430
+ /**
1431
+ * Gap Y
1432
+ * @see https://tailwindcss.com/docs/gap
1433
+ */
1434
+ "gap-y": [{
1435
+ "gap-y": scaleUnambiguousSpacing()
1436
+ }],
1437
+ /**
1438
+ * Justify Content
1439
+ * @see https://tailwindcss.com/docs/justify-content
1440
+ */
1441
+ "justify-content": [{
1442
+ justify: [...scaleAlignPrimaryAxis(), "normal"]
1443
+ }],
1444
+ /**
1445
+ * Justify Items
1446
+ * @see https://tailwindcss.com/docs/justify-items
1447
+ */
1448
+ "justify-items": [{
1449
+ "justify-items": [...scaleAlignSecondaryAxis(), "normal"]
1450
+ }],
1451
+ /**
1452
+ * Justify Self
1453
+ * @see https://tailwindcss.com/docs/justify-self
1454
+ */
1455
+ "justify-self": [{
1456
+ "justify-self": ["auto", ...scaleAlignSecondaryAxis()]
1457
+ }],
1458
+ /**
1459
+ * Align Content
1460
+ * @see https://tailwindcss.com/docs/align-content
1461
+ */
1462
+ "align-content": [{
1463
+ content: ["normal", ...scaleAlignPrimaryAxis()]
1464
+ }],
1465
+ /**
1466
+ * Align Items
1467
+ * @see https://tailwindcss.com/docs/align-items
1468
+ */
1469
+ "align-items": [{
1470
+ items: [...scaleAlignSecondaryAxis(), {
1471
+ baseline: ["", "last"]
1472
+ }]
1473
+ }],
1474
+ /**
1475
+ * Align Self
1476
+ * @see https://tailwindcss.com/docs/align-self
1477
+ */
1478
+ "align-self": [{
1479
+ self: ["auto", ...scaleAlignSecondaryAxis(), {
1480
+ baseline: ["", "last"]
1481
+ }]
1482
+ }],
1483
+ /**
1484
+ * Place Content
1485
+ * @see https://tailwindcss.com/docs/place-content
1486
+ */
1487
+ "place-content": [{
1488
+ "place-content": scaleAlignPrimaryAxis()
1489
+ }],
1490
+ /**
1491
+ * Place Items
1492
+ * @see https://tailwindcss.com/docs/place-items
1493
+ */
1494
+ "place-items": [{
1495
+ "place-items": [...scaleAlignSecondaryAxis(), "baseline"]
1496
+ }],
1497
+ /**
1498
+ * Place Self
1499
+ * @see https://tailwindcss.com/docs/place-self
1500
+ */
1501
+ "place-self": [{
1502
+ "place-self": ["auto", ...scaleAlignSecondaryAxis()]
1503
+ }],
1504
+ // Spacing
1505
+ /**
1506
+ * Padding
1507
+ * @see https://tailwindcss.com/docs/padding
1508
+ */
1509
+ p: [{
1510
+ p: scaleUnambiguousSpacing()
1511
+ }],
1512
+ /**
1513
+ * Padding Inline
1514
+ * @see https://tailwindcss.com/docs/padding
1515
+ */
1516
+ px: [{
1517
+ px: scaleUnambiguousSpacing()
1518
+ }],
1519
+ /**
1520
+ * Padding Block
1521
+ * @see https://tailwindcss.com/docs/padding
1522
+ */
1523
+ py: [{
1524
+ py: scaleUnambiguousSpacing()
1525
+ }],
1526
+ /**
1527
+ * Padding Inline Start
1528
+ * @see https://tailwindcss.com/docs/padding
1529
+ */
1530
+ ps: [{
1531
+ ps: scaleUnambiguousSpacing()
1532
+ }],
1533
+ /**
1534
+ * Padding Inline End
1535
+ * @see https://tailwindcss.com/docs/padding
1536
+ */
1537
+ pe: [{
1538
+ pe: scaleUnambiguousSpacing()
1539
+ }],
1540
+ /**
1541
+ * Padding Block Start
1542
+ * @see https://tailwindcss.com/docs/padding
1543
+ */
1544
+ pbs: [{
1545
+ pbs: scaleUnambiguousSpacing()
1546
+ }],
1547
+ /**
1548
+ * Padding Block End
1549
+ * @see https://tailwindcss.com/docs/padding
1550
+ */
1551
+ pbe: [{
1552
+ pbe: scaleUnambiguousSpacing()
1553
+ }],
1554
+ /**
1555
+ * Padding Top
1556
+ * @see https://tailwindcss.com/docs/padding
1557
+ */
1558
+ pt: [{
1559
+ pt: scaleUnambiguousSpacing()
1560
+ }],
1561
+ /**
1562
+ * Padding Right
1563
+ * @see https://tailwindcss.com/docs/padding
1564
+ */
1565
+ pr: [{
1566
+ pr: scaleUnambiguousSpacing()
1567
+ }],
1568
+ /**
1569
+ * Padding Bottom
1570
+ * @see https://tailwindcss.com/docs/padding
1571
+ */
1572
+ pb: [{
1573
+ pb: scaleUnambiguousSpacing()
1574
+ }],
1575
+ /**
1576
+ * Padding Left
1577
+ * @see https://tailwindcss.com/docs/padding
1578
+ */
1579
+ pl: [{
1580
+ pl: scaleUnambiguousSpacing()
1581
+ }],
1582
+ /**
1583
+ * Margin
1584
+ * @see https://tailwindcss.com/docs/margin
1585
+ */
1586
+ m: [{
1587
+ m: scaleMargin()
1588
+ }],
1589
+ /**
1590
+ * Margin Inline
1591
+ * @see https://tailwindcss.com/docs/margin
1592
+ */
1593
+ mx: [{
1594
+ mx: scaleMargin()
1595
+ }],
1596
+ /**
1597
+ * Margin Block
1598
+ * @see https://tailwindcss.com/docs/margin
1599
+ */
1600
+ my: [{
1601
+ my: scaleMargin()
1602
+ }],
1603
+ /**
1604
+ * Margin Inline Start
1605
+ * @see https://tailwindcss.com/docs/margin
1606
+ */
1607
+ ms: [{
1608
+ ms: scaleMargin()
1609
+ }],
1610
+ /**
1611
+ * Margin Inline End
1612
+ * @see https://tailwindcss.com/docs/margin
1613
+ */
1614
+ me: [{
1615
+ me: scaleMargin()
1616
+ }],
1617
+ /**
1618
+ * Margin Block Start
1619
+ * @see https://tailwindcss.com/docs/margin
1620
+ */
1621
+ mbs: [{
1622
+ mbs: scaleMargin()
1623
+ }],
1624
+ /**
1625
+ * Margin Block End
1626
+ * @see https://tailwindcss.com/docs/margin
1627
+ */
1628
+ mbe: [{
1629
+ mbe: scaleMargin()
1630
+ }],
1631
+ /**
1632
+ * Margin Top
1633
+ * @see https://tailwindcss.com/docs/margin
1634
+ */
1635
+ mt: [{
1636
+ mt: scaleMargin()
1637
+ }],
1638
+ /**
1639
+ * Margin Right
1640
+ * @see https://tailwindcss.com/docs/margin
1641
+ */
1642
+ mr: [{
1643
+ mr: scaleMargin()
1644
+ }],
1645
+ /**
1646
+ * Margin Bottom
1647
+ * @see https://tailwindcss.com/docs/margin
1648
+ */
1649
+ mb: [{
1650
+ mb: scaleMargin()
1651
+ }],
1652
+ /**
1653
+ * Margin Left
1654
+ * @see https://tailwindcss.com/docs/margin
1655
+ */
1656
+ ml: [{
1657
+ ml: scaleMargin()
1658
+ }],
1659
+ /**
1660
+ * Space Between X
1661
+ * @see https://tailwindcss.com/docs/margin#adding-space-between-children
1662
+ */
1663
+ "space-x": [{
1664
+ "space-x": scaleUnambiguousSpacing()
1665
+ }],
1666
+ /**
1667
+ * Space Between X Reverse
1668
+ * @see https://tailwindcss.com/docs/margin#adding-space-between-children
1669
+ */
1670
+ "space-x-reverse": ["space-x-reverse"],
1671
+ /**
1672
+ * Space Between Y
1673
+ * @see https://tailwindcss.com/docs/margin#adding-space-between-children
1674
+ */
1675
+ "space-y": [{
1676
+ "space-y": scaleUnambiguousSpacing()
1677
+ }],
1678
+ /**
1679
+ * Space Between Y Reverse
1680
+ * @see https://tailwindcss.com/docs/margin#adding-space-between-children
1681
+ */
1682
+ "space-y-reverse": ["space-y-reverse"],
1683
+ // --------------
1684
+ // --- Sizing ---
1685
+ // --------------
1686
+ /**
1687
+ * Size
1688
+ * @see https://tailwindcss.com/docs/width#setting-both-width-and-height
1689
+ */
1690
+ size: [{
1691
+ size: scaleSizing()
1692
+ }],
1693
+ /**
1694
+ * Inline Size
1695
+ * @see https://tailwindcss.com/docs/width
1696
+ */
1697
+ "inline-size": [{
1698
+ inline: ["auto", ...scaleSizingInline()]
1699
+ }],
1700
+ /**
1701
+ * Min-Inline Size
1702
+ * @see https://tailwindcss.com/docs/min-width
1703
+ */
1704
+ "min-inline-size": [{
1705
+ "min-inline": ["auto", ...scaleSizingInline()]
1706
+ }],
1707
+ /**
1708
+ * Max-Inline Size
1709
+ * @see https://tailwindcss.com/docs/max-width
1710
+ */
1711
+ "max-inline-size": [{
1712
+ "max-inline": ["none", ...scaleSizingInline()]
1713
+ }],
1714
+ /**
1715
+ * Block Size
1716
+ * @see https://tailwindcss.com/docs/height
1717
+ */
1718
+ "block-size": [{
1719
+ block: ["auto", ...scaleSizingBlock()]
1720
+ }],
1721
+ /**
1722
+ * Min-Block Size
1723
+ * @see https://tailwindcss.com/docs/min-height
1724
+ */
1725
+ "min-block-size": [{
1726
+ "min-block": ["auto", ...scaleSizingBlock()]
1727
+ }],
1728
+ /**
1729
+ * Max-Block Size
1730
+ * @see https://tailwindcss.com/docs/max-height
1731
+ */
1732
+ "max-block-size": [{
1733
+ "max-block": ["none", ...scaleSizingBlock()]
1734
+ }],
1735
+ /**
1736
+ * Width
1737
+ * @see https://tailwindcss.com/docs/width
1738
+ */
1739
+ w: [{
1740
+ w: [themeContainer, "screen", ...scaleSizing()]
1741
+ }],
1742
+ /**
1743
+ * Min-Width
1744
+ * @see https://tailwindcss.com/docs/min-width
1745
+ */
1746
+ "min-w": [{
1747
+ "min-w": [
1748
+ themeContainer,
1749
+ "screen",
1750
+ /** Deprecated. @see https://github.com/tailwindlabs/tailwindcss.com/issues/2027#issuecomment-2620152757 */
1751
+ "none",
1752
+ ...scaleSizing()
1753
+ ]
1754
+ }],
1755
+ /**
1756
+ * Max-Width
1757
+ * @see https://tailwindcss.com/docs/max-width
1758
+ */
1759
+ "max-w": [{
1760
+ "max-w": [
1761
+ themeContainer,
1762
+ "screen",
1763
+ "none",
1764
+ /** Deprecated since Tailwind CSS v4.0.0. @see https://github.com/tailwindlabs/tailwindcss.com/issues/2027#issuecomment-2620152757 */
1765
+ "prose",
1766
+ /** Deprecated since Tailwind CSS v4.0.0. @see https://github.com/tailwindlabs/tailwindcss.com/issues/2027#issuecomment-2620152757 */
1767
+ {
1768
+ screen: [themeBreakpoint]
1769
+ },
1770
+ ...scaleSizing()
1771
+ ]
1772
+ }],
1773
+ /**
1774
+ * Height
1775
+ * @see https://tailwindcss.com/docs/height
1776
+ */
1777
+ h: [{
1778
+ h: ["screen", "lh", ...scaleSizing()]
1779
+ }],
1780
+ /**
1781
+ * Min-Height
1782
+ * @see https://tailwindcss.com/docs/min-height
1783
+ */
1784
+ "min-h": [{
1785
+ "min-h": ["screen", "lh", "none", ...scaleSizing()]
1786
+ }],
1787
+ /**
1788
+ * Max-Height
1789
+ * @see https://tailwindcss.com/docs/max-height
1790
+ */
1791
+ "max-h": [{
1792
+ "max-h": ["screen", "lh", ...scaleSizing()]
1793
+ }],
1794
+ // ------------------
1795
+ // --- Typography ---
1796
+ // ------------------
1797
+ /**
1798
+ * Font Size
1799
+ * @see https://tailwindcss.com/docs/font-size
1800
+ */
1801
+ "font-size": [{
1802
+ text: ["base", themeText, isArbitraryVariableLength, isArbitraryLength]
1803
+ }],
1804
+ /**
1805
+ * Font Smoothing
1806
+ * @see https://tailwindcss.com/docs/font-smoothing
1807
+ */
1808
+ "font-smoothing": ["antialiased", "subpixel-antialiased"],
1809
+ /**
1810
+ * Font Style
1811
+ * @see https://tailwindcss.com/docs/font-style
1812
+ */
1813
+ "font-style": ["italic", "not-italic"],
1814
+ /**
1815
+ * Font Weight
1816
+ * @see https://tailwindcss.com/docs/font-weight
1817
+ */
1818
+ "font-weight": [{
1819
+ font: [themeFontWeight, isArbitraryVariableWeight, isArbitraryWeight]
1820
+ }],
1821
+ /**
1822
+ * Font Stretch
1823
+ * @see https://tailwindcss.com/docs/font-stretch
1824
+ */
1825
+ "font-stretch": [{
1826
+ "font-stretch": ["ultra-condensed", "extra-condensed", "condensed", "semi-condensed", "normal", "semi-expanded", "expanded", "extra-expanded", "ultra-expanded", isPercent, isArbitraryValue]
1827
+ }],
1828
+ /**
1829
+ * Font Family
1830
+ * @see https://tailwindcss.com/docs/font-family
1831
+ */
1832
+ "font-family": [{
1833
+ font: [isArbitraryVariableFamilyName, isArbitraryFamilyName, themeFont]
1834
+ }],
1835
+ /**
1836
+ * Font Feature Settings
1837
+ * @see https://tailwindcss.com/docs/font-feature-settings
1838
+ */
1839
+ "font-features": [{
1840
+ "font-features": [isArbitraryValue]
1841
+ }],
1842
+ /**
1843
+ * Font Variant Numeric
1844
+ * @see https://tailwindcss.com/docs/font-variant-numeric
1845
+ */
1846
+ "fvn-normal": ["normal-nums"],
1847
+ /**
1848
+ * Font Variant Numeric
1849
+ * @see https://tailwindcss.com/docs/font-variant-numeric
1850
+ */
1851
+ "fvn-ordinal": ["ordinal"],
1852
+ /**
1853
+ * Font Variant Numeric
1854
+ * @see https://tailwindcss.com/docs/font-variant-numeric
1855
+ */
1856
+ "fvn-slashed-zero": ["slashed-zero"],
1857
+ /**
1858
+ * Font Variant Numeric
1859
+ * @see https://tailwindcss.com/docs/font-variant-numeric
1860
+ */
1861
+ "fvn-figure": ["lining-nums", "oldstyle-nums"],
1862
+ /**
1863
+ * Font Variant Numeric
1864
+ * @see https://tailwindcss.com/docs/font-variant-numeric
1865
+ */
1866
+ "fvn-spacing": ["proportional-nums", "tabular-nums"],
1867
+ /**
1868
+ * Font Variant Numeric
1869
+ * @see https://tailwindcss.com/docs/font-variant-numeric
1870
+ */
1871
+ "fvn-fraction": ["diagonal-fractions", "stacked-fractions"],
1872
+ /**
1873
+ * Letter Spacing
1874
+ * @see https://tailwindcss.com/docs/letter-spacing
1875
+ */
1876
+ tracking: [{
1877
+ tracking: [themeTracking, isArbitraryVariable, isArbitraryValue]
1878
+ }],
1879
+ /**
1880
+ * Line Clamp
1881
+ * @see https://tailwindcss.com/docs/line-clamp
1882
+ */
1883
+ "line-clamp": [{
1884
+ "line-clamp": [isNumber, "none", isArbitraryVariable, isArbitraryNumber]
1885
+ }],
1886
+ /**
1887
+ * Line Height
1888
+ * @see https://tailwindcss.com/docs/line-height
1889
+ */
1890
+ leading: [{
1891
+ leading: [
1892
+ /** Deprecated since Tailwind CSS v4.0.0. @see https://github.com/tailwindlabs/tailwindcss.com/issues/2027#issuecomment-2620152757 */
1893
+ themeLeading,
1894
+ ...scaleUnambiguousSpacing()
1895
+ ]
1896
+ }],
1897
+ /**
1898
+ * List Style Image
1899
+ * @see https://tailwindcss.com/docs/list-style-image
1900
+ */
1901
+ "list-image": [{
1902
+ "list-image": ["none", isArbitraryVariable, isArbitraryValue]
1903
+ }],
1904
+ /**
1905
+ * List Style Position
1906
+ * @see https://tailwindcss.com/docs/list-style-position
1907
+ */
1908
+ "list-style-position": [{
1909
+ list: ["inside", "outside"]
1910
+ }],
1911
+ /**
1912
+ * List Style Type
1913
+ * @see https://tailwindcss.com/docs/list-style-type
1914
+ */
1915
+ "list-style-type": [{
1916
+ list: ["disc", "decimal", "none", isArbitraryVariable, isArbitraryValue]
1917
+ }],
1918
+ /**
1919
+ * Text Alignment
1920
+ * @see https://tailwindcss.com/docs/text-align
1921
+ */
1922
+ "text-alignment": [{
1923
+ text: ["left", "center", "right", "justify", "start", "end"]
1924
+ }],
1925
+ /**
1926
+ * Placeholder Color
1927
+ * @deprecated since Tailwind CSS v3.0.0
1928
+ * @see https://v3.tailwindcss.com/docs/placeholder-color
1929
+ */
1930
+ "placeholder-color": [{
1931
+ placeholder: scaleColor()
1932
+ }],
1933
+ /**
1934
+ * Text Color
1935
+ * @see https://tailwindcss.com/docs/text-color
1936
+ */
1937
+ "text-color": [{
1938
+ text: scaleColor()
1939
+ }],
1940
+ /**
1941
+ * Text Decoration
1942
+ * @see https://tailwindcss.com/docs/text-decoration
1943
+ */
1944
+ "text-decoration": ["underline", "overline", "line-through", "no-underline"],
1945
+ /**
1946
+ * Text Decoration Style
1947
+ * @see https://tailwindcss.com/docs/text-decoration-style
1948
+ */
1949
+ "text-decoration-style": [{
1950
+ decoration: [...scaleLineStyle(), "wavy"]
1951
+ }],
1952
+ /**
1953
+ * Text Decoration Thickness
1954
+ * @see https://tailwindcss.com/docs/text-decoration-thickness
1955
+ */
1956
+ "text-decoration-thickness": [{
1957
+ decoration: [isNumber, "from-font", "auto", isArbitraryVariable, isArbitraryLength]
1958
+ }],
1959
+ /**
1960
+ * Text Decoration Color
1961
+ * @see https://tailwindcss.com/docs/text-decoration-color
1962
+ */
1963
+ "text-decoration-color": [{
1964
+ decoration: scaleColor()
1965
+ }],
1966
+ /**
1967
+ * Text Underline Offset
1968
+ * @see https://tailwindcss.com/docs/text-underline-offset
1969
+ */
1970
+ "underline-offset": [{
1971
+ "underline-offset": [isNumber, "auto", isArbitraryVariable, isArbitraryValue]
1972
+ }],
1973
+ /**
1974
+ * Text Transform
1975
+ * @see https://tailwindcss.com/docs/text-transform
1976
+ */
1977
+ "text-transform": ["uppercase", "lowercase", "capitalize", "normal-case"],
1978
+ /**
1979
+ * Text Overflow
1980
+ * @see https://tailwindcss.com/docs/text-overflow
1981
+ */
1982
+ "text-overflow": ["truncate", "text-ellipsis", "text-clip"],
1983
+ /**
1984
+ * Text Wrap
1985
+ * @see https://tailwindcss.com/docs/text-wrap
1986
+ */
1987
+ "text-wrap": [{
1988
+ text: ["wrap", "nowrap", "balance", "pretty"]
1989
+ }],
1990
+ /**
1991
+ * Text Indent
1992
+ * @see https://tailwindcss.com/docs/text-indent
1993
+ */
1994
+ indent: [{
1995
+ indent: scaleUnambiguousSpacing()
1996
+ }],
1997
+ /**
1998
+ * Vertical Alignment
1999
+ * @see https://tailwindcss.com/docs/vertical-align
2000
+ */
2001
+ "vertical-align": [{
2002
+ align: ["baseline", "top", "middle", "bottom", "text-top", "text-bottom", "sub", "super", isArbitraryVariable, isArbitraryValue]
2003
+ }],
2004
+ /**
2005
+ * Whitespace
2006
+ * @see https://tailwindcss.com/docs/whitespace
2007
+ */
2008
+ whitespace: [{
2009
+ whitespace: ["normal", "nowrap", "pre", "pre-line", "pre-wrap", "break-spaces"]
2010
+ }],
2011
+ /**
2012
+ * Word Break
2013
+ * @see https://tailwindcss.com/docs/word-break
2014
+ */
2015
+ break: [{
2016
+ break: ["normal", "words", "all", "keep"]
2017
+ }],
2018
+ /**
2019
+ * Overflow Wrap
2020
+ * @see https://tailwindcss.com/docs/overflow-wrap
2021
+ */
2022
+ wrap: [{
2023
+ wrap: ["break-word", "anywhere", "normal"]
2024
+ }],
2025
+ /**
2026
+ * Hyphens
2027
+ * @see https://tailwindcss.com/docs/hyphens
2028
+ */
2029
+ hyphens: [{
2030
+ hyphens: ["none", "manual", "auto"]
2031
+ }],
2032
+ /**
2033
+ * Content
2034
+ * @see https://tailwindcss.com/docs/content
2035
+ */
2036
+ content: [{
2037
+ content: ["none", isArbitraryVariable, isArbitraryValue]
2038
+ }],
2039
+ // -------------------
2040
+ // --- Backgrounds ---
2041
+ // -------------------
2042
+ /**
2043
+ * Background Attachment
2044
+ * @see https://tailwindcss.com/docs/background-attachment
2045
+ */
2046
+ "bg-attachment": [{
2047
+ bg: ["fixed", "local", "scroll"]
2048
+ }],
2049
+ /**
2050
+ * Background Clip
2051
+ * @see https://tailwindcss.com/docs/background-clip
2052
+ */
2053
+ "bg-clip": [{
2054
+ "bg-clip": ["border", "padding", "content", "text"]
2055
+ }],
2056
+ /**
2057
+ * Background Origin
2058
+ * @see https://tailwindcss.com/docs/background-origin
2059
+ */
2060
+ "bg-origin": [{
2061
+ "bg-origin": ["border", "padding", "content"]
2062
+ }],
2063
+ /**
2064
+ * Background Position
2065
+ * @see https://tailwindcss.com/docs/background-position
2066
+ */
2067
+ "bg-position": [{
2068
+ bg: scaleBgPosition()
2069
+ }],
2070
+ /**
2071
+ * Background Repeat
2072
+ * @see https://tailwindcss.com/docs/background-repeat
2073
+ */
2074
+ "bg-repeat": [{
2075
+ bg: scaleBgRepeat()
2076
+ }],
2077
+ /**
2078
+ * Background Size
2079
+ * @see https://tailwindcss.com/docs/background-size
2080
+ */
2081
+ "bg-size": [{
2082
+ bg: scaleBgSize()
2083
+ }],
2084
+ /**
2085
+ * Background Image
2086
+ * @see https://tailwindcss.com/docs/background-image
2087
+ */
2088
+ "bg-image": [{
2089
+ bg: ["none", {
2090
+ linear: [{
2091
+ to: ["t", "tr", "r", "br", "b", "bl", "l", "tl"]
2092
+ }, isInteger, isArbitraryVariable, isArbitraryValue],
2093
+ radial: ["", isArbitraryVariable, isArbitraryValue],
2094
+ conic: [isInteger, isArbitraryVariable, isArbitraryValue]
2095
+ }, isArbitraryVariableImage, isArbitraryImage]
2096
+ }],
2097
+ /**
2098
+ * Background Color
2099
+ * @see https://tailwindcss.com/docs/background-color
2100
+ */
2101
+ "bg-color": [{
2102
+ bg: scaleColor()
2103
+ }],
2104
+ /**
2105
+ * Gradient Color Stops From Position
2106
+ * @see https://tailwindcss.com/docs/gradient-color-stops
2107
+ */
2108
+ "gradient-from-pos": [{
2109
+ from: scaleGradientStopPosition()
2110
+ }],
2111
+ /**
2112
+ * Gradient Color Stops Via Position
2113
+ * @see https://tailwindcss.com/docs/gradient-color-stops
2114
+ */
2115
+ "gradient-via-pos": [{
2116
+ via: scaleGradientStopPosition()
2117
+ }],
2118
+ /**
2119
+ * Gradient Color Stops To Position
2120
+ * @see https://tailwindcss.com/docs/gradient-color-stops
2121
+ */
2122
+ "gradient-to-pos": [{
2123
+ to: scaleGradientStopPosition()
2124
+ }],
2125
+ /**
2126
+ * Gradient Color Stops From
2127
+ * @see https://tailwindcss.com/docs/gradient-color-stops
2128
+ */
2129
+ "gradient-from": [{
2130
+ from: scaleColor()
2131
+ }],
2132
+ /**
2133
+ * Gradient Color Stops Via
2134
+ * @see https://tailwindcss.com/docs/gradient-color-stops
2135
+ */
2136
+ "gradient-via": [{
2137
+ via: scaleColor()
2138
+ }],
2139
+ /**
2140
+ * Gradient Color Stops To
2141
+ * @see https://tailwindcss.com/docs/gradient-color-stops
2142
+ */
2143
+ "gradient-to": [{
2144
+ to: scaleColor()
2145
+ }],
2146
+ // ---------------
2147
+ // --- Borders ---
2148
+ // ---------------
2149
+ /**
2150
+ * Border Radius
2151
+ * @see https://tailwindcss.com/docs/border-radius
2152
+ */
2153
+ rounded: [{
2154
+ rounded: scaleRadius()
2155
+ }],
2156
+ /**
2157
+ * Border Radius Start
2158
+ * @see https://tailwindcss.com/docs/border-radius
2159
+ */
2160
+ "rounded-s": [{
2161
+ "rounded-s": scaleRadius()
2162
+ }],
2163
+ /**
2164
+ * Border Radius End
2165
+ * @see https://tailwindcss.com/docs/border-radius
2166
+ */
2167
+ "rounded-e": [{
2168
+ "rounded-e": scaleRadius()
2169
+ }],
2170
+ /**
2171
+ * Border Radius Top
2172
+ * @see https://tailwindcss.com/docs/border-radius
2173
+ */
2174
+ "rounded-t": [{
2175
+ "rounded-t": scaleRadius()
2176
+ }],
2177
+ /**
2178
+ * Border Radius Right
2179
+ * @see https://tailwindcss.com/docs/border-radius
2180
+ */
2181
+ "rounded-r": [{
2182
+ "rounded-r": scaleRadius()
2183
+ }],
2184
+ /**
2185
+ * Border Radius Bottom
2186
+ * @see https://tailwindcss.com/docs/border-radius
2187
+ */
2188
+ "rounded-b": [{
2189
+ "rounded-b": scaleRadius()
2190
+ }],
2191
+ /**
2192
+ * Border Radius Left
2193
+ * @see https://tailwindcss.com/docs/border-radius
2194
+ */
2195
+ "rounded-l": [{
2196
+ "rounded-l": scaleRadius()
2197
+ }],
2198
+ /**
2199
+ * Border Radius Start Start
2200
+ * @see https://tailwindcss.com/docs/border-radius
2201
+ */
2202
+ "rounded-ss": [{
2203
+ "rounded-ss": scaleRadius()
2204
+ }],
2205
+ /**
2206
+ * Border Radius Start End
2207
+ * @see https://tailwindcss.com/docs/border-radius
2208
+ */
2209
+ "rounded-se": [{
2210
+ "rounded-se": scaleRadius()
2211
+ }],
2212
+ /**
2213
+ * Border Radius End End
2214
+ * @see https://tailwindcss.com/docs/border-radius
2215
+ */
2216
+ "rounded-ee": [{
2217
+ "rounded-ee": scaleRadius()
2218
+ }],
2219
+ /**
2220
+ * Border Radius End Start
2221
+ * @see https://tailwindcss.com/docs/border-radius
2222
+ */
2223
+ "rounded-es": [{
2224
+ "rounded-es": scaleRadius()
2225
+ }],
2226
+ /**
2227
+ * Border Radius Top Left
2228
+ * @see https://tailwindcss.com/docs/border-radius
2229
+ */
2230
+ "rounded-tl": [{
2231
+ "rounded-tl": scaleRadius()
2232
+ }],
2233
+ /**
2234
+ * Border Radius Top Right
2235
+ * @see https://tailwindcss.com/docs/border-radius
2236
+ */
2237
+ "rounded-tr": [{
2238
+ "rounded-tr": scaleRadius()
2239
+ }],
2240
+ /**
2241
+ * Border Radius Bottom Right
2242
+ * @see https://tailwindcss.com/docs/border-radius
2243
+ */
2244
+ "rounded-br": [{
2245
+ "rounded-br": scaleRadius()
2246
+ }],
2247
+ /**
2248
+ * Border Radius Bottom Left
2249
+ * @see https://tailwindcss.com/docs/border-radius
2250
+ */
2251
+ "rounded-bl": [{
2252
+ "rounded-bl": scaleRadius()
2253
+ }],
2254
+ /**
2255
+ * Border Width
2256
+ * @see https://tailwindcss.com/docs/border-width
2257
+ */
2258
+ "border-w": [{
2259
+ border: scaleBorderWidth()
2260
+ }],
2261
+ /**
2262
+ * Border Width Inline
2263
+ * @see https://tailwindcss.com/docs/border-width
2264
+ */
2265
+ "border-w-x": [{
2266
+ "border-x": scaleBorderWidth()
2267
+ }],
2268
+ /**
2269
+ * Border Width Block
2270
+ * @see https://tailwindcss.com/docs/border-width
2271
+ */
2272
+ "border-w-y": [{
2273
+ "border-y": scaleBorderWidth()
2274
+ }],
2275
+ /**
2276
+ * Border Width Inline Start
2277
+ * @see https://tailwindcss.com/docs/border-width
2278
+ */
2279
+ "border-w-s": [{
2280
+ "border-s": scaleBorderWidth()
2281
+ }],
2282
+ /**
2283
+ * Border Width Inline End
2284
+ * @see https://tailwindcss.com/docs/border-width
2285
+ */
2286
+ "border-w-e": [{
2287
+ "border-e": scaleBorderWidth()
2288
+ }],
2289
+ /**
2290
+ * Border Width Block Start
2291
+ * @see https://tailwindcss.com/docs/border-width
2292
+ */
2293
+ "border-w-bs": [{
2294
+ "border-bs": scaleBorderWidth()
2295
+ }],
2296
+ /**
2297
+ * Border Width Block End
2298
+ * @see https://tailwindcss.com/docs/border-width
2299
+ */
2300
+ "border-w-be": [{
2301
+ "border-be": scaleBorderWidth()
2302
+ }],
2303
+ /**
2304
+ * Border Width Top
2305
+ * @see https://tailwindcss.com/docs/border-width
2306
+ */
2307
+ "border-w-t": [{
2308
+ "border-t": scaleBorderWidth()
2309
+ }],
2310
+ /**
2311
+ * Border Width Right
2312
+ * @see https://tailwindcss.com/docs/border-width
2313
+ */
2314
+ "border-w-r": [{
2315
+ "border-r": scaleBorderWidth()
2316
+ }],
2317
+ /**
2318
+ * Border Width Bottom
2319
+ * @see https://tailwindcss.com/docs/border-width
2320
+ */
2321
+ "border-w-b": [{
2322
+ "border-b": scaleBorderWidth()
2323
+ }],
2324
+ /**
2325
+ * Border Width Left
2326
+ * @see https://tailwindcss.com/docs/border-width
2327
+ */
2328
+ "border-w-l": [{
2329
+ "border-l": scaleBorderWidth()
2330
+ }],
2331
+ /**
2332
+ * Divide Width X
2333
+ * @see https://tailwindcss.com/docs/border-width#between-children
2334
+ */
2335
+ "divide-x": [{
2336
+ "divide-x": scaleBorderWidth()
2337
+ }],
2338
+ /**
2339
+ * Divide Width X Reverse
2340
+ * @see https://tailwindcss.com/docs/border-width#between-children
2341
+ */
2342
+ "divide-x-reverse": ["divide-x-reverse"],
2343
+ /**
2344
+ * Divide Width Y
2345
+ * @see https://tailwindcss.com/docs/border-width#between-children
2346
+ */
2347
+ "divide-y": [{
2348
+ "divide-y": scaleBorderWidth()
2349
+ }],
2350
+ /**
2351
+ * Divide Width Y Reverse
2352
+ * @see https://tailwindcss.com/docs/border-width#between-children
2353
+ */
2354
+ "divide-y-reverse": ["divide-y-reverse"],
2355
+ /**
2356
+ * Border Style
2357
+ * @see https://tailwindcss.com/docs/border-style
2358
+ */
2359
+ "border-style": [{
2360
+ border: [...scaleLineStyle(), "hidden", "none"]
2361
+ }],
2362
+ /**
2363
+ * Divide Style
2364
+ * @see https://tailwindcss.com/docs/border-style#setting-the-divider-style
2365
+ */
2366
+ "divide-style": [{
2367
+ divide: [...scaleLineStyle(), "hidden", "none"]
2368
+ }],
2369
+ /**
2370
+ * Border Color
2371
+ * @see https://tailwindcss.com/docs/border-color
2372
+ */
2373
+ "border-color": [{
2374
+ border: scaleColor()
2375
+ }],
2376
+ /**
2377
+ * Border Color Inline
2378
+ * @see https://tailwindcss.com/docs/border-color
2379
+ */
2380
+ "border-color-x": [{
2381
+ "border-x": scaleColor()
2382
+ }],
2383
+ /**
2384
+ * Border Color Block
2385
+ * @see https://tailwindcss.com/docs/border-color
2386
+ */
2387
+ "border-color-y": [{
2388
+ "border-y": scaleColor()
2389
+ }],
2390
+ /**
2391
+ * Border Color Inline Start
2392
+ * @see https://tailwindcss.com/docs/border-color
2393
+ */
2394
+ "border-color-s": [{
2395
+ "border-s": scaleColor()
2396
+ }],
2397
+ /**
2398
+ * Border Color Inline End
2399
+ * @see https://tailwindcss.com/docs/border-color
2400
+ */
2401
+ "border-color-e": [{
2402
+ "border-e": scaleColor()
2403
+ }],
2404
+ /**
2405
+ * Border Color Block Start
2406
+ * @see https://tailwindcss.com/docs/border-color
2407
+ */
2408
+ "border-color-bs": [{
2409
+ "border-bs": scaleColor()
2410
+ }],
2411
+ /**
2412
+ * Border Color Block End
2413
+ * @see https://tailwindcss.com/docs/border-color
2414
+ */
2415
+ "border-color-be": [{
2416
+ "border-be": scaleColor()
2417
+ }],
2418
+ /**
2419
+ * Border Color Top
2420
+ * @see https://tailwindcss.com/docs/border-color
2421
+ */
2422
+ "border-color-t": [{
2423
+ "border-t": scaleColor()
2424
+ }],
2425
+ /**
2426
+ * Border Color Right
2427
+ * @see https://tailwindcss.com/docs/border-color
2428
+ */
2429
+ "border-color-r": [{
2430
+ "border-r": scaleColor()
2431
+ }],
2432
+ /**
2433
+ * Border Color Bottom
2434
+ * @see https://tailwindcss.com/docs/border-color
2435
+ */
2436
+ "border-color-b": [{
2437
+ "border-b": scaleColor()
2438
+ }],
2439
+ /**
2440
+ * Border Color Left
2441
+ * @see https://tailwindcss.com/docs/border-color
2442
+ */
2443
+ "border-color-l": [{
2444
+ "border-l": scaleColor()
2445
+ }],
2446
+ /**
2447
+ * Divide Color
2448
+ * @see https://tailwindcss.com/docs/divide-color
2449
+ */
2450
+ "divide-color": [{
2451
+ divide: scaleColor()
2452
+ }],
2453
+ /**
2454
+ * Outline Style
2455
+ * @see https://tailwindcss.com/docs/outline-style
2456
+ */
2457
+ "outline-style": [{
2458
+ outline: [...scaleLineStyle(), "none", "hidden"]
2459
+ }],
2460
+ /**
2461
+ * Outline Offset
2462
+ * @see https://tailwindcss.com/docs/outline-offset
2463
+ */
2464
+ "outline-offset": [{
2465
+ "outline-offset": [isNumber, isArbitraryVariable, isArbitraryValue]
2466
+ }],
2467
+ /**
2468
+ * Outline Width
2469
+ * @see https://tailwindcss.com/docs/outline-width
2470
+ */
2471
+ "outline-w": [{
2472
+ outline: ["", isNumber, isArbitraryVariableLength, isArbitraryLength]
2473
+ }],
2474
+ /**
2475
+ * Outline Color
2476
+ * @see https://tailwindcss.com/docs/outline-color
2477
+ */
2478
+ "outline-color": [{
2479
+ outline: scaleColor()
2480
+ }],
2481
+ // ---------------
2482
+ // --- Effects ---
2483
+ // ---------------
2484
+ /**
2485
+ * Box Shadow
2486
+ * @see https://tailwindcss.com/docs/box-shadow
2487
+ */
2488
+ shadow: [{
2489
+ shadow: [
2490
+ // Deprecated since Tailwind CSS v4.0.0
2491
+ "",
2492
+ "none",
2493
+ themeShadow,
2494
+ isArbitraryVariableShadow,
2495
+ isArbitraryShadow
2496
+ ]
2497
+ }],
2498
+ /**
2499
+ * Box Shadow Color
2500
+ * @see https://tailwindcss.com/docs/box-shadow#setting-the-shadow-color
2501
+ */
2502
+ "shadow-color": [{
2503
+ shadow: scaleColor()
2504
+ }],
2505
+ /**
2506
+ * Inset Box Shadow
2507
+ * @see https://tailwindcss.com/docs/box-shadow#adding-an-inset-shadow
2508
+ */
2509
+ "inset-shadow": [{
2510
+ "inset-shadow": ["none", themeInsetShadow, isArbitraryVariableShadow, isArbitraryShadow]
2511
+ }],
2512
+ /**
2513
+ * Inset Box Shadow Color
2514
+ * @see https://tailwindcss.com/docs/box-shadow#setting-the-inset-shadow-color
2515
+ */
2516
+ "inset-shadow-color": [{
2517
+ "inset-shadow": scaleColor()
2518
+ }],
2519
+ /**
2520
+ * Ring Width
2521
+ * @see https://tailwindcss.com/docs/box-shadow#adding-a-ring
2522
+ */
2523
+ "ring-w": [{
2524
+ ring: scaleBorderWidth()
2525
+ }],
2526
+ /**
2527
+ * Ring Width Inset
2528
+ * @see https://v3.tailwindcss.com/docs/ring-width#inset-rings
2529
+ * @deprecated since Tailwind CSS v4.0.0
2530
+ * @see https://github.com/tailwindlabs/tailwindcss/blob/v4.0.0/packages/tailwindcss/src/utilities.ts#L4158
2531
+ */
2532
+ "ring-w-inset": ["ring-inset"],
2533
+ /**
2534
+ * Ring Color
2535
+ * @see https://tailwindcss.com/docs/box-shadow#setting-the-ring-color
2536
+ */
2537
+ "ring-color": [{
2538
+ ring: scaleColor()
2539
+ }],
2540
+ /**
2541
+ * Ring Offset Width
2542
+ * @see https://v3.tailwindcss.com/docs/ring-offset-width
2543
+ * @deprecated since Tailwind CSS v4.0.0
2544
+ * @see https://github.com/tailwindlabs/tailwindcss/blob/v4.0.0/packages/tailwindcss/src/utilities.ts#L4158
2545
+ */
2546
+ "ring-offset-w": [{
2547
+ "ring-offset": [isNumber, isArbitraryLength]
2548
+ }],
2549
+ /**
2550
+ * Ring Offset Color
2551
+ * @see https://v3.tailwindcss.com/docs/ring-offset-color
2552
+ * @deprecated since Tailwind CSS v4.0.0
2553
+ * @see https://github.com/tailwindlabs/tailwindcss/blob/v4.0.0/packages/tailwindcss/src/utilities.ts#L4158
2554
+ */
2555
+ "ring-offset-color": [{
2556
+ "ring-offset": scaleColor()
2557
+ }],
2558
+ /**
2559
+ * Inset Ring Width
2560
+ * @see https://tailwindcss.com/docs/box-shadow#adding-an-inset-ring
2561
+ */
2562
+ "inset-ring-w": [{
2563
+ "inset-ring": scaleBorderWidth()
2564
+ }],
2565
+ /**
2566
+ * Inset Ring Color
2567
+ * @see https://tailwindcss.com/docs/box-shadow#setting-the-inset-ring-color
2568
+ */
2569
+ "inset-ring-color": [{
2570
+ "inset-ring": scaleColor()
2571
+ }],
2572
+ /**
2573
+ * Text Shadow
2574
+ * @see https://tailwindcss.com/docs/text-shadow
2575
+ */
2576
+ "text-shadow": [{
2577
+ "text-shadow": ["none", themeTextShadow, isArbitraryVariableShadow, isArbitraryShadow]
2578
+ }],
2579
+ /**
2580
+ * Text Shadow Color
2581
+ * @see https://tailwindcss.com/docs/text-shadow#setting-the-shadow-color
2582
+ */
2583
+ "text-shadow-color": [{
2584
+ "text-shadow": scaleColor()
2585
+ }],
2586
+ /**
2587
+ * Opacity
2588
+ * @see https://tailwindcss.com/docs/opacity
2589
+ */
2590
+ opacity: [{
2591
+ opacity: [isNumber, isArbitraryVariable, isArbitraryValue]
2592
+ }],
2593
+ /**
2594
+ * Mix Blend Mode
2595
+ * @see https://tailwindcss.com/docs/mix-blend-mode
2596
+ */
2597
+ "mix-blend": [{
2598
+ "mix-blend": [...scaleBlendMode(), "plus-darker", "plus-lighter"]
2599
+ }],
2600
+ /**
2601
+ * Background Blend Mode
2602
+ * @see https://tailwindcss.com/docs/background-blend-mode
2603
+ */
2604
+ "bg-blend": [{
2605
+ "bg-blend": scaleBlendMode()
2606
+ }],
2607
+ /**
2608
+ * Mask Clip
2609
+ * @see https://tailwindcss.com/docs/mask-clip
2610
+ */
2611
+ "mask-clip": [{
2612
+ "mask-clip": ["border", "padding", "content", "fill", "stroke", "view"]
2613
+ }, "mask-no-clip"],
2614
+ /**
2615
+ * Mask Composite
2616
+ * @see https://tailwindcss.com/docs/mask-composite
2617
+ */
2618
+ "mask-composite": [{
2619
+ mask: ["add", "subtract", "intersect", "exclude"]
2620
+ }],
2621
+ /**
2622
+ * Mask Image
2623
+ * @see https://tailwindcss.com/docs/mask-image
2624
+ */
2625
+ "mask-image-linear-pos": [{
2626
+ "mask-linear": [isNumber]
2627
+ }],
2628
+ "mask-image-linear-from-pos": [{
2629
+ "mask-linear-from": scaleMaskImagePosition()
2630
+ }],
2631
+ "mask-image-linear-to-pos": [{
2632
+ "mask-linear-to": scaleMaskImagePosition()
2633
+ }],
2634
+ "mask-image-linear-from-color": [{
2635
+ "mask-linear-from": scaleColor()
2636
+ }],
2637
+ "mask-image-linear-to-color": [{
2638
+ "mask-linear-to": scaleColor()
2639
+ }],
2640
+ "mask-image-t-from-pos": [{
2641
+ "mask-t-from": scaleMaskImagePosition()
2642
+ }],
2643
+ "mask-image-t-to-pos": [{
2644
+ "mask-t-to": scaleMaskImagePosition()
2645
+ }],
2646
+ "mask-image-t-from-color": [{
2647
+ "mask-t-from": scaleColor()
2648
+ }],
2649
+ "mask-image-t-to-color": [{
2650
+ "mask-t-to": scaleColor()
2651
+ }],
2652
+ "mask-image-r-from-pos": [{
2653
+ "mask-r-from": scaleMaskImagePosition()
2654
+ }],
2655
+ "mask-image-r-to-pos": [{
2656
+ "mask-r-to": scaleMaskImagePosition()
2657
+ }],
2658
+ "mask-image-r-from-color": [{
2659
+ "mask-r-from": scaleColor()
2660
+ }],
2661
+ "mask-image-r-to-color": [{
2662
+ "mask-r-to": scaleColor()
2663
+ }],
2664
+ "mask-image-b-from-pos": [{
2665
+ "mask-b-from": scaleMaskImagePosition()
2666
+ }],
2667
+ "mask-image-b-to-pos": [{
2668
+ "mask-b-to": scaleMaskImagePosition()
2669
+ }],
2670
+ "mask-image-b-from-color": [{
2671
+ "mask-b-from": scaleColor()
2672
+ }],
2673
+ "mask-image-b-to-color": [{
2674
+ "mask-b-to": scaleColor()
2675
+ }],
2676
+ "mask-image-l-from-pos": [{
2677
+ "mask-l-from": scaleMaskImagePosition()
2678
+ }],
2679
+ "mask-image-l-to-pos": [{
2680
+ "mask-l-to": scaleMaskImagePosition()
2681
+ }],
2682
+ "mask-image-l-from-color": [{
2683
+ "mask-l-from": scaleColor()
2684
+ }],
2685
+ "mask-image-l-to-color": [{
2686
+ "mask-l-to": scaleColor()
2687
+ }],
2688
+ "mask-image-x-from-pos": [{
2689
+ "mask-x-from": scaleMaskImagePosition()
2690
+ }],
2691
+ "mask-image-x-to-pos": [{
2692
+ "mask-x-to": scaleMaskImagePosition()
2693
+ }],
2694
+ "mask-image-x-from-color": [{
2695
+ "mask-x-from": scaleColor()
2696
+ }],
2697
+ "mask-image-x-to-color": [{
2698
+ "mask-x-to": scaleColor()
2699
+ }],
2700
+ "mask-image-y-from-pos": [{
2701
+ "mask-y-from": scaleMaskImagePosition()
2702
+ }],
2703
+ "mask-image-y-to-pos": [{
2704
+ "mask-y-to": scaleMaskImagePosition()
2705
+ }],
2706
+ "mask-image-y-from-color": [{
2707
+ "mask-y-from": scaleColor()
2708
+ }],
2709
+ "mask-image-y-to-color": [{
2710
+ "mask-y-to": scaleColor()
2711
+ }],
2712
+ "mask-image-radial": [{
2713
+ "mask-radial": [isArbitraryVariable, isArbitraryValue]
2714
+ }],
2715
+ "mask-image-radial-from-pos": [{
2716
+ "mask-radial-from": scaleMaskImagePosition()
2717
+ }],
2718
+ "mask-image-radial-to-pos": [{
2719
+ "mask-radial-to": scaleMaskImagePosition()
2720
+ }],
2721
+ "mask-image-radial-from-color": [{
2722
+ "mask-radial-from": scaleColor()
2723
+ }],
2724
+ "mask-image-radial-to-color": [{
2725
+ "mask-radial-to": scaleColor()
2726
+ }],
2727
+ "mask-image-radial-shape": [{
2728
+ "mask-radial": ["circle", "ellipse"]
2729
+ }],
2730
+ "mask-image-radial-size": [{
2731
+ "mask-radial": [{
2732
+ closest: ["side", "corner"],
2733
+ farthest: ["side", "corner"]
2734
+ }]
2735
+ }],
2736
+ "mask-image-radial-pos": [{
2737
+ "mask-radial-at": scalePosition()
2738
+ }],
2739
+ "mask-image-conic-pos": [{
2740
+ "mask-conic": [isNumber]
2741
+ }],
2742
+ "mask-image-conic-from-pos": [{
2743
+ "mask-conic-from": scaleMaskImagePosition()
2744
+ }],
2745
+ "mask-image-conic-to-pos": [{
2746
+ "mask-conic-to": scaleMaskImagePosition()
2747
+ }],
2748
+ "mask-image-conic-from-color": [{
2749
+ "mask-conic-from": scaleColor()
2750
+ }],
2751
+ "mask-image-conic-to-color": [{
2752
+ "mask-conic-to": scaleColor()
2753
+ }],
2754
+ /**
2755
+ * Mask Mode
2756
+ * @see https://tailwindcss.com/docs/mask-mode
2757
+ */
2758
+ "mask-mode": [{
2759
+ mask: ["alpha", "luminance", "match"]
2760
+ }],
2761
+ /**
2762
+ * Mask Origin
2763
+ * @see https://tailwindcss.com/docs/mask-origin
2764
+ */
2765
+ "mask-origin": [{
2766
+ "mask-origin": ["border", "padding", "content", "fill", "stroke", "view"]
2767
+ }],
2768
+ /**
2769
+ * Mask Position
2770
+ * @see https://tailwindcss.com/docs/mask-position
2771
+ */
2772
+ "mask-position": [{
2773
+ mask: scaleBgPosition()
2774
+ }],
2775
+ /**
2776
+ * Mask Repeat
2777
+ * @see https://tailwindcss.com/docs/mask-repeat
2778
+ */
2779
+ "mask-repeat": [{
2780
+ mask: scaleBgRepeat()
2781
+ }],
2782
+ /**
2783
+ * Mask Size
2784
+ * @see https://tailwindcss.com/docs/mask-size
2785
+ */
2786
+ "mask-size": [{
2787
+ mask: scaleBgSize()
2788
+ }],
2789
+ /**
2790
+ * Mask Type
2791
+ * @see https://tailwindcss.com/docs/mask-type
2792
+ */
2793
+ "mask-type": [{
2794
+ "mask-type": ["alpha", "luminance"]
2795
+ }],
2796
+ /**
2797
+ * Mask Image
2798
+ * @see https://tailwindcss.com/docs/mask-image
2799
+ */
2800
+ "mask-image": [{
2801
+ mask: ["none", isArbitraryVariable, isArbitraryValue]
2802
+ }],
2803
+ // ---------------
2804
+ // --- Filters ---
2805
+ // ---------------
2806
+ /**
2807
+ * Filter
2808
+ * @see https://tailwindcss.com/docs/filter
2809
+ */
2810
+ filter: [{
2811
+ filter: [
2812
+ // Deprecated since Tailwind CSS v3.0.0
2813
+ "",
2814
+ "none",
2815
+ isArbitraryVariable,
2816
+ isArbitraryValue
2817
+ ]
2818
+ }],
2819
+ /**
2820
+ * Blur
2821
+ * @see https://tailwindcss.com/docs/blur
2822
+ */
2823
+ blur: [{
2824
+ blur: scaleBlur()
2825
+ }],
2826
+ /**
2827
+ * Brightness
2828
+ * @see https://tailwindcss.com/docs/brightness
2829
+ */
2830
+ brightness: [{
2831
+ brightness: [isNumber, isArbitraryVariable, isArbitraryValue]
2832
+ }],
2833
+ /**
2834
+ * Contrast
2835
+ * @see https://tailwindcss.com/docs/contrast
2836
+ */
2837
+ contrast: [{
2838
+ contrast: [isNumber, isArbitraryVariable, isArbitraryValue]
2839
+ }],
2840
+ /**
2841
+ * Drop Shadow
2842
+ * @see https://tailwindcss.com/docs/drop-shadow
2843
+ */
2844
+ "drop-shadow": [{
2845
+ "drop-shadow": [
2846
+ // Deprecated since Tailwind CSS v4.0.0
2847
+ "",
2848
+ "none",
2849
+ themeDropShadow,
2850
+ isArbitraryVariableShadow,
2851
+ isArbitraryShadow
2852
+ ]
2853
+ }],
2854
+ /**
2855
+ * Drop Shadow Color
2856
+ * @see https://tailwindcss.com/docs/filter-drop-shadow#setting-the-shadow-color
2857
+ */
2858
+ "drop-shadow-color": [{
2859
+ "drop-shadow": scaleColor()
2860
+ }],
2861
+ /**
2862
+ * Grayscale
2863
+ * @see https://tailwindcss.com/docs/grayscale
2864
+ */
2865
+ grayscale: [{
2866
+ grayscale: ["", isNumber, isArbitraryVariable, isArbitraryValue]
2867
+ }],
2868
+ /**
2869
+ * Hue Rotate
2870
+ * @see https://tailwindcss.com/docs/hue-rotate
2871
+ */
2872
+ "hue-rotate": [{
2873
+ "hue-rotate": [isNumber, isArbitraryVariable, isArbitraryValue]
2874
+ }],
2875
+ /**
2876
+ * Invert
2877
+ * @see https://tailwindcss.com/docs/invert
2878
+ */
2879
+ invert: [{
2880
+ invert: ["", isNumber, isArbitraryVariable, isArbitraryValue]
2881
+ }],
2882
+ /**
2883
+ * Saturate
2884
+ * @see https://tailwindcss.com/docs/saturate
2885
+ */
2886
+ saturate: [{
2887
+ saturate: [isNumber, isArbitraryVariable, isArbitraryValue]
2888
+ }],
2889
+ /**
2890
+ * Sepia
2891
+ * @see https://tailwindcss.com/docs/sepia
2892
+ */
2893
+ sepia: [{
2894
+ sepia: ["", isNumber, isArbitraryVariable, isArbitraryValue]
2895
+ }],
2896
+ /**
2897
+ * Backdrop Filter
2898
+ * @see https://tailwindcss.com/docs/backdrop-filter
2899
+ */
2900
+ "backdrop-filter": [{
2901
+ "backdrop-filter": [
2902
+ // Deprecated since Tailwind CSS v3.0.0
2903
+ "",
2904
+ "none",
2905
+ isArbitraryVariable,
2906
+ isArbitraryValue
2907
+ ]
2908
+ }],
2909
+ /**
2910
+ * Backdrop Blur
2911
+ * @see https://tailwindcss.com/docs/backdrop-blur
2912
+ */
2913
+ "backdrop-blur": [{
2914
+ "backdrop-blur": scaleBlur()
2915
+ }],
2916
+ /**
2917
+ * Backdrop Brightness
2918
+ * @see https://tailwindcss.com/docs/backdrop-brightness
2919
+ */
2920
+ "backdrop-brightness": [{
2921
+ "backdrop-brightness": [isNumber, isArbitraryVariable, isArbitraryValue]
2922
+ }],
2923
+ /**
2924
+ * Backdrop Contrast
2925
+ * @see https://tailwindcss.com/docs/backdrop-contrast
2926
+ */
2927
+ "backdrop-contrast": [{
2928
+ "backdrop-contrast": [isNumber, isArbitraryVariable, isArbitraryValue]
2929
+ }],
2930
+ /**
2931
+ * Backdrop Grayscale
2932
+ * @see https://tailwindcss.com/docs/backdrop-grayscale
2933
+ */
2934
+ "backdrop-grayscale": [{
2935
+ "backdrop-grayscale": ["", isNumber, isArbitraryVariable, isArbitraryValue]
2936
+ }],
2937
+ /**
2938
+ * Backdrop Hue Rotate
2939
+ * @see https://tailwindcss.com/docs/backdrop-hue-rotate
2940
+ */
2941
+ "backdrop-hue-rotate": [{
2942
+ "backdrop-hue-rotate": [isNumber, isArbitraryVariable, isArbitraryValue]
2943
+ }],
2944
+ /**
2945
+ * Backdrop Invert
2946
+ * @see https://tailwindcss.com/docs/backdrop-invert
2947
+ */
2948
+ "backdrop-invert": [{
2949
+ "backdrop-invert": ["", isNumber, isArbitraryVariable, isArbitraryValue]
2950
+ }],
2951
+ /**
2952
+ * Backdrop Opacity
2953
+ * @see https://tailwindcss.com/docs/backdrop-opacity
2954
+ */
2955
+ "backdrop-opacity": [{
2956
+ "backdrop-opacity": [isNumber, isArbitraryVariable, isArbitraryValue]
2957
+ }],
2958
+ /**
2959
+ * Backdrop Saturate
2960
+ * @see https://tailwindcss.com/docs/backdrop-saturate
2961
+ */
2962
+ "backdrop-saturate": [{
2963
+ "backdrop-saturate": [isNumber, isArbitraryVariable, isArbitraryValue]
2964
+ }],
2965
+ /**
2966
+ * Backdrop Sepia
2967
+ * @see https://tailwindcss.com/docs/backdrop-sepia
2968
+ */
2969
+ "backdrop-sepia": [{
2970
+ "backdrop-sepia": ["", isNumber, isArbitraryVariable, isArbitraryValue]
2971
+ }],
2972
+ // --------------
2973
+ // --- Tables ---
2974
+ // --------------
2975
+ /**
2976
+ * Border Collapse
2977
+ * @see https://tailwindcss.com/docs/border-collapse
2978
+ */
2979
+ "border-collapse": [{
2980
+ border: ["collapse", "separate"]
2981
+ }],
2982
+ /**
2983
+ * Border Spacing
2984
+ * @see https://tailwindcss.com/docs/border-spacing
2985
+ */
2986
+ "border-spacing": [{
2987
+ "border-spacing": scaleUnambiguousSpacing()
2988
+ }],
2989
+ /**
2990
+ * Border Spacing X
2991
+ * @see https://tailwindcss.com/docs/border-spacing
2992
+ */
2993
+ "border-spacing-x": [{
2994
+ "border-spacing-x": scaleUnambiguousSpacing()
2995
+ }],
2996
+ /**
2997
+ * Border Spacing Y
2998
+ * @see https://tailwindcss.com/docs/border-spacing
2999
+ */
3000
+ "border-spacing-y": [{
3001
+ "border-spacing-y": scaleUnambiguousSpacing()
3002
+ }],
3003
+ /**
3004
+ * Table Layout
3005
+ * @see https://tailwindcss.com/docs/table-layout
3006
+ */
3007
+ "table-layout": [{
3008
+ table: ["auto", "fixed"]
3009
+ }],
3010
+ /**
3011
+ * Caption Side
3012
+ * @see https://tailwindcss.com/docs/caption-side
3013
+ */
3014
+ caption: [{
3015
+ caption: ["top", "bottom"]
3016
+ }],
3017
+ // ---------------------------------
3018
+ // --- Transitions and Animation ---
3019
+ // ---------------------------------
3020
+ /**
3021
+ * Transition Property
3022
+ * @see https://tailwindcss.com/docs/transition-property
3023
+ */
3024
+ transition: [{
3025
+ transition: ["", "all", "colors", "opacity", "shadow", "transform", "none", isArbitraryVariable, isArbitraryValue]
3026
+ }],
3027
+ /**
3028
+ * Transition Behavior
3029
+ * @see https://tailwindcss.com/docs/transition-behavior
3030
+ */
3031
+ "transition-behavior": [{
3032
+ transition: ["normal", "discrete"]
3033
+ }],
3034
+ /**
3035
+ * Transition Duration
3036
+ * @see https://tailwindcss.com/docs/transition-duration
3037
+ */
3038
+ duration: [{
3039
+ duration: [isNumber, "initial", isArbitraryVariable, isArbitraryValue]
3040
+ }],
3041
+ /**
3042
+ * Transition Timing Function
3043
+ * @see https://tailwindcss.com/docs/transition-timing-function
3044
+ */
3045
+ ease: [{
3046
+ ease: ["linear", "initial", themeEase, isArbitraryVariable, isArbitraryValue]
3047
+ }],
3048
+ /**
3049
+ * Transition Delay
3050
+ * @see https://tailwindcss.com/docs/transition-delay
3051
+ */
3052
+ delay: [{
3053
+ delay: [isNumber, isArbitraryVariable, isArbitraryValue]
3054
+ }],
3055
+ /**
3056
+ * Animation
3057
+ * @see https://tailwindcss.com/docs/animation
3058
+ */
3059
+ animate: [{
3060
+ animate: ["none", themeAnimate, isArbitraryVariable, isArbitraryValue]
3061
+ }],
3062
+ // ------------------
3063
+ // --- Transforms ---
3064
+ // ------------------
3065
+ /**
3066
+ * Backface Visibility
3067
+ * @see https://tailwindcss.com/docs/backface-visibility
3068
+ */
3069
+ backface: [{
3070
+ backface: ["hidden", "visible"]
3071
+ }],
3072
+ /**
3073
+ * Perspective
3074
+ * @see https://tailwindcss.com/docs/perspective
3075
+ */
3076
+ perspective: [{
3077
+ perspective: [themePerspective, isArbitraryVariable, isArbitraryValue]
3078
+ }],
3079
+ /**
3080
+ * Perspective Origin
3081
+ * @see https://tailwindcss.com/docs/perspective-origin
3082
+ */
3083
+ "perspective-origin": [{
3084
+ "perspective-origin": scalePositionWithArbitrary()
3085
+ }],
3086
+ /**
3087
+ * Rotate
3088
+ * @see https://tailwindcss.com/docs/rotate
3089
+ */
3090
+ rotate: [{
3091
+ rotate: scaleRotate()
3092
+ }],
3093
+ /**
3094
+ * Rotate X
3095
+ * @see https://tailwindcss.com/docs/rotate
3096
+ */
3097
+ "rotate-x": [{
3098
+ "rotate-x": scaleRotate()
3099
+ }],
3100
+ /**
3101
+ * Rotate Y
3102
+ * @see https://tailwindcss.com/docs/rotate
3103
+ */
3104
+ "rotate-y": [{
3105
+ "rotate-y": scaleRotate()
3106
+ }],
3107
+ /**
3108
+ * Rotate Z
3109
+ * @see https://tailwindcss.com/docs/rotate
3110
+ */
3111
+ "rotate-z": [{
3112
+ "rotate-z": scaleRotate()
3113
+ }],
3114
+ /**
3115
+ * Scale
3116
+ * @see https://tailwindcss.com/docs/scale
3117
+ */
3118
+ scale: [{
3119
+ scale: scaleScale()
3120
+ }],
3121
+ /**
3122
+ * Scale X
3123
+ * @see https://tailwindcss.com/docs/scale
3124
+ */
3125
+ "scale-x": [{
3126
+ "scale-x": scaleScale()
3127
+ }],
3128
+ /**
3129
+ * Scale Y
3130
+ * @see https://tailwindcss.com/docs/scale
3131
+ */
3132
+ "scale-y": [{
3133
+ "scale-y": scaleScale()
3134
+ }],
3135
+ /**
3136
+ * Scale Z
3137
+ * @see https://tailwindcss.com/docs/scale
3138
+ */
3139
+ "scale-z": [{
3140
+ "scale-z": scaleScale()
3141
+ }],
3142
+ /**
3143
+ * Scale 3D
3144
+ * @see https://tailwindcss.com/docs/scale
3145
+ */
3146
+ "scale-3d": ["scale-3d"],
3147
+ /**
3148
+ * Skew
3149
+ * @see https://tailwindcss.com/docs/skew
3150
+ */
3151
+ skew: [{
3152
+ skew: scaleSkew()
3153
+ }],
3154
+ /**
3155
+ * Skew X
3156
+ * @see https://tailwindcss.com/docs/skew
3157
+ */
3158
+ "skew-x": [{
3159
+ "skew-x": scaleSkew()
3160
+ }],
3161
+ /**
3162
+ * Skew Y
3163
+ * @see https://tailwindcss.com/docs/skew
3164
+ */
3165
+ "skew-y": [{
3166
+ "skew-y": scaleSkew()
3167
+ }],
3168
+ /**
3169
+ * Transform
3170
+ * @see https://tailwindcss.com/docs/transform
3171
+ */
3172
+ transform: [{
3173
+ transform: [isArbitraryVariable, isArbitraryValue, "", "none", "gpu", "cpu"]
3174
+ }],
3175
+ /**
3176
+ * Transform Origin
3177
+ * @see https://tailwindcss.com/docs/transform-origin
3178
+ */
3179
+ "transform-origin": [{
3180
+ origin: scalePositionWithArbitrary()
3181
+ }],
3182
+ /**
3183
+ * Transform Style
3184
+ * @see https://tailwindcss.com/docs/transform-style
3185
+ */
3186
+ "transform-style": [{
3187
+ transform: ["3d", "flat"]
3188
+ }],
3189
+ /**
3190
+ * Translate
3191
+ * @see https://tailwindcss.com/docs/translate
3192
+ */
3193
+ translate: [{
3194
+ translate: scaleTranslate()
3195
+ }],
3196
+ /**
3197
+ * Translate X
3198
+ * @see https://tailwindcss.com/docs/translate
3199
+ */
3200
+ "translate-x": [{
3201
+ "translate-x": scaleTranslate()
3202
+ }],
3203
+ /**
3204
+ * Translate Y
3205
+ * @see https://tailwindcss.com/docs/translate
3206
+ */
3207
+ "translate-y": [{
3208
+ "translate-y": scaleTranslate()
3209
+ }],
3210
+ /**
3211
+ * Translate Z
3212
+ * @see https://tailwindcss.com/docs/translate
3213
+ */
3214
+ "translate-z": [{
3215
+ "translate-z": scaleTranslate()
3216
+ }],
3217
+ /**
3218
+ * Translate None
3219
+ * @see https://tailwindcss.com/docs/translate
3220
+ */
3221
+ "translate-none": ["translate-none"],
3222
+ // ---------------------
3223
+ // --- Interactivity ---
3224
+ // ---------------------
3225
+ /**
3226
+ * Accent Color
3227
+ * @see https://tailwindcss.com/docs/accent-color
3228
+ */
3229
+ accent: [{
3230
+ accent: scaleColor()
3231
+ }],
3232
+ /**
3233
+ * Appearance
3234
+ * @see https://tailwindcss.com/docs/appearance
3235
+ */
3236
+ appearance: [{
3237
+ appearance: ["none", "auto"]
3238
+ }],
3239
+ /**
3240
+ * Caret Color
3241
+ * @see https://tailwindcss.com/docs/just-in-time-mode#caret-color-utilities
3242
+ */
3243
+ "caret-color": [{
3244
+ caret: scaleColor()
3245
+ }],
3246
+ /**
3247
+ * Color Scheme
3248
+ * @see https://tailwindcss.com/docs/color-scheme
3249
+ */
3250
+ "color-scheme": [{
3251
+ scheme: ["normal", "dark", "light", "light-dark", "only-dark", "only-light"]
3252
+ }],
3253
+ /**
3254
+ * Cursor
3255
+ * @see https://tailwindcss.com/docs/cursor
3256
+ */
3257
+ cursor: [{
3258
+ cursor: ["auto", "default", "pointer", "wait", "text", "move", "help", "not-allowed", "none", "context-menu", "progress", "cell", "crosshair", "vertical-text", "alias", "copy", "no-drop", "grab", "grabbing", "all-scroll", "col-resize", "row-resize", "n-resize", "e-resize", "s-resize", "w-resize", "ne-resize", "nw-resize", "se-resize", "sw-resize", "ew-resize", "ns-resize", "nesw-resize", "nwse-resize", "zoom-in", "zoom-out", isArbitraryVariable, isArbitraryValue]
3259
+ }],
3260
+ /**
3261
+ * Field Sizing
3262
+ * @see https://tailwindcss.com/docs/field-sizing
3263
+ */
3264
+ "field-sizing": [{
3265
+ "field-sizing": ["fixed", "content"]
3266
+ }],
3267
+ /**
3268
+ * Pointer Events
3269
+ * @see https://tailwindcss.com/docs/pointer-events
3270
+ */
3271
+ "pointer-events": [{
3272
+ "pointer-events": ["auto", "none"]
3273
+ }],
3274
+ /**
3275
+ * Resize
3276
+ * @see https://tailwindcss.com/docs/resize
3277
+ */
3278
+ resize: [{
3279
+ resize: ["none", "", "y", "x"]
3280
+ }],
3281
+ /**
3282
+ * Scroll Behavior
3283
+ * @see https://tailwindcss.com/docs/scroll-behavior
3284
+ */
3285
+ "scroll-behavior": [{
3286
+ scroll: ["auto", "smooth"]
3287
+ }],
3288
+ /**
3289
+ * Scroll Margin
3290
+ * @see https://tailwindcss.com/docs/scroll-margin
3291
+ */
3292
+ "scroll-m": [{
3293
+ "scroll-m": scaleUnambiguousSpacing()
3294
+ }],
3295
+ /**
3296
+ * Scroll Margin Inline
3297
+ * @see https://tailwindcss.com/docs/scroll-margin
3298
+ */
3299
+ "scroll-mx": [{
3300
+ "scroll-mx": scaleUnambiguousSpacing()
3301
+ }],
3302
+ /**
3303
+ * Scroll Margin Block
3304
+ * @see https://tailwindcss.com/docs/scroll-margin
3305
+ */
3306
+ "scroll-my": [{
3307
+ "scroll-my": scaleUnambiguousSpacing()
3308
+ }],
3309
+ /**
3310
+ * Scroll Margin Inline Start
3311
+ * @see https://tailwindcss.com/docs/scroll-margin
3312
+ */
3313
+ "scroll-ms": [{
3314
+ "scroll-ms": scaleUnambiguousSpacing()
3315
+ }],
3316
+ /**
3317
+ * Scroll Margin Inline End
3318
+ * @see https://tailwindcss.com/docs/scroll-margin
3319
+ */
3320
+ "scroll-me": [{
3321
+ "scroll-me": scaleUnambiguousSpacing()
3322
+ }],
3323
+ /**
3324
+ * Scroll Margin Block Start
3325
+ * @see https://tailwindcss.com/docs/scroll-margin
3326
+ */
3327
+ "scroll-mbs": [{
3328
+ "scroll-mbs": scaleUnambiguousSpacing()
3329
+ }],
3330
+ /**
3331
+ * Scroll Margin Block End
3332
+ * @see https://tailwindcss.com/docs/scroll-margin
3333
+ */
3334
+ "scroll-mbe": [{
3335
+ "scroll-mbe": scaleUnambiguousSpacing()
3336
+ }],
3337
+ /**
3338
+ * Scroll Margin Top
3339
+ * @see https://tailwindcss.com/docs/scroll-margin
3340
+ */
3341
+ "scroll-mt": [{
3342
+ "scroll-mt": scaleUnambiguousSpacing()
3343
+ }],
3344
+ /**
3345
+ * Scroll Margin Right
3346
+ * @see https://tailwindcss.com/docs/scroll-margin
3347
+ */
3348
+ "scroll-mr": [{
3349
+ "scroll-mr": scaleUnambiguousSpacing()
3350
+ }],
3351
+ /**
3352
+ * Scroll Margin Bottom
3353
+ * @see https://tailwindcss.com/docs/scroll-margin
3354
+ */
3355
+ "scroll-mb": [{
3356
+ "scroll-mb": scaleUnambiguousSpacing()
3357
+ }],
3358
+ /**
3359
+ * Scroll Margin Left
3360
+ * @see https://tailwindcss.com/docs/scroll-margin
3361
+ */
3362
+ "scroll-ml": [{
3363
+ "scroll-ml": scaleUnambiguousSpacing()
3364
+ }],
3365
+ /**
3366
+ * Scroll Padding
3367
+ * @see https://tailwindcss.com/docs/scroll-padding
3368
+ */
3369
+ "scroll-p": [{
3370
+ "scroll-p": scaleUnambiguousSpacing()
3371
+ }],
3372
+ /**
3373
+ * Scroll Padding Inline
3374
+ * @see https://tailwindcss.com/docs/scroll-padding
3375
+ */
3376
+ "scroll-px": [{
3377
+ "scroll-px": scaleUnambiguousSpacing()
3378
+ }],
3379
+ /**
3380
+ * Scroll Padding Block
3381
+ * @see https://tailwindcss.com/docs/scroll-padding
3382
+ */
3383
+ "scroll-py": [{
3384
+ "scroll-py": scaleUnambiguousSpacing()
3385
+ }],
3386
+ /**
3387
+ * Scroll Padding Inline Start
3388
+ * @see https://tailwindcss.com/docs/scroll-padding
3389
+ */
3390
+ "scroll-ps": [{
3391
+ "scroll-ps": scaleUnambiguousSpacing()
3392
+ }],
3393
+ /**
3394
+ * Scroll Padding Inline End
3395
+ * @see https://tailwindcss.com/docs/scroll-padding
3396
+ */
3397
+ "scroll-pe": [{
3398
+ "scroll-pe": scaleUnambiguousSpacing()
3399
+ }],
3400
+ /**
3401
+ * Scroll Padding Block Start
3402
+ * @see https://tailwindcss.com/docs/scroll-padding
3403
+ */
3404
+ "scroll-pbs": [{
3405
+ "scroll-pbs": scaleUnambiguousSpacing()
3406
+ }],
3407
+ /**
3408
+ * Scroll Padding Block End
3409
+ * @see https://tailwindcss.com/docs/scroll-padding
3410
+ */
3411
+ "scroll-pbe": [{
3412
+ "scroll-pbe": scaleUnambiguousSpacing()
3413
+ }],
3414
+ /**
3415
+ * Scroll Padding Top
3416
+ * @see https://tailwindcss.com/docs/scroll-padding
3417
+ */
3418
+ "scroll-pt": [{
3419
+ "scroll-pt": scaleUnambiguousSpacing()
3420
+ }],
3421
+ /**
3422
+ * Scroll Padding Right
3423
+ * @see https://tailwindcss.com/docs/scroll-padding
3424
+ */
3425
+ "scroll-pr": [{
3426
+ "scroll-pr": scaleUnambiguousSpacing()
3427
+ }],
3428
+ /**
3429
+ * Scroll Padding Bottom
3430
+ * @see https://tailwindcss.com/docs/scroll-padding
3431
+ */
3432
+ "scroll-pb": [{
3433
+ "scroll-pb": scaleUnambiguousSpacing()
3434
+ }],
3435
+ /**
3436
+ * Scroll Padding Left
3437
+ * @see https://tailwindcss.com/docs/scroll-padding
3438
+ */
3439
+ "scroll-pl": [{
3440
+ "scroll-pl": scaleUnambiguousSpacing()
3441
+ }],
3442
+ /**
3443
+ * Scroll Snap Align
3444
+ * @see https://tailwindcss.com/docs/scroll-snap-align
3445
+ */
3446
+ "snap-align": [{
3447
+ snap: ["start", "end", "center", "align-none"]
3448
+ }],
3449
+ /**
3450
+ * Scroll Snap Stop
3451
+ * @see https://tailwindcss.com/docs/scroll-snap-stop
3452
+ */
3453
+ "snap-stop": [{
3454
+ snap: ["normal", "always"]
3455
+ }],
3456
+ /**
3457
+ * Scroll Snap Type
3458
+ * @see https://tailwindcss.com/docs/scroll-snap-type
3459
+ */
3460
+ "snap-type": [{
3461
+ snap: ["none", "x", "y", "both"]
3462
+ }],
3463
+ /**
3464
+ * Scroll Snap Type Strictness
3465
+ * @see https://tailwindcss.com/docs/scroll-snap-type
3466
+ */
3467
+ "snap-strictness": [{
3468
+ snap: ["mandatory", "proximity"]
3469
+ }],
3470
+ /**
3471
+ * Touch Action
3472
+ * @see https://tailwindcss.com/docs/touch-action
3473
+ */
3474
+ touch: [{
3475
+ touch: ["auto", "none", "manipulation"]
3476
+ }],
3477
+ /**
3478
+ * Touch Action X
3479
+ * @see https://tailwindcss.com/docs/touch-action
3480
+ */
3481
+ "touch-x": [{
3482
+ "touch-pan": ["x", "left", "right"]
3483
+ }],
3484
+ /**
3485
+ * Touch Action Y
3486
+ * @see https://tailwindcss.com/docs/touch-action
3487
+ */
3488
+ "touch-y": [{
3489
+ "touch-pan": ["y", "up", "down"]
3490
+ }],
3491
+ /**
3492
+ * Touch Action Pinch Zoom
3493
+ * @see https://tailwindcss.com/docs/touch-action
3494
+ */
3495
+ "touch-pz": ["touch-pinch-zoom"],
3496
+ /**
3497
+ * User Select
3498
+ * @see https://tailwindcss.com/docs/user-select
3499
+ */
3500
+ select: [{
3501
+ select: ["none", "text", "all", "auto"]
3502
+ }],
3503
+ /**
3504
+ * Will Change
3505
+ * @see https://tailwindcss.com/docs/will-change
3506
+ */
3507
+ "will-change": [{
3508
+ "will-change": ["auto", "scroll", "contents", "transform", isArbitraryVariable, isArbitraryValue]
3509
+ }],
3510
+ // -----------
3511
+ // --- SVG ---
3512
+ // -----------
3513
+ /**
3514
+ * Fill
3515
+ * @see https://tailwindcss.com/docs/fill
3516
+ */
3517
+ fill: [{
3518
+ fill: ["none", ...scaleColor()]
3519
+ }],
3520
+ /**
3521
+ * Stroke Width
3522
+ * @see https://tailwindcss.com/docs/stroke-width
3523
+ */
3524
+ "stroke-w": [{
3525
+ stroke: [isNumber, isArbitraryVariableLength, isArbitraryLength, isArbitraryNumber]
3526
+ }],
3527
+ /**
3528
+ * Stroke
3529
+ * @see https://tailwindcss.com/docs/stroke
3530
+ */
3531
+ stroke: [{
3532
+ stroke: ["none", ...scaleColor()]
3533
+ }],
3534
+ // ---------------------
3535
+ // --- Accessibility ---
3536
+ // ---------------------
3537
+ /**
3538
+ * Forced Color Adjust
3539
+ * @see https://tailwindcss.com/docs/forced-color-adjust
3540
+ */
3541
+ "forced-color-adjust": [{
3542
+ "forced-color-adjust": ["auto", "none"]
3543
+ }]
3544
+ },
3545
+ conflictingClassGroups: {
3546
+ overflow: ["overflow-x", "overflow-y"],
3547
+ overscroll: ["overscroll-x", "overscroll-y"],
3548
+ inset: ["inset-x", "inset-y", "inset-bs", "inset-be", "start", "end", "top", "right", "bottom", "left"],
3549
+ "inset-x": ["right", "left"],
3550
+ "inset-y": ["top", "bottom"],
3551
+ flex: ["basis", "grow", "shrink"],
3552
+ gap: ["gap-x", "gap-y"],
3553
+ p: ["px", "py", "ps", "pe", "pbs", "pbe", "pt", "pr", "pb", "pl"],
3554
+ px: ["pr", "pl"],
3555
+ py: ["pt", "pb"],
3556
+ m: ["mx", "my", "ms", "me", "mbs", "mbe", "mt", "mr", "mb", "ml"],
3557
+ mx: ["mr", "ml"],
3558
+ my: ["mt", "mb"],
3559
+ size: ["w", "h"],
3560
+ "font-size": ["leading"],
3561
+ "fvn-normal": ["fvn-ordinal", "fvn-slashed-zero", "fvn-figure", "fvn-spacing", "fvn-fraction"],
3562
+ "fvn-ordinal": ["fvn-normal"],
3563
+ "fvn-slashed-zero": ["fvn-normal"],
3564
+ "fvn-figure": ["fvn-normal"],
3565
+ "fvn-spacing": ["fvn-normal"],
3566
+ "fvn-fraction": ["fvn-normal"],
3567
+ "line-clamp": ["display", "overflow"],
3568
+ rounded: ["rounded-s", "rounded-e", "rounded-t", "rounded-r", "rounded-b", "rounded-l", "rounded-ss", "rounded-se", "rounded-ee", "rounded-es", "rounded-tl", "rounded-tr", "rounded-br", "rounded-bl"],
3569
+ "rounded-s": ["rounded-ss", "rounded-es"],
3570
+ "rounded-e": ["rounded-se", "rounded-ee"],
3571
+ "rounded-t": ["rounded-tl", "rounded-tr"],
3572
+ "rounded-r": ["rounded-tr", "rounded-br"],
3573
+ "rounded-b": ["rounded-br", "rounded-bl"],
3574
+ "rounded-l": ["rounded-tl", "rounded-bl"],
3575
+ "border-spacing": ["border-spacing-x", "border-spacing-y"],
3576
+ "border-w": ["border-w-x", "border-w-y", "border-w-s", "border-w-e", "border-w-bs", "border-w-be", "border-w-t", "border-w-r", "border-w-b", "border-w-l"],
3577
+ "border-w-x": ["border-w-r", "border-w-l"],
3578
+ "border-w-y": ["border-w-t", "border-w-b"],
3579
+ "border-color": ["border-color-x", "border-color-y", "border-color-s", "border-color-e", "border-color-bs", "border-color-be", "border-color-t", "border-color-r", "border-color-b", "border-color-l"],
3580
+ "border-color-x": ["border-color-r", "border-color-l"],
3581
+ "border-color-y": ["border-color-t", "border-color-b"],
3582
+ translate: ["translate-x", "translate-y", "translate-none"],
3583
+ "translate-none": ["translate", "translate-x", "translate-y", "translate-z"],
3584
+ "scroll-m": ["scroll-mx", "scroll-my", "scroll-ms", "scroll-me", "scroll-mbs", "scroll-mbe", "scroll-mt", "scroll-mr", "scroll-mb", "scroll-ml"],
3585
+ "scroll-mx": ["scroll-mr", "scroll-ml"],
3586
+ "scroll-my": ["scroll-mt", "scroll-mb"],
3587
+ "scroll-p": ["scroll-px", "scroll-py", "scroll-ps", "scroll-pe", "scroll-pbs", "scroll-pbe", "scroll-pt", "scroll-pr", "scroll-pb", "scroll-pl"],
3588
+ "scroll-px": ["scroll-pr", "scroll-pl"],
3589
+ "scroll-py": ["scroll-pt", "scroll-pb"],
3590
+ touch: ["touch-x", "touch-y", "touch-pz"],
3591
+ "touch-x": ["touch"],
3592
+ "touch-y": ["touch"],
3593
+ "touch-pz": ["touch"]
3594
+ },
3595
+ conflictingClassGroupModifiers: {
3596
+ "font-size": ["leading"]
3597
+ },
3598
+ orderSensitiveModifiers: ["*", "**", "after", "backdrop", "before", "details-content", "file", "first-letter", "first-line", "marker", "placeholder", "selection"]
3599
+ };
3600
+ };
3601
+ var twMerge = /* @__PURE__ */ createTailwindMerge(getDefaultConfig);
3602
+
3603
+ // src/lib/utils.ts
3604
+ function cn(...inputs) {
3605
+ return twMerge(clsx(inputs));
3606
+ }
3607
+ async function copyToClipboard(text) {
3608
+ const clipboard = typeof navigator !== "undefined" ? navigator.clipboard : void 0;
3609
+ if (clipboard && typeof clipboard.writeText === "function") {
3610
+ try {
3611
+ await clipboard.writeText(text);
3612
+ return true;
3613
+ } catch {
3614
+ }
3615
+ }
3616
+ if (typeof document === "undefined" || typeof document.execCommand !== "function") {
3617
+ return false;
3618
+ }
3619
+ const textarea = document.createElement("textarea");
3620
+ textarea.value = text;
3621
+ textarea.style.position = "fixed";
3622
+ textarea.style.opacity = "0";
3623
+ document.body.appendChild(textarea);
3624
+ textarea.select();
3625
+ try {
3626
+ return document.execCommand("copy");
3627
+ } finally {
3628
+ document.body.removeChild(textarea);
3629
+ }
3630
+ }
3631
+
3632
+ // src/components/PlanUpdateBlock.tsx
3633
+ import { jsx as jsx2, jsxs } from "react/jsx-runtime";
3634
+ var PLAN_STEP_STATUSES = /* @__PURE__ */ new Set(["pending", "in_progress", "completed"]);
3635
+ var PLAN_AUTO_COLLAPSE_MS = 5e3;
3636
+ function isPlanUpdateTool(toolCall) {
3637
+ return formatToolName(toolCall.name) === "UpdatePlan";
3638
+ }
3639
+ function getPlanUpdateDisplayState(messages) {
3640
+ let current = null;
3641
+ let latestAttempt = null;
3642
+ let latestAttemptStreaming = false;
3643
+ for (const message of messages) {
3644
+ if ((message.loop_name ?? "root") !== "root") continue;
3645
+ for (const toolCall of message.tool_calls ?? []) {
3646
+ if (!isPlanUpdateTool(toolCall)) continue;
3647
+ latestAttempt = toolCall;
3648
+ latestAttemptStreaming = message.status === "streaming";
3649
+ if (toolCall.status === "done" && parsePlanUpdate(toolCall.arguments)) current = toolCall;
3650
+ }
3651
+ }
3652
+ return {
3653
+ current,
3654
+ updating: latestAttempt?.status === "pending" && latestAttemptStreaming
3655
+ };
3656
+ }
3657
+ function parsePlanUpdate(argumentsJson) {
3658
+ try {
3659
+ const raw = JSON.parse(argumentsJson);
3660
+ if (!raw || typeof raw !== "object") return null;
3661
+ const candidate = raw;
3662
+ if (!Array.isArray(candidate.plan)) return null;
3663
+ const plan = candidate.plan.map((item) => {
3664
+ if (!item || typeof item !== "object") return null;
3665
+ const step = item.step;
3666
+ const status = item.status;
3667
+ if (typeof step !== "string" || !step.trim() || typeof status !== "string" || !PLAN_STEP_STATUSES.has(status)) {
3668
+ return null;
3669
+ }
3670
+ return { step: step.trim(), status };
3671
+ });
3672
+ if (plan.some((item) => item === null)) return null;
3673
+ if (plan.filter((item) => item?.status === "in_progress").length > 1) return null;
3674
+ return { plan };
3675
+ } catch {
3676
+ return null;
3677
+ }
3678
+ }
3679
+ function pickCurrentPlanStep(plan) {
3680
+ return plan.find((item) => item.status === "in_progress") ?? plan.find((item) => item.status === "pending") ?? plan[plan.length - 1] ?? null;
3681
+ }
3682
+ function PlanStepIcon({
3683
+ status,
3684
+ size = 17,
3685
+ running = false
3686
+ }) {
3687
+ if (status === "completed") {
3688
+ return /* @__PURE__ */ jsx2(Check, { size, strokeWidth: 2, className: "shrink-0 text-emerald-500" });
3689
+ }
3690
+ if (status === "in_progress") {
3691
+ return running ? /* @__PURE__ */ jsx2(LoaderCircle, { size, className: "shrink-0 animate-spin text-[hsl(var(--muted-foreground))]" }) : /* @__PURE__ */ jsx2(CircleDot, { size, className: "shrink-0 text-amber-500" });
3692
+ }
3693
+ return /* @__PURE__ */ jsx2(Circle, { size, className: "shrink-0 text-[hsl(var(--muted-foreground))]/60" });
3694
+ }
3695
+ function PlanUpdateBlock({
3696
+ toolCall,
3697
+ running = false,
3698
+ autoReveal = false,
3699
+ className
3700
+ }) {
3701
+ const updateKey = `${toolCall.id}:${toolCall.arguments}`;
3702
+ const revealKey = autoReveal ? updateKey : null;
3703
+ const [collapsed, setCollapsed] = useState(!autoReveal);
3704
+ const collapseTimerRef = useRef(null);
3705
+ const data = parsePlanUpdate(toolCall.arguments);
3706
+ useEffect(() => {
3707
+ if (!revealKey) return;
3708
+ if (collapseTimerRef.current) clearTimeout(collapseTimerRef.current);
3709
+ setCollapsed(false);
3710
+ collapseTimerRef.current = setTimeout(() => {
3711
+ setCollapsed(true);
3712
+ collapseTimerRef.current = null;
3713
+ }, PLAN_AUTO_COLLAPSE_MS);
3714
+ }, [revealKey]);
3715
+ useEffect(
3716
+ () => () => {
3717
+ if (collapseTimerRef.current) clearTimeout(collapseTimerRef.current);
3718
+ },
3719
+ []
3720
+ );
3721
+ if (!data) return null;
3722
+ const completed = data.plan.filter((item) => item.status === "completed").length;
3723
+ const currentStep = pickCurrentPlanStep(data.plan);
3724
+ const pausedAtCurrentStep = !running && currentStep?.status === "in_progress";
3725
+ return /* @__PURE__ */ jsxs("section", { part: "plan-block", className: cn("blade-chat-plan-block overflow-hidden", className), children: [
3726
+ /* @__PURE__ */ jsxs(
3727
+ "button",
3728
+ {
3729
+ type: "button",
3730
+ "aria-expanded": !collapsed,
3731
+ onClick: () => {
3732
+ if (collapseTimerRef.current) {
3733
+ clearTimeout(collapseTimerRef.current);
3734
+ collapseTimerRef.current = null;
3735
+ }
3736
+ setCollapsed((value) => !value);
3737
+ },
3738
+ className: cn(
3739
+ "flex w-full items-center gap-2 px-3 py-2 text-left transition-colors hover:bg-[hsl(var(--muted)/0.3)]",
3740
+ !collapsed && "border-b border-[hsl(var(--border))]"
3741
+ ),
3742
+ children: [
3743
+ collapsed && currentStep ? /* @__PURE__ */ jsxs("span", { className: "flex min-w-0 flex-1 items-center gap-1.5 text-xs text-[hsl(var(--foreground))]", children: [
3744
+ /* @__PURE__ */ jsx2(PlanStepIcon, { status: currentStep.status, size: 14, running }),
3745
+ /* @__PURE__ */ jsx2("span", { className: "truncate", children: currentStep.step }),
3746
+ pausedAtCurrentStep ? /* @__PURE__ */ jsx2("span", { className: "shrink-0 text-[11px] text-amber-500", children: "\u5DF2\u6682\u505C" }) : null
3747
+ ] }) : /* @__PURE__ */ jsxs("span", { className: "flex min-w-0 flex-1 items-center gap-1.5 text-[11px] text-[hsl(var(--muted-foreground))]", children: [
3748
+ /* @__PURE__ */ jsx2(ListChecks, { size: 14, className: "shrink-0", "aria-hidden": "true" }),
3749
+ /* @__PURE__ */ jsx2("span", { className: "truncate", children: "\u4EFB\u52A1\u8FDB\u5EA6" }),
3750
+ pausedAtCurrentStep ? /* @__PURE__ */ jsx2("span", { className: "shrink-0 text-amber-500", children: "\u5DF2\u6682\u505C" }) : null
3751
+ ] }),
3752
+ /* @__PURE__ */ jsxs("span", { className: "shrink-0 text-[11px] tabular-nums text-[hsl(var(--muted-foreground))]", children: [
3753
+ completed,
3754
+ "/",
3755
+ data.plan.length
3756
+ ] }),
3757
+ /* @__PURE__ */ jsx2(
3758
+ ChevronDown,
3759
+ {
3760
+ size: 14,
3761
+ className: cn(
3762
+ "shrink-0 text-[hsl(var(--muted-foreground))] transition-transform duration-300 ease-out motion-reduce:transition-none",
3763
+ !collapsed && "rotate-180"
3764
+ )
3765
+ }
3766
+ )
3767
+ ]
3768
+ }
3769
+ ),
3770
+ /* @__PURE__ */ jsx2(
3771
+ "div",
3772
+ {
3773
+ "aria-hidden": collapsed,
3774
+ className: cn(
3775
+ "grid transition-[grid-template-rows,opacity] duration-300 ease-out motion-reduce:transition-none",
3776
+ collapsed ? "grid-rows-[0fr] opacity-0" : "grid-rows-[1fr] opacity-100"
3777
+ ),
3778
+ children: /* @__PURE__ */ jsx2("div", { className: "min-h-0 overflow-hidden", children: /* @__PURE__ */ jsx2("div", { className: "flex max-h-40 flex-col gap-0.5 overflow-y-auto px-3 py-2", children: data.plan.length === 0 ? /* @__PURE__ */ jsx2("span", { className: "text-xs text-[hsl(var(--muted-foreground))]", children: "\u6682\u65E0\u4EFB\u52A1\u6B65\u9AA4" }) : data.plan.map((item, index) => /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2 py-0.5", children: [
3779
+ /* @__PURE__ */ jsx2("span", { className: "mt-[3px] flex shrink-0", children: /* @__PURE__ */ jsx2(PlanStepIcon, { status: item.status, size: 14, running }) }),
3780
+ /* @__PURE__ */ jsx2(
3781
+ "span",
3782
+ {
3783
+ className: cn(
3784
+ "min-w-0 flex-1 break-words text-[13px] leading-5",
3785
+ item.status === "completed" ? "text-[hsl(var(--muted-foreground))]" : item.status === "in_progress" ? "font-medium text-[hsl(var(--foreground))]" : "text-[hsl(var(--muted-foreground))]"
3786
+ ),
3787
+ children: item.step
3788
+ }
3789
+ )
3790
+ ] }, `${index}-${item.step}`)) }) })
3791
+ }
3792
+ )
3793
+ ] });
3794
+ }
3795
+
3796
+ // src/chat/runtime/session-source.tsx
3797
+ import { createInitialSessionState } from "@blade-hq/agent-client/internal";
3798
+ import {
3799
+ createContext as createContext2,
3800
+ useContext as useContext2,
3801
+ useEffect as useEffect2,
3802
+ useLayoutEffect,
3803
+ useMemo,
3804
+ useRef as useRef2,
3805
+ useState as useState2,
3806
+ useSyncExternalStore
3807
+ } from "react";
3808
+ import { jsx as jsx3 } from "react/jsx-runtime";
3809
+ var EMPTY_SOURCE = {
3810
+ subscribe: () => () => {
3811
+ },
3812
+ getSession: () => void 0,
3813
+ isHistoryLoading: () => false,
3814
+ planRevealRevision: () => 0
3815
+ };
3816
+ var SessionSourceContext = createContext2(EMPTY_SOURCE);
3817
+ function SessionSourceProvider({ source, children }) {
3818
+ return /* @__PURE__ */ jsx3(SessionSourceContext.Provider, { value: source, children });
3819
+ }
3820
+ function useSessionSource() {
3821
+ return useContext2(SessionSourceContext);
3822
+ }
3823
+ var SingleSessionSource = class {
3824
+ session = null;
3825
+ loading = false;
3826
+ listeners = /* @__PURE__ */ new Set();
3827
+ revisions = /* @__PURE__ */ new Map();
3828
+ subscribe = (listener) => {
3829
+ this.listeners.add(listener);
3830
+ return () => {
3831
+ this.listeners.delete(listener);
3832
+ };
3833
+ };
3834
+ getSession = (sessionId) => {
3835
+ const current = this.session;
3836
+ return current && (!sessionId || current.sessionId === sessionId) ? current : void 0;
3837
+ };
3838
+ isHistoryLoading = (sessionId) => {
3839
+ if (!this.session) return this.loading;
3840
+ return (!sessionId || this.session.sessionId === sessionId) && this.loading;
3841
+ };
3842
+ planRevealRevision = (sessionId) => sessionId ? this.revisions.get(sessionId) ?? 0 : 0;
3843
+ update(session, loading) {
3844
+ if (this.session === session && this.loading === loading) return;
3845
+ this.session = session;
3846
+ this.loading = loading;
3847
+ this.notify();
3848
+ }
3849
+ watchPlan(session) {
3850
+ return session.on("toolResult", ({ toolCall, turn, source }) => {
3851
+ if (source === "reconnect_replay" || (turn.loop_id || "root") !== "root" || toolCall.status !== "done" || !isPlanUpdateTool(toolCall) || !parsePlanUpdate(toolCall.arguments)) {
3852
+ return;
3853
+ }
3854
+ this.revisions.set(session.sessionId, (this.revisions.get(session.sessionId) ?? 0) + 1);
3855
+ this.notify();
3856
+ });
3857
+ }
3858
+ notify() {
3859
+ for (const listener of [...this.listeners]) listener();
3860
+ }
3861
+ };
3862
+ function useSingleSessionSource(session, loading) {
3863
+ const [source] = useState2(() => new SingleSessionSource());
3864
+ useLayoutEffect(() => {
3865
+ source.update(session, loading);
3866
+ }, [source, session, loading]);
3867
+ useEffect2(() => session ? source.watchPlan(session) : void 0, [source, session]);
3868
+ return source;
3869
+ }
3870
+ var EMPTY_STATE = createInitialSessionState("");
3871
+ var noopSubscribe = () => () => {
3872
+ };
3873
+ function useSessionHandle(sessionId) {
3874
+ const source = useSessionSource();
3875
+ return useSyncExternalStore(
3876
+ source.subscribe,
3877
+ () => source.getSession(sessionId) ?? null,
3878
+ () => source.getSession(sessionId) ?? null
3879
+ );
3880
+ }
3881
+ function useSessionState(sessionId, selector) {
3882
+ const session = useSessionHandle(sessionId);
3883
+ const selectorRef = useRef2(selector);
3884
+ selectorRef.current = selector;
3885
+ const store = useMemo(() => {
3886
+ let lastState = null;
3887
+ let lastSelector = null;
3888
+ let lastSelected;
3889
+ const getSnapshot = () => {
3890
+ const state = session ? session.getState() : EMPTY_STATE;
3891
+ const current = selectorRef.current;
3892
+ if (state !== lastState || current !== lastSelector) {
3893
+ const next = current(state);
3894
+ if (!(lastState !== null && Object.is(next, lastSelected))) lastSelected = next;
3895
+ lastState = state;
3896
+ lastSelector = current;
3897
+ }
3898
+ return lastSelected;
3899
+ };
3900
+ return {
3901
+ subscribe: session ? (listener) => session.subscribe(listener) : noopSubscribe,
3902
+ getSnapshot
3903
+ };
3904
+ }, [session]);
3905
+ return useSyncExternalStore(store.subscribe, store.getSnapshot, store.getSnapshot);
3906
+ }
3907
+ function useIsSessionHistoryLoading(sessionId) {
3908
+ const source = useSessionSource();
3909
+ return useSyncExternalStore(
3910
+ source.subscribe,
3911
+ () => source.isHistoryLoading(sessionId),
3912
+ () => source.isHistoryLoading(sessionId)
3913
+ );
3914
+ }
3915
+ function usePlanRevealRevision(sessionId) {
3916
+ const source = useSessionSource();
3917
+ return useSyncExternalStore(
3918
+ source.subscribe,
3919
+ () => source.planRevealRevision(sessionId),
3920
+ () => source.planRevealRevision(sessionId)
3921
+ );
3922
+ }
3923
+ var CurrentChatSessionContext = createContext2(null);
3924
+ function CurrentChatSessionProvider({ sessionId, children }) {
3925
+ return /* @__PURE__ */ jsx3(CurrentChatSessionContext.Provider, { value: sessionId, children });
3926
+ }
3927
+ function useCurrentChatSessionId() {
3928
+ return useContext2(CurrentChatSessionContext);
3929
+ }
3930
+
3931
+ // src/chat/runtime/environment.tsx
3932
+ import { createContext as createContext3, useContext as useContext3, useMemo as useMemo2 } from "react";
3933
+ import { jsx as jsx4 } from "react/jsx-runtime";
3934
+ var EMPTY_ENVIRONMENT = {};
3935
+ var ChatEnvironmentContext = createContext3(EMPTY_ENVIRONMENT);
3936
+ function ChatEnvironmentProvider({ value, children }) {
3937
+ return /* @__PURE__ */ jsx4(ChatEnvironmentContext.Provider, { value, children });
3938
+ }
3939
+ function useChatEnvironment() {
3940
+ return useContext3(ChatEnvironmentContext);
3941
+ }
3942
+ var NO_HIGHLIGHT = { highlightedHtml: null };
3943
+ function usePlainCode() {
3944
+ return NO_HIGHLIGHT;
3945
+ }
3946
+ function useHighlightedCode(code, language) {
3947
+ const use = useChatEnvironment().useHighlightedCode ?? usePlainCode;
3948
+ return use(code, language);
3949
+ }
3950
+ function useNoDetail() {
3951
+ return null;
3952
+ }
3953
+ function useChatSessionDetail(sessionId) {
3954
+ const use = useChatEnvironment().useSessionDetail ?? useNoDetail;
3955
+ return use(sessionId);
3956
+ }
3957
+ function useShowTodo() {
3958
+ return false;
3959
+ }
3960
+ function useHideTodo() {
3961
+ const use = useChatEnvironment().useHideTodo ?? useShowTodo;
3962
+ return use();
3963
+ }
3964
+ function useChatRenderMode() {
3965
+ return useChatEnvironment().renderMode ?? "normal";
3966
+ }
3967
+ function notifyChat(environment, kind, message, options) {
3968
+ if (environment.notify) environment.notify(kind, message, options);
3969
+ else if (kind === "error") console.error(message);
3970
+ }
3971
+ function useComposerBridge(sessionId) {
3972
+ const environment = useChatEnvironment();
3973
+ const session = useSessionHandle(sessionId);
3974
+ return useMemo2(
3975
+ () => ({
3976
+ appendText(text, separate = false) {
3977
+ if (!sessionId) return;
3978
+ if (environment.appendToComposer) environment.appendToComposer(sessionId, text, separate);
3979
+ else session?.insertText(separate ? `
3980
+
3981
+ ${text}` : text);
3982
+ },
3983
+ addContext(context) {
3984
+ if (!sessionId) return;
3985
+ if (environment.addComposerContext) environment.addComposerContext(sessionId, context);
3986
+ else session?.attach(context.label, context.content);
3987
+ }
3988
+ }),
3989
+ [environment, session, sessionId]
3990
+ );
3991
+ }
3992
+ var NO_VIRTUAL_ITEMS = [];
3993
+ var NO_VIRTUALIZER = {
3994
+ getVirtualItems: () => NO_VIRTUAL_ITEMS,
3995
+ getTotalSize: () => 0,
3996
+ measureElement: () => {
3997
+ },
3998
+ scrollToIndex: () => {
3999
+ },
4000
+ getOffsetForIndex: () => void 0
4001
+ };
4002
+ function useNoVirtualizer() {
4003
+ return NO_VIRTUALIZER;
4004
+ }
4005
+ function useChatVirtualizer(options) {
4006
+ const injected = useChatEnvironment().useVirtualizer;
4007
+ const use = injected ?? useNoVirtualizer;
4008
+ const virtualizer = use(options);
4009
+ return { virtualizer, enabled: Boolean(injected) };
4010
+ }
4011
+
4012
+ // src/components/AccountConnectorRules.tsx
4013
+ import { useCallback } from "react";
4014
+ import { jsx as jsx5 } from "react/jsx-runtime";
4015
+ function AccountConnectorRules({ client, name, refresh = 0 }) {
4016
+ const read = useCallback(() => client.connectors.rules(name), [client, name]);
4017
+ const update = useCallback((set) => client.connectors.updateRules(name, set), [client, name]);
4018
+ return /* @__PURE__ */ jsx5(ConnectorRulesPanel, { compact: true, read, update, refresh }, name);
4019
+ }
4020
+
4021
+ // src/components/BrowserConnectionDialog.tsx
4022
+ import { useEffect as useEffect3, useRef as useRef3, useState as useState3 } from "react";
4023
+ import { jsx as jsx6, jsxs as jsxs2 } from "react/jsx-runtime";
4024
+ function BrowserConnectionDialog({ client, name, label = "\u4E1A\u52A1\u8D26\u53F7", connector, onClose }) {
4025
+ const [connection, setConnection] = useState3(connector?.connection);
4026
+ const [editing, setEditing] = useState3(false);
4027
+ const [refresh, setRefresh] = useState3(0);
4028
+ const [frame, setFrame] = useState3(null);
4029
+ const alive = useRef3(false);
4030
+ useEffect3(() => {
4031
+ alive.current = true;
4032
+ return () => {
4033
+ alive.current = false;
4034
+ };
4035
+ }, []);
4036
+ const status = connection?.status ?? "disconnected";
4037
+ const showLogin = status !== "connected" || editing;
4038
+ const url = new URL(client.connectors.browserAuthorizationUrl(name), window.location.href);
4039
+ const origin = url.origin;
4040
+ useEffect3(() => {
4041
+ if (!showLogin || !frame) return;
4042
+ return client.connectors.bindBrowserAuthorizationFrame(frame, name);
4043
+ }, [client, name, showLogin, frame]);
4044
+ useEffect3(() => {
4045
+ const receive = (event) => {
4046
+ if (event.origin === origin && event.source === frame?.contentWindow && event.data?.type === "blade:connector-auth-close") onClose();
4047
+ };
4048
+ window.addEventListener("message", receive);
4049
+ return () => window.removeEventListener("message", receive);
4050
+ }, [origin, onClose, frame]);
4051
+ const login = /* @__PURE__ */ jsxs2("div", { className: "space-y-3", children: [
4052
+ /* @__PURE__ */ jsx6("p", { className: "text-xs opacity-70", children: "\u5728\u4E0B\u65B9\u9875\u9762\u5B8C\u6210\u767B\u5F55\u6216\u626B\u7801\uFF0C\u7136\u540E\u786E\u8BA4\u767B\u5F55\u3002\u9700\u8981\u9000\u51FA\u65F6\u53EF\u8FD4\u56DE\u8FDE\u63A5\u5668\u3002" }),
4053
+ /* @__PURE__ */ jsx6("iframe", { ref: setFrame, title: `${label}\u767B\u5F55\u9875\u9762`, className: "h-[min(560px,60dvh)] w-full border-0" })
4054
+ ] });
4055
+ return /* @__PURE__ */ jsx6(Dialog, { open: true, onOpenChange: (open) => {
4056
+ if (!open) onClose();
4057
+ }, children: /* @__PURE__ */ jsxs2(DialogContent, { "aria-describedby": void 0, className: "max-h-[90dvh] overflow-y-auto sm:max-w-[800px]", children: [
4058
+ /* @__PURE__ */ jsxs2(DialogTitle, { className: "sr-only", children: [
4059
+ "\u8FDE\u63A5 ",
4060
+ label
4061
+ ] }),
4062
+ /* @__PURE__ */ jsx6(
4063
+ ConfigConnection,
4064
+ {
4065
+ editDescription: "\u91CD\u65B0\u767B\u5F55\u4E1A\u52A1\u8D26\u53F7",
4066
+ detail: { title: label, rules: /* @__PURE__ */ jsx6(AccountConnectorRules, { client, name, refresh }) },
4067
+ status,
4068
+ account: connection?.account_label,
4069
+ verifiedAt: connection?.verified_at,
4070
+ onEdit: () => setEditing(true),
4071
+ connection: login,
4072
+ onDisconnect: async () => {
4073
+ const view = await client.connectors.disconnect(name);
4074
+ if (alive.current) {
4075
+ setConnection(view.connection);
4076
+ setEditing(false);
4077
+ setRefresh((value) => value + 1);
4078
+ }
4079
+ },
4080
+ onVerify: async () => {
4081
+ const view = await client.connectors.verify(name);
4082
+ if (alive.current) {
4083
+ setConnection(view.connection);
4084
+ setRefresh((value) => value + 1);
4085
+ }
4086
+ }
4087
+ }
4088
+ ),
4089
+ editing && status === "connected" && /* @__PURE__ */ jsx6(Dialog, { open: true, onOpenChange: (open) => {
4090
+ if (!open) setEditing(false);
4091
+ }, children: /* @__PURE__ */ jsxs2(DialogContent, { "aria-describedby": void 0, className: "max-h-[90dvh] overflow-y-auto sm:max-w-[800px]", children: [
4092
+ /* @__PURE__ */ jsx6(DialogTitle, { children: "\u66F4\u6362\u8D26\u53F7" }),
4093
+ /* @__PURE__ */ jsx6("p", { children: "\u5B8C\u6210\u767B\u5F55\u5E76\u9A8C\u8BC1\u540E\u66FF\u6362\u5F53\u524D\u8D26\u53F7\uFF0C\u4F7F\u7528\u89C4\u5219\u4FDD\u7559\u3002" }),
4094
+ login
4095
+ ] }) }),
4096
+ /* @__PURE__ */ jsx6("button", { type: "button", className: "min-h-10 rounded-lg border px-4 text-sm", onClick: onClose, children: "\u8FD4\u56DE\u8FDE\u63A5\u5668" })
4097
+ ] }) });
4098
+ }
4099
+
4100
+ export {
4101
+ BladeProvider,
4102
+ useBladeClient,
4103
+ useOptionalBladeClient,
4104
+ useBladeHost,
4105
+ cn,
4106
+ copyToClipboard,
4107
+ getToolDescription,
4108
+ getSkillNameFromFilePath,
4109
+ formatToolFileName,
4110
+ formatToolName,
4111
+ getToolDisplayLabel,
4112
+ getToolTone,
4113
+ getToolStatusLabel,
4114
+ extractToolFilePath,
4115
+ extractToolFilePaths,
4116
+ getToolOutputTag,
4117
+ isSuccessfulToolCall,
4118
+ countSuccessfulToolCalls,
4119
+ countPendingToolCalls,
4120
+ formatToolCallCount,
4121
+ summarizeToolCalls,
4122
+ hasNaturalLanguageText,
4123
+ findAnchorMessageIndex,
4124
+ getCollapsedTurnSegments,
4125
+ getLatestPendingToolName,
4126
+ getFinishTaskTitle,
4127
+ getTextContentSegments,
4128
+ getLastTextSegment,
4129
+ countMessageLines,
4130
+ PLAN_AUTO_COLLAPSE_MS,
4131
+ isPlanUpdateTool,
4132
+ getPlanUpdateDisplayState,
4133
+ parsePlanUpdate,
4134
+ pickCurrentPlanStep,
4135
+ PlanUpdateBlock,
4136
+ SessionSourceProvider,
4137
+ useSessionSource,
4138
+ useSingleSessionSource,
4139
+ useSessionHandle,
4140
+ useSessionState,
4141
+ useIsSessionHistoryLoading,
4142
+ usePlanRevealRevision,
4143
+ CurrentChatSessionProvider,
4144
+ useCurrentChatSessionId,
4145
+ ChatEnvironmentProvider,
4146
+ useChatEnvironment,
4147
+ useHighlightedCode,
4148
+ useChatSessionDetail,
4149
+ useHideTodo,
4150
+ useChatRenderMode,
4151
+ notifyChat,
4152
+ useComposerBridge,
4153
+ useChatVirtualizer,
4154
+ AccountConnectorRules,
4155
+ BrowserConnectionDialog
4156
+ };
4157
+ //# sourceMappingURL=chunk-PRDGUQTE.js.map