@meridianlabs/log-viewer 0.3.260 → 0.3.262

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 (218) hide show
  1. package/README.md +109 -0
  2. package/lib/{AsciinemaPlayerImpl-D25m6trA.js → AsciinemaPlayerImpl-BG5NPs0z.js} +157 -96
  3. package/lib/AsciinemaPlayerImpl-BG5NPs0z.js.map +1 -0
  4. package/lib/e2e/fixtures/handlers.d.ts +6 -0
  5. package/lib/e2e/fixtures/handlers.d.ts.map +1 -1
  6. package/lib/e2e/fixtures/log-list-scenario.d.ts +5735 -0
  7. package/lib/e2e/fixtures/log-list-scenario.d.ts.map +1 -0
  8. package/lib/e2e/fixtures/test-data.d.ts +2 -0
  9. package/lib/e2e/fixtures/test-data.d.ts.map +1 -1
  10. package/lib/e2e/metrics-overflow.spec.d.ts +2 -0
  11. package/lib/e2e/metrics-overflow.spec.d.ts.map +1 -0
  12. package/lib/e2e/turn-navigation.spec.d.ts +5 -0
  13. package/lib/e2e/turn-navigation.spec.d.ts.map +1 -1
  14. package/lib/index.js +70845 -41174
  15. package/lib/index.js.map +1 -1
  16. package/lib/src/app/App.d.ts.map +1 -1
  17. package/lib/src/app/log-list/LogsPanel.d.ts.map +1 -1
  18. package/lib/src/app/log-list/ViewerOptionsPopover.d.ts.map +1 -1
  19. package/lib/src/app/log-list/fileLogItem.d.ts.map +1 -1
  20. package/lib/src/app/log-list/grid/LogListGrid.d.ts.map +1 -1
  21. package/lib/src/app/log-list/grid/columns/hooks.d.ts.map +1 -1
  22. package/lib/src/app/log-list/grid/logListRow.d.ts.map +1 -1
  23. package/lib/src/app/log-list/grid/useLogListData.d.ts.map +1 -1
  24. package/lib/src/app/log-list/listing/evaluator.d.ts +5 -3
  25. package/lib/src/app/log-list/listing/evaluator.d.ts.map +1 -1
  26. package/lib/src/app/log-list/listing/useLogsListingQuery.d.ts.map +1 -1
  27. package/lib/src/app/log-view/LogSampleDetailView.d.ts.map +1 -1
  28. package/lib/src/app/log-view/LogView.d.ts.map +1 -1
  29. package/lib/src/app/log-view/LogViewContainer.d.ts.map +1 -1
  30. package/lib/src/app/log-view/tabs/InfoTab.d.ts +120 -1
  31. package/lib/src/app/log-view/tabs/InfoTab.d.ts.map +1 -1
  32. package/lib/src/app/log-view/tabs/ModelsTab.d.ts +113 -1
  33. package/lib/src/app/log-view/tabs/ModelsTab.d.ts.map +1 -1
  34. package/lib/src/app/log-view/tabs/SamplesTab.d.ts.map +1 -1
  35. package/lib/src/app/log-view/tabs/TaskTab.d.ts +113 -1
  36. package/lib/src/app/log-view/tabs/TaskTab.d.ts.map +1 -1
  37. package/lib/src/app/log-view/tabs/timeline/HistoryList.d.ts.map +1 -1
  38. package/lib/src/app/log-view/tabs/timeline/TimelineChart.d.ts.map +1 -1
  39. package/lib/src/app/log-view/tabs/timeline/TimelineTab.d.ts +113 -1
  40. package/lib/src/app/log-view/tabs/timeline/TimelineTab.d.ts.map +1 -1
  41. package/lib/src/app/log-view/tabs/timeline/timelineData.d.ts.map +1 -1
  42. package/lib/src/app/log-view/title-view/AutogrowText.d.ts.map +1 -1
  43. package/lib/src/app/log-view/title-view/CollapsedTitleBar.d.ts.map +1 -1
  44. package/lib/src/app/log-view/title-view/EditMetadataDialog.d.ts.map +1 -1
  45. package/lib/src/app/log-view/title-view/EditTagsDialog.d.ts.map +1 -1
  46. package/lib/src/app/log-view/title-view/ModelRolesView.d.ts.map +1 -1
  47. package/lib/src/app/log-view/title-view/PrimaryBar.d.ts.map +1 -1
  48. package/lib/src/app/log-view/title-view/ResultsPanel.d.ts +4 -0
  49. package/lib/src/app/log-view/title-view/ResultsPanel.d.ts.map +1 -1
  50. package/lib/src/app/log-view/title-view/ScoreGrid.d.ts.map +1 -1
  51. package/lib/src/app/log-view/title-view/TagStrip.d.ts +18 -0
  52. package/lib/src/app/log-view/title-view/TagStrip.d.ts.map +1 -1
  53. package/lib/src/app/log-view/useShowTimeline.d.ts.map +1 -1
  54. package/lib/src/app/navbar/Navbar.d.ts.map +1 -1
  55. package/lib/src/app/plan/DatasetDetailView.d.ts.map +1 -1
  56. package/lib/src/app/plan/PlanDetailView.d.ts.map +1 -1
  57. package/lib/src/app/routing/RouteDispatcher.d.ts +7 -1
  58. package/lib/src/app/routing/RouteDispatcher.d.ts.map +1 -1
  59. package/lib/src/app/routing/loaders/LogLoadController.d.ts.map +1 -1
  60. package/lib/src/app/routing/loaders/SampleLoadController.d.ts.map +1 -1
  61. package/lib/src/app/routing/loaders/SampleRouteSelectionController.d.ts.map +1 -1
  62. package/lib/src/app/routing/url.d.ts +23 -21
  63. package/lib/src/app/routing/url.d.ts.map +1 -1
  64. package/lib/src/app/samples/InlineSampleDisplay.d.ts.map +1 -1
  65. package/lib/src/app/samples/SampleDetailComponent.d.ts.map +1 -1
  66. package/lib/src/app/samples/SampleDisplay.d.ts.map +1 -1
  67. package/lib/src/app/samples/SampleSummaryView.d.ts.map +1 -1
  68. package/lib/src/app/samples/descriptor/samplesDescriptor.d.ts.map +1 -1
  69. package/lib/src/app/samples/descriptor/score/ListScoreDescriptor.d.ts.map +1 -1
  70. package/lib/src/app/samples/descriptor/score/ObjectScoreDescriptor.d.ts.map +1 -1
  71. package/lib/src/app/samples/descriptor/types.d.ts +3 -2
  72. package/lib/src/app/samples/descriptor/types.d.ts.map +1 -1
  73. package/lib/src/app/samples/error/error.d.ts +1 -1
  74. package/lib/src/app/samples/error/error.d.ts.map +1 -1
  75. package/lib/src/app/samples/event/SampleEventView.d.ts.map +1 -1
  76. package/lib/src/app/samples/header-v2/ScorePanel.d.ts.map +1 -1
  77. package/lib/src/app/samples/header-v2/ScoreValueDisplay.d.ts +1 -1
  78. package/lib/src/app/samples/header-v2/ScoreValueDisplay.d.ts.map +1 -1
  79. package/lib/src/app/samples/header-v2/scoreTone.d.ts +1 -1
  80. package/lib/src/app/samples/header-v2/scoreTone.d.ts.map +1 -1
  81. package/lib/src/app/samples/list/SampleList.d.ts.map +1 -1
  82. package/lib/src/app/samples/list/SamplesViewOptionsPopover.d.ts.map +1 -1
  83. package/lib/src/app/samples/list/samplesView.converters.d.ts.map +1 -1
  84. package/lib/src/app/samples/list/useSamplesView.d.ts.map +1 -1
  85. package/lib/src/app/samples/print/SamplePrintView.d.ts.map +1 -1
  86. package/lib/src/app/samples/retry-display/RetryAttemptCard.d.ts.map +1 -1
  87. package/lib/src/app/samples/retry-display/RetryTerminalAnchor.d.ts.map +1 -1
  88. package/lib/src/app/samples/sample-tools/SelectScorer.d.ts.map +1 -1
  89. package/lib/src/app/samples/sample-tools/filterAst.d.ts.map +1 -1
  90. package/lib/src/app/samples/sample-tools/filters.d.ts +1 -1
  91. package/lib/src/app/samples/sample-tools/filters.d.ts.map +1 -1
  92. package/lib/src/app/samples/sample-tools/sample-filter/SampleFilter.d.ts.map +1 -1
  93. package/lib/src/app/samples/sample-tools/sample-filter/completions.d.ts.map +1 -1
  94. package/lib/src/app/samples/scores/SampleScores.d.ts +2 -2
  95. package/lib/src/app/samples/scores/SampleScores.d.ts.map +1 -1
  96. package/lib/src/app/samples/scores/SampleScoresGrid.d.ts.map +1 -1
  97. package/lib/src/app/samples/scores/SampleScoresView.d.ts.map +1 -1
  98. package/lib/src/app/samples/status/status.d.ts +2 -2
  99. package/lib/src/app/samples/status/status.d.ts.map +1 -1
  100. package/lib/src/app/samples/transcript/TranscriptFilter.d.ts +2 -0
  101. package/lib/src/app/samples/transcript/TranscriptFilter.d.ts.map +1 -1
  102. package/lib/src/app/samples/transcript/TranscriptPanel.d.ts +3 -0
  103. package/lib/src/app/samples/transcript/TranscriptPanel.d.ts.map +1 -1
  104. package/lib/src/app/samples/transcript/chunked/ChunkedTranscriptPanel.d.ts.map +1 -1
  105. package/lib/src/app/samples/transcript/hooks.d.ts +1 -1
  106. package/lib/src/app/samples/transcript/hooks.d.ts.map +1 -1
  107. package/lib/src/app/samples-panel/SampleDetailView.d.ts.map +1 -1
  108. package/lib/src/app/samples-panel/SamplesPanel.d.ts.map +1 -1
  109. package/lib/src/app/shared/ColumnSelectorPopover.d.ts.map +1 -1
  110. package/lib/src/app/shared/data-grid/DataGrid.d.ts +4 -4
  111. package/lib/src/app/shared/data-grid/DataGrid.d.ts.map +1 -1
  112. package/lib/src/app/shared/data-grid/columnTypes.d.ts +4 -3
  113. package/lib/src/app/shared/data-grid/columnTypes.d.ts.map +1 -1
  114. package/lib/src/app/shared/data-grid/findMatches.d.ts +3 -2
  115. package/lib/src/app/shared/data-grid/findMatches.d.ts.map +1 -1
  116. package/lib/src/app/shared/data-grid/tableFeatures.d.ts +10 -0
  117. package/lib/src/app/shared/data-grid/tableFeatures.d.ts.map +1 -0
  118. package/lib/src/app/shared/data-grid/testFixtures.d.ts +21 -0
  119. package/lib/src/app/shared/data-grid/testFixtures.d.ts.map +1 -0
  120. package/lib/src/app/shared/gridComparators.d.ts +0 -3
  121. package/lib/src/app/shared/gridComparators.d.ts.map +1 -1
  122. package/lib/src/app/shared/samples-grid/SamplesGrid.d.ts.map +1 -1
  123. package/lib/src/app/shared/samples-grid/colorScale.d.ts.map +1 -1
  124. package/lib/src/app/shared/samples-grid/columns.d.ts.map +1 -1
  125. package/lib/src/app/shared/samples-grid/types.d.ts +4 -3
  126. package/lib/src/app/shared/samples-grid/types.d.ts.map +1 -1
  127. package/lib/src/app/types.d.ts +2 -1
  128. package/lib/src/app/types.d.ts.map +1 -1
  129. package/lib/src/app_config/index.d.ts +1 -1
  130. package/lib/src/app_config/index.d.ts.map +1 -1
  131. package/lib/src/app_config/resolveBackend.d.ts.map +1 -1
  132. package/lib/src/client/api/client-api.d.ts.map +1 -1
  133. package/lib/src/client/api/static-http/api-static-http.d.ts.map +1 -1
  134. package/lib/src/client/api/static-http/fetch.d.ts.map +1 -1
  135. package/lib/src/client/api/testClientApi.d.ts.map +1 -1
  136. package/lib/src/client/api/types.d.ts +17 -8
  137. package/lib/src/client/api/types.d.ts.map +1 -1
  138. package/lib/src/client/api/view-server/api-view-server.d.ts +0 -6
  139. package/lib/src/client/api/view-server/api-view-server.d.ts.map +1 -1
  140. package/lib/src/client/api/view-server/request.d.ts.map +1 -1
  141. package/lib/src/client/database/schema.d.ts.map +1 -1
  142. package/lib/src/client/database/utils.d.ts.map +1 -1
  143. package/lib/src/client/remote/remoteLogFile.d.ts.map +1 -1
  144. package/lib/src/client/remote/zstd-worker.d.ts.map +1 -1
  145. package/lib/src/client/storage/index.d.ts.map +1 -1
  146. package/lib/src/client/utils/derive.d.ts.map +1 -1
  147. package/lib/src/client/utils/normalize.d.ts +23 -0
  148. package/lib/src/client/utils/normalize.d.ts.map +1 -0
  149. package/lib/src/client/utils/type-utils.d.ts.map +1 -1
  150. package/lib/src/components/DownloadButton.d.ts.map +1 -1
  151. package/lib/src/components/DownloadLogButton.d.ts.map +1 -1
  152. package/lib/src/components/DownloadPanel.d.ts.map +1 -1
  153. package/lib/src/components/MessageBand.d.ts.map +1 -1
  154. package/lib/src/embed.d.ts +26 -0
  155. package/lib/src/embed.d.ts.map +1 -0
  156. package/lib/src/index.d.ts +1 -0
  157. package/lib/src/index.d.ts.map +1 -1
  158. package/lib/src/log_data/FetchEngineController.d.ts.map +1 -1
  159. package/lib/src/log_data/chunked/chunkStore.d.ts.map +1 -1
  160. package/lib/src/log_data/chunked/chunkedSample.d.ts.map +1 -1
  161. package/lib/src/log_data/chunked/syntheticEvents.d.ts.map +1 -1
  162. package/lib/src/log_data/chunkedAttachments.d.ts +9 -2
  163. package/lib/src/log_data/chunkedAttachments.d.ts.map +1 -1
  164. package/lib/src/log_data/chunkedSampleQuery.d.ts.map +1 -1
  165. package/lib/src/log_data/fetchEngine.d.ts +5 -5
  166. package/lib/src/log_data/fetchEngine.d.ts.map +1 -1
  167. package/lib/src/log_data/listingSync.d.ts.map +1 -1
  168. package/lib/src/log_data/log.d.ts.map +1 -1
  169. package/lib/src/log_data/logsListingRead.d.ts.map +1 -1
  170. package/lib/src/log_data/messageRowsQuery.d.ts.map +1 -1
  171. package/lib/src/log_data/messagesExport.d.ts.map +1 -1
  172. package/lib/src/log_data/sampleData.d.ts.map +1 -1
  173. package/lib/src/log_data/sampleFetch.d.ts +5 -2
  174. package/lib/src/log_data/sampleFetch.d.ts.map +1 -1
  175. package/lib/src/log_data/sampleStream.d.ts.map +1 -1
  176. package/lib/src/log_data/scoreSchema.d.ts.map +1 -1
  177. package/lib/src/scoring/headline.d.ts +20 -0
  178. package/lib/src/scoring/headline.d.ts.map +1 -0
  179. package/lib/src/scoring/metrics.d.ts +9 -13
  180. package/lib/src/scoring/metrics.d.ts.map +1 -1
  181. package/lib/src/scoring/scores.d.ts +8 -0
  182. package/lib/src/scoring/scores.d.ts.map +1 -1
  183. package/lib/src/scoring/types.d.ts +12 -0
  184. package/lib/src/scoring/types.d.ts.map +1 -1
  185. package/lib/src/state/appSlice.d.ts.map +1 -1
  186. package/lib/src/state/hooks.d.ts +113 -1
  187. package/lib/src/state/hooks.d.ts.map +1 -1
  188. package/lib/src/state/logSlice.d.ts.map +1 -1
  189. package/lib/src/state/logsSlice.d.ts.map +1 -1
  190. package/lib/src/state/sampleSlice.d.ts +1 -1
  191. package/lib/src/state/sampleSlice.d.ts.map +1 -1
  192. package/lib/src/state/store.d.ts.map +1 -1
  193. package/lib/src/utils/attachments.d.ts +6 -0
  194. package/lib/src/utils/attachments.d.ts.map +1 -1
  195. package/lib/src/utils/cssVars.d.ts +8 -0
  196. package/lib/src/utils/cssVars.d.ts.map +1 -0
  197. package/lib/src/utils/debugging.d.ts.map +1 -1
  198. package/lib/src/utils/evalModel.d.ts +3 -1
  199. package/lib/src/utils/evalModel.d.ts.map +1 -1
  200. package/lib/src/utils/workQueue.d.ts +5 -0
  201. package/lib/src/utils/workQueue.d.ts.map +1 -1
  202. package/lib/styles/index.css +3847 -4414
  203. package/package.json +24 -29
  204. package/lib/AsciinemaPlayerImpl-D25m6trA.js.map +0 -1
  205. package/lib/src/app/log-list/listing/combineFilters.d.ts +0 -10
  206. package/lib/src/app/log-list/listing/combineFilters.d.ts.map +0 -1
  207. package/lib/src/app/plan/ModelCard.d.ts +0 -11
  208. package/lib/src/app/plan/ModelCard.d.ts.map +0 -1
  209. package/lib/src/app/routing/TasksRouter.d.ts +0 -7
  210. package/lib/src/app/routing/TasksRouter.d.ts.map +0 -1
  211. package/lib/src/components/ActivityBar.d.ts +0 -8
  212. package/lib/src/components/ActivityBar.d.ts.map +0 -1
  213. package/lib/src/components/AsciinemaPlayer.d.ts +0 -20
  214. package/lib/src/components/AsciinemaPlayer.d.ts.map +0 -1
  215. package/lib/src/utils/react.d.ts +0 -2
  216. package/lib/src/utils/react.d.ts.map +0 -1
  217. package/lib/src/utils/uri.d.ts +0 -22
  218. package/lib/src/utils/uri.d.ts.map +0 -1
package/README.md ADDED
@@ -0,0 +1,109 @@
1
+ # Inspect Log Viewer
2
+
3
+ React app for viewing eval logs produced by
4
+ [Inspect AI](https://inspect.aisi.org.uk/). It runs standalone (served by
5
+ `inspect view`), against statically hosted log directories, inside the
6
+ Inspect VS Code extension, and can be embedded in external applications via
7
+ the [`@meridianlabs/log-viewer`](https://www.npmjs.com/package/@meridianlabs/log-viewer)
8
+ npm package.
9
+
10
+ For repo setup (corepack, pnpm, install), see the
11
+ [root README](../../README.md).
12
+
13
+ ## Development
14
+
15
+ Run commands from this directory, or from the repo root with
16
+ `pnpm <command> --filter=@meridianlabs/log-viewer` (the root scripts pass the
17
+ filter through to `turbo run`, preserving task dependencies — see
18
+ [scripts.md](../../docs/scripts.md)):
19
+
20
+ | Command | Description |
21
+ | ---------------- | ----------------------------------------- |
22
+ | `pnpm dev` | Start the Vite dev server on :5173 |
23
+ | `pnpm build` | Build the bundled app |
24
+ | `pnpm build:lib` | Build the embeddable library into `lib/` |
25
+ | `pnpm test` | Run unit/integration tests (vitest) |
26
+ | `pnpm e2e` | Run Playwright e2e tests |
27
+ | `pnpm check-all` | Type check, lint, format, test, and build |
28
+
29
+ Built output is not committed; the library is built at publish time
30
+ (`prepublishOnly`).
31
+
32
+ You may optionally set the `VIEW_SERVER_API_URL` environment variable at
33
+ build time to use an API server running on a different host.
34
+
35
+ ## Embedding (`@meridianlabs/log-viewer`)
36
+
37
+ > **Versioning disclaimer**: this package does NOT use semantic versioning.
38
+ > The public surface evolves with the host application's needs — expect
39
+ > breaking changes in any release and adapt accordingly.
40
+
41
+ ```bash
42
+ npm install @meridianlabs/log-viewer
43
+ ```
44
+
45
+ The viewer requires its bundled CSS:
46
+
47
+ ```typescript
48
+ import "@meridianlabs/log-viewer/styles/index.css";
49
+ ```
50
+
51
+ ### Example Usage
52
+
53
+ An embedder installs a per-dir API factory with `setApiFactory` **before**
54
+ initializing the store and rendering `<App />`. The viewer resolves the log
55
+ directory (from `initialLogDir` or a `?log_dir=` URL param), calls your
56
+ factory with it, and renders:
57
+
58
+ ```tsx
59
+ import {
60
+ App,
61
+ clientApi,
62
+ createViewServerApi,
63
+ initializeStore,
64
+ setApiFactory,
65
+ } from "@meridianlabs/log-viewer";
66
+ import type { Capabilities } from "@meridianlabs/log-viewer";
67
+
68
+ import "@meridianlabs/log-viewer/styles/index.css";
69
+
70
+ // Install the API factory first — installing after the backend has
71
+ // resolved throws.
72
+ setApiFactory(
73
+ (logDir) =>
74
+ clientApi(
75
+ createViewServerApi({
76
+ logDir,
77
+ // Optional transport options: apiBaseUrl, headerProvider, customFetch
78
+ apiBaseUrl: "https://mycompany.com/api",
79
+ })
80
+ ),
81
+ "s3://my-bucket/logs" // initialLogDir; omit to require ?log_dir= in the URL
82
+ );
83
+
84
+ const capabilities: Capabilities = {
85
+ downloadFiles: true,
86
+ downloadLogs: false,
87
+ webWorkers: true,
88
+ streamSamples: false,
89
+ };
90
+ initializeStore(capabilities);
91
+
92
+ export function MyApp() {
93
+ return <App />;
94
+ }
95
+ ```
96
+
97
+ To re-point the viewer at a different log directory after boot, call
98
+ `setLogRoot(dir)` — it rebuilds the API through the same factory.
99
+
100
+ ### Embedder chrome
101
+
102
+ If your own UI (rendered as a sibling of `<App />`, not a descendant) calls
103
+ the viewer's selection hooks (`useSelectedSampleSummary`,
104
+ `useSelectedScores`, `useLogSelection`), wrap that chrome in
105
+ `<InspectQueryClientProvider>` so the hooks resolve the viewer's
106
+ react-query client, and gate it on `useViewerReady()` — the hooks throw
107
+ before the viewer's app config resolves.
108
+
109
+ See [src/index.ts](src/index.ts) for the full public surface.
@@ -1,5 +1,6 @@
1
- import { useEffect, useRef } from "react";
2
1
  import { jsx } from "react/jsx-runtime";
2
+ import { c } from "react/compiler-runtime";
3
+ import { useEffect, useRef } from "react";
3
4
  //#region ../../node_modules/.pnpm/asciinema-player@3.17.0/node_modules/asciinema-player/dist/logging-DeB0koVt.js
4
5
  function parseNpt(time) {
5
6
  if (typeof time === "number") return time;
@@ -2961,25 +2962,29 @@ var PARSERS = /* @__PURE__ */ new Map([
2961
2962
  ]);
2962
2963
  function getDriver(src) {
2963
2964
  if (typeof src === "function") return src;
2964
- if (typeof src === "string") if (src.substring(0, 5) == "ws://" || src.substring(0, 6) == "wss://") src = {
2965
- driver: "websocket",
2966
- url: src
2967
- };
2968
- else if (src.substring(0, 6) == "clock:") src = { driver: "clock" };
2969
- else if (src.substring(0, 7) == "random:") src = { driver: "random" };
2970
- else if (src.substring(0, 10) == "benchmark:") src = {
2971
- driver: "benchmark",
2972
- url: src.substring(10)
2973
- };
2974
- else src = {
2975
- driver: "recording",
2976
- url: src
2977
- };
2965
+ if (typeof src === "string") {
2966
+ if (src.substring(0, 5) == "ws://" || src.substring(0, 6) == "wss://") src = {
2967
+ driver: "websocket",
2968
+ url: src
2969
+ };
2970
+ else if (src.substring(0, 6) == "clock:") src = { driver: "clock" };
2971
+ else if (src.substring(0, 7) == "random:") src = { driver: "random" };
2972
+ else if (src.substring(0, 10) == "benchmark:") src = {
2973
+ driver: "benchmark",
2974
+ url: src.substring(10)
2975
+ };
2976
+ else src = {
2977
+ driver: "recording",
2978
+ url: src
2979
+ };
2980
+ }
2978
2981
  if (src.driver === void 0) src.driver = "recording";
2979
2982
  if (src.driver == "recording") {
2980
2983
  if (src.format !== "segmented" && src.parser === void 0) src.parser = "asciicast";
2981
- if (typeof src.parser === "string") if (PARSERS.has(src.parser)) src.parser = PARSERS.get(src.parser);
2982
- else throw new Error(`unknown parser: ${src.parser}`);
2984
+ if (typeof src.parser === "string") {
2985
+ if (PARSERS.has(src.parser)) src.parser = PARSERS.get(src.parser);
2986
+ else throw new Error(`unknown parser: ${src.parser}`);
2987
+ }
2983
2988
  }
2984
2989
  if (DRIVERS.has(src.driver)) {
2985
2990
  const driver = DRIVERS.get(src.driver);
@@ -3102,12 +3107,14 @@ function children(fn) {
3102
3107
  return memo;
3103
3108
  }
3104
3109
  function readSignal() {
3105
- if (this.sources && this.state) if (this.state === STALE) updateComputation(this);
3106
- else {
3107
- const updates = Updates;
3108
- Updates = null;
3109
- runUpdates(() => lookUpstream(this), false);
3110
- Updates = updates;
3110
+ if (this.sources && this.state) {
3111
+ if (this.state === STALE) updateComputation(this);
3112
+ else {
3113
+ const updates = Updates;
3114
+ Updates = null;
3115
+ runUpdates(() => lookUpstream(this), false);
3116
+ Updates = updates;
3117
+ }
3111
3118
  }
3112
3119
  if (Listener) {
3113
3120
  const sSlot = this.observers ? this.observers.length : 0;
@@ -3195,8 +3202,10 @@ function createComputation(fn, init, pure, state = STALE, options) {
3195
3202
  pure
3196
3203
  };
3197
3204
  if (Owner === null);
3198
- else if (Owner !== UNOWNED) if (!Owner.owned) Owner.owned = [c];
3199
- else Owner.owned.push(c);
3205
+ else if (Owner !== UNOWNED) {
3206
+ if (!Owner.owned) Owner.owned = [c];
3207
+ else Owner.owned.push(c);
3208
+ }
3200
3209
  return c;
3201
3210
  }
3202
3211
  function runTop(node) {
@@ -3502,18 +3511,19 @@ function reconcileArrays(parentNode, a, b) {
3502
3511
  while (i < bEnd) map.set(b[i], i++);
3503
3512
  }
3504
3513
  const index = map.get(a[aStart]);
3505
- if (index != null) if (bStart < index && index < bEnd) {
3506
- let i = aStart, sequence = 1, t;
3507
- while (++i < aEnd && i < bEnd) {
3508
- if ((t = map.get(a[i])) == null || t !== index + sequence) break;
3509
- sequence++;
3510
- }
3511
- if (sequence > index - bStart) {
3512
- const node = a[aStart];
3513
- while (bStart < index) parentNode.insertBefore(b[bStart++], node);
3514
- } else parentNode.replaceChild(b[bStart++], a[aStart++]);
3515
- } else aStart++;
3516
- else a[aStart++].remove();
3514
+ if (index != null) {
3515
+ if (bStart < index && index < bEnd) {
3516
+ let i = aStart, sequence = 1, t;
3517
+ while (++i < aEnd && i < bEnd) {
3518
+ if ((t = map.get(a[i])) == null || t !== index + sequence) break;
3519
+ sequence++;
3520
+ }
3521
+ if (sequence > index - bStart) {
3522
+ const node = a[aStart];
3523
+ while (bStart < index) parentNode.insertBefore(b[bStart++], node);
3524
+ } else parentNode.replaceChild(b[bStart++], a[aStart++]);
3525
+ } else aStart++;
3526
+ } else a[aStart++].remove();
3517
3527
  }
3518
3528
  }
3519
3529
  }
@@ -3672,9 +3682,10 @@ function insertExpression(parent, value, current, marker, unwrapArray) {
3672
3682
  if (array.length === 0) {
3673
3683
  current = cleanChildren(parent, current, marker);
3674
3684
  if (multi) return current;
3675
- } else if (currentArray) if (current.length === 0) appendNodes(parent, array, marker);
3676
- else reconcileArrays(parent, current, array);
3677
- else {
3685
+ } else if (currentArray) {
3686
+ if (current.length === 0) appendNodes(parent, array, marker);
3687
+ else reconcileArrays(parent, current, array);
3688
+ } else {
3678
3689
  current && cleanChildren(parent);
3679
3690
  appendNodes(parent, array);
3680
3691
  }
@@ -3696,14 +3707,15 @@ function normalizeIncomingArray(normalized, array, current, unwrap) {
3696
3707
  if (item == null || item === true || item === false);
3697
3708
  else if ((t = typeof item) === "object" && item.nodeType) normalized.push(item);
3698
3709
  else if (Array.isArray(item)) dynamic = normalizeIncomingArray(normalized, item, prev) || dynamic;
3699
- else if (t === "function") if (unwrap) {
3700
- while (typeof item === "function") item = item();
3701
- dynamic = normalizeIncomingArray(normalized, Array.isArray(item) ? item : [item], Array.isArray(prev) ? prev : [prev]) || dynamic;
3710
+ else if (t === "function") {
3711
+ if (unwrap) {
3712
+ while (typeof item === "function") item = item();
3713
+ dynamic = normalizeIncomingArray(normalized, Array.isArray(item) ? item : [item], Array.isArray(prev) ? prev : [prev]) || dynamic;
3714
+ } else {
3715
+ normalized.push(item);
3716
+ dynamic = true;
3717
+ }
3702
3718
  } else {
3703
- normalized.push(item);
3704
- dynamic = true;
3705
- }
3706
- else {
3707
3719
  const value = String(item);
3708
3720
  if (prev && prev.nodeType === 3 && prev.data === value) normalized.push(prev);
3709
3721
  else normalized.push(document.createTextNode(value));
@@ -4217,16 +4229,20 @@ function __wbg_finalize_init(instance, module) {
4217
4229
  }
4218
4230
  function initSync(module) {
4219
4231
  if (wasm !== void 0) return wasm;
4220
- if (typeof module !== "undefined") if (Object.getPrototypeOf(module) === Object.prototype) ({module} = module);
4221
- else console.warn("using deprecated parameters for `initSync()`; pass a single object instead");
4232
+ if (typeof module !== "undefined") {
4233
+ if (Object.getPrototypeOf(module) === Object.prototype) ({module} = module);
4234
+ else console.warn("using deprecated parameters for `initSync()`; pass a single object instead");
4235
+ }
4222
4236
  const imports = __wbg_get_imports();
4223
4237
  if (!(module instanceof WebAssembly.Module)) module = new WebAssembly.Module(module);
4224
4238
  return __wbg_finalize_init(new WebAssembly.Instance(module, imports), module);
4225
4239
  }
4226
4240
  async function __wbg_init(module_or_path) {
4227
4241
  if (wasm !== void 0) return wasm;
4228
- if (typeof module_or_path !== "undefined") if (Object.getPrototypeOf(module_or_path) === Object.prototype) ({module_or_path} = module_or_path);
4229
- else console.warn("using deprecated parameters for the initialization function; pass a single object instead");
4242
+ if (typeof module_or_path !== "undefined") {
4243
+ if (Object.getPrototypeOf(module_or_path) === Object.prototype) ({module_or_path} = module_or_path);
4244
+ else console.warn("using deprecated parameters for the initialization function; pass a single object instead");
4245
+ }
4230
4246
  const imports = __wbg_get_imports();
4231
4247
  if (typeof module_or_path === "string" || typeof Request === "function" && module_or_path instanceof Request || typeof URL === "function" && module_or_path instanceof URL) module_or_path = fetch(module_or_path);
4232
4248
  const { instance, module } = await __wbg_load(await module_or_path, imports);
@@ -6124,8 +6140,10 @@ var Player = (props) => {
6124
6140
  const terminalH = charH * terminalRows() + bordersH;
6125
6141
  let fit = props.fit ?? "width";
6126
6142
  const currentContainerSize = containerSize();
6127
- if (fit === "both" || isFullscreen()) if (currentContainerSize.width / (currentContainerSize.height - controlBarHeight()) > terminalW / terminalH) fit = "height";
6128
- else fit = "width";
6143
+ if (fit === "both" || isFullscreen()) {
6144
+ if (currentContainerSize.width / (currentContainerSize.height - controlBarHeight()) > terminalW / terminalH) fit = "height";
6145
+ else fit = "width";
6146
+ }
6129
6147
  if (fit === false || fit === "none") return {};
6130
6148
  else if (fit === "width") {
6131
6149
  const scale = currentContainerSize.width / terminalW;
@@ -6178,11 +6196,13 @@ var Player = (props) => {
6178
6196
  core.seek(`${pos * 100}%`);
6179
6197
  } else if (e.key == "?") toggleHelp();
6180
6198
  else if (e.key == "k") toggleKeystrokeOverlay();
6181
- else if (e.key == "ArrowLeft") if (e.shiftKey) core.seek("<<<");
6182
- else core.seek("<<");
6183
- else if (e.key == "ArrowRight") if (e.shiftKey) core.seek(">>>");
6184
- else core.seek(">>");
6185
- else if (e.key == "Escape") setIsHelpVisible(false);
6199
+ else if (e.key == "ArrowLeft") {
6200
+ if (e.shiftKey) core.seek("<<<");
6201
+ else core.seek("<<");
6202
+ } else if (e.key == "ArrowRight") {
6203
+ if (e.shiftKey) core.seek(">>>");
6204
+ else core.seek(">>");
6205
+ } else if (e.key == "Escape") setIsHelpVisible(false);
6186
6206
  else return;
6187
6207
  e.stopPropagation();
6188
6208
  e.preventDefault();
@@ -6218,10 +6238,12 @@ var Player = (props) => {
6218
6238
  const embeddedTheme = createMemo(() => preferEmbeddedTheme ? originalTheme() : null);
6219
6239
  const playerStyle = () => {
6220
6240
  const style = {};
6221
- if ((props.fit === false || props.fit === "none") && props.terminalFontSize !== void 0) if (props.terminalFontSize === "small") style["font-size"] = "12px";
6222
- else if (props.terminalFontSize === "medium") style["font-size"] = "18px";
6223
- else if (props.terminalFontSize === "big") style["font-size"] = "24px";
6224
- else style["font-size"] = props.terminalFontSize;
6241
+ if ((props.fit === false || props.fit === "none") && props.terminalFontSize !== void 0) {
6242
+ if (props.terminalFontSize === "small") style["font-size"] = "12px";
6243
+ else if (props.terminalFontSize === "medium") style["font-size"] = "18px";
6244
+ else if (props.terminalFontSize === "big") style["font-size"] = "24px";
6245
+ else style["font-size"] = props.terminalFontSize;
6246
+ }
6225
6247
  const size = terminalElementSize();
6226
6248
  if (size.width !== void 0) {
6227
6249
  style["width"] = `${size.width}px`;
@@ -6594,18 +6616,42 @@ function create(src, elem, opts = {}) {
6594
6616
  }
6595
6617
  //#endregion
6596
6618
  //#region ../../packages/react/src/components/AsciinemaPlayerImpl.tsx
6597
- var AsciinemaPlayerImpl = ({ id, rows, cols, inputUrl, outputUrl, timingUrl, fit, speed, autoPlay, loop, theme, idleTimeLimit = 2, style }) => {
6619
+ var AsciinemaPlayerImpl = (t0) => {
6620
+ const $ = c(18);
6621
+ const { id, rows, cols, inputUrl, outputUrl, timingUrl, fit, speed, autoPlay, loop, theme, idleTimeLimit: t1, style } = t0;
6622
+ const idleTimeLimit = t1 === void 0 ? 2 : t1;
6598
6623
  const playerContainerRef = useRef(null);
6599
- useEffect(() => {
6600
- if (!playerContainerRef.current) return;
6601
- const player = create({
6602
- url: [
6603
- timingUrl,
6604
- outputUrl,
6605
- inputUrl
6606
- ],
6607
- parser: "typescript"
6608
- }, playerContainerRef.current, {
6624
+ let t2;
6625
+ let t3;
6626
+ if ($[0] !== autoPlay || $[1] !== cols || $[2] !== fit || $[3] !== idleTimeLimit || $[4] !== inputUrl || $[5] !== loop || $[6] !== outputUrl || $[7] !== rows || $[8] !== speed || $[9] !== theme || $[10] !== timingUrl) {
6627
+ t2 = () => {
6628
+ if (!playerContainerRef.current) return;
6629
+ const player = create({
6630
+ url: [
6631
+ timingUrl,
6632
+ outputUrl,
6633
+ inputUrl
6634
+ ],
6635
+ parser: "typescript"
6636
+ }, playerContainerRef.current, {
6637
+ rows,
6638
+ cols,
6639
+ autoPlay,
6640
+ loop,
6641
+ theme,
6642
+ speed,
6643
+ idleTimeLimit,
6644
+ fit
6645
+ });
6646
+ player.play();
6647
+ return () => {
6648
+ player.dispose();
6649
+ };
6650
+ };
6651
+ t3 = [
6652
+ timingUrl,
6653
+ outputUrl,
6654
+ inputUrl,
6609
6655
  rows,
6610
6656
  cols,
6611
6657
  autoPlay,
@@ -6614,31 +6660,46 @@ var AsciinemaPlayerImpl = ({ id, rows, cols, inputUrl, outputUrl, timingUrl, fit
6614
6660
  speed,
6615
6661
  idleTimeLimit,
6616
6662
  fit
6663
+ ];
6664
+ $[0] = autoPlay;
6665
+ $[1] = cols;
6666
+ $[2] = fit;
6667
+ $[3] = idleTimeLimit;
6668
+ $[4] = inputUrl;
6669
+ $[5] = loop;
6670
+ $[6] = outputUrl;
6671
+ $[7] = rows;
6672
+ $[8] = speed;
6673
+ $[9] = theme;
6674
+ $[10] = timingUrl;
6675
+ $[11] = t2;
6676
+ $[12] = t3;
6677
+ } else {
6678
+ t2 = $[11];
6679
+ t3 = $[12];
6680
+ }
6681
+ useEffect(t2, t3);
6682
+ const t4 = `asciinema-player-${id || "default"}`;
6683
+ let t5;
6684
+ if ($[13] !== style) {
6685
+ t5 = { ...style };
6686
+ $[13] = style;
6687
+ $[14] = t5;
6688
+ } else t5 = $[14];
6689
+ let t6;
6690
+ if ($[15] !== t4 || $[16] !== t5) {
6691
+ t6 = /*#__PURE__*/ jsx("div", {
6692
+ id: t4,
6693
+ ref: playerContainerRef,
6694
+ style: t5
6617
6695
  });
6618
- player.play();
6619
- return () => {
6620
- player.dispose();
6621
- };
6622
- }, [
6623
- timingUrl,
6624
- outputUrl,
6625
- inputUrl,
6626
- rows,
6627
- cols,
6628
- autoPlay,
6629
- loop,
6630
- theme,
6631
- speed,
6632
- idleTimeLimit,
6633
- fit
6634
- ]);
6635
- return /* @__PURE__ */ jsx("div", {
6636
- id: `asciinema-player-${id || "default"}`,
6637
- ref: playerContainerRef,
6638
- style: { ...style }
6639
- });
6696
+ $[15] = t4;
6697
+ $[16] = t5;
6698
+ $[17] = t6;
6699
+ } else t6 = $[17];
6700
+ return t6;
6640
6701
  };
6641
6702
  //#endregion
6642
6703
  export { AsciinemaPlayerImpl as default };
6643
6704
 
6644
- //# sourceMappingURL=AsciinemaPlayerImpl-D25m6trA.js.map
6705
+ //# sourceMappingURL=AsciinemaPlayerImpl-BG5NPs0z.js.map