@checkly/playwright-core 1.48.24-maxi → 1.48.25-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. package/lib/generated/bindingsControllerSource.js +7 -0
  2. package/lib/generated/storageScriptSource.js +7 -0
  3. package/lib/server/har/harRecorder.js +3 -1
  4. package/lib/server/trace/recorder/tracing.js +9 -20
  5. package/lib/utils/fileUtils.js +65 -2
  6. package/lib/vite/{traceViewer/assets/codeMirrorModule-tzBrK1V4.js → recorder/assets/codeMirrorModule-baozm8ur.js} +10 -10
  7. package/lib/vite/recorder/assets/{index-BcaUAUCW.js → index-2ElAIWFB.js} +2 -2
  8. package/lib/vite/recorder/index.html +1 -1
  9. package/lib/vite/traceViewer/assets/{codeMirrorModule-CB-2okZ8.js → codeMirrorModule-DblsdhjA.js} +2096 -2331
  10. package/lib/vite/{recorder/assets/codeMirrorModule-CR6kB851.js → traceViewer/assets/codeMirrorModule-lDjkI8Ax.js} +1 -1
  11. package/lib/vite/traceViewer/assets/{inspectorTab-BHcfR9dD.js → inspectorTab-BPzhNk9r.js} +2 -2
  12. package/lib/vite/traceViewer/assets/inspectorTab-DOc4D3cX.js +17361 -0
  13. package/lib/vite/traceViewer/assets/{defaultSettingsView-CBiB4avC.js → testServerConnection-D-tXL3sj.js} +49 -42
  14. package/lib/vite/traceViewer/assets/{workbench-DZqNXdoV.js → workbench-DLv_q9ji.js} +1 -1
  15. package/lib/vite/traceViewer/assets/workbench-DNolpp3y.js +1473 -0
  16. package/lib/vite/traceViewer/assets/xtermModule-DZP0glxx.js +5982 -0
  17. package/lib/vite/traceViewer/{embedded.DInvAijy.js → embedded.BIubxTi3.js} +1 -1
  18. package/lib/vite/traceViewer/{embedded.gzudoghF.js → embedded.DeCrOtlO.js} +4 -4
  19. package/lib/vite/traceViewer/embedded.html +3 -3
  20. package/lib/vite/traceViewer/{index.DilotR1h.js → index.CM_h9lHr.js} +7 -124
  21. package/lib/vite/traceViewer/{index.Dha3cgqs.js → index.DPD22sZn.js} +1 -1
  22. package/lib/vite/traceViewer/index.html +3 -3
  23. package/lib/vite/traceViewer/{inspectorTab.DnGm18kV.css → inspectorTab.DGJWXOSd.css} +1488 -1521
  24. package/lib/vite/traceViewer/{recorder.C88JDknq.js → recorder.BaRuS6Pc.js} +1 -1
  25. package/lib/vite/traceViewer/{recorder.DVrkq3Um.js → recorder.Fwf59ZKh.js} +3 -3
  26. package/lib/vite/traceViewer/recorder.html +2 -2
  27. package/lib/vite/traceViewer/{uiMode.2tr9k625.js → uiMode.B11wexdJ.js} +1 -1
  28. package/lib/vite/traceViewer/{uiMode.C9_OcpPU.js → uiMode.CYBsUhm_.js} +58 -90
  29. package/lib/vite/traceViewer/{uiMode.c5ORgcrX.css → uiMode.DRmgrHSk.css} +45 -7
  30. package/lib/vite/traceViewer/uiMode.html +3 -3
  31. package/lib/vite/traceViewer/{workbench.xUZSA8PY.css → workbench.BQNDbcQ0.css} +83 -320
  32. package/package.json +1 -1
  33. package/lib/client/clientStackTrace.js +0 -66
  34. package/lib/client/fileUtils.js +0 -33
  35. package/lib/client/platform.js +0 -72
  36. package/lib/client/timeoutSettings.js +0 -66
  37. package/lib/client/webSocket.js +0 -107
  38. package/lib/generated/recorderSource.js +0 -7
  39. package/lib/server/callLog.js +0 -80
  40. package/lib/server/harBackend.js +0 -158
  41. package/lib/server/localUtils.js +0 -204
  42. package/lib/server/recorder/chat.js +0 -178
  43. package/lib/server/recorder/codeGenerator.js +0 -154
  44. package/lib/server/recorder/csharp.js +0 -311
  45. package/lib/server/recorder/java.js +0 -249
  46. package/lib/server/recorder/javascript.js +0 -230
  47. package/lib/server/recorder/jsonl.js +0 -48
  48. package/lib/server/recorder/language.js +0 -45
  49. package/lib/server/recorder/python.js +0 -276
  50. package/lib/server/recorder/recorderActions.js +0 -6
  51. package/lib/server/recorder/utils.js +0 -46
  52. package/lib/server/storageScript.js +0 -161
  53. package/lib/server/timeoutSettings.js +0 -75
  54. package/lib/server/utils/ascii.js +0 -32
  55. package/lib/server/utils/comparators.js +0 -160
  56. package/lib/server/utils/crypto.js +0 -172
  57. package/lib/server/utils/debug.js +0 -39
  58. package/lib/server/utils/debugLogger.js +0 -94
  59. package/lib/server/utils/env.js +0 -54
  60. package/lib/server/utils/eventsHelper.js +0 -39
  61. package/lib/server/utils/expectUtils.js +0 -34
  62. package/lib/server/utils/fileUtils.js +0 -205
  63. package/lib/server/utils/happyEyeballs.js +0 -210
  64. package/lib/server/utils/hostPlatform.js +0 -146
  65. package/lib/server/utils/httpServer.js +0 -234
  66. package/lib/server/utils/image_tools/colorUtils.js +0 -99
  67. package/lib/server/utils/image_tools/compare.js +0 -109
  68. package/lib/server/utils/image_tools/imageChannel.js +0 -71
  69. package/lib/server/utils/image_tools/stats.js +0 -103
  70. package/lib/server/utils/linuxUtils.js +0 -59
  71. package/lib/server/utils/network.js +0 -161
  72. package/lib/server/utils/nodePlatform.js +0 -141
  73. package/lib/server/utils/pipeTransport.js +0 -83
  74. package/lib/server/utils/processLauncher.js +0 -249
  75. package/lib/server/utils/profiler.js +0 -53
  76. package/lib/server/utils/socksProxy.js +0 -571
  77. package/lib/server/utils/spawnAsync.js +0 -46
  78. package/lib/server/utils/task.js +0 -59
  79. package/lib/server/utils/userAgent.js +0 -92
  80. package/lib/server/utils/wsServer.js +0 -129
  81. package/lib/server/utils/zipFile.js +0 -76
  82. package/lib/server/utils/zones.js +0 -55
  83. package/lib/utils/glob.js +0 -84
  84. package/lib/utils/isomorphic/ariaSnapshot.js +0 -393
  85. package/lib/utils/isomorphic/assert.js +0 -26
  86. package/lib/utils/isomorphic/colors.js +0 -66
  87. package/lib/utils/isomorphic/headers.js +0 -53
  88. package/lib/utils/isomorphic/manualPromise.js +0 -108
  89. package/lib/utils/isomorphic/multimap.js +0 -74
  90. package/lib/utils/isomorphic/rtti.js +0 -42
  91. package/lib/utils/isomorphic/semaphore.js +0 -52
  92. package/lib/utils/isomorphic/stackTrace.js +0 -170
  93. package/lib/utils/isomorphic/time.js +0 -26
  94. package/lib/utils/isomorphic/timeoutRunner.js +0 -67
  95. package/lib/utils/isomorphic/types.js +0 -6
  96. package/lib/utils/mimeType.js +0 -30
  97. package/lib/utils.js +0 -448
  98. package/lib/vite/traceViewer/assets/codeMirrorModule-DZoSgqUd.js +0 -24
  99. package/lib/vite/traceViewer/assets/inspectorTab-BuJ3wAX_.js +0 -64
  100. package/lib/vite/traceViewer/assets/inspectorTab-CwgfffWb.js +0 -25143
  101. package/lib/vite/traceViewer/assets/workbench-CWZselvp.js +0 -2470
  102. package/lib/vite/traceViewer/assets/workbench-DdmJ9AJV.js +0 -9
  103. package/lib/vite/traceViewer/assets/xtermModule-Es_gt_u7.js +0 -5994
  104. package/lib/vite/traceViewer/defaultSettingsView.Dp3b_92q.css +0 -41
  105. package/lib/vite/traceViewer/embedded.Dxe2heQk.js +0 -2
  106. package/lib/vite/traceViewer/index.CB297BuW.js +0 -2
  107. package/lib/vite/traceViewer/recorder.DNMfnSiu.js +0 -2
  108. package/lib/vite/traceViewer/uiMode.Cr1tvTWS.js +0 -5
  109. /package/lib/vite/traceViewer/{codeMirrorModule.DuST8d_k.css → codeMirrorModule.Cy8X9Wtw.css} +0 -0
  110. /package/lib/vite/traceViewer/{embedded.BeldSa2G.css → embedded.DjZq4InJ.css} +0 -0
  111. /package/lib/vite/traceViewer/{index.QewjJ85u.css → index.QanXxRUb.css} +0 -0
  112. /package/lib/vite/traceViewer/{recorder.DLgqV9db.css → recorder.DBDpiNOK.css} +0 -0
  113. /package/lib/vite/traceViewer/{xtermModule.EsaqrrTX.css → xtermModule.4oRVGWQ-.css} +0 -0
@@ -1,5 +1,51 @@
1
- import { a as EventEmitter } from "./workbench-CWZselvp.js";
2
- import { j as jsxRuntimeExports, h as useSetting, i as useDarkModeSetting } from "./inspectorTab-CwgfffWb.js";
1
+ var Disposable;
2
+ ((Disposable2) => {
3
+ function disposeAll(disposables) {
4
+ for (const disposable of disposables.splice(0))
5
+ disposable.dispose();
6
+ }
7
+ Disposable2.disposeAll = disposeAll;
8
+ })(Disposable || (Disposable = {}));
9
+ class EventEmitter {
10
+ constructor() {
11
+ this._listeners = /* @__PURE__ */ new Set();
12
+ this.event = (listener, disposables) => {
13
+ this._listeners.add(listener);
14
+ let disposed = false;
15
+ const self = this;
16
+ const result = {
17
+ dispose() {
18
+ if (!disposed) {
19
+ disposed = true;
20
+ self._listeners.delete(listener);
21
+ }
22
+ }
23
+ };
24
+ if (disposables)
25
+ disposables.push(result);
26
+ return result;
27
+ };
28
+ }
29
+ fire(event) {
30
+ const dispatch = !this._deliveryQueue;
31
+ if (!this._deliveryQueue)
32
+ this._deliveryQueue = [];
33
+ for (const listener of this._listeners)
34
+ this._deliveryQueue.push({ listener, event });
35
+ if (!dispatch)
36
+ return;
37
+ for (let index = 0; index < this._deliveryQueue.length; index++) {
38
+ const { listener, event: event2 } = this._deliveryQueue[index];
39
+ listener.call(null, event2);
40
+ }
41
+ this._deliveryQueue = void 0;
42
+ }
43
+ dispose() {
44
+ this._listeners.clear();
45
+ if (this._deliveryQueue)
46
+ this._deliveryQueue = [];
47
+ }
48
+ }
3
49
  class WebSocketTestServerTransport {
4
50
  constructor(url) {
5
51
  this._ws = new WebSocket(url);
@@ -171,47 +217,8 @@ class TestServerConnection {
171
217
  }
172
218
  }
173
219
  }
174
- const SettingsView = ({ settings }) => {
175
- return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "vbox settings-view", children: settings.map(({ value, set, name, title }) => {
176
- const labelId = `setting-${name}`;
177
- return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "setting", title, children: [
178
- /* @__PURE__ */ jsxRuntimeExports.jsx(
179
- "input",
180
- {
181
- type: "checkbox",
182
- id: labelId,
183
- checked: value,
184
- onChange: () => set(!value)
185
- }
186
- ),
187
- /* @__PURE__ */ jsxRuntimeExports.jsx("label", { htmlFor: labelId, children: name })
188
- ] }, name);
189
- }) });
190
- };
191
- const DefaultSettingsView = () => {
192
- const [
193
- shouldPopulateCanvasFromScreenshot,
194
- setShouldPopulateCanvasFromScreenshot
195
- ] = useSetting("shouldPopulateCanvasFromScreenshot", false);
196
- const [darkMode, setDarkMode] = useDarkModeSetting();
197
- return /* @__PURE__ */ jsxRuntimeExports.jsx(
198
- SettingsView,
199
- {
200
- settings: [
201
- { value: darkMode, set: setDarkMode, name: "Dark mode" },
202
- {
203
- value: shouldPopulateCanvasFromScreenshot,
204
- set: setShouldPopulateCanvasFromScreenshot,
205
- name: "Display canvas content",
206
- title: "Attempt to display the captured canvas appearance in the snapshot preview. May not be accurate."
207
- }
208
- ]
209
- }
210
- );
211
- };
212
220
  export {
213
- DefaultSettingsView as D,
214
221
  TestServerConnection as T,
215
222
  WebSocketTestServerTransport as W
216
223
  };
217
- //# sourceMappingURL=defaultSettingsView-CBiB4avC.js.map
224
+ //# sourceMappingURL=testServerConnection-D-tXL3sj.js.map
@@ -1,4 +1,4 @@
1
- import{r as d,j as e,L as Mt,k as Vt,l as _t,n as kt,m as F,P as J,f as K,C as Gt,o as Yt,u as ht,p as St,G as qt,q as Kt,v as Jt,w as Qt,x as Zt,h as jt,y as te,z as ee,A as se,N as ie,S as wt,B as ne,D as Nt,T as bt,I as ae,E as re}from"./inspectorTab-BHcfR9dD.js";const ce=Mt;function le({name:t,rootItem:s,render:i,icon:n,isError:c,isVisible:l,selectedItem:a,onAccepted:r,onSelected:o,onHighlighted:x,treeState:h,setTreeState:v,noItemsMessage:m,dataTestId:b,autoExpandDepth:j}){const w=d.useMemo(()=>oe(s,a,h.expandedItems,j||0),[s,a,h,j]),M=d.useMemo(()=>{if(!l)return[...w.keys()];const f=new Map,N=T=>{const L=f.get(T);if(L!==void 0)return L;let R=T.children.some(z=>N(z));for(const z of T.children){const G=N(z);R=R||G}const X=l(T)||R;return f.set(T,X),X};for(const T of w.keys())N(T);const y=[];for(const T of w.keys())l(T)&&y.push(T);return y},[w,l]);return e.jsx(ce,{name:t,items:M,id:f=>f.id,dataTestId:b||t+"-tree",render:f=>{const N=i(f);return e.jsxs(e.Fragment,{children:[n&&e.jsx("div",{className:"codicon "+(n(f)||"blank"),style:{minWidth:16,marginRight:4}}),typeof N=="string"?e.jsx("div",{style:{textOverflow:"ellipsis",overflow:"hidden"},children:N}):N]})},icon:f=>{const N=w.get(f).expanded;if(typeof N=="boolean")return N?"codicon-chevron-down":"codicon-chevron-right"},isError:f=>(c==null?void 0:c(f))||!1,indent:f=>w.get(f).depth,selectedItem:a,onAccepted:f=>r==null?void 0:r(f),onSelected:f=>o==null?void 0:o(f),onHighlighted:f=>x==null?void 0:x(f),onLeftArrow:f=>{const{expanded:N,parent:y}=w.get(f);N?(h.expandedItems.set(f.id,!1),v({...h})):y&&(o==null||o(y))},onRightArrow:f=>{f.children.length&&(h.expandedItems.set(f.id,!0),v({...h}))},onIconClicked:f=>{const{expanded:N}=w.get(f);if(N){for(let y=a;y;y=y.parent)if(y===f){o==null||o(f);break}h.expandedItems.set(f.id,!1)}else h.expandedItems.set(f.id,!0);v({...h})},noItemsMessage:m})}function oe(t,s,i,n){const c=new Map,l=new Set;for(let r=s==null?void 0:s.parent;r;r=r.parent)l.add(r.id);const a=(r,o)=>{for(const x of r.children){const h=l.has(x.id)||i.get(x.id),v=n>o&&c.size<25&&h!==!1,m=x.children.length?h??v:void 0;c.set(x,{depth:o,expanded:m,parent:t===r?null:r}),m&&a(x,o+1)}};return a(t,0),c}const he=le,de=({actions:t,selectedAction:s,selectedTime:i,setSelectedTime:n,sdkLanguage:c,onSelected:l,onHighlighted:a,revealConsole:r,isLive:o})=>{const[x,h]=d.useState({expandedItems:new Map}),{rootItem:v,itemMap:m}=d.useMemo(()=>Vt(t),[t]),{selectedItem:b}=d.useMemo(()=>({selectedItem:s?m.get(s.callId):void 0}),[m,s]);return e.jsxs("div",{className:"vbox",children:[i&&e.jsxs("div",{className:"action-list-show-all",onClick:()=>n(void 0),children:[e.jsx("span",{className:"codicon codicon-triangle-left"}),"Show all"]}),e.jsx(he,{name:"actions",rootItem:v,treeState:x,setTreeState:h,selectedItem:b,onSelected:j=>l==null?void 0:l(j.action),onHighlighted:j=>a==null?void 0:a(j==null?void 0:j.action),onAccepted:j=>n({minimum:j.action.startTime,maximum:j.action.endTime}),isError:j=>{var w,M;return!!((M=(w=j.action)==null?void 0:w.error)!=null&&M.message)},isVisible:j=>!i||j.action.startTime<=i.maximum&&j.action.endTime>=i.minimum,render:j=>dt(j.action,{sdkLanguage:c,revealConsole:r,isLive:o,showDuration:!0,showBadges:!0})})]})},dt=(t,s)=>{const{sdkLanguage:i,revealConsole:n,isLive:c,showDuration:l,showBadges:a}=s,{errors:r,warnings:o}=_t(t),x=t.params.selector?kt(i||"javascript",t.params.selector):void 0;let h="";return t.endTime?h=F(t.endTime-t.startTime):t.error?h="Timed out":c||(h="-"),e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"action-title",title:t.apiName,children:[e.jsx("span",{children:t.apiName}),x&&e.jsx("div",{className:"action-selector",title:x,children:x}),t.method==="goto"&&t.params.url&&e.jsx("div",{className:"action-url",title:t.params.url,children:t.params.url}),t.class==="APIRequestContext"&&t.params.url&&e.jsx("div",{className:"action-url",title:t.params.url,children:me(t.params.url)})]}),(l||a)&&e.jsx("div",{className:"spacer"}),l&&e.jsx("div",{className:"action-duration",children:h||e.jsx("span",{className:"codicon codicon-loading"})}),a&&e.jsxs("div",{className:"action-icons",onClick:()=>n==null?void 0:n(),children:[!!r&&e.jsxs("div",{className:"action-icon",children:[e.jsx("span",{className:"codicon codicon-error"}),e.jsx("span",{className:"action-icon-value",children:r})]}),!!o&&e.jsxs("div",{className:"action-icon",children:[e.jsx("span",{className:"codicon codicon-warning"}),e.jsx("span",{className:"action-icon-value",children:o})]})]})]})};function me(t){try{const s=new URL(t);return s.pathname+s.search}catch{return t}}const ue=({action:t,sdkLanguage:s})=>{if(!t)return e.jsx(J,{text:"No action selected"});const i={...t.params};delete i.info;const n=Object.keys(i),c=t.startTime+(t.context.wallTime-t.context.startTime),l=new Date(c).toLocaleString(),a=t.endTime?F(t.endTime-t.startTime):"Timed Out";return e.jsxs("div",{className:"call-tab",children:[e.jsx("div",{className:"call-line",children:t.apiName}),e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"call-section",children:"Time"}),l&&e.jsxs("div",{className:"call-line",children:["wall time:",e.jsx("span",{className:"call-value datetime",title:l,children:l})]}),e.jsxs("div",{className:"call-line",children:["duration:",e.jsx("span",{className:"call-value datetime",title:a,children:a})]})]}),!!n.length&&e.jsx("div",{className:"call-section",children:"Parameters"}),!!n.length&&n.map((r,o)=>yt(Tt(t,r,i[r],s),"param-"+o)),!!t.result&&e.jsx("div",{className:"call-section",children:"Return value"}),!!t.result&&Object.keys(t.result).map((r,o)=>yt(Tt(t,r,t.result[r],s),"result-"+o))]})};function yt(t,s){let i=t.text.replace(/\n/g,"↵");return t.type==="string"&&(i=`"${i}"`),e.jsxs("div",{className:"call-line",children:[t.name,":",e.jsx("span",{className:K("call-value",t.type),title:t.text,children:i}),["string","number","object","locator"].includes(t.type)&&e.jsx(Gt,{value:t.text})]},s)}function Tt(t,s,i,n){const c=t.method.includes("eval")||t.method==="waitForFunction";if(s==="files")return{text:"<files>",type:"string",name:s};if((s==="eventInit"||s==="expectedValue"||s==="arg"&&c)&&(i=tt(i.value,new Array(10).fill({handle:"<handle>"}))),(s==="value"&&c||s==="received"&&t.method==="expect")&&(i=tt(i,new Array(10).fill({handle:"<handle>"}))),s==="selector")return{text:kt(n||"javascript",t.params.selector),type:"locator",name:"locator"};const l=typeof i;return l!=="object"||i===null?{text:String(i),type:l,name:s}:i.guid?{text:"<handle>",type:"handle",name:s}:{text:JSON.stringify(i).slice(0,1e3),type:"object",name:s}}function tt(t,s){if(t.n!==void 0)return t.n;if(t.s!==void 0)return t.s;if(t.b!==void 0)return t.b;if(t.v!==void 0){if(t.v==="undefined")return;if(t.v==="null")return null;if(t.v==="NaN")return NaN;if(t.v==="Infinity")return 1/0;if(t.v==="-Infinity")return-1/0;if(t.v==="-0")return-0}if(t.d!==void 0)return new Date(t.d);if(t.r!==void 0)return new RegExp(t.r.p,t.r.f);if(t.a!==void 0)return t.a.map(i=>tt(i,s));if(t.o!==void 0){const i={};for(const{k:n,v:c}of t.o)i[n]=tt(c,s);return i}return t.h!==void 0?s===void 0?"<object>":s[t.h]:"<object>"}const xe=Mt,fe=({action:t,isLive:s})=>{const i=d.useMemo(()=>{var a;if(!t||!t.log.length)return[];const n=t.log,c=t.context.wallTime-t.context.startTime,l=[];for(let r=0;r<n.length;++r){let o="";if(n[r].time!==-1){const x=(a=n[r])==null?void 0:a.time;r+1<n.length?o=F(n[r+1].time-x):t.endTime>0?o=F(t.endTime-x):s?o=F(Date.now()-c-x):o="-"}l.push({message:n[r].message,time:o})}return l},[t,s]);return i.length?e.jsx(xe,{name:"log",items:i,render:n=>e.jsxs("div",{className:"log-list-item",children:[e.jsx("span",{className:"log-list-duration",children:n.time}),n.message]}),notSelectable:!0}):e.jsx(J,{text:"No log entries"})},pe=({error:t})=>{const s=d.useMemo(()=>Yt(t),[t]);return e.jsx("div",{className:"error-message",dangerouslySetInnerHTML:{__html:s||""}})};function ge(t){return d.useMemo(()=>{if(!t)return{errors:new Map};const s=new Map;for(const i of t.errorDescriptors)s.set(i.message,i);return{errors:s}},[t])}const ve=({errorsModel:t,sdkLanguage:s,revealInSource:i})=>t.errors.size?e.jsx("div",{className:"fill",style:{overflow:"auto"},children:[...t.errors.entries()].map(([n,c])=>{var o;let l,a;const r=(o=c.stack)==null?void 0:o[0];return r&&(l=r.file.replace(/.*[/\\](.*)/,"$1")+":"+r.line,a=r.file+":"+r.line),e.jsxs("div",{children:[e.jsxs("div",{className:"hbox",style:{alignItems:"center",padding:"5px 10px",minHeight:36,fontWeight:"bold",color:"var(--vscode-errorForeground)"},children:[c.action&&dt(c.action,{sdkLanguage:s}),l&&e.jsxs("div",{className:"action-location",children:["@ ",e.jsx("span",{title:a,onClick:()=>i(c),children:l})]})]}),e.jsx(pe,{error:n})]},n)})}):e.jsx(J,{text:"No errors"}),Ct={width:200,height:45},_=2.5,je=Ct.height+_*2,we=({model:t,boundaries:s,previewPoint:i})=>{var h,v;const[n,c]=ht(),l=d.useRef(null);let a=0;if(l.current&&i){const m=l.current.getBoundingClientRect();a=(i.clientY-m.top+l.current.scrollTop)/je|0}const r=(v=(h=t==null?void 0:t.pages)==null?void 0:h[a])==null?void 0:v.screencastFrames;let o,x;if(i!==void 0&&r&&r.length){const m=s.minimum+(s.maximum-s.minimum)*i.x/n.width;o=r[St(r,m,Lt)-1];const b={width:Math.min(800,window.innerWidth/2|0),height:Math.min(800,window.innerHeight/2|0)};x=o?It({width:o.width,height:o.height},b):void 0}return e.jsxs("div",{className:"film-strip",ref:c,children:[e.jsx("div",{className:"film-strip-lanes",ref:l,children:t==null?void 0:t.pages.map((m,b)=>m.screencastFrames.length?e.jsx(Ne,{boundaries:s,page:m,width:n.width},b):null)}),(i==null?void 0:i.x)!==void 0&&e.jsxs("div",{className:"film-strip-hover",style:{top:n.bottom+5,left:Math.min(i.x,n.width-(x?x.width:0)-10)},children:[i.action&&e.jsx("div",{className:"film-strip-hover-title",children:dt(i.action,i)}),o&&x&&e.jsx("div",{style:{width:x.width,height:x.height},children:e.jsx("img",{src:`sha1/${o.sha1}`,width:x.width,height:x.height})})]})]})},Ne=({boundaries:t,page:s,width:i})=>{const n={width:0,height:0},c=s.screencastFrames;for(const w of c)n.width=Math.max(n.width,w.width),n.height=Math.max(n.height,w.height);const l=It(n,Ct),a=c[0].timestamp,r=c[c.length-1].timestamp,o=t.maximum-t.minimum,x=(a-t.minimum)/o*i,h=(t.maximum-r)/o*i,m=(r-a)/o*i/(l.width+2*_)|0,b=(r-a)/m,j=[];for(let w=0;a&&b&&w<m;++w){const M=a+b*w,f=St(c,M,Lt)-1;j.push(e.jsx("div",{className:"film-strip-frame",style:{width:l.width,height:l.height,backgroundImage:`url(sha1/${c[f].sha1})`,backgroundSize:`${l.width}px ${l.height}px`,margin:_,marginRight:_}},w))}return j.push(e.jsx("div",{className:"film-strip-frame",style:{width:l.width,height:l.height,backgroundImage:`url(sha1/${c[c.length-1].sha1})`,backgroundSize:`${l.width}px ${l.height}px`,margin:_,marginRight:_}},j.length)),e.jsx("div",{className:"film-strip-lane",style:{marginLeft:x+"px",marginRight:h+"px"},children:j})};function Lt(t,s){return t-s.timestamp}function It(t,s){const i=Math.max(t.width/s.width,t.height/s.height);return{width:t.width/i|0,height:t.height/i|0}}const be=({model:t,boundaries:s,consoleEntries:i,onSelected:n,highlightedAction:c,highlightedEntry:l,highlightedConsoleEntry:a,selectedTime:r,setSelectedTime:o,sdkLanguage:x})=>{const[h,v]=ht(),[m,b]=d.useState(),[j,w]=d.useState(),{offsets:M,curtainLeft:f,curtainRight:N}=d.useMemo(()=>{let p=r||s;if(m&&m.startX!==m.endX){const k=H(h.width,s,m.startX),I=H(h.width,s,m.endX);p={minimum:Math.min(k,I),maximum:Math.max(k,I)}}const u=W(h.width,s,p.minimum),C=W(h.width,s,s.maximum)-W(h.width,s,p.maximum);return{offsets:ye(h.width,s),curtainLeft:u,curtainRight:C}},[r,s,m,h]),y=d.useMemo(()=>{const p=[];for(const u of(t==null?void 0:t.actions)||[])u.class!=="Test"&&p.push({action:u,leftTime:u.startTime,rightTime:u.endTime||s.maximum,leftPosition:W(h.width,s,u.startTime),rightPosition:W(h.width,s,u.endTime||s.maximum),active:!1,error:!!u.error});for(const u of(t==null?void 0:t.resources)||[]){const S=u._monotonicTime,C=u._monotonicTime+u.time;p.push({resource:u,leftTime:S,rightTime:C,leftPosition:W(h.width,s,S),rightPosition:W(h.width,s,C),active:!1,error:!1})}for(const u of i||[])p.push({consoleMessage:u,leftTime:u.timestamp,rightTime:u.timestamp,leftPosition:W(h.width,s,u.timestamp),rightPosition:W(h.width,s,u.timestamp),active:!1,error:u.isError});return p},[t,i,s,h]);d.useMemo(()=>{for(const p of y)c?p.active=p.action===c:l?p.active=p.resource===l:a?p.active=p.consoleMessage===a:p.active=!1},[y,c,l,a]);const T=d.useCallback(p=>{if(w(void 0),!v.current)return;const u=p.clientX-v.current.getBoundingClientRect().left,S=H(h.width,s,u),C=r?W(h.width,s,r.minimum):0,k=r?W(h.width,s,r.maximum):0;r&&Math.abs(u-C)<10?b({startX:k,endX:u,type:"resize"}):r&&Math.abs(u-k)<10?b({startX:C,endX:u,type:"resize"}):r&&S>r.minimum&&S<r.maximum&&p.clientY-v.current.getBoundingClientRect().top<20?b({startX:C,endX:k,pivot:u,type:"move"}):b({startX:u,endX:u,type:"resize"})},[s,h,v,r]),L=d.useCallback(p=>{if(!v.current)return;const u=p.clientX-v.current.getBoundingClientRect().left,S=H(h.width,s,u),C=t==null?void 0:t.actions.findLast(A=>A.startTime<=S);if(!p.buttons){b(void 0);return}if(C&&n(C),!m)return;let k=m;if(m.type==="resize")k={...m,endX:u};else{const A=u-m.pivot;let U=m.startX+A,$=m.endX+A;U<0&&(U=0,$=U+(m.endX-m.startX)),$>h.width&&($=h.width,U=$-(m.endX-m.startX)),k={...m,startX:U,endX:$,pivot:u}}b(k);const I=H(h.width,s,k.startX),P=H(h.width,s,k.endX);I!==P&&o({minimum:Math.min(I,P),maximum:Math.max(I,P)})},[s,m,h,t,n,v,o]),R=d.useCallback(()=>{if(w(void 0),!!m){if(m.startX!==m.endX){const p=H(h.width,s,m.startX),u=H(h.width,s,m.endX);o({minimum:Math.min(p,u),maximum:Math.max(p,u)})}else{const p=H(h.width,s,m.startX),u=t==null?void 0:t.actions.findLast(S=>S.startTime<=p);u&&n(u),o(void 0)}b(void 0)}},[s,m,h,t,o,n]),X=d.useCallback(p=>{if(!v.current)return;const u=p.clientX-v.current.getBoundingClientRect().left,S=H(h.width,s,u),C=t==null?void 0:t.actions.findLast(k=>k.startTime<=S);w({x:u,clientY:p.clientY,action:C,sdkLanguage:x})},[s,h,t,v,x]),z=d.useCallback(()=>{w(void 0)},[]),G=d.useCallback(()=>{o(void 0)},[o]);return e.jsxs("div",{style:{flex:"none",borderBottom:"1px solid var(--vscode-panel-border)"},children:[!!m&&e.jsx(qt,{cursor:(m==null?void 0:m.type)==="resize"?"ew-resize":"grab",onPaneMouseUp:R,onPaneMouseMove:L,onPaneDoubleClick:G}),e.jsxs("div",{ref:v,className:"timeline-view",onMouseDown:T,onMouseMove:X,onMouseLeave:z,children:[e.jsx("div",{className:"timeline-grid",children:M.map((p,u)=>e.jsx("div",{className:"timeline-divider",style:{left:p.position+"px"},children:e.jsx("div",{className:"timeline-time",children:F(p.time-s.minimum)})},u))}),e.jsx("div",{style:{height:8}}),e.jsx(we,{model:t,boundaries:s,previewPoint:j}),e.jsx("div",{className:"timeline-bars",children:y.map((p,u)=>e.jsx("div",{className:K("timeline-bar",p.action&&"action",p.resource&&"network",p.consoleMessage&&"console-message",p.active&&"active",p.error&&"error"),style:{left:p.leftPosition,width:Math.max(5,p.rightPosition-p.leftPosition),top:Te(p),bottom:0}},u))}),e.jsx("div",{className:"timeline-marker",style:{display:j!==void 0?"block":"none",left:((j==null?void 0:j.x)||0)+"px"}}),r&&e.jsxs("div",{className:"timeline-window",children:[e.jsx("div",{className:"timeline-window-curtain left",style:{width:f}}),e.jsx("div",{className:"timeline-window-resizer",style:{left:-5}}),e.jsx("div",{className:"timeline-window-center",children:e.jsx("div",{className:"timeline-window-drag"})}),e.jsx("div",{className:"timeline-window-resizer",style:{left:5}}),e.jsx("div",{className:"timeline-window-curtain right",style:{width:N}})]})]})]})};function ye(t,s){let n=t/64;const c=s.maximum-s.minimum,l=t/c;let a=c/n;const r=Math.ceil(Math.log(a)/Math.LN10);a=Math.pow(10,r),a*l>=5*64&&(a=a/5),a*l>=2*64&&(a=a/2);const o=s.minimum;let x=s.maximum;x+=64/l,n=Math.ceil((x-o)/a),a||(n=0);const h=[];for(let v=0;v<n;++v){const m=o+a*v;h.push({position:W(t,s,m),time:m})}return h}function W(t,s,i){return(i-s.minimum)/(s.maximum-s.minimum)*t}function H(t,s,i){return i/t*(s.maximum-s.minimum)+s.minimum}function Te(t){return t.resource?25:20}const Me=({model:t})=>{var s,i;return t?e.jsxs("div",{"data-testid":"metadata-view",className:"vbox",style:{flexShrink:0},children:[e.jsx("div",{className:"call-section",style:{paddingTop:2},children:"Time"}),!!t.wallTime&&e.jsxs("div",{className:"call-line",children:["start time:",e.jsx("span",{className:"call-value datetime",title:new Date(t.wallTime).toLocaleString(),children:new Date(t.wallTime).toLocaleString()})]}),e.jsxs("div",{className:"call-line",children:["duration:",e.jsx("span",{className:"call-value number",title:F(t.endTime-t.startTime),children:F(t.endTime-t.startTime)})]}),e.jsx("div",{className:"call-section",children:"Browser"}),e.jsxs("div",{className:"call-line",children:["engine:",e.jsx("span",{className:"call-value string",title:t.browserName,children:t.browserName})]}),t.channel&&e.jsxs("div",{className:"call-line",children:["channel:",e.jsx("span",{className:"call-value string",title:t.channel,children:t.channel})]}),t.platform&&e.jsxs("div",{className:"call-line",children:["platform:",e.jsx("span",{className:"call-value string",title:t.platform,children:t.platform})]}),t.options.userAgent&&e.jsxs("div",{className:"call-line",children:["user agent:",e.jsx("span",{className:"call-value datetime",title:t.options.userAgent,children:t.options.userAgent})]}),t.options.baseURL&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"call-section",style:{paddingTop:2},children:"Config"}),e.jsxs("div",{className:"call-line",children:["baseURL:",e.jsx("a",{className:"call-value string",href:t.options.baseURL,title:t.options.baseURL,target:"_blank",rel:"noopener noreferrer",children:t.options.baseURL})]})]}),e.jsx("div",{className:"call-section",children:"Viewport"}),t.options.viewport&&e.jsxs("div",{className:"call-line",children:["width:",e.jsx("span",{className:"call-value number",title:String(!!((s=t.options.viewport)!=null&&s.width)),children:t.options.viewport.width})]}),t.options.viewport&&e.jsxs("div",{className:"call-line",children:["height:",e.jsx("span",{className:"call-value number",title:String(!!((i=t.options.viewport)!=null&&i.height)),children:t.options.viewport.height})]}),e.jsxs("div",{className:"call-line",children:["is mobile:",e.jsx("span",{className:"call-value boolean",title:String(!!t.options.isMobile),children:String(!!t.options.isMobile)})]}),t.options.deviceScaleFactor&&e.jsxs("div",{className:"call-line",children:["device scale:",e.jsx("span",{className:"call-value number",title:String(t.options.deviceScaleFactor),children:String(t.options.deviceScaleFactor)})]}),e.jsx("div",{className:"call-section",children:"Counts"}),e.jsxs("div",{className:"call-line",children:["pages:",e.jsx("span",{className:"call-value number",children:t.pages.length})]}),e.jsxs("div",{className:"call-line",children:["actions:",e.jsx("span",{className:"call-value number",children:t.actions.length})]}),e.jsxs("div",{className:"call-line",children:["events:",e.jsx("span",{className:"call-value number",children:t.events.length})]})]}):e.jsx(e.Fragment,{})};async function lt(t){const s=new Image;return t&&(s.src=t,await new Promise((i,n)=>{s.onload=i,s.onerror=i})),s}const ot={backgroundImage:`linear-gradient(45deg, #80808020 25%, transparent 25%),
1
+ import{r as d,j as e,L as Mt,k as Vt,l as _t,n as kt,m as F,P as J,f as K,C as Gt,o as Yt,u as ht,p as St,G as qt,q as Kt,v as Jt,w as Qt,x as Zt,h as jt,y as te,z as ee,A as se,N as ie,S as wt,B as ne,D as Nt,T as bt,I as ae,E as re}from"./inspectorTab-BPzhNk9r.js";const ce=Mt;function le({name:t,rootItem:s,render:i,icon:n,isError:c,isVisible:l,selectedItem:a,onAccepted:r,onSelected:o,onHighlighted:x,treeState:h,setTreeState:v,noItemsMessage:m,dataTestId:b,autoExpandDepth:j}){const w=d.useMemo(()=>oe(s,a,h.expandedItems,j||0),[s,a,h,j]),M=d.useMemo(()=>{if(!l)return[...w.keys()];const f=new Map,N=T=>{const L=f.get(T);if(L!==void 0)return L;let R=T.children.some(z=>N(z));for(const z of T.children){const G=N(z);R=R||G}const X=l(T)||R;return f.set(T,X),X};for(const T of w.keys())N(T);const y=[];for(const T of w.keys())l(T)&&y.push(T);return y},[w,l]);return e.jsx(ce,{name:t,items:M,id:f=>f.id,dataTestId:b||t+"-tree",render:f=>{const N=i(f);return e.jsxs(e.Fragment,{children:[n&&e.jsx("div",{className:"codicon "+(n(f)||"blank"),style:{minWidth:16,marginRight:4}}),typeof N=="string"?e.jsx("div",{style:{textOverflow:"ellipsis",overflow:"hidden"},children:N}):N]})},icon:f=>{const N=w.get(f).expanded;if(typeof N=="boolean")return N?"codicon-chevron-down":"codicon-chevron-right"},isError:f=>(c==null?void 0:c(f))||!1,indent:f=>w.get(f).depth,selectedItem:a,onAccepted:f=>r==null?void 0:r(f),onSelected:f=>o==null?void 0:o(f),onHighlighted:f=>x==null?void 0:x(f),onLeftArrow:f=>{const{expanded:N,parent:y}=w.get(f);N?(h.expandedItems.set(f.id,!1),v({...h})):y&&(o==null||o(y))},onRightArrow:f=>{f.children.length&&(h.expandedItems.set(f.id,!0),v({...h}))},onIconClicked:f=>{const{expanded:N}=w.get(f);if(N){for(let y=a;y;y=y.parent)if(y===f){o==null||o(f);break}h.expandedItems.set(f.id,!1)}else h.expandedItems.set(f.id,!0);v({...h})},noItemsMessage:m})}function oe(t,s,i,n){const c=new Map,l=new Set;for(let r=s==null?void 0:s.parent;r;r=r.parent)l.add(r.id);const a=(r,o)=>{for(const x of r.children){const h=l.has(x.id)||i.get(x.id),v=n>o&&c.size<25&&h!==!1,m=x.children.length?h??v:void 0;c.set(x,{depth:o,expanded:m,parent:t===r?null:r}),m&&a(x,o+1)}};return a(t,0),c}const he=le,de=({actions:t,selectedAction:s,selectedTime:i,setSelectedTime:n,sdkLanguage:c,onSelected:l,onHighlighted:a,revealConsole:r,isLive:o})=>{const[x,h]=d.useState({expandedItems:new Map}),{rootItem:v,itemMap:m}=d.useMemo(()=>Vt(t),[t]),{selectedItem:b}=d.useMemo(()=>({selectedItem:s?m.get(s.callId):void 0}),[m,s]);return e.jsxs("div",{className:"vbox",children:[i&&e.jsxs("div",{className:"action-list-show-all",onClick:()=>n(void 0),children:[e.jsx("span",{className:"codicon codicon-triangle-left"}),"Show all"]}),e.jsx(he,{name:"actions",rootItem:v,treeState:x,setTreeState:h,selectedItem:b,onSelected:j=>l==null?void 0:l(j.action),onHighlighted:j=>a==null?void 0:a(j==null?void 0:j.action),onAccepted:j=>n({minimum:j.action.startTime,maximum:j.action.endTime}),isError:j=>{var w,M;return!!((M=(w=j.action)==null?void 0:w.error)!=null&&M.message)},isVisible:j=>!i||j.action.startTime<=i.maximum&&j.action.endTime>=i.minimum,render:j=>dt(j.action,{sdkLanguage:c,revealConsole:r,isLive:o,showDuration:!0,showBadges:!0})})]})},dt=(t,s)=>{const{sdkLanguage:i,revealConsole:n,isLive:c,showDuration:l,showBadges:a}=s,{errors:r,warnings:o}=_t(t),x=t.params.selector?kt(i||"javascript",t.params.selector):void 0;let h="";return t.endTime?h=F(t.endTime-t.startTime):t.error?h="Timed out":c||(h="-"),e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"action-title",title:t.apiName,children:[e.jsx("span",{children:t.apiName}),x&&e.jsx("div",{className:"action-selector",title:x,children:x}),t.method==="goto"&&t.params.url&&e.jsx("div",{className:"action-url",title:t.params.url,children:t.params.url}),t.class==="APIRequestContext"&&t.params.url&&e.jsx("div",{className:"action-url",title:t.params.url,children:me(t.params.url)})]}),(l||a)&&e.jsx("div",{className:"spacer"}),l&&e.jsx("div",{className:"action-duration",children:h||e.jsx("span",{className:"codicon codicon-loading"})}),a&&e.jsxs("div",{className:"action-icons",onClick:()=>n==null?void 0:n(),children:[!!r&&e.jsxs("div",{className:"action-icon",children:[e.jsx("span",{className:"codicon codicon-error"}),e.jsx("span",{className:"action-icon-value",children:r})]}),!!o&&e.jsxs("div",{className:"action-icon",children:[e.jsx("span",{className:"codicon codicon-warning"}),e.jsx("span",{className:"action-icon-value",children:o})]})]})]})};function me(t){try{const s=new URL(t);return s.pathname+s.search}catch{return t}}const ue=({action:t,sdkLanguage:s})=>{if(!t)return e.jsx(J,{text:"No action selected"});const i={...t.params};delete i.info;const n=Object.keys(i),c=t.startTime+(t.context.wallTime-t.context.startTime),l=new Date(c).toLocaleString(),a=t.endTime?F(t.endTime-t.startTime):"Timed Out";return e.jsxs("div",{className:"call-tab",children:[e.jsx("div",{className:"call-line",children:t.apiName}),e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"call-section",children:"Time"}),l&&e.jsxs("div",{className:"call-line",children:["wall time:",e.jsx("span",{className:"call-value datetime",title:l,children:l})]}),e.jsxs("div",{className:"call-line",children:["duration:",e.jsx("span",{className:"call-value datetime",title:a,children:a})]})]}),!!n.length&&e.jsx("div",{className:"call-section",children:"Parameters"}),!!n.length&&n.map((r,o)=>yt(Tt(t,r,i[r],s),"param-"+o)),!!t.result&&e.jsx("div",{className:"call-section",children:"Return value"}),!!t.result&&Object.keys(t.result).map((r,o)=>yt(Tt(t,r,t.result[r],s),"result-"+o))]})};function yt(t,s){let i=t.text.replace(/\n/g,"↵");return t.type==="string"&&(i=`"${i}"`),e.jsxs("div",{className:"call-line",children:[t.name,":",e.jsx("span",{className:K("call-value",t.type),title:t.text,children:i}),["string","number","object","locator"].includes(t.type)&&e.jsx(Gt,{value:t.text})]},s)}function Tt(t,s,i,n){const c=t.method.includes("eval")||t.method==="waitForFunction";if(s==="files")return{text:"<files>",type:"string",name:s};if((s==="eventInit"||s==="expectedValue"||s==="arg"&&c)&&(i=tt(i.value,new Array(10).fill({handle:"<handle>"}))),(s==="value"&&c||s==="received"&&t.method==="expect")&&(i=tt(i,new Array(10).fill({handle:"<handle>"}))),s==="selector")return{text:kt(n||"javascript",t.params.selector),type:"locator",name:"locator"};const l=typeof i;return l!=="object"||i===null?{text:String(i),type:l,name:s}:i.guid?{text:"<handle>",type:"handle",name:s}:{text:JSON.stringify(i).slice(0,1e3),type:"object",name:s}}function tt(t,s){if(t.n!==void 0)return t.n;if(t.s!==void 0)return t.s;if(t.b!==void 0)return t.b;if(t.v!==void 0){if(t.v==="undefined")return;if(t.v==="null")return null;if(t.v==="NaN")return NaN;if(t.v==="Infinity")return 1/0;if(t.v==="-Infinity")return-1/0;if(t.v==="-0")return-0}if(t.d!==void 0)return new Date(t.d);if(t.r!==void 0)return new RegExp(t.r.p,t.r.f);if(t.a!==void 0)return t.a.map(i=>tt(i,s));if(t.o!==void 0){const i={};for(const{k:n,v:c}of t.o)i[n]=tt(c,s);return i}return t.h!==void 0?s===void 0?"<object>":s[t.h]:"<object>"}const xe=Mt,fe=({action:t,isLive:s})=>{const i=d.useMemo(()=>{var a;if(!t||!t.log.length)return[];const n=t.log,c=t.context.wallTime-t.context.startTime,l=[];for(let r=0;r<n.length;++r){let o="";if(n[r].time!==-1){const x=(a=n[r])==null?void 0:a.time;r+1<n.length?o=F(n[r+1].time-x):t.endTime>0?o=F(t.endTime-x):s?o=F(Date.now()-c-x):o="-"}l.push({message:n[r].message,time:o})}return l},[t,s]);return i.length?e.jsx(xe,{name:"log",items:i,render:n=>e.jsxs("div",{className:"log-list-item",children:[e.jsx("span",{className:"log-list-duration",children:n.time}),n.message]}),notSelectable:!0}):e.jsx(J,{text:"No log entries"})},pe=({error:t})=>{const s=d.useMemo(()=>Yt(t),[t]);return e.jsx("div",{className:"error-message",dangerouslySetInnerHTML:{__html:s||""}})};function ge(t){return d.useMemo(()=>{if(!t)return{errors:new Map};const s=new Map;for(const i of t.errorDescriptors)s.set(i.message,i);return{errors:s}},[t])}const ve=({errorsModel:t,sdkLanguage:s,revealInSource:i})=>t.errors.size?e.jsx("div",{className:"fill",style:{overflow:"auto"},children:[...t.errors.entries()].map(([n,c])=>{var o;let l,a;const r=(o=c.stack)==null?void 0:o[0];return r&&(l=r.file.replace(/.*[/\\](.*)/,"$1")+":"+r.line,a=r.file+":"+r.line),e.jsxs("div",{children:[e.jsxs("div",{className:"hbox",style:{alignItems:"center",padding:"5px 10px",minHeight:36,fontWeight:"bold",color:"var(--vscode-errorForeground)"},children:[c.action&&dt(c.action,{sdkLanguage:s}),l&&e.jsxs("div",{className:"action-location",children:["@ ",e.jsx("span",{title:a,onClick:()=>i(c),children:l})]})]}),e.jsx(pe,{error:n})]},n)})}):e.jsx(J,{text:"No errors"}),Ct={width:200,height:45},_=2.5,je=Ct.height+_*2,we=({model:t,boundaries:s,previewPoint:i})=>{var h,v;const[n,c]=ht(),l=d.useRef(null);let a=0;if(l.current&&i){const m=l.current.getBoundingClientRect();a=(i.clientY-m.top+l.current.scrollTop)/je|0}const r=(v=(h=t==null?void 0:t.pages)==null?void 0:h[a])==null?void 0:v.screencastFrames;let o,x;if(i!==void 0&&r&&r.length){const m=s.minimum+(s.maximum-s.minimum)*i.x/n.width;o=r[St(r,m,Lt)-1];const b={width:Math.min(800,window.innerWidth/2|0),height:Math.min(800,window.innerHeight/2|0)};x=o?It({width:o.width,height:o.height},b):void 0}return e.jsxs("div",{className:"film-strip",ref:c,children:[e.jsx("div",{className:"film-strip-lanes",ref:l,children:t==null?void 0:t.pages.map((m,b)=>m.screencastFrames.length?e.jsx(Ne,{boundaries:s,page:m,width:n.width},b):null)}),(i==null?void 0:i.x)!==void 0&&e.jsxs("div",{className:"film-strip-hover",style:{top:n.bottom+5,left:Math.min(i.x,n.width-(x?x.width:0)-10)},children:[i.action&&e.jsx("div",{className:"film-strip-hover-title",children:dt(i.action,i)}),o&&x&&e.jsx("div",{style:{width:x.width,height:x.height},children:e.jsx("img",{src:`sha1/${o.sha1}`,width:x.width,height:x.height})})]})]})},Ne=({boundaries:t,page:s,width:i})=>{const n={width:0,height:0},c=s.screencastFrames;for(const w of c)n.width=Math.max(n.width,w.width),n.height=Math.max(n.height,w.height);const l=It(n,Ct),a=c[0].timestamp,r=c[c.length-1].timestamp,o=t.maximum-t.minimum,x=(a-t.minimum)/o*i,h=(t.maximum-r)/o*i,m=(r-a)/o*i/(l.width+2*_)|0,b=(r-a)/m,j=[];for(let w=0;a&&b&&w<m;++w){const M=a+b*w,f=St(c,M,Lt)-1;j.push(e.jsx("div",{className:"film-strip-frame",style:{width:l.width,height:l.height,backgroundImage:`url(sha1/${c[f].sha1})`,backgroundSize:`${l.width}px ${l.height}px`,margin:_,marginRight:_}},w))}return j.push(e.jsx("div",{className:"film-strip-frame",style:{width:l.width,height:l.height,backgroundImage:`url(sha1/${c[c.length-1].sha1})`,backgroundSize:`${l.width}px ${l.height}px`,margin:_,marginRight:_}},j.length)),e.jsx("div",{className:"film-strip-lane",style:{marginLeft:x+"px",marginRight:h+"px"},children:j})};function Lt(t,s){return t-s.timestamp}function It(t,s){const i=Math.max(t.width/s.width,t.height/s.height);return{width:t.width/i|0,height:t.height/i|0}}const be=({model:t,boundaries:s,consoleEntries:i,onSelected:n,highlightedAction:c,highlightedEntry:l,highlightedConsoleEntry:a,selectedTime:r,setSelectedTime:o,sdkLanguage:x})=>{const[h,v]=ht(),[m,b]=d.useState(),[j,w]=d.useState(),{offsets:M,curtainLeft:f,curtainRight:N}=d.useMemo(()=>{let p=r||s;if(m&&m.startX!==m.endX){const k=H(h.width,s,m.startX),I=H(h.width,s,m.endX);p={minimum:Math.min(k,I),maximum:Math.max(k,I)}}const u=W(h.width,s,p.minimum),C=W(h.width,s,s.maximum)-W(h.width,s,p.maximum);return{offsets:ye(h.width,s),curtainLeft:u,curtainRight:C}},[r,s,m,h]),y=d.useMemo(()=>{const p=[];for(const u of(t==null?void 0:t.actions)||[])u.class!=="Test"&&p.push({action:u,leftTime:u.startTime,rightTime:u.endTime||s.maximum,leftPosition:W(h.width,s,u.startTime),rightPosition:W(h.width,s,u.endTime||s.maximum),active:!1,error:!!u.error});for(const u of(t==null?void 0:t.resources)||[]){const S=u._monotonicTime,C=u._monotonicTime+u.time;p.push({resource:u,leftTime:S,rightTime:C,leftPosition:W(h.width,s,S),rightPosition:W(h.width,s,C),active:!1,error:!1})}for(const u of i||[])p.push({consoleMessage:u,leftTime:u.timestamp,rightTime:u.timestamp,leftPosition:W(h.width,s,u.timestamp),rightPosition:W(h.width,s,u.timestamp),active:!1,error:u.isError});return p},[t,i,s,h]);d.useMemo(()=>{for(const p of y)c?p.active=p.action===c:l?p.active=p.resource===l:a?p.active=p.consoleMessage===a:p.active=!1},[y,c,l,a]);const T=d.useCallback(p=>{if(w(void 0),!v.current)return;const u=p.clientX-v.current.getBoundingClientRect().left,S=H(h.width,s,u),C=r?W(h.width,s,r.minimum):0,k=r?W(h.width,s,r.maximum):0;r&&Math.abs(u-C)<10?b({startX:k,endX:u,type:"resize"}):r&&Math.abs(u-k)<10?b({startX:C,endX:u,type:"resize"}):r&&S>r.minimum&&S<r.maximum&&p.clientY-v.current.getBoundingClientRect().top<20?b({startX:C,endX:k,pivot:u,type:"move"}):b({startX:u,endX:u,type:"resize"})},[s,h,v,r]),L=d.useCallback(p=>{if(!v.current)return;const u=p.clientX-v.current.getBoundingClientRect().left,S=H(h.width,s,u),C=t==null?void 0:t.actions.findLast(A=>A.startTime<=S);if(!p.buttons){b(void 0);return}if(C&&n(C),!m)return;let k=m;if(m.type==="resize")k={...m,endX:u};else{const A=u-m.pivot;let U=m.startX+A,$=m.endX+A;U<0&&(U=0,$=U+(m.endX-m.startX)),$>h.width&&($=h.width,U=$-(m.endX-m.startX)),k={...m,startX:U,endX:$,pivot:u}}b(k);const I=H(h.width,s,k.startX),P=H(h.width,s,k.endX);I!==P&&o({minimum:Math.min(I,P),maximum:Math.max(I,P)})},[s,m,h,t,n,v,o]),R=d.useCallback(()=>{if(w(void 0),!!m){if(m.startX!==m.endX){const p=H(h.width,s,m.startX),u=H(h.width,s,m.endX);o({minimum:Math.min(p,u),maximum:Math.max(p,u)})}else{const p=H(h.width,s,m.startX),u=t==null?void 0:t.actions.findLast(S=>S.startTime<=p);u&&n(u),o(void 0)}b(void 0)}},[s,m,h,t,o,n]),X=d.useCallback(p=>{if(!v.current)return;const u=p.clientX-v.current.getBoundingClientRect().left,S=H(h.width,s,u),C=t==null?void 0:t.actions.findLast(k=>k.startTime<=S);w({x:u,clientY:p.clientY,action:C,sdkLanguage:x})},[s,h,t,v,x]),z=d.useCallback(()=>{w(void 0)},[]),G=d.useCallback(()=>{o(void 0)},[o]);return e.jsxs("div",{style:{flex:"none",borderBottom:"1px solid var(--vscode-panel-border)"},children:[!!m&&e.jsx(qt,{cursor:(m==null?void 0:m.type)==="resize"?"ew-resize":"grab",onPaneMouseUp:R,onPaneMouseMove:L,onPaneDoubleClick:G}),e.jsxs("div",{ref:v,className:"timeline-view",onMouseDown:T,onMouseMove:X,onMouseLeave:z,children:[e.jsx("div",{className:"timeline-grid",children:M.map((p,u)=>e.jsx("div",{className:"timeline-divider",style:{left:p.position+"px"},children:e.jsx("div",{className:"timeline-time",children:F(p.time-s.minimum)})},u))}),e.jsx("div",{style:{height:8}}),e.jsx(we,{model:t,boundaries:s,previewPoint:j}),e.jsx("div",{className:"timeline-bars",children:y.map((p,u)=>e.jsx("div",{className:K("timeline-bar",p.action&&"action",p.resource&&"network",p.consoleMessage&&"console-message",p.active&&"active",p.error&&"error"),style:{left:p.leftPosition,width:Math.max(5,p.rightPosition-p.leftPosition),top:Te(p),bottom:0}},u))}),e.jsx("div",{className:"timeline-marker",style:{display:j!==void 0?"block":"none",left:((j==null?void 0:j.x)||0)+"px"}}),r&&e.jsxs("div",{className:"timeline-window",children:[e.jsx("div",{className:"timeline-window-curtain left",style:{width:f}}),e.jsx("div",{className:"timeline-window-resizer",style:{left:-5}}),e.jsx("div",{className:"timeline-window-center",children:e.jsx("div",{className:"timeline-window-drag"})}),e.jsx("div",{className:"timeline-window-resizer",style:{left:5}}),e.jsx("div",{className:"timeline-window-curtain right",style:{width:N}})]})]})]})};function ye(t,s){let n=t/64;const c=s.maximum-s.minimum,l=t/c;let a=c/n;const r=Math.ceil(Math.log(a)/Math.LN10);a=Math.pow(10,r),a*l>=5*64&&(a=a/5),a*l>=2*64&&(a=a/2);const o=s.minimum;let x=s.maximum;x+=64/l,n=Math.ceil((x-o)/a),a||(n=0);const h=[];for(let v=0;v<n;++v){const m=o+a*v;h.push({position:W(t,s,m),time:m})}return h}function W(t,s,i){return(i-s.minimum)/(s.maximum-s.minimum)*t}function H(t,s,i){return i/t*(s.maximum-s.minimum)+s.minimum}function Te(t){return t.resource?25:20}const Me=({model:t})=>{var s,i;return t?e.jsxs("div",{"data-testid":"metadata-view",className:"vbox",style:{flexShrink:0},children:[e.jsx("div",{className:"call-section",style:{paddingTop:2},children:"Time"}),!!t.wallTime&&e.jsxs("div",{className:"call-line",children:["start time:",e.jsx("span",{className:"call-value datetime",title:new Date(t.wallTime).toLocaleString(),children:new Date(t.wallTime).toLocaleString()})]}),e.jsxs("div",{className:"call-line",children:["duration:",e.jsx("span",{className:"call-value number",title:F(t.endTime-t.startTime),children:F(t.endTime-t.startTime)})]}),e.jsx("div",{className:"call-section",children:"Browser"}),e.jsxs("div",{className:"call-line",children:["engine:",e.jsx("span",{className:"call-value string",title:t.browserName,children:t.browserName})]}),t.channel&&e.jsxs("div",{className:"call-line",children:["channel:",e.jsx("span",{className:"call-value string",title:t.channel,children:t.channel})]}),t.platform&&e.jsxs("div",{className:"call-line",children:["platform:",e.jsx("span",{className:"call-value string",title:t.platform,children:t.platform})]}),t.options.userAgent&&e.jsxs("div",{className:"call-line",children:["user agent:",e.jsx("span",{className:"call-value datetime",title:t.options.userAgent,children:t.options.userAgent})]}),t.options.baseURL&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"call-section",style:{paddingTop:2},children:"Config"}),e.jsxs("div",{className:"call-line",children:["baseURL:",e.jsx("a",{className:"call-value string",href:t.options.baseURL,title:t.options.baseURL,target:"_blank",rel:"noopener noreferrer",children:t.options.baseURL})]})]}),e.jsx("div",{className:"call-section",children:"Viewport"}),t.options.viewport&&e.jsxs("div",{className:"call-line",children:["width:",e.jsx("span",{className:"call-value number",title:String(!!((s=t.options.viewport)!=null&&s.width)),children:t.options.viewport.width})]}),t.options.viewport&&e.jsxs("div",{className:"call-line",children:["height:",e.jsx("span",{className:"call-value number",title:String(!!((i=t.options.viewport)!=null&&i.height)),children:t.options.viewport.height})]}),e.jsxs("div",{className:"call-line",children:["is mobile:",e.jsx("span",{className:"call-value boolean",title:String(!!t.options.isMobile),children:String(!!t.options.isMobile)})]}),t.options.deviceScaleFactor&&e.jsxs("div",{className:"call-line",children:["device scale:",e.jsx("span",{className:"call-value number",title:String(t.options.deviceScaleFactor),children:String(t.options.deviceScaleFactor)})]}),e.jsx("div",{className:"call-section",children:"Counts"}),e.jsxs("div",{className:"call-line",children:["pages:",e.jsx("span",{className:"call-value number",children:t.pages.length})]}),e.jsxs("div",{className:"call-line",children:["actions:",e.jsx("span",{className:"call-value number",children:t.actions.length})]}),e.jsxs("div",{className:"call-line",children:["events:",e.jsx("span",{className:"call-value number",children:t.events.length})]})]}):e.jsx(e.Fragment,{})};async function lt(t){const s=new Image;return t&&(s.src=t,await new Promise((i,n)=>{s.onload=i,s.onerror=i})),s}const ot={backgroundImage:`linear-gradient(45deg, #80808020 25%, transparent 25%),
2
2
  linear-gradient(-45deg, #80808020 25%, transparent 25%),
3
3
  linear-gradient(45deg, transparent 75%, #80808020 75%),
4
4
  linear-gradient(-45deg, transparent 75%, #80808020 75%)`,backgroundSize:"20px 20px",backgroundPosition:"0 0, 0 10px, 10px -10px, -10px 0px",boxShadow:`rgb(0 0 0 / 10%) 0px 1.8px 1.9px,