@codeyam/codeyam-cli 0.1.14 → 0.1.15

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 (87) hide show
  1. package/analyzer-template/.build-info.json +6 -6
  2. package/analyzer-template/log.txt +3 -3
  3. package/codeyam-cli/src/commands/editor.js +40 -5
  4. package/codeyam-cli/src/commands/editor.js.map +1 -1
  5. package/codeyam-cli/src/utils/__tests__/editorAudit.test.js +339 -1
  6. package/codeyam-cli/src/utils/__tests__/editorAudit.test.js.map +1 -1
  7. package/codeyam-cli/src/utils/__tests__/editorScenarios.test.js +39 -0
  8. package/codeyam-cli/src/utils/__tests__/editorScenarios.test.js.map +1 -1
  9. package/codeyam-cli/src/utils/__tests__/scenariosManifest.test.js +139 -1
  10. package/codeyam-cli/src/utils/__tests__/scenariosManifest.test.js.map +1 -1
  11. package/codeyam-cli/src/utils/backgroundServer.js +1 -1
  12. package/codeyam-cli/src/utils/backgroundServer.js.map +1 -1
  13. package/codeyam-cli/src/utils/editorAudit.js +69 -1
  14. package/codeyam-cli/src/utils/editorAudit.js.map +1 -1
  15. package/codeyam-cli/src/utils/editorScenarios.js +5 -1
  16. package/codeyam-cli/src/utils/editorScenarios.js.map +1 -1
  17. package/codeyam-cli/src/utils/scenariosManifest.js +30 -0
  18. package/codeyam-cli/src/utils/scenariosManifest.js.map +1 -1
  19. package/codeyam-cli/src/webserver/backgroundServer.js +42 -57
  20. package/codeyam-cli/src/webserver/backgroundServer.js.map +1 -1
  21. package/codeyam-cli/src/webserver/build/client/assets/{CopyButton-CzTDWkF2.js → CopyButton-CLe80MMu.js} +1 -1
  22. package/codeyam-cli/src/webserver/build/client/assets/{EntityItem-BFbq6iFk.js → EntityItem-Crt_KN_U.js} +1 -1
  23. package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeIcon-B6OMi58N.js → EntityTypeIcon-CD7lGABo.js} +1 -1
  24. package/codeyam-cli/src/webserver/build/client/assets/{InlineSpinner-DuYodzo1.js → InlineSpinner-CgTNOhnu.js} +1 -1
  25. package/codeyam-cli/src/webserver/build/client/assets/{InteractivePreview-CXo9EeCl.js → InteractivePreview-CKeQT5Ty.js} +2 -2
  26. package/codeyam-cli/src/webserver/build/client/assets/{LibraryFunctionPreview-DYCNb2It.js → LibraryFunctionPreview-D3s1MFkb.js} +1 -1
  27. package/codeyam-cli/src/webserver/build/client/assets/{LogViewer-CZgY3sxX.js → LogViewer-CM5zg40N.js} +1 -1
  28. package/codeyam-cli/src/webserver/build/client/assets/{ReportIssueModal-CnYYwRDw.js → ReportIssueModal-C2PLkej3.js} +1 -1
  29. package/codeyam-cli/src/webserver/build/client/assets/{SafeScreenshot-CDoF7ZpU.js → SafeScreenshot-DanvyBPb.js} +1 -1
  30. package/codeyam-cli/src/webserver/build/client/assets/{ScenarioViewer-DrnfvaLL.js → ScenarioViewer-DUMfcNVK.js} +1 -1
  31. package/codeyam-cli/src/webserver/build/client/assets/{Spinner-Df3UCi8k.js → Spinner-D0LgAaSa.js} +1 -1
  32. package/codeyam-cli/src/webserver/build/client/assets/{ViewportInspectBar-DRKR9T0U.js → ViewportInspectBar-BA_Ry-rs.js} +1 -1
  33. package/codeyam-cli/src/webserver/build/client/assets/{_index-ClR-g3tY.js → _index-BAWd-Xjf.js} +1 -1
  34. package/codeyam-cli/src/webserver/build/client/assets/{activity.(_tab)-DTH6ydEA.js → activity.(_tab)-BOARiB-g.js} +1 -1
  35. package/codeyam-cli/src/webserver/build/client/assets/{addon-web-links-74hnHF59.js → addon-web-links-CHx25PAe.js} +1 -1
  36. package/codeyam-cli/src/webserver/build/client/assets/{agent-transcripts-B8CYhCO9.js → agent-transcripts-Bg3e7q4S.js} +1 -1
  37. package/codeyam-cli/src/webserver/build/client/assets/{book-open-CLaoh4ac.js → book-open-CL-lMgHh.js} +1 -1
  38. package/codeyam-cli/src/webserver/build/client/assets/{chevron-down-BZ2DZxbW.js → chevron-down-GmAjGS9-.js} +1 -1
  39. package/codeyam-cli/src/webserver/build/client/assets/{chunk-JZWAC4HX-BBXArFPl.js → chunk-JZWAC4HX-BAdwhyCx.js} +11 -11
  40. package/codeyam-cli/src/webserver/build/client/assets/{circle-check-CT4unAk-.js → circle-check-DFcQkN5j.js} +1 -1
  41. package/codeyam-cli/src/webserver/build/client/assets/{copy-zK0B6Nu-.js → copy-C6iF61Xs.js} +1 -1
  42. package/codeyam-cli/src/webserver/build/client/assets/{createLucideIcon-DJB0YQJL.js → createLucideIcon-4ImjHTVC.js} +1 -1
  43. package/codeyam-cli/src/webserver/build/client/assets/{dev.empty-CkXFP_i-.js → dev.empty-C8y4mmyv.js} +1 -1
  44. package/codeyam-cli/src/webserver/build/client/assets/editor._tab-Gbk_i5Js.js +1 -0
  45. package/codeyam-cli/src/webserver/build/client/assets/editor.entity.(_sha)-B7xQ9Sjy.js +58 -0
  46. package/codeyam-cli/src/webserver/build/client/assets/{editorPreview-DggyRwOr.js → editorPreview-CxmrE6AF.js} +6 -6
  47. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha._-BqAN7hyG.js → entity._sha._-Blfy9UlN.js} +1 -1
  48. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha.scenarios._scenarioId.dev-D1eikpe1.js → entity._sha.scenarios._scenarioId.dev-CUobbQdQ.js} +1 -1
  49. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha.scenarios._scenarioId.fullscreen-Dg1NhIms.js → entity._sha.scenarios._scenarioId.fullscreen-C6eeL24i.js} +1 -1
  50. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.create-scenario-CJX6kkkV.js → entity._sha_.create-scenario-DQM8E7L4.js} +1 -1
  51. package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.edit._scenarioId-BhVjZhKg.js → entity._sha_.edit._scenarioId-CAoXLsQr.js} +1 -1
  52. package/codeyam-cli/src/webserver/build/client/assets/{entry.client-_gzKltPN.js → entry.client-SuW9syRS.js} +1 -1
  53. package/codeyam-cli/src/webserver/build/client/assets/{files-CV_17tZS.js → files-D-xGrg29.js} +1 -1
  54. package/codeyam-cli/src/webserver/build/client/assets/{git-D-YXmMbR.js → git-Bq_fbXP5.js} +1 -1
  55. package/codeyam-cli/src/webserver/build/client/assets/globals-fAqOD9ex.css +1 -0
  56. package/codeyam-cli/src/webserver/build/client/assets/{index-CCrgCshv.js → index-Bp1l4hSv.js} +1 -1
  57. package/codeyam-cli/src/webserver/build/client/assets/{index-BsX0F-9C.js → index-CWV9XZiG.js} +1 -1
  58. package/codeyam-cli/src/webserver/build/client/assets/{index-Blo6EK8G.js → index-DE3jI_dv.js} +1 -1
  59. package/codeyam-cli/src/webserver/build/client/assets/{labs-Byazq8Pv.js → labs-B_IX45ih.js} +1 -1
  60. package/codeyam-cli/src/webserver/build/client/assets/{loader-circle-DVQ0oHR7.js → loader-circle-De-7qQ2u.js} +1 -1
  61. package/codeyam-cli/src/webserver/build/client/assets/manifest-5d53342d.js +1 -0
  62. package/codeyam-cli/src/webserver/build/client/assets/{memory-b-VmA2Vj.js → memory-Cx2xEx7s.js} +1 -1
  63. package/codeyam-cli/src/webserver/build/client/assets/{pause-DGcndCAa.js → pause-CFxEKL1u.js} +1 -1
  64. package/codeyam-cli/src/webserver/build/client/assets/root-DB3O9_9j.js +67 -0
  65. package/codeyam-cli/src/webserver/build/client/assets/{search-C0Uw0bcK.js → search-BdBb5aqc.js} +1 -1
  66. package/codeyam-cli/src/webserver/build/client/assets/{settings-OoNgHIfW.js → settings-DdE-Untf.js} +1 -1
  67. package/codeyam-cli/src/webserver/build/client/assets/{simulations-Bcemfu8a.js → simulations-DSCdE99u.js} +1 -1
  68. package/codeyam-cli/src/webserver/build/client/assets/{terminal-BgMmG7R9.js → terminal-CrplD4b1.js} +1 -1
  69. package/codeyam-cli/src/webserver/build/client/assets/{triangle-alert-Cs87hJYK.js → triangle-alert-DqJ0j69l.js} +1 -1
  70. package/codeyam-cli/src/webserver/build/client/assets/{useCustomSizes-BR3Rs7JY.js → useCustomSizes-DhXHbEjP.js} +1 -1
  71. package/codeyam-cli/src/webserver/build/client/assets/{useLastLogLine-BxxP_XF9.js → useLastLogLine-BNd5hYuW.js} +1 -1
  72. package/codeyam-cli/src/webserver/build/client/assets/{useReportContext-BermyNU5.js → useReportContext-Cy5Qg_UR.js} +1 -1
  73. package/codeyam-cli/src/webserver/build/client/assets/{useToast-a_QN_W9_.js → useToast-5HR2j9ZE.js} +1 -1
  74. package/codeyam-cli/src/webserver/build/server/assets/{analysisRunner-if8kM_1Q.js → analysisRunner-DcJSnBCE.js} +1 -1
  75. package/codeyam-cli/src/webserver/build/server/assets/{index-CHymws6l.js → index-CEaDhUiv.js} +1 -1
  76. package/codeyam-cli/src/webserver/build/server/assets/{init-D3HkMDbI.js → init-DA7guOrE.js} +1 -1
  77. package/codeyam-cli/src/webserver/build/server/assets/{server-build-DTCzJQiH.js → server-build-juyiY2m6.js} +125 -125
  78. package/codeyam-cli/src/webserver/build/server/index.js +1 -1
  79. package/codeyam-cli/src/webserver/build-info.json +5 -5
  80. package/codeyam-cli/src/webserver/terminalServer.js +1 -1
  81. package/codeyam-cli/src/webserver/terminalServer.js.map +1 -1
  82. package/package.json +1 -1
  83. package/codeyam-cli/src/webserver/build/client/assets/editor._tab-DPw7NZHc.js +0 -1
  84. package/codeyam-cli/src/webserver/build/client/assets/editor.entity.(_sha)-DYqG1D_d.js +0 -58
  85. package/codeyam-cli/src/webserver/build/client/assets/globals-DRvOjyO3.css +0 -1
  86. package/codeyam-cli/src/webserver/build/client/assets/manifest-f4212c17.js +0 -1
  87. package/codeyam-cli/src/webserver/build/client/assets/root-F-k2uYj5.js +0 -67
@@ -1 +1 @@
1
- import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{r as a}from"./chunk-JZWAC4HX-BBXArFPl.js";function j({screenshotPath:l,cacheBuster:o,alt:x,className:f="",title:n}){const[i,s]=a.useState("loading"),[c,r]=a.useState(!1),d=a.useRef(null),u=o?`/api/screenshot/${l}?cb=${o}`:`/api/screenshot/${l}`,m=()=>{s("success"),r(!0)},h=()=>{s("error"),r(!1)};return a.useEffect(()=>{s("loading"),r(!1);const t=d.current;t!=null&&t.complete&&(t.naturalHeight!==0?(s("success"),r(!0)):(s("error"),r(!1)))},[u]),l?e.jsxs("div",{className:"relative w-full h-full flex items-center justify-center",title:n,children:[e.jsx("img",{ref:d,src:u,alt:x,onLoad:m,onError:h,className:f||"max-w-full max-h-full object-contain",style:{visibility:c?"visible":"hidden",position:c?"relative":"absolute"}}),i==="loading"&&e.jsx("div",{className:"absolute inset-0 bg-gray-100 animate-pulse rounded flex items-center justify-center",children:e.jsx("svg",{className:"w-8 h-8 text-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})})}),i==="error"&&e.jsxs("div",{className:"absolute inset-0 border-2 border-dashed border-gray-300 bg-gray-50 rounded flex flex-col items-center justify-center text-xs gap-1",children:[e.jsx("span",{className:"text-2xl text-gray-400",children:"📷"}),e.jsx("span",{className:"text-gray-400 whitespace-nowrap",children:"No Screenshot"})]})]}):e.jsx("div",{className:"w-full h-full border-2 border-dashed border-gray-300 bg-gray-50 rounded flex flex-col items-center justify-center text-xs gap-1",title:n,children:e.jsx("span",{className:"text-2xl text-gray-400",children:"📷"})})}export{j as S};
1
+ import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{r as a}from"./chunk-JZWAC4HX-BAdwhyCx.js";function j({screenshotPath:l,cacheBuster:o,alt:x,className:f="",title:n}){const[i,s]=a.useState("loading"),[c,r]=a.useState(!1),d=a.useRef(null),u=o?`/api/screenshot/${l}?cb=${o}`:`/api/screenshot/${l}`,m=()=>{s("success"),r(!0)},h=()=>{s("error"),r(!1)};return a.useEffect(()=>{s("loading"),r(!1);const t=d.current;t!=null&&t.complete&&(t.naturalHeight!==0?(s("success"),r(!0)):(s("error"),r(!1)))},[u]),l?e.jsxs("div",{className:"relative w-full h-full flex items-center justify-center",title:n,children:[e.jsx("img",{ref:d,src:u,alt:x,onLoad:m,onError:h,className:f||"max-w-full max-h-full object-contain",style:{visibility:c?"visible":"hidden",position:c?"relative":"absolute"}}),i==="loading"&&e.jsx("div",{className:"absolute inset-0 bg-gray-100 animate-pulse rounded flex items-center justify-center",children:e.jsx("svg",{className:"w-8 h-8 text-gray-300",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})})}),i==="error"&&e.jsxs("div",{className:"absolute inset-0 border-2 border-dashed border-gray-300 bg-gray-50 rounded flex flex-col items-center justify-center text-xs gap-1",children:[e.jsx("span",{className:"text-2xl text-gray-400",children:"📷"}),e.jsx("span",{className:"text-gray-400 whitespace-nowrap",children:"No Screenshot"})]})]}):e.jsx("div",{className:"w-full h-full border-2 border-dashed border-gray-300 bg-gray-50 rounded flex flex-col items-center justify-center text-xs gap-1",title:n,children:e.jsx("span",{className:"text-2xl text-gray-400",children:"📷"})})}export{j as S};
@@ -1,4 +1,4 @@
1
- import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{r as i,d as ge,L as ie}from"./chunk-JZWAC4HX-BBXArFPl.js";import{I as be}from"./InteractivePreview-CXo9EeCl.js";import{V as je}from"./ViewportInspectBar-DRKR9T0U.js";import{u as we,S as Ne}from"./useCustomSizes-BR3Rs7JY.js";import{L as J}from"./LogViewer-CZgY3sxX.js";import{S as ve}from"./SafeScreenshot-CDoF7ZpU.js";import{u as ke}from"./useLastLogLine-BxxP_XF9.js";import{u as Ce}from"./Spinner-Df3UCi8k.js";import{_ as ye}from"./preload-helper-ckwbz45p.js";import{R as Ie}from"./ReportIssueModal-CnYYwRDw.js";import{C as Ee,a as Le}from"./copy-zK0B6Nu-.js";import{g as Pe}from"./scenarioStatus-B_8jpV3e.js";function $e({presets:s,customSizes:t,currentWidth:n,currentHeight:o,scale:v,onSizeChange:N,onSaveCustomSize:w,onRemoveCustomSize:d,className:k=""}){const[h,x]=i.useState(!1),[g,b]=i.useState(String(n)),[m,j]=i.useState(String(o)),[C,u]=i.useState(!1),[l,R]=i.useState(!1),P=i.useRef(null);i.useEffect(()=>{C||b(String(n))},[n,C]),i.useEffect(()=>{l||j(String(o))},[o,l]),i.useEffect(()=>{const r=f=>{P.current&&!P.current.contains(f.target)&&x(!1)};return document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r)},[]);const $=i.useMemo(()=>{const r=s.find(c=>c.width===n&&c.height===o);if(r)return r.name;const f=t.find(c=>c.width===n&&c.height===o);return f?f.name:"Custom"},[s,t,n,o]),O=$==="Custom",S=r=>{N(r.width,r.height),x(!1)},W=r=>{const f=r.target.value;b(f);const c=parseInt(f,10);!isNaN(c)&&c>0&&N(c,o)},U=r=>{const f=r.target.value;j(f);const c=parseInt(f,10);!isNaN(c)&&c>0&&N(n,c)},A=()=>{u(!1);const r=parseInt(g,10);(isNaN(r)||r<=0)&&b(String(n))},K=()=>{R(!1);const r=parseInt(m,10);(isNaN(r)||r<=0)&&j(String(o))},D=r=>{(r.key==="Enter"||r.key==="Escape")&&r.target.blur()};return e.jsxs("div",{className:`flex items-center gap-3 ${k}`,children:[e.jsxs("div",{className:"relative",ref:P,children:[e.jsxs("button",{onClick:()=>x(!h),className:"flex items-center gap-2 px-3 py-1.5 bg-white border border-gray-300 rounded-md text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-[#005c75] focus:ring-offset-1 min-w-[120px] justify-between",children:[e.jsx("span",{children:$}),e.jsx("svg",{className:`w-4 h-4 transition-transform ${h?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),h&&e.jsx("div",{className:"absolute top-full left-0 mt-1 min-w-full bg-white border border-gray-200 rounded-md shadow-lg z-50",children:e.jsxs("div",{className:"py-1",children:[s.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-3 py-1 text-xs font-semibold text-gray-500 uppercase tracking-wider whitespace-nowrap",children:"Presets"}),s.map(r=>e.jsxs("button",{onClick:()=>S(r),className:`w-full text-left px-3 py-2 text-sm hover:bg-gray-100 flex justify-between items-center gap-4 whitespace-nowrap ${$===r.name?"bg-[#f0f7f9] text-[#005c75]":"text-gray-700"}`,children:[e.jsx("span",{children:r.name}),e.jsxs("span",{className:"text-xs text-gray-500",children:[r.width," x ",r.height]})]},r.name))]}),t.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"border-t border-gray-100 my-1"}),e.jsx("div",{className:"px-3 py-1 text-xs font-semibold text-gray-500 uppercase tracking-wider whitespace-nowrap",children:"Custom"}),[...t].sort((r,f)=>r.width-f.width).map(r=>e.jsxs("div",{className:`flex items-center gap-1 hover:bg-gray-100 ${$===r.name?"bg-[#f0f7f9] text-[#005c75]":"text-gray-700"}`,children:[e.jsxs("button",{onClick:()=>S(r),className:"flex-1 text-left px-3 py-2 text-sm flex justify-between items-center gap-4 whitespace-nowrap cursor-pointer",children:[e.jsx("span",{children:r.name}),e.jsxs("span",{className:"text-xs text-gray-500",children:[r.width," x ",r.height]})]}),d&&e.jsx("button",{onClick:f=>{f.stopPropagation(),$===r.name&&s.length>0&&N(s[0].width,s[0].height),d(r.name)},className:"p-1.5 mr-1 text-gray-400 hover:text-red-500 hover:bg-red-50 rounded cursor-pointer transition-colors",title:"Remove custom size",children:e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]},r.name))]})]})})]}),e.jsxs("div",{className:"flex items-center gap-1 text-sm",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx("input",{type:"text",value:g,onChange:W,onFocus:()=>u(!0),onBlur:A,onKeyDown:D,className:"w-16 px-2 py-1 text-right border border-gray-300 rounded-l-md text-sm focus:outline-none focus:ring-2 focus:ring-[#005c75] focus:border-[#005c75]"}),e.jsx("span",{className:"px-2 py-1 bg-gray-100 border border-l-0 border-gray-300 rounded-r-md text-gray-500 text-sm",children:"px"})]}),e.jsx("span",{className:"text-gray-400 mx-1",children:"×"}),e.jsxs("div",{className:"flex items-center",children:[e.jsx("input",{type:"text",value:m,onChange:U,onFocus:()=>R(!0),onBlur:K,onKeyDown:D,className:"w-16 px-2 py-1 text-right border border-gray-300 rounded-l-md text-sm focus:outline-none focus:ring-2 focus:ring-[#005c75] focus:border-[#005c75]"}),e.jsx("span",{className:"px-2 py-1 bg-gray-100 border border-l-0 border-gray-300 rounded-r-md text-gray-500 text-sm",children:"px"})]}),v!==void 0&&v<1&&e.jsxs("span",{className:"text-xs text-gray-500 ml-1",children:["(",Math.round(v*100),"%)"]})]}),O&&e.jsx("button",{onClick:w,className:"px-3 py-1.5 bg-[#005c75] text-white text-sm font-medium rounded-md hover:bg-[#004a5c] focus:outline-none focus:ring-2 focus:ring-[#005c75] focus:ring-offset-1 transition-colors",children:"Save Custom Size"})]})}function de({size:s=24,className:t=""}){return e.jsxs("svg",{width:s,height:s,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,"aria-hidden":"true",children:[e.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z",fill:"#ef4444",stroke:"none"}),e.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13",stroke:"#FFFFFF",strokeWidth:"2",strokeLinecap:"round"}),e.jsx("circle",{cx:"12",cy:"17",r:"1",fill:"#FFFFFF"})]})}function _e({scenario:s,analysis:t,entity:n}){var w,d,k;const o=((w=s.metadata)==null?void 0:w.executionResult)||null,v=((k=(d=s.metadata)==null?void 0:d.data)==null?void 0:k.argumentsData)||[],N=h=>{var j,C,u;if(!h)return"No execution results available yet. Run the function to capture side effects including console output, file operations, and API calls.";const x=[],g=((j=h.sideEffects)==null?void 0:j.consoleOutput)||[];g.length>0&&(x.push(`Console Output: ${g.length} log ${g.length===1?"entry":"entries"} captured`),g.forEach(l=>{x.push(` [${l.level.toUpperCase()}] ${l.args.join(" ")}`)}));const b=((C=h.sideEffects)==null?void 0:C.fileWrites)||[];b.length>0&&(x.push(`
1
+ import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{r as i,d as ge,L as ie}from"./chunk-JZWAC4HX-BAdwhyCx.js";import{I as be}from"./InteractivePreview-CKeQT5Ty.js";import{V as je}from"./ViewportInspectBar-BA_Ry-rs.js";import{u as we,S as Ne}from"./useCustomSizes-DhXHbEjP.js";import{L as J}from"./LogViewer-CM5zg40N.js";import{S as ve}from"./SafeScreenshot-DanvyBPb.js";import{u as ke}from"./useLastLogLine-BNd5hYuW.js";import{u as Ce}from"./Spinner-D0LgAaSa.js";import{_ as ye}from"./preload-helper-ckwbz45p.js";import{R as Ie}from"./ReportIssueModal-C2PLkej3.js";import{C as Ee,a as Le}from"./copy-C6iF61Xs.js";import{g as Pe}from"./scenarioStatus-B_8jpV3e.js";function $e({presets:s,customSizes:t,currentWidth:n,currentHeight:o,scale:v,onSizeChange:N,onSaveCustomSize:w,onRemoveCustomSize:d,className:k=""}){const[h,x]=i.useState(!1),[g,b]=i.useState(String(n)),[m,j]=i.useState(String(o)),[C,u]=i.useState(!1),[l,R]=i.useState(!1),P=i.useRef(null);i.useEffect(()=>{C||b(String(n))},[n,C]),i.useEffect(()=>{l||j(String(o))},[o,l]),i.useEffect(()=>{const r=f=>{P.current&&!P.current.contains(f.target)&&x(!1)};return document.addEventListener("mousedown",r),()=>document.removeEventListener("mousedown",r)},[]);const $=i.useMemo(()=>{const r=s.find(c=>c.width===n&&c.height===o);if(r)return r.name;const f=t.find(c=>c.width===n&&c.height===o);return f?f.name:"Custom"},[s,t,n,o]),O=$==="Custom",S=r=>{N(r.width,r.height),x(!1)},W=r=>{const f=r.target.value;b(f);const c=parseInt(f,10);!isNaN(c)&&c>0&&N(c,o)},U=r=>{const f=r.target.value;j(f);const c=parseInt(f,10);!isNaN(c)&&c>0&&N(n,c)},A=()=>{u(!1);const r=parseInt(g,10);(isNaN(r)||r<=0)&&b(String(n))},K=()=>{R(!1);const r=parseInt(m,10);(isNaN(r)||r<=0)&&j(String(o))},D=r=>{(r.key==="Enter"||r.key==="Escape")&&r.target.blur()};return e.jsxs("div",{className:`flex items-center gap-3 ${k}`,children:[e.jsxs("div",{className:"relative",ref:P,children:[e.jsxs("button",{onClick:()=>x(!h),className:"flex items-center gap-2 px-3 py-1.5 bg-white border border-gray-300 rounded-md text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-[#005c75] focus:ring-offset-1 min-w-[120px] justify-between",children:[e.jsx("span",{children:$}),e.jsx("svg",{className:`w-4 h-4 transition-transform ${h?"rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]}),h&&e.jsx("div",{className:"absolute top-full left-0 mt-1 min-w-full bg-white border border-gray-200 rounded-md shadow-lg z-50",children:e.jsxs("div",{className:"py-1",children:[s.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-3 py-1 text-xs font-semibold text-gray-500 uppercase tracking-wider whitespace-nowrap",children:"Presets"}),s.map(r=>e.jsxs("button",{onClick:()=>S(r),className:`w-full text-left px-3 py-2 text-sm hover:bg-gray-100 flex justify-between items-center gap-4 whitespace-nowrap ${$===r.name?"bg-[#f0f7f9] text-[#005c75]":"text-gray-700"}`,children:[e.jsx("span",{children:r.name}),e.jsxs("span",{className:"text-xs text-gray-500",children:[r.width," x ",r.height]})]},r.name))]}),t.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"border-t border-gray-100 my-1"}),e.jsx("div",{className:"px-3 py-1 text-xs font-semibold text-gray-500 uppercase tracking-wider whitespace-nowrap",children:"Custom"}),[...t].sort((r,f)=>r.width-f.width).map(r=>e.jsxs("div",{className:`flex items-center gap-1 hover:bg-gray-100 ${$===r.name?"bg-[#f0f7f9] text-[#005c75]":"text-gray-700"}`,children:[e.jsxs("button",{onClick:()=>S(r),className:"flex-1 text-left px-3 py-2 text-sm flex justify-between items-center gap-4 whitespace-nowrap cursor-pointer",children:[e.jsx("span",{children:r.name}),e.jsxs("span",{className:"text-xs text-gray-500",children:[r.width," x ",r.height]})]}),d&&e.jsx("button",{onClick:f=>{f.stopPropagation(),$===r.name&&s.length>0&&N(s[0].width,s[0].height),d(r.name)},className:"p-1.5 mr-1 text-gray-400 hover:text-red-500 hover:bg-red-50 rounded cursor-pointer transition-colors",title:"Remove custom size",children:e.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]},r.name))]})]})})]}),e.jsxs("div",{className:"flex items-center gap-1 text-sm",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx("input",{type:"text",value:g,onChange:W,onFocus:()=>u(!0),onBlur:A,onKeyDown:D,className:"w-16 px-2 py-1 text-right border border-gray-300 rounded-l-md text-sm focus:outline-none focus:ring-2 focus:ring-[#005c75] focus:border-[#005c75]"}),e.jsx("span",{className:"px-2 py-1 bg-gray-100 border border-l-0 border-gray-300 rounded-r-md text-gray-500 text-sm",children:"px"})]}),e.jsx("span",{className:"text-gray-400 mx-1",children:"×"}),e.jsxs("div",{className:"flex items-center",children:[e.jsx("input",{type:"text",value:m,onChange:U,onFocus:()=>R(!0),onBlur:K,onKeyDown:D,className:"w-16 px-2 py-1 text-right border border-gray-300 rounded-l-md text-sm focus:outline-none focus:ring-2 focus:ring-[#005c75] focus:border-[#005c75]"}),e.jsx("span",{className:"px-2 py-1 bg-gray-100 border border-l-0 border-gray-300 rounded-r-md text-gray-500 text-sm",children:"px"})]}),v!==void 0&&v<1&&e.jsxs("span",{className:"text-xs text-gray-500 ml-1",children:["(",Math.round(v*100),"%)"]})]}),O&&e.jsx("button",{onClick:w,className:"px-3 py-1.5 bg-[#005c75] text-white text-sm font-medium rounded-md hover:bg-[#004a5c] focus:outline-none focus:ring-2 focus:ring-[#005c75] focus:ring-offset-1 transition-colors",children:"Save Custom Size"})]})}function de({size:s=24,className:t=""}){return e.jsxs("svg",{width:s,height:s,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:t,"aria-hidden":"true",children:[e.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z",fill:"#ef4444",stroke:"none"}),e.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13",stroke:"#FFFFFF",strokeWidth:"2",strokeLinecap:"round"}),e.jsx("circle",{cx:"12",cy:"17",r:"1",fill:"#FFFFFF"})]})}function _e({scenario:s,analysis:t,entity:n}){var w,d,k;const o=((w=s.metadata)==null?void 0:w.executionResult)||null,v=((k=(d=s.metadata)==null?void 0:d.data)==null?void 0:k.argumentsData)||[],N=h=>{var j,C,u;if(!h)return"No execution results available yet. Run the function to capture side effects including console output, file operations, and API calls.";const x=[],g=((j=h.sideEffects)==null?void 0:j.consoleOutput)||[];g.length>0&&(x.push(`Console Output: ${g.length} log ${g.length===1?"entry":"entries"} captured`),g.forEach(l=>{x.push(` [${l.level.toUpperCase()}] ${l.args.join(" ")}`)}));const b=((C=h.sideEffects)==null?void 0:C.fileWrites)||[];b.length>0&&(x.push(`
2
2
  File System Operations: ${b.length} ${b.length===1?"operation":"operations"} detected`),b.forEach(l=>{x.push(` ${l.operation}: ${l.path}${l.size?` (${l.size} bytes)`:""}`)}));const m=((u=h.sideEffects)==null?void 0:u.apiCalls)||[];return m.length>0&&(x.push(`
3
3
  API Calls: ${m.length} ${m.length===1?"call":"calls"} made`),m.forEach(l=>{x.push(` ${l.method} ${l.url}${l.status?` → ${l.status}`:""}${l.duration?` (${l.duration}ms)`:""}`)})),h.error&&x.push(`
4
4
  Error: ${h.error.name||"Error"}: ${h.error.message}`),x.length===0?"No side effects detected. The function executed without console output, file operations, or API calls.":x.join(`
@@ -1,4 +1,4 @@
1
- import{d as P,r as t}from"./chunk-JZWAC4HX-BBXArFPl.js";import{u as _}from"./useLastLogLine-BxxP_XF9.js";import{j as y}from"./jsx-runtime-D_zvdyIk.js";function R(s){const o=s.replace(/[^a-zA-Z0-9_]+/g,"_");return o.slice(0,1).toUpperCase()+o.slice(1)}function G({analysisId:s,scenarioId:o,scenarioName:i,entityName:c,projectSlug:m,enabled:x=!0,refreshTrigger:p=0}){const k=P(),[b,E]=t.useState(null),[q,U]=t.useState(!1),[z,u]=t.useState(!1),[A,f]=t.useState(!1),v=t.useRef(!1),I=t.useRef(null),g=t.useRef(null),h=t.useRef(null),[F,w]=t.useState(0),[j,M]=t.useState(0),r=t.useRef(null),l=t.useRef(!1),{interactiveUrl:L,resetLogs:T}=_(m,x),C=t.useRef(o),B=t.useRef(p);t.useEffect(()=>{B.current!==p&&(B.current=p,b&&(console.log("[useInteractiveMode] Manual refresh triggered"),u(!0),f(!1),w(0),M(e=>e+1),l.current=!1,r.current&&(clearTimeout(r.current),r.current=null)))},[p,b]),t.useEffect(()=>{if(C.current!==o&&(C.current=o,I.current&&g.current&&i)){let e=I.current;if(h.current&&c){const a=R(h.current),d=R(c);a!==d&&(e=e.replace(a,d),h.current=c)}const n=R(g.current),S=R(i);e=e.replace(n,S),g.current=i,E(e),u(!0),f(!1),w(0),M(a=>a+1),l.current=!1,r.current&&(clearTimeout(r.current),r.current=null);return}},[o,i,c]),t.useEffect(()=>{if(L){const e=L+"?width=600px";I.current=e,i&&(g.current=i),c&&(h.current=c),E(e),U(!1),u(!0)}},[L]),t.useEffect(()=>{const e=n=>{n.data.type==="codeyam-resize"&&(l.current||(l.current=!0,r.current&&(clearTimeout(r.current),r.current=null),w(0),f(!0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{u(!1)})})))};return window.addEventListener("message",e),()=>window.removeEventListener("message",e)},[]);const D=()=>{l.current=!1,r.current&&clearTimeout(r.current);const e=300*Math.pow(2,F);r.current=setTimeout(()=>{l.current||(F<2?(w(n=>n+1),M(n=>n+1),u(!0)):(console.error("[useInteractiveMode] Interactive mode failed to load after 3 attempts - showing iframe anyway"),f(!0),u(!1)))},e)};return t.useEffect(()=>{x&&!v.current&&o&&s&&(v.current=!0,U(!0),f(!1),E(null),(async()=>{if(m)try{await fetch(`/api/logs/${m}`,{method:"DELETE"})}catch(n){console.error("[useInteractiveMode] Failed to clear log file:",n)}T(),k.submit({action:"start",analysisId:s,scenarioId:o},{method:"post",action:"/api/interactive-mode"})})())},[x,o,s,T,m]),t.useEffect(()=>{const e=s,n=()=>{if(v.current&&e){const a=new URLSearchParams({action:"stop",analysisId:e});console.log("[useInteractiveMode] Sending stop request via sendBeacon");const d=navigator.sendBeacon("/api/interactive-mode",a);console.log("[useInteractiveMode] sendBeacon result:",d),d||(console.log("[useInteractiveMode] sendBeacon failed, using fetch fallback"),fetch("/api/interactive-mode",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:a,keepalive:!0}).catch(K=>console.error("Failed to stop interactive mode:",K)))}},S=()=>{n()};return window.addEventListener("beforeunload",S),()=>{window.removeEventListener("beforeunload",S),console.log("[useInteractiveMode] Cleanup running:",{hasStarted:v.current,analysisId:e}),n()}},[s]),{interactiveServerUrl:b,isStarting:q,isLoading:z,showIframe:A,iframeKey:j,onIframeLoad:D}}function H(){return y.jsxs("div",{className:"spinner-container",children:[y.jsx("span",{className:"loader"}),y.jsx("style",{children:`
1
+ import{d as P,r as t}from"./chunk-JZWAC4HX-BAdwhyCx.js";import{u as _}from"./useLastLogLine-BNd5hYuW.js";import{j as y}from"./jsx-runtime-D_zvdyIk.js";function R(s){const o=s.replace(/[^a-zA-Z0-9_]+/g,"_");return o.slice(0,1).toUpperCase()+o.slice(1)}function G({analysisId:s,scenarioId:o,scenarioName:i,entityName:c,projectSlug:m,enabled:x=!0,refreshTrigger:p=0}){const k=P(),[b,E]=t.useState(null),[q,U]=t.useState(!1),[z,u]=t.useState(!1),[A,f]=t.useState(!1),v=t.useRef(!1),I=t.useRef(null),g=t.useRef(null),h=t.useRef(null),[F,w]=t.useState(0),[j,M]=t.useState(0),r=t.useRef(null),l=t.useRef(!1),{interactiveUrl:L,resetLogs:T}=_(m,x),C=t.useRef(o),B=t.useRef(p);t.useEffect(()=>{B.current!==p&&(B.current=p,b&&(console.log("[useInteractiveMode] Manual refresh triggered"),u(!0),f(!1),w(0),M(e=>e+1),l.current=!1,r.current&&(clearTimeout(r.current),r.current=null)))},[p,b]),t.useEffect(()=>{if(C.current!==o&&(C.current=o,I.current&&g.current&&i)){let e=I.current;if(h.current&&c){const a=R(h.current),d=R(c);a!==d&&(e=e.replace(a,d),h.current=c)}const n=R(g.current),S=R(i);e=e.replace(n,S),g.current=i,E(e),u(!0),f(!1),w(0),M(a=>a+1),l.current=!1,r.current&&(clearTimeout(r.current),r.current=null);return}},[o,i,c]),t.useEffect(()=>{if(L){const e=L+"?width=600px";I.current=e,i&&(g.current=i),c&&(h.current=c),E(e),U(!1),u(!0)}},[L]),t.useEffect(()=>{const e=n=>{n.data.type==="codeyam-resize"&&(l.current||(l.current=!0,r.current&&(clearTimeout(r.current),r.current=null),w(0),f(!0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{u(!1)})})))};return window.addEventListener("message",e),()=>window.removeEventListener("message",e)},[]);const D=()=>{l.current=!1,r.current&&clearTimeout(r.current);const e=300*Math.pow(2,F);r.current=setTimeout(()=>{l.current||(F<2?(w(n=>n+1),M(n=>n+1),u(!0)):(console.error("[useInteractiveMode] Interactive mode failed to load after 3 attempts - showing iframe anyway"),f(!0),u(!1)))},e)};return t.useEffect(()=>{x&&!v.current&&o&&s&&(v.current=!0,U(!0),f(!1),E(null),(async()=>{if(m)try{await fetch(`/api/logs/${m}`,{method:"DELETE"})}catch(n){console.error("[useInteractiveMode] Failed to clear log file:",n)}T(),k.submit({action:"start",analysisId:s,scenarioId:o},{method:"post",action:"/api/interactive-mode"})})())},[x,o,s,T,m]),t.useEffect(()=>{const e=s,n=()=>{if(v.current&&e){const a=new URLSearchParams({action:"stop",analysisId:e});console.log("[useInteractiveMode] Sending stop request via sendBeacon");const d=navigator.sendBeacon("/api/interactive-mode",a);console.log("[useInteractiveMode] sendBeacon result:",d),d||(console.log("[useInteractiveMode] sendBeacon failed, using fetch fallback"),fetch("/api/interactive-mode",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:a,keepalive:!0}).catch(K=>console.error("Failed to stop interactive mode:",K)))}},S=()=>{n()};return window.addEventListener("beforeunload",S),()=>{window.removeEventListener("beforeunload",S),console.log("[useInteractiveMode] Cleanup running:",{hasStarted:v.current,analysisId:e}),n()}},[s]),{interactiveServerUrl:b,isStarting:q,isLoading:z,showIframe:A,iframeKey:j,onIframeLoad:D}}function H(){return y.jsxs("div",{className:"spinner-container",children:[y.jsx("span",{className:"loader"}),y.jsx("style",{children:`
2
2
  .loader {
3
3
  width: 48px;
4
4
  height: 48px;
@@ -1 +1 @@
1
- import{j as n}from"./jsx-runtime-D_zvdyIk.js";import{r as u}from"./chunk-JZWAC4HX-BBXArFPl.js";const m=10,W=1024;function L({currentViewportWidth:g,currentPresetName:P,onDevicePresetClick:w,devicePresets:p,onHoverChange:c,hideLabel:E=!1,lightMode:d=!1}){const[r,v]=u.useState(null),x=u.useRef(null),j=u.useMemo(()=>[...p].sort((t,s)=>t.width-s.width),[p]),{fittingPresets:o,overflowPresets:i}=u.useMemo(()=>{const t=[],s=[];for(const e of j)e.width<=W?t.push(e):s.push(e);return s.sort((e,l)=>l.width-e.width),{fittingPresets:t,overflowPresets:s}},[j]),b=u.useCallback(t=>{if(!x.current)return null;const s=x.current.getBoundingClientRect(),e=t-s.left,l=s.width,h=l/2,y=(o.length>0?o[o.length-1].width:0)/2,S=h-y,X=h+y,$=i.length>0?(i.length-1)*m:0;if(i.length>0){if(e<S){if(e<=$){const a=Math.min(Math.floor(e/m),i.length-1);return i[a]}return i[i.length-1]}if(e>X){const a=l-e;if(a<=$){const f=Math.min(Math.floor(a/m),i.length-1);return i[f]}return i[i.length-1]}}const k=Math.abs(e-h);for(let a=o.length-1;a>=0;a--){const f=o[a],F=o[a-1],B=f.width/2,T=F?F.width/2:0;if(k<=B&&k>=T)return f}return o[0]||i[i.length-1]||null},[o,i]),I=u.useCallback(t=>{const s=b(t.clientX);v(s),c==null||c(s)},[b,c]),M=u.useCallback(()=>{v(null),c==null||c(null)},[c]),R=u.useCallback(t=>{const s=b(t.clientX);s&&w(s)},[b,w]),N=r||{name:P,width:g};return n.jsxs("div",{ref:x,className:"relative h-6 shrink-0 overflow-hidden cursor-pointer",onMouseMove:I,onMouseLeave:M,onClick:R,children:[r&&n.jsx("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:n.jsx("div",{className:"h-full transition-all duration-100 bg-[#005C75]",style:{width:`${r.width}px`}})}),n.jsx("div",{className:"absolute inset-0 pointer-events-none",children:o.map(t=>{const s=t.width===g,e=(r==null?void 0:r.name)===t.name,l=t.width/2;return n.jsxs("div",{children:[n.jsx("div",{className:"absolute top-0 bottom-0",style:{left:`calc(50% - ${l}px)`},children:n.jsx("div",{className:`w-0.5 h-full transition-colors duration-75 ${s||e?d?"bg-gray-900":"bg-white":d?"bg-[rgba(0,0,0,0.2)]":"bg-[rgba(255,255,255,0.3)]"}`})}),n.jsx("div",{className:"absolute top-0 bottom-0",style:{left:`calc(50% + ${l}px)`},children:n.jsx("div",{className:`w-0.5 h-full transition-colors duration-75 ${s||e?d?"bg-gray-900":"bg-white":d?"bg-[rgba(0,0,0,0.2)]":"bg-[rgba(255,255,255,0.3)]"}`})})]},t.name)})}),n.jsx("div",{className:"absolute inset-0 pointer-events-none",children:i.map((t,s)=>{const e=s*m,l=t.width===g,h=(r==null?void 0:r.name)===t.name;return n.jsxs("div",{children:[n.jsx("div",{className:"absolute top-0 bottom-0",style:{left:`${e}px`},children:n.jsx("div",{className:`w-0.5 h-full transition-colors duration-75 ${l||h?d?"bg-gray-900":"bg-white":d?"bg-[rgba(0,0,0,0.2)]":"bg-[rgba(255,255,255,0.3)]"}`})}),n.jsx("div",{className:"absolute top-0 bottom-0",style:{right:`${e}px`},children:n.jsx("div",{className:`w-0.5 h-full transition-colors duration-75 ${l||h?d?"bg-gray-900":"bg-white":d?"bg-[rgba(0,0,0,0.2)]":"bg-[rgba(255,255,255,0.3)]"}`})})]},t.name)})}),!E&&n.jsx("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:n.jsxs("div",{className:`text-[10px] px-2 py-0.5 rounded shadow-sm whitespace-nowrap transition-colors ${r?"bg-[#005c75] text-white":"bg-white/90 text-[#005c75] border border-[rgba(0,92,117,0.25)]"}`,children:[N.name," - ",N.width,"px"]})})]})}export{L as V};
1
+ import{j as n}from"./jsx-runtime-D_zvdyIk.js";import{r as u}from"./chunk-JZWAC4HX-BAdwhyCx.js";const m=10,W=1024;function L({currentViewportWidth:g,currentPresetName:P,onDevicePresetClick:w,devicePresets:p,onHoverChange:c,hideLabel:E=!1,lightMode:d=!1}){const[r,v]=u.useState(null),x=u.useRef(null),j=u.useMemo(()=>[...p].sort((t,s)=>t.width-s.width),[p]),{fittingPresets:o,overflowPresets:i}=u.useMemo(()=>{const t=[],s=[];for(const e of j)e.width<=W?t.push(e):s.push(e);return s.sort((e,l)=>l.width-e.width),{fittingPresets:t,overflowPresets:s}},[j]),b=u.useCallback(t=>{if(!x.current)return null;const s=x.current.getBoundingClientRect(),e=t-s.left,l=s.width,h=l/2,y=(o.length>0?o[o.length-1].width:0)/2,S=h-y,X=h+y,$=i.length>0?(i.length-1)*m:0;if(i.length>0){if(e<S){if(e<=$){const a=Math.min(Math.floor(e/m),i.length-1);return i[a]}return i[i.length-1]}if(e>X){const a=l-e;if(a<=$){const f=Math.min(Math.floor(a/m),i.length-1);return i[f]}return i[i.length-1]}}const k=Math.abs(e-h);for(let a=o.length-1;a>=0;a--){const f=o[a],F=o[a-1],B=f.width/2,T=F?F.width/2:0;if(k<=B&&k>=T)return f}return o[0]||i[i.length-1]||null},[o,i]),I=u.useCallback(t=>{const s=b(t.clientX);v(s),c==null||c(s)},[b,c]),M=u.useCallback(()=>{v(null),c==null||c(null)},[c]),R=u.useCallback(t=>{const s=b(t.clientX);s&&w(s)},[b,w]),N=r||{name:P,width:g};return n.jsxs("div",{ref:x,className:"relative h-6 shrink-0 overflow-hidden cursor-pointer",onMouseMove:I,onMouseLeave:M,onClick:R,children:[r&&n.jsx("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:n.jsx("div",{className:"h-full transition-all duration-100 bg-[#005C75]",style:{width:`${r.width}px`}})}),n.jsx("div",{className:"absolute inset-0 pointer-events-none",children:o.map(t=>{const s=t.width===g,e=(r==null?void 0:r.name)===t.name,l=t.width/2;return n.jsxs("div",{children:[n.jsx("div",{className:"absolute top-0 bottom-0",style:{left:`calc(50% - ${l}px)`},children:n.jsx("div",{className:`w-0.5 h-full transition-colors duration-75 ${s||e?d?"bg-gray-900":"bg-white":d?"bg-[rgba(0,0,0,0.2)]":"bg-[rgba(255,255,255,0.3)]"}`})}),n.jsx("div",{className:"absolute top-0 bottom-0",style:{left:`calc(50% + ${l}px)`},children:n.jsx("div",{className:`w-0.5 h-full transition-colors duration-75 ${s||e?d?"bg-gray-900":"bg-white":d?"bg-[rgba(0,0,0,0.2)]":"bg-[rgba(255,255,255,0.3)]"}`})})]},t.name)})}),n.jsx("div",{className:"absolute inset-0 pointer-events-none",children:i.map((t,s)=>{const e=s*m,l=t.width===g,h=(r==null?void 0:r.name)===t.name;return n.jsxs("div",{children:[n.jsx("div",{className:"absolute top-0 bottom-0",style:{left:`${e}px`},children:n.jsx("div",{className:`w-0.5 h-full transition-colors duration-75 ${l||h?d?"bg-gray-900":"bg-white":d?"bg-[rgba(0,0,0,0.2)]":"bg-[rgba(255,255,255,0.3)]"}`})}),n.jsx("div",{className:"absolute top-0 bottom-0",style:{right:`${e}px`},children:n.jsx("div",{className:`w-0.5 h-full transition-colors duration-75 ${l||h?d?"bg-gray-900":"bg-white":d?"bg-[rgba(0,0,0,0.2)]":"bg-[rgba(255,255,255,0.3)]"}`})})]},t.name)})}),!E&&n.jsx("div",{className:"absolute inset-0 flex items-center justify-center pointer-events-none",children:n.jsxs("div",{className:`text-[10px] px-2 py-0.5 rounded shadow-sm whitespace-nowrap transition-colors ${r?"bg-[#005c75] text-white":"bg-white/90 text-[#005c75] border border-[rgba(0,92,117,0.25)]"}`,children:[N.name," - ",N.width,"px"]})})]})}export{L as V};
@@ -1,4 +1,4 @@
1
- import{r as u,L as p,w as se,u as te,d as ae,f as re}from"./chunk-JZWAC4HX-BBXArFPl.js";import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{u as ne}from"./useLastLogLine-BxxP_XF9.js";import{u as le}from"./useToast-a_QN_W9_.js";import{u as oe}from"./useReportContext-BermyNU5.js";import{L as ie}from"./LogViewer-CZgY3sxX.js";import{I as E,C as P,E as ce}from"./EntityTypeIcon-B6OMi58N.js";import{S as Y}from"./SafeScreenshot-CDoF7ZpU.js";import{g as de}from"./scenarioStatus-B_8jpV3e.js";import{c as q}from"./createLucideIcon-DJB0YQJL.js";import{C as xe}from"./circle-check-CT4unAk-.js";import{L as S}from"./loader-circle-DVQ0oHR7.js";/**
1
+ import{r as u,L as p,w as se,u as te,d as ae,f as re}from"./chunk-JZWAC4HX-BAdwhyCx.js";import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{u as ne}from"./useLastLogLine-BNd5hYuW.js";import{u as le}from"./useToast-5HR2j9ZE.js";import{u as oe}from"./useReportContext-Cy5Qg_UR.js";import{L as ie}from"./LogViewer-CM5zg40N.js";import{I as E,C as P,E as ce}from"./EntityTypeIcon-CD7lGABo.js";import{S as Y}from"./SafeScreenshot-DanvyBPb.js";import{g as de}from"./scenarioStatus-B_8jpV3e.js";import{c as q}from"./createLucideIcon-4ImjHTVC.js";import{C as xe}from"./circle-check-DFcQkN5j.js";import{L as S}from"./loader-circle-De-7qQ2u.js";/**
2
2
  * @license lucide-react v0.577.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{w as se,u as te,j as re,r as f,L as b,f as R}from"./chunk-JZWAC4HX-BBXArFPl.js";import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{L as oe}from"./LogViewer-CZgY3sxX.js";import{u as ie}from"./useLastLogLine-BxxP_XF9.js";import{u as le}from"./useReportContext-BermyNU5.js";import{E as q}from"./EntityTypeIcon-B6OMi58N.js";import{E as ee}from"./EntityTypeBadge-CQgyEGV-.js";import{S as Z}from"./SafeScreenshot-CDoF7ZpU.js";import{L as ae}from"./LoadingDots-By5zI316.js";import{L as ne}from"./loader-circle-DVQ0oHR7.js";import{P as ce,F as de}from"./pause-DGcndCAa.js";import{c as X}from"./createLucideIcon-DJB0YQJL.js";/**
1
+ import{w as se,u as te,j as re,r as f,L as b,f as R}from"./chunk-JZWAC4HX-BAdwhyCx.js";import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{L as oe}from"./LogViewer-CM5zg40N.js";import{u as ie}from"./useLastLogLine-BNd5hYuW.js";import{u as le}from"./useReportContext-Cy5Qg_UR.js";import{E as q}from"./EntityTypeIcon-CD7lGABo.js";import{E as ee}from"./EntityTypeBadge-CQgyEGV-.js";import{S as Z}from"./SafeScreenshot-DanvyBPb.js";import{L as ae}from"./LoadingDots-By5zI316.js";import{L as ne}from"./loader-circle-De-7qQ2u.js";import{P as ce,F as de}from"./pause-CFxEKL1u.js";import{c as X}from"./createLucideIcon-4ImjHTVC.js";/**
2
2
  * @license lucide-react v0.577.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{g as O}from"./chunk-JZWAC4HX-BBXArFPl.js";function j(b,k){for(var _=0;_<k.length;_++){const l=k[_];if(typeof l!="string"&&!Array.isArray(l)){for(const u in l)if(u!=="default"&&!(u in b)){const L=Object.getOwnPropertyDescriptor(l,u);L&&Object.defineProperty(b,u,L.get?L:{enumerable:!0,get:()=>l[u]})}}}return Object.freeze(Object.defineProperty(b,Symbol.toStringTag,{value:"Module"}))}var w={exports:{}},$;function A(){return $||($=1,(function(b,k){(function(_,l){b.exports=l()})(self,(()=>(()=>{var _={6:(p,d)=>{function h(n){try{const e=new URL(n),t=e.password&&e.username?`${e.protocol}//${e.username}:${e.password}@${e.host}`:e.username?`${e.protocol}//${e.username}@${e.host}`:`${e.protocol}//${e.host}`;return n.toLocaleLowerCase().startsWith(t.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(d,"__esModule",{value:!0}),d.LinkComputer=d.WebLinkProvider=void 0,d.WebLinkProvider=class{constructor(n,e,t,r={}){this._terminal=n,this._regex=e,this._handler=t,this._options=r}provideLinks(n,e){const t=f.computeLink(n,this._regex,this._terminal,this._handler);e(this._addCallbacks(t))}_addCallbacks(n){return n.map((e=>(e.leave=this._options.leave,e.hover=(t,r)=>{if(this._options.hover){const{range:c}=e;this._options.hover(t,r,c)}},e)))}};class f{static computeLink(e,t,r,c){const g=new RegExp(t.source,(t.flags||"")+"g"),[o,s]=f._getWindowedLineStrings(e-1,r),i=o.join("");let a;const x=[];for(;a=g.exec(i);){const v=a[0];if(!h(v))continue;const[m,W]=f._mapStrIdx(r,s,0,a.index),[y,P]=f._mapStrIdx(r,m,W,v.length);if(m===-1||W===-1||y===-1||P===-1)continue;const S={start:{x:W+1,y:m+1},end:{x:P,y:y+1}};x.push({range:S,text:v,activate:c})}return x}static _getWindowedLineStrings(e,t){let r,c=e,g=e,o=0,s="";const i=[];if(r=t.buffer.active.getLine(e)){const a=r.translateToString(!0);if(r.isWrapped&&a[0]!==" "){for(o=0;(r=t.buffer.active.getLine(--c))&&o<2048&&(s=r.translateToString(!0),o+=s.length,i.push(s),r.isWrapped&&s.indexOf(" ")===-1););i.reverse()}for(i.push(a),o=0;(r=t.buffer.active.getLine(++g))&&r.isWrapped&&o<2048&&(s=r.translateToString(!0),o+=s.length,i.push(s),s.indexOf(" ")===-1););}return[i,c]}static _mapStrIdx(e,t,r,c){const g=e.buffer.active,o=g.getNullCell();let s=r;for(;c;){const i=g.getLine(t);if(!i)return[-1,-1];for(let a=s;a<i.length;++a){i.getCell(a,o);const x=o.getChars();if(o.getWidth()&&(c-=x.length||1,a===i.length-1&&x==="")){const v=g.getLine(t+1);v&&v.isWrapped&&(v.getCell(0,o),o.getWidth()===2&&(c+=1))}if(c<0)return[t,a]}t++,s=0}return[t,s]}}d.LinkComputer=f}},l={};function u(p){var d=l[p];if(d!==void 0)return d.exports;var h=l[p]={exports:{}};return _[p](h,h.exports,u),h.exports}var L={};return(()=>{var p=L;Object.defineProperty(p,"__esModule",{value:!0}),p.WebLinksAddon=void 0;const d=u(6),h=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function f(n,e){const t=window.open();if(t){try{t.opener=null}catch{}t.location.href=e}else console.warn("Opening link blocked as opener could not be cleared")}p.WebLinksAddon=class{constructor(n=f,e={}){this._handler=n,this._options=e}activate(n){this._terminal=n;const e=this._options,t=e.urlRegex||h;this._linkProvider=this._terminal.registerLinkProvider(new d.WebLinkProvider(this._terminal,t,this._handler,e))}dispose(){var n;(n=this._linkProvider)==null||n.dispose()}}})(),L})()))})(w)),w.exports}var C=A();const T=O(C),E=j({__proto__:null,default:T},[C]);export{E as a};
1
+ import{g as O}from"./chunk-JZWAC4HX-BAdwhyCx.js";function j(b,k){for(var _=0;_<k.length;_++){const l=k[_];if(typeof l!="string"&&!Array.isArray(l)){for(const u in l)if(u!=="default"&&!(u in b)){const L=Object.getOwnPropertyDescriptor(l,u);L&&Object.defineProperty(b,u,L.get?L:{enumerable:!0,get:()=>l[u]})}}}return Object.freeze(Object.defineProperty(b,Symbol.toStringTag,{value:"Module"}))}var w={exports:{}},$;function A(){return $||($=1,(function(b,k){(function(_,l){b.exports=l()})(self,(()=>(()=>{var _={6:(p,d)=>{function h(n){try{const e=new URL(n),t=e.password&&e.username?`${e.protocol}//${e.username}:${e.password}@${e.host}`:e.username?`${e.protocol}//${e.username}@${e.host}`:`${e.protocol}//${e.host}`;return n.toLocaleLowerCase().startsWith(t.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(d,"__esModule",{value:!0}),d.LinkComputer=d.WebLinkProvider=void 0,d.WebLinkProvider=class{constructor(n,e,t,r={}){this._terminal=n,this._regex=e,this._handler=t,this._options=r}provideLinks(n,e){const t=f.computeLink(n,this._regex,this._terminal,this._handler);e(this._addCallbacks(t))}_addCallbacks(n){return n.map((e=>(e.leave=this._options.leave,e.hover=(t,r)=>{if(this._options.hover){const{range:c}=e;this._options.hover(t,r,c)}},e)))}};class f{static computeLink(e,t,r,c){const g=new RegExp(t.source,(t.flags||"")+"g"),[o,s]=f._getWindowedLineStrings(e-1,r),i=o.join("");let a;const x=[];for(;a=g.exec(i);){const v=a[0];if(!h(v))continue;const[m,W]=f._mapStrIdx(r,s,0,a.index),[y,P]=f._mapStrIdx(r,m,W,v.length);if(m===-1||W===-1||y===-1||P===-1)continue;const S={start:{x:W+1,y:m+1},end:{x:P,y:y+1}};x.push({range:S,text:v,activate:c})}return x}static _getWindowedLineStrings(e,t){let r,c=e,g=e,o=0,s="";const i=[];if(r=t.buffer.active.getLine(e)){const a=r.translateToString(!0);if(r.isWrapped&&a[0]!==" "){for(o=0;(r=t.buffer.active.getLine(--c))&&o<2048&&(s=r.translateToString(!0),o+=s.length,i.push(s),r.isWrapped&&s.indexOf(" ")===-1););i.reverse()}for(i.push(a),o=0;(r=t.buffer.active.getLine(++g))&&r.isWrapped&&o<2048&&(s=r.translateToString(!0),o+=s.length,i.push(s),s.indexOf(" ")===-1););}return[i,c]}static _mapStrIdx(e,t,r,c){const g=e.buffer.active,o=g.getNullCell();let s=r;for(;c;){const i=g.getLine(t);if(!i)return[-1,-1];for(let a=s;a<i.length;++a){i.getCell(a,o);const x=o.getChars();if(o.getWidth()&&(c-=x.length||1,a===i.length-1&&x==="")){const v=g.getLine(t+1);v&&v.isWrapped&&(v.getCell(0,o),o.getWidth()===2&&(c+=1))}if(c<0)return[t,a]}t++,s=0}return[t,s]}}d.LinkComputer=f}},l={};function u(p){var d=l[p];if(d!==void 0)return d.exports;var h=l[p]={exports:{}};return _[p](h,h.exports,u),h.exports}var L={};return(()=>{var p=L;Object.defineProperty(p,"__esModule",{value:!0}),p.WebLinksAddon=void 0;const d=u(6),h=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function f(n,e){const t=window.open();if(t){try{t.opener=null}catch{}t.location.href=e}else console.warn("Opening link blocked as opener could not be cleared")}p.WebLinksAddon=class{constructor(n=f,e={}){this._handler=n,this._options=e}activate(n){this._terminal=n;const e=this._options,t=e.urlRegex||h;this._linkProvider=this._terminal.registerLinkProvider(new d.WebLinkProvider(this._terminal,t,this._handler,e))}dispose(){var n;(n=this._linkProvider)==null||n.dispose()}}})(),L})()))})(w)),w.exports}var C=A();const T=O(C),E=j({__proto__:null,default:T},[C]);export{E as a};
@@ -1,4 +1,4 @@
1
- import{w as O,u as P,a as I,i as B,r as m,L as D}from"./chunk-JZWAC4HX-BBXArFPl.js";import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{u as U}from"./useReportContext-BermyNU5.js";import{c as w}from"./createLucideIcon-DJB0YQJL.js";import{T as F,C as N}from"./terminal-BgMmG7R9.js";import{S as V}from"./search-C0Uw0bcK.js";import{C as _}from"./chevron-down-BZ2DZxbW.js";import{B as A}from"./book-open-CLaoh4ac.js";import{T as H}from"./triangle-alert-Cs87hJYK.js";import{C as q,a as z}from"./copy-zK0B6Nu-.js";/**
1
+ import{w as O,u as P,a as I,i as B,r as m,L as D}from"./chunk-JZWAC4HX-BAdwhyCx.js";import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{u as U}from"./useReportContext-Cy5Qg_UR.js";import{c as w}from"./createLucideIcon-4ImjHTVC.js";import{T as F,C as N}from"./terminal-CrplD4b1.js";import{S as V}from"./search-BdBb5aqc.js";import{C as _}from"./chevron-down-GmAjGS9-.js";import{B as A}from"./book-open-CL-lMgHh.js";import{T as H}from"./triangle-alert-DqJ0j69l.js";import{C as q,a as z}from"./copy-C6iF61Xs.js";/**
2
2
  * @license lucide-react v0.577.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as o}from"./createLucideIcon-DJB0YQJL.js";/**
1
+ import{c as o}from"./createLucideIcon-4ImjHTVC.js";/**
2
2
  * @license lucide-react v0.577.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as o}from"./createLucideIcon-DJB0YQJL.js";/**
1
+ import{c as o}from"./createLucideIcon-4ImjHTVC.js";/**
2
2
  * @license lucide-react v0.577.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.