@hot-updater/console 1.0.0-rc.0 → 1.0.0-rc.2

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 (203) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/assets/HashValueDisplay-CB0Eskit.js +1 -0
  3. package/.output/public/assets/InsightsPageHeader-Car5LNiZ.js +1 -0
  4. package/.output/public/assets/api-keys-BzKocqRy.js +1 -0
  5. package/.output/public/assets/api-keys-api-BHcODB7q.js +1 -0
  6. package/.output/public/assets/card-Dhr_eFYj.js +1 -0
  7. package/.output/public/assets/{chart-no-axes-combined-FaYMGmQS.js → chart-no-axes-combined-Dy4WJv2U.js} +1 -1
  8. package/.output/public/assets/composite-Bp98A0Ld.js +1 -0
  9. package/.output/public/assets/createServerFn-CA8fs7QD.js +3 -0
  10. package/.output/public/assets/dialog-CUTrcPlB.js +1 -0
  11. package/.output/public/assets/{dist-DspNKfMj.js → dist-C_NydL0e.js} +1 -1
  12. package/.output/public/assets/index-DdAz-CXv.js +10 -0
  13. package/.output/public/assets/input-group-cSOG4wh_.js +1 -0
  14. package/.output/public/assets/insights-C0PBSZ-n.js +1 -0
  15. package/.output/public/assets/installations-CE33wgbY.js +2 -0
  16. package/.output/public/assets/installations-CStZja8x.js +1 -0
  17. package/.output/public/assets/lazyRouteComponent-Ccp3bwBY.js +1 -0
  18. package/.output/public/assets/link-CI8idAUi.js +1 -0
  19. package/.output/public/assets/loader-circle-BoxLrsOu.js +1 -0
  20. package/.output/public/assets/refresh-cw-Bqc72UZG.js +1 -0
  21. package/.output/public/assets/{routes-DcQnVajO.js → routes-DGVXdzpw.js} +2 -2
  22. package/.output/public/assets/routes-DTlwOr8I.js +1 -0
  23. package/.output/public/assets/{shield-check-DE_hVuHu.js → shield-check-uK3MHWJZ.js} +1 -1
  24. package/.output/public/assets/signing-CMf4aqDO.js +1 -0
  25. package/.output/public/assets/styles-BCvbtKsm.css +2 -0
  26. package/.output/public/assets/table-2vcV89QB.js +1 -0
  27. package/.output/public/assets/useCompositeListItem-CHLITE_4.js +1 -0
  28. package/.output/public/assets/x-DCd0j8c6.js +1 -0
  29. package/.output/server/{__23tanstack-start-server-fn-resolver-DBP9TQ7K.mjs → __23tanstack-start-server-fn-resolver-B7ioJhtE.mjs} +44 -52
  30. package/.output/server/_libs/@base-ui/react+[...].mjs +1906 -4040
  31. package/.output/server/_libs/@tanstack/react-router+[...].mjs +52 -4
  32. package/.output/server/_libs/@tanstack/react-router-ssr-query+[...].mjs +2 -2
  33. package/.output/server/_libs/lucide-react.mjs +36 -3
  34. package/.output/server/_libs/next-themes.mjs +2 -2
  35. package/.output/server/_libs/sonner.mjs +2 -2
  36. package/.output/server/_libs/tanstack__react-query.mjs +2 -2
  37. package/.output/server/_libs/verkit.mjs +20 -15
  38. package/.output/server/_runtime.mjs +1 -10
  39. package/.output/server/_ssr/HashValueDisplay-DwpGLfrl.mjs +55 -0
  40. package/.output/server/_ssr/InsightsPageHeader-Df4Brj8u.mjs +484 -0
  41. package/.output/server/_ssr/{api-keys-BnM_o2nS.mjs → api-keys-CZeTPQys.mjs} +11 -13
  42. package/.output/server/_ssr/{api-keys-api-CIywsSF5.mjs → api-keys-api-BUPQVSpk.mjs} +2 -2
  43. package/.output/server/_ssr/{api-keys-rpc-BSp1wkIV.mjs → api-keys-rpc-Cs7tS5_j.mjs} +5 -5
  44. package/.output/server/_ssr/{api-rpc-cG5wd_tO.mjs → api-rpc-tAupfGQm.mjs} +73 -142
  45. package/.output/server/_ssr/{auth-rpc-BrJ6obHJ.mjs → auth-rpc-DUaeOWKK.mjs} +4 -4
  46. package/.output/server/_ssr/{auth.server-DwKoZoQM.mjs → auth.server-DW71WzsD.mjs} +2 -5
  47. package/.output/server/_ssr/{bundle-signing-rpc-COoQhW8E.mjs → bundle-signing-rpc-BhnBw0-d.mjs} +2 -2
  48. package/.output/server/_ssr/bundle-signing.server-C4NW5mWx.mjs +12 -0
  49. package/.output/server/_ssr/{alert-Dim3MGY5.mjs → card-BRiPmi0C.mjs} +61 -39
  50. package/.output/server/_ssr/{config.server-DEiLhKmy.mjs → config.server-afDuAwaG.mjs} +15 -8
  51. package/.output/server/_ssr/{createSsrRpc-9P0S0lJ3.mjs → createSsrRpc-DjWNJ0uc.mjs} +6 -6
  52. package/.output/server/_ssr/databaseJsonValue-d6I3nAS4.mjs +45 -0
  53. package/.output/server/_ssr/{databaseRows-CwbNwYSl.mjs → databaseRows-5bCRTxm-.mjs} +4 -44
  54. package/.output/server/_ssr/{deleteBundle-Cu_XOMt0.mjs → deleteBundle-BTGwBgzx.mjs} +2 -2
  55. package/.output/server/_ssr/{dialog-CQuRMNZ4.mjs → dialog-DS-nw-pA.mjs} +2 -2
  56. package/.output/server/_ssr/{dist-BVSLTpoP.mjs → dist-CyzPaI5v.mjs} +2 -2
  57. package/.output/server/_ssr/{getBundleChildren-BcRMFoDF.mjs → getBundleChildren-C0vh4ZvE.mjs} +2 -2
  58. package/.output/server/_ssr/input-group-BpsnmvZw.mjs +70 -0
  59. package/.output/server/_ssr/insights-BdS364Xu.mjs +460 -0
  60. package/.output/server/_ssr/insights-rpc-38DujK0G.mjs +57 -0
  61. package/.output/server/_ssr/insightsContract-fjJDBeEE.mjs +303 -0
  62. package/.output/server/_ssr/installations-CtA59MQG.mjs +29 -0
  63. package/.output/server/_ssr/installations-DiVKEF5T.mjs +627 -0
  64. package/.output/server/_ssr/{router-C-KUBfOi.mjs → router-B9wG_9f8.mjs} +37 -46
  65. package/.output/server/_ssr/{routes-Z7TwC6nC.mjs → routes-CKrrS2q2.mjs} +3 -3
  66. package/.output/server/_ssr/{routes-BM4ht9jb.mjs → routes-D7Yh_jfj.mjs} +402 -390
  67. package/.output/server/_ssr/runtime.server-DacU1TBV.mjs +438 -0
  68. package/.output/server/_ssr/{server-BjzmvXnO.mjs → server-D_C2rMzf.mjs} +5 -5
  69. package/.output/server/_ssr/{signing-k8GxyBDF.mjs → signing-Dz1WkZOf.mjs} +16 -85
  70. package/.output/server/_ssr/ssr.mjs +1 -1
  71. package/.output/server/_ssr/{field-DRIXKjZG.mjs → table-CnZmon_Z.mjs} +51 -5
  72. package/.output/server/_ssr/{uuidv7-BbJ-9D_I.mjs → uuidv7-D0QFkPL_.mjs} +3 -3
  73. package/.output/server/_tanstack-start-manifest_v-2MjTyxil.mjs +97 -0
  74. package/.output/server/index.mjs +168 -203
  75. package/lib/index.d.mts +4 -4
  76. package/lib/vite-internal.mjs +1 -1
  77. package/lib/vite.d.mts +0 -1
  78. package/package.json +8 -8
  79. package/src/components/AppSidebar.tsx +12 -16
  80. package/src/components/ConsoleAccessPage.tsx +1 -1
  81. package/src/components/HashValueDisplay.tsx +11 -2
  82. package/src/components/features/api-keys/ApiKeysPage.tsx +1 -1
  83. package/src/components/features/bundles/BundleChildrenPanel.tsx +7 -6
  84. package/src/components/features/bundles/BundleMetadata.tsx +1 -20
  85. package/src/components/features/channels/ChannelManagementDialog.tsx +1 -1
  86. package/src/components/features/insights/EventDetails.tsx +151 -0
  87. package/src/components/features/insights/EventHistoryCard.tsx +245 -0
  88. package/src/components/features/insights/EventHistoryList.tsx +63 -0
  89. package/src/components/features/insights/InsightsBundleReports.tsx +51 -0
  90. package/src/components/features/insights/InsightsControls.tsx +121 -0
  91. package/src/components/features/{analytics/AnalyticsErrorAlert.tsx → insights/InsightsErrorAlert.tsx} +6 -6
  92. package/src/components/features/insights/InsightsOverview.tsx +203 -0
  93. package/src/components/features/insights/InsightsPageHeader.tsx +48 -0
  94. package/src/components/features/insights/InsightsPagination.tsx +52 -0
  95. package/src/components/features/insights/InstallationHistoryCard.tsx +250 -0
  96. package/src/components/features/insights/InstallationMatchesCard.tsx +178 -0
  97. package/src/components/features/insights/InstallationPageHeader.tsx +90 -0
  98. package/src/components/features/releases/ReleaseEditorSheet.tsx +24 -24
  99. package/src/components/features/signing/BundleSigningPage.tsx +18 -126
  100. package/src/components/ui/badge.tsx +2 -0
  101. package/src/components/ui/combobox.tsx +1 -0
  102. package/src/components/ui/skeleton.tsx +4 -1
  103. package/src/components/ui/tooltip.tsx +1 -1
  104. package/src/index.ts +7 -3
  105. package/src/lib/api-rpc.ts +19 -90
  106. package/src/lib/api.ts +0 -99
  107. package/src/lib/insights-api.ts +100 -0
  108. package/src/lib/insights-rpc.ts +88 -0
  109. package/src/lib/insights-view.ts +15 -0
  110. package/src/lib/public-bundle-error.ts +19 -0
  111. package/src/lib/server/bundle-signing.server.ts +5 -82
  112. package/src/lib/server/console-runtime.server.ts +0 -9
  113. package/src/lib/server/releaseReachability.ts +1 -4
  114. package/src/lib/server/runtime.server.ts +6 -142
  115. package/src/routeTree.gen.ts +21 -21
  116. package/src/router.tsx +3 -0
  117. package/src/routes/-installations-search.ts +25 -12
  118. package/src/routes/__root.tsx +6 -16
  119. package/src/routes/api-keys.tsx +1 -1
  120. package/src/routes/index.tsx +21 -81
  121. package/src/routes/insights.tsx +84 -0
  122. package/src/routes/installations.tsx +294 -142
  123. package/src/styles.css +6 -0
  124. package/.output/public/assets/AnalyticsCapabilityContext-BCke57-7.js +0 -1
  125. package/.output/public/assets/BundleActivityChart-CnsBe_1J.js +0 -42
  126. package/.output/public/assets/BundleIdDisplay-Dky75zLU.js +0 -1
  127. package/.output/public/assets/alert-C-1KvDW8.js +0 -1
  128. package/.output/public/assets/analytics-Bqz0c-BT.js +0 -1
  129. package/.output/public/assets/analytics-api-CJdrTLLO.js +0 -1
  130. package/.output/public/assets/api-B_Rh-uzC.js +0 -1
  131. package/.output/public/assets/api-keys-BurCFhzH.js +0 -1
  132. package/.output/public/assets/api-keys-api-BEDJdQg3.js +0 -1
  133. package/.output/public/assets/badge-Bf0fZ-Gx.js +0 -1
  134. package/.output/public/assets/createServerFn-gM2-LFBy.js +0 -3
  135. package/.output/public/assets/dialog-BS60BRr2.js +0 -1
  136. package/.output/public/assets/download-O-yNBc9H.js +0 -1
  137. package/.output/public/assets/field-Buq148-A.js +0 -1
  138. package/.output/public/assets/index-kFhd2S78.js +0 -10
  139. package/.output/public/assets/installations-BrQ-od41.js +0 -2
  140. package/.output/public/assets/installations-CGlZ3ROz.js +0 -1
  141. package/.output/public/assets/lazyRouteComponent-rPzgA7S-.js +0 -1
  142. package/.output/public/assets/loader-circle-DCYF-wJl.js +0 -1
  143. package/.output/public/assets/refresh-cw-n8XYbPPj.js +0 -1
  144. package/.output/public/assets/routes-CrdokJ80.js +0 -1
  145. package/.output/public/assets/search-DLhbWw3W.js +0 -1
  146. package/.output/public/assets/signing-HRexfjsH.js +0 -1
  147. package/.output/public/assets/styles-eB4EtvFS.css +0 -2
  148. package/.output/public/assets/table-D8CLieHX.js +0 -1
  149. package/.output/public/assets/textarea-YJLTVAoq.js +0 -1
  150. package/.output/public/assets/useMutation-JsGVjQMY.js +0 -1
  151. package/.output/public/assets/useOpenInteractionType-4cRD5xO0.js +0 -1
  152. package/.output/server/_libs/@reduxjs/toolkit+[...].mjs +0 -1554
  153. package/.output/server/_libs/d3-array.mjs +0 -231
  154. package/.output/server/_libs/d3-color.mjs +0 -330
  155. package/.output/server/_libs/d3-format.mjs +0 -252
  156. package/.output/server/_libs/d3-interpolate.mjs +0 -207
  157. package/.output/server/_libs/d3-path.mjs +0 -77
  158. package/.output/server/_libs/d3-scale+[...].mjs +0 -1907
  159. package/.output/server/_libs/d3-shape.mjs +0 -818
  160. package/.output/server/_libs/decimal.js-light.mjs +0 -884
  161. package/.output/server/_libs/es-toolkit.mjs +0 -1134
  162. package/.output/server/_libs/eventemitter3.mjs +0 -236
  163. package/.output/server/_libs/immer.mjs +0 -532
  164. package/.output/server/_libs/react-redux+[...].mjs +0 -205
  165. package/.output/server/_libs/recharts+[...].mjs +0 -14117
  166. package/.output/server/_ssr/AnalyticsCapabilityContext-ui4DX8GO.mjs +0 -15
  167. package/.output/server/_ssr/BundleActivityChart-BiB9ZORH.mjs +0 -288
  168. package/.output/server/_ssr/BundleIdDisplay-Czk6iR6p.mjs +0 -13
  169. package/.output/server/_ssr/analytics-DtMTn8fn.mjs +0 -858
  170. package/.output/server/_ssr/analytics-api-Cg1M5v_H.mjs +0 -71
  171. package/.output/server/_ssr/analytics-input-fRRRn0uA.mjs +0 -96
  172. package/.output/server/_ssr/analytics-rpc-DY5uXvHT.mjs +0 -155
  173. package/.output/server/_ssr/api-BTSv1tZb.mjs +0 -282
  174. package/.output/server/_ssr/badge-DCxbEeof.mjs +0 -26
  175. package/.output/server/_ssr/bundle-signing.server-D5u8KkMp.mjs +0 -51
  176. package/.output/server/_ssr/installations-B-azgAvX.mjs +0 -19
  177. package/.output/server/_ssr/installations-Ctvzp2JH.mjs +0 -535
  178. package/.output/server/_ssr/runtime.server-awTLiiXW.mjs +0 -527
  179. package/.output/server/_ssr/table-v1yCvYo7.mjs +0 -53
  180. package/.output/server/_ssr/textarea-DYHnskhb.mjs +0 -14
  181. package/.output/server/_tanstack-start-manifest_v-CH4StzJu.mjs +0 -108
  182. package/src/components/features/analytics/ActivityChart.tsx +0 -150
  183. package/src/components/features/analytics/AnalyticsCapabilityContext.tsx +0 -24
  184. package/src/components/features/analytics/AnalyticsControls.tsx +0 -115
  185. package/src/components/features/analytics/AnalyticsOverview.tsx +0 -208
  186. package/src/components/features/analytics/BundleDistribution.tsx +0 -133
  187. package/src/components/features/analytics/BundleSelector.tsx +0 -114
  188. package/src/components/features/analytics/InstallationHistoryCard.tsx +0 -248
  189. package/src/components/features/analytics/InstallationMatchesCard.tsx +0 -132
  190. package/src/components/features/analytics/InstallationPageHeader.tsx +0 -138
  191. package/src/components/features/analytics/InstallationPagination.tsx +0 -48
  192. package/src/components/features/analytics/InstallationSearch.tsx +0 -230
  193. package/src/components/features/analytics/UpdateOutcomes.tsx +0 -147
  194. package/src/components/features/bundles/BundleActivityChart.tsx +0 -193
  195. package/src/components/features/bundles/BundleAnalyticsSummary.tsx +0 -123
  196. package/src/lib/analytics-api.ts +0 -145
  197. package/src/lib/analytics-error.ts +0 -19
  198. package/src/lib/analytics-input.ts +0 -187
  199. package/src/lib/analytics-overview.ts +0 -170
  200. package/src/lib/analytics-rpc.ts +0 -218
  201. package/src/lib/server/releaseActivity.ts +0 -27
  202. package/src/routes/analytics.tsx +0 -139
  203. /package/.output/public/assets/{preload-helper-TKOBYGYD.js → preload-helper-CQ36nxok.js} +0 -0
@@ -0,0 +1,484 @@
1
+ import { r as __toESM } from "../_runtime.mjs";
2
+ import { c as createServerFn } from "./createServerFn-B2hcXoPM.mjs";
3
+ import { J as require_react, q as require_jsx_runtime } from "../_libs/@base-ui/react+[...].mjs";
4
+ import { F as ChartNoAxesCombined, I as ArrowUpRight, N as ChevronDown, P as Check, d as RefreshCw, h as PackageCheck, n as TriangleAlert, u as RotateCcw, z as Activity } from "../_libs/lucide-react.mjs";
5
+ import { S as buttonVariants, _ as Skeleton, g as SidebarTrigger, t as Button$1, w as createSsrRpc } from "./createSsrRpc-DjWNJ0uc.mjs";
6
+ import { m as Link } from "../_libs/@tanstack/react-router+[...].mjs";
7
+ import { n as useQuery } from "../_libs/tanstack__react-query.mjs";
8
+ import { a as Badge, d as CardTitle, i as AlertTitle, o as Card, r as AlertDescription, s as CardContent, t as Alert, u as CardHeader } from "./card-BRiPmi0C.mjs";
9
+ import { c as TableBody, d as TableHeader, f as TableRow, l as TableCell, s as Table, u as TableHead } from "./table-CnZmon_Z.mjs";
10
+ import { t as HashValueDisplay } from "./HashValueDisplay-DwpGLfrl.mjs";
11
+ //#region node_modules/.nitro/vite/services/ssr/assets/InsightsPageHeader-Df4Brj8u.js
12
+ var import_react = /* @__PURE__ */ __toESM(require_react());
13
+ var import_jsx_runtime = require_jsx_runtime();
14
+ var readOverview = (input) => input;
15
+ var readEventsPage = (input) => input;
16
+ var readInstallationEventsPage = (input) => input;
17
+ var readInstallationPage = (input) => input;
18
+ var readInstallId = (input) => input;
19
+ var getReportingInstallationsRpc = createServerFn({ method: "GET" }).validator(readOverview).handler(createSsrRpc("ff00311d412c8cdfa8ad5b0ba1eb6aa7471d0cc12170e6cc645deb91603d42dd"));
20
+ var listInsightsEventsRpc = createServerFn({ method: "GET" }).validator(readEventsPage).handler(createSsrRpc("d4c50f40701055145f24873dc90f3c55a5494457a6a03a743339b2ac4545eb19"));
21
+ var listInsightsInstallationEventsRpc = createServerFn({ method: "GET" }).validator(readInstallationEventsPage).handler(createSsrRpc("3c04bc6624be6dfdd80cf96819f9c6d0455e59a7bb4c0374b6afb0162ffd15b0"));
22
+ var getInsightsInstallationRpc = createServerFn({ method: "GET" }).validator(readInstallId).handler(createSsrRpc("6726f1ed9eda1f0cb4c1f1ad1023faee435ddcfd0b7c55ef08ca7f2f7f577370"));
23
+ var findInsightsInstallationsRpc = createServerFn({ method: "GET" }).validator(readInstallationPage).handler(createSsrRpc("735c501f6d5ea81a445ff2b6b2ea6a1b589e3c6f63a465a881822c80ae71e7d1"));
24
+ var STALE_TIME_MS = 3e4;
25
+ var queryKeys = {
26
+ reportingInstallations: (input) => [
27
+ "insights",
28
+ "reporting-installations",
29
+ input
30
+ ],
31
+ events: (input) => [
32
+ "insights",
33
+ "events",
34
+ input
35
+ ],
36
+ installations: (input) => [
37
+ "insights",
38
+ "installations",
39
+ input
40
+ ],
41
+ installation: (installId) => [
42
+ "insights",
43
+ "installation",
44
+ installId
45
+ ],
46
+ installationEvents: (input) => [
47
+ "insights",
48
+ "installation-events",
49
+ input
50
+ ]
51
+ };
52
+ var useReportingInstallationsQuery = (input) => useQuery({
53
+ queryKey: queryKeys.reportingInstallations(input),
54
+ queryFn: () => getReportingInstallationsRpc({ data: input }),
55
+ refetchOnWindowFocus: true,
56
+ staleTime: STALE_TIME_MS
57
+ });
58
+ var useInsightsEventsQuery = (input, enabled) => useQuery({
59
+ queryKey: queryKeys.events(input),
60
+ queryFn: () => listInsightsEventsRpc({ data: input }),
61
+ enabled,
62
+ refetchOnWindowFocus: true,
63
+ staleTime: STALE_TIME_MS
64
+ });
65
+ var useInsightsInstallationsQuery = (input, enabled) => useQuery({
66
+ queryKey: queryKeys.installations(input),
67
+ queryFn: () => findInsightsInstallationsRpc({ data: input }),
68
+ enabled: enabled && input.identity.length > 0,
69
+ staleTime: STALE_TIME_MS
70
+ });
71
+ var useInsightsInstallationQuery = (installId, enabled) => useQuery({
72
+ queryKey: queryKeys.installation(installId),
73
+ queryFn: () => getInsightsInstallationRpc({ data: { installId } }),
74
+ enabled: enabled && installId.length > 0,
75
+ staleTime: STALE_TIME_MS
76
+ });
77
+ var useInsightsInstallationEventsQuery = (input, enabled) => useQuery({
78
+ queryKey: queryKeys.installationEvents(input),
79
+ queryFn: () => listInsightsInstallationEventsRpc({ data: input }),
80
+ enabled: enabled && input.installId.length > 0,
81
+ refetchOnWindowFocus: true,
82
+ staleTime: STALE_TIME_MS
83
+ });
84
+ var eventTypes = {
85
+ UPDATE_APPLIED: {
86
+ label: "Bundle applied",
87
+ variant: "success",
88
+ icon: Check
89
+ },
90
+ RECOVERED: {
91
+ label: "Recovered",
92
+ variant: "warning",
93
+ icon: RotateCcw
94
+ },
95
+ RELEASE_ADOPTED: {
96
+ label: "Bundle adopted",
97
+ variant: "success",
98
+ icon: PackageCheck
99
+ },
100
+ UNCHANGED: {
101
+ label: "Activity reported",
102
+ variant: "secondary",
103
+ icon: Activity
104
+ }
105
+ };
106
+ function useInsightsTimeFormat() {
107
+ const [timeZone, setTimeZone] = (0, import_react.useState)("UTC");
108
+ (0, import_react.useEffect)(() => {
109
+ setTimeZone(Intl.DateTimeFormat().resolvedOptions().timeZone);
110
+ }, []);
111
+ return new Intl.DateTimeFormat("en", {
112
+ timeZone,
113
+ timeZoneName: "shortOffset",
114
+ year: "numeric",
115
+ month: "2-digit",
116
+ day: "2-digit",
117
+ hour: "2-digit",
118
+ minute: "2-digit",
119
+ second: "2-digit",
120
+ hourCycle: "h23"
121
+ });
122
+ }
123
+ function formatInsightsTimestamp(value, formatter) {
124
+ const parts = Object.fromEntries(formatter.formatToParts(new Date(value)).map(({ type, value }) => [type, value]));
125
+ const offset = parts.timeZoneName === "GMT" ? "GMT+0" : parts.timeZoneName;
126
+ return `${parts.year}/${parts.month}/${parts.day} ${parts.hour}:${parts.minute}:${parts.second} ${offset}`;
127
+ }
128
+ function EventTimestamp({ value, formatter, touch = false }) {
129
+ const date = new Date(value);
130
+ const localTime = formatInsightsTimestamp(value, formatter);
131
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("details", {
132
+ className: "group/time",
133
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("summary", {
134
+ className: `cursor-pointer list-none rounded-md outline-none focus-visible:ring-2 focus-visible:ring-ring/30 [&::-webkit-details-marker]:hidden ${touch ? "flex min-h-11 items-center" : ""}`,
135
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
136
+ className: "flex items-center gap-1",
137
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("time", {
138
+ dateTime: date.toISOString(),
139
+ className: "whitespace-nowrap",
140
+ children: localTime
141
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ChevronDown, {
142
+ "aria-hidden": "true",
143
+ className: "size-3 text-muted-foreground group-open/time:rotate-180"
144
+ })]
145
+ })
146
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
147
+ className: "mt-2 text-muted-foreground",
148
+ children: date.toISOString().replace("T", " ").replace("Z", " UTC")
149
+ })]
150
+ });
151
+ }
152
+ function EventTypeBadge({ type }) {
153
+ const eventType = eventTypes[type];
154
+ const Icon = eventType.icon;
155
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Badge, {
156
+ variant: eventType.variant,
157
+ className: "gap-1 whitespace-nowrap [&_svg]:size-3",
158
+ title: type === "UNCHANGED" ? "App activity reported on the current bundle without a bundle transition." : type === "RELEASE_ADOPTED" ? "A different release was adopted without changing the bundle." : void 0,
159
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, { "aria-hidden": "true" }), eventType.label]
160
+ });
161
+ }
162
+ function EventBundleTransition({ event, touch = false }) {
163
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("dl", {
164
+ className: "grid grid-cols-[auto_minmax(0,1fr)] items-center gap-x-2 gap-y-2",
165
+ children: [
166
+ event.fromBundleId ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("dt", {
167
+ className: "text-muted-foreground",
168
+ children: "From"
169
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("dd", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(HashValueDisplay, {
170
+ value: event.fromBundleId,
171
+ buttonClassName: touch ? "min-h-11 px-3" : void 0
172
+ }) })] }) : null,
173
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("dt", {
174
+ className: "text-muted-foreground",
175
+ children: event.type === "UNCHANGED" ? "Current" : "To"
176
+ }),
177
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("dd", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(HashValueDisplay, {
178
+ value: event.toBundleId,
179
+ buttonClassName: touch ? "min-h-11 px-3" : void 0
180
+ }) })
181
+ ]
182
+ });
183
+ }
184
+ function EventHistoryList({ events, formatter, renderIdentity }) {
185
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
186
+ className: "px-4 pb-2 text-xs text-muted-foreground sm:px-6",
187
+ children: "Time in your browser zone"
188
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ol", {
189
+ "aria-label": "Events",
190
+ className: "divide-y border-y",
191
+ children: events.map((event) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("li", {
192
+ className: "flex min-w-0 flex-col gap-3 px-4 py-4 sm:px-6",
193
+ children: [
194
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
195
+ className: "flex flex-wrap items-center justify-between gap-x-4 gap-y-1",
196
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(EventTypeBadge, { type: event.type }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
197
+ className: "text-xs tabular-nums",
198
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EventTimestamp, {
199
+ value: event.receivedAtMs,
200
+ formatter,
201
+ touch: true
202
+ })
203
+ })]
204
+ }),
205
+ renderIdentity?.(event),
206
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("dl", {
207
+ className: "flex flex-wrap gap-x-2 gap-y-1 text-sm",
208
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("dt", {
209
+ className: "sr-only",
210
+ children: "App"
211
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("dd", { children: [
212
+ event.platform === "ios" ? "iOS" : "Android",
213
+ " ",
214
+ event.appVersion
215
+ ] })] }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
216
+ className: "min-w-0 text-muted-foreground",
217
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("dt", {
218
+ className: "sr-only",
219
+ children: "Channel"
220
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("dd", {
221
+ className: "wrap-anywhere",
222
+ children: event.channel
223
+ })]
224
+ })]
225
+ }),
226
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
227
+ className: "text-xs",
228
+ "aria-label": "Bundle",
229
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EventBundleTransition, {
230
+ event,
231
+ touch: true
232
+ })
233
+ })
234
+ ]
235
+ }, event.id))
236
+ })] });
237
+ }
238
+ function InsightsErrorAlert({ fallbackTitle }) {
239
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Alert, {
240
+ variant: "destructive",
241
+ children: [
242
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TriangleAlert, { "aria-hidden": "true" }),
243
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertTitle, { children: fallbackTitle }),
244
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDescription, { children: "Refresh to try again. If this keeps happening, check your Insights provider connection." })
245
+ ]
246
+ });
247
+ }
248
+ function InsightsPagination({ hasPrevious, label, nextCursor, onNext, onPrevious, pageLength, pageNumber }) {
249
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("nav", {
250
+ "aria-label": `${label} pagination`,
251
+ className: "flex flex-wrap items-center justify-between gap-3 border-t px-4 py-3 sm:px-6",
252
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
253
+ className: "text-xs text-muted-foreground tabular-nums",
254
+ children: [
255
+ "Page ",
256
+ pageNumber,
257
+ " · ",
258
+ pageLength.toLocaleString(),
259
+ " rows"
260
+ ]
261
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
262
+ className: "flex gap-2",
263
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button$1, {
264
+ className: "h-11 min-w-11 px-3 lg:h-8 lg:min-w-0 lg:px-2",
265
+ disabled: !hasPrevious,
266
+ onClick: onPrevious,
267
+ size: "sm",
268
+ type: "button",
269
+ variant: "outline",
270
+ children: "Previous"
271
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Button$1, {
272
+ className: "h-11 min-w-11 px-3 lg:h-8 lg:min-w-0 lg:px-2",
273
+ disabled: nextCursor === null,
274
+ onClick: onNext,
275
+ size: "sm",
276
+ type: "button",
277
+ variant: "outline",
278
+ children: "Next"
279
+ })]
280
+ })]
281
+ });
282
+ }
283
+ function EventIdentity({ event, eventsLocation, touch = false }) {
284
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
285
+ className: touch ? "flex min-w-0 flex-wrap items-center justify-between gap-2" : "flex min-w-0 flex-col items-start gap-2",
286
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Link, {
287
+ className: buttonVariants({
288
+ className: touch ? "-ml-2 h-auto min-h-11 min-w-0 flex-1 justify-start gap-2 whitespace-normal text-sm" : "-ml-2 max-w-full justify-start",
289
+ size: "sm",
290
+ variant: "ghost"
291
+ }),
292
+ to: "/installations",
293
+ search: {
294
+ ...eventsLocation,
295
+ query: event.installId || void 0,
296
+ installId: event.installId
297
+ },
298
+ "aria-label": `View history for ${event.userId ?? event.username ?? "anonymous installation"} (${event.installId})`,
299
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
300
+ className: touch ? "min-w-0 text-left wrap-anywhere" : "truncate",
301
+ children: event.userId ?? event.username ?? "Anonymous installation"
302
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ArrowUpRight, {
303
+ "aria-hidden": "true",
304
+ "data-icon": "inline-end"
305
+ })]
306
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(HashValueDisplay, {
307
+ value: event.installId,
308
+ maxLength: 13,
309
+ buttonClassName: touch ? "min-h-11 px-3" : void 0
310
+ })]
311
+ });
312
+ }
313
+ function EventHistoryCard({ children, error, eventsLocation, history, isFetching, isLoading, onNext, onPrevious, onRefresh, pageNumber, title = "All events" }) {
314
+ const dateTimeFormat = useInsightsTimeFormat();
315
+ const hasPrevious = pageNumber > 1;
316
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Card, {
317
+ className: "@container min-w-0 shadow-sm",
318
+ "aria-busy": isFetching,
319
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(CardHeader, {
320
+ className: "gap-4 p-4 sm:p-6",
321
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
322
+ className: "flex flex-wrap items-center justify-between gap-3",
323
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(CardTitle, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", { children: title }) }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Button$1, {
324
+ className: "h-11 lg:h-8",
325
+ disabled: isFetching,
326
+ onClick: onRefresh,
327
+ size: "lg",
328
+ variant: "outline",
329
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(RefreshCw, {
330
+ "aria-hidden": "true",
331
+ "data-icon": "inline-start"
332
+ }), "Refresh"]
333
+ })]
334
+ }), children]
335
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CardContent, {
336
+ className: "min-w-0 p-0",
337
+ children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
338
+ className: "flex flex-col gap-4 p-6",
339
+ role: "status",
340
+ "aria-label": "Loading events",
341
+ children: [
342
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Skeleton, { className: "h-12 w-full" }),
343
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Skeleton, { className: "h-12 w-full" }),
344
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Skeleton, { className: "h-12 w-full" })
345
+ ]
346
+ }) : error ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
347
+ className: "px-6 pb-6",
348
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(InsightsErrorAlert, {
349
+ error,
350
+ fallbackTitle: "Event history unavailable"
351
+ })
352
+ }) : history ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [history.data.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
353
+ className: "@[58rem]:hidden",
354
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EventHistoryList, {
355
+ events: history.data,
356
+ formatter: dateTimeFormat,
357
+ renderIdentity: (event) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EventIdentity, {
358
+ event,
359
+ eventsLocation,
360
+ touch: true
361
+ })
362
+ })
363
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
364
+ className: "hidden @[58rem]:block",
365
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Table, {
366
+ className: "min-w-4xl table-fixed",
367
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(TableRow, {
368
+ className: "[&>th]:px-4 sm:[&>th]:px-6",
369
+ children: [
370
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableHead, {
371
+ className: "w-64",
372
+ children: "Time"
373
+ }),
374
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableHead, {
375
+ className: "w-48",
376
+ children: "Event"
377
+ }),
378
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableHead, {
379
+ className: "w-48",
380
+ children: "User / installation"
381
+ }),
382
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableHead, {
383
+ className: "w-32",
384
+ children: "App"
385
+ }),
386
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableHead, {
387
+ className: "w-52",
388
+ children: "Bundle"
389
+ })
390
+ ]
391
+ }) }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableBody, { children: history.data.map((event) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(TableRow, {
392
+ className: "[&>td]:px-4 [&>td]:py-4 [&>td]:align-top sm:[&>td]:px-6",
393
+ children: [
394
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableCell, {
395
+ className: "whitespace-normal text-xs tabular-nums",
396
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EventTimestamp, {
397
+ value: event.receivedAtMs,
398
+ formatter: dateTimeFormat
399
+ })
400
+ }),
401
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EventTypeBadge, { type: event.type }) }),
402
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableCell, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EventIdentity, {
403
+ event,
404
+ eventsLocation
405
+ }) }),
406
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableCell, {
407
+ className: "whitespace-normal text-xs",
408
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
409
+ className: "flex flex-col gap-2",
410
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [
411
+ event.platform === "ios" ? "iOS" : "Android",
412
+ " ",
413
+ event.appVersion
414
+ ] }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
415
+ className: "text-muted-foreground",
416
+ children: event.channel
417
+ })]
418
+ })
419
+ }),
420
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableCell, {
421
+ className: "whitespace-normal text-xs",
422
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EventBundleTransition, { event })
423
+ })
424
+ ]
425
+ }, event.id)) })]
426
+ })
427
+ })] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
428
+ className: "px-6 pb-6 text-sm text-muted-foreground",
429
+ children: hasPrevious || history.nextCursor ? "No events on this page" : title === "All events" ? "No events recorded yet" : "No matching reports in this period"
430
+ }), history.data.length > 0 || hasPrevious || history.nextCursor ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(InsightsPagination, {
431
+ hasPrevious,
432
+ label: title,
433
+ nextCursor: history.nextCursor,
434
+ onNext,
435
+ onPrevious,
436
+ pageLength: history.data.length,
437
+ pageNumber
438
+ }) : null] }) : null
439
+ })]
440
+ });
441
+ }
442
+ function InsightsPageHeader({ view }) {
443
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("header", {
444
+ className: "sticky top-0 z-10 flex shrink-0 flex-wrap items-center gap-3 border-b bg-background px-3 py-3 sm:bg-card/70 sm:px-4 sm:backdrop-blur-sm",
445
+ children: [
446
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SidebarTrigger, { className: "-ml-1 size-11 lg:size-7" }),
447
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
448
+ className: "flex items-center gap-1.5",
449
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ChartNoAxesCombined, {
450
+ "aria-hidden": "true",
451
+ className: "size-3.5 text-muted-foreground"
452
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", {
453
+ className: "text-sm font-medium",
454
+ children: "Insights"
455
+ })]
456
+ }),
457
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("nav", {
458
+ "aria-label": "Insights views",
459
+ className: "ml-auto flex gap-1",
460
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Link, {
461
+ "aria-current": view === "overview" ? "page" : void 0,
462
+ className: buttonVariants({
463
+ className: "h-11 px-3 lg:h-8 lg:px-2.5",
464
+ size: "lg",
465
+ variant: view === "overview" ? "secondary" : "ghost"
466
+ }),
467
+ to: "/insights",
468
+ children: "Overview"
469
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Link, {
470
+ "aria-current": view === "events" ? "page" : void 0,
471
+ className: buttonVariants({
472
+ className: "h-11 px-3 lg:h-8 lg:px-2.5",
473
+ size: "lg",
474
+ variant: view === "events" ? "secondary" : "ghost"
475
+ }),
476
+ to: "/installations",
477
+ children: "Events"
478
+ })]
479
+ })
480
+ ]
481
+ });
482
+ }
483
+ //#endregion
484
+ export { EventTypeBadge as a, InsightsPagination as c, useInsightsInstallationQuery as d, useInsightsInstallationsQuery as f, EventTimestamp as i, useInsightsEventsQuery as l, useReportingInstallationsQuery as m, EventHistoryCard as n, InsightsErrorAlert as o, useInsightsTimeFormat as p, EventHistoryList as r, InsightsPageHeader as s, EventBundleTransition as t, useInsightsInstallationEventsQuery as u };
@@ -1,15 +1,13 @@
1
- import { i as __toESM } from "../_runtime.mjs";
2
- import { at as require_react, it as require_jsx_runtime } from "../_libs/@base-ui/react+[...].mjs";
3
- import { E as Clipboard, N as Check, b as KeyRound, d as RefreshCw, f as Plus, n as TriangleAlert, s as ShieldOff, v as LoaderCircle } from "../_libs/lucide-react.mjs";
4
- import { _ as Skeleton, g as SidebarTrigger, n as Input, t as Button$1 } from "./createSsrRpc-9P0S0lJ3.mjs";
5
- import { a as FieldLabel, i as FieldGroup, n as FieldDescription, r as FieldError, t as Field } from "./field-DRIXKjZG.mjs";
6
- import { a as Card, i as AlertTitle, l as CardHeader, n as AlertAction, o as CardContent, r as AlertDescription, t as Alert, u as CardTitle } from "./alert-Dim3MGY5.mjs";
7
- import { a as useRevokeApiKeyMutation, i as useCreateApiKeyMutation, r as useApiKeysQuery } from "./api-keys-api-CIywsSF5.mjs";
8
- import { a as AlertDialogDescription, c as AlertDialogMedia, d as Dialog$1, f as DialogContent, g as DialogTitle, h as DialogHeader, i as AlertDialogContent, l as AlertDialogTitle, m as DialogFooter, n as AlertDialogAction, o as AlertDialogFooter, p as DialogDescription, r as AlertDialogCancel, s as AlertDialogHeader, t as AlertDialog$1, u as AlertDialogTrigger } from "./dialog-CQuRMNZ4.mjs";
9
- import { t as Badge } from "./badge-DCxbEeof.mjs";
10
- import { a as TableHeader, i as TableHead, n as TableBody, o as TableRow, r as TableCell, t as Table } from "./table-v1yCvYo7.mjs";
1
+ import { r as __toESM } from "../_runtime.mjs";
2
+ import { J as require_react, q as require_jsx_runtime } from "../_libs/@base-ui/react+[...].mjs";
3
+ import { D as Clipboard, P as Check, d as RefreshCw, f as Plus, n as TriangleAlert, s as ShieldOff, x as KeyRound, y as LoaderCircle } from "../_libs/lucide-react.mjs";
4
+ import { _ as Skeleton, g as SidebarTrigger, n as Input, t as Button$1 } from "./createSsrRpc-DjWNJ0uc.mjs";
5
+ import { a as useRevokeApiKeyMutation, i as useCreateApiKeyMutation, r as useApiKeysQuery } from "./api-keys-api-BUPQVSpk.mjs";
6
+ import { a as Badge, d as CardTitle, i as AlertTitle, n as AlertAction, o as Card, r as AlertDescription, s as CardContent, t as Alert, u as CardHeader } from "./card-BRiPmi0C.mjs";
7
+ import { a as AlertDialogDescription, c as AlertDialogMedia, d as Dialog$1, f as DialogContent, g as DialogTitle, h as DialogHeader, i as AlertDialogContent, l as AlertDialogTitle, m as DialogFooter, n as AlertDialogAction, o as AlertDialogFooter, p as DialogDescription, r as AlertDialogCancel, s as AlertDialogHeader, t as AlertDialog$1, u as AlertDialogTrigger } from "./dialog-DS-nw-pA.mjs";
8
+ import { a as FieldLabel, c as TableBody, d as TableHeader, f as TableRow, i as FieldGroup, l as TableCell, n as FieldDescription, r as FieldError, s as Table, t as Field, u as TableHead } from "./table-CnZmon_Z.mjs";
11
9
  import { n as toast } from "../_libs/sonner.mjs";
12
- //#region node_modules/.nitro/vite/services/ssr/assets/api-keys-BnM_o2nS.js
10
+ //#region node_modules/.nitro/vite/services/ssr/assets/api-keys-CZeTPQys.js
13
11
  var import_react = /* @__PURE__ */ __toESM(require_react());
14
12
  var import_jsx_runtime = require_jsx_runtime();
15
13
  var formatCreatedAt = (createdAt) => new Date(createdAt).toISOString().slice(0, 10);
@@ -144,7 +142,7 @@ function RevokeApiKeyDialog({ record }) {
144
142
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(AlertDialogDescription, { children: [
145
143
  "Apps using ",
146
144
  record.prefix,
147
- "… will immediately lose OTA update and analytics access. This action cannot be undone."
145
+ "… will immediately lose OTA update and insights access. This action cannot be undone."
148
146
  ] })
149
147
  ] }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(AlertDialogFooter, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(AlertDialogCancel, {
150
148
  disabled: revoke.isPending,
@@ -284,7 +282,7 @@ function ApiKeysRoute() {
284
282
  }),
285
283
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
286
284
  className: "basis-full pl-9 text-xs text-muted-foreground sm:basis-auto sm:pl-0",
287
- children: "API keys can download OTA updates and submit analytics only."
285
+ children: "API keys can download OTA updates and submit insights only."
288
286
  })
289
287
  ]
290
288
  }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
@@ -1,8 +1,8 @@
1
1
  import { c as createServerFn } from "./createServerFn-B2hcXoPM.mjs";
2
- import { w as createSsrRpc } from "./createSsrRpc-9P0S0lJ3.mjs";
2
+ import { w as createSsrRpc } from "./createSsrRpc-DjWNJ0uc.mjs";
3
3
  import { g as redirect } from "../_libs/@tanstack/react-router+[...].mjs";
4
4
  import { i as useQueryClient, n as useQuery, t as useMutation } from "../_libs/tanstack__react-query.mjs";
5
- //#region node_modules/.nitro/vite/services/ssr/assets/api-keys-api-CIywsSF5.js
5
+ //#region node_modules/.nitro/vite/services/ssr/assets/api-keys-api-BUPQVSpk.js
6
6
  var parseName = (input) => {
7
7
  const name = typeof input === "object" && input !== null ? Reflect.get(input, "name") : void 0;
8
8
  if (typeof name !== "string") throw new TypeError("API key name must be a string.");
@@ -1,6 +1,6 @@
1
1
  import { c as createServerFn } from "./createServerFn-B2hcXoPM.mjs";
2
2
  import { t as createServerRpc } from "./createServerRpc-DB29C_5p.mjs";
3
- //#region node_modules/.nitro/vite/services/ssr/assets/api-keys-rpc-BSp1wkIV.js
3
+ //#region node_modules/.nitro/vite/services/ssr/assets/api-keys-rpc-Cs7tS5_j.js
4
4
  var BASE64URL_32_PATTERN = /^[A-Za-z0-9_-]{43}$/u;
5
5
  var bytesToBase64Url = (bytes) => {
6
6
  let binary = "";
@@ -24,7 +24,7 @@ var hashApiKey = async (apiKey) => {
24
24
  return bytesToBase64Url(new Uint8Array(digest));
25
25
  };
26
26
  var apiKeyId = () => {
27
- const bytes = new Uint8Array(16);
27
+ const bytes = /* @__PURE__ */ new Uint8Array(16);
28
28
  crypto.getRandomValues(bytes);
29
29
  return `api-${bytesToBase64Url(bytes)}`;
30
30
  };
@@ -61,7 +61,7 @@ var registerApiKey = async (input) => {
61
61
  });
62
62
  };
63
63
  var createApiKey = (input) => {
64
- const bytes = new Uint8Array(32);
64
+ const bytes = /* @__PURE__ */ new Uint8Array(32);
65
65
  crypto.getRandomValues(bytes);
66
66
  return registerApiKey({
67
67
  apiKey: bytesToBase64Url(bytes),
@@ -81,7 +81,7 @@ var parseId = (input) => {
81
81
  return { id };
82
82
  };
83
83
  var requireStore = async () => {
84
- const { prepareConfig } = await import("./config.server-DEiLhKmy.mjs");
84
+ const { prepareConfig } = await import("./config.server-afDuAwaG.mjs");
85
85
  const { apiKeyStore } = await prepareConfig();
86
86
  if (apiKeyStore === null) throw new Error("API keys are not supported by the configured database plugin.");
87
87
  return apiKeyStore;
@@ -92,7 +92,7 @@ var getApiKeyCapabilityRpc_createServerFn_handler = createServerRpc({
92
92
  filename: "src/lib/api-keys-rpc.ts"
93
93
  }, (opts) => getApiKeyCapabilityRpc.__executeServer(opts));
94
94
  var getApiKeyCapabilityRpc = createServerFn({ method: "GET" }).handler(getApiKeyCapabilityRpc_createServerFn_handler, async () => {
95
- const { prepareConfig } = await import("./config.server-DEiLhKmy.mjs");
95
+ const { prepareConfig } = await import("./config.server-afDuAwaG.mjs");
96
96
  const { apiKeyStore } = await prepareConfig();
97
97
  return { apiKeys: apiKeyStore !== null };
98
98
  });