effect-browser 0.3.0-beta.20 → 0.3.0-beta.22

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 (243) hide show
  1. package/README.md +221 -158
  2. package/dist/Action-24sLOubi.d.mts +110 -0
  3. package/dist/Action.d.mts +2 -0
  4. package/dist/Action.mjs +141 -0
  5. package/dist/Action.mjs.map +1 -0
  6. package/dist/ActionPort.d.mts +15 -0
  7. package/dist/ActionPort.mjs +101 -0
  8. package/dist/ActionPort.mjs.map +1 -0
  9. package/dist/Browser-Cq2K1FEA.mjs +4075 -0
  10. package/dist/Browser-Cq2K1FEA.mjs.map +1 -0
  11. package/dist/Browser-wZhwZSlG.d.mts +167 -0
  12. package/dist/Browser.d.mts +2 -129
  13. package/dist/Browser.mjs +1 -1
  14. package/dist/{BrowserError-Coy7EW1N.d.mts → BrowserError-BlcmLVzn.d.mts} +22 -7
  15. package/dist/BrowserError.d.mts +2 -2
  16. package/dist/BrowserError.mjs +46 -9
  17. package/dist/BrowserError.mjs.map +1 -1
  18. package/dist/{BrowserEvent-dq6FRT8w.d.mts → BrowserEvent-lLqJ3GJS.d.mts} +93 -37
  19. package/dist/BrowserEvent.d.mts +2 -2
  20. package/dist/BrowserEvent.mjs +29 -24
  21. package/dist/BrowserEvent.mjs.map +1 -1
  22. package/dist/{Change-DqING3tr.d.mts → Change-Ba7INmay.d.mts} +4 -6
  23. package/dist/Change.d.mts +2 -2
  24. package/dist/Change.mjs +97 -2
  25. package/dist/Change.mjs.map +1 -0
  26. package/dist/Clock.d.mts +57 -0
  27. package/dist/Clock.mjs +80 -0
  28. package/dist/Clock.mjs.map +1 -0
  29. package/dist/{Frame-DkNdjjjr.d.mts → Frame-UEH2hO5T.d.mts} +10 -3
  30. package/dist/Frame.d.mts +2 -2
  31. package/dist/Frame.mjs +10 -2
  32. package/dist/Frame.mjs.map +1 -1
  33. package/dist/{Motion-DND6I-64.d.mts → Geometry-DJx9qrYy.d.mts} +7 -10
  34. package/dist/Geometry.d.mts +2 -0
  35. package/dist/Geometry.mjs +32 -0
  36. package/dist/Geometry.mjs.map +1 -0
  37. package/dist/LICENSE-jpeg-js +28 -0
  38. package/dist/Matching.d.mts +37 -0
  39. package/dist/{match.inpage-xOe9LNO0.mjs → Matching.mjs} +28 -4
  40. package/dist/Matching.mjs.map +1 -0
  41. package/dist/{Page-CfB6Zn1p.mjs → Page-BF5izr8R.mjs} +216 -31
  42. package/dist/Page-BF5izr8R.mjs.map +1 -0
  43. package/dist/{Page-ku6j5t-v.d.mts → Page-CvsOEorc.d.mts} +158 -185
  44. package/dist/Page.d.mts +2 -2
  45. package/dist/Page.mjs +1 -1
  46. package/dist/Released-tURbFmal.d.mts +15 -0
  47. package/dist/{Snapshot-B34hZ4Jl.d.mts → Snapshot-CtBVOtuu.d.mts} +6 -1
  48. package/dist/Snapshot.d.mts +1 -1
  49. package/dist/Snapshot.mjs.map +1 -1
  50. package/dist/Stillness-CNlvayIo.mjs +136 -0
  51. package/dist/Stillness-CNlvayIo.mjs.map +1 -0
  52. package/dist/Style-AO4V7Czt.mjs +357 -0
  53. package/dist/Style-AO4V7Czt.mjs.map +1 -0
  54. package/dist/Style.d.mts +72 -0
  55. package/dist/Style.mjs +2 -0
  56. package/dist/Url.d.mts +26 -0
  57. package/dist/Url.mjs +74 -0
  58. package/dist/Url.mjs.map +1 -0
  59. package/dist/Window-CMddGMt1.d.mts +34 -0
  60. package/dist/Window.d.mts +2 -0
  61. package/dist/Window.mjs +35 -0
  62. package/dist/Window.mjs.map +1 -0
  63. package/dist/connection-2KHI4_KN.d.mts +41 -0
  64. package/dist/connection-BTeO0Hiz.mjs +68 -0
  65. package/dist/connection-BTeO0Hiz.mjs.map +1 -0
  66. package/dist/index.d.mts +15 -17
  67. package/dist/index.mjs +11 -14
  68. package/dist/moment/Moment.d.mts +86 -0
  69. package/dist/{Moment.mjs → moment/Moment.mjs} +44 -38
  70. package/dist/moment/Moment.mjs.map +1 -0
  71. package/dist/{Plan-DJ4hEEna.d.mts → plan/index.d.mts} +169 -64
  72. package/dist/{Plan-C-d5QYS8.mjs → plan/index.mjs} +122 -155
  73. package/dist/plan/index.mjs.map +1 -0
  74. package/dist/{Policy.d.mts → policy/Policy.d.mts} +5 -9
  75. package/dist/{Policy.mjs → policy/Policy.mjs} +11 -21
  76. package/dist/policy/Policy.mjs.map +1 -0
  77. package/dist/presentation/Motion.d.mts +12 -0
  78. package/dist/{Motion.mjs → presentation/Motion.mjs} +4 -27
  79. package/dist/presentation/Motion.mjs.map +1 -0
  80. package/dist/presentation/Presentation.d.mts +30 -0
  81. package/dist/presentation/Presentation.mjs +105 -0
  82. package/dist/presentation/Presentation.mjs.map +1 -0
  83. package/dist/{Stage.d.mts → presentation/Stage.d.mts} +5 -8
  84. package/dist/{Stage.mjs → presentation/Stage.mjs} +68 -76
  85. package/dist/presentation/Stage.mjs.map +1 -0
  86. package/dist/presentation/feed.d.mts +20 -0
  87. package/dist/presentation/feed.mjs +18 -0
  88. package/dist/presentation/feed.mjs.map +1 -0
  89. package/dist/providers/Cdp.d.mts +9 -0
  90. package/dist/providers/Cdp.mjs +15 -0
  91. package/dist/providers/Cdp.mjs.map +1 -0
  92. package/dist/{Chromium.d.mts → providers/Chromium.d.mts} +6 -7
  93. package/dist/{Chromium.mjs → providers/Chromium.mjs} +7 -16
  94. package/dist/providers/Chromium.mjs.map +1 -0
  95. package/dist/providers/Released.d.mts +2 -0
  96. package/dist/providers/Released.mjs +12 -0
  97. package/dist/providers/Released.mjs.map +1 -0
  98. package/dist/stillness/Stillness.d.mts +12 -0
  99. package/dist/stillness/Stillness.mjs +2 -0
  100. package/dist/supervisor/Supervisor.d.mts +104 -0
  101. package/dist/supervisor/Supervisor.mjs +513 -0
  102. package/dist/supervisor/Supervisor.mjs.map +1 -0
  103. package/dist/testing/index.d.mts +337 -0
  104. package/dist/testing/index.mjs +515 -0
  105. package/dist/testing/index.mjs.map +1 -0
  106. package/dist/workerd/Cdp.d.mts +8 -0
  107. package/dist/workerd/Cdp.mjs +13 -0
  108. package/dist/workerd/Cdp.mjs.map +1 -0
  109. package/package.json +94 -33
  110. package/src/Action.ts +127 -0
  111. package/src/ActionPort.ts +128 -0
  112. package/src/Browser.ts +366 -225
  113. package/src/BrowserError.ts +63 -6
  114. package/src/BrowserEvent.ts +26 -25
  115. package/src/Change.ts +0 -2
  116. package/src/{internal/pictures/clock.ts → Clock.ts} +17 -6
  117. package/src/Frame.ts +14 -0
  118. package/src/Geometry.ts +48 -0
  119. package/src/{internal/reading/match.inpage.ts → Matching.ts} +34 -4
  120. package/src/Page.ts +111 -92
  121. package/src/Snapshot.ts +5 -0
  122. package/src/{internal/input/style.ts → Style.ts} +121 -14
  123. package/src/Window.ts +30 -0
  124. package/src/index.ts +8 -13
  125. package/src/internal/input/actions.ts +61 -119
  126. package/src/internal/input/dispatch.ts +3 -3
  127. package/src/internal/input/gate.ts +21 -18
  128. package/src/internal/input/guard.inpage.ts +25 -58
  129. package/src/internal/input/guard.ts +11 -20
  130. package/src/internal/input/keyboard.ts +12 -3
  131. package/src/internal/input/perform.ts +78 -60
  132. package/src/internal/input/pointer.ts +4 -2
  133. package/src/internal/input/settle.ts +7 -5
  134. package/src/internal/input/targets.inpage.ts +1 -1
  135. package/src/internal/input/targets.ts +4 -9
  136. package/src/internal/page/bridge.ts +210 -114
  137. package/src/internal/page/context.ts +23 -73
  138. package/src/internal/page/dialogs.ts +58 -0
  139. package/src/internal/page/identity.ts +6 -23
  140. package/src/internal/page/lane.ts +14 -15
  141. package/src/internal/page/navigation.ts +50 -42
  142. package/src/internal/page/openings.ts +11 -5
  143. package/src/internal/page/page.ts +44 -81
  144. package/src/internal/page/port.ts +125 -0
  145. package/src/internal/{input → page}/replies.ts +1 -1
  146. package/src/internal/page/request-owner.ts +269 -0
  147. package/src/internal/page/requests.ts +357 -0
  148. package/src/internal/page/scripts.ts +124 -0
  149. package/src/internal/pictures/capture.ts +255 -332
  150. package/src/internal/pictures/dimensions.ts +162 -0
  151. package/src/internal/pictures/frame.ts +68 -0
  152. package/src/internal/pictures/pictures.ts +57 -23
  153. package/src/internal/pictures/quiescence.ts +1 -1
  154. package/src/internal/pictures/state.ts +26 -0
  155. package/src/internal/pictures/transport.ts +21 -4
  156. package/src/internal/reading/controls.inpage.ts +5 -70
  157. package/src/internal/reading/expect.inpage.ts +13 -17
  158. package/src/internal/reading/names.inpage.ts +89 -45
  159. package/src/internal/reading/outline.inpage.ts +6 -7
  160. package/src/internal/reading/reading.ts +144 -176
  161. package/src/internal/reading/ready.inpage.ts +6 -17
  162. package/src/internal/reading/ready.ts +13 -135
  163. package/src/internal/reading/subjects.inpage.ts +83 -43
  164. package/src/internal/reading/walk.inpage.ts +33 -13
  165. package/src/internal/timeline/changes.ts +55 -6
  166. package/src/internal/timeline/events.ts +15 -5
  167. package/src/internal/timeline/history.inpage.ts +1 -1
  168. package/src/internal/timeline/record.inpage.ts +4 -1
  169. package/src/internal/timeline/window.ts +2 -1
  170. package/src/{Moment.ts → moment/Moment.ts} +13 -31
  171. package/src/{internal/timeline → moment}/words.ts +2 -2
  172. package/src/{internal/reading → plan}/choose.ts +3 -3
  173. package/src/plan/data.ts +117 -0
  174. package/src/plan/execute.ts +411 -0
  175. package/src/plan/index.ts +36 -0
  176. package/src/plan/record.ts +71 -0
  177. package/src/plan/targets.ts +71 -0
  178. package/src/{Policy.ts → policy/Policy.ts} +13 -10
  179. package/src/{Motion.ts → presentation/Motion.ts} +12 -46
  180. package/src/presentation/Presentation.ts +176 -0
  181. package/src/{Stage.ts → presentation/Stage.ts} +147 -112
  182. package/src/presentation/feed.ts +21 -0
  183. package/src/providers/Cdp.ts +16 -0
  184. package/src/{Chromium.ts → providers/Chromium.ts} +7 -10
  185. package/src/providers/Released.ts +13 -0
  186. package/src/providers/connection.ts +134 -0
  187. package/src/{internal/pictures/motion.ts → stillness/Pixels.ts} +4 -4
  188. package/src/stillness/Stillness.ts +166 -0
  189. package/src/supervisor/Supervisor.ts +170 -0
  190. package/src/supervisor/contract.ts +105 -0
  191. package/src/supervisor/lifecycle.ts +272 -0
  192. package/src/supervisor/runtime.ts +234 -0
  193. package/src/testing/TestBrowser.ts +115 -0
  194. package/src/testing/TestPage.ts +10 -0
  195. package/src/testing/evidence.ts +154 -0
  196. package/src/testing/index.ts +3 -0
  197. package/src/testing/model.ts +222 -0
  198. package/src/testing/page.ts +360 -0
  199. package/src/workerd/Cdp.ts +11 -0
  200. package/dist/Browser-BwCldIff.mjs +0 -629
  201. package/dist/Browser-BwCldIff.mjs.map +0 -1
  202. package/dist/Cdp.d.mts +0 -32
  203. package/dist/Cdp.mjs +0 -61
  204. package/dist/Cdp.mjs.map +0 -1
  205. package/dist/Change-DNvztNLu.mjs +0 -138
  206. package/dist/Change-DNvztNLu.mjs.map +0 -1
  207. package/dist/Chromium.mjs.map +0 -1
  208. package/dist/Expect.d.mts +0 -62
  209. package/dist/Expect.mjs +0 -114
  210. package/dist/Expect.mjs.map +0 -1
  211. package/dist/Moment.d.mts +0 -2
  212. package/dist/Moment.mjs.map +0 -1
  213. package/dist/Motion.d.mts +0 -2
  214. package/dist/Motion.mjs.map +0 -1
  215. package/dist/Page-CfB6Zn1p.mjs.map +0 -1
  216. package/dist/Plan-C-d5QYS8.mjs.map +0 -1
  217. package/dist/Plan.d.mts +0 -2
  218. package/dist/Plan.mjs +0 -2
  219. package/dist/Policy.mjs.map +0 -1
  220. package/dist/Presentation.d.mts +0 -48
  221. package/dist/Presentation.mjs +0 -118
  222. package/dist/Presentation.mjs.map +0 -1
  223. package/dist/Stage.mjs.map +0 -1
  224. package/dist/Supervisor-2mPjIYYs.mjs +0 -676
  225. package/dist/Supervisor-2mPjIYYs.mjs.map +0 -1
  226. package/dist/Supervisor-mVPeEUp8.d.mts +0 -317
  227. package/dist/Supervisor.d.mts +0 -2
  228. package/dist/Supervisor.mjs +0 -2
  229. package/dist/context-w3NJPRLo.mjs +0 -335
  230. package/dist/context-w3NJPRLo.mjs.map +0 -1
  231. package/dist/match.inpage-xOe9LNO0.mjs.map +0 -1
  232. package/dist/page-BKwfF6z-.mjs +0 -5099
  233. package/dist/page-BKwfF6z-.mjs.map +0 -1
  234. package/dist/url-Cd04Okid.mjs +0 -264
  235. package/dist/url-Cd04Okid.mjs.map +0 -1
  236. package/src/Cdp.ts +0 -101
  237. package/src/Expect.ts +0 -180
  238. package/src/Plan.ts +0 -674
  239. package/src/Presentation.ts +0 -196
  240. package/src/Supervisor.ts +0 -632
  241. package/src/internal/supervisor/lifecycle.ts +0 -484
  242. /package/src/{internal/page/url.ts → Url.ts} +0 -0
  243. /package/src/{internal/pictures → stillness}/utilsBundle.d.ts +0 -0
package/dist/Clock.mjs ADDED
@@ -0,0 +1,80 @@
1
+ import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
2
+ import { Duration, Effect, Option, Semaphore } from "effect";
3
+ //#region src/Clock.ts
4
+ /**
5
+ * Host monotonic milliseconds and the browser's clock read on the owner's: estimates of their
6
+ * offset from timed probes, how an estimate ages, and the mapping a browser's pages share.
7
+ * `pictures.ts` takes the probes.
8
+ */
9
+ var Clock_exports = /* @__PURE__ */ __exportAll({
10
+ estimate: () => estimate,
11
+ mapping: () => mapping,
12
+ monotonicMillis: () => monotonicMillis,
13
+ supersedes: () => supersedes,
14
+ toBrowserSeconds: () => toBrowserSeconds,
15
+ toHostTime: () => toHostTime,
16
+ uncertaintyAt: () => uncertaintyAt
17
+ });
18
+ /** Read the captured owner's clock, including from native callbacks, without changing its origin. */
19
+ const monotonicMillis = (clock) => Number(clock.monotonicTimeNanosUnsafe()) / 1e6;
20
+ /** The fastest complete probe limits uncertainty without mistaking transit delay for clock offset. */
21
+ const estimate = (probes) => {
22
+ let best;
23
+ for (const probe of probes) {
24
+ const roundTripMillis = probe.hostEnd - probe.hostStart;
25
+ if (!Number.isFinite(probe.hostStart) || !Number.isFinite(probe.hostEnd) || !Number.isFinite(probe.browserTime) || !Number.isFinite(roundTripMillis) || roundTripMillis < 0) continue;
26
+ const sampledAt = probe.hostStart + roundTripMillis / 2;
27
+ const offsetMillis = probe.browserTime - sampledAt;
28
+ if (!Number.isFinite(offsetMillis) || !Number.isFinite(probe.browserTime - probe.hostStart) || !Number.isFinite(probe.browserTime - probe.hostEnd)) continue;
29
+ if (best === void 0 || roundTripMillis < best.roundTripMillis) best = {
30
+ offsetMillis,
31
+ uncertaintyMillis: roundTripMillis / 2,
32
+ roundTripMillis,
33
+ sampledAt
34
+ };
35
+ }
36
+ return Option.fromUndefinedOr(best);
37
+ };
38
+ const driftPerMillis = 1e-4;
39
+ /** An estimate's uncertainty at `hostTime`, wider the further that is from when it was sampled. */
40
+ const uncertaintyAt = (estimate, hostTime) => estimate.uncertaintyMillis + Math.abs(hostTime - estimate.sampledAt) * driftPerMillis;
41
+ const renewAfter = Duration.seconds(10);
42
+ /**
43
+ * Whether a new measurement should replace the current estimate. Each interval contains the true
44
+ * offset, so overlapping intervals agree and the narrower one is kept, the current one widened by
45
+ * its age: a probe delayed behind a busy page cannot widen every tab's stamps. A disjoint
46
+ * measurement means the clocks moved (a wall clock step, or drift between a remote browser and
47
+ * this host), so the newer evidence wins.
48
+ */
49
+ const supersedes = (next, current) => {
50
+ const aged = uncertaintyAt(current, next.sampledAt);
51
+ return next.uncertaintyMillis <= aged || Math.abs(next.offsetMillis - current.offsetMillis) > next.uncertaintyMillis + aged;
52
+ };
53
+ /**
54
+ * Every renderer of a browser reads the same host wall clock, so the offset belongs to the
55
+ * browser rather than a page. A busy page cannot fail work that an earlier estimate can serve.
56
+ */
57
+ const mapping = (now) => {
58
+ let latest;
59
+ let measuredAt = Number.NEGATIVE_INFINITY;
60
+ const lock = Semaphore.makeUnsafe(1);
61
+ const adopt = (measure) => {
62
+ measuredAt = now();
63
+ return measure.pipe(Effect.map((estimate) => {
64
+ if (latest === void 0 || supersedes(estimate, latest)) latest = estimate;
65
+ return latest;
66
+ }));
67
+ };
68
+ return {
69
+ latest: () => latest,
70
+ current: (measure) => Effect.suspend(() => latest === void 0 ? lock.withPermits(1)(Effect.suspend(() => latest === void 0 ? adopt(measure) : Effect.succeed(latest))) : Effect.succeed(latest)),
71
+ renew: (measure) => lock.withPermits(1)(Effect.suspend(() => latest === void 0 || now() - measuredAt < Duration.toMillis(renewAfter) ? Effect.void : Effect.ignore(adopt(measure))))
72
+ };
73
+ };
74
+ const toHostTime = (calibration, browserEpochMillis) => browserEpochMillis - calibration.offsetMillis;
75
+ /** CDP input timestamps use seconds, unlike browser frame timestamps and the owner's clock. */
76
+ const toBrowserSeconds = (calibration, hostMillis) => (hostMillis + calibration.offsetMillis) / 1e3;
77
+ //#endregion
78
+ export { estimate, mapping, monotonicMillis, supersedes, Clock_exports as t, toBrowserSeconds, toHostTime, uncertaintyAt };
79
+
80
+ //# sourceMappingURL=Clock.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Clock.mjs","names":[],"sources":["../src/Clock.ts"],"sourcesContent":["/**\n * Host monotonic milliseconds and the browser's clock read on the owner's: estimates of their\n * offset from timed probes, how an estimate ages, and the mapping a browser's pages share.\n * `pictures.ts` takes the probes.\n */\nimport { type Clock, Duration, Effect, Option, Semaphore } from \"effect\";\n\n/** Read the captured owner's clock, including from native callbacks, without changing its origin. */\nexport const monotonicMillis = (clock: Clock.Clock): number =>\n Number(clock.monotonicTimeNanosUnsafe()) / 1e6;\n\nexport interface Probe {\n readonly hostStart: number;\n readonly hostEnd: number;\n readonly browserTime: number;\n}\n\nexport interface Estimate {\n /** Browser epoch milliseconds minus the owner's host monotonic milliseconds. */\n readonly offsetMillis: number;\n /** Either transport direction can own the entire round trip; symmetry is not assumed. */\n readonly uncertaintyMillis: number;\n readonly roundTripMillis: number;\n readonly sampledAt: number;\n}\n\n/** The fastest complete probe limits uncertainty without mistaking transit delay for clock offset. */\nexport const estimate = (probes: ReadonlyArray<Probe>): Option.Option<Estimate> => {\n let best: Estimate | undefined;\n\n for (const probe of probes) {\n const roundTripMillis = probe.hostEnd - probe.hostStart;\n\n if (\n !Number.isFinite(probe.hostStart) ||\n !Number.isFinite(probe.hostEnd) ||\n !Number.isFinite(probe.browserTime) ||\n !Number.isFinite(roundTripMillis) ||\n roundTripMillis < 0\n )\n continue;\n const sampledAt = probe.hostStart + roundTripMillis / 2;\n const offsetMillis = probe.browserTime - sampledAt;\n\n if (\n !Number.isFinite(offsetMillis) ||\n !Number.isFinite(probe.browserTime - probe.hostStart) ||\n !Number.isFinite(probe.browserTime - probe.hostEnd)\n )\n continue;\n if (best === undefined || roundTripMillis < best.roundTripMillis)\n best = {\n offsetMillis,\n uncertaintyMillis: roundTripMillis / 2,\n roundTripMillis,\n sampledAt,\n };\n }\n\n return Option.fromUndefinedOr(best);\n};\n\n// Two machines' clocks drift apart by up to about 100 parts per million, so an estimate says this\n// much less about the offset for each millisecond of its age.\nconst driftPerMillis = 1e-4;\n\n/** An estimate's uncertainty at `hostTime`, wider the further that is from when it was sampled. */\nexport const uncertaintyAt = (estimate: Estimate, hostTime: number): number =>\n estimate.uncertaintyMillis + Math.abs(hostTime - estimate.sampledAt) * driftPerMillis;\n\n// Ten seconds widen an estimate by a millisecond, far less than a remote round trip, so it is\n// measured again no more often than this.\nconst renewAfter = Duration.seconds(10);\n\n/**\n * The browser's one epoch mapping, shared by its pages, input runs and capture generations. It is\n * measured on first need, by the first capture, never ahead of it.\n */\nexport interface Mapping {\n /** The latest estimate, without measuring: input uses it, and never waits for one. */\n readonly latest: () => Estimate | undefined;\n /** The latest estimate, measured through `measure` only while the browser has none. */\n readonly current: <E>(measure: Effect.Effect<Estimate, E>) => Effect.Effect<Estimate, E>;\n /**\n * Measure again once ten seconds have passed since the latest measurement began. A failed\n * measurement keeps the estimate, which keeps widening with its age.\n */\n readonly renew: <E>(measure: Effect.Effect<Estimate, E>) => Effect.Effect<void>;\n}\n\n/**\n * Whether a new measurement should replace the current estimate. Each interval contains the true\n * offset, so overlapping intervals agree and the narrower one is kept, the current one widened by\n * its age: a probe delayed behind a busy page cannot widen every tab's stamps. A disjoint\n * measurement means the clocks moved (a wall clock step, or drift between a remote browser and\n * this host), so the newer evidence wins.\n */\nexport const supersedes = (next: Estimate, current: Estimate): boolean => {\n const aged = uncertaintyAt(current, next.sampledAt);\n\n return (\n next.uncertaintyMillis <= aged ||\n Math.abs(next.offsetMillis - current.offsetMillis) > next.uncertaintyMillis + aged\n );\n};\n\n/**\n * Every renderer of a browser reads the same host wall clock, so the offset belongs to the\n * browser rather than a page. A busy page cannot fail work that an earlier estimate can serve.\n */\nexport const mapping = (now: () => number): Mapping => {\n let latest: Estimate | undefined;\n let measuredAt = Number.NEGATIVE_INFINITY;\n const lock = Semaphore.makeUnsafe(1);\n\n // Called where a measurement is decided, so no other can be decided before this one begins.\n const adopt = <E>(measure: Effect.Effect<Estimate, E>) => {\n measuredAt = now();\n\n return measure.pipe(\n Effect.map((estimate) => {\n if (latest === undefined || supersedes(estimate, latest)) latest = estimate;\n\n return latest;\n }),\n );\n };\n\n return {\n latest: () => latest,\n current: (measure) =>\n Effect.suspend(() =>\n latest === undefined\n ? lock.withPermits(1)(\n Effect.suspend(() =>\n latest === undefined ? adopt(measure) : Effect.succeed(latest),\n ),\n )\n : Effect.succeed(latest),\n ),\n renew: (measure) =>\n lock.withPermits(1)(\n Effect.suspend(() =>\n latest === undefined || now() - measuredAt < Duration.toMillis(renewAfter)\n ? Effect.void\n : Effect.ignore(adopt(measure)),\n ),\n ),\n };\n};\n\nexport const toHostTime = (calibration: Estimate, browserEpochMillis: number): number =>\n browserEpochMillis - calibration.offsetMillis;\n\n/** CDP input timestamps use seconds, unlike browser frame timestamps and the owner's clock. */\nexport const toBrowserSeconds = (calibration: Estimate, hostMillis: number): number =>\n (hostMillis + calibration.offsetMillis) / 1000;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAQA,MAAa,mBAAmB,UAC9B,OAAO,MAAM,yBAAyB,CAAC,IAAI;;AAkB7C,MAAa,YAAY,WAA0D;CACjF,IAAI;CAEJ,KAAK,MAAM,SAAS,QAAQ;EAC1B,MAAM,kBAAkB,MAAM,UAAU,MAAM;EAE9C,IACE,CAAC,OAAO,SAAS,MAAM,SAAS,KAChC,CAAC,OAAO,SAAS,MAAM,OAAO,KAC9B,CAAC,OAAO,SAAS,MAAM,WAAW,KAClC,CAAC,OAAO,SAAS,eAAe,KAChC,kBAAkB,GAElB;EACF,MAAM,YAAY,MAAM,YAAY,kBAAkB;EACtD,MAAM,eAAe,MAAM,cAAc;EAEzC,IACE,CAAC,OAAO,SAAS,YAAY,KAC7B,CAAC,OAAO,SAAS,MAAM,cAAc,MAAM,SAAS,KACpD,CAAC,OAAO,SAAS,MAAM,cAAc,MAAM,OAAO,GAElD;EACF,IAAI,SAAS,KAAA,KAAa,kBAAkB,KAAK,iBAC/C,OAAO;GACL;GACA,mBAAmB,kBAAkB;GACrC;GACA;EACF;CACJ;CAEA,OAAO,OAAO,gBAAgB,IAAI;AACpC;AAIA,MAAM,iBAAiB;;AAGvB,MAAa,iBAAiB,UAAoB,aAChD,SAAS,oBAAoB,KAAK,IAAI,WAAW,SAAS,SAAS,IAAI;AAIzE,MAAM,aAAa,SAAS,QAAQ,EAAE;;;;;;;;AAyBtC,MAAa,cAAc,MAAgB,YAA+B;CACxE,MAAM,OAAO,cAAc,SAAS,KAAK,SAAS;CAElD,OACE,KAAK,qBAAqB,QAC1B,KAAK,IAAI,KAAK,eAAe,QAAQ,YAAY,IAAI,KAAK,oBAAoB;AAElF;;;;;AAMA,MAAa,WAAW,QAA+B;CACrD,IAAI;CACJ,IAAI,aAAa,OAAO;CACxB,MAAM,OAAO,UAAU,WAAW,CAAC;CAGnC,MAAM,SAAY,YAAwC;EACxD,aAAa,IAAI;EAEjB,OAAO,QAAQ,KACb,OAAO,KAAK,aAAa;GACvB,IAAI,WAAW,KAAA,KAAa,WAAW,UAAU,MAAM,GAAG,SAAS;GAEnE,OAAO;EACT,CAAC,CACH;CACF;CAEA,OAAO;EACL,cAAc;EACd,UAAU,YACR,OAAO,cACL,WAAW,KAAA,IACP,KAAK,YAAY,CAAC,CAAC,CACjB,OAAO,cACL,WAAW,KAAA,IAAY,MAAM,OAAO,IAAI,OAAO,QAAQ,MAAM,CAC/D,CACF,IACA,OAAO,QAAQ,MAAM,CAC3B;EACF,QAAQ,YACN,KAAK,YAAY,CAAC,CAAC,CACjB,OAAO,cACL,WAAW,KAAA,KAAa,IAAI,IAAI,aAAa,SAAS,SAAS,UAAU,IACrE,OAAO,OACP,OAAO,OAAO,MAAM,OAAO,CAAC,CAClC,CACF;CACJ;AACF;AAEA,MAAa,cAAc,aAAuB,uBAChD,qBAAqB,YAAY;;AAGnC,MAAa,oBAAoB,aAAuB,gBACrD,aAAa,YAAY,gBAAgB"}
@@ -1,6 +1,6 @@
1
1
  import { Schema } from "effect";
2
2
  declare namespace Frame_d_exports {
3
- export { BrowserPaint, CaptureStats, Frame, Image, ScreencastOptions, Screenshot };
3
+ export { BrowserPaint, CaptureStats, Frame, Image, ScreencastOptions, Screenshot, sameCapture };
4
4
  }
5
5
  declare const Image_base: Schema.Class<Image, Schema.Struct<{
6
6
  readonly data: Schema.Uint8Array;
@@ -29,6 +29,11 @@ declare const Frame_base: Schema.Class<Frame, Schema.Struct<{
29
29
  readonly session: Schema.String;
30
30
  /** Owning Browser connection; document counters restart on adoption or reattachment. */
31
31
  readonly connection: Schema.String;
32
+ /** Native capture identity. Screenshots have no capture generation or sequence. */
33
+ readonly capture: Schema.optionalKey<Schema.Struct<{
34
+ readonly generation: Schema.Int;
35
+ readonly sequence: Schema.Int;
36
+ }>>;
32
37
  readonly data: Schema.Uint8Array;
33
38
  readonly timing: Schema.Union<readonly [typeof BrowserPaint, typeof Screenshot]>;
34
39
  readonly receivedAt: Schema.Finite;
@@ -53,6 +58,8 @@ declare class Frame extends Frame_base {
53
58
  get hostTime(): number;
54
59
  get image(): Image;
55
60
  }
61
+ /** Equal capture lineage survives an image copy; untagged pictures retain object identity only. */
62
+ declare const sameCapture: (frame: Frame, other: Frame | undefined) => boolean;
56
63
  declare const CaptureStats_base: Schema.Class<CaptureStats, Schema.Struct<{
57
64
  readonly received: Schema.Int;
58
65
  readonly accepted: Schema.Int;
@@ -113,5 +120,5 @@ interface ScreencastOptions {
113
120
  } | undefined;
114
121
  }
115
122
  //#endregion
116
- export { Image as a, Frame_d_exports as i, CaptureStats as n, ScreencastOptions as o, Frame as r, Screenshot as s, BrowserPaint as t };
117
- //# sourceMappingURL=Frame-DkNdjjjr.d.mts.map
123
+ export { Image as a, sameCapture as c, Frame_d_exports as i, CaptureStats as n, ScreencastOptions as o, Frame as r, Screenshot as s, BrowserPaint as t };
124
+ //# sourceMappingURL=Frame-UEH2hO5T.d.mts.map
package/dist/Frame.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { a as Image, n as CaptureStats, o as ScreencastOptions, r as Frame, s as Screenshot, t as BrowserPaint } from "./Frame-DkNdjjjr.mjs";
2
- export { BrowserPaint, CaptureStats, Frame, Image, ScreencastOptions, Screenshot };
1
+ import { a as Image, c as sameCapture, n as CaptureStats, o as ScreencastOptions, r as Frame, s as Screenshot, t as BrowserPaint } from "./Frame-UEH2hO5T.mjs";
2
+ export { BrowserPaint, CaptureStats, Frame, Image, ScreencastOptions, Screenshot, sameCapture };
package/dist/Frame.mjs CHANGED
@@ -11,7 +11,8 @@ var Frame_exports = /* @__PURE__ */ __exportAll({
11
11
  CaptureStats: () => CaptureStats,
12
12
  Frame: () => Frame,
13
13
  Image: () => Image,
14
- Screenshot: () => Screenshot
14
+ Screenshot: () => Screenshot,
15
+ sameCapture: () => sameCapture
15
16
  });
16
17
  /** An encoded picture with its pixel dimensions. Crops also need their viewport origin. */
17
18
  var Image = class extends Schema.Class("effect-browser/Image")({
@@ -44,6 +45,11 @@ var Frame = class extends Schema.Class("effect-browser/Frame")({
44
45
  session: Schema.String,
45
46
  /** Owning Browser connection; document counters restart on adoption or reattachment. */
46
47
  connection: Schema.String.check(Schema.isNonEmpty()),
48
+ /** Native capture identity. Screenshots have no capture generation or sequence. */
49
+ capture: Schema.optionalKey(Schema.Struct({
50
+ generation: Count,
51
+ sequence: Count
52
+ })),
47
53
  data: Schema.Uint8Array,
48
54
  timing: Schema.Union([BrowserPaint, Screenshot]),
49
55
  receivedAt: Schema.Finite,
@@ -73,6 +79,8 @@ var Frame = class extends Schema.Class("effect-browser/Frame")({
73
79
  });
74
80
  }
75
81
  };
82
+ /** Equal capture lineage survives an image copy; untagged pictures retain object identity only. */
83
+ const sameCapture = (frame, other) => other !== void 0 && (frame === other || frame.capture !== void 0 && frame.page === other.page && frame.session === other.session && frame.connection === other.connection && frame.document === other.document && frame.capture.generation === other.capture?.generation && frame.capture.sequence === other.capture?.sequence);
76
84
  /**
77
85
  * A page's capture counts, over its life or a window of the latest minute: what Chromium sent,
78
86
  * what readers got, and why the rest went no further. Frames that came late are counted apart from
@@ -118,6 +126,6 @@ var CaptureStats = class extends Schema.Class("effect-browser/CaptureStats")({
118
126
  })
119
127
  }) {};
120
128
  //#endregion
121
- export { BrowserPaint, CaptureStats, Frame, Image, Screenshot, Frame_exports as t };
129
+ export { BrowserPaint, CaptureStats, Frame, Image, Screenshot, sameCapture, Frame_exports as t };
122
130
 
123
131
  //# sourceMappingURL=Frame.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"Frame.mjs","names":[],"sources":["../src/Frame.ts"],"sourcesContent":["/**\n * Pictures of a page: screenshots, and screencast frames stamped with the browser's clock.\n *\n * @since 0.3.0\n */\nimport { Schema } from \"effect\";\n\n/** An encoded picture with its pixel dimensions. Crops also need their viewport origin. */\nexport class Image extends Schema.Class<Image>(\"effect-browser/Image\")({\n data: Schema.Uint8Array,\n mediaType: Schema.Literals([\"image/jpeg\", \"image/png\"]),\n width: Schema.Finite,\n height: Schema.Finite,\n}) {}\n\nconst Nonnegative = Schema.Finite.check(Schema.isGreaterThanOrEqualTo(0));\nconst Count = Schema.Int.check(Schema.isGreaterThanOrEqualTo(0));\n\n/** Native CDP paint time mapped to the owning host clock, with transport uncertainty retained. */\nexport class BrowserPaint extends Schema.TaggedClass<BrowserPaint>()(\"BrowserPaint\", {\n timestamp: Schema.Finite,\n hostTime: Schema.Finite,\n uncertaintyMillis: Nonnegative,\n}) {}\n\n/** A screenshot's host capture interval; it has no native browser paint timestamp. */\nexport class Screenshot extends Schema.TaggedClass<Screenshot>()(\"Screenshot\", {\n hostTime: Schema.Finite,\n uncertaintyMillis: Nonnegative,\n}) {}\n\n/**\n * An image and its timing evidence. Paint time and screenshot capture time cannot be confused in\n * serialized data. `receivedAt` records delivery on the owning host's monotonic clock; it does\n * not make an old paint current.\n */\nexport class Frame extends Schema.Class<Frame>(\"effect-browser/Frame\")({\n page: Schema.String,\n /** The page's browser session: its provider's session id, as `Browser.Service.id` gives it. */\n session: Schema.String,\n /** Owning Browser connection; document counters restart on adoption or reattachment. */\n connection: Schema.String.check(Schema.isNonEmpty()),\n data: Schema.Uint8Array,\n timing: Schema.Union([BrowserPaint, Screenshot]),\n receivedAt: Schema.Finite,\n width: Schema.Finite,\n height: Schema.Finite,\n /**\n * The page's document committed before the frame arrived, as `Navigated` counts them. Just\n * after a commit a browser can still show the old document's paint, so a frame may show the\n * document before its own, never one after it.\n */\n document: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n /** The page's address when the frame arrived. */\n url: Schema.String,\n}) {\n get timestamp(): number | undefined {\n return this.timing._tag === \"BrowserPaint\" ? this.timing.timestamp : undefined;\n }\n\n get hostTime(): number {\n return this.timing.hostTime;\n }\n\n get image(): Image {\n return new Image({\n data: this.data,\n mediaType: \"image/jpeg\",\n width: this.width,\n height: this.height,\n });\n }\n}\n\n/**\n * A page's capture counts, over its life or a window of the latest minute: what Chromium sent,\n * what readers got, and why the rest went no further. Frames that came late are counted apart from\n * those a reader lost.\n */\nexport class CaptureStats extends Schema.Class<CaptureStats>(\"effect-browser/CaptureStats\")({\n received: Count,\n accepted: Count,\n /**\n * Frames Chromium finished encoding after a newer one, dropped rather than reordered. It encodes\n * several at once, so a busy machine makes more of them; none was a paint readers missed.\n */\n late: Count,\n missingTimestamp: Count,\n /**\n * Frames dropped for their size. Most are other captures' frames, which a clipped screenshot\n * draws into a screencast. The rest are the page's own frames of a new size, dropped while still\n * unconfirmed: when another size replaced it, when its capture stopped, or beyond the 16 held.\n */\n foreignSize: Count,\n /**\n * Frames discarded while native capture is paused for a library picture and its restoration.\n * A pause can produce no callbacks, so this count may remain zero even when pictures were taken.\n */\n duringPictures: Count,\n /**\n * Frames a reader missed by falling behind. Each reader counts its own, so with several readers\n * this can exceed the frames accepted.\n */\n lost: Count,\n /**\n * Acknowledgements of frames sent and not yet answered, now, whatever the window. Chromium sends\n * a frame only while few are unacknowledged, so a backlog means fewer frames.\n */\n ackBacklog: Count,\n /** Paint-time gaps between consecutive accepted frames. */\n gaps: Schema.Struct({\n count: Count,\n totalMillis: Nonnegative,\n minMillis: Schema.NullOr(Nonnegative),\n maxMillis: Schema.NullOr(Nonnegative),\n lastMillis: Schema.NullOr(Nonnegative),\n }),\n}) {}\n\n/**\n * Settings for a page's one native capture. Readers that join a running capture share its\n * settings: one without options accepts them, and one whose explicit options differ fails with\n * `InvalidRequest`.\n */\nexport interface ScreencastOptions {\n /** JPEG quality, 0 to 100. Defaults to 80. */\n readonly quality?: number | undefined;\n /** Frames are scaled down to fit this box. Defaults to the viewport in CSS pixels. */\n readonly size?: { readonly width: number; readonly height: number } | undefined;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAQA,IAAa,QAAb,cAA2B,OAAO,MAAa,sBAAsB,CAAC,CAAC;CACrE,MAAM,OAAO;CACb,WAAW,OAAO,SAAS,CAAC,cAAc,WAAW,CAAC;CACtD,OAAO,OAAO;CACd,QAAQ,OAAO;AACjB,CAAC,CAAC,CAAC,CAAC;AAEJ,MAAM,cAAc,OAAO,OAAO,MAAM,OAAO,uBAAuB,CAAC,CAAC;AACxE,MAAM,QAAQ,OAAO,IAAI,MAAM,OAAO,uBAAuB,CAAC,CAAC;;AAG/D,IAAa,eAAb,cAAkC,OAAO,YAA0B,CAAC,CAAC,gBAAgB;CACnF,WAAW,OAAO;CAClB,UAAU,OAAO;CACjB,mBAAmB;AACrB,CAAC,CAAC,CAAC,CAAC;;AAGJ,IAAa,aAAb,cAAgC,OAAO,YAAwB,CAAC,CAAC,cAAc;CAC7E,UAAU,OAAO;CACjB,mBAAmB;AACrB,CAAC,CAAC,CAAC,CAAC;;;;;;AAOJ,IAAa,QAAb,cAA2B,OAAO,MAAa,sBAAsB,CAAC,CAAC;CACrE,MAAM,OAAO;;CAEb,SAAS,OAAO;;CAEhB,YAAY,OAAO,OAAO,MAAM,OAAO,WAAW,CAAC;CACnD,MAAM,OAAO;CACb,QAAQ,OAAO,MAAM,CAAC,cAAc,UAAU,CAAC;CAC/C,YAAY,OAAO;CACnB,OAAO,OAAO;CACd,QAAQ,OAAO;;;;;;CAMf,UAAU,OAAO,IAAI,MAAM,OAAO,uBAAuB,CAAC,CAAC;;CAE3D,KAAK,OAAO;AACd,CAAC,CAAC,CAAC;CACD,IAAI,YAAgC;EAClC,OAAO,KAAK,OAAO,SAAS,iBAAiB,KAAK,OAAO,YAAY,KAAA;CACvE;CAEA,IAAI,WAAmB;EACrB,OAAO,KAAK,OAAO;CACrB;CAEA,IAAI,QAAe;EACjB,OAAO,IAAI,MAAM;GACf,MAAM,KAAK;GACX,WAAW;GACX,OAAO,KAAK;GACZ,QAAQ,KAAK;EACf,CAAC;CACH;AACF;;;;;;AAOA,IAAa,eAAb,cAAkC,OAAO,MAAoB,6BAA6B,CAAC,CAAC;CAC1F,UAAU;CACV,UAAU;;;;;CAKV,MAAM;CACN,kBAAkB;;;;;;CAMlB,aAAa;;;;;CAKb,gBAAgB;;;;;CAKhB,MAAM;;;;;CAKN,YAAY;;CAEZ,MAAM,OAAO,OAAO;EAClB,OAAO;EACP,aAAa;EACb,WAAW,OAAO,OAAO,WAAW;EACpC,WAAW,OAAO,OAAO,WAAW;EACpC,YAAY,OAAO,OAAO,WAAW;CACvC,CAAC;AACH,CAAC,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"Frame.mjs","names":[],"sources":["../src/Frame.ts"],"sourcesContent":["/**\n * Pictures of a page: screenshots, and screencast frames stamped with the browser's clock.\n *\n * @since 0.3.0\n */\nimport { Schema } from \"effect\";\n\n/** An encoded picture with its pixel dimensions. Crops also need their viewport origin. */\nexport class Image extends Schema.Class<Image>(\"effect-browser/Image\")({\n data: Schema.Uint8Array,\n mediaType: Schema.Literals([\"image/jpeg\", \"image/png\"]),\n width: Schema.Finite,\n height: Schema.Finite,\n}) {}\n\nconst Nonnegative = Schema.Finite.check(Schema.isGreaterThanOrEqualTo(0));\nconst Count = Schema.Int.check(Schema.isGreaterThanOrEqualTo(0));\n\n/** Native CDP paint time mapped to the owning host clock, with transport uncertainty retained. */\nexport class BrowserPaint extends Schema.TaggedClass<BrowserPaint>()(\"BrowserPaint\", {\n timestamp: Schema.Finite,\n hostTime: Schema.Finite,\n uncertaintyMillis: Nonnegative,\n}) {}\n\n/** A screenshot's host capture interval; it has no native browser paint timestamp. */\nexport class Screenshot extends Schema.TaggedClass<Screenshot>()(\"Screenshot\", {\n hostTime: Schema.Finite,\n uncertaintyMillis: Nonnegative,\n}) {}\n\n/**\n * An image and its timing evidence. Paint time and screenshot capture time cannot be confused in\n * serialized data. `receivedAt` records delivery on the owning host's monotonic clock; it does\n * not make an old paint current.\n */\nexport class Frame extends Schema.Class<Frame>(\"effect-browser/Frame\")({\n page: Schema.String,\n /** The page's browser session: its provider's session id, as `Browser.Service.id` gives it. */\n session: Schema.String,\n /** Owning Browser connection; document counters restart on adoption or reattachment. */\n connection: Schema.String.check(Schema.isNonEmpty()),\n /** Native capture identity. Screenshots have no capture generation or sequence. */\n capture: Schema.optionalKey(Schema.Struct({ generation: Count, sequence: Count })),\n data: Schema.Uint8Array,\n timing: Schema.Union([BrowserPaint, Screenshot]),\n receivedAt: Schema.Finite,\n width: Schema.Finite,\n height: Schema.Finite,\n /**\n * The page's document committed before the frame arrived, as `Navigated` counts them. Just\n * after a commit a browser can still show the old document's paint, so a frame may show the\n * document before its own, never one after it.\n */\n document: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n /** The page's address when the frame arrived. */\n url: Schema.String,\n}) {\n get timestamp(): number | undefined {\n return this.timing._tag === \"BrowserPaint\" ? this.timing.timestamp : undefined;\n }\n\n get hostTime(): number {\n return this.timing.hostTime;\n }\n\n get image(): Image {\n return new Image({\n data: this.data,\n mediaType: \"image/jpeg\",\n width: this.width,\n height: this.height,\n });\n }\n}\n\n/** Equal capture lineage survives an image copy; untagged pictures retain object identity only. */\nexport const sameCapture = (frame: Frame, other: Frame | undefined): boolean =>\n other !== undefined &&\n (frame === other ||\n (frame.capture !== undefined &&\n frame.page === other.page &&\n frame.session === other.session &&\n frame.connection === other.connection &&\n frame.document === other.document &&\n frame.capture.generation === other.capture?.generation &&\n frame.capture.sequence === other.capture?.sequence));\n\n/**\n * A page's capture counts, over its life or a window of the latest minute: what Chromium sent,\n * what readers got, and why the rest went no further. Frames that came late are counted apart from\n * those a reader lost.\n */\nexport class CaptureStats extends Schema.Class<CaptureStats>(\"effect-browser/CaptureStats\")({\n received: Count,\n accepted: Count,\n /**\n * Frames Chromium finished encoding after a newer one, dropped rather than reordered. It encodes\n * several at once, so a busy machine makes more of them; none was a paint readers missed.\n */\n late: Count,\n missingTimestamp: Count,\n /**\n * Frames dropped for their size. Most are other captures' frames, which a clipped screenshot\n * draws into a screencast. The rest are the page's own frames of a new size, dropped while still\n * unconfirmed: when another size replaced it, when its capture stopped, or beyond the 16 held.\n */\n foreignSize: Count,\n /**\n * Frames discarded while native capture is paused for a library picture and its restoration.\n * A pause can produce no callbacks, so this count may remain zero even when pictures were taken.\n */\n duringPictures: Count,\n /**\n * Frames a reader missed by falling behind. Each reader counts its own, so with several readers\n * this can exceed the frames accepted.\n */\n lost: Count,\n /**\n * Acknowledgements of frames sent and not yet answered, now, whatever the window. Chromium sends\n * a frame only while few are unacknowledged, so a backlog means fewer frames.\n */\n ackBacklog: Count,\n /** Paint-time gaps between consecutive accepted frames. */\n gaps: Schema.Struct({\n count: Count,\n totalMillis: Nonnegative,\n minMillis: Schema.NullOr(Nonnegative),\n maxMillis: Schema.NullOr(Nonnegative),\n lastMillis: Schema.NullOr(Nonnegative),\n }),\n}) {}\n\n/**\n * Settings for a page's one native capture. Readers that join a running capture share its\n * settings: one without options accepts them, and one whose explicit options differ fails with\n * `InvalidRequest`.\n */\nexport interface ScreencastOptions {\n /** JPEG quality, 0 to 100. Defaults to 80. */\n readonly quality?: number | undefined;\n /** Frames are scaled down to fit this box. Defaults to the viewport in CSS pixels. */\n readonly size?: { readonly width: number; readonly height: number } | undefined;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAQA,IAAa,QAAb,cAA2B,OAAO,MAAa,sBAAsB,CAAC,CAAC;CACrE,MAAM,OAAO;CACb,WAAW,OAAO,SAAS,CAAC,cAAc,WAAW,CAAC;CACtD,OAAO,OAAO;CACd,QAAQ,OAAO;AACjB,CAAC,CAAC,CAAC,CAAC;AAEJ,MAAM,cAAc,OAAO,OAAO,MAAM,OAAO,uBAAuB,CAAC,CAAC;AACxE,MAAM,QAAQ,OAAO,IAAI,MAAM,OAAO,uBAAuB,CAAC,CAAC;;AAG/D,IAAa,eAAb,cAAkC,OAAO,YAA0B,CAAC,CAAC,gBAAgB;CACnF,WAAW,OAAO;CAClB,UAAU,OAAO;CACjB,mBAAmB;AACrB,CAAC,CAAC,CAAC,CAAC;;AAGJ,IAAa,aAAb,cAAgC,OAAO,YAAwB,CAAC,CAAC,cAAc;CAC7E,UAAU,OAAO;CACjB,mBAAmB;AACrB,CAAC,CAAC,CAAC,CAAC;;;;;;AAOJ,IAAa,QAAb,cAA2B,OAAO,MAAa,sBAAsB,CAAC,CAAC;CACrE,MAAM,OAAO;;CAEb,SAAS,OAAO;;CAEhB,YAAY,OAAO,OAAO,MAAM,OAAO,WAAW,CAAC;;CAEnD,SAAS,OAAO,YAAY,OAAO,OAAO;EAAE,YAAY;EAAO,UAAU;CAAM,CAAC,CAAC;CACjF,MAAM,OAAO;CACb,QAAQ,OAAO,MAAM,CAAC,cAAc,UAAU,CAAC;CAC/C,YAAY,OAAO;CACnB,OAAO,OAAO;CACd,QAAQ,OAAO;;;;;;CAMf,UAAU,OAAO,IAAI,MAAM,OAAO,uBAAuB,CAAC,CAAC;;CAE3D,KAAK,OAAO;AACd,CAAC,CAAC,CAAC;CACD,IAAI,YAAgC;EAClC,OAAO,KAAK,OAAO,SAAS,iBAAiB,KAAK,OAAO,YAAY,KAAA;CACvE;CAEA,IAAI,WAAmB;EACrB,OAAO,KAAK,OAAO;CACrB;CAEA,IAAI,QAAe;EACjB,OAAO,IAAI,MAAM;GACf,MAAM,KAAK;GACX,WAAW;GACX,OAAO,KAAK;GACZ,QAAQ,KAAK;EACf,CAAC;CACH;AACF;;AAGA,MAAa,eAAe,OAAc,UACxC,UAAU,KAAA,MACT,UAAU,SACR,MAAM,YAAY,KAAA,KACjB,MAAM,SAAS,MAAM,QACrB,MAAM,YAAY,MAAM,WACxB,MAAM,eAAe,MAAM,cAC3B,MAAM,aAAa,MAAM,YACzB,MAAM,QAAQ,eAAe,MAAM,SAAS,cAC5C,MAAM,QAAQ,aAAa,MAAM,SAAS;;;;;;AAOhD,IAAa,eAAb,cAAkC,OAAO,MAAoB,6BAA6B,CAAC,CAAC;CAC1F,UAAU;CACV,UAAU;;;;;CAKV,MAAM;CACN,kBAAkB;;;;;;CAMlB,aAAa;;;;;CAKb,gBAAgB;;;;;CAKhB,MAAM;;;;;CAKN,YAAY;;CAEZ,MAAM,OAAO,OAAO;EAClB,OAAO;EACP,aAAa;EACb,WAAW,OAAO,OAAO,WAAW;EACpC,WAAW,OAAO,OAAO,WAAW;EACpC,YAAY,OAAO,OAAO,WAAW;CACvC,CAAC;AACH,CAAC,CAAC,CAAC,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { Effect, Schema } from "effect";
2
- declare namespace Motion_d_exports {
3
- export { Plan, Point, Sample, Service, lognormal, maximumDurationMillis, maximumSamples };
2
+ declare namespace Geometry_d_exports {
3
+ export { Plan, Planner, Point, Sample, maximumDurationMillis, maximumSamples, normal };
4
4
  }
5
5
  declare const maximumSamples = 2048;
6
6
  declare const maximumDurationMillis = 5000;
@@ -22,7 +22,7 @@ declare const Plan: Schema.$Array<Schema.Struct<{
22
22
  readonly afterMillis: Schema.Finite;
23
23
  }>>;
24
24
  type Plan = typeof Plan.Type;
25
- interface Service {
25
+ interface Planner {
26
26
  /**
27
27
  * Offsets start when the performer publishes the plan, before its first input. The browser
28
28
  * decodes the result as a `Plan` whose last sample must be exactly `to`. Glide time has a budget
@@ -30,11 +30,8 @@ interface Service {
30
30
  */
31
31
  readonly plan: (from: Point, to: Point) => Effect.Effect<ReadonlyArray<Sample>>;
32
32
  }
33
- /**
34
- * The research's tuned two-stroke sigma-lognormal model: a fast stroke toward the target and a
35
- * slower one that homes in on it, with a little bend, drawn from `Random`.
36
- */
37
- declare const lognormal: Service;
33
+ /** One standard normal draw from the current seeded Effect random source. */
34
+ declare const normal: Effect.Effect<number, never, never>;
38
35
  //#endregion
39
- export { Service as a, maximumSamples as c, Sample as i, Plan as n, lognormal as o, Point as r, maximumDurationMillis as s, Motion_d_exports as t };
40
- //# sourceMappingURL=Motion-DND6I-64.d.mts.map
36
+ export { Sample as a, normal as c, Point as i, Plan as n, maximumDurationMillis as o, Planner as r, maximumSamples as s, Geometry_d_exports as t };
37
+ //# sourceMappingURL=Geometry-DJx9qrYy.d.mts.map
@@ -0,0 +1,2 @@
1
+ import { a as Sample, c as normal, i as Point, n as Plan, o as maximumDurationMillis, r as Planner, s as maximumSamples } from "./Geometry-DJx9qrYy.mjs";
2
+ export { Plan, Planner, Point, Sample, maximumDurationMillis, maximumSamples, normal };
@@ -0,0 +1,32 @@
1
+ import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
2
+ import { Effect, Random, Schema } from "effect";
3
+ //#region src/Geometry.ts
4
+ /** Viewport geometry and bounded input schedules, independent of presentation planners. */
5
+ var Geometry_exports = /* @__PURE__ */ __exportAll({
6
+ Plan: () => Plan,
7
+ Point: () => Point,
8
+ Sample: () => Sample,
9
+ maximumDurationMillis: () => maximumDurationMillis,
10
+ maximumSamples: () => maximumSamples,
11
+ normal: () => normal
12
+ });
13
+ const maximumSamples = 2048;
14
+ const maximumDurationMillis = 5e3;
15
+ const Point = Schema.Struct({
16
+ x: Schema.Finite,
17
+ y: Schema.Finite
18
+ });
19
+ const Sample = Schema.Struct({
20
+ ...Point.fields,
21
+ afterMillis: Schema.Finite.check(Schema.isGreaterThanOrEqualTo(0), Schema.isLessThanOrEqualTo(maximumDurationMillis))
22
+ });
23
+ /** A complete glide: 1 to 2,048 samples whose offsets never decrease. */
24
+ const Plan = Schema.Array(Sample).check(Schema.isBetweenLength(1, maximumSamples), Schema.makeFilter((samples) => samples.every((sample, index) => sample.afterMillis >= (samples[index - 1]?.afterMillis ?? 0)), { expected: "nondecreasing sample offsets" }));
25
+ /** One standard normal draw from the current seeded Effect random source. */
26
+ const normal = Effect.gen(function* () {
27
+ return Math.sqrt(-2 * Math.log(1 - (yield* Random.next))) * Math.cos(2 * Math.PI * (yield* Random.next));
28
+ });
29
+ //#endregion
30
+ export { Plan, Point, Sample, maximumDurationMillis, maximumSamples, normal, Geometry_exports as t };
31
+
32
+ //# sourceMappingURL=Geometry.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Geometry.mjs","names":[],"sources":["../src/Geometry.ts"],"sourcesContent":["/** Viewport geometry and bounded input schedules, independent of presentation planners. */\nimport { Effect, Random, Schema } from \"effect\";\n\nexport const maximumSamples = 2048;\nexport const maximumDurationMillis = 5000;\n\nexport const Point = Schema.Struct({ x: Schema.Finite, y: Schema.Finite });\nexport type Point = typeof Point.Type;\n\nexport const Sample = Schema.Struct({\n ...Point.fields,\n afterMillis: Schema.Finite.check(\n Schema.isGreaterThanOrEqualTo(0),\n Schema.isLessThanOrEqualTo(maximumDurationMillis),\n ),\n});\n\nexport type Sample = typeof Sample.Type;\n\n/** A complete glide: 1 to 2,048 samples whose offsets never decrease. */\nexport const Plan = Schema.Array(Sample).check(\n Schema.isBetweenLength(1, maximumSamples),\n Schema.makeFilter(\n (samples) =>\n samples.every(\n (sample, index) => sample.afterMillis >= (samples[index - 1]?.afterMillis ?? 0),\n ),\n { expected: \"nondecreasing sample offsets\" },\n ),\n);\n\nexport type Plan = typeof Plan.Type;\n\nexport interface Planner {\n /**\n * Offsets start when the performer publishes the plan, before its first input. The browser\n * decodes the result as a `Plan` whose last sample must be exactly `to`. Glide time has a budget\n * of its own, outside the browser's `actionTimeout`, so a drag may glide twice for 5 seconds.\n */\n readonly plan: (from: Point, to: Point) => Effect.Effect<ReadonlyArray<Sample>>;\n}\n\n/** One standard normal draw from the current seeded Effect random source. */\nexport const normal = Effect.gen(function* () {\n const radius = Math.sqrt(-2 * Math.log(1 - (yield* Random.next)));\n\n return radius * Math.cos(2 * Math.PI * (yield* Random.next));\n});\n"],"mappings":";;;;;;;;;;;;AAGA,MAAa,iBAAiB;AAC9B,MAAa,wBAAwB;AAErC,MAAa,QAAQ,OAAO,OAAO;CAAE,GAAG,OAAO;CAAQ,GAAG,OAAO;AAAO,CAAC;AAGzE,MAAa,SAAS,OAAO,OAAO;CAClC,GAAG,MAAM;CACT,aAAa,OAAO,OAAO,MACzB,OAAO,uBAAuB,CAAC,GAC/B,OAAO,oBAAoB,qBAAqB,CAClD;AACF,CAAC;;AAKD,MAAa,OAAO,OAAO,MAAM,MAAM,CAAC,CAAC,MACvC,OAAO,gBAAgB,GAAG,cAAc,GACxC,OAAO,YACJ,YACC,QAAQ,OACL,QAAQ,UAAU,OAAO,gBAAgB,QAAQ,QAAQ,EAAE,EAAE,eAAe,EAC/E,GACF,EAAE,UAAU,+BAA+B,CAC7C,CACF;;AAcA,MAAa,SAAS,OAAO,IAAI,aAAa;CAG5C,OAFe,KAAK,KAAK,KAAK,KAAK,IAAI,KAAK,OAAO,OAAO,KAAK,CAEnD,IAAI,KAAK,IAAI,IAAI,KAAK,MAAM,OAAO,OAAO,KAAK;AAC7D,CAAC"}
@@ -0,0 +1,28 @@
1
+ %% jpeg-js@0.4.4 NOTICES AND INFORMATION BEGIN HERE
2
+ =========================================
3
+ Copyright (c) 2014, Eugene Ware
4
+ All rights reserved.
5
+
6
+ Redistribution and use in source and binary forms, with or without
7
+ modification, are permitted provided that the following conditions are met:
8
+
9
+ 1. Redistributions of source code must retain the above copyright
10
+ notice, this list of conditions and the following disclaimer.
11
+ 2. Redistributions in binary form must reproduce the above copyright
12
+ notice, this list of conditions and the following disclaimer in the
13
+ documentation and/or other materials provided with the distribution.
14
+ 3. Neither the name of Eugene Ware nor the names of its contributors
15
+ may be used to endorse or promote products derived from this software
16
+ without specific prior written permission.
17
+
18
+ THIS SOFTWARE IS PROVIDED BY EUGENE WARE ''AS IS'' AND ANY
19
+ EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21
+ DISCLAIMED. IN NO EVENT SHALL EUGENE WARE BE LIABLE FOR ANY
22
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
25
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
+ =========================================
@@ -0,0 +1,37 @@
1
+ import { x as SubjectContext } from "./BrowserEvent-lLqJ3GJS.mjs";
2
+ import { i as Point } from "./Geometry-DJx9qrYy.mjs";
3
+ import { s as FindQuery } from "./Page-CvsOEorc.mjs";
4
+ //#region src/Matching.d.ts
5
+ /** A string, or a pattern sent to the page as its source and flags. */
6
+ export type Wanted = string | {
7
+ readonly source: string;
8
+ readonly flags: string;
9
+ };
10
+ export interface FindRequest {
11
+ readonly selector: string | null;
12
+ readonly state: "visible" | "enabled";
13
+ readonly role: string | null;
14
+ readonly name: Wanted | null;
15
+ readonly text: Wanted | null;
16
+ readonly near: string | null;
17
+ readonly at: Point | null;
18
+ readonly scope: "viewport" | "document";
19
+ }
20
+ /** A public query in its serializable, fully specified form. */
21
+ export declare const request: (query: FindQuery, scope: FindRequest["scope"]) => FindRequest;
22
+ /** What a query is matched against, read only when a rule needs it. */
23
+ export interface Candidate {
24
+ readonly role: string | null;
25
+ readonly name: () => string;
26
+ readonly text: () => string;
27
+ readonly context: () => SubjectContext;
28
+ }
29
+ export declare const match: () => {
30
+ compile: (request: Pick<FindRequest, "role" | "name" | "text" | "near">) => (candidate: Candidate) => boolean;
31
+ holds: (text: string, value: string) => boolean;
32
+ normalize: (value: string) => string;
33
+ mark: (observations: ReadonlyArray<string>) => string;
34
+ };
35
+ export type Match = ReturnType<typeof match>;
36
+ //#endregion
37
+ //# sourceMappingURL=Matching.d.mts.map
@@ -1,4 +1,21 @@
1
- //#region src/internal/reading/match.inpage.ts
1
+ //#region src/Matching.ts
2
+ /** A public query in its serializable, fully specified form. */
3
+ const request = (query, scope) => {
4
+ const wanted = (value) => value instanceof RegExp ? {
5
+ source: value.source,
6
+ flags: value.flags
7
+ } : value ?? null;
8
+ return {
9
+ selector: query.selector ?? null,
10
+ state: query.state ?? "visible",
11
+ role: query.role ?? null,
12
+ name: wanted(query.name),
13
+ text: wanted(query.text),
14
+ near: query.near ?? null,
15
+ at: query.at ?? null,
16
+ scope: query.scope ?? scope
17
+ };
18
+ };
2
19
  const match = () => {
3
20
  /**
4
21
  * How names, text and context compare: one Unicode form, without invisible format characters,
@@ -36,13 +53,20 @@ const match = () => {
36
53
  ].some((value) => value !== void 0 && holds(value, near));
37
54
  };
38
55
  };
56
+ /** A comparison token for ordered observations, without retaining their text. */
57
+ const mark = (observations) => {
58
+ let hash = 2166136261;
59
+ for (const shown of observations) for (let index = 0; index < shown.length; index++) hash = Math.imul(hash ^ shown.charCodeAt(index), 16777619);
60
+ return `${observations.length}:${(hash >>> 0).toString(16)}`;
61
+ };
39
62
  return {
40
63
  compile,
41
64
  holds,
42
- normalize
65
+ normalize,
66
+ mark
43
67
  };
44
68
  };
45
69
  //#endregion
46
- export { match as t };
70
+ export { match, request };
47
71
 
48
- //# sourceMappingURL=match.inpage-xOe9LNO0.mjs.map
72
+ //# sourceMappingURL=Matching.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Matching.mjs","names":[],"sources":["../src/Matching.ts"],"sourcesContent":["/**\n * In the page: the rules `find` matches by. It touches no DOM, so it also runs outside a page.\n *\n * - A role matches when it is the same token, ignoring case and the space around it.\n * - A name given as a string matches when the two read the same once their spaces are collapsed,\n * their case folded and their characters given one Unicode form; a pattern matches when it\n * finds itself in the name.\n * - Text matches when it appears, read the same way, in the element's text.\n * - `near` matches when its words appear, whole and in order, in any of the element's context:\n * its row, column, label or heading. Replay chooses among candidates by the same rule.\n */\nimport type { SubjectContext } from \"./BrowserEvent.ts\";\nimport type { Point } from \"./Geometry.ts\";\nimport type { FindQuery } from \"./Page.ts\";\n\n/** A string, or a pattern sent to the page as its source and flags. */\nexport type Wanted = string | { readonly source: string; readonly flags: string };\n\nexport interface FindRequest {\n readonly selector: string | null;\n readonly state: \"visible\" | \"enabled\";\n readonly role: string | null;\n readonly name: Wanted | null;\n readonly text: Wanted | null;\n readonly near: string | null;\n readonly at: Point | null;\n readonly scope: \"viewport\" | \"document\";\n}\n\n/** A public query in its serializable, fully specified form. */\nexport const request = (query: FindQuery, scope: FindRequest[\"scope\"]): FindRequest => {\n const wanted = (value: string | RegExp | undefined): Wanted | null =>\n value instanceof RegExp ? { source: value.source, flags: value.flags } : (value ?? null);\n\n return {\n selector: query.selector ?? null,\n state: query.state ?? \"visible\",\n role: query.role ?? null,\n name: wanted(query.name),\n text: wanted(query.text),\n near: query.near ?? null,\n at: query.at ?? null,\n scope: query.scope ?? scope,\n };\n};\n\n/** What a query is matched against, read only when a rule needs it. */\nexport interface Candidate {\n readonly role: string | null;\n readonly name: () => string;\n readonly text: () => string;\n readonly context: () => SubjectContext;\n}\n\nexport const match = () => {\n /**\n * How names, text and context compare: one Unicode form, without invisible format characters,\n * spaces collapsed, and case folded upper first, so that \"ß\" and \"SS\" read the same.\n */\n const normalize = (value: string): string =>\n value\n .normalize(\"NFKC\")\n .replace(/\\p{Cf}/gu, \"\")\n .replace(/\\s+/g, \" \")\n .trim()\n .toUpperCase()\n .toLowerCase();\n\n /** A string that reads the same, or, unless `whole`, appears within; or a pattern found within. */\n const rule = (wanted: Wanted, whole: boolean) => {\n if (typeof wanted !== \"string\") {\n // `g` and `y` keep a position from one test to the next, so one pattern would answer\n // differently for each element. A pattern is tried on the text as the page shows it.\n const found = new RegExp(wanted.source, wanted.flags.replace(/[gy]/g, \"\"));\n\n return (value: string) => found.test(value.replace(/\\s+/g, \" \").trim());\n }\n const target = normalize(wanted);\n\n return whole\n ? (value: string) => normalize(value) === target\n : (value: string) => normalize(value).includes(target);\n };\n\n /** Whether a value's words appear, whole and in order, among a text's: \"BTC\" not in \"WBTC\". */\n const holds = (text: string, value: string) =>\n ` ${normalize(text)} `.includes(` ${normalize(value)} `);\n\n /** Whether a candidate meets every rule a query gives; a rule left out always holds. */\n const compile = (request: Pick<FindRequest, \"role\" | \"name\" | \"text\" | \"near\">) => {\n const role = request.role === null ? null : normalize(request.role);\n const name = request.name === null ? null : rule(request.name, true);\n const text = request.text === null ? null : rule(request.text, false);\n const { near } = request;\n\n return (candidate: Candidate): boolean => {\n if (role !== null && normalize(candidate.role ?? \"\") !== role) return false;\n if (text !== null && !text(candidate.text())) return false;\n if (name !== null && !name(candidate.name())) return false;\n if (near === null) return true;\n const { row, column, label, heading } = candidate.context();\n\n return [row, column, label, heading].some(\n (value) => value !== undefined && holds(value, near),\n );\n };\n };\n\n /** A comparison token for ordered observations, without retaining their text. */\n const mark = (observations: ReadonlyArray<string>): string => {\n let hash = 0x811c9dc5;\n\n for (const shown of observations)\n for (let index = 0; index < shown.length; index++)\n hash = Math.imul(hash ^ shown.charCodeAt(index), 0x01000193);\n\n return `${observations.length}:${(hash >>> 0).toString(16)}`;\n };\n\n return { compile, holds, normalize, mark };\n};\n\nexport type Match = ReturnType<typeof match>;\n"],"mappings":";;AA8BA,MAAa,WAAW,OAAkB,UAA6C;CACrF,MAAM,UAAU,UACd,iBAAiB,SAAS;EAAE,QAAQ,MAAM;EAAQ,OAAO,MAAM;CAAM,IAAK,SAAS;CAErF,OAAO;EACL,UAAU,MAAM,YAAY;EAC5B,OAAO,MAAM,SAAS;EACtB,MAAM,MAAM,QAAQ;EACpB,MAAM,OAAO,MAAM,IAAI;EACvB,MAAM,OAAO,MAAM,IAAI;EACvB,MAAM,MAAM,QAAQ;EACpB,IAAI,MAAM,MAAM;EAChB,OAAO,MAAM,SAAS;CACxB;AACF;AAUA,MAAa,cAAc;;;;;CAKzB,MAAM,aAAa,UACjB,MACG,UAAU,MAAM,CAAC,CACjB,QAAQ,YAAY,EAAE,CAAC,CACvB,QAAQ,QAAQ,GAAG,CAAC,CACpB,KAAK,CAAC,CACN,YAAY,CAAC,CACb,YAAY;;CAGjB,MAAM,QAAQ,QAAgB,UAAmB;EAC/C,IAAI,OAAO,WAAW,UAAU;GAG9B,MAAM,QAAQ,IAAI,OAAO,OAAO,QAAQ,OAAO,MAAM,QAAQ,SAAS,EAAE,CAAC;GAEzE,QAAQ,UAAkB,MAAM,KAAK,MAAM,QAAQ,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC;EACxE;EACA,MAAM,SAAS,UAAU,MAAM;EAE/B,OAAO,SACF,UAAkB,UAAU,KAAK,MAAM,UACvC,UAAkB,UAAU,KAAK,CAAC,CAAC,SAAS,MAAM;CACzD;;CAGA,MAAM,SAAS,MAAc,UAC3B,IAAI,UAAU,IAAI,EAAE,GAAG,SAAS,IAAI,UAAU,KAAK,EAAE,EAAE;;CAGzD,MAAM,WAAW,YAAkE;EACjF,MAAM,OAAO,QAAQ,SAAS,OAAO,OAAO,UAAU,QAAQ,IAAI;EAClE,MAAM,OAAO,QAAQ,SAAS,OAAO,OAAO,KAAK,QAAQ,MAAM,IAAI;EACnE,MAAM,OAAO,QAAQ,SAAS,OAAO,OAAO,KAAK,QAAQ,MAAM,KAAK;EACpE,MAAM,EAAE,SAAS;EAEjB,QAAQ,cAAkC;GACxC,IAAI,SAAS,QAAQ,UAAU,UAAU,QAAQ,EAAE,MAAM,MAAM,OAAO;GACtE,IAAI,SAAS,QAAQ,CAAC,KAAK,UAAU,KAAK,CAAC,GAAG,OAAO;GACrD,IAAI,SAAS,QAAQ,CAAC,KAAK,UAAU,KAAK,CAAC,GAAG,OAAO;GACrD,IAAI,SAAS,MAAM,OAAO;GAC1B,MAAM,EAAE,KAAK,QAAQ,OAAO,YAAY,UAAU,QAAQ;GAE1D,OAAO;IAAC;IAAK;IAAQ;IAAO;GAAO,CAAC,CAAC,MAClC,UAAU,UAAU,KAAA,KAAa,MAAM,OAAO,IAAI,CACrD;EACF;CACF;;CAGA,MAAM,QAAQ,iBAAgD;EAC5D,IAAI,OAAO;EAEX,KAAK,MAAM,SAAS,cAClB,KAAK,IAAI,QAAQ,GAAG,QAAQ,MAAM,QAAQ,SACxC,OAAO,KAAK,KAAK,OAAO,MAAM,WAAW,KAAK,GAAG,QAAU;EAE/D,OAAO,GAAG,aAAa,OAAO,IAAI,SAAS,EAAA,CAAG,SAAS,EAAE;CAC3D;CAEA,OAAO;EAAE;EAAS;EAAO;EAAW;CAAK;AAC3C"}