@lunora/studio 1.0.0-alpha.30 → 1.0.0-alpha.301

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 (465) hide show
  1. package/LICENSE.md +6 -0
  2. package/README.md +1 -1
  3. package/dist/index.d.mts +1581 -0
  4. package/dist/index.d.ts +974 -806
  5. package/dist/index.mjs +1 -0
  6. package/dist/mount.d.mts +22 -0
  7. package/dist/mount.d.ts +11 -10
  8. package/dist/mount.mjs +1 -0
  9. package/dist/packem_chunks/AdvisorHealthPanel.mjs +1 -0
  10. package/dist/packem_chunks/ApiTab.mjs +1 -0
  11. package/dist/packem_chunks/AuditPanel.mjs +1 -0
  12. package/dist/packem_chunks/DeploymentHealthPanel.mjs +1 -0
  13. package/dist/packem_chunks/ExportImportPanel.mjs +3 -0
  14. package/dist/packem_chunks/FileBrowser.mjs +4 -0
  15. package/dist/packem_chunks/FunctionRunner.mjs +1 -0
  16. package/dist/packem_chunks/FunctionStatsPanel.mjs +1 -0
  17. package/dist/packem_chunks/HealthPanel.mjs +1 -0
  18. package/dist/packem_chunks/InsightsPanel.mjs +1 -0
  19. package/dist/packem_chunks/LogsPanel.mjs +1 -0
  20. package/dist/packem_chunks/MailPanel.mjs +2 -0
  21. package/dist/packem_chunks/MetricsPanel.mjs +1 -0
  22. package/dist/packem_chunks/NotificationsPanel.mjs +1 -0
  23. package/dist/packem_chunks/PitrPanel.mjs +1 -0
  24. package/dist/packem_chunks/SchemaViewer.mjs +1 -0
  25. package/dist/packem_chunks/SecurityAdvisorPanel.mjs +1 -0
  26. package/dist/packem_chunks/SettingsPanel.mjs +1 -0
  27. package/dist/packem_chunks/SqlEditorPanel.mjs +10 -0
  28. package/dist/packem_chunks/TableEditor.mjs +1 -0
  29. package/dist/packem_chunks/agents-panel.mjs +1 -0
  30. package/dist/packem_chunks/ai-usage-panel.mjs +1 -0
  31. package/dist/packem_chunks/analytics-panel.mjs +1 -0
  32. package/dist/packem_chunks/architecture-panel.mjs +1 -0
  33. package/dist/packem_chunks/auth-audit-panel.mjs +1 -0
  34. package/dist/packem_chunks/auth-config-panel.mjs +1 -0
  35. package/dist/packem_chunks/auth-sessions-panel.mjs +1 -0
  36. package/dist/packem_chunks/containers-panel.mjs +1 -0
  37. package/dist/packem_chunks/dashboards-panel.mjs +1 -0
  38. package/dist/packem_chunks/evals-panel.mjs +1 -0
  39. package/dist/packem_chunks/fanout-panel.mjs +1 -0
  40. package/dist/packem_chunks/flags-panel.mjs +1 -0
  41. package/dist/packem_chunks/issues-panel.mjs +1 -0
  42. package/dist/packem_chunks/kv-browser.mjs +1 -0
  43. package/dist/packem_chunks/log-drains-panel.mjs +4 -0
  44. package/dist/packem_chunks/migrations-route.mjs +1 -0
  45. package/dist/packem_chunks/organizations-panel.mjs +1 -0
  46. package/dist/packem_chunks/payments-panel.mjs +1 -0
  47. package/dist/packem_chunks/permissions-panel.mjs +1 -0
  48. package/dist/packem_chunks/privacy-requests-panel.mjs +1 -0
  49. package/dist/packem_chunks/queues-panel.mjs +1 -0
  50. package/dist/packem_chunks/reactors-panel.mjs +1 -0
  51. package/dist/packem_chunks/rls-panel.mjs +1 -0
  52. package/dist/packem_chunks/schedule-panel.mjs +1 -0
  53. package/dist/packem_chunks/sparkline.mjs +1 -0
  54. package/dist/packem_chunks/storage-rules-panel.mjs +1 -0
  55. package/dist/packem_chunks/subscriptions-panel.mjs +1 -0
  56. package/dist/packem_chunks/sync-client-panel.mjs +1 -0
  57. package/dist/packem_chunks/traces-panel.mjs +1 -0
  58. package/dist/packem_chunks/users-panel.mjs +1 -0
  59. package/dist/packem_chunks/vector-browser.mjs +1 -0
  60. package/dist/packem_chunks/workflows-panel.mjs +1 -0
  61. package/dist/packem_shared/ADMIN_FUNCTIONS-B8yyk5BX.mjs +1 -0
  62. package/dist/packem_shared/ApiDocsPanel-fhDlZGE4.mjs +2 -0
  63. package/dist/packem_shared/ApiReferencePanel-nAf8tNRr.mjs +1 -0
  64. package/dist/packem_shared/CommandPalette-D9ZY-qQd.mjs +1 -0
  65. package/dist/packem_shared/ConfirmButton-DU4p72Er.mjs +1 -0
  66. package/dist/packem_shared/ConnectionBadge-B8Hj5DaE.mjs +1 -0
  67. package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-DuULO4XM.mjs +1 -0
  68. package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-D5YMT0gM.mjs +1 -0
  69. package/dist/packem_shared/DEFAULT_LOCALE-A1Yg5ORA.mjs +1 -0
  70. package/dist/packem_shared/DataBrowser-E68QfaST.mjs +4 -0
  71. package/dist/packem_shared/DataFilters-CYZFt2EK.mjs +1 -0
  72. package/dist/packem_shared/ErrorBoundary-BWNF98VF.mjs +1 -0
  73. package/dist/packem_shared/GlobalDataBrowser-DhObcZDY.mjs +1 -0
  74. package/dist/packem_shared/HomePanel-CUuYsApa.mjs +1 -0
  75. package/dist/packem_shared/MigrationsPanel-CkVIwAbK.mjs +1 -0
  76. package/dist/packem_shared/OpenRpcReferencePanel-BxEr49D9.mjs +1 -0
  77. package/dist/packem_shared/STUDIO_ROOT_CLASS-C6MccdVk.mjs +1 -0
  78. package/dist/packem_shared/ScheduledJobs-BZNcYWBP.mjs +1 -0
  79. package/dist/packem_shared/ShardInput-C6mjgAh4.mjs +1 -0
  80. package/dist/packem_shared/Studio-CZjQXFHC.mjs +1 -0
  81. package/dist/packem_shared/StudioApp-C9ENwcOH.mjs +1 -0
  82. package/dist/packem_shared/StudioI18nProvider-fVsCSs5L.mjs +1 -0
  83. package/dist/packem_shared/advisor-view-DzI2RQhY.mjs +1 -0
  84. package/dist/packem_shared/aggregateMetrics-DKFJc-o5.mjs +1 -0
  85. package/dist/packem_shared/alert-PB5W11MM.mjs +1 -0
  86. package/dist/packem_shared/app.d-D7vL0y8y.d.mts +349 -0
  87. package/dist/packem_shared/app.d-D7vL0y8y.d.ts +349 -0
  88. package/dist/packem_shared/auth-pager-DiDnXsfe.mjs +1 -0
  89. package/dist/packem_shared/badge-r_5B4LHP.mjs +1 -0
  90. package/dist/packem_shared/bar-chart-BCsEIQoQ.mjs +6 -0
  91. package/dist/packem_shared/browser-storage-BH1MxLZs.mjs +1 -0
  92. package/dist/packem_shared/button-q0UYSmrn.mjs +1 -0
  93. package/dist/packem_shared/card-By2O8ULa.mjs +1 -0
  94. package/dist/packem_shared/cf-links-CBJ5SywP.mjs +1 -0
  95. package/dist/packem_shared/checkbox-CnS9cyCz.mjs +1 -0
  96. package/dist/packem_shared/control-button-BOZ5K-FC.mjs +1 -0
  97. package/dist/packem_shared/data-grid-DIiNmDR9.mjs +1 -0
  98. package/dist/packem_shared/data-view-params-DhYmAkcj.mjs +1 -0
  99. package/dist/packem_shared/diagram-export-panel-D5CVNJkp.mjs +2 -0
  100. package/dist/packem_shared/dropdown-menu-jLZenfWH.mjs +2 -0
  101. package/dist/packem_shared/empty-state-D7jEML_T.mjs +1 -0
  102. package/dist/packem_shared/error-alert-DueSEkt-.mjs +1 -0
  103. package/dist/packem_shared/grid-features-OVIMIQan.mjs +6 -0
  104. package/dist/packem_shared/grid-pagination-DgzyzfBh.mjs +1 -0
  105. package/dist/packem_shared/home-panel-BcE8S2Nn.mjs +3 -0
  106. package/dist/packem_shared/input-CXhxesPC.mjs +1 -0
  107. package/dist/packem_shared/internal-Df43vQI0.mjs +2 -0
  108. package/dist/packem_shared/label-DKFzyHq6.mjs +1 -0
  109. package/dist/packem_shared/live-status-BuJdUZFU.mjs +1 -0
  110. package/dist/packem_shared/log-fields-BolUoZ9g.mjs +1 -0
  111. package/dist/packem_shared/log-line-CICyJ_kc.mjs +1 -0
  112. package/dist/packem_shared/metrics-format-1sNGG47R.mjs +1 -0
  113. package/dist/packem_shared/modal-shell-CDztwLnv.mjs +1 -0
  114. package/dist/packem_shared/operation-console-provider-DoloEvon.mjs +1 -0
  115. package/dist/packem_shared/recording-client-CyFiAE2l.mjs +1 -0
  116. package/dist/packem_shared/reference-view-CIHyURU6.mjs +13 -0
  117. package/dist/packem_shared/schema-diagram-C5oilX7l.mjs +2 -0
  118. package/dist/packem_shared/scroll-area-CXCQH7VT.mjs +2 -0
  119. package/dist/packem_shared/select-DPyS18Vy.mjs +2 -0
  120. package/dist/packem_shared/shard-history-CaO3C4KQ.mjs +1 -0
  121. package/dist/packem_shared/shortcuts-B9gDaXmw.mjs +1 -0
  122. package/dist/packem_shared/skeleton-DX1gfixl.mjs +1 -0
  123. package/dist/packem_shared/sparkline-B_sPPO_8.mjs +1 -0
  124. package/dist/packem_shared/sql-result-table-DyK762_A.mjs +1 -0
  125. package/dist/packem_shared/stat-card-BAv73QtB.mjs +1 -0
  126. package/dist/packem_shared/storage-tier-C2mKwYRj.mjs +1 -0
  127. package/dist/packem_shared/studio-fK2DTLde.mjs +2 -0
  128. package/dist/packem_shared/table-D0SBiDu-.mjs +2 -0
  129. package/dist/packem_shared/table-list-sidebar-DkPO_Qtz.mjs +1 -0
  130. package/dist/packem_shared/textarea--40GKAyz.mjs +1 -0
  131. package/dist/packem_shared/trace-handoff-BV3EWqy_.mjs +1 -0
  132. package/dist/packem_shared/use-admin-query-tlBof8Yg.mjs +1 -0
  133. package/dist/packem_shared/use-admin-spec-Bir7V68L.mjs +1 -0
  134. package/dist/packem_shared/use-async-submit-CZqCMTJ_.mjs +1 -0
  135. package/dist/packem_shared/use-auth-config-Z_n4ABCI.mjs +1 -0
  136. package/dist/packem_shared/use-mirrored-ref-CVDf2z1M.mjs +1 -0
  137. package/dist/packem_shared/use-open-trace-DMVhpnyG.mjs +1 -0
  138. package/dist/packem_shared/use-shard-key-BsP3o5wT.mjs +1 -0
  139. package/dist/packem_shared/use-sql-assistant-CZydTzd5.mjs +1 -0
  140. package/dist/packem_shared/useDebounced-DVeQ5-oW.mjs +1 -0
  141. package/dist/packem_shared/utils-bhneXptQ.mjs +1 -0
  142. package/dist/packem_shared/virtual-rect-D_j7aLxX.mjs +1 -0
  143. package/dist/standalone/chunk-24T422OY.js +1 -0
  144. package/dist/standalone/chunk-253UHWDX.js +1 -0
  145. package/dist/standalone/chunk-2I4NHEKA.js +1 -0
  146. package/dist/standalone/chunk-2IKDEUCX.js +1 -0
  147. package/dist/standalone/chunk-2LJRI76T.js +1 -0
  148. package/dist/standalone/chunk-2SGUZAFC.js +1 -0
  149. package/dist/standalone/chunk-2TP3H244.js +1 -0
  150. package/dist/standalone/chunk-2VA5S3IA.js +1 -0
  151. package/dist/standalone/chunk-37WYCOQ2.js +1 -0
  152. package/dist/standalone/chunk-3M7IXVST.js +1 -0
  153. package/dist/standalone/chunk-3YXASVTP.js +1 -0
  154. package/dist/standalone/chunk-45M2SFAD.js +1 -0
  155. package/dist/standalone/chunk-4FAWIWSZ.js +1 -0
  156. package/dist/standalone/chunk-4WD4XGC3.js +1 -0
  157. package/dist/standalone/chunk-4ZEL6BYL.js +1 -0
  158. package/dist/standalone/chunk-55UGUCQ6.js +1 -0
  159. package/dist/standalone/chunk-5B2RTXBS.js +1 -0
  160. package/dist/standalone/chunk-5QR2SQIS.js +1 -0
  161. package/dist/standalone/chunk-5WGHX3BJ.js +1 -0
  162. package/dist/standalone/chunk-6HLARDYO.js +1 -0
  163. package/dist/standalone/chunk-6JBF34XO.js +1 -0
  164. package/dist/standalone/chunk-6PDZ5QSX.js +3 -0
  165. package/dist/standalone/chunk-6QTAHSDD.js +1 -0
  166. package/dist/standalone/chunk-6X76NBY7.js +2 -0
  167. package/dist/standalone/chunk-76CINMOE.js +1 -0
  168. package/dist/standalone/chunk-76GDLOCA.js +1 -0
  169. package/dist/standalone/chunk-7G4Z6Q7X.js +1 -0
  170. package/dist/standalone/chunk-7IIQBGQK.js +1 -0
  171. package/dist/standalone/chunk-7NWLYOGL.js +1 -0
  172. package/dist/standalone/chunk-7PBPAGC2.js +3 -0
  173. package/dist/standalone/chunk-7RKB5KS7.js +1 -0
  174. package/dist/standalone/chunk-7Y3SY37W.js +1 -0
  175. package/dist/standalone/chunk-APWVPIZV.js +1 -0
  176. package/dist/standalone/chunk-AUAECCXB.js +1 -0
  177. package/dist/standalone/{chunk-BJGBHGK3.js → chunk-AUGKHAMQ.js} +1 -1
  178. package/dist/standalone/chunk-AZHAXSRA.js +1 -0
  179. package/dist/standalone/chunk-B6WI7CHG.js +1 -0
  180. package/dist/standalone/chunk-BOMPSVRC.js +1 -0
  181. package/dist/standalone/chunk-BXUP4USX.js +1 -0
  182. package/dist/standalone/chunk-CCDX5RYT.js +1 -0
  183. package/dist/standalone/chunk-CG2BXM3M.js +1 -0
  184. package/dist/standalone/chunk-CGQMJYCW.js +1 -0
  185. package/dist/standalone/chunk-CVXNHIQW.js +1 -0
  186. package/dist/standalone/chunk-CZBYO7MB.js +1 -0
  187. package/dist/standalone/chunk-D2MWAZIR.js +1 -0
  188. package/dist/standalone/chunk-D4KVIMPR.js +4 -0
  189. package/dist/standalone/chunk-DRFPILA5.js +1 -0
  190. package/dist/standalone/chunk-E3LQQON3.js +1 -0
  191. package/dist/standalone/chunk-E4PXACVL.js +3 -0
  192. package/dist/standalone/chunk-ECY2JC5F.js +1 -0
  193. package/dist/standalone/chunk-F4CHPK5T.js +1 -0
  194. package/dist/standalone/chunk-F7CMFUN5.js +1 -0
  195. package/dist/standalone/chunk-FPI7AMQJ.js +1 -0
  196. package/dist/standalone/chunk-FSHFJSTY.js +1 -0
  197. package/dist/standalone/chunk-FUYEZFBP.js +1 -0
  198. package/dist/standalone/chunk-G6EOMCDE.js +9 -0
  199. package/dist/standalone/chunk-G74GIEU4.js +1 -0
  200. package/dist/standalone/chunk-GHQ2VDI2.js +1 -0
  201. package/dist/standalone/chunk-HCTJKP5J.js +1 -0
  202. package/dist/standalone/chunk-HJHSQPHW.js +19 -0
  203. package/dist/standalone/chunk-HLFK7BP6.js +1 -0
  204. package/dist/standalone/chunk-HV77I2E5.js +1 -0
  205. package/dist/standalone/chunk-HX5A6HC7.js +1 -0
  206. package/dist/standalone/chunk-I26MS5PJ.js +1 -0
  207. package/dist/standalone/chunk-IWZ7GVQO.js +1 -0
  208. package/dist/standalone/chunk-J6GRPDN3.js +1 -0
  209. package/dist/standalone/chunk-JQXA2OYK.js +1 -0
  210. package/dist/standalone/chunk-JVZG34HR.js +1 -0
  211. package/dist/standalone/chunk-JZGTSH2C.js +4 -0
  212. package/dist/standalone/chunk-K76MCCBF.js +1 -0
  213. package/dist/standalone/chunk-KNVOVRC7.js +1 -0
  214. package/dist/standalone/chunk-KQSQVNVI.js +1 -0
  215. package/dist/standalone/chunk-L7XFE7ZQ.js +15 -0
  216. package/dist/standalone/chunk-MGVUIQTE.js +5 -0
  217. package/dist/standalone/chunk-MK7SA3YV.js +8 -0
  218. package/dist/standalone/chunk-MVWZMWPD.js +1 -0
  219. package/dist/standalone/chunk-N62W6SXC.js +1 -0
  220. package/dist/standalone/chunk-N7ZLG6XW.js +1 -0
  221. package/dist/standalone/chunk-NCPW7WHO.js +1 -0
  222. package/dist/standalone/chunk-NDTQTKDX.js +6 -0
  223. package/dist/standalone/chunk-NGVP66OH.js +1 -0
  224. package/dist/standalone/chunk-NNYTSWRW.js +1 -0
  225. package/dist/standalone/chunk-NQZALRU3.js +1 -0
  226. package/dist/standalone/chunk-NRP22GKC.js +1 -0
  227. package/dist/standalone/chunk-NXQW5E6W.js +1 -0
  228. package/dist/standalone/chunk-OPM7ESDV.js +1 -0
  229. package/dist/standalone/chunk-OQ6I6OXT.js +2 -0
  230. package/dist/standalone/chunk-OSGXNEFA.js +1 -0
  231. package/dist/standalone/chunk-OYCUPD3Q.js +1 -0
  232. package/dist/standalone/chunk-PD2VK52L.js +1 -0
  233. package/dist/standalone/chunk-PIMTWCRD.js +1 -0
  234. package/dist/standalone/chunk-PSPU5HSH.js +1 -0
  235. package/dist/standalone/chunk-Q6ED4KUL.js +1 -0
  236. package/dist/standalone/chunk-Q6IT6ZD7.js +1 -0
  237. package/dist/standalone/chunk-QAQDMS6R.js +1 -0
  238. package/dist/standalone/chunk-QJLHH3ET.js +1 -0
  239. package/dist/standalone/chunk-R6U22RSY.js +1 -0
  240. package/dist/standalone/chunk-RGMVGZV4.js +1 -0
  241. package/dist/standalone/chunk-RJWFF2KE.js +1 -0
  242. package/dist/standalone/chunk-RWVIV3U7.js +1 -0
  243. package/dist/standalone/chunk-RZ6QAA2I.js +1 -0
  244. package/dist/standalone/chunk-S4Z7K55A.js +1 -0
  245. package/dist/standalone/chunk-SA2OGF3F.js +1 -0
  246. package/dist/standalone/chunk-SJQERRSZ.js +1 -0
  247. package/dist/standalone/chunk-SV764LKQ.js +1 -0
  248. package/dist/standalone/chunk-TVUR3FJ4.js +1 -0
  249. package/dist/standalone/chunk-U5ESUXRC.js +1 -0
  250. package/dist/standalone/chunk-UC7MNI2F.js +1 -0
  251. package/dist/standalone/chunk-UD4LDX2S.js +1 -0
  252. package/dist/standalone/chunk-UX6CSZ3D.js +1 -0
  253. package/dist/standalone/chunk-UYEZR3BI.js +1 -0
  254. package/dist/standalone/chunk-V3A4MT5T.js +1 -0
  255. package/dist/standalone/chunk-VCFEO3RI.js +1 -0
  256. package/dist/standalone/chunk-VESGIGMQ.js +1 -0
  257. package/dist/standalone/chunk-VNLBEXJH.js +1 -0
  258. package/dist/standalone/chunk-VOL6MWI6.js +1 -0
  259. package/dist/standalone/chunk-WIASRPIC.js +59 -0
  260. package/dist/standalone/chunk-WJRYEML4.js +1 -0
  261. package/dist/standalone/chunk-WZ44V6FP.js +1 -0
  262. package/dist/standalone/chunk-XGCIDUJF.js +1 -0
  263. package/dist/standalone/chunk-XHRKNCCI.js +1 -0
  264. package/dist/standalone/chunk-XIAH5TMC.js +1 -0
  265. package/dist/standalone/chunk-XILJ2PEQ.js +1 -0
  266. package/dist/standalone/chunk-XNN6PY57.js +14 -0
  267. package/dist/standalone/chunk-Y3AYVFTK.js +1 -0
  268. package/dist/standalone/chunk-YEB2U5KT.js +1 -0
  269. package/dist/standalone/chunk-YLPATGWK.js +15 -0
  270. package/dist/standalone/chunk-YQL6PSXT.js +1 -0
  271. package/dist/standalone/chunk-YRYRCORI.js +1 -0
  272. package/dist/standalone/chunk-YVR4SEPU.js +1 -0
  273. package/dist/standalone/chunk-YZPYGQZ5.js +1 -0
  274. package/dist/standalone/chunk-Z22BDS6N.js +1 -0
  275. package/dist/standalone/chunk-ZKJS6EBE.js +1 -0
  276. package/dist/standalone/studio.js +9 -214
  277. package/dist/styles.css +2 -2
  278. package/package.json +26 -21
  279. package/dist/index.js +0 -41
  280. package/dist/mount.js +0 -26
  281. package/dist/packem_chunks/ApiTab.js +0 -251
  282. package/dist/packem_chunks/AuditPanel.js +0 -200
  283. package/dist/packem_chunks/ExportImportPanel.js +0 -197
  284. package/dist/packem_chunks/FileBrowser.js +0 -2932
  285. package/dist/packem_chunks/FunctionRunner.js +0 -343
  286. package/dist/packem_chunks/FunctionStatsPanel.js +0 -375
  287. package/dist/packem_chunks/HealthPanel.js +0 -648
  288. package/dist/packem_chunks/InsightsPanel.js +0 -461
  289. package/dist/packem_chunks/LogsPanel.js +0 -827
  290. package/dist/packem_chunks/MailPanel.js +0 -440
  291. package/dist/packem_chunks/MetricsPanel.js +0 -1344
  292. package/dist/packem_chunks/MigrationsPanel.js +0 -239
  293. package/dist/packem_chunks/PitrPanel.js +0 -252
  294. package/dist/packem_chunks/SchemaViewer.js +0 -2512
  295. package/dist/packem_chunks/SecurityAdvisorPanel.js +0 -92
  296. package/dist/packem_chunks/SettingsPanel.js +0 -390
  297. package/dist/packem_chunks/SqlEditorPanel.js +0 -2322
  298. package/dist/packem_chunks/TableEditor.js +0 -313
  299. package/dist/packem_chunks/analytics-panel.js +0 -261
  300. package/dist/packem_chunks/auth-config-panel.js +0 -179
  301. package/dist/packem_chunks/auth-sessions-panel.js +0 -175
  302. package/dist/packem_chunks/dashboards-panel.js +0 -779
  303. package/dist/packem_chunks/fanout-panel.js +0 -481
  304. package/dist/packem_chunks/flags-panel.js +0 -176
  305. package/dist/packem_chunks/kv-browser.js +0 -1896
  306. package/dist/packem_chunks/log-drains-panel.js +0 -273
  307. package/dist/packem_chunks/organizations-panel.js +0 -670
  308. package/dist/packem_chunks/payments-panel.js +0 -185
  309. package/dist/packem_chunks/permissions-panel.js +0 -804
  310. package/dist/packem_chunks/queues-panel.js +0 -147
  311. package/dist/packem_chunks/rls-panel.js +0 -313
  312. package/dist/packem_chunks/schedule-panel.js +0 -831
  313. package/dist/packem_chunks/sparkline.js +0 -79
  314. package/dist/packem_chunks/storage-rules-panel.js +0 -138
  315. package/dist/packem_chunks/subscriptions-panel.js +0 -236
  316. package/dist/packem_chunks/users-panel.js +0 -1265
  317. package/dist/packem_chunks/vector-browser.js +0 -281
  318. package/dist/packem_chunks/workflows-panel.js +0 -562
  319. package/dist/packem_shared/ADMIN_FUNCTIONS-CdaxLGkE.js +0 -48
  320. package/dist/packem_shared/ApiDocsPanel-B6u_wnz-.js +0 -842
  321. package/dist/packem_shared/ApiReferencePanel-Drz4UO0a.js +0 -230
  322. package/dist/packem_shared/CommandPalette-B5BertvU.js +0 -373
  323. package/dist/packem_shared/ConfirmButton-C2eVi2Qv.js +0 -59
  324. package/dist/packem_shared/ConnectionBadge-B2DDM2Tn.js +0 -111
  325. package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-Vxwaxx51.js +0 -50
  326. package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-DjF0h-gA.js +0 -89
  327. package/dist/packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js +0 -27
  328. package/dist/packem_shared/DataBrowser-ANTHLWWh.js +0 -4493
  329. package/dist/packem_shared/DataFilters-FNquMaiu.js +0 -249
  330. package/dist/packem_shared/ErrorBoundary-BzAApI7J.js +0 -66
  331. package/dist/packem_shared/GlobalDataBrowser-CjgTG_wa.js +0 -289
  332. package/dist/packem_shared/HomePanel-c2FodE9t.js +0 -14
  333. package/dist/packem_shared/OpenRpcReferencePanel-CspFdbUT.js +0 -192
  334. package/dist/packem_shared/STUDIO_ROOT_CLASS-D12gX2dV.js +0 -3
  335. package/dist/packem_shared/ScheduledJobs-BEJXtsBn.js +0 -262
  336. package/dist/packem_shared/ShardInput-gx_DZXXn.js +0 -107
  337. package/dist/packem_shared/Studio-CVTtA_sB.js +0 -16
  338. package/dist/packem_shared/StudioApp-BSYV2fz6.js +0 -657
  339. package/dist/packem_shared/StudioI18nProvider-B-tDCZIi.js +0 -48
  340. package/dist/packem_shared/advisor-view-DzqyvUU3.js +0 -159
  341. package/dist/packem_shared/aggregateMetrics-D4nUHEKU.js +0 -108
  342. package/dist/packem_shared/app.d-B6MyY_al.d.ts +0 -300
  343. package/dist/packem_shared/badge-B2PKA1-5.js +0 -49
  344. package/dist/packem_shared/bar-chart-Bb__F5-u.js +0 -3245
  345. package/dist/packem_shared/browser-storage-d03UsV7v.js +0 -249
  346. package/dist/packem_shared/button-BhsN2uZH.js +0 -49
  347. package/dist/packem_shared/card-DURq3ElK.js +0 -175
  348. package/dist/packem_shared/cf-links-BZfRdxSE.js +0 -8
  349. package/dist/packem_shared/checkbox-UNkzAxl-.js +0 -63
  350. package/dist/packem_shared/data-grid-Dsg6nRjo.js +0 -183
  351. package/dist/packem_shared/data-view-params-Cd6yRVbv.js +0 -96
  352. package/dist/packem_shared/dropdown-menu-WY4B_eJO.js +0 -280
  353. package/dist/packem_shared/empty-state-DY_oe0k6.js +0 -98
  354. package/dist/packem_shared/grid-features-D7nNzBYm.js +0 -745
  355. package/dist/packem_shared/home-panel-aOR_drVv.js +0 -1637
  356. package/dist/packem_shared/input-XH4r1Pt1.js +0 -53
  357. package/dist/packem_shared/internal-FcNZ3beb.js +0 -68
  358. package/dist/packem_shared/label-D8ykjn5J.js +0 -46
  359. package/dist/packem_shared/live-status-FZ0psC1z.js +0 -44
  360. package/dist/packem_shared/modal-shell-hyaJvIJ6.js +0 -100
  361. package/dist/packem_shared/reference-view-Doy1XlQq.js +0 -2140
  362. package/dist/packem_shared/select-UkNYCT3s.js +0 -273
  363. package/dist/packem_shared/shard-history-DyebH1R5.js +0 -38
  364. package/dist/packem_shared/skeleton-CGhL0p20.js +0 -45
  365. package/dist/packem_shared/sparkline-KgMPHS4u.js +0 -93
  366. package/dist/packem_shared/storage-tier-CL98eOvn.js +0 -85
  367. package/dist/packem_shared/studio-dMTJ-kRR.js +0 -3987
  368. package/dist/packem_shared/table-DsCa9Qp9.js +0 -246
  369. package/dist/packem_shared/table-list-sidebar-VMo0ftxD.js +0 -832
  370. package/dist/packem_shared/textarea-D3gaCU_-.js +0 -46
  371. package/dist/packem_shared/use-admin-query-BViPA3US.js +0 -105
  372. package/dist/packem_shared/use-auth-capabilities-BHkoBnbZ.js +0 -32
  373. package/dist/packem_shared/useDebounced-Dxncpg6z.js +0 -32
  374. package/dist/packem_shared/utils-B05Dmz_H.js +0 -8
  375. package/dist/packem_shared/virtual-rect-CVMUskSm.js +0 -10
  376. package/dist/standalone/chunk-2DS7JLWL.js +0 -13
  377. package/dist/standalone/chunk-2K47A3P6.js +0 -1
  378. package/dist/standalone/chunk-2NGUNNGW.js +0 -1
  379. package/dist/standalone/chunk-2PDQ4KZ6.js +0 -1
  380. package/dist/standalone/chunk-3BP4BTLR.js +0 -4
  381. package/dist/standalone/chunk-3OA7PECS.js +0 -6
  382. package/dist/standalone/chunk-4QHKBC77.js +0 -1
  383. package/dist/standalone/chunk-57LYXHXH.js +0 -1
  384. package/dist/standalone/chunk-5NSZVXCS.js +0 -1
  385. package/dist/standalone/chunk-5OIBXYZM.js +0 -1
  386. package/dist/standalone/chunk-63XKJQTQ.js +0 -1
  387. package/dist/standalone/chunk-6RC6L33K.js +0 -4
  388. package/dist/standalone/chunk-6VTGE3WJ.js +0 -1
  389. package/dist/standalone/chunk-7PBZKXYA.js +0 -1
  390. package/dist/standalone/chunk-7POIIWC5.js +0 -3
  391. package/dist/standalone/chunk-7RYIQKZA.js +0 -1
  392. package/dist/standalone/chunk-7TJJXVSE.js +0 -1
  393. package/dist/standalone/chunk-AB6QGMBF.js +0 -1
  394. package/dist/standalone/chunk-AHILM3ZP.js +0 -1
  395. package/dist/standalone/chunk-AQGOX5DK.js +0 -1
  396. package/dist/standalone/chunk-ASLGNHAX.js +0 -1
  397. package/dist/standalone/chunk-BHTPZS7L.js +0 -4
  398. package/dist/standalone/chunk-D7HKX4DI.js +0 -1
  399. package/dist/standalone/chunk-DGWTR4G7.js +0 -1
  400. package/dist/standalone/chunk-DSX53PBM.js +0 -1
  401. package/dist/standalone/chunk-DV2MNASX.js +0 -1
  402. package/dist/standalone/chunk-DWDILV2E.js +0 -1
  403. package/dist/standalone/chunk-E7AVZZKO.js +0 -1
  404. package/dist/standalone/chunk-EGJX34WM.js +0 -1
  405. package/dist/standalone/chunk-FCR3HKFV.js +0 -1
  406. package/dist/standalone/chunk-FKO3HO6I.js +0 -4
  407. package/dist/standalone/chunk-FQKNJSRA.js +0 -76
  408. package/dist/standalone/chunk-G2TFEWEQ.js +0 -4
  409. package/dist/standalone/chunk-GABMIICA.js +0 -1
  410. package/dist/standalone/chunk-GTM65MVX.js +0 -1
  411. package/dist/standalone/chunk-GZXPPJVK.js +0 -1
  412. package/dist/standalone/chunk-HFBRE65A.js +0 -1
  413. package/dist/standalone/chunk-HFMQNUBC.js +0 -1
  414. package/dist/standalone/chunk-HG7Q5B3H.js +0 -1
  415. package/dist/standalone/chunk-HTQL7AXU.js +0 -1
  416. package/dist/standalone/chunk-HV7G6DFP.js +0 -5
  417. package/dist/standalone/chunk-ITLLHEVG.js +0 -1
  418. package/dist/standalone/chunk-J6J54MBP.js +0 -1
  419. package/dist/standalone/chunk-JSEXCW5Q.js +0 -1
  420. package/dist/standalone/chunk-KEGAWN6Y.js +0 -1
  421. package/dist/standalone/chunk-KG3QTFWE.js +0 -1
  422. package/dist/standalone/chunk-KGS7KM4A.js +0 -2
  423. package/dist/standalone/chunk-KODWGUAB.js +0 -1
  424. package/dist/standalone/chunk-KZ6INM5M.js +0 -1
  425. package/dist/standalone/chunk-MGFEVTRI.js +0 -1
  426. package/dist/standalone/chunk-N2QDG3MW.js +0 -1
  427. package/dist/standalone/chunk-N4JI6VQD.js +0 -1
  428. package/dist/standalone/chunk-NNISYDNI.js +0 -1
  429. package/dist/standalone/chunk-O4PXDNR3.js +0 -1
  430. package/dist/standalone/chunk-O77VNUFD.js +0 -1
  431. package/dist/standalone/chunk-OD2POGPJ.js +0 -1
  432. package/dist/standalone/chunk-OXCK3ZUG.js +0 -1
  433. package/dist/standalone/chunk-P7DSVO4U.js +0 -1
  434. package/dist/standalone/chunk-PKAM3N5C.js +0 -1
  435. package/dist/standalone/chunk-QGXGBHQO.js +0 -1
  436. package/dist/standalone/chunk-QHA3TAEJ.js +0 -1
  437. package/dist/standalone/chunk-QQWC62X7.js +0 -1
  438. package/dist/standalone/chunk-RMYA7NAH.js +0 -1
  439. package/dist/standalone/chunk-RRCPZMC2.js +0 -22
  440. package/dist/standalone/chunk-S53RUBW5.js +0 -1
  441. package/dist/standalone/chunk-SB4GT6PK.js +0 -1
  442. package/dist/standalone/chunk-SEU5V7I6.js +0 -1
  443. package/dist/standalone/chunk-SHIOUDOT.js +0 -1
  444. package/dist/standalone/chunk-SIDRSX7Y.js +0 -1
  445. package/dist/standalone/chunk-SVR644RF.js +0 -1
  446. package/dist/standalone/chunk-TAD43CG5.js +0 -1
  447. package/dist/standalone/chunk-TBMYIZIO.js +0 -1
  448. package/dist/standalone/chunk-TICVNLPM.js +0 -1
  449. package/dist/standalone/chunk-TQ36RWOP.js +0 -1
  450. package/dist/standalone/chunk-UGMRUEBU.js +0 -1
  451. package/dist/standalone/chunk-UII66UVF.js +0 -1
  452. package/dist/standalone/chunk-VJPQUBN6.js +0 -8
  453. package/dist/standalone/chunk-VLXV72QE.js +0 -1
  454. package/dist/standalone/chunk-VMJKJWG6.js +0 -1
  455. package/dist/standalone/chunk-VPDPN5RR.js +0 -2
  456. package/dist/standalone/chunk-VSEGZA3J.js +0 -1
  457. package/dist/standalone/chunk-VXBZQIGY.js +0 -4
  458. package/dist/standalone/chunk-W7PCVQTE.js +0 -1
  459. package/dist/standalone/chunk-XLILSHPE.js +0 -1
  460. package/dist/standalone/chunk-XURNGQSS.js +0 -1
  461. package/dist/standalone/chunk-YJGANMU7.js +0 -18
  462. package/dist/standalone/chunk-YQQJ4N6U.js +0 -1
  463. package/dist/standalone/chunk-ZH7UES4T.js +0 -2
  464. package/dist/standalone/chunk-ZPUO7FNI.js +0 -1
  465. package/dist/standalone/chunk-ZQCVDXDL.js +0 -1
@@ -1,2140 +0,0 @@
1
- import { c } from 'react/compiler-runtime';
2
- import { useState, useEffect, createContext, use } from 'react';
3
- import { e as errorMessage, b as copyToClipboard, f as fireAndForget, c as callOptions, a as adminRef } from './internal-FcNZ3beb.js';
4
- import { SentIcon, Copy01Icon, Search01Icon } from '@hugeicons/core-free-icons';
5
- import { HugeiconsIcon } from '@hugeicons/react';
6
- import { I as Input } from './input-XH4r1Pt1.js';
7
- import { useT } from './DEFAULT_LOCALE-CiX4W7Kr.js';
8
- import { B as Button } from './button-BhsN2uZH.js';
9
- import { jsxDEV, Fragment } from 'react/jsx-dev-runtime';
10
- import { B as Badge$1 } from './badge-B2PKA1-5.js';
11
- import { ShardInput } from './ShardInput-gx_DZXXn.js';
12
- import { L as Label } from './label-D8ykjn5J.js';
13
- import { T as Textarea } from './textarea-D3gaCU_-.js';
14
- import { useLunora } from '@lunora/react';
15
- import { c as cn } from './utils-B05Dmz_H.js';
16
-
17
- const useAdminSpec = function(inlineSpec, fetcher, classify) {
18
- const $ = c(10);
19
- let t0;
20
- if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
21
- t0 = {
22
- kind: "loading"
23
- };
24
- $[0] = t0;
25
- } else {
26
- t0 = $[0];
27
- }
28
- const [fetched, setFetched] = useState(t0);
29
- let t1;
30
- let t2;
31
- if ($[1] !== classify || $[2] !== fetcher || $[3] !== inlineSpec) {
32
- t1 = () => {
33
- if (inlineSpec !== void 0) {
34
- return;
35
- }
36
- let cancelled = false;
37
- fetcher().then((spec) => {
38
- if (!cancelled) {
39
- setFetched(classify(spec));
40
- }
41
- return spec;
42
- }).catch((error) => {
43
- if (!cancelled) {
44
- setFetched({
45
- kind: "error",
46
- message: errorMessage(error)
47
- });
48
- }
49
- });
50
- return () => {
51
- cancelled = true;
52
- };
53
- };
54
- t2 = [classify, fetcher, inlineSpec];
55
- $[1] = classify;
56
- $[2] = fetcher;
57
- $[3] = inlineSpec;
58
- $[4] = t1;
59
- $[5] = t2;
60
- } else {
61
- t1 = $[4];
62
- t2 = $[5];
63
- }
64
- useEffect(t1, t2);
65
- let t3;
66
- if ($[6] !== classify || $[7] !== fetched || $[8] !== inlineSpec) {
67
- t3 = inlineSpec === void 0 ? fetched : classify(inlineSpec);
68
- $[6] = classify;
69
- $[7] = fetched;
70
- $[8] = inlineSpec;
71
- $[9] = t3;
72
- } else {
73
- t3 = $[9];
74
- }
75
- return t3;
76
- };
77
-
78
- const scalarOf = (value) => {
79
- if (typeof value === "number") {
80
- return "number";
81
- }
82
- if (typeof value === "boolean") {
83
- return "boolean";
84
- }
85
- return "string";
86
- };
87
- const enumValues = (schema) => {
88
- if (schema.enum !== void 0 && schema.enum.length > 0) {
89
- return schema.enum;
90
- }
91
- if (schema.anyOf !== void 0 && schema.anyOf.length > 0 && schema.anyOf.every((member) => member.const !== void 0)) {
92
- return schema.anyOf.map((member) => member.const);
93
- }
94
- return void 0;
95
- };
96
- const typeLabel = (schema) => {
97
- if (schema === void 0) {
98
- return "any";
99
- }
100
- if (schema.const !== void 0) {
101
- return JSON.stringify(schema.const);
102
- }
103
- if (schema.enum !== void 0 && schema.enum.length > 0) {
104
- return schema.enum.map((value) => JSON.stringify(value)).join(" | ");
105
- }
106
- if (schema.anyOf !== void 0 && schema.anyOf.length > 0) {
107
- return schema.anyOf.map((member) => typeLabel(member)).join(" | ");
108
- }
109
- if (schema.type === "array") {
110
- return `array<${typeLabel(schema.items)}>`;
111
- }
112
- return schema.type ?? "any";
113
- };
114
- const fieldTypeLabel = (schema) => {
115
- const values = enumValues(schema);
116
- if (values !== void 0) {
117
- return schema.type ?? scalarOf(values[0]);
118
- }
119
- return typeLabel(schema);
120
- };
121
- const valueInText = (schema) => {
122
- const values = enumValues(schema);
123
- return values === void 0 ? void 0 : values.map((value) => JSON.stringify(value)).join(" | ");
124
- };
125
- const rangeText = (schema) => {
126
- const parts = [];
127
- if (schema.minimum !== void 0) {
128
- parts.push(`${String(schema.minimum)} ≤`);
129
- } else if (schema.exclusiveMinimum !== void 0) {
130
- parts.push(`${String(schema.exclusiveMinimum)} <`);
131
- }
132
- const hasLower = parts.length > 0;
133
- parts.push("value");
134
- if (schema.maximum !== void 0) {
135
- parts.push(`≤ ${String(schema.maximum)}`);
136
- } else if (schema.exclusiveMaximum !== void 0) {
137
- parts.push(`< ${String(schema.exclusiveMaximum)}`);
138
- }
139
- const hasUpper = parts.length > (hasLower ? 2 : 1);
140
- return hasLower || hasUpper ? parts.join(" ") : void 0;
141
- };
142
- const childObject = (schema) => {
143
- if (schema.type === "object" && schema.properties !== void 0) {
144
- return schema;
145
- }
146
- if (schema.type === "array" && schema.items?.type === "object" && schema.items.properties !== void 0) {
147
- return schema.items;
148
- }
149
- return void 0;
150
- };
151
- const exampleForSchema = (schema) => {
152
- if (schema === void 0) {
153
- return null;
154
- }
155
- if (schema.const !== void 0) {
156
- return schema.const;
157
- }
158
- if (schema.enum !== void 0 && schema.enum.length > 0) {
159
- return schema.enum[0];
160
- }
161
- if (schema.anyOf !== void 0 && schema.anyOf.length > 0) {
162
- return exampleForSchema(schema.anyOf[0]);
163
- }
164
- switch (schema.type) {
165
- case "array": {
166
- return [];
167
- }
168
- case "boolean": {
169
- return false;
170
- }
171
- case "number": {
172
- return 0;
173
- }
174
- case "object": {
175
- const out = {};
176
- for (const [key, child] of Object.entries(schema.properties ?? {})) {
177
- out[key] = exampleForSchema(child);
178
- }
179
- return out;
180
- }
181
- case "string": {
182
- return "";
183
- }
184
- default: {
185
- return null;
186
- }
187
- }
188
- };
189
- const Badge = (t0) => {
190
- const $ = c(7);
191
- const {
192
- label,
193
- value
194
- } = t0;
195
- let t1;
196
- if ($[0] !== label) {
197
- t1 = /* @__PURE__ */ jsxDEV("span", {
198
- className: "text-muted-foreground",
199
- children: label
200
- }, void 0, false);
201
- $[0] = label;
202
- $[1] = t1;
203
- } else {
204
- t1 = $[1];
205
- }
206
- let t2;
207
- if ($[2] !== value) {
208
- t2 = /* @__PURE__ */ jsxDEV("span", {
209
- className: "text-foreground",
210
- children: value
211
- }, void 0, false);
212
- $[2] = value;
213
- $[3] = t2;
214
- } else {
215
- t2 = $[3];
216
- }
217
- let t3;
218
- if ($[4] !== t1 || $[5] !== t2) {
219
- t3 = /* @__PURE__ */ jsxDEV("span", {
220
- className: "inline-flex items-center gap-1 rounded border border-border px-1.5 py-0.5 font-mono text-[10px]",
221
- children: [t1, t2]
222
- }, void 0, true);
223
- $[4] = t1;
224
- $[5] = t2;
225
- $[6] = t3;
226
- } else {
227
- t3 = $[6];
228
- }
229
- return t3;
230
- };
231
- const FieldRow = (t0) => {
232
- const $ = c(40);
233
- const {
234
- name,
235
- required,
236
- schema
237
- } = t0;
238
- const t = useT();
239
- let t1;
240
- if ($[0] !== schema) {
241
- t1 = rangeText(schema);
242
- $[0] = schema;
243
- $[1] = t1;
244
- } else {
245
- t1 = $[1];
246
- }
247
- const range = t1;
248
- let t2;
249
- if ($[2] !== schema) {
250
- t2 = valueInText(schema);
251
- $[2] = schema;
252
- $[3] = t2;
253
- } else {
254
- t2 = $[3];
255
- }
256
- const values = t2;
257
- const relation = schema["x-lunora-table"];
258
- const hasBadges = schema.format !== void 0 || range !== void 0 || values !== void 0 || relation !== void 0;
259
- let t3;
260
- if ($[4] !== schema) {
261
- t3 = childObject(schema);
262
- $[4] = schema;
263
- $[5] = t3;
264
- } else {
265
- t3 = $[5];
266
- }
267
- const nested = t3;
268
- const t4 = required ? "*" : "?";
269
- let t5;
270
- if ($[6] !== t4) {
271
- t5 = /* @__PURE__ */ jsxDEV("span", {
272
- className: "text-muted-foreground",
273
- children: t4
274
- }, void 0, false);
275
- $[6] = t4;
276
- $[7] = t5;
277
- } else {
278
- t5 = $[7];
279
- }
280
- let t6;
281
- if ($[8] !== name || $[9] !== t5) {
282
- t6 = /* @__PURE__ */ jsxDEV("span", {
283
- className: "font-mono text-foreground",
284
- children: [name, t5]
285
- }, void 0, true);
286
- $[8] = name;
287
- $[9] = t5;
288
- $[10] = t6;
289
- } else {
290
- t6 = $[10];
291
- }
292
- let t7;
293
- if ($[11] !== schema) {
294
- t7 = fieldTypeLabel(schema);
295
- $[11] = schema;
296
- $[12] = t7;
297
- } else {
298
- t7 = $[12];
299
- }
300
- let t8;
301
- if ($[13] !== t7) {
302
- t8 = /* @__PURE__ */ jsxDEV("span", {
303
- className: "font-mono text-muted-foreground",
304
- children: t7
305
- }, void 0, false);
306
- $[13] = t7;
307
- $[14] = t8;
308
- } else {
309
- t8 = $[14];
310
- }
311
- let t9;
312
- if ($[15] !== t6 || $[16] !== t8) {
313
- t9 = /* @__PURE__ */ jsxDEV("div", {
314
- className: "flex items-baseline gap-2",
315
- children: [t6, t8]
316
- }, void 0, true);
317
- $[15] = t6;
318
- $[16] = t8;
319
- $[17] = t9;
320
- } else {
321
- t9 = $[17];
322
- }
323
- let t10;
324
- if ($[18] !== schema.description) {
325
- t10 = schema.description !== void 0 && /* @__PURE__ */ jsxDEV("p", {
326
- className: "max-w-prose text-muted-foreground",
327
- children: schema.description
328
- }, void 0, false);
329
- $[18] = schema.description;
330
- $[19] = t10;
331
- } else {
332
- t10 = $[19];
333
- }
334
- let t11;
335
- if ($[20] !== hasBadges || $[21] !== range || $[22] !== relation || $[23] !== schema.format || $[24] !== t || $[25] !== values) {
336
- t11 = hasBadges && /* @__PURE__ */ jsxDEV("div", {
337
- className: "flex flex-wrap gap-1",
338
- children: [schema.format !== void 0 && /* @__PURE__ */ jsxDEV(Badge, {
339
- label: t("Format"),
340
- value: schema.format
341
- }, void 0, false), range !== void 0 && /* @__PURE__ */ jsxDEV(Badge, {
342
- label: t("Range"),
343
- value: range
344
- }, void 0, false), values !== void 0 && /* @__PURE__ */ jsxDEV(Badge, {
345
- label: t("Value in"),
346
- value: values
347
- }, void 0, false), relation !== void 0 && /* @__PURE__ */ jsxDEV(Badge, {
348
- label: t("relation"),
349
- value: relation
350
- }, void 0, false)]
351
- }, void 0, true);
352
- $[20] = hasBadges;
353
- $[21] = range;
354
- $[22] = relation;
355
- $[23] = schema.format;
356
- $[24] = t;
357
- $[25] = values;
358
- $[26] = t11;
359
- } else {
360
- t11 = $[26];
361
- }
362
- let t12;
363
- if ($[27] !== t10 || $[28] !== t11 || $[29] !== t9) {
364
- t12 = /* @__PURE__ */ jsxDEV("div", {
365
- className: "flex flex-col gap-1 py-2",
366
- children: [t9, t10, t11]
367
- }, void 0, true);
368
- $[27] = t10;
369
- $[28] = t11;
370
- $[29] = t9;
371
- $[30] = t12;
372
- } else {
373
- t12 = $[30];
374
- }
375
- const header = t12;
376
- if (nested === void 0) {
377
- let t132;
378
- if ($[31] !== header) {
379
- t132 = /* @__PURE__ */ jsxDEV("div", {
380
- className: "border-b border-border/50 last:border-b-0",
381
- children: header
382
- }, void 0, false);
383
- $[31] = header;
384
- $[32] = t132;
385
- } else {
386
- t132 = $[32];
387
- }
388
- return t132;
389
- }
390
- let t13;
391
- if ($[33] !== header) {
392
- t13 = /* @__PURE__ */ jsxDEV("summary", {
393
- className: "cursor-pointer marker:text-muted-foreground",
394
- children: header
395
- }, void 0, false);
396
- $[33] = header;
397
- $[34] = t13;
398
- } else {
399
- t13 = $[34];
400
- }
401
- let t14;
402
- if ($[35] !== nested) {
403
- t14 = /* @__PURE__ */ jsxDEV("div", {
404
- className: "mb-2 ml-2 border-l border-border pl-3",
405
- children: /* @__PURE__ */ jsxDEV(SchemaFields, {
406
- schema: nested
407
- }, void 0, false)
408
- }, void 0, false);
409
- $[35] = nested;
410
- $[36] = t14;
411
- } else {
412
- t14 = $[36];
413
- }
414
- let t15;
415
- if ($[37] !== t13 || $[38] !== t14) {
416
- t15 = /* @__PURE__ */ jsxDEV("details", {
417
- className: "border-b border-border/50 last:border-b-0",
418
- children: [t13, t14]
419
- }, void 0, true);
420
- $[37] = t13;
421
- $[38] = t14;
422
- $[39] = t15;
423
- } else {
424
- t15 = $[39];
425
- }
426
- return t15;
427
- };
428
- const SchemaFields = (t0) => {
429
- const $ = c(7);
430
- const {
431
- schema
432
- } = t0;
433
- let t1;
434
- if ($[0] !== schema.required) {
435
- t1 = new Set(schema.required);
436
- $[0] = schema.required;
437
- $[1] = t1;
438
- } else {
439
- t1 = $[1];
440
- }
441
- const required = t1;
442
- let t2;
443
- if ($[2] !== schema.properties) {
444
- t2 = Object.entries(schema.properties ?? {});
445
- $[2] = schema.properties;
446
- $[3] = t2;
447
- } else {
448
- t2 = $[3];
449
- }
450
- const rows = t2;
451
- let t3;
452
- if ($[4] !== required || $[5] !== rows) {
453
- t3 = /* @__PURE__ */ jsxDEV("div", {
454
- className: "flex flex-col",
455
- children: rows.map((t4) => {
456
- const [name, child] = t4;
457
- return /* @__PURE__ */ jsxDEV(FieldRow, {
458
- name,
459
- required: required.has(name),
460
- schema: child
461
- }, name, false);
462
- })
463
- }, void 0, false);
464
- $[4] = required;
465
- $[5] = rows;
466
- $[6] = t3;
467
- } else {
468
- t3 = $[6];
469
- }
470
- return t3;
471
- };
472
- const SchemaTable = (t0) => {
473
- const $ = c(10);
474
- const {
475
- schema,
476
- testId
477
- } = t0;
478
- if (schema?.type !== "object" || Object.keys(schema.properties ?? {}).length === 0) {
479
- let t12;
480
- if ($[0] !== schema) {
481
- t12 = typeLabel(schema);
482
- $[0] = schema;
483
- $[1] = t12;
484
- } else {
485
- t12 = $[1];
486
- }
487
- let t22;
488
- if ($[2] !== t12 || $[3] !== testId) {
489
- t22 = /* @__PURE__ */ jsxDEV("p", {
490
- className: "font-mono text-xs text-muted-foreground",
491
- "data-testid": testId,
492
- children: t12
493
- }, void 0, false);
494
- $[2] = t12;
495
- $[3] = testId;
496
- $[4] = t22;
497
- } else {
498
- t22 = $[4];
499
- }
500
- return t22;
501
- }
502
- let t1;
503
- if ($[5] !== schema) {
504
- t1 = /* @__PURE__ */ jsxDEV(SchemaFields, {
505
- schema
506
- }, void 0, false);
507
- $[5] = schema;
508
- $[6] = t1;
509
- } else {
510
- t1 = $[6];
511
- }
512
- let t2;
513
- if ($[7] !== t1 || $[8] !== testId) {
514
- t2 = /* @__PURE__ */ jsxDEV("div", {
515
- className: "text-xs",
516
- "data-testid": testId,
517
- children: t1
518
- }, void 0, false);
519
- $[7] = t1;
520
- $[8] = testId;
521
- $[9] = t2;
522
- } else {
523
- t2 = $[9];
524
- }
525
- return t2;
526
- };
527
-
528
- const SAMPLE_ORDER = ["curl", "javascript", "lunora"];
529
- const SAMPLE_LABEL = {
530
- lunora: "Lunora",
531
- curl: "cURL",
532
- javascript: "JavaScript"
533
- };
534
- const apiReferenceOf = (functionPath) => `api.${functionPath.replaceAll(/[/:]/g, ".")}`;
535
- const requestBody = (operation) => {
536
- const args = exampleForSchema(operation.argsSchema) ?? {};
537
- return operation.functionPath === void 0 ? args : {
538
- args,
539
- functionPath: operation.functionPath
540
- };
541
- };
542
- const sampleSource = (sample, operation, server) => {
543
- const url = `${server}${operation.httpPath}`;
544
- const body = JSON.stringify(requestBody(operation), void 0, 2);
545
- const args = JSON.stringify(exampleForSchema(operation.argsSchema) ?? {}, void 0, 2);
546
- switch (sample) {
547
- case "curl": {
548
- const hasBody = operation.method !== "GET" && operation.method !== "HEAD";
549
- const lines = [`curl -X ${operation.method} ${JSON.stringify(url)}`];
550
- if (hasBody) {
551
- lines.push(` -H "Content-Type: application/json"`, ` -d '${body}'`);
552
- }
553
- return lines.join(" \\\n");
554
- }
555
- case "lunora": {
556
- if (operation.functionPath === void 0) {
557
- return `await fetch(${JSON.stringify(operation.httpPath)}, { method: ${JSON.stringify(operation.method)} });`;
558
- }
559
- const method = operation.kind ?? "query";
560
- return `import { useLunora } from "@lunora/react";
561
- import { api } from "./_generated/api";
562
-
563
- const client = useLunora();
564
- await client.${method}(${apiReferenceOf(operation.functionPath)}, ${args});`;
565
- }
566
- default: {
567
- const hasBody = operation.method !== "GET" && operation.method !== "HEAD";
568
- const init = hasBody ? `{
569
- method: ${JSON.stringify(operation.method)},
570
- headers: { "Content-Type": "application/json" },
571
- body: JSON.stringify(${body}),
572
- }` : `{ method: ${JSON.stringify(operation.method)} }`;
573
- return `const response = await fetch(${JSON.stringify(url)}, ${init});
574
- const data = await response.json();`;
575
- }
576
- }
577
- };
578
- const CodeSamples = (t0) => {
579
- const $ = c(24);
580
- const {
581
- operation,
582
- server
583
- } = t0;
584
- const t = useT();
585
- const [sample, setSample] = useState("curl");
586
- let t1;
587
- if ($[0] !== operation || $[1] !== sample || $[2] !== server) {
588
- t1 = sampleSource(sample, operation, server);
589
- $[0] = operation;
590
- $[1] = sample;
591
- $[2] = server;
592
- $[3] = t1;
593
- } else {
594
- t1 = $[3];
595
- }
596
- const source = t1;
597
- let t2;
598
- if ($[4] !== source) {
599
- t2 = () => {
600
- copyToClipboard(source);
601
- };
602
- $[4] = source;
603
- $[5] = t2;
604
- } else {
605
- t2 = $[5];
606
- }
607
- const onCopy = t2;
608
- let t3;
609
- if ($[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
610
- t3 = (event) => {
611
- setSample(event.currentTarget.dataset.sample);
612
- };
613
- $[6] = t3;
614
- } else {
615
- t3 = $[6];
616
- }
617
- const onSelect = t3;
618
- let t4;
619
- if ($[7] !== sample) {
620
- t4 = SAMPLE_ORDER.map((key) => /* @__PURE__ */ jsxDEV("button", {
621
- "aria-selected": sample === key,
622
- className: "rounded px-2 py-0.5 text-xs text-muted-foreground transition-colors hover:text-foreground aria-selected:bg-muted aria-selected:font-medium aria-selected:text-foreground",
623
- "data-sample": key,
624
- "data-testid": `api-sample-${key}`,
625
- onClick: onSelect,
626
- role: "tab",
627
- type: "button",
628
- children: SAMPLE_LABEL[key]
629
- }, key, false));
630
- $[7] = sample;
631
- $[8] = t4;
632
- } else {
633
- t4 = $[8];
634
- }
635
- let t5;
636
- if ($[9] !== t4) {
637
- t5 = /* @__PURE__ */ jsxDEV("div", {
638
- className: "flex gap-1",
639
- role: "tablist",
640
- children: t4
641
- }, void 0, false);
642
- $[9] = t4;
643
- $[10] = t5;
644
- } else {
645
- t5 = $[10];
646
- }
647
- let t6;
648
- if ($[11] !== t) {
649
- t6 = t("Copy");
650
- $[11] = t;
651
- $[12] = t6;
652
- } else {
653
- t6 = $[12];
654
- }
655
- let t7;
656
- if ($[13] !== onCopy || $[14] !== t6) {
657
- t7 = /* @__PURE__ */ jsxDEV(Button, {
658
- "data-testid": "api-sample-copy",
659
- onClick: onCopy,
660
- size: "xs",
661
- type: "button",
662
- variant: "ghost",
663
- children: t6
664
- }, void 0, false);
665
- $[13] = onCopy;
666
- $[14] = t6;
667
- $[15] = t7;
668
- } else {
669
- t7 = $[15];
670
- }
671
- let t8;
672
- if ($[16] !== t5 || $[17] !== t7) {
673
- t8 = /* @__PURE__ */ jsxDEV("div", {
674
- className: "flex items-center justify-between gap-2 border-b border-border px-3 py-2",
675
- children: [t5, t7]
676
- }, void 0, true);
677
- $[16] = t5;
678
- $[17] = t7;
679
- $[18] = t8;
680
- } else {
681
- t8 = $[18];
682
- }
683
- let t9;
684
- if ($[19] !== source) {
685
- t9 = /* @__PURE__ */ jsxDEV("pre", {
686
- className: "overflow-auto px-3 pb-3 font-mono text-xs",
687
- "data-testid": "api-sample-source",
688
- children: source
689
- }, void 0, false);
690
- $[19] = source;
691
- $[20] = t9;
692
- } else {
693
- t9 = $[20];
694
- }
695
- let t10;
696
- if ($[21] !== t8 || $[22] !== t9) {
697
- t10 = /* @__PURE__ */ jsxDEV("div", {
698
- className: "flex flex-col gap-2 rounded-xl border border-border bg-card",
699
- "data-testid": "api-code-samples",
700
- children: [t8, t9]
701
- }, void 0, true);
702
- $[21] = t8;
703
- $[22] = t9;
704
- $[23] = t10;
705
- } else {
706
- t10 = $[23];
707
- }
708
- return t10;
709
- };
710
-
711
- const TONE_CLASS = {
712
- blue: "text-info",
713
- emerald: "text-success",
714
- neutral: "text-muted-foreground",
715
- orange: "text-warning",
716
- red: "text-destructive",
717
- violet: "text-royal-amethyst"
718
- };
719
- const methodTone = (method) => {
720
- switch (method.toUpperCase()) {
721
- case "DELETE": {
722
- return "red";
723
- }
724
- case "GET": {
725
- return "emerald";
726
- }
727
- case "PATCH": {
728
- return "orange";
729
- }
730
- case "POST": {
731
- return "blue";
732
- }
733
- case "PUT": {
734
- return "orange";
735
- }
736
- default: {
737
- return "neutral";
738
- }
739
- }
740
- };
741
- const kindTone = (kind) => {
742
- switch (kind) {
743
- case "action": {
744
- return "violet";
745
- }
746
- case "mutation": {
747
- return "orange";
748
- }
749
- case "query": {
750
- return "emerald";
751
- }
752
- default: {
753
- return "neutral";
754
- }
755
- }
756
- };
757
- const MethodBadge = (t0) => {
758
- const $ = c(7);
759
- const {
760
- kind,
761
- method,
762
- testId
763
- } = t0;
764
- let t1;
765
- if ($[0] !== kind || $[1] !== method) {
766
- t1 = kind ?? method.toUpperCase();
767
- $[0] = kind;
768
- $[1] = method;
769
- $[2] = t1;
770
- } else {
771
- t1 = $[2];
772
- }
773
- const label = t1;
774
- const tone = kind === void 0 ? methodTone(method) : kindTone(kind);
775
- const t2 = `${TONE_CLASS[tone]} font-mono text-[10px] tracking-wide uppercase`;
776
- let t3;
777
- if ($[3] !== label || $[4] !== t2 || $[5] !== testId) {
778
- t3 = /* @__PURE__ */ jsxDEV(Badge$1, {
779
- className: t2,
780
- "data-testid": testId,
781
- variant: "ghost",
782
- children: label
783
- }, void 0, false);
784
- $[3] = label;
785
- $[4] = t2;
786
- $[5] = testId;
787
- $[6] = t3;
788
- } else {
789
- t3 = $[6];
790
- }
791
- return t3;
792
- };
793
-
794
- const statusToneClass = (status) => {
795
- if (status.startsWith("2")) {
796
- return "text-emerald-600 dark:text-emerald-400";
797
- }
798
- if (status === "default" || status.startsWith("4") || status.startsWith("5")) {
799
- return "text-red-600 dark:text-red-400";
800
- }
801
- return "text-muted-foreground";
802
- };
803
- const statusDotClass = (status) => {
804
- if (status.startsWith("2")) {
805
- return "bg-emerald-500";
806
- }
807
- if (status === "default" || status.startsWith("4") || status.startsWith("5")) {
808
- return "bg-red-500";
809
- }
810
- return "bg-muted-foreground";
811
- };
812
-
813
- const seedArgs = (operation) => JSON.stringify(exampleForSchema(operation.argsSchema) ?? {}, void 0, 2);
814
- const OperationRunContext = /* @__PURE__ */ createContext(null);
815
- const useOperationRun = () => {
816
- const value = use(OperationRunContext);
817
- if (value === null) {
818
- throw new Error("useOperationRun must be used within an OperationRunProvider");
819
- }
820
- return value;
821
- };
822
- const OperationRunProvider = ({
823
- children,
824
- operation
825
- }) => {
826
- const t = useT();
827
- const client = useLunora();
828
- const [argsText, setArgsText] = useState(() => seedArgs(operation));
829
- const [shardKey, setShardKey] = useState("");
830
- const [status, setStatus] = useState("idle");
831
- const [response, setResponse] = useState(void 0);
832
- const [error, setError] = useState(null);
833
- const [durationMs, setDurationMs] = useState(null);
834
- const send = async () => {
835
- let parsedArgs;
836
- try {
837
- parsedArgs = argsText.trim() === "" ? {} : JSON.parse(argsText);
838
- } catch (parseError) {
839
- setStatus("error");
840
- setResponse(void 0);
841
- setDurationMs(null);
842
- setError(t("Invalid JSON args: {message}", {
843
- message: errorMessage(parseError)
844
- }));
845
- return;
846
- }
847
- setStatus("running");
848
- setError(null);
849
- const startedAt = performance.now();
850
- try {
851
- let value;
852
- if (operation.functionPath === void 0) {
853
- const hasBody = operation.method !== "GET" && operation.method !== "HEAD";
854
- const fetchResponse = await fetch(operation.httpPath, {
855
- body: hasBody ? JSON.stringify(parsedArgs) : void 0,
856
- headers: hasBody ? {
857
- "content-type": "application/json"
858
- } : void 0,
859
- method: operation.method
860
- });
861
- const text = await fetchResponse.text();
862
- try {
863
- value = JSON.parse(text);
864
- } catch {
865
- value = text;
866
- }
867
- } else {
868
- const reference = adminRef(operation.functionPath);
869
- const options = callOptions(shardKey);
870
- switch (operation.kind) {
871
- case "action": {
872
- value = await client.action(reference, parsedArgs, options);
873
- break;
874
- }
875
- case "mutation": {
876
- value = await client.mutation(reference, parsedArgs, options);
877
- break;
878
- }
879
- default: {
880
- value = await client.query(reference, parsedArgs, options);
881
- }
882
- }
883
- }
884
- setResponse(value);
885
- setDurationMs(Math.round(performance.now() - startedAt));
886
- setStatus("success");
887
- } catch (runError) {
888
- setResponse(void 0);
889
- setDurationMs(Math.round(performance.now() - startedAt));
890
- setError(errorMessage(runError));
891
- setStatus("error");
892
- }
893
- };
894
- const onSend = () => {
895
- fireAndForget(send());
896
- };
897
- const value_0 = {
898
- argsText,
899
- durationMs,
900
- error,
901
- operation,
902
- response,
903
- send: onSend,
904
- setArgsText,
905
- setShardKey,
906
- shardKey,
907
- status
908
- };
909
- return /* @__PURE__ */ jsxDEV(OperationRunContext, {
910
- value: value_0,
911
- children
912
- }, void 0, false);
913
- };
914
-
915
- const TryIt = () => {
916
- const $ = c(48);
917
- const t = useT();
918
- const {
919
- argsText,
920
- operation,
921
- send,
922
- setArgsText,
923
- setShardKey,
924
- shardKey,
925
- status
926
- } = useOperationRun();
927
- let t0;
928
- if ($[0] !== setArgsText) {
929
- t0 = (event) => {
930
- setArgsText(event.target.value);
931
- };
932
- $[0] = setArgsText;
933
- $[1] = t0;
934
- } else {
935
- t0 = $[1];
936
- }
937
- const onArgsChange = t0;
938
- let t1;
939
- if ($[2] !== send) {
940
- t1 = (event_0) => {
941
- if (event_0.key === "Enter" && (event_0.metaKey || event_0.ctrlKey)) {
942
- event_0.preventDefault();
943
- send();
944
- }
945
- };
946
- $[2] = send;
947
- $[3] = t1;
948
- } else {
949
- t1 = $[3];
950
- }
951
- const onArgsKeyDown = t1;
952
- const running = status === "running";
953
- let t2;
954
- if ($[4] !== operation.kind || $[5] !== operation.method) {
955
- t2 = /* @__PURE__ */ jsxDEV(MethodBadge, {
956
- kind: operation.kind,
957
- method: operation.method,
958
- testId: "api-try-method"
959
- }, void 0, false);
960
- $[4] = operation.kind;
961
- $[5] = operation.method;
962
- $[6] = t2;
963
- } else {
964
- t2 = $[6];
965
- }
966
- const t3 = operation.functionPath ?? operation.httpPath;
967
- let t4;
968
- if ($[7] !== t3) {
969
- t4 = /* @__PURE__ */ jsxDEV("code", {
970
- className: "min-w-0 flex-1 truncate font-mono text-xs text-foreground",
971
- children: t3
972
- }, void 0, false);
973
- $[7] = t3;
974
- $[8] = t4;
975
- } else {
976
- t4 = $[8];
977
- }
978
- const t5 = running ? "animate-pulse" : void 0;
979
- let t6;
980
- if ($[9] !== t5) {
981
- t6 = /* @__PURE__ */ jsxDEV(HugeiconsIcon, {
982
- className: t5,
983
- icon: SentIcon,
984
- strokeWidth: 2
985
- }, void 0, false);
986
- $[9] = t5;
987
- $[10] = t6;
988
- } else {
989
- t6 = $[10];
990
- }
991
- let t7;
992
- if ($[11] !== running || $[12] !== t) {
993
- t7 = running ? t("Sending…") : t("Send");
994
- $[11] = running;
995
- $[12] = t;
996
- $[13] = t7;
997
- } else {
998
- t7 = $[13];
999
- }
1000
- let t8;
1001
- if ($[14] !== running || $[15] !== send || $[16] !== t6 || $[17] !== t7) {
1002
- t8 = /* @__PURE__ */ jsxDEV(Button, {
1003
- "data-testid": "api-try-send",
1004
- disabled: running,
1005
- onClick: send,
1006
- size: "sm",
1007
- type: "button",
1008
- children: [t6, t7]
1009
- }, void 0, true);
1010
- $[14] = running;
1011
- $[15] = send;
1012
- $[16] = t6;
1013
- $[17] = t7;
1014
- $[18] = t8;
1015
- } else {
1016
- t8 = $[18];
1017
- }
1018
- let t9;
1019
- if ($[19] !== t2 || $[20] !== t4 || $[21] !== t8) {
1020
- t9 = /* @__PURE__ */ jsxDEV("div", {
1021
- className: "flex items-center gap-2 border-b border-border bg-muted px-3 py-2",
1022
- children: [t2, t4, t8]
1023
- }, void 0, true);
1024
- $[19] = t2;
1025
- $[20] = t4;
1026
- $[21] = t8;
1027
- $[22] = t9;
1028
- } else {
1029
- t9 = $[22];
1030
- }
1031
- let t10;
1032
- if ($[23] !== t) {
1033
- t10 = t("Arguments (JSON)");
1034
- $[23] = t;
1035
- $[24] = t10;
1036
- } else {
1037
- t10 = $[24];
1038
- }
1039
- let t11;
1040
- if ($[25] !== t10) {
1041
- t11 = /* @__PURE__ */ jsxDEV(Label, {
1042
- htmlFor: "api-try-args",
1043
- children: t10
1044
- }, void 0, false);
1045
- $[25] = t10;
1046
- $[26] = t11;
1047
- } else {
1048
- t11 = $[26];
1049
- }
1050
- let t12;
1051
- if ($[27] !== argsText) {
1052
- t12 = argsText.split("\n");
1053
- $[27] = argsText;
1054
- $[28] = t12;
1055
- } else {
1056
- t12 = $[28];
1057
- }
1058
- const t13 = Math.min(12, Math.max(3, t12.length));
1059
- let t14;
1060
- if ($[29] !== argsText || $[30] !== onArgsChange || $[31] !== onArgsKeyDown || $[32] !== t13) {
1061
- t14 = /* @__PURE__ */ jsxDEV(Textarea, {
1062
- className: "font-mono text-xs",
1063
- "data-testid": "api-try-args",
1064
- id: "api-try-args",
1065
- onChange: onArgsChange,
1066
- onKeyDown: onArgsKeyDown,
1067
- rows: t13,
1068
- spellCheck: false,
1069
- value: argsText
1070
- }, void 0, false);
1071
- $[29] = argsText;
1072
- $[30] = onArgsChange;
1073
- $[31] = onArgsKeyDown;
1074
- $[32] = t13;
1075
- $[33] = t14;
1076
- } else {
1077
- t14 = $[33];
1078
- }
1079
- let t15;
1080
- if ($[34] !== t11 || $[35] !== t14) {
1081
- t15 = /* @__PURE__ */ jsxDEV("div", {
1082
- className: "flex flex-col gap-1.5",
1083
- children: [t11, t14]
1084
- }, void 0, true);
1085
- $[34] = t11;
1086
- $[35] = t14;
1087
- $[36] = t15;
1088
- } else {
1089
- t15 = $[36];
1090
- }
1091
- let t16;
1092
- if ($[37] !== operation.functionPath || $[38] !== setShardKey || $[39] !== shardKey || $[40] !== t) {
1093
- t16 = operation.functionPath !== void 0 && /* @__PURE__ */ jsxDEV("div", {
1094
- className: "flex flex-col gap-1.5",
1095
- children: [/* @__PURE__ */ jsxDEV(Label, {
1096
- htmlFor: "shard-input",
1097
- children: t("Shard key (optional)")
1098
- }, void 0, false), /* @__PURE__ */ jsxDEV(ShardInput, {
1099
- id: "shard-input",
1100
- onChange: setShardKey,
1101
- testId: "shard-input",
1102
- value: shardKey
1103
- }, void 0, false)]
1104
- }, void 0, true);
1105
- $[37] = operation.functionPath;
1106
- $[38] = setShardKey;
1107
- $[39] = shardKey;
1108
- $[40] = t;
1109
- $[41] = t16;
1110
- } else {
1111
- t16 = $[41];
1112
- }
1113
- let t17;
1114
- if ($[42] !== t15 || $[43] !== t16) {
1115
- t17 = /* @__PURE__ */ jsxDEV("div", {
1116
- className: "flex flex-col gap-3 p-3",
1117
- children: [t15, t16]
1118
- }, void 0, true);
1119
- $[42] = t15;
1120
- $[43] = t16;
1121
- $[44] = t17;
1122
- } else {
1123
- t17 = $[44];
1124
- }
1125
- let t18;
1126
- if ($[45] !== t17 || $[46] !== t9) {
1127
- t18 = /* @__PURE__ */ jsxDEV("div", {
1128
- className: "overflow-hidden rounded-xl border border-border bg-card",
1129
- "data-testid": "api-try-it",
1130
- children: [t9, t17]
1131
- }, void 0, true);
1132
- $[45] = t17;
1133
- $[46] = t9;
1134
- $[47] = t18;
1135
- } else {
1136
- t18 = $[47];
1137
- }
1138
- return t18;
1139
- };
1140
-
1141
- const OperationView = (t0) => {
1142
- const $ = c(51);
1143
- const {
1144
- operation
1145
- } = t0;
1146
- const t = useT();
1147
- const t1 = `api-operation-${operation.operationId}`;
1148
- const t2 = operation.key;
1149
- let t3;
1150
- if ($[0] !== operation.kind || $[1] !== operation.method) {
1151
- t3 = /* @__PURE__ */ jsxDEV(MethodBadge, {
1152
- kind: operation.kind,
1153
- method: operation.method,
1154
- testId: "api-operation-method"
1155
- }, void 0, false);
1156
- $[0] = operation.kind;
1157
- $[1] = operation.method;
1158
- $[2] = t3;
1159
- } else {
1160
- t3 = $[2];
1161
- }
1162
- const t4 = operation.functionPath ?? operation.httpPath;
1163
- let t5;
1164
- if ($[3] !== t4) {
1165
- t5 = /* @__PURE__ */ jsxDEV("code", {
1166
- className: "truncate font-mono text-xs text-muted-foreground",
1167
- children: t4
1168
- }, void 0, false);
1169
- $[3] = t4;
1170
- $[4] = t5;
1171
- } else {
1172
- t5 = $[4];
1173
- }
1174
- let t6;
1175
- if ($[5] !== t3 || $[6] !== t5) {
1176
- t6 = /* @__PURE__ */ jsxDEV("div", {
1177
- className: "flex items-center gap-2",
1178
- children: [t3, t5]
1179
- }, void 0, true);
1180
- $[5] = t3;
1181
- $[6] = t5;
1182
- $[7] = t6;
1183
- } else {
1184
- t6 = $[7];
1185
- }
1186
- let t7;
1187
- if ($[8] !== operation.title) {
1188
- t7 = /* @__PURE__ */ jsxDEV("h1", {
1189
- className: "text-lg font-semibold text-foreground",
1190
- "data-testid": "api-operation-title",
1191
- children: operation.title
1192
- }, void 0, false);
1193
- $[8] = operation.title;
1194
- $[9] = t7;
1195
- } else {
1196
- t7 = $[9];
1197
- }
1198
- let t8;
1199
- if ($[10] !== operation.description) {
1200
- t8 = operation.description !== void 0 && /* @__PURE__ */ jsxDEV("p", {
1201
- className: "text-sm text-muted-foreground",
1202
- children: operation.description
1203
- }, void 0, false);
1204
- $[10] = operation.description;
1205
- $[11] = t8;
1206
- } else {
1207
- t8 = $[11];
1208
- }
1209
- let t9;
1210
- if ($[12] !== t6 || $[13] !== t7 || $[14] !== t8) {
1211
- t9 = /* @__PURE__ */ jsxDEV("header", {
1212
- className: "sticky top-0 z-10 -mx-6 -mt-6 flex flex-col gap-2 border-b border-border bg-background px-6 pt-6 pb-3",
1213
- children: [t6, t7, t8]
1214
- }, void 0, true);
1215
- $[12] = t6;
1216
- $[13] = t7;
1217
- $[14] = t8;
1218
- $[15] = t9;
1219
- } else {
1220
- t9 = $[15];
1221
- }
1222
- let t10;
1223
- if ($[16] !== t) {
1224
- t10 = t("Try it");
1225
- $[16] = t;
1226
- $[17] = t10;
1227
- } else {
1228
- t10 = $[17];
1229
- }
1230
- let t11;
1231
- if ($[18] !== t10) {
1232
- t11 = /* @__PURE__ */ jsxDEV("h2", {
1233
- className: "font-mono text-[11px] tracking-wide text-muted-foreground uppercase",
1234
- children: t10
1235
- }, void 0, false);
1236
- $[18] = t10;
1237
- $[19] = t11;
1238
- } else {
1239
- t11 = $[19];
1240
- }
1241
- let t12;
1242
- if ($[20] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
1243
- t12 = /* @__PURE__ */ jsxDEV(TryIt, {}, void 0, false);
1244
- $[20] = t12;
1245
- } else {
1246
- t12 = $[20];
1247
- }
1248
- let t13;
1249
- if ($[21] !== t11) {
1250
- t13 = /* @__PURE__ */ jsxDEV("section", {
1251
- className: "flex flex-col gap-2",
1252
- children: [t11, t12]
1253
- }, void 0, true);
1254
- $[21] = t11;
1255
- $[22] = t13;
1256
- } else {
1257
- t13 = $[22];
1258
- }
1259
- let t14;
1260
- if ($[23] !== t) {
1261
- t14 = t("Request arguments");
1262
- $[23] = t;
1263
- $[24] = t14;
1264
- } else {
1265
- t14 = $[24];
1266
- }
1267
- let t15;
1268
- if ($[25] !== t14) {
1269
- t15 = /* @__PURE__ */ jsxDEV("h2", {
1270
- className: "font-mono text-[11px] tracking-wide text-muted-foreground uppercase",
1271
- children: t14
1272
- }, void 0, false);
1273
- $[25] = t14;
1274
- $[26] = t15;
1275
- } else {
1276
- t15 = $[26];
1277
- }
1278
- let t16;
1279
- if ($[27] !== operation.argsSchema) {
1280
- t16 = /* @__PURE__ */ jsxDEV(SchemaTable, {
1281
- schema: operation.argsSchema,
1282
- testId: "api-operation-args"
1283
- }, void 0, false);
1284
- $[27] = operation.argsSchema;
1285
- $[28] = t16;
1286
- } else {
1287
- t16 = $[28];
1288
- }
1289
- let t17;
1290
- if ($[29] !== t15 || $[30] !== t16) {
1291
- t17 = /* @__PURE__ */ jsxDEV("section", {
1292
- className: "flex flex-col gap-2",
1293
- children: [t15, t16]
1294
- }, void 0, true);
1295
- $[29] = t15;
1296
- $[30] = t16;
1297
- $[31] = t17;
1298
- } else {
1299
- t17 = $[31];
1300
- }
1301
- let t18;
1302
- if ($[32] !== t) {
1303
- t18 = t("Response body");
1304
- $[32] = t;
1305
- $[33] = t18;
1306
- } else {
1307
- t18 = $[33];
1308
- }
1309
- let t19;
1310
- if ($[34] !== t18) {
1311
- t19 = /* @__PURE__ */ jsxDEV("h2", {
1312
- className: "font-mono text-[11px] tracking-wide text-muted-foreground uppercase",
1313
- children: t18
1314
- }, void 0, false);
1315
- $[34] = t18;
1316
- $[35] = t19;
1317
- } else {
1318
- t19 = $[35];
1319
- }
1320
- let t20;
1321
- if ($[36] !== operation.responses || $[37] !== t) {
1322
- let t212;
1323
- if ($[39] !== t) {
1324
- t212 = (response) => /* @__PURE__ */ jsxDEV("div", {
1325
- className: "flex flex-col gap-1.5 rounded-xl border border-border bg-card p-3",
1326
- children: [/* @__PURE__ */ jsxDEV("div", {
1327
- className: "flex items-center justify-between gap-2",
1328
- children: [/* @__PURE__ */ jsxDEV("span", {
1329
- className: `inline-flex items-center gap-1.5 font-mono text-xs font-semibold ${statusToneClass(response.status)}`,
1330
- children: [/* @__PURE__ */ jsxDEV("span", {
1331
- className: `size-1.5 rounded-full ${statusDotClass(response.status)}`
1332
- }, void 0, false), response.status]
1333
- }, void 0, true), response.schema !== void 0 && /* @__PURE__ */ jsxDEV("span", {
1334
- className: "rounded border border-border px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground",
1335
- children: t("application/json")
1336
- }, void 0, false)]
1337
- }, void 0, true), response.description !== void 0 && /* @__PURE__ */ jsxDEV("p", {
1338
- className: "text-xs text-muted-foreground",
1339
- children: response.description
1340
- }, void 0, false), response.schema !== void 0 && /* @__PURE__ */ jsxDEV(SchemaTable, {
1341
- schema: response.schema,
1342
- testId: `api-response-${response.status}`
1343
- }, void 0, false)]
1344
- }, response.status, true);
1345
- $[39] = t;
1346
- $[40] = t212;
1347
- } else {
1348
- t212 = $[40];
1349
- }
1350
- t20 = operation.responses.map(t212);
1351
- $[36] = operation.responses;
1352
- $[37] = t;
1353
- $[38] = t20;
1354
- } else {
1355
- t20 = $[38];
1356
- }
1357
- let t21;
1358
- if ($[41] !== t19 || $[42] !== t20) {
1359
- t21 = /* @__PURE__ */ jsxDEV("section", {
1360
- className: "flex flex-col gap-3",
1361
- children: [t19, t20]
1362
- }, void 0, true);
1363
- $[41] = t19;
1364
- $[42] = t20;
1365
- $[43] = t21;
1366
- } else {
1367
- t21 = $[43];
1368
- }
1369
- let t22;
1370
- if ($[44] !== operation.key || $[45] !== t1 || $[46] !== t13 || $[47] !== t17 || $[48] !== t21 || $[49] !== t9) {
1371
- t22 = /* @__PURE__ */ jsxDEV("div", {
1372
- className: "flex flex-col gap-6 duration-200 animate-in fade-in-0 slide-in-from-bottom-1",
1373
- "data-testid": t1,
1374
- children: [t9, t13, t17, t21]
1375
- }, t2, true);
1376
- $[44] = operation.key;
1377
- $[45] = t1;
1378
- $[46] = t13;
1379
- $[47] = t17;
1380
- $[48] = t21;
1381
- $[49] = t9;
1382
- $[50] = t22;
1383
- } else {
1384
- t22 = $[50];
1385
- }
1386
- return t22;
1387
- };
1388
-
1389
- const KIND_CLASS = {
1390
- boolean: "text-royal-amethyst",
1391
- key: "text-sky-sapphire",
1392
- number: "text-warning",
1393
- plain: "",
1394
- string: "text-success"
1395
- };
1396
- const TOKEN = /"(?:[^"\\]|\\.)*"|\b(?:true|false|null)\b|-?\d+(?:\.\d+)?/g;
1397
- const COLON_AHEAD = /^\s*:/;
1398
- const classify = (code, end, text) => {
1399
- if (text.startsWith('"')) {
1400
- return COLON_AHEAD.test(code.slice(end)) ? "key" : "string";
1401
- }
1402
- if (text === "true" || text === "false" || text === "null") {
1403
- return "boolean";
1404
- }
1405
- return "number";
1406
- };
1407
- const tokenize = (code) => {
1408
- const tokens = [];
1409
- let lastIndex = 0;
1410
- for (const match of code.matchAll(TOKEN)) {
1411
- const {
1412
- index
1413
- } = match;
1414
- const text = match[0];
1415
- const end = index + text.length;
1416
- if (index > lastIndex) {
1417
- tokens.push({
1418
- kind: "plain",
1419
- start: lastIndex,
1420
- text: code.slice(lastIndex, index)
1421
- });
1422
- }
1423
- tokens.push({
1424
- kind: classify(code, end, text),
1425
- start: index,
1426
- text
1427
- });
1428
- lastIndex = end;
1429
- }
1430
- if (lastIndex < code.length) {
1431
- tokens.push({
1432
- kind: "plain",
1433
- start: lastIndex,
1434
- text: code.slice(lastIndex)
1435
- });
1436
- }
1437
- return tokens;
1438
- };
1439
- const JsonHighlight = (t0) => {
1440
- const $ = c(4);
1441
- const {
1442
- code
1443
- } = t0;
1444
- let t1;
1445
- if ($[0] !== code) {
1446
- const tokens = tokenize(code);
1447
- t1 = tokens.map(_temp$1);
1448
- $[0] = code;
1449
- $[1] = t1;
1450
- } else {
1451
- t1 = $[1];
1452
- }
1453
- let t2;
1454
- if ($[2] !== t1) {
1455
- t2 = /* @__PURE__ */ jsxDEV(Fragment, {
1456
- children: t1
1457
- }, void 0, false);
1458
- $[2] = t1;
1459
- $[3] = t2;
1460
- } else {
1461
- t2 = $[3];
1462
- }
1463
- return t2;
1464
- };
1465
- function _temp$1(token) {
1466
- return /* @__PURE__ */ jsxDEV("span", {
1467
- className: KIND_CLASS[token.kind],
1468
- children: token.text
1469
- }, token.start, false);
1470
- }
1471
-
1472
- const LIVE_TAB = "__live__";
1473
- const exampleBody = (response) => response.schema === void 0 ? "" : JSON.stringify(exampleForSchema(response.schema), void 0, 2);
1474
- const liveBody = (error, response, failed) => {
1475
- if (failed) {
1476
- return error ?? "";
1477
- }
1478
- return response === void 0 ? "" : JSON.stringify(response, void 0, 2);
1479
- };
1480
- const ResponseBody = (t0) => {
1481
- const $ = c(18);
1482
- const {
1483
- active,
1484
- running,
1485
- showError
1486
- } = t0;
1487
- const t = useT();
1488
- if (running) {
1489
- let t12;
1490
- if ($[0] !== t) {
1491
- t12 = t("Sending…");
1492
- $[0] = t;
1493
- $[1] = t12;
1494
- } else {
1495
- t12 = $[1];
1496
- }
1497
- let t22;
1498
- if ($[2] !== t12) {
1499
- t22 = /* @__PURE__ */ jsxDEV("p", {
1500
- className: "px-3 py-3 text-xs text-muted-foreground",
1501
- "data-testid": "api-response-running",
1502
- children: t12
1503
- }, void 0, false);
1504
- $[2] = t12;
1505
- $[3] = t22;
1506
- } else {
1507
- t22 = $[3];
1508
- }
1509
- return t22;
1510
- }
1511
- if (active === void 0 || active.body === "") {
1512
- let t12;
1513
- if ($[4] !== active?.live || $[5] !== t) {
1514
- t12 = active?.live === true ? t("Send a request to see the response.") : t("No example for this response.");
1515
- $[4] = active?.live;
1516
- $[5] = t;
1517
- $[6] = t12;
1518
- } else {
1519
- t12 = $[6];
1520
- }
1521
- let t22;
1522
- if ($[7] !== t12) {
1523
- t22 = /* @__PURE__ */ jsxDEV("p", {
1524
- className: "px-3 py-3 text-xs text-muted-foreground",
1525
- "data-testid": "api-response-idle",
1526
- children: t12
1527
- }, void 0, false);
1528
- $[7] = t12;
1529
- $[8] = t22;
1530
- } else {
1531
- t22 = $[8];
1532
- }
1533
- return t22;
1534
- }
1535
- const t1 = showError && "text-destructive";
1536
- let t2;
1537
- if ($[9] !== t1) {
1538
- t2 = cn("max-h-[28rem] overflow-auto px-3 py-3 font-mono text-xs", t1);
1539
- $[9] = t1;
1540
- $[10] = t2;
1541
- } else {
1542
- t2 = $[10];
1543
- }
1544
- const t3 = showError ? "api-response-error" : "api-response-body";
1545
- let t4;
1546
- if ($[11] !== active.body || $[12] !== showError) {
1547
- t4 = showError ? active.body : /* @__PURE__ */ jsxDEV(JsonHighlight, {
1548
- code: active.body
1549
- }, void 0, false);
1550
- $[11] = active.body;
1551
- $[12] = showError;
1552
- $[13] = t4;
1553
- } else {
1554
- t4 = $[13];
1555
- }
1556
- let t5;
1557
- if ($[14] !== t2 || $[15] !== t3 || $[16] !== t4) {
1558
- t5 = /* @__PURE__ */ jsxDEV("pre", {
1559
- className: t2,
1560
- "data-testid": t3,
1561
- children: t4
1562
- }, void 0, false);
1563
- $[14] = t2;
1564
- $[15] = t3;
1565
- $[16] = t4;
1566
- $[17] = t5;
1567
- } else {
1568
- t5 = $[17];
1569
- }
1570
- return t5;
1571
- };
1572
- const ResponsePanel = () => {
1573
- const $ = c(67);
1574
- const t = useT();
1575
- const {
1576
- durationMs,
1577
- error,
1578
- operation,
1579
- response,
1580
- status
1581
- } = useOperationRun();
1582
- const running = status === "running";
1583
- const failed = status === "error";
1584
- const ran = status === "success" || failed;
1585
- let t0;
1586
- if ($[0] !== durationMs || $[1] !== error || $[2] !== failed || $[3] !== operation.responses || $[4] !== ran || $[5] !== response || $[6] !== t) {
1587
- bb0: {
1588
- const documented = operation.responses.map(_temp);
1589
- if (!ran) {
1590
- t0 = documented;
1591
- break bb0;
1592
- }
1593
- let t14;
1594
- if ($[8] !== error || $[9] !== failed || $[10] !== response) {
1595
- t14 = liveBody(error, response, failed);
1596
- $[8] = error;
1597
- $[9] = failed;
1598
- $[10] = response;
1599
- $[11] = t14;
1600
- } else {
1601
- t14 = $[11];
1602
- }
1603
- let t22;
1604
- if ($[12] !== t) {
1605
- t22 = t("Live");
1606
- $[12] = t;
1607
- $[13] = t22;
1608
- } else {
1609
- t22 = $[13];
1610
- }
1611
- const t32 = failed ? "error" : "200";
1612
- let t42;
1613
- if ($[14] !== durationMs || $[15] !== t14 || $[16] !== t22 || $[17] !== t32) {
1614
- t42 = {
1615
- body: t14,
1616
- durationMs,
1617
- id: LIVE_TAB,
1618
- label: t22,
1619
- live: true,
1620
- status: t32
1621
- };
1622
- $[14] = durationMs;
1623
- $[15] = t14;
1624
- $[16] = t22;
1625
- $[17] = t32;
1626
- $[18] = t42;
1627
- } else {
1628
- t42 = $[18];
1629
- }
1630
- const live = t42;
1631
- t0 = [live, ...documented];
1632
- }
1633
- $[0] = durationMs;
1634
- $[1] = error;
1635
- $[2] = failed;
1636
- $[3] = operation.responses;
1637
- $[4] = ran;
1638
- $[5] = response;
1639
- $[6] = t;
1640
- $[7] = t0;
1641
- } else {
1642
- t0 = $[7];
1643
- }
1644
- const tabs = t0;
1645
- let t1;
1646
- if ($[19] !== ran || $[20] !== tabs) {
1647
- t1 = ran ? LIVE_TAB : tabs.find(_temp2)?.id ?? tabs[0]?.id ?? "";
1648
- $[19] = ran;
1649
- $[20] = tabs;
1650
- $[21] = t1;
1651
- } else {
1652
- t1 = $[21];
1653
- }
1654
- const defaultId = t1;
1655
- const [picked, setPicked] = useState(null);
1656
- let active;
1657
- let onCopy;
1658
- let onSelect;
1659
- let showError;
1660
- let t2;
1661
- let t3;
1662
- let t4;
1663
- let t5;
1664
- let t6;
1665
- let t7;
1666
- if ($[22] !== defaultId || $[23] !== picked || $[24] !== t || $[25] !== tabs) {
1667
- active = tabs.find((tab_0) => tab_0.id === (picked ?? defaultId)) ?? tabs[0];
1668
- let t82;
1669
- if ($[36] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
1670
- t82 = (event) => {
1671
- const {
1672
- id
1673
- } = event.currentTarget.dataset;
1674
- if (id !== void 0) {
1675
- setPicked(id);
1676
- }
1677
- };
1678
- $[36] = t82;
1679
- } else {
1680
- t82 = $[36];
1681
- }
1682
- onSelect = t82;
1683
- onCopy = () => {
1684
- if (active !== void 0) {
1685
- copyToClipboard(active.body);
1686
- }
1687
- };
1688
- const liveDurationMs = active?.live === true ? active.durationMs : null;
1689
- showError = active?.live === true && active.status === "error";
1690
- t6 = "flex min-h-0 flex-col rounded-xl border border-border bg-card";
1691
- t7 = "api-response-panel";
1692
- t4 = "flex items-center justify-between gap-2 border-b border-border px-3 py-2";
1693
- let t92;
1694
- if ($[37] !== t) {
1695
- t92 = t("Response");
1696
- $[37] = t;
1697
- $[38] = t92;
1698
- } else {
1699
- t92 = $[38];
1700
- }
1701
- if ($[39] !== t92) {
1702
- t5 = /* @__PURE__ */ jsxDEV("span", {
1703
- className: "font-mono text-[11px] tracking-wide text-muted-foreground uppercase",
1704
- children: t92
1705
- }, void 0, false);
1706
- $[39] = t92;
1707
- $[40] = t5;
1708
- } else {
1709
- t5 = $[40];
1710
- }
1711
- t2 = "flex items-center gap-2";
1712
- t3 = liveDurationMs !== null && /* @__PURE__ */ jsxDEV("span", {
1713
- className: "font-mono text-[10px] text-muted-foreground",
1714
- children: t("{ms} ms", {
1715
- ms: liveDurationMs
1716
- })
1717
- }, void 0, false);
1718
- $[22] = defaultId;
1719
- $[23] = picked;
1720
- $[24] = t;
1721
- $[25] = tabs;
1722
- $[26] = active;
1723
- $[27] = onCopy;
1724
- $[28] = onSelect;
1725
- $[29] = showError;
1726
- $[30] = t2;
1727
- $[31] = t3;
1728
- $[32] = t4;
1729
- $[33] = t5;
1730
- $[34] = t6;
1731
- $[35] = t7;
1732
- } else {
1733
- active = $[26];
1734
- onCopy = $[27];
1735
- onSelect = $[28];
1736
- showError = $[29];
1737
- t2 = $[30];
1738
- t3 = $[31];
1739
- t4 = $[32];
1740
- t5 = $[33];
1741
- t6 = $[34];
1742
- t7 = $[35];
1743
- }
1744
- let t8;
1745
- if ($[41] !== active || $[42] !== onCopy || $[43] !== t) {
1746
- t8 = active !== void 0 && active.body !== "" && /* @__PURE__ */ jsxDEV(Button, {
1747
- "aria-label": t("Copy"),
1748
- "data-testid": "api-response-copy",
1749
- onClick: onCopy,
1750
- size: "icon-xs",
1751
- type: "button",
1752
- variant: "ghost",
1753
- children: /* @__PURE__ */ jsxDEV(HugeiconsIcon, {
1754
- icon: Copy01Icon,
1755
- strokeWidth: 2
1756
- }, void 0, false)
1757
- }, void 0, false);
1758
- $[41] = active;
1759
- $[42] = onCopy;
1760
- $[43] = t;
1761
- $[44] = t8;
1762
- } else {
1763
- t8 = $[44];
1764
- }
1765
- let t9;
1766
- if ($[45] !== t2 || $[46] !== t3 || $[47] !== t8) {
1767
- t9 = /* @__PURE__ */ jsxDEV("div", {
1768
- className: t2,
1769
- children: [t3, t8]
1770
- }, void 0, true);
1771
- $[45] = t2;
1772
- $[46] = t3;
1773
- $[47] = t8;
1774
- $[48] = t9;
1775
- } else {
1776
- t9 = $[48];
1777
- }
1778
- let t10;
1779
- if ($[49] !== t4 || $[50] !== t5 || $[51] !== t9) {
1780
- t10 = /* @__PURE__ */ jsxDEV("div", {
1781
- className: t4,
1782
- children: [t5, t9]
1783
- }, void 0, true);
1784
- $[49] = t4;
1785
- $[50] = t5;
1786
- $[51] = t9;
1787
- $[52] = t10;
1788
- } else {
1789
- t10 = $[52];
1790
- }
1791
- let t11;
1792
- if ($[53] !== active?.id || $[54] !== onSelect || $[55] !== tabs) {
1793
- t11 = tabs.length > 0 && /* @__PURE__ */ jsxDEV("div", {
1794
- className: "flex gap-1 overflow-x-auto border-b border-border px-2 py-1.5",
1795
- role: "tablist",
1796
- children: tabs.map((tab_1) => {
1797
- const selected = tab_1.id === active?.id;
1798
- return /* @__PURE__ */ jsxDEV("button", {
1799
- "aria-selected": selected,
1800
- className: cn("inline-flex items-center gap-1.5 rounded px-2 py-0.5 font-mono text-xs transition-colors hover:text-foreground aria-selected:bg-muted aria-selected:font-medium", selected ? statusToneClass(tab_1.status) : "text-muted-foreground"),
1801
- "data-id": tab_1.id,
1802
- "data-testid": tab_1.live ? "api-response-tab-live" : `api-response-tab-${tab_1.status}`,
1803
- onClick: onSelect,
1804
- role: "tab",
1805
- type: "button",
1806
- children: [/* @__PURE__ */ jsxDEV("span", {
1807
- className: `size-1.5 rounded-full ${statusDotClass(tab_1.status)}`
1808
- }, void 0, false), tab_1.label]
1809
- }, tab_1.id, true);
1810
- })
1811
- }, void 0, false);
1812
- $[53] = active?.id;
1813
- $[54] = onSelect;
1814
- $[55] = tabs;
1815
- $[56] = t11;
1816
- } else {
1817
- t11 = $[56];
1818
- }
1819
- let t12;
1820
- if ($[57] !== active || $[58] !== running || $[59] !== showError) {
1821
- t12 = /* @__PURE__ */ jsxDEV(ResponseBody, {
1822
- active,
1823
- running,
1824
- showError
1825
- }, void 0, false);
1826
- $[57] = active;
1827
- $[58] = running;
1828
- $[59] = showError;
1829
- $[60] = t12;
1830
- } else {
1831
- t12 = $[60];
1832
- }
1833
- let t13;
1834
- if ($[61] !== t10 || $[62] !== t11 || $[63] !== t12 || $[64] !== t6 || $[65] !== t7) {
1835
- t13 = /* @__PURE__ */ jsxDEV("div", {
1836
- className: t6,
1837
- "data-testid": t7,
1838
- children: [t10, t11, t12]
1839
- }, void 0, true);
1840
- $[61] = t10;
1841
- $[62] = t11;
1842
- $[63] = t12;
1843
- $[64] = t6;
1844
- $[65] = t7;
1845
- $[66] = t13;
1846
- } else {
1847
- t13 = $[66];
1848
- }
1849
- return t13;
1850
- };
1851
- function _temp(entry) {
1852
- return {
1853
- body: exampleBody(entry),
1854
- durationMs: null,
1855
- id: entry.status,
1856
- label: entry.status,
1857
- live: false,
1858
- status: entry.status
1859
- };
1860
- }
1861
- function _temp2(tab) {
1862
- return tab.status.startsWith("2");
1863
- }
1864
-
1865
- const filterGroups = (groups, query) => {
1866
- const needle = query.trim().toLowerCase();
1867
- if (needle === "") {
1868
- return groups;
1869
- }
1870
- return groups.map((group) => {
1871
- return {
1872
- ...group,
1873
- operations: group.operations.filter((operation) => `${operation.summary} ${operation.operationId}`.toLowerCase().includes(needle))
1874
- };
1875
- }).filter((group) => group.operations.length > 0);
1876
- };
1877
- const ReferenceView = (t0) => {
1878
- const $ = c(53);
1879
- const {
1880
- model
1881
- } = t0;
1882
- const t = useT();
1883
- const firstKey = model.groups[0]?.operations[0]?.key ?? "";
1884
- const [selectedKey, setSelectedKey] = useState(firstKey);
1885
- const [filter, setFilter] = useState("");
1886
- let t1;
1887
- if ($[0] !== firstKey || $[1] !== model.operationByKey || $[2] !== selectedKey) {
1888
- t1 = model.operationByKey.get(selectedKey) ?? model.operationByKey.get(firstKey);
1889
- $[0] = firstKey;
1890
- $[1] = model.operationByKey;
1891
- $[2] = selectedKey;
1892
- $[3] = t1;
1893
- } else {
1894
- t1 = $[3];
1895
- }
1896
- const selected = t1;
1897
- let groups;
1898
- let server;
1899
- let t2;
1900
- let t3;
1901
- let t4;
1902
- let t5;
1903
- let t6;
1904
- let t7;
1905
- let t8;
1906
- let t9;
1907
- if ($[4] !== filter || $[5] !== model.groups || $[6] !== model.server || $[7] !== selected?.key || $[8] !== t) {
1908
- groups = filterGroups(model.groups, filter);
1909
- let t102;
1910
- if ($[19] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
1911
- t102 = (event) => {
1912
- const {
1913
- key
1914
- } = event.currentTarget.dataset;
1915
- if (key !== void 0) {
1916
- setSelectedKey(key);
1917
- }
1918
- };
1919
- $[19] = t102;
1920
- } else {
1921
- t102 = $[19];
1922
- }
1923
- const onSelect = t102;
1924
- let t112;
1925
- if ($[20] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
1926
- t112 = (event_0) => {
1927
- setFilter(event_0.target.value);
1928
- };
1929
- $[20] = t112;
1930
- } else {
1931
- t112 = $[20];
1932
- }
1933
- const onFilterChange = t112;
1934
- server = model.server ?? "";
1935
- t8 = "grid min-h-0 flex-1 grid-cols-1 overflow-hidden lg:grid-cols-[16rem_minmax(0,1fr)_22rem]";
1936
- t9 = "api-reference";
1937
- if ($[21] !== t) {
1938
- t4 = t("API operations");
1939
- $[21] = t;
1940
- $[22] = t4;
1941
- } else {
1942
- t4 = $[22];
1943
- }
1944
- t5 = "flex min-h-0 flex-col overflow-y-auto border-r border-border";
1945
- t6 = "api-reference-nav";
1946
- let t122;
1947
- if ($[23] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
1948
- t122 = /* @__PURE__ */ jsxDEV(HugeiconsIcon, {
1949
- className: "pointer-events-none absolute top-1/2 left-2 size-3.5 -translate-y-1/2 text-muted-foreground",
1950
- icon: Search01Icon,
1951
- strokeWidth: 2
1952
- }, void 0, false);
1953
- $[23] = t122;
1954
- } else {
1955
- t122 = $[23];
1956
- }
1957
- let t132;
1958
- if ($[24] !== t) {
1959
- t132 = t("Filter operations");
1960
- $[24] = t;
1961
- $[25] = t132;
1962
- } else {
1963
- t132 = $[25];
1964
- }
1965
- if ($[26] !== filter || $[27] !== t132) {
1966
- t7 = /* @__PURE__ */ jsxDEV("div", {
1967
- className: "sticky top-0 z-10 border-b border-border bg-sidebar p-2",
1968
- children: /* @__PURE__ */ jsxDEV("div", {
1969
- className: "relative",
1970
- children: [t122, /* @__PURE__ */ jsxDEV(Input, {
1971
- className: "h-7 pl-7",
1972
- "data-testid": "api-filter",
1973
- onChange: onFilterChange,
1974
- placeholder: t132,
1975
- value: filter
1976
- }, void 0, false)]
1977
- }, void 0, true)
1978
- }, void 0, false);
1979
- $[26] = filter;
1980
- $[27] = t132;
1981
- $[28] = t7;
1982
- } else {
1983
- t7 = $[28];
1984
- }
1985
- t2 = "flex flex-col gap-4 p-2";
1986
- let t142;
1987
- if ($[29] !== selected?.key || $[30] !== t) {
1988
- t142 = (group) => /* @__PURE__ */ jsxDEV("div", {
1989
- className: "flex flex-col gap-1",
1990
- children: [/* @__PURE__ */ jsxDEV("div", {
1991
- className: "flex items-center justify-between px-2",
1992
- children: [/* @__PURE__ */ jsxDEV("span", {
1993
- className: "font-mono text-[11px] tracking-wide text-muted-foreground uppercase",
1994
- children: group.name || t("(root)")
1995
- }, void 0, false), /* @__PURE__ */ jsxDEV("span", {
1996
- className: "font-mono text-[10px] text-muted-foreground/70",
1997
- children: group.operations.length
1998
- }, void 0, false)]
1999
- }, void 0, true), group.operations.map((operation) => {
2000
- const active = operation.key === selected?.key;
2001
- return /* @__PURE__ */ jsxDEV("button", {
2002
- "aria-current": active ? "page" : void 0,
2003
- className: "flex items-center justify-between gap-2 rounded-md border-l-2 border-transparent px-2 py-1 text-start text-xs text-muted-foreground transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground aria-[current=page]:border-primary aria-[current=page]:bg-sidebar-accent aria-[current=page]:font-medium aria-[current=page]:text-foreground",
2004
- "data-key": operation.key,
2005
- "data-testid": `api-nav-${operation.operationId}`,
2006
- onClick: onSelect,
2007
- type: "button",
2008
- children: [/* @__PURE__ */ jsxDEV("span", {
2009
- className: "truncate",
2010
- children: operation.summary
2011
- }, void 0, false), /* @__PURE__ */ jsxDEV(MethodBadge, {
2012
- kind: operation.kind,
2013
- method: operation.method
2014
- }, void 0, false)]
2015
- }, operation.key, true);
2016
- })]
2017
- }, group.name, true);
2018
- $[29] = selected?.key;
2019
- $[30] = t;
2020
- $[31] = t142;
2021
- } else {
2022
- t142 = $[31];
2023
- }
2024
- t3 = groups.map(t142);
2025
- $[4] = filter;
2026
- $[5] = model.groups;
2027
- $[6] = model.server;
2028
- $[7] = selected?.key;
2029
- $[8] = t;
2030
- $[9] = groups;
2031
- $[10] = server;
2032
- $[11] = t2;
2033
- $[12] = t3;
2034
- $[13] = t4;
2035
- $[14] = t5;
2036
- $[15] = t6;
2037
- $[16] = t7;
2038
- $[17] = t8;
2039
- $[18] = t9;
2040
- } else {
2041
- groups = $[9];
2042
- server = $[10];
2043
- t2 = $[11];
2044
- t3 = $[12];
2045
- t4 = $[13];
2046
- t5 = $[14];
2047
- t6 = $[15];
2048
- t7 = $[16];
2049
- t8 = $[17];
2050
- t9 = $[18];
2051
- }
2052
- let t10;
2053
- if ($[32] !== groups.length || $[33] !== t) {
2054
- t10 = groups.length === 0 && /* @__PURE__ */ jsxDEV("p", {
2055
- className: "px-2 py-1 text-xs text-muted-foreground",
2056
- "data-testid": "api-nav-empty",
2057
- children: t("No operations match your filter.")
2058
- }, void 0, false);
2059
- $[32] = groups.length;
2060
- $[33] = t;
2061
- $[34] = t10;
2062
- } else {
2063
- t10 = $[34];
2064
- }
2065
- let t11;
2066
- if ($[35] !== t10 || $[36] !== t2 || $[37] !== t3) {
2067
- t11 = /* @__PURE__ */ jsxDEV("div", {
2068
- className: t2,
2069
- children: [t3, t10]
2070
- }, void 0, true);
2071
- $[35] = t10;
2072
- $[36] = t2;
2073
- $[37] = t3;
2074
- $[38] = t11;
2075
- } else {
2076
- t11 = $[38];
2077
- }
2078
- let t12;
2079
- if ($[39] !== t11 || $[40] !== t4 || $[41] !== t5 || $[42] !== t6 || $[43] !== t7) {
2080
- t12 = /* @__PURE__ */ jsxDEV("nav", {
2081
- "aria-label": t4,
2082
- className: t5,
2083
- "data-testid": t6,
2084
- children: [t7, t11]
2085
- }, void 0, true);
2086
- $[39] = t11;
2087
- $[40] = t4;
2088
- $[41] = t5;
2089
- $[42] = t6;
2090
- $[43] = t7;
2091
- $[44] = t12;
2092
- } else {
2093
- t12 = $[44];
2094
- }
2095
- let t13;
2096
- if ($[45] !== selected || $[46] !== server) {
2097
- t13 = selected === void 0 ? /* @__PURE__ */ jsxDEV("div", {
2098
- className: "lg:col-span-2"
2099
- }, void 0, false) : /* @__PURE__ */ jsxDEV(OperationRunProvider, {
2100
- operation: selected,
2101
- children: [/* @__PURE__ */ jsxDEV("div", {
2102
- className: "min-w-0 overflow-y-auto p-6",
2103
- "data-testid": "api-reference-main",
2104
- children: /* @__PURE__ */ jsxDEV(OperationView, {
2105
- operation: selected
2106
- }, void 0, false)
2107
- }, void 0, false), /* @__PURE__ */ jsxDEV("aside", {
2108
- className: "flex min-w-0 flex-col gap-4 overflow-y-auto border-border p-4 lg:border-l",
2109
- "data-testid": "api-reference-aside",
2110
- children: [/* @__PURE__ */ jsxDEV(CodeSamples, {
2111
- operation: selected,
2112
- server
2113
- }, void 0, false), /* @__PURE__ */ jsxDEV(ResponsePanel, {}, void 0, false)]
2114
- }, void 0, true)]
2115
- }, selected.key, true);
2116
- $[45] = selected;
2117
- $[46] = server;
2118
- $[47] = t13;
2119
- } else {
2120
- t13 = $[47];
2121
- }
2122
- let t14;
2123
- if ($[48] !== t12 || $[49] !== t13 || $[50] !== t8 || $[51] !== t9) {
2124
- t14 = /* @__PURE__ */ jsxDEV("div", {
2125
- className: t8,
2126
- "data-testid": t9,
2127
- children: [t12, t13]
2128
- }, void 0, true);
2129
- $[48] = t12;
2130
- $[49] = t13;
2131
- $[50] = t8;
2132
- $[51] = t9;
2133
- $[52] = t14;
2134
- } else {
2135
- t14 = $[52];
2136
- }
2137
- return t14;
2138
- };
2139
-
2140
- export { ReferenceView as R, useAdminSpec as u };