@cartanova/qgrid-cli 2.10.9 → 2.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (318) hide show
  1. package/bundle/dist/_virtual/_rolldown/runtime.js +1 -10
  2. package/bundle/dist/application/monit/log-buffer.js +12 -6
  3. package/bundle/dist/application/monit/monit.frame.js +11 -3
  4. package/bundle/dist/application/monit/monit.types.js +1 -1
  5. package/bundle/dist/application/qgrid/conv-routing.js +9 -6
  6. package/bundle/dist/application/qgrid/expired-token-reminder.js +2 -2
  7. package/bundle/dist/application/qgrid/oauth.js +31 -4
  8. package/bundle/dist/application/qgrid/qgrid-image-generation.js +1 -1
  9. package/bundle/dist/application/qgrid/qgrid-response-format.js +22 -20
  10. package/bundle/dist/application/qgrid/qgrid-run-lifecycle.js +43 -34
  11. package/bundle/dist/application/qgrid/qgrid.dispatcher.js +128 -93
  12. package/bundle/dist/application/qgrid/qgrid.frame.js +930 -49
  13. package/bundle/dist/application/qgrid/qgrid.types.js +212 -5
  14. package/bundle/dist/application/qgrid/schema-prompt.js +75 -48
  15. package/bundle/dist/application/qgrid/slack-user-map.js +1 -1
  16. package/bundle/dist/application/qgrid/token-death.js +1 -1
  17. package/bundle/dist/application/qgrid/token-subscriber.js +83 -30
  18. package/bundle/dist/application/qgrid/token-trigger-setup.js +1 -1
  19. package/bundle/dist/application/qgrid/token-window-keepalive.js +8 -6
  20. package/bundle/dist/application/qgrid/tool-emulation-schema.js +13 -13
  21. package/bundle/dist/application/qgrid/tool-emulation.js +19 -15
  22. package/bundle/dist/application/request-log/json-schema-type-text.js +29 -12
  23. package/bundle/dist/application/request-log/request-log.model.js +83 -69
  24. package/bundle/dist/application/request-log/request-log.types.js +8 -2
  25. package/bundle/dist/application/request-log/zod-code-format.js +1 -1
  26. package/bundle/dist/application/request-log-step/request-log-step.model.js +1 -1
  27. package/bundle/dist/application/request-log-step/request-log-step.types.js +1 -1
  28. package/bundle/dist/application/setting/setting.constant.js +1 -1
  29. package/bundle/dist/application/setting/setting.model.js +2 -2
  30. package/bundle/dist/application/setting/setting.store.js +2 -2
  31. package/bundle/dist/application/setting/setting.types.js +1 -1
  32. package/bundle/dist/application/sonamu.generated.js +40 -16
  33. package/bundle/dist/application/sonamu.generated.sso.js +2 -1
  34. package/bundle/dist/application/token/token.model.js +26 -9
  35. package/bundle/dist/application/token/token.types.js +20 -3
  36. package/bundle/dist/i18n/en.js +15 -1
  37. package/bundle/dist/i18n/ko.js +15 -1
  38. package/bundle/dist/i18n/sd.generated.js +2 -1
  39. package/bundle/dist/migrations/20260807133553_manual__backfill_request_log_cost.js +8 -6
  40. package/bundle/dist/migrations/20261018215031_alter_request_logs_add1_alter1.js +15 -0
  41. package/bundle/dist/server-bootstrap.js +4 -2
  42. package/bundle/dist/server-error-handler.js +1 -1
  43. package/bundle/dist/sonamu.config.js +37 -8
  44. package/bundle/dist/startup-migrations.js +17 -7
  45. package/bundle/dist/testing/global.js +1 -1
  46. package/bundle/dist/testing/schema-bench.js +0 -0
  47. package/bundle/dist/testing/test-database-name.js +1 -1
  48. package/bundle/dist/utils/providers/anthropic/anthropic-constants.js +1 -1
  49. package/bundle/dist/utils/providers/anthropic/anthropic-dispatcher.js +11 -5
  50. package/bundle/dist/utils/providers/anthropic/anthropic-quota.js +4 -4
  51. package/bundle/dist/utils/providers/anthropic/anthropic-thinking.js +1 -1
  52. package/bundle/dist/utils/providers/anthropic/claude-session.js +20 -19
  53. package/bundle/dist/utils/providers/anthropic/fence-strip.js +1 -1
  54. package/bundle/dist/utils/providers/anthropic/stream-json-adapter.js +49 -23
  55. package/bundle/dist/utils/providers/common/credentials.js +5 -1
  56. package/bundle/dist/utils/providers/common/effort.js +3 -3
  57. package/bundle/dist/utils/providers/common/model-cost.js +69 -14
  58. package/bundle/dist/utils/providers/common/provider-types.js +29 -1
  59. package/bundle/dist/utils/providers/common/schema-validation.js +78 -40
  60. package/bundle/dist/utils/providers/common/smooth-weighted-round-robin.js +1 -1
  61. package/bundle/dist/utils/providers/common/strictifier.js +62 -43
  62. package/bundle/dist/utils/providers/common/thinking.js +3 -2
  63. package/bundle/dist/utils/providers/common/ttft.js +1 -1
  64. package/bundle/dist/utils/providers/grok/grok-backend-protocol.js +427 -0
  65. package/bundle/dist/utils/providers/grok/grok-constants.js +55 -0
  66. package/bundle/dist/utils/providers/grok/grok-direct-client.js +196 -0
  67. package/bundle/dist/utils/providers/grok/grok-dispatcher.js +1313 -0
  68. package/bundle/dist/utils/providers/grok/grok-headers.js +118 -0
  69. package/bundle/dist/utils/providers/grok/grok-media-client.js +420 -0
  70. package/bundle/dist/utils/providers/grok/grok-models.js +114 -0
  71. package/bundle/dist/utils/providers/grok/grok-oauth.js +455 -0
  72. package/bundle/dist/utils/providers/grok/grok-quota.js +119 -0
  73. package/bundle/dist/utils/providers/grok/grok-refresh.js +192 -0
  74. package/bundle/dist/utils/providers/grok/grok-types.js +186 -0
  75. package/bundle/dist/utils/providers/grok/grok-voice-client.js +199 -0
  76. package/bundle/dist/utils/providers/grok/index.js +11 -0
  77. package/bundle/dist/utils/providers/openai/openai-backend-protocol.js +111 -83
  78. package/bundle/dist/utils/providers/openai/openai-callback-relay.js +3 -2
  79. package/bundle/dist/utils/providers/openai/openai-constants.js +1 -1
  80. package/bundle/dist/utils/providers/openai/openai-direct-client.js +23 -7
  81. package/bundle/dist/utils/providers/openai/openai-dispatcher.js +143 -106
  82. package/bundle/dist/utils/providers/openai/openai-image-generation.js +48 -33
  83. package/bundle/dist/utils/providers/openai/openai-oauth.js +28 -13
  84. package/bundle/dist/utils/providers/openai/openai-quota.js +38 -27
  85. package/bundle/dist/utils/providers/openai/openai-refresh.js +17 -9
  86. package/bundle/dist/utils/providers/openai/openai-sse.js +1 -1
  87. package/bundle/dist/utils/providers/openai/openai-transport-config.js +1 -1
  88. package/bundle/dist/utils/quiet-hours.js +1 -1
  89. package/bundle/dist/utils/slack-notify.js +14 -8
  90. package/bundle/dist/utils/subset-loaders.js +4 -5
  91. package/bundle/src/application/monit/log-buffer.ts +23 -9
  92. package/bundle/src/application/monit/monit.frame.ts +22 -5
  93. package/bundle/src/application/monit/monit.types.ts +6 -0
  94. package/bundle/src/application/qgrid/conv-routing.test.ts +76 -4
  95. package/bundle/src/application/qgrid/conv-routing.ts +35 -9
  96. package/bundle/src/application/qgrid/expired-token-reminder.ts +9 -1
  97. package/bundle/src/application/qgrid/oauth.ts +51 -15
  98. package/bundle/src/application/qgrid/qgrid-image-generation.ts +9 -0
  99. package/bundle/src/application/qgrid/qgrid-response-format.ts +50 -25
  100. package/bundle/src/application/qgrid/qgrid-run-lifecycle.test.ts +33 -0
  101. package/bundle/src/application/qgrid/qgrid-run-lifecycle.ts +87 -40
  102. package/bundle/src/application/qgrid/qgrid.dispatcher.test.ts +97 -0
  103. package/bundle/src/application/qgrid/qgrid.dispatcher.ts +274 -126
  104. package/bundle/src/application/qgrid/qgrid.frame.test.ts +1013 -3
  105. package/bundle/src/application/qgrid/qgrid.frame.ts +1415 -60
  106. package/bundle/src/application/qgrid/qgrid.types.ts +335 -0
  107. package/bundle/src/application/qgrid/schema-prompt.ts +105 -41
  108. package/bundle/src/application/qgrid/slack-user-map.ts +5 -0
  109. package/bundle/src/application/qgrid/token-death.ts +4 -0
  110. package/bundle/src/application/qgrid/token-subscriber.test.ts +21 -19
  111. package/bundle/src/application/qgrid/token-subscriber.ts +186 -53
  112. package/bundle/src/application/qgrid/token-trigger-setup.ts +2 -0
  113. package/bundle/src/application/qgrid/token-window-keepalive.ts +49 -6
  114. package/bundle/src/application/qgrid/tool-emulation-schema.ts +33 -29
  115. package/bundle/src/application/qgrid/tool-emulation.ts +52 -27
  116. package/bundle/src/application/request-log/json-schema-type-text.test.ts +5 -5
  117. package/bundle/src/application/request-log/json-schema-type-text.ts +81 -26
  118. package/bundle/src/application/request-log/request-log.entity.json +8 -0
  119. package/bundle/src/application/request-log/request-log.model.test.ts +111 -4
  120. package/bundle/src/application/request-log/request-log.model.ts +279 -145
  121. package/bundle/src/application/request-log/request-log.types.ts +17 -0
  122. package/bundle/src/application/request-log/zod-code-format.ts +11 -0
  123. package/bundle/src/application/request-log-step/request-log-step.model.ts +1 -0
  124. package/bundle/src/application/request-log-step/request-log-step.types.ts +2 -0
  125. package/bundle/src/application/setting/setting.constant.ts +9 -0
  126. package/bundle/src/application/setting/setting.model.ts +12 -2
  127. package/bundle/src/application/setting/setting.store.ts +5 -1
  128. package/bundle/src/application/setting/setting.types.ts +8 -0
  129. package/bundle/src/application/sonamu.generated.http +135 -0
  130. package/bundle/src/application/sonamu.generated.sso.ts +3 -0
  131. package/bundle/src/application/sonamu.generated.ts +29 -0
  132. package/bundle/src/application/token/token.identity.test.ts +20 -0
  133. package/bundle/src/application/token/token.model.ts +66 -7
  134. package/bundle/src/application/token/token.types.ts +24 -1
  135. package/bundle/src/i18n/en.ts +19 -0
  136. package/bundle/src/i18n/ko.ts +21 -0
  137. package/bundle/src/i18n/sd.generated.ts +24 -2
  138. package/bundle/src/migrations/20260807133553_manual__backfill_request_log_cost.ts +16 -8
  139. package/bundle/src/migrations/20261018215031_alter_request_logs_add1_alter1.ts +15 -0
  140. package/bundle/src/server-bootstrap.ts +4 -2
  141. package/bundle/src/server-error-handler.ts +1 -0
  142. package/bundle/src/sonamu.config.ts +69 -7
  143. package/bundle/src/startup-migrations.ts +27 -9
  144. package/bundle/src/testing/global.ts +20 -0
  145. package/bundle/src/testing/schema-bench.ts +105 -30
  146. package/bundle/src/testing/test-database-name.ts +2 -0
  147. package/bundle/src/utils/providers/anthropic/anthropic-constants.ts +8 -0
  148. package/bundle/src/utils/providers/anthropic/anthropic-dispatcher.ts +41 -6
  149. package/bundle/src/utils/providers/anthropic/anthropic-quota.ts +7 -3
  150. package/bundle/src/utils/providers/anthropic/anthropic-thinking.ts +6 -0
  151. package/bundle/src/utils/providers/anthropic/claude-session.ts +58 -24
  152. package/bundle/src/utils/providers/anthropic/fence-strip.ts +11 -0
  153. package/bundle/src/utils/providers/anthropic/stream-json-adapter.ts +110 -45
  154. package/bundle/src/utils/providers/common/credentials.ts +8 -0
  155. package/bundle/src/utils/providers/common/effort.ts +9 -2
  156. package/bundle/src/utils/providers/common/model-cost.test.ts +48 -1
  157. package/bundle/src/utils/providers/common/model-cost.ts +259 -158
  158. package/bundle/src/utils/providers/common/provider-dispatcher.ts +98 -2
  159. package/bundle/src/utils/providers/common/provider-types.ts +46 -3
  160. package/bundle/src/utils/providers/common/schema-validation.test.ts +5 -1
  161. package/bundle/src/utils/providers/common/schema-validation.ts +124 -56
  162. package/bundle/src/utils/providers/common/smooth-weighted-round-robin.ts +4 -0
  163. package/bundle/src/utils/providers/common/strictifier.ts +185 -59
  164. package/bundle/src/utils/providers/common/thinking.ts +2 -2
  165. package/bundle/src/utils/providers/common/ttft.ts +4 -2
  166. package/bundle/src/utils/providers/grok/__fixtures__/golden-responses-1.0.60.json +164 -0
  167. package/bundle/src/utils/providers/grok/grok-backend-protocol.test.ts +325 -0
  168. package/bundle/src/utils/providers/grok/grok-backend-protocol.ts +721 -0
  169. package/bundle/src/utils/providers/grok/grok-constants.ts +105 -0
  170. package/bundle/src/utils/providers/grok/grok-direct-client.test.ts +179 -0
  171. package/bundle/src/utils/providers/grok/grok-direct-client.ts +313 -0
  172. package/bundle/src/utils/providers/grok/grok-dispatcher.test.ts +1395 -0
  173. package/bundle/src/utils/providers/grok/grok-dispatcher.ts +2105 -0
  174. package/bundle/src/utils/providers/grok/grok-headers.test.ts +149 -0
  175. package/bundle/src/utils/providers/grok/grok-headers.ts +199 -0
  176. package/bundle/src/utils/providers/grok/grok-media-client.test.ts +446 -0
  177. package/bundle/src/utils/providers/grok/grok-media-client.ts +703 -0
  178. package/bundle/src/utils/providers/grok/grok-models.test.ts +96 -0
  179. package/bundle/src/utils/providers/grok/grok-models.ts +161 -0
  180. package/bundle/src/utils/providers/grok/grok-oauth.test.ts +406 -0
  181. package/bundle/src/utils/providers/grok/grok-oauth.ts +771 -0
  182. package/bundle/src/utils/providers/grok/grok-quota.test.ts +142 -0
  183. package/bundle/src/utils/providers/grok/grok-quota.ts +198 -0
  184. package/bundle/src/utils/providers/grok/grok-refresh.test.ts +239 -0
  185. package/bundle/src/utils/providers/grok/grok-refresh.ts +325 -0
  186. package/bundle/src/utils/providers/grok/grok-types.test.ts +252 -0
  187. package/bundle/src/utils/providers/grok/grok-types.ts +374 -0
  188. package/bundle/src/utils/providers/grok/grok-voice-client.test.ts +321 -0
  189. package/bundle/src/utils/providers/grok/grok-voice-client.ts +284 -0
  190. package/bundle/src/utils/providers/grok/index.ts +20 -0
  191. package/bundle/src/utils/providers/openai/openai-backend-protocol.ts +221 -137
  192. package/bundle/src/utils/providers/openai/openai-callback-relay.ts +12 -1
  193. package/bundle/src/utils/providers/openai/openai-constants.ts +2 -0
  194. package/bundle/src/utils/providers/openai/openai-direct-client.ts +111 -21
  195. package/bundle/src/utils/providers/openai/openai-dispatcher.ts +322 -169
  196. package/bundle/src/utils/providers/openai/openai-image-generation.ts +116 -36
  197. package/bundle/src/utils/providers/openai/openai-oauth.ts +48 -20
  198. package/bundle/src/utils/providers/openai/openai-quota.ts +77 -46
  199. package/bundle/src/utils/providers/openai/openai-refresh.ts +42 -18
  200. package/bundle/src/utils/providers/openai/openai-sse.ts +27 -3
  201. package/bundle/src/utils/providers/openai/openai-transport-config.ts +2 -0
  202. package/bundle/src/utils/quiet-hours.ts +12 -1
  203. package/bundle/src/utils/slack-notify.ts +44 -13
  204. package/bundle/src/utils/subset-loaders.ts +7 -7
  205. package/bundle/web-dist/client/assets/clsx-5XM_pHvN.js +1 -0
  206. package/bundle/web-dist/client/assets/index-BA7uQ-6c.js +31 -0
  207. package/bundle/web-dist/client/assets/index-Be2qCZmI.css +1 -0
  208. package/bundle/web-dist/client/assets/logs-C47OJGEI.js +1 -0
  209. package/bundle/web-dist/client/assets/monit-BS9no0dU.js +4 -0
  210. package/bundle/web-dist/client/assets/plus-sdACTfH0.js +1 -0
  211. package/bundle/web-dist/client/assets/refresh-cw-CY8o_1cT.js +1 -0
  212. package/bundle/web-dist/client/assets/request-model-BRtFuZvj.js +1 -0
  213. package/bundle/web-dist/client/assets/routes-kqgkUxE8.js +5 -0
  214. package/bundle/web-dist/client/assets/{services.generated-BsieU37H.js → services.generated-CefiDXEv.js} +5 -5
  215. package/bundle/web-dist/client/assets/settings-DNDvFGSw.js +1 -0
  216. package/bundle/web-dist/client/assets/show-u8Np69q3.js +2 -0
  217. package/bundle/web-dist/client/assets/tokens-QvP410NW.js +1 -0
  218. package/bundle/web-dist/client/assets/total-cost-MnfKU8IN.js +1 -0
  219. package/bundle/web-dist/client/assets/use-oauth-login-flow-Bzdh28Ws.js +1 -0
  220. package/bundle/web-dist/client/assets/use-update-token-mutation-CfJKaxmR.js +1 -0
  221. package/bundle/web-dist/client/assets/vendor-react-CUFFrVN9.js +244 -0
  222. package/bundle/web-dist/client/assets/vendor-tanstack-Bf_jag9G.js +1 -0
  223. package/bundle/web-dist/client/index.html +6 -6
  224. package/bundle/web-dist/server/assets/clsx-D_N5PN_2.js +16 -0
  225. package/bundle/web-dist/server/assets/{lazyRouteComponent-Dtd0NR4r.js → lazyRouteComponent-D8iTIHyn.js} +129 -2
  226. package/bundle/web-dist/server/assets/logs-B3OTd9hy.js +825 -0
  227. package/bundle/web-dist/server/assets/{monit-DvzribSE.js → monit-B2hqorPe.js} +385 -126
  228. package/bundle/web-dist/server/assets/plus-DwG7h9kq.js +28 -0
  229. package/bundle/web-dist/server/assets/{react-dom-B4a6-uuR.js → react-dom-BIYQzBqG.js} +2 -129
  230. package/bundle/web-dist/server/assets/refresh-cw-mMBkwOq0.js +44 -0
  231. package/bundle/web-dist/server/assets/{request-model-CbqfnQOJ.js → request-model-I6OdODSH.js} +15 -6
  232. package/bundle/web-dist/server/assets/{routes-BAPWTizT.js → routes-B95YlUv2.js} +760 -213
  233. package/bundle/web-dist/server/assets/{services.generated-CEbGjsI0.js → services.generated-DQATJ6qf.js} +12821 -12194
  234. package/bundle/web-dist/server/assets/settings-C3gbGk0m.js +830 -0
  235. package/bundle/web-dist/server/assets/{show-CxVZTAdv.js → show-Bxaj3rhH.js} +1355 -419
  236. package/bundle/web-dist/server/assets/tokens-CZjH3cB7.js +1038 -0
  237. package/bundle/web-dist/server/assets/total-cost-fTE9Xy82.js +18 -0
  238. package/bundle/web-dist/server/assets/use-oauth-login-flow-CKDHgc3U.js +2379 -0
  239. package/bundle/web-dist/server/assets/{use-update-token-mutation-CfYmk_4_.js → use-update-token-mutation-BEbgOzaa.js} +1 -1
  240. package/bundle/web-dist/server/entry-server.generated.js +4303 -22810
  241. package/dist/cli.js +9 -9
  242. package/package.json +4 -11
  243. package/postinstall.mjs +12 -0
  244. package/skills/qgrid/SKILL.md +1 -0
  245. package/skills/qgrid/references/cli-env-and-server-boot.md +4 -1
  246. package/skills/qgrid/references/decision-rationale.md +24 -1
  247. package/skills/qgrid/references/grok-runtime.md +89 -0
  248. package/skills/qgrid/references/provider-runtime-differences.md +30 -29
  249. package/skills/qgrid/references/repo-map.md +10 -0
  250. package/skills/qgrid/references/request-log-run-lifecycle.md +1 -1
  251. package/skills/qgrid/references/sonamu-api-web-flow.md +1 -1
  252. package/skills/qgrid/references/token-auth-quota-lifecycle.md +56 -3
  253. package/bundle/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.js +0 -406
  254. package/bundle/dist/node_modules/.pnpm/@vitest_expect@4.1.10/node_modules/@vitest/expect/dist/index.js +0 -1507
  255. package/bundle/dist/node_modules/.pnpm/@vitest_pretty-format@4.1.10/node_modules/@vitest/pretty-format/dist/index.js +0 -887
  256. package/bundle/dist/node_modules/.pnpm/@vitest_runner@4.1.10/node_modules/@vitest/runner/dist/chunk-artifact.js +0 -2756
  257. package/bundle/dist/node_modules/.pnpm/@vitest_runner@4.1.10/node_modules/@vitest/runner/dist/index.js +0 -8
  258. package/bundle/dist/node_modules/.pnpm/@vitest_runner@4.1.10/node_modules/@vitest/runner/dist/utils.js +0 -8
  259. package/bundle/dist/node_modules/.pnpm/@vitest_snapshot@4.1.10/node_modules/@vitest/snapshot/dist/index.js +0 -922
  260. package/bundle/dist/node_modules/.pnpm/@vitest_spy@4.1.10/node_modules/@vitest/spy/dist/index.js +0 -386
  261. package/bundle/dist/node_modules/.pnpm/@vitest_utils@4.1.10/node_modules/@vitest/utils/dist/chunk-pathe.M-eThtNZ.js +0 -121
  262. package/bundle/dist/node_modules/.pnpm/@vitest_utils@4.1.10/node_modules/@vitest/utils/dist/constants.js +0 -51
  263. package/bundle/dist/node_modules/.pnpm/@vitest_utils@4.1.10/node_modules/@vitest/utils/dist/diff.js +0 -1317
  264. package/bundle/dist/node_modules/.pnpm/@vitest_utils@4.1.10/node_modules/@vitest/utils/dist/display.js +0 -561
  265. package/bundle/dist/node_modules/.pnpm/@vitest_utils@4.1.10/node_modules/@vitest/utils/dist/error.js +0 -40
  266. package/bundle/dist/node_modules/.pnpm/@vitest_utils@4.1.10/node_modules/@vitest/utils/dist/helpers.js +0 -272
  267. package/bundle/dist/node_modules/.pnpm/@vitest_utils@4.1.10/node_modules/@vitest/utils/dist/offset.js +0 -27
  268. package/bundle/dist/node_modules/.pnpm/@vitest_utils@4.1.10/node_modules/@vitest/utils/dist/serialize.js +0 -77
  269. package/bundle/dist/node_modules/.pnpm/@vitest_utils@4.1.10/node_modules/@vitest/utils/dist/source-map.js +0 -381
  270. package/bundle/dist/node_modules/.pnpm/@vitest_utils@4.1.10/node_modules/@vitest/utils/dist/timers.js +0 -51
  271. package/bundle/dist/node_modules/.pnpm/chai@6.2.2/node_modules/chai/index.js +0 -2986
  272. package/bundle/dist/node_modules/.pnpm/expect-type@1.3.0/node_modules/expect-type/dist/branding.js +0 -10
  273. package/bundle/dist/node_modules/.pnpm/expect-type@1.3.0/node_modules/expect-type/dist/index.js +0 -109
  274. package/bundle/dist/node_modules/.pnpm/expect-type@1.3.0/node_modules/expect-type/dist/messages.js +0 -10
  275. package/bundle/dist/node_modules/.pnpm/expect-type@1.3.0/node_modules/expect-type/dist/overloads.js +0 -10
  276. package/bundle/dist/node_modules/.pnpm/expect-type@1.3.0/node_modules/expect-type/dist/utils.js +0 -10
  277. package/bundle/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.js +0 -1126
  278. package/bundle/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/index.js +0 -21
  279. package/bundle/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.js +0 -432
  280. package/bundle/dist/node_modules/.pnpm/tinybench@2.9.0/node_modules/tinybench/dist/index.js +0 -517
  281. package/bundle/dist/node_modules/.pnpm/tinyrainbow@3.1.0/node_modules/tinyrainbow/dist/index.js +0 -101
  282. package/bundle/dist/node_modules/.pnpm/vite@8.0.3_@emnapi_core@1.11.2_@emnapi_runtime@1.11.2_@types_node@25.0.7_esbuild@0.27.4_5b35fc1fb85d2af4d105e0d74f940f50/node_modules/vite/dist/node/module-runner.js +0 -1265
  283. package/bundle/dist/node_modules/.pnpm/vitest@4.1.10_@opentelemetry_api@1.9.0_@types_node@25.0.7_@vitest_coverage-v8@4.1.10_vi_a1977b93af7bb69308bcb1dbab39b618/node_modules/vitest/dist/chunks/_commonjsHelpers.D26ty3Ew.js +0 -9
  284. package/bundle/dist/node_modules/.pnpm/vitest@4.1.10_@opentelemetry_api@1.9.0_@types_node@25.0.7_@vitest_coverage-v8@4.1.10_vi_a1977b93af7bb69308bcb1dbab39b618/node_modules/vitest/dist/chunks/benchmark.CX_oY03V.js +0 -41
  285. package/bundle/dist/node_modules/.pnpm/vitest@4.1.10_@opentelemetry_api@1.9.0_@types_node@25.0.7_@vitest_coverage-v8@4.1.10_vi_a1977b93af7bb69308bcb1dbab39b618/node_modules/vitest/dist/chunks/evaluatedModules.Dg1zASAC.js +0 -19
  286. package/bundle/dist/node_modules/.pnpm/vitest@4.1.10_@opentelemetry_api@1.9.0_@types_node@25.0.7_@vitest_coverage-v8@4.1.10_vi_a1977b93af7bb69308bcb1dbab39b618/node_modules/vitest/dist/chunks/index.Chj8NDwU.js +0 -202
  287. package/bundle/dist/node_modules/.pnpm/vitest@4.1.10_@opentelemetry_api@1.9.0_@types_node@25.0.7_@vitest_coverage-v8@4.1.10_vi_a1977b93af7bb69308bcb1dbab39b618/node_modules/vitest/dist/chunks/index.DdgEv5B1.js +0 -46
  288. package/bundle/dist/node_modules/.pnpm/vitest@4.1.10_@opentelemetry_api@1.9.0_@types_node@25.0.7_@vitest_coverage-v8@4.1.10_vi_a1977b93af7bb69308bcb1dbab39b618/node_modules/vitest/dist/chunks/rpc.MzXet3jl.js +0 -119
  289. package/bundle/dist/node_modules/.pnpm/vitest@4.1.10_@opentelemetry_api@1.9.0_@types_node@25.0.7_@vitest_coverage-v8@4.1.10_vi_a1977b93af7bb69308bcb1dbab39b618/node_modules/vitest/dist/chunks/test.DNmyFkvJ.js +0 -3044
  290. package/bundle/dist/node_modules/.pnpm/vitest@4.1.10_@opentelemetry_api@1.9.0_@types_node@25.0.7_@vitest_coverage-v8@4.1.10_vi_a1977b93af7bb69308bcb1dbab39b618/node_modules/vitest/dist/chunks/utils.BX5Fg8C4.js +0 -59
  291. package/bundle/dist/node_modules/.pnpm/vitest@4.1.10_@opentelemetry_api@1.9.0_@types_node@25.0.7_@vitest_coverage-v8@4.1.10_vi_a1977b93af7bb69308bcb1dbab39b618/node_modules/vitest/dist/index.js +0 -28
  292. package/bundle/dist/testing/setup-mocks.js +0 -16
  293. package/bundle/src/testing/setup-mocks.ts +0 -44
  294. package/bundle/web-dist/client/assets/index-Bw2s88Ot.css +0 -1
  295. package/bundle/web-dist/client/assets/index-CrXKu_J8.js +0 -106
  296. package/bundle/web-dist/client/assets/logs-B2SmWJXA.js +0 -1
  297. package/bundle/web-dist/client/assets/monit-D-JwXXoA.js +0 -1
  298. package/bundle/web-dist/client/assets/plus-B62CuqT8.js +0 -1
  299. package/bundle/web-dist/client/assets/refresh-cw-NNcU0Cmq.js +0 -1
  300. package/bundle/web-dist/client/assets/request-model-CojtinqK.js +0 -1
  301. package/bundle/web-dist/client/assets/routes-C5r4gTvY.js +0 -5
  302. package/bundle/web-dist/client/assets/settings-D3tDSAck.js +0 -1
  303. package/bundle/web-dist/client/assets/show-Cah_kUKC.js +0 -2
  304. package/bundle/web-dist/client/assets/tokens-DU2Iyxxd.js +0 -1
  305. package/bundle/web-dist/client/assets/use-oauth-login-flow-D0UaR9_e.js +0 -1
  306. package/bundle/web-dist/client/assets/use-update-token-mutation-DAq0F8p-.js +0 -1
  307. package/bundle/web-dist/client/assets/vendor-react-DH4kUfK2.js +0 -9
  308. package/bundle/web-dist/client/assets/vendor-tanstack-DJRQAbrY.js +0 -1
  309. package/bundle/web-dist/server/assets/logs-l91avYif.js +0 -509
  310. package/bundle/web-dist/server/assets/plus-KZrECewT.js +0 -19
  311. package/bundle/web-dist/server/assets/refresh-cw-BND93JrF.js +0 -23
  312. package/bundle/web-dist/server/assets/settings-BZR5HSAL.js +0 -461
  313. package/bundle/web-dist/server/assets/tokens-D1hb4eKk.js +0 -448
  314. package/bundle/web-dist/server/assets/use-oauth-login-flow-Cvdy0zF8.js +0 -178
  315. package/dist/cli.d.ts +0 -10
  316. /package/bundle/web-dist/client/assets/{cost-DH2jZbrw.js → cost-DB3HbU7T.js} +0 -0
  317. /package/bundle/web-dist/client/assets/{preload-helper-ca-nBW7U.js → preload-helper-DWTEM3RW.js} +0 -0
  318. /package/bundle/web-dist/server/assets/{cost-eEHeTRT5.js → cost-BC9yzyA9.js} +0 -0
@@ -0,0 +1,2379 @@
1
+ import { F as require_react, N as useQueryClient, P as require_jsx_runtime, k as require_jsx_dev_runtime, n as QgridService, o as TokenService, tt as __toESM } from "./services.generated-DQATJ6qf.js";
2
+ import { t as clsx } from "./clsx-D_N5PN_2.js";
3
+ //#region ../../node_modules/.pnpm/tailwind-merge@3.5.0/node_modules/tailwind-merge/dist/bundle-mjs.mjs
4
+ /**
5
+ * Concatenates two arrays faster than the array spread operator.
6
+ */
7
+ var concatArrays = (array1, array2) => {
8
+ const combinedArray = new Array(array1.length + array2.length);
9
+ for (let i = 0; i < array1.length; i++) combinedArray[i] = array1[i];
10
+ for (let i = 0; i < array2.length; i++) combinedArray[array1.length + i] = array2[i];
11
+ return combinedArray;
12
+ };
13
+ var createClassValidatorObject = (classGroupId, validator) => ({
14
+ classGroupId,
15
+ validator
16
+ });
17
+ var createClassPartObject = (nextPart = /* @__PURE__ */ new Map(), validators = null, classGroupId) => ({
18
+ nextPart,
19
+ validators,
20
+ classGroupId
21
+ });
22
+ var CLASS_PART_SEPARATOR = "-";
23
+ var EMPTY_CONFLICTS = [];
24
+ var ARBITRARY_PROPERTY_PREFIX = "arbitrary..";
25
+ var createClassGroupUtils = (config) => {
26
+ const classMap = createClassMap(config);
27
+ const { conflictingClassGroups, conflictingClassGroupModifiers } = config;
28
+ const getClassGroupId = (className) => {
29
+ if (className.startsWith("[") && className.endsWith("]")) return getGroupIdForArbitraryProperty(className);
30
+ const classParts = className.split(CLASS_PART_SEPARATOR);
31
+ return getGroupRecursive(classParts, classParts[0] === "" && classParts.length > 1 ? 1 : 0, classMap);
32
+ };
33
+ const getConflictingClassGroupIds = (classGroupId, hasPostfixModifier) => {
34
+ if (hasPostfixModifier) {
35
+ const modifierConflicts = conflictingClassGroupModifiers[classGroupId];
36
+ const baseConflicts = conflictingClassGroups[classGroupId];
37
+ if (modifierConflicts) {
38
+ if (baseConflicts) return concatArrays(baseConflicts, modifierConflicts);
39
+ return modifierConflicts;
40
+ }
41
+ return baseConflicts || EMPTY_CONFLICTS;
42
+ }
43
+ return conflictingClassGroups[classGroupId] || EMPTY_CONFLICTS;
44
+ };
45
+ return {
46
+ getClassGroupId,
47
+ getConflictingClassGroupIds
48
+ };
49
+ };
50
+ var getGroupRecursive = (classParts, startIndex, classPartObject) => {
51
+ if (classParts.length - startIndex === 0) return classPartObject.classGroupId;
52
+ const currentClassPart = classParts[startIndex];
53
+ const nextClassPartObject = classPartObject.nextPart.get(currentClassPart);
54
+ if (nextClassPartObject) {
55
+ const result = getGroupRecursive(classParts, startIndex + 1, nextClassPartObject);
56
+ if (result) return result;
57
+ }
58
+ const validators = classPartObject.validators;
59
+ if (validators === null) return;
60
+ const classRest = startIndex === 0 ? classParts.join(CLASS_PART_SEPARATOR) : classParts.slice(startIndex).join(CLASS_PART_SEPARATOR);
61
+ const validatorsLength = validators.length;
62
+ for (let i = 0; i < validatorsLength; i++) {
63
+ const validatorObj = validators[i];
64
+ if (validatorObj.validator(classRest)) return validatorObj.classGroupId;
65
+ }
66
+ };
67
+ /**
68
+ * Get the class group ID for an arbitrary property.
69
+ *
70
+ * @param className - The class name to get the group ID for. Is expected to be string starting with `[` and ending with `]`.
71
+ */
72
+ var getGroupIdForArbitraryProperty = (className) => className.slice(1, -1).indexOf(":") === -1 ? void 0 : (() => {
73
+ const content = className.slice(1, -1);
74
+ const colonIndex = content.indexOf(":");
75
+ const property = content.slice(0, colonIndex);
76
+ return property ? ARBITRARY_PROPERTY_PREFIX + property : void 0;
77
+ })();
78
+ /**
79
+ * Exported for testing only
80
+ */
81
+ var createClassMap = (config) => {
82
+ const { theme, classGroups } = config;
83
+ return processClassGroups(classGroups, theme);
84
+ };
85
+ var processClassGroups = (classGroups, theme) => {
86
+ const classMap = createClassPartObject();
87
+ for (const classGroupId in classGroups) {
88
+ const group = classGroups[classGroupId];
89
+ processClassesRecursively(group, classMap, classGroupId, theme);
90
+ }
91
+ return classMap;
92
+ };
93
+ var processClassesRecursively = (classGroup, classPartObject, classGroupId, theme) => {
94
+ const len = classGroup.length;
95
+ for (let i = 0; i < len; i++) {
96
+ const classDefinition = classGroup[i];
97
+ processClassDefinition(classDefinition, classPartObject, classGroupId, theme);
98
+ }
99
+ };
100
+ var processClassDefinition = (classDefinition, classPartObject, classGroupId, theme) => {
101
+ if (typeof classDefinition === "string") {
102
+ processStringDefinition(classDefinition, classPartObject, classGroupId);
103
+ return;
104
+ }
105
+ if (typeof classDefinition === "function") {
106
+ processFunctionDefinition(classDefinition, classPartObject, classGroupId, theme);
107
+ return;
108
+ }
109
+ processObjectDefinition(classDefinition, classPartObject, classGroupId, theme);
110
+ };
111
+ var processStringDefinition = (classDefinition, classPartObject, classGroupId) => {
112
+ const classPartObjectToEdit = classDefinition === "" ? classPartObject : getPart(classPartObject, classDefinition);
113
+ classPartObjectToEdit.classGroupId = classGroupId;
114
+ };
115
+ var processFunctionDefinition = (classDefinition, classPartObject, classGroupId, theme) => {
116
+ if (isThemeGetter(classDefinition)) {
117
+ processClassesRecursively(classDefinition(theme), classPartObject, classGroupId, theme);
118
+ return;
119
+ }
120
+ if (classPartObject.validators === null) classPartObject.validators = [];
121
+ classPartObject.validators.push(createClassValidatorObject(classGroupId, classDefinition));
122
+ };
123
+ var processObjectDefinition = (classDefinition, classPartObject, classGroupId, theme) => {
124
+ const entries = Object.entries(classDefinition);
125
+ const len = entries.length;
126
+ for (let i = 0; i < len; i++) {
127
+ const [key, value] = entries[i];
128
+ processClassesRecursively(value, getPart(classPartObject, key), classGroupId, theme);
129
+ }
130
+ };
131
+ var getPart = (classPartObject, path) => {
132
+ let current = classPartObject;
133
+ const parts = path.split(CLASS_PART_SEPARATOR);
134
+ const len = parts.length;
135
+ for (let i = 0; i < len; i++) {
136
+ const part = parts[i];
137
+ let next = current.nextPart.get(part);
138
+ if (!next) {
139
+ next = createClassPartObject();
140
+ current.nextPart.set(part, next);
141
+ }
142
+ current = next;
143
+ }
144
+ return current;
145
+ };
146
+ var isThemeGetter = (func) => "isThemeGetter" in func && func.isThemeGetter === true;
147
+ var createLruCache = (maxCacheSize) => {
148
+ if (maxCacheSize < 1) return {
149
+ get: () => void 0,
150
+ set: () => {}
151
+ };
152
+ let cacheSize = 0;
153
+ let cache = Object.create(null);
154
+ let previousCache = Object.create(null);
155
+ const update = (key, value) => {
156
+ cache[key] = value;
157
+ cacheSize++;
158
+ if (cacheSize > maxCacheSize) {
159
+ cacheSize = 0;
160
+ previousCache = cache;
161
+ cache = Object.create(null);
162
+ }
163
+ };
164
+ return {
165
+ get(key) {
166
+ let value = cache[key];
167
+ if (value !== void 0) return value;
168
+ if ((value = previousCache[key]) !== void 0) {
169
+ update(key, value);
170
+ return value;
171
+ }
172
+ },
173
+ set(key, value) {
174
+ if (key in cache) cache[key] = value;
175
+ else update(key, value);
176
+ }
177
+ };
178
+ };
179
+ var IMPORTANT_MODIFIER = "!";
180
+ var MODIFIER_SEPARATOR = ":";
181
+ var EMPTY_MODIFIERS = [];
182
+ var createResultObject = (modifiers, hasImportantModifier, baseClassName, maybePostfixModifierPosition, isExternal) => ({
183
+ modifiers,
184
+ hasImportantModifier,
185
+ baseClassName,
186
+ maybePostfixModifierPosition,
187
+ isExternal
188
+ });
189
+ var createParseClassName = (config) => {
190
+ const { prefix, experimentalParseClassName } = config;
191
+ /**
192
+ * Parse class name into parts.
193
+ *
194
+ * Inspired by `splitAtTopLevelOnly` used in Tailwind CSS
195
+ * @see https://github.com/tailwindlabs/tailwindcss/blob/v3.2.2/src/util/splitAtTopLevelOnly.js
196
+ */
197
+ let parseClassName = (className) => {
198
+ const modifiers = [];
199
+ let bracketDepth = 0;
200
+ let parenDepth = 0;
201
+ let modifierStart = 0;
202
+ let postfixModifierPosition;
203
+ const len = className.length;
204
+ for (let index = 0; index < len; index++) {
205
+ const currentCharacter = className[index];
206
+ if (bracketDepth === 0 && parenDepth === 0) {
207
+ if (currentCharacter === MODIFIER_SEPARATOR) {
208
+ modifiers.push(className.slice(modifierStart, index));
209
+ modifierStart = index + 1;
210
+ continue;
211
+ }
212
+ if (currentCharacter === "/") {
213
+ postfixModifierPosition = index;
214
+ continue;
215
+ }
216
+ }
217
+ if (currentCharacter === "[") bracketDepth++;
218
+ else if (currentCharacter === "]") bracketDepth--;
219
+ else if (currentCharacter === "(") parenDepth++;
220
+ else if (currentCharacter === ")") parenDepth--;
221
+ }
222
+ const baseClassNameWithImportantModifier = modifiers.length === 0 ? className : className.slice(modifierStart);
223
+ let baseClassName = baseClassNameWithImportantModifier;
224
+ let hasImportantModifier = false;
225
+ if (baseClassNameWithImportantModifier.endsWith(IMPORTANT_MODIFIER)) {
226
+ baseClassName = baseClassNameWithImportantModifier.slice(0, -1);
227
+ hasImportantModifier = true;
228
+ } else if (baseClassNameWithImportantModifier.startsWith(IMPORTANT_MODIFIER)) {
229
+ baseClassName = baseClassNameWithImportantModifier.slice(1);
230
+ hasImportantModifier = true;
231
+ }
232
+ const maybePostfixModifierPosition = postfixModifierPosition && postfixModifierPosition > modifierStart ? postfixModifierPosition - modifierStart : void 0;
233
+ return createResultObject(modifiers, hasImportantModifier, baseClassName, maybePostfixModifierPosition);
234
+ };
235
+ if (prefix) {
236
+ const fullPrefix = prefix + MODIFIER_SEPARATOR;
237
+ const parseClassNameOriginal = parseClassName;
238
+ parseClassName = (className) => className.startsWith(fullPrefix) ? parseClassNameOriginal(className.slice(fullPrefix.length)) : createResultObject(EMPTY_MODIFIERS, false, className, void 0, true);
239
+ }
240
+ if (experimentalParseClassName) {
241
+ const parseClassNameOriginal = parseClassName;
242
+ parseClassName = (className) => experimentalParseClassName({
243
+ className,
244
+ parseClassName: parseClassNameOriginal
245
+ });
246
+ }
247
+ return parseClassName;
248
+ };
249
+ /**
250
+ * Sorts modifiers according to following schema:
251
+ * - Predefined modifiers are sorted alphabetically
252
+ * - When an arbitrary variant appears, it must be preserved which modifiers are before and after it
253
+ */
254
+ var createSortModifiers = (config) => {
255
+ const modifierWeights = /* @__PURE__ */ new Map();
256
+ config.orderSensitiveModifiers.forEach((mod, index) => {
257
+ modifierWeights.set(mod, 1e6 + index);
258
+ });
259
+ return (modifiers) => {
260
+ const result = [];
261
+ let currentSegment = [];
262
+ for (let i = 0; i < modifiers.length; i++) {
263
+ const modifier = modifiers[i];
264
+ const isArbitrary = modifier[0] === "[";
265
+ const isOrderSensitive = modifierWeights.has(modifier);
266
+ if (isArbitrary || isOrderSensitive) {
267
+ if (currentSegment.length > 0) {
268
+ currentSegment.sort();
269
+ result.push(...currentSegment);
270
+ currentSegment = [];
271
+ }
272
+ result.push(modifier);
273
+ } else currentSegment.push(modifier);
274
+ }
275
+ if (currentSegment.length > 0) {
276
+ currentSegment.sort();
277
+ result.push(...currentSegment);
278
+ }
279
+ return result;
280
+ };
281
+ };
282
+ var createConfigUtils = (config) => ({
283
+ cache: createLruCache(config.cacheSize),
284
+ parseClassName: createParseClassName(config),
285
+ sortModifiers: createSortModifiers(config),
286
+ ...createClassGroupUtils(config)
287
+ });
288
+ var SPLIT_CLASSES_REGEX = /\s+/;
289
+ var mergeClassList = (classList, configUtils) => {
290
+ const { parseClassName, getClassGroupId, getConflictingClassGroupIds, sortModifiers } = configUtils;
291
+ /**
292
+ * Set of classGroupIds in following format:
293
+ * `{importantModifier}{variantModifiers}{classGroupId}`
294
+ * @example 'float'
295
+ * @example 'hover:focus:bg-color'
296
+ * @example 'md:!pr'
297
+ */
298
+ const classGroupsInConflict = [];
299
+ const classNames = classList.trim().split(SPLIT_CLASSES_REGEX);
300
+ let result = "";
301
+ for (let index = classNames.length - 1; index >= 0; index -= 1) {
302
+ const originalClassName = classNames[index];
303
+ const { isExternal, modifiers, hasImportantModifier, baseClassName, maybePostfixModifierPosition } = parseClassName(originalClassName);
304
+ if (isExternal) {
305
+ result = originalClassName + (result.length > 0 ? " " + result : result);
306
+ continue;
307
+ }
308
+ let hasPostfixModifier = !!maybePostfixModifierPosition;
309
+ let classGroupId = getClassGroupId(hasPostfixModifier ? baseClassName.substring(0, maybePostfixModifierPosition) : baseClassName);
310
+ if (!classGroupId) {
311
+ if (!hasPostfixModifier) {
312
+ result = originalClassName + (result.length > 0 ? " " + result : result);
313
+ continue;
314
+ }
315
+ classGroupId = getClassGroupId(baseClassName);
316
+ if (!classGroupId) {
317
+ result = originalClassName + (result.length > 0 ? " " + result : result);
318
+ continue;
319
+ }
320
+ hasPostfixModifier = false;
321
+ }
322
+ const variantModifier = modifiers.length === 0 ? "" : modifiers.length === 1 ? modifiers[0] : sortModifiers(modifiers).join(":");
323
+ const modifierId = hasImportantModifier ? variantModifier + IMPORTANT_MODIFIER : variantModifier;
324
+ const classId = modifierId + classGroupId;
325
+ if (classGroupsInConflict.indexOf(classId) > -1) continue;
326
+ classGroupsInConflict.push(classId);
327
+ const conflictGroups = getConflictingClassGroupIds(classGroupId, hasPostfixModifier);
328
+ for (let i = 0; i < conflictGroups.length; ++i) {
329
+ const group = conflictGroups[i];
330
+ classGroupsInConflict.push(modifierId + group);
331
+ }
332
+ result = originalClassName + (result.length > 0 ? " " + result : result);
333
+ }
334
+ return result;
335
+ };
336
+ /**
337
+ * The code in this file is copied from https://github.com/lukeed/clsx and modified to suit the needs of tailwind-merge better.
338
+ *
339
+ * Specifically:
340
+ * - Runtime code from https://github.com/lukeed/clsx/blob/v1.2.1/src/index.js
341
+ * - TypeScript types from https://github.com/lukeed/clsx/blob/v1.2.1/clsx.d.ts
342
+ *
343
+ * Original code has MIT license: Copyright (c) Luke Edwards <luke.edwards05@gmail.com> (lukeed.com)
344
+ */
345
+ var twJoin = (...classLists) => {
346
+ let index = 0;
347
+ let argument;
348
+ let resolvedValue;
349
+ let string = "";
350
+ while (index < classLists.length) if (argument = classLists[index++]) {
351
+ if (resolvedValue = toValue(argument)) {
352
+ string && (string += " ");
353
+ string += resolvedValue;
354
+ }
355
+ }
356
+ return string;
357
+ };
358
+ var toValue = (mix) => {
359
+ if (typeof mix === "string") return mix;
360
+ let resolvedValue;
361
+ let string = "";
362
+ for (let k = 0; k < mix.length; k++) if (mix[k]) {
363
+ if (resolvedValue = toValue(mix[k])) {
364
+ string && (string += " ");
365
+ string += resolvedValue;
366
+ }
367
+ }
368
+ return string;
369
+ };
370
+ var createTailwindMerge = (createConfigFirst, ...createConfigRest) => {
371
+ let configUtils;
372
+ let cacheGet;
373
+ let cacheSet;
374
+ let functionToCall;
375
+ const initTailwindMerge = (classList) => {
376
+ configUtils = createConfigUtils(createConfigRest.reduce((previousConfig, createConfigCurrent) => createConfigCurrent(previousConfig), createConfigFirst()));
377
+ cacheGet = configUtils.cache.get;
378
+ cacheSet = configUtils.cache.set;
379
+ functionToCall = tailwindMerge;
380
+ return tailwindMerge(classList);
381
+ };
382
+ const tailwindMerge = (classList) => {
383
+ const cachedResult = cacheGet(classList);
384
+ if (cachedResult) return cachedResult;
385
+ const result = mergeClassList(classList, configUtils);
386
+ cacheSet(classList, result);
387
+ return result;
388
+ };
389
+ functionToCall = initTailwindMerge;
390
+ return (...args) => functionToCall(twJoin(...args));
391
+ };
392
+ var fallbackThemeArr = [];
393
+ var fromTheme = (key) => {
394
+ const themeGetter = (theme) => theme[key] || fallbackThemeArr;
395
+ themeGetter.isThemeGetter = true;
396
+ return themeGetter;
397
+ };
398
+ var arbitraryValueRegex = /^\[(?:(\w[\w-]*):)?(.+)\]$/i;
399
+ var arbitraryVariableRegex = /^\((?:(\w[\w-]*):)?(.+)\)$/i;
400
+ var fractionRegex = /^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/;
401
+ var tshirtUnitRegex = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/;
402
+ 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$/;
403
+ var colorFunctionRegex = /^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/;
404
+ var shadowRegex = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/;
405
+ var imageRegex = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;
406
+ var isFraction = (value) => fractionRegex.test(value);
407
+ var isNumber = (value) => !!value && !Number.isNaN(Number(value));
408
+ var isInteger = (value) => !!value && Number.isInteger(Number(value));
409
+ var isPercent = (value) => value.endsWith("%") && isNumber(value.slice(0, -1));
410
+ var isTshirtSize = (value) => tshirtUnitRegex.test(value);
411
+ var isAny = () => true;
412
+ var isLengthOnly = (value) => lengthUnitRegex.test(value) && !colorFunctionRegex.test(value);
413
+ var isNever = () => false;
414
+ var isShadow = (value) => shadowRegex.test(value);
415
+ var isImage = (value) => imageRegex.test(value);
416
+ var isAnyNonArbitrary = (value) => !isArbitraryValue(value) && !isArbitraryVariable(value);
417
+ var isArbitrarySize = (value) => getIsArbitraryValue(value, isLabelSize, isNever);
418
+ var isArbitraryValue = (value) => arbitraryValueRegex.test(value);
419
+ var isArbitraryLength = (value) => getIsArbitraryValue(value, isLabelLength, isLengthOnly);
420
+ var isArbitraryNumber = (value) => getIsArbitraryValue(value, isLabelNumber, isNumber);
421
+ var isArbitraryWeight = (value) => getIsArbitraryValue(value, isLabelWeight, isAny);
422
+ var isArbitraryFamilyName = (value) => getIsArbitraryValue(value, isLabelFamilyName, isNever);
423
+ var isArbitraryPosition = (value) => getIsArbitraryValue(value, isLabelPosition, isNever);
424
+ var isArbitraryImage = (value) => getIsArbitraryValue(value, isLabelImage, isImage);
425
+ var isArbitraryShadow = (value) => getIsArbitraryValue(value, isLabelShadow, isShadow);
426
+ var isArbitraryVariable = (value) => arbitraryVariableRegex.test(value);
427
+ var isArbitraryVariableLength = (value) => getIsArbitraryVariable(value, isLabelLength);
428
+ var isArbitraryVariableFamilyName = (value) => getIsArbitraryVariable(value, isLabelFamilyName);
429
+ var isArbitraryVariablePosition = (value) => getIsArbitraryVariable(value, isLabelPosition);
430
+ var isArbitraryVariableSize = (value) => getIsArbitraryVariable(value, isLabelSize);
431
+ var isArbitraryVariableImage = (value) => getIsArbitraryVariable(value, isLabelImage);
432
+ var isArbitraryVariableShadow = (value) => getIsArbitraryVariable(value, isLabelShadow, true);
433
+ var isArbitraryVariableWeight = (value) => getIsArbitraryVariable(value, isLabelWeight, true);
434
+ var getIsArbitraryValue = (value, testLabel, testValue) => {
435
+ const result = arbitraryValueRegex.exec(value);
436
+ if (result) {
437
+ if (result[1]) return testLabel(result[1]);
438
+ return testValue(result[2]);
439
+ }
440
+ return false;
441
+ };
442
+ var getIsArbitraryVariable = (value, testLabel, shouldMatchNoLabel = false) => {
443
+ const result = arbitraryVariableRegex.exec(value);
444
+ if (result) {
445
+ if (result[1]) return testLabel(result[1]);
446
+ return shouldMatchNoLabel;
447
+ }
448
+ return false;
449
+ };
450
+ var isLabelPosition = (label) => label === "position" || label === "percentage";
451
+ var isLabelImage = (label) => label === "image" || label === "url";
452
+ var isLabelSize = (label) => label === "length" || label === "size" || label === "bg-size";
453
+ var isLabelLength = (label) => label === "length";
454
+ var isLabelNumber = (label) => label === "number";
455
+ var isLabelFamilyName = (label) => label === "family-name";
456
+ var isLabelWeight = (label) => label === "number" || label === "weight";
457
+ var isLabelShadow = (label) => label === "shadow";
458
+ var getDefaultConfig = () => {
459
+ /**
460
+ * Theme getters for theme variable namespaces
461
+ * @see https://tailwindcss.com/docs/theme#theme-variable-namespaces
462
+ */
463
+ const themeColor = fromTheme("color");
464
+ const themeFont = fromTheme("font");
465
+ const themeText = fromTheme("text");
466
+ const themeFontWeight = fromTheme("font-weight");
467
+ const themeTracking = fromTheme("tracking");
468
+ const themeLeading = fromTheme("leading");
469
+ const themeBreakpoint = fromTheme("breakpoint");
470
+ const themeContainer = fromTheme("container");
471
+ const themeSpacing = fromTheme("spacing");
472
+ const themeRadius = fromTheme("radius");
473
+ const themeShadow = fromTheme("shadow");
474
+ const themeInsetShadow = fromTheme("inset-shadow");
475
+ const themeTextShadow = fromTheme("text-shadow");
476
+ const themeDropShadow = fromTheme("drop-shadow");
477
+ const themeBlur = fromTheme("blur");
478
+ const themePerspective = fromTheme("perspective");
479
+ const themeAspect = fromTheme("aspect");
480
+ const themeEase = fromTheme("ease");
481
+ const themeAnimate = fromTheme("animate");
482
+ /**
483
+ * Helpers to avoid repeating the same scales
484
+ *
485
+ * We use functions that create a new array every time they're called instead of static arrays.
486
+ * This ensures that users who modify any scale by mutating the array (e.g. with `array.push(element)`) don't accidentally mutate arrays in other parts of the config.
487
+ */
488
+ const scaleBreak = () => [
489
+ "auto",
490
+ "avoid",
491
+ "all",
492
+ "avoid-page",
493
+ "page",
494
+ "left",
495
+ "right",
496
+ "column"
497
+ ];
498
+ const scalePosition = () => [
499
+ "center",
500
+ "top",
501
+ "bottom",
502
+ "left",
503
+ "right",
504
+ "top-left",
505
+ "left-top",
506
+ "top-right",
507
+ "right-top",
508
+ "bottom-right",
509
+ "right-bottom",
510
+ "bottom-left",
511
+ "left-bottom"
512
+ ];
513
+ const scalePositionWithArbitrary = () => [
514
+ ...scalePosition(),
515
+ isArbitraryVariable,
516
+ isArbitraryValue
517
+ ];
518
+ const scaleOverflow = () => [
519
+ "auto",
520
+ "hidden",
521
+ "clip",
522
+ "visible",
523
+ "scroll"
524
+ ];
525
+ const scaleOverscroll = () => [
526
+ "auto",
527
+ "contain",
528
+ "none"
529
+ ];
530
+ const scaleUnambiguousSpacing = () => [
531
+ isArbitraryVariable,
532
+ isArbitraryValue,
533
+ themeSpacing
534
+ ];
535
+ const scaleInset = () => [
536
+ isFraction,
537
+ "full",
538
+ "auto",
539
+ ...scaleUnambiguousSpacing()
540
+ ];
541
+ const scaleGridTemplateColsRows = () => [
542
+ isInteger,
543
+ "none",
544
+ "subgrid",
545
+ isArbitraryVariable,
546
+ isArbitraryValue
547
+ ];
548
+ const scaleGridColRowStartAndEnd = () => [
549
+ "auto",
550
+ { span: [
551
+ "full",
552
+ isInteger,
553
+ isArbitraryVariable,
554
+ isArbitraryValue
555
+ ] },
556
+ isInteger,
557
+ isArbitraryVariable,
558
+ isArbitraryValue
559
+ ];
560
+ const scaleGridColRowStartOrEnd = () => [
561
+ isInteger,
562
+ "auto",
563
+ isArbitraryVariable,
564
+ isArbitraryValue
565
+ ];
566
+ const scaleGridAutoColsRows = () => [
567
+ "auto",
568
+ "min",
569
+ "max",
570
+ "fr",
571
+ isArbitraryVariable,
572
+ isArbitraryValue
573
+ ];
574
+ const scaleAlignPrimaryAxis = () => [
575
+ "start",
576
+ "end",
577
+ "center",
578
+ "between",
579
+ "around",
580
+ "evenly",
581
+ "stretch",
582
+ "baseline",
583
+ "center-safe",
584
+ "end-safe"
585
+ ];
586
+ const scaleAlignSecondaryAxis = () => [
587
+ "start",
588
+ "end",
589
+ "center",
590
+ "stretch",
591
+ "center-safe",
592
+ "end-safe"
593
+ ];
594
+ const scaleMargin = () => ["auto", ...scaleUnambiguousSpacing()];
595
+ const scaleSizing = () => [
596
+ isFraction,
597
+ "auto",
598
+ "full",
599
+ "dvw",
600
+ "dvh",
601
+ "lvw",
602
+ "lvh",
603
+ "svw",
604
+ "svh",
605
+ "min",
606
+ "max",
607
+ "fit",
608
+ ...scaleUnambiguousSpacing()
609
+ ];
610
+ const scaleSizingInline = () => [
611
+ isFraction,
612
+ "screen",
613
+ "full",
614
+ "dvw",
615
+ "lvw",
616
+ "svw",
617
+ "min",
618
+ "max",
619
+ "fit",
620
+ ...scaleUnambiguousSpacing()
621
+ ];
622
+ const scaleSizingBlock = () => [
623
+ isFraction,
624
+ "screen",
625
+ "full",
626
+ "lh",
627
+ "dvh",
628
+ "lvh",
629
+ "svh",
630
+ "min",
631
+ "max",
632
+ "fit",
633
+ ...scaleUnambiguousSpacing()
634
+ ];
635
+ const scaleColor = () => [
636
+ themeColor,
637
+ isArbitraryVariable,
638
+ isArbitraryValue
639
+ ];
640
+ const scaleBgPosition = () => [
641
+ ...scalePosition(),
642
+ isArbitraryVariablePosition,
643
+ isArbitraryPosition,
644
+ { position: [isArbitraryVariable, isArbitraryValue] }
645
+ ];
646
+ const scaleBgRepeat = () => ["no-repeat", { repeat: [
647
+ "",
648
+ "x",
649
+ "y",
650
+ "space",
651
+ "round"
652
+ ] }];
653
+ const scaleBgSize = () => [
654
+ "auto",
655
+ "cover",
656
+ "contain",
657
+ isArbitraryVariableSize,
658
+ isArbitrarySize,
659
+ { size: [isArbitraryVariable, isArbitraryValue] }
660
+ ];
661
+ const scaleGradientStopPosition = () => [
662
+ isPercent,
663
+ isArbitraryVariableLength,
664
+ isArbitraryLength
665
+ ];
666
+ const scaleRadius = () => [
667
+ "",
668
+ "none",
669
+ "full",
670
+ themeRadius,
671
+ isArbitraryVariable,
672
+ isArbitraryValue
673
+ ];
674
+ const scaleBorderWidth = () => [
675
+ "",
676
+ isNumber,
677
+ isArbitraryVariableLength,
678
+ isArbitraryLength
679
+ ];
680
+ const scaleLineStyle = () => [
681
+ "solid",
682
+ "dashed",
683
+ "dotted",
684
+ "double"
685
+ ];
686
+ const scaleBlendMode = () => [
687
+ "normal",
688
+ "multiply",
689
+ "screen",
690
+ "overlay",
691
+ "darken",
692
+ "lighten",
693
+ "color-dodge",
694
+ "color-burn",
695
+ "hard-light",
696
+ "soft-light",
697
+ "difference",
698
+ "exclusion",
699
+ "hue",
700
+ "saturation",
701
+ "color",
702
+ "luminosity"
703
+ ];
704
+ const scaleMaskImagePosition = () => [
705
+ isNumber,
706
+ isPercent,
707
+ isArbitraryVariablePosition,
708
+ isArbitraryPosition
709
+ ];
710
+ const scaleBlur = () => [
711
+ "",
712
+ "none",
713
+ themeBlur,
714
+ isArbitraryVariable,
715
+ isArbitraryValue
716
+ ];
717
+ const scaleRotate = () => [
718
+ "none",
719
+ isNumber,
720
+ isArbitraryVariable,
721
+ isArbitraryValue
722
+ ];
723
+ const scaleScale = () => [
724
+ "none",
725
+ isNumber,
726
+ isArbitraryVariable,
727
+ isArbitraryValue
728
+ ];
729
+ const scaleSkew = () => [
730
+ isNumber,
731
+ isArbitraryVariable,
732
+ isArbitraryValue
733
+ ];
734
+ const scaleTranslate = () => [
735
+ isFraction,
736
+ "full",
737
+ ...scaleUnambiguousSpacing()
738
+ ];
739
+ return {
740
+ cacheSize: 500,
741
+ theme: {
742
+ animate: [
743
+ "spin",
744
+ "ping",
745
+ "pulse",
746
+ "bounce"
747
+ ],
748
+ aspect: ["video"],
749
+ blur: [isTshirtSize],
750
+ breakpoint: [isTshirtSize],
751
+ color: [isAny],
752
+ container: [isTshirtSize],
753
+ "drop-shadow": [isTshirtSize],
754
+ ease: [
755
+ "in",
756
+ "out",
757
+ "in-out"
758
+ ],
759
+ font: [isAnyNonArbitrary],
760
+ "font-weight": [
761
+ "thin",
762
+ "extralight",
763
+ "light",
764
+ "normal",
765
+ "medium",
766
+ "semibold",
767
+ "bold",
768
+ "extrabold",
769
+ "black"
770
+ ],
771
+ "inset-shadow": [isTshirtSize],
772
+ leading: [
773
+ "none",
774
+ "tight",
775
+ "snug",
776
+ "normal",
777
+ "relaxed",
778
+ "loose"
779
+ ],
780
+ perspective: [
781
+ "dramatic",
782
+ "near",
783
+ "normal",
784
+ "midrange",
785
+ "distant",
786
+ "none"
787
+ ],
788
+ radius: [isTshirtSize],
789
+ shadow: [isTshirtSize],
790
+ spacing: ["px", isNumber],
791
+ text: [isTshirtSize],
792
+ "text-shadow": [isTshirtSize],
793
+ tracking: [
794
+ "tighter",
795
+ "tight",
796
+ "normal",
797
+ "wide",
798
+ "wider",
799
+ "widest"
800
+ ]
801
+ },
802
+ classGroups: {
803
+ aspect: [{ aspect: [
804
+ "auto",
805
+ "square",
806
+ isFraction,
807
+ isArbitraryValue,
808
+ isArbitraryVariable,
809
+ themeAspect
810
+ ] }],
811
+ container: ["container"],
812
+ columns: [{ columns: [
813
+ isNumber,
814
+ isArbitraryValue,
815
+ isArbitraryVariable,
816
+ themeContainer
817
+ ] }],
818
+ "break-after": [{ "break-after": scaleBreak() }],
819
+ "break-before": [{ "break-before": scaleBreak() }],
820
+ "break-inside": [{ "break-inside": [
821
+ "auto",
822
+ "avoid",
823
+ "avoid-page",
824
+ "avoid-column"
825
+ ] }],
826
+ "box-decoration": [{ "box-decoration": ["slice", "clone"] }],
827
+ box: [{ box: ["border", "content"] }],
828
+ display: [
829
+ "block",
830
+ "inline-block",
831
+ "inline",
832
+ "flex",
833
+ "inline-flex",
834
+ "table",
835
+ "inline-table",
836
+ "table-caption",
837
+ "table-cell",
838
+ "table-column",
839
+ "table-column-group",
840
+ "table-footer-group",
841
+ "table-header-group",
842
+ "table-row-group",
843
+ "table-row",
844
+ "flow-root",
845
+ "grid",
846
+ "inline-grid",
847
+ "contents",
848
+ "list-item",
849
+ "hidden"
850
+ ],
851
+ sr: ["sr-only", "not-sr-only"],
852
+ float: [{ float: [
853
+ "right",
854
+ "left",
855
+ "none",
856
+ "start",
857
+ "end"
858
+ ] }],
859
+ clear: [{ clear: [
860
+ "left",
861
+ "right",
862
+ "both",
863
+ "none",
864
+ "start",
865
+ "end"
866
+ ] }],
867
+ isolation: ["isolate", "isolation-auto"],
868
+ "object-fit": [{ object: [
869
+ "contain",
870
+ "cover",
871
+ "fill",
872
+ "none",
873
+ "scale-down"
874
+ ] }],
875
+ "object-position": [{ object: scalePositionWithArbitrary() }],
876
+ overflow: [{ overflow: scaleOverflow() }],
877
+ "overflow-x": [{ "overflow-x": scaleOverflow() }],
878
+ "overflow-y": [{ "overflow-y": scaleOverflow() }],
879
+ overscroll: [{ overscroll: scaleOverscroll() }],
880
+ "overscroll-x": [{ "overscroll-x": scaleOverscroll() }],
881
+ "overscroll-y": [{ "overscroll-y": scaleOverscroll() }],
882
+ position: [
883
+ "static",
884
+ "fixed",
885
+ "absolute",
886
+ "relative",
887
+ "sticky"
888
+ ],
889
+ inset: [{ inset: scaleInset() }],
890
+ "inset-x": [{ "inset-x": scaleInset() }],
891
+ "inset-y": [{ "inset-y": scaleInset() }],
892
+ start: [{
893
+ "inset-s": scaleInset(),
894
+ start: scaleInset()
895
+ }],
896
+ end: [{
897
+ "inset-e": scaleInset(),
898
+ end: scaleInset()
899
+ }],
900
+ "inset-bs": [{ "inset-bs": scaleInset() }],
901
+ "inset-be": [{ "inset-be": scaleInset() }],
902
+ top: [{ top: scaleInset() }],
903
+ right: [{ right: scaleInset() }],
904
+ bottom: [{ bottom: scaleInset() }],
905
+ left: [{ left: scaleInset() }],
906
+ visibility: [
907
+ "visible",
908
+ "invisible",
909
+ "collapse"
910
+ ],
911
+ z: [{ z: [
912
+ isInteger,
913
+ "auto",
914
+ isArbitraryVariable,
915
+ isArbitraryValue
916
+ ] }],
917
+ basis: [{ basis: [
918
+ isFraction,
919
+ "full",
920
+ "auto",
921
+ themeContainer,
922
+ ...scaleUnambiguousSpacing()
923
+ ] }],
924
+ "flex-direction": [{ flex: [
925
+ "row",
926
+ "row-reverse",
927
+ "col",
928
+ "col-reverse"
929
+ ] }],
930
+ "flex-wrap": [{ flex: [
931
+ "nowrap",
932
+ "wrap",
933
+ "wrap-reverse"
934
+ ] }],
935
+ flex: [{ flex: [
936
+ isNumber,
937
+ isFraction,
938
+ "auto",
939
+ "initial",
940
+ "none",
941
+ isArbitraryValue
942
+ ] }],
943
+ grow: [{ grow: [
944
+ "",
945
+ isNumber,
946
+ isArbitraryVariable,
947
+ isArbitraryValue
948
+ ] }],
949
+ shrink: [{ shrink: [
950
+ "",
951
+ isNumber,
952
+ isArbitraryVariable,
953
+ isArbitraryValue
954
+ ] }],
955
+ order: [{ order: [
956
+ isInteger,
957
+ "first",
958
+ "last",
959
+ "none",
960
+ isArbitraryVariable,
961
+ isArbitraryValue
962
+ ] }],
963
+ "grid-cols": [{ "grid-cols": scaleGridTemplateColsRows() }],
964
+ "col-start-end": [{ col: scaleGridColRowStartAndEnd() }],
965
+ "col-start": [{ "col-start": scaleGridColRowStartOrEnd() }],
966
+ "col-end": [{ "col-end": scaleGridColRowStartOrEnd() }],
967
+ "grid-rows": [{ "grid-rows": scaleGridTemplateColsRows() }],
968
+ "row-start-end": [{ row: scaleGridColRowStartAndEnd() }],
969
+ "row-start": [{ "row-start": scaleGridColRowStartOrEnd() }],
970
+ "row-end": [{ "row-end": scaleGridColRowStartOrEnd() }],
971
+ "grid-flow": [{ "grid-flow": [
972
+ "row",
973
+ "col",
974
+ "dense",
975
+ "row-dense",
976
+ "col-dense"
977
+ ] }],
978
+ "auto-cols": [{ "auto-cols": scaleGridAutoColsRows() }],
979
+ "auto-rows": [{ "auto-rows": scaleGridAutoColsRows() }],
980
+ gap: [{ gap: scaleUnambiguousSpacing() }],
981
+ "gap-x": [{ "gap-x": scaleUnambiguousSpacing() }],
982
+ "gap-y": [{ "gap-y": scaleUnambiguousSpacing() }],
983
+ "justify-content": [{ justify: [...scaleAlignPrimaryAxis(), "normal"] }],
984
+ "justify-items": [{ "justify-items": [...scaleAlignSecondaryAxis(), "normal"] }],
985
+ "justify-self": [{ "justify-self": ["auto", ...scaleAlignSecondaryAxis()] }],
986
+ "align-content": [{ content: ["normal", ...scaleAlignPrimaryAxis()] }],
987
+ "align-items": [{ items: [...scaleAlignSecondaryAxis(), { baseline: ["", "last"] }] }],
988
+ "align-self": [{ self: [
989
+ "auto",
990
+ ...scaleAlignSecondaryAxis(),
991
+ { baseline: ["", "last"] }
992
+ ] }],
993
+ "place-content": [{ "place-content": scaleAlignPrimaryAxis() }],
994
+ "place-items": [{ "place-items": [...scaleAlignSecondaryAxis(), "baseline"] }],
995
+ "place-self": [{ "place-self": ["auto", ...scaleAlignSecondaryAxis()] }],
996
+ p: [{ p: scaleUnambiguousSpacing() }],
997
+ px: [{ px: scaleUnambiguousSpacing() }],
998
+ py: [{ py: scaleUnambiguousSpacing() }],
999
+ ps: [{ ps: scaleUnambiguousSpacing() }],
1000
+ pe: [{ pe: scaleUnambiguousSpacing() }],
1001
+ pbs: [{ pbs: scaleUnambiguousSpacing() }],
1002
+ pbe: [{ pbe: scaleUnambiguousSpacing() }],
1003
+ pt: [{ pt: scaleUnambiguousSpacing() }],
1004
+ pr: [{ pr: scaleUnambiguousSpacing() }],
1005
+ pb: [{ pb: scaleUnambiguousSpacing() }],
1006
+ pl: [{ pl: scaleUnambiguousSpacing() }],
1007
+ m: [{ m: scaleMargin() }],
1008
+ mx: [{ mx: scaleMargin() }],
1009
+ my: [{ my: scaleMargin() }],
1010
+ ms: [{ ms: scaleMargin() }],
1011
+ me: [{ me: scaleMargin() }],
1012
+ mbs: [{ mbs: scaleMargin() }],
1013
+ mbe: [{ mbe: scaleMargin() }],
1014
+ mt: [{ mt: scaleMargin() }],
1015
+ mr: [{ mr: scaleMargin() }],
1016
+ mb: [{ mb: scaleMargin() }],
1017
+ ml: [{ ml: scaleMargin() }],
1018
+ "space-x": [{ "space-x": scaleUnambiguousSpacing() }],
1019
+ "space-x-reverse": ["space-x-reverse"],
1020
+ "space-y": [{ "space-y": scaleUnambiguousSpacing() }],
1021
+ "space-y-reverse": ["space-y-reverse"],
1022
+ size: [{ size: scaleSizing() }],
1023
+ "inline-size": [{ inline: ["auto", ...scaleSizingInline()] }],
1024
+ "min-inline-size": [{ "min-inline": ["auto", ...scaleSizingInline()] }],
1025
+ "max-inline-size": [{ "max-inline": ["none", ...scaleSizingInline()] }],
1026
+ "block-size": [{ block: ["auto", ...scaleSizingBlock()] }],
1027
+ "min-block-size": [{ "min-block": ["auto", ...scaleSizingBlock()] }],
1028
+ "max-block-size": [{ "max-block": ["none", ...scaleSizingBlock()] }],
1029
+ w: [{ w: [
1030
+ themeContainer,
1031
+ "screen",
1032
+ ...scaleSizing()
1033
+ ] }],
1034
+ "min-w": [{ "min-w": [
1035
+ themeContainer,
1036
+ "screen",
1037
+ "none",
1038
+ ...scaleSizing()
1039
+ ] }],
1040
+ "max-w": [{ "max-w": [
1041
+ themeContainer,
1042
+ "screen",
1043
+ "none",
1044
+ "prose",
1045
+ { screen: [themeBreakpoint] },
1046
+ ...scaleSizing()
1047
+ ] }],
1048
+ h: [{ h: [
1049
+ "screen",
1050
+ "lh",
1051
+ ...scaleSizing()
1052
+ ] }],
1053
+ "min-h": [{ "min-h": [
1054
+ "screen",
1055
+ "lh",
1056
+ "none",
1057
+ ...scaleSizing()
1058
+ ] }],
1059
+ "max-h": [{ "max-h": [
1060
+ "screen",
1061
+ "lh",
1062
+ ...scaleSizing()
1063
+ ] }],
1064
+ "font-size": [{ text: [
1065
+ "base",
1066
+ themeText,
1067
+ isArbitraryVariableLength,
1068
+ isArbitraryLength
1069
+ ] }],
1070
+ "font-smoothing": ["antialiased", "subpixel-antialiased"],
1071
+ "font-style": ["italic", "not-italic"],
1072
+ "font-weight": [{ font: [
1073
+ themeFontWeight,
1074
+ isArbitraryVariableWeight,
1075
+ isArbitraryWeight
1076
+ ] }],
1077
+ "font-stretch": [{ "font-stretch": [
1078
+ "ultra-condensed",
1079
+ "extra-condensed",
1080
+ "condensed",
1081
+ "semi-condensed",
1082
+ "normal",
1083
+ "semi-expanded",
1084
+ "expanded",
1085
+ "extra-expanded",
1086
+ "ultra-expanded",
1087
+ isPercent,
1088
+ isArbitraryValue
1089
+ ] }],
1090
+ "font-family": [{ font: [
1091
+ isArbitraryVariableFamilyName,
1092
+ isArbitraryFamilyName,
1093
+ themeFont
1094
+ ] }],
1095
+ "font-features": [{ "font-features": [isArbitraryValue] }],
1096
+ "fvn-normal": ["normal-nums"],
1097
+ "fvn-ordinal": ["ordinal"],
1098
+ "fvn-slashed-zero": ["slashed-zero"],
1099
+ "fvn-figure": ["lining-nums", "oldstyle-nums"],
1100
+ "fvn-spacing": ["proportional-nums", "tabular-nums"],
1101
+ "fvn-fraction": ["diagonal-fractions", "stacked-fractions"],
1102
+ tracking: [{ tracking: [
1103
+ themeTracking,
1104
+ isArbitraryVariable,
1105
+ isArbitraryValue
1106
+ ] }],
1107
+ "line-clamp": [{ "line-clamp": [
1108
+ isNumber,
1109
+ "none",
1110
+ isArbitraryVariable,
1111
+ isArbitraryNumber
1112
+ ] }],
1113
+ leading: [{ leading: [themeLeading, ...scaleUnambiguousSpacing()] }],
1114
+ "list-image": [{ "list-image": [
1115
+ "none",
1116
+ isArbitraryVariable,
1117
+ isArbitraryValue
1118
+ ] }],
1119
+ "list-style-position": [{ list: ["inside", "outside"] }],
1120
+ "list-style-type": [{ list: [
1121
+ "disc",
1122
+ "decimal",
1123
+ "none",
1124
+ isArbitraryVariable,
1125
+ isArbitraryValue
1126
+ ] }],
1127
+ "text-alignment": [{ text: [
1128
+ "left",
1129
+ "center",
1130
+ "right",
1131
+ "justify",
1132
+ "start",
1133
+ "end"
1134
+ ] }],
1135
+ "placeholder-color": [{ placeholder: scaleColor() }],
1136
+ "text-color": [{ text: scaleColor() }],
1137
+ "text-decoration": [
1138
+ "underline",
1139
+ "overline",
1140
+ "line-through",
1141
+ "no-underline"
1142
+ ],
1143
+ "text-decoration-style": [{ decoration: [...scaleLineStyle(), "wavy"] }],
1144
+ "text-decoration-thickness": [{ decoration: [
1145
+ isNumber,
1146
+ "from-font",
1147
+ "auto",
1148
+ isArbitraryVariable,
1149
+ isArbitraryLength
1150
+ ] }],
1151
+ "text-decoration-color": [{ decoration: scaleColor() }],
1152
+ "underline-offset": [{ "underline-offset": [
1153
+ isNumber,
1154
+ "auto",
1155
+ isArbitraryVariable,
1156
+ isArbitraryValue
1157
+ ] }],
1158
+ "text-transform": [
1159
+ "uppercase",
1160
+ "lowercase",
1161
+ "capitalize",
1162
+ "normal-case"
1163
+ ],
1164
+ "text-overflow": [
1165
+ "truncate",
1166
+ "text-ellipsis",
1167
+ "text-clip"
1168
+ ],
1169
+ "text-wrap": [{ text: [
1170
+ "wrap",
1171
+ "nowrap",
1172
+ "balance",
1173
+ "pretty"
1174
+ ] }],
1175
+ indent: [{ indent: scaleUnambiguousSpacing() }],
1176
+ "vertical-align": [{ align: [
1177
+ "baseline",
1178
+ "top",
1179
+ "middle",
1180
+ "bottom",
1181
+ "text-top",
1182
+ "text-bottom",
1183
+ "sub",
1184
+ "super",
1185
+ isArbitraryVariable,
1186
+ isArbitraryValue
1187
+ ] }],
1188
+ whitespace: [{ whitespace: [
1189
+ "normal",
1190
+ "nowrap",
1191
+ "pre",
1192
+ "pre-line",
1193
+ "pre-wrap",
1194
+ "break-spaces"
1195
+ ] }],
1196
+ break: [{ break: [
1197
+ "normal",
1198
+ "words",
1199
+ "all",
1200
+ "keep"
1201
+ ] }],
1202
+ wrap: [{ wrap: [
1203
+ "break-word",
1204
+ "anywhere",
1205
+ "normal"
1206
+ ] }],
1207
+ hyphens: [{ hyphens: [
1208
+ "none",
1209
+ "manual",
1210
+ "auto"
1211
+ ] }],
1212
+ content: [{ content: [
1213
+ "none",
1214
+ isArbitraryVariable,
1215
+ isArbitraryValue
1216
+ ] }],
1217
+ "bg-attachment": [{ bg: [
1218
+ "fixed",
1219
+ "local",
1220
+ "scroll"
1221
+ ] }],
1222
+ "bg-clip": [{ "bg-clip": [
1223
+ "border",
1224
+ "padding",
1225
+ "content",
1226
+ "text"
1227
+ ] }],
1228
+ "bg-origin": [{ "bg-origin": [
1229
+ "border",
1230
+ "padding",
1231
+ "content"
1232
+ ] }],
1233
+ "bg-position": [{ bg: scaleBgPosition() }],
1234
+ "bg-repeat": [{ bg: scaleBgRepeat() }],
1235
+ "bg-size": [{ bg: scaleBgSize() }],
1236
+ "bg-image": [{ bg: [
1237
+ "none",
1238
+ {
1239
+ linear: [
1240
+ { to: [
1241
+ "t",
1242
+ "tr",
1243
+ "r",
1244
+ "br",
1245
+ "b",
1246
+ "bl",
1247
+ "l",
1248
+ "tl"
1249
+ ] },
1250
+ isInteger,
1251
+ isArbitraryVariable,
1252
+ isArbitraryValue
1253
+ ],
1254
+ radial: [
1255
+ "",
1256
+ isArbitraryVariable,
1257
+ isArbitraryValue
1258
+ ],
1259
+ conic: [
1260
+ isInteger,
1261
+ isArbitraryVariable,
1262
+ isArbitraryValue
1263
+ ]
1264
+ },
1265
+ isArbitraryVariableImage,
1266
+ isArbitraryImage
1267
+ ] }],
1268
+ "bg-color": [{ bg: scaleColor() }],
1269
+ "gradient-from-pos": [{ from: scaleGradientStopPosition() }],
1270
+ "gradient-via-pos": [{ via: scaleGradientStopPosition() }],
1271
+ "gradient-to-pos": [{ to: scaleGradientStopPosition() }],
1272
+ "gradient-from": [{ from: scaleColor() }],
1273
+ "gradient-via": [{ via: scaleColor() }],
1274
+ "gradient-to": [{ to: scaleColor() }],
1275
+ rounded: [{ rounded: scaleRadius() }],
1276
+ "rounded-s": [{ "rounded-s": scaleRadius() }],
1277
+ "rounded-e": [{ "rounded-e": scaleRadius() }],
1278
+ "rounded-t": [{ "rounded-t": scaleRadius() }],
1279
+ "rounded-r": [{ "rounded-r": scaleRadius() }],
1280
+ "rounded-b": [{ "rounded-b": scaleRadius() }],
1281
+ "rounded-l": [{ "rounded-l": scaleRadius() }],
1282
+ "rounded-ss": [{ "rounded-ss": scaleRadius() }],
1283
+ "rounded-se": [{ "rounded-se": scaleRadius() }],
1284
+ "rounded-ee": [{ "rounded-ee": scaleRadius() }],
1285
+ "rounded-es": [{ "rounded-es": scaleRadius() }],
1286
+ "rounded-tl": [{ "rounded-tl": scaleRadius() }],
1287
+ "rounded-tr": [{ "rounded-tr": scaleRadius() }],
1288
+ "rounded-br": [{ "rounded-br": scaleRadius() }],
1289
+ "rounded-bl": [{ "rounded-bl": scaleRadius() }],
1290
+ "border-w": [{ border: scaleBorderWidth() }],
1291
+ "border-w-x": [{ "border-x": scaleBorderWidth() }],
1292
+ "border-w-y": [{ "border-y": scaleBorderWidth() }],
1293
+ "border-w-s": [{ "border-s": scaleBorderWidth() }],
1294
+ "border-w-e": [{ "border-e": scaleBorderWidth() }],
1295
+ "border-w-bs": [{ "border-bs": scaleBorderWidth() }],
1296
+ "border-w-be": [{ "border-be": scaleBorderWidth() }],
1297
+ "border-w-t": [{ "border-t": scaleBorderWidth() }],
1298
+ "border-w-r": [{ "border-r": scaleBorderWidth() }],
1299
+ "border-w-b": [{ "border-b": scaleBorderWidth() }],
1300
+ "border-w-l": [{ "border-l": scaleBorderWidth() }],
1301
+ "divide-x": [{ "divide-x": scaleBorderWidth() }],
1302
+ "divide-x-reverse": ["divide-x-reverse"],
1303
+ "divide-y": [{ "divide-y": scaleBorderWidth() }],
1304
+ "divide-y-reverse": ["divide-y-reverse"],
1305
+ "border-style": [{ border: [
1306
+ ...scaleLineStyle(),
1307
+ "hidden",
1308
+ "none"
1309
+ ] }],
1310
+ "divide-style": [{ divide: [
1311
+ ...scaleLineStyle(),
1312
+ "hidden",
1313
+ "none"
1314
+ ] }],
1315
+ "border-color": [{ border: scaleColor() }],
1316
+ "border-color-x": [{ "border-x": scaleColor() }],
1317
+ "border-color-y": [{ "border-y": scaleColor() }],
1318
+ "border-color-s": [{ "border-s": scaleColor() }],
1319
+ "border-color-e": [{ "border-e": scaleColor() }],
1320
+ "border-color-bs": [{ "border-bs": scaleColor() }],
1321
+ "border-color-be": [{ "border-be": scaleColor() }],
1322
+ "border-color-t": [{ "border-t": scaleColor() }],
1323
+ "border-color-r": [{ "border-r": scaleColor() }],
1324
+ "border-color-b": [{ "border-b": scaleColor() }],
1325
+ "border-color-l": [{ "border-l": scaleColor() }],
1326
+ "divide-color": [{ divide: scaleColor() }],
1327
+ "outline-style": [{ outline: [
1328
+ ...scaleLineStyle(),
1329
+ "none",
1330
+ "hidden"
1331
+ ] }],
1332
+ "outline-offset": [{ "outline-offset": [
1333
+ isNumber,
1334
+ isArbitraryVariable,
1335
+ isArbitraryValue
1336
+ ] }],
1337
+ "outline-w": [{ outline: [
1338
+ "",
1339
+ isNumber,
1340
+ isArbitraryVariableLength,
1341
+ isArbitraryLength
1342
+ ] }],
1343
+ "outline-color": [{ outline: scaleColor() }],
1344
+ shadow: [{ shadow: [
1345
+ "",
1346
+ "none",
1347
+ themeShadow,
1348
+ isArbitraryVariableShadow,
1349
+ isArbitraryShadow
1350
+ ] }],
1351
+ "shadow-color": [{ shadow: scaleColor() }],
1352
+ "inset-shadow": [{ "inset-shadow": [
1353
+ "none",
1354
+ themeInsetShadow,
1355
+ isArbitraryVariableShadow,
1356
+ isArbitraryShadow
1357
+ ] }],
1358
+ "inset-shadow-color": [{ "inset-shadow": scaleColor() }],
1359
+ "ring-w": [{ ring: scaleBorderWidth() }],
1360
+ "ring-w-inset": ["ring-inset"],
1361
+ "ring-color": [{ ring: scaleColor() }],
1362
+ "ring-offset-w": [{ "ring-offset": [isNumber, isArbitraryLength] }],
1363
+ "ring-offset-color": [{ "ring-offset": scaleColor() }],
1364
+ "inset-ring-w": [{ "inset-ring": scaleBorderWidth() }],
1365
+ "inset-ring-color": [{ "inset-ring": scaleColor() }],
1366
+ "text-shadow": [{ "text-shadow": [
1367
+ "none",
1368
+ themeTextShadow,
1369
+ isArbitraryVariableShadow,
1370
+ isArbitraryShadow
1371
+ ] }],
1372
+ "text-shadow-color": [{ "text-shadow": scaleColor() }],
1373
+ opacity: [{ opacity: [
1374
+ isNumber,
1375
+ isArbitraryVariable,
1376
+ isArbitraryValue
1377
+ ] }],
1378
+ "mix-blend": [{ "mix-blend": [
1379
+ ...scaleBlendMode(),
1380
+ "plus-darker",
1381
+ "plus-lighter"
1382
+ ] }],
1383
+ "bg-blend": [{ "bg-blend": scaleBlendMode() }],
1384
+ "mask-clip": [{ "mask-clip": [
1385
+ "border",
1386
+ "padding",
1387
+ "content",
1388
+ "fill",
1389
+ "stroke",
1390
+ "view"
1391
+ ] }, "mask-no-clip"],
1392
+ "mask-composite": [{ mask: [
1393
+ "add",
1394
+ "subtract",
1395
+ "intersect",
1396
+ "exclude"
1397
+ ] }],
1398
+ "mask-image-linear-pos": [{ "mask-linear": [isNumber] }],
1399
+ "mask-image-linear-from-pos": [{ "mask-linear-from": scaleMaskImagePosition() }],
1400
+ "mask-image-linear-to-pos": [{ "mask-linear-to": scaleMaskImagePosition() }],
1401
+ "mask-image-linear-from-color": [{ "mask-linear-from": scaleColor() }],
1402
+ "mask-image-linear-to-color": [{ "mask-linear-to": scaleColor() }],
1403
+ "mask-image-t-from-pos": [{ "mask-t-from": scaleMaskImagePosition() }],
1404
+ "mask-image-t-to-pos": [{ "mask-t-to": scaleMaskImagePosition() }],
1405
+ "mask-image-t-from-color": [{ "mask-t-from": scaleColor() }],
1406
+ "mask-image-t-to-color": [{ "mask-t-to": scaleColor() }],
1407
+ "mask-image-r-from-pos": [{ "mask-r-from": scaleMaskImagePosition() }],
1408
+ "mask-image-r-to-pos": [{ "mask-r-to": scaleMaskImagePosition() }],
1409
+ "mask-image-r-from-color": [{ "mask-r-from": scaleColor() }],
1410
+ "mask-image-r-to-color": [{ "mask-r-to": scaleColor() }],
1411
+ "mask-image-b-from-pos": [{ "mask-b-from": scaleMaskImagePosition() }],
1412
+ "mask-image-b-to-pos": [{ "mask-b-to": scaleMaskImagePosition() }],
1413
+ "mask-image-b-from-color": [{ "mask-b-from": scaleColor() }],
1414
+ "mask-image-b-to-color": [{ "mask-b-to": scaleColor() }],
1415
+ "mask-image-l-from-pos": [{ "mask-l-from": scaleMaskImagePosition() }],
1416
+ "mask-image-l-to-pos": [{ "mask-l-to": scaleMaskImagePosition() }],
1417
+ "mask-image-l-from-color": [{ "mask-l-from": scaleColor() }],
1418
+ "mask-image-l-to-color": [{ "mask-l-to": scaleColor() }],
1419
+ "mask-image-x-from-pos": [{ "mask-x-from": scaleMaskImagePosition() }],
1420
+ "mask-image-x-to-pos": [{ "mask-x-to": scaleMaskImagePosition() }],
1421
+ "mask-image-x-from-color": [{ "mask-x-from": scaleColor() }],
1422
+ "mask-image-x-to-color": [{ "mask-x-to": scaleColor() }],
1423
+ "mask-image-y-from-pos": [{ "mask-y-from": scaleMaskImagePosition() }],
1424
+ "mask-image-y-to-pos": [{ "mask-y-to": scaleMaskImagePosition() }],
1425
+ "mask-image-y-from-color": [{ "mask-y-from": scaleColor() }],
1426
+ "mask-image-y-to-color": [{ "mask-y-to": scaleColor() }],
1427
+ "mask-image-radial": [{ "mask-radial": [isArbitraryVariable, isArbitraryValue] }],
1428
+ "mask-image-radial-from-pos": [{ "mask-radial-from": scaleMaskImagePosition() }],
1429
+ "mask-image-radial-to-pos": [{ "mask-radial-to": scaleMaskImagePosition() }],
1430
+ "mask-image-radial-from-color": [{ "mask-radial-from": scaleColor() }],
1431
+ "mask-image-radial-to-color": [{ "mask-radial-to": scaleColor() }],
1432
+ "mask-image-radial-shape": [{ "mask-radial": ["circle", "ellipse"] }],
1433
+ "mask-image-radial-size": [{ "mask-radial": [{
1434
+ closest: ["side", "corner"],
1435
+ farthest: ["side", "corner"]
1436
+ }] }],
1437
+ "mask-image-radial-pos": [{ "mask-radial-at": scalePosition() }],
1438
+ "mask-image-conic-pos": [{ "mask-conic": [isNumber] }],
1439
+ "mask-image-conic-from-pos": [{ "mask-conic-from": scaleMaskImagePosition() }],
1440
+ "mask-image-conic-to-pos": [{ "mask-conic-to": scaleMaskImagePosition() }],
1441
+ "mask-image-conic-from-color": [{ "mask-conic-from": scaleColor() }],
1442
+ "mask-image-conic-to-color": [{ "mask-conic-to": scaleColor() }],
1443
+ "mask-mode": [{ mask: [
1444
+ "alpha",
1445
+ "luminance",
1446
+ "match"
1447
+ ] }],
1448
+ "mask-origin": [{ "mask-origin": [
1449
+ "border",
1450
+ "padding",
1451
+ "content",
1452
+ "fill",
1453
+ "stroke",
1454
+ "view"
1455
+ ] }],
1456
+ "mask-position": [{ mask: scaleBgPosition() }],
1457
+ "mask-repeat": [{ mask: scaleBgRepeat() }],
1458
+ "mask-size": [{ mask: scaleBgSize() }],
1459
+ "mask-type": [{ "mask-type": ["alpha", "luminance"] }],
1460
+ "mask-image": [{ mask: [
1461
+ "none",
1462
+ isArbitraryVariable,
1463
+ isArbitraryValue
1464
+ ] }],
1465
+ filter: [{ filter: [
1466
+ "",
1467
+ "none",
1468
+ isArbitraryVariable,
1469
+ isArbitraryValue
1470
+ ] }],
1471
+ blur: [{ blur: scaleBlur() }],
1472
+ brightness: [{ brightness: [
1473
+ isNumber,
1474
+ isArbitraryVariable,
1475
+ isArbitraryValue
1476
+ ] }],
1477
+ contrast: [{ contrast: [
1478
+ isNumber,
1479
+ isArbitraryVariable,
1480
+ isArbitraryValue
1481
+ ] }],
1482
+ "drop-shadow": [{ "drop-shadow": [
1483
+ "",
1484
+ "none",
1485
+ themeDropShadow,
1486
+ isArbitraryVariableShadow,
1487
+ isArbitraryShadow
1488
+ ] }],
1489
+ "drop-shadow-color": [{ "drop-shadow": scaleColor() }],
1490
+ grayscale: [{ grayscale: [
1491
+ "",
1492
+ isNumber,
1493
+ isArbitraryVariable,
1494
+ isArbitraryValue
1495
+ ] }],
1496
+ "hue-rotate": [{ "hue-rotate": [
1497
+ isNumber,
1498
+ isArbitraryVariable,
1499
+ isArbitraryValue
1500
+ ] }],
1501
+ invert: [{ invert: [
1502
+ "",
1503
+ isNumber,
1504
+ isArbitraryVariable,
1505
+ isArbitraryValue
1506
+ ] }],
1507
+ saturate: [{ saturate: [
1508
+ isNumber,
1509
+ isArbitraryVariable,
1510
+ isArbitraryValue
1511
+ ] }],
1512
+ sepia: [{ sepia: [
1513
+ "",
1514
+ isNumber,
1515
+ isArbitraryVariable,
1516
+ isArbitraryValue
1517
+ ] }],
1518
+ "backdrop-filter": [{ "backdrop-filter": [
1519
+ "",
1520
+ "none",
1521
+ isArbitraryVariable,
1522
+ isArbitraryValue
1523
+ ] }],
1524
+ "backdrop-blur": [{ "backdrop-blur": scaleBlur() }],
1525
+ "backdrop-brightness": [{ "backdrop-brightness": [
1526
+ isNumber,
1527
+ isArbitraryVariable,
1528
+ isArbitraryValue
1529
+ ] }],
1530
+ "backdrop-contrast": [{ "backdrop-contrast": [
1531
+ isNumber,
1532
+ isArbitraryVariable,
1533
+ isArbitraryValue
1534
+ ] }],
1535
+ "backdrop-grayscale": [{ "backdrop-grayscale": [
1536
+ "",
1537
+ isNumber,
1538
+ isArbitraryVariable,
1539
+ isArbitraryValue
1540
+ ] }],
1541
+ "backdrop-hue-rotate": [{ "backdrop-hue-rotate": [
1542
+ isNumber,
1543
+ isArbitraryVariable,
1544
+ isArbitraryValue
1545
+ ] }],
1546
+ "backdrop-invert": [{ "backdrop-invert": [
1547
+ "",
1548
+ isNumber,
1549
+ isArbitraryVariable,
1550
+ isArbitraryValue
1551
+ ] }],
1552
+ "backdrop-opacity": [{ "backdrop-opacity": [
1553
+ isNumber,
1554
+ isArbitraryVariable,
1555
+ isArbitraryValue
1556
+ ] }],
1557
+ "backdrop-saturate": [{ "backdrop-saturate": [
1558
+ isNumber,
1559
+ isArbitraryVariable,
1560
+ isArbitraryValue
1561
+ ] }],
1562
+ "backdrop-sepia": [{ "backdrop-sepia": [
1563
+ "",
1564
+ isNumber,
1565
+ isArbitraryVariable,
1566
+ isArbitraryValue
1567
+ ] }],
1568
+ "border-collapse": [{ border: ["collapse", "separate"] }],
1569
+ "border-spacing": [{ "border-spacing": scaleUnambiguousSpacing() }],
1570
+ "border-spacing-x": [{ "border-spacing-x": scaleUnambiguousSpacing() }],
1571
+ "border-spacing-y": [{ "border-spacing-y": scaleUnambiguousSpacing() }],
1572
+ "table-layout": [{ table: ["auto", "fixed"] }],
1573
+ caption: [{ caption: ["top", "bottom"] }],
1574
+ transition: [{ transition: [
1575
+ "",
1576
+ "all",
1577
+ "colors",
1578
+ "opacity",
1579
+ "shadow",
1580
+ "transform",
1581
+ "none",
1582
+ isArbitraryVariable,
1583
+ isArbitraryValue
1584
+ ] }],
1585
+ "transition-behavior": [{ transition: ["normal", "discrete"] }],
1586
+ duration: [{ duration: [
1587
+ isNumber,
1588
+ "initial",
1589
+ isArbitraryVariable,
1590
+ isArbitraryValue
1591
+ ] }],
1592
+ ease: [{ ease: [
1593
+ "linear",
1594
+ "initial",
1595
+ themeEase,
1596
+ isArbitraryVariable,
1597
+ isArbitraryValue
1598
+ ] }],
1599
+ delay: [{ delay: [
1600
+ isNumber,
1601
+ isArbitraryVariable,
1602
+ isArbitraryValue
1603
+ ] }],
1604
+ animate: [{ animate: [
1605
+ "none",
1606
+ themeAnimate,
1607
+ isArbitraryVariable,
1608
+ isArbitraryValue
1609
+ ] }],
1610
+ backface: [{ backface: ["hidden", "visible"] }],
1611
+ perspective: [{ perspective: [
1612
+ themePerspective,
1613
+ isArbitraryVariable,
1614
+ isArbitraryValue
1615
+ ] }],
1616
+ "perspective-origin": [{ "perspective-origin": scalePositionWithArbitrary() }],
1617
+ rotate: [{ rotate: scaleRotate() }],
1618
+ "rotate-x": [{ "rotate-x": scaleRotate() }],
1619
+ "rotate-y": [{ "rotate-y": scaleRotate() }],
1620
+ "rotate-z": [{ "rotate-z": scaleRotate() }],
1621
+ scale: [{ scale: scaleScale() }],
1622
+ "scale-x": [{ "scale-x": scaleScale() }],
1623
+ "scale-y": [{ "scale-y": scaleScale() }],
1624
+ "scale-z": [{ "scale-z": scaleScale() }],
1625
+ "scale-3d": ["scale-3d"],
1626
+ skew: [{ skew: scaleSkew() }],
1627
+ "skew-x": [{ "skew-x": scaleSkew() }],
1628
+ "skew-y": [{ "skew-y": scaleSkew() }],
1629
+ transform: [{ transform: [
1630
+ isArbitraryVariable,
1631
+ isArbitraryValue,
1632
+ "",
1633
+ "none",
1634
+ "gpu",
1635
+ "cpu"
1636
+ ] }],
1637
+ "transform-origin": [{ origin: scalePositionWithArbitrary() }],
1638
+ "transform-style": [{ transform: ["3d", "flat"] }],
1639
+ translate: [{ translate: scaleTranslate() }],
1640
+ "translate-x": [{ "translate-x": scaleTranslate() }],
1641
+ "translate-y": [{ "translate-y": scaleTranslate() }],
1642
+ "translate-z": [{ "translate-z": scaleTranslate() }],
1643
+ "translate-none": ["translate-none"],
1644
+ accent: [{ accent: scaleColor() }],
1645
+ appearance: [{ appearance: ["none", "auto"] }],
1646
+ "caret-color": [{ caret: scaleColor() }],
1647
+ "color-scheme": [{ scheme: [
1648
+ "normal",
1649
+ "dark",
1650
+ "light",
1651
+ "light-dark",
1652
+ "only-dark",
1653
+ "only-light"
1654
+ ] }],
1655
+ cursor: [{ cursor: [
1656
+ "auto",
1657
+ "default",
1658
+ "pointer",
1659
+ "wait",
1660
+ "text",
1661
+ "move",
1662
+ "help",
1663
+ "not-allowed",
1664
+ "none",
1665
+ "context-menu",
1666
+ "progress",
1667
+ "cell",
1668
+ "crosshair",
1669
+ "vertical-text",
1670
+ "alias",
1671
+ "copy",
1672
+ "no-drop",
1673
+ "grab",
1674
+ "grabbing",
1675
+ "all-scroll",
1676
+ "col-resize",
1677
+ "row-resize",
1678
+ "n-resize",
1679
+ "e-resize",
1680
+ "s-resize",
1681
+ "w-resize",
1682
+ "ne-resize",
1683
+ "nw-resize",
1684
+ "se-resize",
1685
+ "sw-resize",
1686
+ "ew-resize",
1687
+ "ns-resize",
1688
+ "nesw-resize",
1689
+ "nwse-resize",
1690
+ "zoom-in",
1691
+ "zoom-out",
1692
+ isArbitraryVariable,
1693
+ isArbitraryValue
1694
+ ] }],
1695
+ "field-sizing": [{ "field-sizing": ["fixed", "content"] }],
1696
+ "pointer-events": [{ "pointer-events": ["auto", "none"] }],
1697
+ resize: [{ resize: [
1698
+ "none",
1699
+ "",
1700
+ "y",
1701
+ "x"
1702
+ ] }],
1703
+ "scroll-behavior": [{ scroll: ["auto", "smooth"] }],
1704
+ "scroll-m": [{ "scroll-m": scaleUnambiguousSpacing() }],
1705
+ "scroll-mx": [{ "scroll-mx": scaleUnambiguousSpacing() }],
1706
+ "scroll-my": [{ "scroll-my": scaleUnambiguousSpacing() }],
1707
+ "scroll-ms": [{ "scroll-ms": scaleUnambiguousSpacing() }],
1708
+ "scroll-me": [{ "scroll-me": scaleUnambiguousSpacing() }],
1709
+ "scroll-mbs": [{ "scroll-mbs": scaleUnambiguousSpacing() }],
1710
+ "scroll-mbe": [{ "scroll-mbe": scaleUnambiguousSpacing() }],
1711
+ "scroll-mt": [{ "scroll-mt": scaleUnambiguousSpacing() }],
1712
+ "scroll-mr": [{ "scroll-mr": scaleUnambiguousSpacing() }],
1713
+ "scroll-mb": [{ "scroll-mb": scaleUnambiguousSpacing() }],
1714
+ "scroll-ml": [{ "scroll-ml": scaleUnambiguousSpacing() }],
1715
+ "scroll-p": [{ "scroll-p": scaleUnambiguousSpacing() }],
1716
+ "scroll-px": [{ "scroll-px": scaleUnambiguousSpacing() }],
1717
+ "scroll-py": [{ "scroll-py": scaleUnambiguousSpacing() }],
1718
+ "scroll-ps": [{ "scroll-ps": scaleUnambiguousSpacing() }],
1719
+ "scroll-pe": [{ "scroll-pe": scaleUnambiguousSpacing() }],
1720
+ "scroll-pbs": [{ "scroll-pbs": scaleUnambiguousSpacing() }],
1721
+ "scroll-pbe": [{ "scroll-pbe": scaleUnambiguousSpacing() }],
1722
+ "scroll-pt": [{ "scroll-pt": scaleUnambiguousSpacing() }],
1723
+ "scroll-pr": [{ "scroll-pr": scaleUnambiguousSpacing() }],
1724
+ "scroll-pb": [{ "scroll-pb": scaleUnambiguousSpacing() }],
1725
+ "scroll-pl": [{ "scroll-pl": scaleUnambiguousSpacing() }],
1726
+ "snap-align": [{ snap: [
1727
+ "start",
1728
+ "end",
1729
+ "center",
1730
+ "align-none"
1731
+ ] }],
1732
+ "snap-stop": [{ snap: ["normal", "always"] }],
1733
+ "snap-type": [{ snap: [
1734
+ "none",
1735
+ "x",
1736
+ "y",
1737
+ "both"
1738
+ ] }],
1739
+ "snap-strictness": [{ snap: ["mandatory", "proximity"] }],
1740
+ touch: [{ touch: [
1741
+ "auto",
1742
+ "none",
1743
+ "manipulation"
1744
+ ] }],
1745
+ "touch-x": [{ "touch-pan": [
1746
+ "x",
1747
+ "left",
1748
+ "right"
1749
+ ] }],
1750
+ "touch-y": [{ "touch-pan": [
1751
+ "y",
1752
+ "up",
1753
+ "down"
1754
+ ] }],
1755
+ "touch-pz": ["touch-pinch-zoom"],
1756
+ select: [{ select: [
1757
+ "none",
1758
+ "text",
1759
+ "all",
1760
+ "auto"
1761
+ ] }],
1762
+ "will-change": [{ "will-change": [
1763
+ "auto",
1764
+ "scroll",
1765
+ "contents",
1766
+ "transform",
1767
+ isArbitraryVariable,
1768
+ isArbitraryValue
1769
+ ] }],
1770
+ fill: [{ fill: ["none", ...scaleColor()] }],
1771
+ "stroke-w": [{ stroke: [
1772
+ isNumber,
1773
+ isArbitraryVariableLength,
1774
+ isArbitraryLength,
1775
+ isArbitraryNumber
1776
+ ] }],
1777
+ stroke: [{ stroke: ["none", ...scaleColor()] }],
1778
+ "forced-color-adjust": [{ "forced-color-adjust": ["auto", "none"] }]
1779
+ },
1780
+ conflictingClassGroups: {
1781
+ overflow: ["overflow-x", "overflow-y"],
1782
+ overscroll: ["overscroll-x", "overscroll-y"],
1783
+ inset: [
1784
+ "inset-x",
1785
+ "inset-y",
1786
+ "inset-bs",
1787
+ "inset-be",
1788
+ "start",
1789
+ "end",
1790
+ "top",
1791
+ "right",
1792
+ "bottom",
1793
+ "left"
1794
+ ],
1795
+ "inset-x": ["right", "left"],
1796
+ "inset-y": ["top", "bottom"],
1797
+ flex: [
1798
+ "basis",
1799
+ "grow",
1800
+ "shrink"
1801
+ ],
1802
+ gap: ["gap-x", "gap-y"],
1803
+ p: [
1804
+ "px",
1805
+ "py",
1806
+ "ps",
1807
+ "pe",
1808
+ "pbs",
1809
+ "pbe",
1810
+ "pt",
1811
+ "pr",
1812
+ "pb",
1813
+ "pl"
1814
+ ],
1815
+ px: ["pr", "pl"],
1816
+ py: ["pt", "pb"],
1817
+ m: [
1818
+ "mx",
1819
+ "my",
1820
+ "ms",
1821
+ "me",
1822
+ "mbs",
1823
+ "mbe",
1824
+ "mt",
1825
+ "mr",
1826
+ "mb",
1827
+ "ml"
1828
+ ],
1829
+ mx: ["mr", "ml"],
1830
+ my: ["mt", "mb"],
1831
+ size: ["w", "h"],
1832
+ "font-size": ["leading"],
1833
+ "fvn-normal": [
1834
+ "fvn-ordinal",
1835
+ "fvn-slashed-zero",
1836
+ "fvn-figure",
1837
+ "fvn-spacing",
1838
+ "fvn-fraction"
1839
+ ],
1840
+ "fvn-ordinal": ["fvn-normal"],
1841
+ "fvn-slashed-zero": ["fvn-normal"],
1842
+ "fvn-figure": ["fvn-normal"],
1843
+ "fvn-spacing": ["fvn-normal"],
1844
+ "fvn-fraction": ["fvn-normal"],
1845
+ "line-clamp": ["display", "overflow"],
1846
+ rounded: [
1847
+ "rounded-s",
1848
+ "rounded-e",
1849
+ "rounded-t",
1850
+ "rounded-r",
1851
+ "rounded-b",
1852
+ "rounded-l",
1853
+ "rounded-ss",
1854
+ "rounded-se",
1855
+ "rounded-ee",
1856
+ "rounded-es",
1857
+ "rounded-tl",
1858
+ "rounded-tr",
1859
+ "rounded-br",
1860
+ "rounded-bl"
1861
+ ],
1862
+ "rounded-s": ["rounded-ss", "rounded-es"],
1863
+ "rounded-e": ["rounded-se", "rounded-ee"],
1864
+ "rounded-t": ["rounded-tl", "rounded-tr"],
1865
+ "rounded-r": ["rounded-tr", "rounded-br"],
1866
+ "rounded-b": ["rounded-br", "rounded-bl"],
1867
+ "rounded-l": ["rounded-tl", "rounded-bl"],
1868
+ "border-spacing": ["border-spacing-x", "border-spacing-y"],
1869
+ "border-w": [
1870
+ "border-w-x",
1871
+ "border-w-y",
1872
+ "border-w-s",
1873
+ "border-w-e",
1874
+ "border-w-bs",
1875
+ "border-w-be",
1876
+ "border-w-t",
1877
+ "border-w-r",
1878
+ "border-w-b",
1879
+ "border-w-l"
1880
+ ],
1881
+ "border-w-x": ["border-w-r", "border-w-l"],
1882
+ "border-w-y": ["border-w-t", "border-w-b"],
1883
+ "border-color": [
1884
+ "border-color-x",
1885
+ "border-color-y",
1886
+ "border-color-s",
1887
+ "border-color-e",
1888
+ "border-color-bs",
1889
+ "border-color-be",
1890
+ "border-color-t",
1891
+ "border-color-r",
1892
+ "border-color-b",
1893
+ "border-color-l"
1894
+ ],
1895
+ "border-color-x": ["border-color-r", "border-color-l"],
1896
+ "border-color-y": ["border-color-t", "border-color-b"],
1897
+ translate: [
1898
+ "translate-x",
1899
+ "translate-y",
1900
+ "translate-none"
1901
+ ],
1902
+ "translate-none": [
1903
+ "translate",
1904
+ "translate-x",
1905
+ "translate-y",
1906
+ "translate-z"
1907
+ ],
1908
+ "scroll-m": [
1909
+ "scroll-mx",
1910
+ "scroll-my",
1911
+ "scroll-ms",
1912
+ "scroll-me",
1913
+ "scroll-mbs",
1914
+ "scroll-mbe",
1915
+ "scroll-mt",
1916
+ "scroll-mr",
1917
+ "scroll-mb",
1918
+ "scroll-ml"
1919
+ ],
1920
+ "scroll-mx": ["scroll-mr", "scroll-ml"],
1921
+ "scroll-my": ["scroll-mt", "scroll-mb"],
1922
+ "scroll-p": [
1923
+ "scroll-px",
1924
+ "scroll-py",
1925
+ "scroll-ps",
1926
+ "scroll-pe",
1927
+ "scroll-pbs",
1928
+ "scroll-pbe",
1929
+ "scroll-pt",
1930
+ "scroll-pr",
1931
+ "scroll-pb",
1932
+ "scroll-pl"
1933
+ ],
1934
+ "scroll-px": ["scroll-pr", "scroll-pl"],
1935
+ "scroll-py": ["scroll-pt", "scroll-pb"],
1936
+ touch: [
1937
+ "touch-x",
1938
+ "touch-y",
1939
+ "touch-pz"
1940
+ ],
1941
+ "touch-x": ["touch"],
1942
+ "touch-y": ["touch"],
1943
+ "touch-pz": ["touch"]
1944
+ },
1945
+ conflictingClassGroupModifiers: { "font-size": ["leading"] },
1946
+ orderSensitiveModifiers: [
1947
+ "*",
1948
+ "**",
1949
+ "after",
1950
+ "backdrop",
1951
+ "before",
1952
+ "details-content",
1953
+ "file",
1954
+ "first-letter",
1955
+ "first-line",
1956
+ "marker",
1957
+ "placeholder",
1958
+ "selection"
1959
+ ]
1960
+ };
1961
+ };
1962
+ var twMerge = /* @__PURE__ */ createTailwindMerge(getDefaultConfig);
1963
+ //#endregion
1964
+ //#region ../../node_modules/.pnpm/@sonamu-kit+react-components@0.4.10_@babel+core@7.29.0_supports-color@10.2.2__@babel+te_b8d5123d856c9139958cd183d6b13f14/node_modules/@sonamu-kit/react-components/dist/lib/utils.js
1965
+ var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
1966
+ function i$1(...e) {
1967
+ return twMerge(clsx(e));
1968
+ }
1969
+ //#endregion
1970
+ //#region ../../node_modules/.pnpm/@sonamu-kit+react-components@0.4.10_@babel+core@7.29.0_supports-color@10.2.2__@babel+te_b8d5123d856c9139958cd183d6b13f14/node_modules/@sonamu-kit/react-components/dist/_virtual/~icons/lucide/x.js
1971
+ var import_jsx_runtime = require_jsx_runtime();
1972
+ var t = (t) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", {
1973
+ viewBox: "0 0 24 24",
1974
+ width: "1.2em",
1975
+ height: "1.2em",
1976
+ ...t,
1977
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", {
1978
+ fill: "none",
1979
+ stroke: "currentColor",
1980
+ strokeLinecap: "round",
1981
+ strokeLinejoin: "round",
1982
+ strokeWidth: 2,
1983
+ d: "M18 6L6 18M6 6l12 12"
1984
+ })
1985
+ });
1986
+ globalThis.AggregateError;
1987
+ Array.isArray;
1988
+ function isFunction(value) {
1989
+ return typeof value === "function";
1990
+ }
1991
+ Number.isInteger;
1992
+ //#endregion
1993
+ //#region ../../node_modules/.pnpm/@sonamu-kit+react-components@0.4.10_@babel+core@7.29.0_supports-color@10.2.2__@babel+te_b8d5123d856c9139958cd183d6b13f14/node_modules/@sonamu-kit/react-components/dist/components/ui/input.js
1994
+ var o = import_react.forwardRef(({ className: o, type: s, onValueChange: c, onChange: l, clearable: u = !1, ...d }, f) => {
1995
+ let p = import_react.useRef(null), m = import_react.useCallback((e) => {
1996
+ p.current = e, isFunction(f) ? f(e) : f && (f.current = e);
1997
+ }, [f]), h = d.value !== void 0, [g, _] = import_react.useState(() => String(d.defaultValue ?? "").length > 0), v = h ? String(d.value ?? "").length > 0 : g, y = (e) => {
1998
+ h || _(e.target.value.length > 0), c?.(e.target.value), l?.(e);
1999
+ }, b = () => {
2000
+ let e = p.current;
2001
+ e && ((Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, "value")?.set)?.call(e, ""), e.dispatchEvent(new Event("input", { bubbles: !0 })), e.focus()), h || _(!1);
2002
+ }, x = u && v && !d.disabled && !d.readOnly, S = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", {
2003
+ type: s,
2004
+ "data-slot": "input",
2005
+ className: i$1("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border px-3 py-1 text-base bg-input-background transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm", "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]", "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive", u && "pr-8", o),
2006
+ ref: m,
2007
+ ...d,
2008
+ onChange: y
2009
+ });
2010
+ return u ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2011
+ className: "relative w-full",
2012
+ children: [S, x && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
2013
+ type: "button",
2014
+ tabIndex: -1,
2015
+ "aria-label": "Clear",
2016
+ onMouseDown: (e) => e.preventDefault(),
2017
+ onClick: b,
2018
+ className: "absolute right-2 top-1/2 -translate-y-1/2 flex items-center justify-center text-muted-foreground opacity-60 hover:opacity-100 transition-opacity cursor-pointer",
2019
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(t, { className: "h-4 w-4" })
2020
+ })]
2021
+ }) : S;
2022
+ });
2023
+ o.displayName = "Input";
2024
+ //#endregion
2025
+ //#region src/components/qgrid/OAuthCodeEntry.tsx
2026
+ var import_jsx_dev_runtime = require_jsx_dev_runtime();
2027
+ var _jsxFileName = "/home/runner/work/qgrid/qgrid/packages/web/src/components/qgrid/OAuthCodeEntry.tsx";
2028
+ var HELP_TEXT = {
2029
+ openai: "새 탭에서 OpenAI 로그인을 완료한 뒤 연결 실패 화면이 나타나면, 주소창의 전체 URL을 아래에 붙여넣으세요.",
2030
+ anthropic: "새 탭에서 Claude 로그인을 완료하면 코드가 표시됩니다. 코드 전체를 아래에 붙여넣으세요.",
2031
+ grok: "새 탭에서 xAI(auth.x.ai) 로그인을 완료하면 127.0.0.1 주소로 이동하며 페이지가 열리지 않습니다. 주소창의 전체 URL(또는 그 안의 code 값)을 아래에 붙여넣으세요."
2032
+ };
2033
+ var PLACEHOLDER = {
2034
+ openai: "http://localhost:1455/auth/callback?code=...&state=...",
2035
+ anthropic: "code#state",
2036
+ grok: "http://127.0.0.1:.../callback?code=...&state=..."
2037
+ };
2038
+ /**
2039
+ * 원격 접속(code 모드) 로그인의 인증 결과 입력 단계.
2040
+ * Add Token 모달과 재로그인이 같은 문구·에러·재시작 동선을 쓰도록 한 곳에 둔다.
2041
+ */
2042
+ function OAuthCodeEntry({ provider, isPending, isError, onSubmit, onRestart }) {
2043
+ const [pastedCode, setPastedCode] = (0, import_react.useState)("");
2044
+ return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
2045
+ className: "space-y-2",
2046
+ children: [
2047
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("p", {
2048
+ className: "text-[12px] text-sand-600 leading-relaxed",
2049
+ children: HELP_TEXT[provider]
2050
+ }, void 0, false, {
2051
+ fileName: _jsxFileName,
2052
+ lineNumber: 41,
2053
+ columnNumber: 7
2054
+ }, this),
2055
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(o, {
2056
+ value: pastedCode,
2057
+ onChange: (e) => setPastedCode(e.target.value),
2058
+ placeholder: PLACEHOLDER[provider],
2059
+ className: "w-full border border-sand-200 rounded-md px-3 py-2 text-sm font-mono text-sand-900 bg-white placeholder:text-sand-300 focus:outline-none focus:border-sienna-300"
2060
+ }, void 0, false, {
2061
+ fileName: _jsxFileName,
2062
+ lineNumber: 42,
2063
+ columnNumber: 7
2064
+ }, this),
2065
+ isError && /* @__PURE__ */ (void 0)("p", {
2066
+ className: "text-[11px] text-red-500",
2067
+ children: "인증 결과 확인에 실패했습니다 — 전체 값을 다시 붙여넣거나 로그인을 다시 시작하세요."
2068
+ }, void 0, false, {
2069
+ fileName: _jsxFileName,
2070
+ lineNumber: 49,
2071
+ columnNumber: 9
2072
+ }, this),
2073
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("button", {
2074
+ type: "button",
2075
+ className: "w-full py-2.5 text-sm font-medium rounded-md bg-sand-900 text-white hover:bg-sand-800 disabled:opacity-50 transition-colors duration-150 flex items-center justify-center gap-2",
2076
+ disabled: !pastedCode.trim() || isPending,
2077
+ onClick: () => onSubmit(pastedCode),
2078
+ children: isPending ? /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("span", {
2079
+ className: "flex items-center gap-1.5",
2080
+ children: [/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("span", { className: "w-3.5 h-3.5 border-2 border-white border-t-transparent rounded-full animate-spin" }, void 0, false, {
2081
+ fileName: _jsxFileName,
2082
+ lineNumber: 61,
2083
+ columnNumber: 13
2084
+ }, this), "Verifying..."]
2085
+ }, void 0, true, {
2086
+ fileName: _jsxFileName,
2087
+ lineNumber: 60,
2088
+ columnNumber: 11
2089
+ }, this) : "Complete login"
2090
+ }, void 0, false, {
2091
+ fileName: _jsxFileName,
2092
+ lineNumber: 53,
2093
+ columnNumber: 7
2094
+ }, this),
2095
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("button", {
2096
+ type: "button",
2097
+ className: "w-full py-1.5 text-[12px] text-sand-500 hover:text-sand-700 transition-colors duration-150",
2098
+ onClick: () => {
2099
+ setPastedCode("");
2100
+ onRestart();
2101
+ },
2102
+ children: "처음부터 다시 시작"
2103
+ }, void 0, false, {
2104
+ fileName: _jsxFileName,
2105
+ lineNumber: 68,
2106
+ columnNumber: 7
2107
+ }, this)
2108
+ ]
2109
+ }, void 0, true, {
2110
+ fileName: _jsxFileName,
2111
+ lineNumber: 40,
2112
+ columnNumber: 5
2113
+ }, this);
2114
+ }
2115
+ //#endregion
2116
+ //#region src/components/qgrid/use-oauth-login-flow.ts
2117
+ var PROVIDERS = [
2118
+ "anthropic",
2119
+ "openai",
2120
+ "grok"
2121
+ ];
2122
+ function isOAuthProvider(value) {
2123
+ return PROVIDERS.some((provider) => provider === value);
2124
+ }
2125
+ var OPENAI_POLL_INTERVAL_MS = 3e3;
2126
+ var OPENAI_POLL_TIMEOUT_MS = 3e5;
2127
+ var DEVICE_SLOW_DOWN_STEP_SEC = 5;
2128
+ var DEVICE_MAX_CONSECUTIVE_POLL_FAILURES = 3;
2129
+ var GROK_LOGIN_FAILED_MESSAGE = "Grok login failed";
2130
+ /** Server-provided login URLs are only opened or linked when they are https. */
2131
+ function safeHttpsUrl(value) {
2132
+ if (!value) return void 0;
2133
+ try {
2134
+ return new URL(value).protocol === "https:" ? value : void 0;
2135
+ } catch {
2136
+ return;
2137
+ }
2138
+ }
2139
+ async function getTokenIds(provider, name) {
2140
+ const { rows } = await TokenService.getTokens("A", {
2141
+ num: 0,
2142
+ queryMode: "list"
2143
+ });
2144
+ return new Set(rows.filter((token) => token.provider === provider && token.name === name).map((token) => token.id));
2145
+ }
2146
+ /**
2147
+ * provider별 OAuth 로그인 시작과 코드 제출을 한 곳에 모은다.
2148
+ * Add Token 모달과 tokens 목록의 재로그인 버튼이 같은 플로우를 쓴다 — 두 진입점이
2149
+ * redirect/code 분기나 폴링 처리를 각자 구현하면 원격 접속 경험이 갈라진다.
2150
+ */
2151
+ function useOAuthLoginFlow() {
2152
+ const [loadingProvider, setLoadingProvider] = (0, import_react.useState)(null);
2153
+ const [codeEntryProvider, setCodeEntryProvider] = (0, import_react.useState)(null);
2154
+ const [deviceFlow, setDeviceFlow] = (0, import_react.useState)(null);
2155
+ const queryClient = useQueryClient();
2156
+ const oauthStartMutation = QgridService.useOauthStartMutation();
2157
+ const oauthStartOpenAIMutation = QgridService.useOauthStartOpenAIMutation();
2158
+ const oauthStartGrokMutation = QgridService.useOauthStartGrokMutation();
2159
+ const oauthCompleteMutation = QgridService.useOauthCompleteMutation();
2160
+ const pollTimers = (0, import_react.useRef)({});
2161
+ const attemptRef = (0, import_react.useRef)(0);
2162
+ const stopPolling = () => {
2163
+ attemptRef.current += 1;
2164
+ if (pollTimers.current.interval !== void 0) clearInterval(pollTimers.current.interval);
2165
+ if (pollTimers.current.timeout !== void 0) clearTimeout(pollTimers.current.timeout);
2166
+ pollTimers.current = {};
2167
+ };
2168
+ (0, import_react.useEffect)(() => stopPolling, []);
2169
+ const invalidateTokens = () => Promise.all([queryClient.invalidateQueries({ queryKey: ["Token"] }), queryClient.invalidateQueries({ queryKey: ["Qgrid"] })]);
2170
+ const start = async (provider, name) => {
2171
+ const trimmed = name.trim();
2172
+ if (!trimmed) return;
2173
+ stopPolling();
2174
+ const attempt = attemptRef.current;
2175
+ setDeviceFlow(null);
2176
+ const popup = window.open("about:blank", "_blank");
2177
+ setLoadingProvider(provider);
2178
+ try {
2179
+ if (provider === "grok") {
2180
+ const { authUrl } = await oauthStartGrokMutation.mutateAsync({ name: trimmed });
2181
+ if (attempt !== attemptRef.current) {
2182
+ popup?.close();
2183
+ return;
2184
+ }
2185
+ const loginUrl = safeHttpsUrl(authUrl);
2186
+ if (!loginUrl) throw new Error("Grok login URL is not https");
2187
+ if (popup) popup.location.href = loginUrl;
2188
+ else window.open(loginUrl, "_blank");
2189
+ setCodeEntryProvider(provider);
2190
+ setLoadingProvider(null);
2191
+ return;
2192
+ }
2193
+ if (provider === "openai") {
2194
+ const before = await getTokenIds(provider, trimmed);
2195
+ if (attempt !== attemptRef.current) {
2196
+ popup?.close();
2197
+ return;
2198
+ }
2199
+ const { authUrl, mode } = await oauthStartOpenAIMutation.mutateAsync({ name: trimmed });
2200
+ if (attempt !== attemptRef.current) {
2201
+ popup?.close();
2202
+ return;
2203
+ }
2204
+ if (popup) popup.location.href = authUrl;
2205
+ else window.open(authUrl, "_blank");
2206
+ if (mode === "code") {
2207
+ setCodeEntryProvider(provider);
2208
+ setLoadingProvider(null);
2209
+ return;
2210
+ }
2211
+ pollTimers.current.interval = window.setInterval(() => {
2212
+ getTokenIds(provider, trimmed).then((ids) => {
2213
+ if (attempt !== attemptRef.current) return;
2214
+ if ([...ids].some((id) => !before.has(id))) {
2215
+ stopPolling();
2216
+ setLoadingProvider(null);
2217
+ invalidateTokens();
2218
+ }
2219
+ }).catch(() => {});
2220
+ }, OPENAI_POLL_INTERVAL_MS);
2221
+ pollTimers.current.timeout = window.setTimeout(() => {
2222
+ if (attempt !== attemptRef.current) return;
2223
+ stopPolling();
2224
+ setLoadingProvider(null);
2225
+ }, OPENAI_POLL_TIMEOUT_MS);
2226
+ return;
2227
+ }
2228
+ const { authUrl, mode } = await oauthStartMutation.mutateAsync({ name: trimmed });
2229
+ if (attempt !== attemptRef.current) {
2230
+ popup?.close();
2231
+ return;
2232
+ }
2233
+ if (mode === "code") {
2234
+ if (popup) popup.location.href = authUrl;
2235
+ else window.open(authUrl, "_blank");
2236
+ setCodeEntryProvider(provider);
2237
+ setLoadingProvider(null);
2238
+ } else {
2239
+ popup?.close();
2240
+ window.location.href = authUrl;
2241
+ }
2242
+ } catch (e) {
2243
+ popup?.close();
2244
+ if (attempt !== attemptRef.current) return;
2245
+ console.error("OAuth start failed:", e);
2246
+ setLoadingProvider(null);
2247
+ }
2248
+ };
2249
+ /**
2250
+ * Grok device-code 로그인. 사용자 코드를 보여 주고 `interval` 초마다 폴링한다.
2251
+ * 타이머는 OpenAI 폴링과 같은 `pollTimers`/`attemptRef` 로 관리해 reset·언마운트 시 멈춘다.
2252
+ * `onAdded` 는 토큰 저장과 목록 무효화가 끝난 뒤, 플로우가 취소되지 않았을 때만 호출된다.
2253
+ */
2254
+ const startDevice = async (name, onAdded) => {
2255
+ const trimmed = name.trim();
2256
+ if (!trimmed) return;
2257
+ stopPolling();
2258
+ const attempt = attemptRef.current;
2259
+ setCodeEntryProvider(null);
2260
+ setLoadingProvider(null);
2261
+ setDeviceFlow({ status: "starting" });
2262
+ let device;
2263
+ try {
2264
+ device = await QgridService.oauthStartGrokDevice(trimmed);
2265
+ } catch (e) {
2266
+ if (attempt !== attemptRef.current) return;
2267
+ console.error("Grok device login start failed:", e);
2268
+ setDeviceFlow({
2269
+ status: "error",
2270
+ message: e instanceof Error && e.message ? e.message : GROK_LOGIN_FAILED_MESSAGE
2271
+ });
2272
+ return;
2273
+ }
2274
+ if (attempt !== attemptRef.current) return;
2275
+ const { deviceCode } = device;
2276
+ const verificationUri = safeHttpsUrl(device.verificationUri);
2277
+ if (!verificationUri) {
2278
+ setDeviceFlow({
2279
+ status: "error",
2280
+ message: "Grok verification URL is not https"
2281
+ });
2282
+ return;
2283
+ }
2284
+ const verificationUriComplete = safeHttpsUrl(device.verificationUriComplete);
2285
+ const expiresAt = Date.now() + device.expiresIn * 1e3;
2286
+ let intervalSec = Math.max(device.interval, 1);
2287
+ let failures = 0;
2288
+ const waiting = {
2289
+ status: "waiting",
2290
+ userCode: device.userCode,
2291
+ verificationUri,
2292
+ expiresAt,
2293
+ slowDown: false
2294
+ };
2295
+ if (verificationUriComplete) waiting.verificationUriComplete = verificationUriComplete;
2296
+ setDeviceFlow(waiting);
2297
+ const schedule = () => {
2298
+ const delay = Math.min(intervalSec * 1e3, Math.max(expiresAt - Date.now(), 0));
2299
+ pollTimers.current.timeout = window.setTimeout(() => void poll(), delay);
2300
+ };
2301
+ const poll = async () => {
2302
+ if (attempt !== attemptRef.current) return;
2303
+ if (Date.now() >= expiresAt) {
2304
+ setDeviceFlow({ status: "expired" });
2305
+ return;
2306
+ }
2307
+ let result;
2308
+ try {
2309
+ result = await QgridService.oauthPollGrokDevice(deviceCode);
2310
+ } catch (e) {
2311
+ if (attempt !== attemptRef.current) return;
2312
+ failures += 1;
2313
+ if (failures >= DEVICE_MAX_CONSECUTIVE_POLL_FAILURES) {
2314
+ console.error("Grok device login poll failed:", e);
2315
+ setDeviceFlow({
2316
+ status: "error",
2317
+ message: e instanceof Error && e.message ? e.message : GROK_LOGIN_FAILED_MESSAGE
2318
+ });
2319
+ return;
2320
+ }
2321
+ schedule();
2322
+ return;
2323
+ }
2324
+ if (attempt !== attemptRef.current) return;
2325
+ failures = 0;
2326
+ if (result.status === "added") {
2327
+ setDeviceFlow({
2328
+ status: "added",
2329
+ name: result.name ?? trimmed
2330
+ });
2331
+ await invalidateTokens();
2332
+ if (attempt === attemptRef.current) onAdded?.();
2333
+ return;
2334
+ }
2335
+ if (result.status === "slow_down") {
2336
+ intervalSec = result.intervalSec ?? intervalSec + DEVICE_SLOW_DOWN_STEP_SEC;
2337
+ setDeviceFlow((prev) => prev?.status === "waiting" ? {
2338
+ ...prev,
2339
+ slowDown: true
2340
+ } : prev);
2341
+ } else if (result.intervalSec !== void 0) intervalSec = result.intervalSec;
2342
+ intervalSec = Math.max(intervalSec, 1);
2343
+ schedule();
2344
+ };
2345
+ schedule();
2346
+ };
2347
+ /** @returns 교환 성공 여부. 실패 시 `completeMutation.isError` 로 안내 문구를 띄운다. */
2348
+ const submitCode = async (pastedCode) => {
2349
+ const trimmed = pastedCode.trim();
2350
+ if (!trimmed) return false;
2351
+ try {
2352
+ await oauthCompleteMutation.mutateAsync({ pastedCode: trimmed });
2353
+ } catch (e) {
2354
+ console.error("OAuth complete failed:", e);
2355
+ return false;
2356
+ }
2357
+ await invalidateTokens();
2358
+ return true;
2359
+ };
2360
+ const reset = () => {
2361
+ stopPolling();
2362
+ setLoadingProvider(null);
2363
+ setCodeEntryProvider(null);
2364
+ setDeviceFlow(null);
2365
+ oauthCompleteMutation.reset();
2366
+ };
2367
+ return {
2368
+ loadingProvider,
2369
+ codeEntryProvider,
2370
+ deviceFlow,
2371
+ start,
2372
+ startDevice,
2373
+ submitCode,
2374
+ reset,
2375
+ completeMutation: oauthCompleteMutation
2376
+ };
2377
+ }
2378
+ //#endregion
2379
+ export { o as i, useOAuthLoginFlow as n, OAuthCodeEntry as r, isOAuthProvider as t };