shiplightai 0.1.21 → 0.1.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/dist/agentHelpers-ZM2YPYUG.js +3 -0
  2. package/dist/agentLogin-TVTERJCC.js +3 -0
  3. package/dist/chunk-47OHTDHW.js +18 -0
  4. package/dist/chunk-4MP3EHVU.js +11 -0
  5. package/dist/{chunk-32JFHFFG.js → chunk-AEEQXF3N.js} +29 -29
  6. package/dist/chunk-C6BVAOFE.js +3 -0
  7. package/dist/{chunk-RTTIJBGI.js → chunk-CSHDULY4.js} +28 -28
  8. package/dist/chunk-EEEG4LZX.js +3 -0
  9. package/dist/chunk-HJNJZWUA.js +5 -0
  10. package/dist/chunk-ID5JNGPZ.js +18 -0
  11. package/dist/{chunk-YHOTGR6H.js → chunk-J4TZ3OFZ.js} +1 -1
  12. package/dist/chunk-JQ2K2XJ4.js +61 -0
  13. package/dist/chunk-L5JSAS2D.js +3 -0
  14. package/dist/{chunk-YDR4P3GA.js → chunk-NLZ3YJX4.js} +1 -1
  15. package/dist/{chunk-JHSENQ4F.js → chunk-SFCNGCFT.js} +27 -27
  16. package/dist/{chunk-2F3YRAA7.js → chunk-VLVDPV2E.js} +13 -13
  17. package/dist/cjs/debugger-pw.cjs +7 -7
  18. package/dist/cjs/fixture.cjs +162 -147
  19. package/dist/cjs/index.cjs +229 -309
  20. package/dist/cjs/reporter.cjs +725 -0
  21. package/dist/cli.js +2107 -939
  22. package/dist/config-BUSI76YU.js +3 -0
  23. package/dist/debugger-pw.d.ts +5 -0
  24. package/dist/debugger-pw.js +1 -1
  25. package/dist/dist-3HGFS7M3-T7FMZHX4.js +3 -0
  26. package/dist/dist-K7NWI5BS.js +3 -0
  27. package/dist/dist-SIZHXBHX.js +3 -0
  28. package/dist/fixture.js +1 -1
  29. package/dist/handler-J6CCKSPE.js +3 -0
  30. package/dist/index.d.ts +1 -48
  31. package/dist/index.js +4 -11
  32. package/dist/{intRunner-5A6M6JSJ.js → intRunner-ZYEEZ6MK.js} +1 -1
  33. package/dist/reporter.d.ts +28 -0
  34. package/dist/reporter.js +723 -0
  35. package/dist/task-EDC5BGTS.js +192 -0
  36. package/dist/testFlow-HYGLHAP6.js +3 -0
  37. package/package.json +8 -1
  38. package/dist/agentHelpers-2TII7YCW.js +0 -3
  39. package/dist/agentLogin-GDOU6BCP.js +0 -3
  40. package/dist/chunk-DJDHFWEV.js +0 -3
  41. package/dist/chunk-JNRJXAJS.js +0 -18
  42. package/dist/chunk-LPSNOKYP.js +0 -61
  43. package/dist/chunk-THVHM4KG.js +0 -11
  44. package/dist/chunk-USRSZQWN.js +0 -5
  45. package/dist/dist-CXOVVE77.js +0 -3
  46. package/dist/dist-SRXGJZ7P.js +0 -3
  47. package/dist/handler-BAP4TGW6.js +0 -3
  48. package/dist/task-VW6MUEKX.js +0 -192
  49. package/dist/testFlow-ZLC5L5GT.js +0 -3
@@ -1,11 +1,11 @@
1
- "use strict";var Ze=Object.create;var W=Object.defineProperty;var Qe=Object.getOwnPropertyDescriptor;var et=Object.getOwnPropertyNames;var tt=Object.getPrototypeOf,it=Object.prototype.hasOwnProperty;var f=(e,t)=>()=>(e&&(t=e(e=0)),t);var F=(e,t)=>{for(var i in t)W(e,i,{get:t[i],enumerable:!0})},Z=(e,t,i,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of et(t))!it.call(e,o)&&o!==i&&W(e,o,{get:()=>t[o],enumerable:!(r=Qe(t,o))||r.enumerable});return e};var v=(e,t,i)=>(i=e!=null?Ze(tt(e)):{},Z(t||!e||!e.__esModule?W(i,"default",{value:e,enumerable:!0}):i,e)),rt=e=>Z(W({},"__esModule",{value:!0}),e);var ie=f(()=>{"use strict"});var re=f(()=>{"use strict"});var oe=f(()=>{"use strict"});var H=f(()=>{"use strict"});var ne=f(()=>{"use strict";H()});var se,nt,ae,ce,L,st,at,le=f(()=>{"use strict";se=112,nt=1080-se,ae={"Blackberry PlayBook":{name:"Blackberry PlayBook",userAgent:"Mozilla/5.0 (PlayBook; U; RIM Tablet OS 2.1.0; en-US) AppleWebKit/536.2+ (KHTML like Gecko) Version/26.0 Safari/536.2+",screen:{width:600,height:1024},viewport:{width:600,height:1024},deviceScaleFactor:1,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"BlackBerry Z30":{name:"BlackBerry Z30",userAgent:"Mozilla/5.0 (BB10; Touch) AppleWebKit/537.10+ (KHTML, like Gecko) Version/26.0 Mobile Safari/537.10+",screen:{width:360,height:640},viewport:{width:360,height:640},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"Galaxy Note 3":{name:"Galaxy Note 3",userAgent:"Mozilla/5.0 (Linux; U; Android 4.3; en-us; SM-N900T Build/JSS15J) AppleWebKit/534.30 (KHTML, like Gecko) Version/26.0 Mobile Safari/534.30",screen:{width:360,height:640},viewport:{width:360,height:640},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"Galaxy Note II":{name:"Galaxy Note II",userAgent:"Mozilla/5.0 (Linux; U; Android 4.1; en-us; GT-N7100 Build/JRO03C) AppleWebKit/534.30 (KHTML, like Gecko) Version/26.0 Mobile Safari/534.30",screen:{width:360,height:640},viewport:{width:360,height:640},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"Galaxy S III":{name:"Galaxy S III",userAgent:"Mozilla/5.0 (Linux; U; Android 4.0; en-us; GT-I9300 Build/IMM76D) AppleWebKit/534.30 (KHTML, like Gecko) Version/26.0 Mobile Safari/534.30",screen:{width:360,height:640},viewport:{width:360,height:640},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"Galaxy S5":{name:"Galaxy S5",userAgent:"Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/LRX21T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:360,height:640},viewport:{width:360,height:640},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Galaxy S8":{name:"Galaxy S8",userAgent:"Mozilla/5.0 (Linux; Android 7.0; SM-G950U Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:360,height:740},viewport:{width:360,height:740},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Galaxy S9+":{name:"Galaxy S9+",userAgent:"Mozilla/5.0 (Linux; Android 8.0.0; SM-G965U Build/R16NW) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:320,height:658},viewport:{width:320,height:658},deviceScaleFactor:4.5,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Galaxy S24":{name:"Galaxy S24",userAgent:"Mozilla/5.0 (Linux; Android 14; SM-S921U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:360,height:780},viewport:{width:360,height:780},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Galaxy A55":{name:"Galaxy A55",userAgent:"Mozilla/5.0 (Linux; Android 14; SM-A556B) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:480,height:1040},viewport:{width:480,height:1040},deviceScaleFactor:2.25,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Galaxy Tab S4":{name:"Galaxy Tab S4",userAgent:"Mozilla/5.0 (Linux; Android 8.1.0; SM-T837A) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36",screen:{width:712,height:1138},viewport:{width:712,height:1138},deviceScaleFactor:2.25,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Galaxy Tab S9":{name:"Galaxy Tab S9",userAgent:"Mozilla/5.0 (Linux; Android 14; SM-X710) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36",screen:{width:640,height:1024},viewport:{width:640,height:1024},deviceScaleFactor:2.5,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"iPad (gen 5)":{name:"iPad (gen 5)",userAgent:"Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:768,height:1024},viewport:{width:768,height:1024},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPad (gen 6)":{name:"iPad (gen 6)",userAgent:"Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:768,height:1024},viewport:{width:768,height:1024},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPad (gen 7)":{name:"iPad (gen 7)",userAgent:"Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:810,height:1080},viewport:{width:810,height:1080},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPad (gen 11)":{name:"iPad (gen 11)",userAgent:"Mozilla/5.0 (iPad; CPU OS 18_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/19E241 Safari/604.1",screen:{width:656,height:944},viewport:{width:656,height:944},deviceScaleFactor:2.5,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPad Mini":{name:"iPad Mini",userAgent:"Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:768,height:1024},viewport:{width:768,height:1024},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPad Pro 11":{name:"iPad Pro 11",userAgent:"Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:834,height:1194},viewport:{width:834,height:1194},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 6":{name:"iPhone 6",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.0 Mobile/15A372 Safari/604.1",screen:{width:375,height:667},viewport:{width:375,height:667},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 6 Plus":{name:"iPhone 6 Plus",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.0 Mobile/15A372 Safari/604.1",screen:{width:414,height:736},viewport:{width:414,height:736},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 7":{name:"iPhone 7",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.0 Mobile/15A372 Safari/604.1",screen:{width:375,height:667},viewport:{width:375,height:667},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 7 Plus":{name:"iPhone 7 Plus",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.0 Mobile/15A372 Safari/604.1",screen:{width:414,height:736},viewport:{width:414,height:736},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 8":{name:"iPhone 8",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.0 Mobile/15A372 Safari/604.1",screen:{width:375,height:667},viewport:{width:375,height:667},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 8 Plus":{name:"iPhone 8 Plus",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.0 Mobile/15A372 Safari/604.1",screen:{width:414,height:736},viewport:{width:414,height:736},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone SE":{name:"iPhone SE",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/26.0 Mobile/14E304 Safari/602.1",screen:{width:320,height:568},viewport:{width:320,height:568},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone SE (3rd gen)":{name:"iPhone SE (3rd gen)",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 18_5 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/26.0 Mobile/19E241 Safari/602.1",screen:{width:375,height:667},viewport:{width:375,height:667},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone X":{name:"iPhone X",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.0 Mobile/15A372 Safari/604.1",screen:{width:375,height:812},viewport:{width:375,height:812},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone XR":{name:"iPhone XR",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 12_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:414,height:896},viewport:{width:414,height:896},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 11":{name:"iPhone 11",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:414,height:896},viewport:{width:414,height:715},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 11 Pro":{name:"iPhone 11 Pro",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:375,height:812},viewport:{width:375,height:635},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 11 Pro Max":{name:"iPhone 11 Pro Max",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:414,height:896},viewport:{width:414,height:715},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 12":{name:"iPhone 12",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:390,height:844},viewport:{width:390,height:664},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 12 Pro":{name:"iPhone 12 Pro",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:390,height:844},viewport:{width:390,height:664},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 12 Pro Max":{name:"iPhone 12 Pro Max",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:428,height:926},viewport:{width:428,height:746},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 12 Mini":{name:"iPhone 12 Mini",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:375,height:812},viewport:{width:375,height:629},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 13":{name:"iPhone 13",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:390,height:844},viewport:{width:390,height:664},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 13 Pro":{name:"iPhone 13 Pro",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:390,height:844},viewport:{width:390,height:664},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 13 Pro Max":{name:"iPhone 13 Pro Max",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:428,height:926},viewport:{width:428,height:746},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 13 Mini":{name:"iPhone 13 Mini",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:375,height:812},viewport:{width:375,height:629},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 14":{name:"iPhone 14",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:390,height:844},viewport:{width:390,height:664},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 14 Plus":{name:"iPhone 14 Plus",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:428,height:926},viewport:{width:428,height:746},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 14 Pro":{name:"iPhone 14 Pro",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:393,height:852},viewport:{width:393,height:660},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 14 Pro Max":{name:"iPhone 14 Pro Max",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:430,height:932},viewport:{width:430,height:740},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 15":{name:"iPhone 15",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:393,height:852},viewport:{width:393,height:659},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 15 Plus":{name:"iPhone 15 Plus",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:430,height:932},viewport:{width:430,height:739},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 15 Pro":{name:"iPhone 15 Pro",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:393,height:852},viewport:{width:393,height:659},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 15 Pro Max":{name:"iPhone 15 Pro Max",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:430,height:932},viewport:{width:430,height:739},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"Kindle Fire HDX":{name:"Kindle Fire HDX",userAgent:"Mozilla/5.0 (Linux; U; en-us; KFAPWI Build/JDQ39) AppleWebKit/535.19 (KHTML, like Gecko) Silk/3.13 Safari/535.19 Silk-Accelerated=true",screen:{width:800,height:1280},viewport:{width:800,height:1280},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"LG Optimus L70":{name:"LG Optimus L70",userAgent:"Mozilla/5.0 (Linux; U; Android 4.4.2; en-us; LGMS323 Build/KOT49I.MS32310c) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:384,height:640},viewport:{width:384,height:640},deviceScaleFactor:1.25,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Microsoft Lumia 550":{name:"Microsoft Lumia 550",userAgent:"Mozilla/5.0 (Windows Phone 10.0; Android 4.2.1; Microsoft; Lumia 550) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36 Edge/14.14263",screen:{width:360,height:640},viewport:{width:360,height:640},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Microsoft Lumia 950":{name:"Microsoft Lumia 950",userAgent:"Mozilla/5.0 (Windows Phone 10.0; Android 4.2.1; Microsoft; Lumia 950) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36 Edge/14.14263",screen:{width:360,height:640},viewport:{width:360,height:640},deviceScaleFactor:4,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Nexus 10":{name:"Nexus 10",userAgent:"Mozilla/5.0 (Linux; Android 6.0.1; Nexus 10 Build/MOB31T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36",screen:{width:800,height:1280},viewport:{width:800,height:1280},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Nexus 4":{name:"Nexus 4",userAgent:"Mozilla/5.0 (Linux; Android 4.4.2; Nexus 4 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:384,height:640},viewport:{width:384,height:640},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Nexus 5":{name:"Nexus 5",userAgent:"Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:360,height:640},viewport:{width:360,height:640},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Nexus 5X":{name:"Nexus 5X",userAgent:"Mozilla/5.0 (Linux; Android 8.0.0; Nexus 5X Build/OPR4.170623.006) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:412,height:732},viewport:{width:412,height:732},deviceScaleFactor:2.625,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Nexus 6":{name:"Nexus 6",userAgent:"Mozilla/5.0 (Linux; Android 7.1.1; Nexus 6 Build/N6F26U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:412,height:732},viewport:{width:412,height:732},deviceScaleFactor:3.5,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Nexus 6P":{name:"Nexus 6P",userAgent:"Mozilla/5.0 (Linux; Android 8.0.0; Nexus 6P Build/OPP3.170518.006) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:412,height:732},viewport:{width:412,height:732},deviceScaleFactor:3.5,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Nexus 7":{name:"Nexus 7",userAgent:"Mozilla/5.0 (Linux; Android 6.0.1; Nexus 7 Build/MOB30X) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36",screen:{width:600,height:960},viewport:{width:600,height:960},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Nokia Lumia 520":{name:"Nokia Lumia 520",userAgent:"Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; ARM; Touch; NOKIA; Lumia 520)",screen:{width:320,height:533},viewport:{width:320,height:533},deviceScaleFactor:1.5,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Nokia N9":{name:"Nokia N9",userAgent:"Mozilla/5.0 (MeeGo; NokiaN9) AppleWebKit/534.13 (KHTML, like Gecko) NokiaBrowser/8.5.0 Mobile Safari/534.13",screen:{width:480,height:854},viewport:{width:480,height:854},deviceScaleFactor:1,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"Pixel 2":{name:"Pixel 2",userAgent:"Mozilla/5.0 (Linux; Android 8.0; Pixel 2 Build/OPD3.170816.012) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:411,height:731},viewport:{width:411,height:731},deviceScaleFactor:2.625,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Pixel 2 XL":{name:"Pixel 2 XL",userAgent:"Mozilla/5.0 (Linux; Android 8.0.0; Pixel 2 XL Build/OPD1.170816.004) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:411,height:823},viewport:{width:411,height:823},deviceScaleFactor:3.5,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Pixel 3":{name:"Pixel 3",userAgent:"Mozilla/5.0 (Linux; Android 9; Pixel 3 Build/PQ1A.181105.017.A1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:393,height:786},viewport:{width:393,height:786},deviceScaleFactor:2.75,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Pixel 4":{name:"Pixel 4",userAgent:"Mozilla/5.0 (Linux; Android 10; Pixel 4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:353,height:745},viewport:{width:353,height:745},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Pixel 4a (5G)":{name:"Pixel 4a (5G)",userAgent:"Mozilla/5.0 (Linux; Android 11; Pixel 4a (5G)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:412,height:892},viewport:{width:412,height:765},deviceScaleFactor:2.63,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Pixel 5":{name:"Pixel 5",userAgent:"Mozilla/5.0 (Linux; Android 11; Pixel 5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:393,height:851},viewport:{width:393,height:727},deviceScaleFactor:2.75,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Pixel 7":{name:"Pixel 7",userAgent:"Mozilla/5.0 (Linux; Android 14; Pixel 7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:412,height:915},viewport:{width:412,height:839},deviceScaleFactor:2.625,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Moto G4":{name:"Moto G4",userAgent:"Mozilla/5.0 (Linux; Android 7.0; Moto G (4)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:360,height:640},viewport:{width:360,height:640},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Desktop Chrome HiDPI":{name:"Desktop Chrome HiDPI",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36",screen:{width:1792,height:1120},viewport:{width:1280,height:720},deviceScaleFactor:2,isMobile:!1,hasTouch:!1,defaultBrowserType:"chromium"},"Desktop Edge HiDPI":{name:"Desktop Edge HiDPI",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36 Edg/141.0.7390.16",screen:{width:1792,height:1120},viewport:{width:1280,height:720},deviceScaleFactor:2,isMobile:!1,hasTouch:!1,defaultBrowserType:"chromium"},"Desktop Firefox HiDPI":{name:"Desktop Firefox HiDPI",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:142.0.1) Gecko/20100101 Firefox/142.0.1",screen:{width:1792,height:1120},viewport:{width:1280,height:720},deviceScaleFactor:2,isMobile:!1,hasTouch:!1,defaultBrowserType:"firefox"},"Desktop Safari":{name:"Desktop Safari",userAgent:"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Safari/605.1.15",screen:{width:1792,height:1120},viewport:{width:1280,height:720},deviceScaleFactor:2,isMobile:!1,hasTouch:!1,defaultBrowserType:"webkit"},"Desktop Chrome":{name:"Desktop Chrome",displayName:"Playwright Chromium",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36",screen:{width:1920,height:1080},viewport:{width:1920,height:1080},deviceScaleFactor:1,isMobile:!1,hasTouch:!1,defaultBrowserType:"chromium"},"Desktop Chrome Medium Resolution":{name:"Desktop Chrome Medium Resolution",displayName:"Playwright Chromium",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36",screen:{width:1280,height:720},viewport:{width:1280,height:720},deviceScaleFactor:1,isMobile:!1,hasTouch:!1,defaultBrowserType:"chromium"},"Desktop Chrome (Branded)":{name:"Desktop Chrome (Branded)",displayName:"Google Chrome",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36",screen:{width:1920,height:1080},viewport:{width:1920,height:1080},deviceScaleFactor:1,isMobile:!1,hasTouch:!1,defaultBrowserType:"chromium",channel:"chrome"},"Desktop Chrome Medium Resolution (Branded)":{name:"Desktop Chrome Medium Resolution (Branded)",displayName:"Google Chrome",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36",screen:{width:1280,height:720},viewport:{width:1280,height:720},deviceScaleFactor:1,isMobile:!1,hasTouch:!1,defaultBrowserType:"chromium",channel:"chrome"},"Desktop Edge":{name:"Desktop Edge",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36 Edg/141.0.7390.16",screen:{width:1920,height:1080},viewport:{width:1280,height:720},deviceScaleFactor:1,isMobile:!1,hasTouch:!1,defaultBrowserType:"chromium"},"Desktop Edge (Branded)":{name:"Desktop Edge (Branded)",displayName:"Microsoft Edge",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36 Edg/141.0.7390.16",screen:{width:1920,height:1080},viewport:{width:1920,height:1080},deviceScaleFactor:1,isMobile:!1,hasTouch:!1,defaultBrowserType:"chromium",channel:"msedge"},"Desktop Edge Medium Resolution (Branded)":{name:"Desktop Edge Medium Resolution (Branded)",displayName:"Microsoft Edge",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36 Edg/141.0.7390.16",screen:{width:1280,height:720},viewport:{width:1280,height:720},deviceScaleFactor:1,isMobile:!1,hasTouch:!1,defaultBrowserType:"chromium",channel:"msedge"},"Desktop Firefox":{name:"Desktop Firefox",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:142.0.1) Gecko/20100101 Firefox/142.0.1",screen:{width:1920,height:1080},viewport:{width:1280,height:720},deviceScaleFactor:1,isMobile:!1,hasTouch:!1,defaultBrowserType:"firefox"}},ce={desktop:["Desktop Chrome","Desktop Chrome Medium Resolution","Desktop Chrome (Branded)","Desktop Chrome Medium Resolution (Branded)","Desktop Edge (Branded)","Desktop Edge Medium Resolution (Branded)","Desktop Safari"],mobile:["iPhone 15 Pro Max","iPhone 15 Pro","iPhone 15 Plus","iPhone 15","iPhone 14 Pro Max","iPhone 14 Pro","iPhone 14 Plus","iPhone 14","iPhone 13 Pro Max","iPhone 13 Pro","iPhone 13","iPhone 13 Mini","iPhone 12 Pro Max","iPhone 12 Pro","iPhone 12","iPhone 12 Mini","iPhone 11 Pro Max","iPhone 11 Pro","iPhone 11","iPhone XR","iPhone X","iPhone SE (3rd gen)","iPhone SE","iPhone 8 Plus","iPhone 8","iPhone 7 Plus","iPhone 7","iPhone 6 Plus","iPhone 6","Galaxy S24","Galaxy A55","Galaxy S9+","Galaxy S8","Galaxy S5","Galaxy Note 3","Galaxy Note II","Galaxy S III","Pixel 7","Pixel 5","Pixel 4a (5G)","Pixel 4","Pixel 3","Pixel 2 XL","Pixel 2","Nexus 6P","Nexus 6","Nexus 5X","Nexus 5","Nexus 4","Moto G4","LG Optimus L70","Microsoft Lumia 950","Microsoft Lumia 550","Nokia Lumia 520","Nokia N9","BlackBerry Z30"]},L=(e,t=!1)=>{let i=["chromium"];return t&&i.push("webkit"),ce[e].map(r=>ae[r]).filter(r=>r.defaultBrowserType&&i.includes(r.defaultBrowserType))},st={desktop:{label:"Desktop",type:"desktop",devices:L("desktop")},mobile:{label:"Mobile Web",type:"mobile",devices:L("mobile")}},at={desktop:{label:"Desktop",type:"desktop",devices:L("desktop",!0)},mobile:{label:"Mobile Web",type:"mobile",devices:L("mobile",!0)}}});var ue=f(()=>{"use strict"});var c,he,U,de,P,pe,fe,ge,A,V,z=f(()=>{"use strict";c=require("zod"),he=c.z.enum(["JS_CODE","AI_MODE"]),U=c.z.object({type:he,expression:c.z.string()}),de=c.z.enum(["DRAFT","STEP","ACTION","IF_ELSE","WHILE_LOOP"]),P=c.z.object({uid:c.z.string(),type:de}),pe=c.z.object({action_data:c.z.object({action_name:c.z.string(),kwargs:c.z.record(c.z.any()).optional(),args:c.z.array(c.z.any()).optional()}),action_description:c.z.string().optional(),url:c.z.string().optional(),xpath:c.z.string().nullable().optional(),locator:c.z.string().nullable().optional(),css_selector:c.z.string().nullable().optional(),unique_selector:c.z.string().nullable().optional(),element_index:c.z.number().nullable().optional(),frame_path:c.z.array(c.z.any()).optional(),artifacts:c.z.record(c.z.any()).optional(),feedback:c.z.string().optional(),original_browser_use_action:c.z.any().optional()}).passthrough(),fe=P.extend({type:c.z.literal("DRAFT"),description:c.z.string()}),ge=P.extend({type:c.z.literal("ACTION"),description:c.z.string(),action_entity:pe.optional(),locator:c.z.string().optional(),use_pure_vision:c.z.boolean().optional()}),A=c.z.lazy(()=>c.z.union([fe,ge,P.extend({type:c.z.literal("STEP"),description:c.z.string().optional().default(""),statements:c.z.array(A),reference_id:c.z.number().optional()}),P.extend({type:c.z.literal("IF_ELSE"),description:c.z.string().optional(),condition:U,then:c.z.array(A),else:c.z.array(A).optional()}),P.extend({type:c.z.literal("WHILE_LOOP"),description:c.z.string().optional(),condition:U,body:c.z.array(A),timeout_ms:c.z.number().optional()})])),V=c.z.object({version:c.z.string().optional(),goal:c.z.string(),url:c.z.string().optional(),final_feedback:c.z.string().optional(),completed:c.z.boolean().optional(),success:c.z.boolean().optional(),statements:c.z.array(A),teardown:c.z.array(A).optional(),last_modified_at:c.z.string().optional()})});function ye(e,t){let i={...t?.test_case_id!==void 0?{test_case_id:t.test_case_id}:{},...t?.name?{name:t.name}:{},goal:e.goal,url:e.url,statements:e.statements.map(E)};return e.final_feedback&&(i.final_feedback=e.final_feedback),e.teardown&&e.teardown.length>0&&(i.teardown=e.teardown.map(E)),i}function K(e,t){return(0,$.stringify)(ye(e,t),ct)}function E(e){switch(e.type){case"DRAFT":return lt(e);case"ACTION":return ut(e);case"STEP":return ht(e);case"IF_ELSE":return dt(e);case"WHILE_LOOP":return pt(e)}}function lt(e){return{desc:e.description}}function ut(e){let t=e.action_entity?.action_data?.action_name??e.action_entity?.action?.action_name,i=e.action_entity?.action_data?.kwargs??e.action_entity?.action?.kwargs;if(t==="verify"){let a=i?.statement;if(typeof a=="string"&&!e.action_entity?.locator&&!e.action_entity?.xpath){let l=i?.code;return typeof l=="string"?{VERIFY:a,js:l}:{VERIFY:a}}}if(t==="go_to_url"){let a=i?.url;if(typeof a=="string"&&!e.action_entity?.locator&&!e.action_entity?.xpath){let l={URL:a};return i?.new_tab===!0&&(l.new_tab=!0),typeof i?.timeout_seconds=="number"&&(l.timeout_seconds=i.timeout_seconds),l}}if(t==="js_action"){let a=i?.code;if(typeof a=="string"&&e.description)return{desc:e.description,js:a}}if(t==="js_code"){let a=i?.code;if(typeof a=="string"&&!e.action_entity?.locator&&!e.action_entity?.xpath)return{CODE:a}}if(!e.action_entity)return{desc:e.description};let r=e.action_entity.action_data??e.action_entity.action;if(!r)return{desc:e.description};let o={desc:e.description,action:r.action_name},n=e.locator??e.action_entity.locator;n&&(o.locator=n);let s=e.action_entity.xpath;if(s&&(o.xpath=s),e.use_pure_vision&&(o.use_pure_vision=!0),r.kwargs&&Object.keys(r.kwargs).length>0)for(let[a,l]of Object.entries(r.kwargs))o[a]=l;return r.args&&r.args.length>0&&(o.args=r.args),o}function ht(e){let t={STEP:e.description,statements:e.statements.map(E)};return e.reference_id!==void 0&&(t.reference_id=e.reference_id),t}function dt(e){let t={IF:_e(e.condition),THEN:e.then.map(E)};return e.else&&e.else.length>0&&(t.ELSE=e.else.map(E)),t}function pt(e){let t={WHILE:_e(e.condition),DO:e.body.map(E)};return e.timeout_ms!==void 0&&(t.timeout_ms=e.timeout_ms),t}function _e(e){return e.type==="JS_CODE"?`js:${e.expression}`:e.expression}function J(e){try{let t=(0,$.parse)(e);if(!t||typeof t!="object")return{};let i={};return typeof t.test_case_id=="number"&&Number.isFinite(t.test_case_id)&&(i.test_case_id=t.test_case_id),typeof t.template_id=="number"&&Number.isFinite(t.template_id)&&(i.template_id=t.template_id),typeof t.name=="string"&&t.name.trim()&&(i.name=t.name.trim()),i}catch{return{}}}function S(e){if(e.length>me)throw new Error(`YAML input too large (${e.length} bytes, max ${me})`);let t=(0,$.parse)(e);if(!t||typeof t!="object")throw new Error("Invalid YAML: expected an object at root level");let i={version:"1.3.0",goal:t.goal,url:t.url,statements:x(t.statements??[])};t.final_feedback&&(i.final_feedback=t.final_feedback),t.teardown&&Array.isArray(t.teardown)&&(i.teardown=x(t.teardown));let r=V.safeParse(i);if(!r.success)throw new Error(`Invalid TestFlow after YAML conversion: ${JSON.stringify(r.error.errors)}`);return r.data}function x(e){if(!Array.isArray(e))throw new Error("Expected an array of statements");return e.map(ft)}function ft(e){if(typeof e=="string")throw new Error(`Plain string statements are not supported. Use "desc: ${e}" instead.`);if(typeof e!="object"||e===null)throw new Error(`Invalid statement: expected object, got ${typeof e}`);let t=e;if("IF"in t)return gt(t);if("WHILE"in t)return mt(t);if("STEP"in t)return wt(t);if("VERIFY"in t){let i=t.VERIFY,r={statement:typeof i=="string"?i:String(i)};return typeof t.js=="string"&&(r.code=t.js),{uid:(0,_.v4)(),type:"ACTION",description:`Verify: ${i}`,action_entity:{action_description:`Verify: ${i}`,action_data:{action_name:"verify",kwargs:r}}}}if("URL"in t){let i=t.URL,r=t.new_tab===!0?!0:void 0,o=typeof t.timeout_seconds=="number"?t.timeout_seconds:void 0,n={url:typeof i=="string"?i:String(i)};return r&&(n.new_tab=!0),o!==void 0&&(n.timeout_seconds=o),{uid:(0,_.v4)(),type:"ACTION",description:`Navigate to ${i}`,action_entity:{action_description:`Navigate to ${i}`,action_data:{action_name:"go_to_url",kwargs:n}}}}if("CODE"in t){let i=t.CODE;return{uid:(0,_.v4)(),type:"ACTION",description:"Code block",action_entity:{action_description:"Code block",action_data:{action_name:"js_code",kwargs:{code:typeof i=="string"?i:String(i)}}}}}if("js"in t&&"desc"in t&&!("VERIFY"in t)){let i=t.js,r=typeof t.desc=="string"?t.desc:"";return{uid:(0,_.v4)(),type:"ACTION",description:r,action_entity:{action_description:r,action_data:{action_name:"js_action",kwargs:{code:typeof i=="string"?i:String(i)}}}}}if("call"in t&&typeof t.call=="string"){let{call:i,...r}=t;return we({...r,action:"function",functionName:i})}if("action"in t)return we(t);if("desc"in t&&typeof t.desc=="string")return{uid:(0,_.v4)(),type:"DRAFT",description:t.desc};throw new Error(`Cannot infer statement type from object: ${JSON.stringify(t)}`)}function Se(e){if(typeof e!="string")throw new Error(`Condition must be a string, got ${typeof e}`);return e.startsWith("js:")?{type:"JS_CODE",expression:e.slice(3)}:{type:"AI_MODE",expression:e}}function gt(e){let t=Se(e.IF),i=e.THEN;if(!Array.isArray(i))throw new Error("IF_ELSE requires a THEN array");let r={uid:(0,_.v4)(),type:"IF_ELSE",condition:t,then:x(i)};return"ELSE"in e&&Array.isArray(e.ELSE)&&(r.else=x(e.ELSE)),r}function mt(e){let t=Se(e.WHILE),i=e.DO;if(!Array.isArray(i))throw new Error("WHILE_LOOP requires a DO array");let r={uid:(0,_.v4)(),type:"WHILE_LOOP",condition:t,body:x(i)};return typeof e.timeout_ms=="number"&&(r.timeout_ms=e.timeout_ms),r}function wt(e){let t=typeof e.STEP=="string"?e.STEP:"";if(!Array.isArray(e.statements))throw new Error("STEP requires a statements array");let i={uid:(0,_.v4)(),type:"STEP",description:t,statements:x(e.statements)};return typeof e.reference_id=="number"&&(i.reference_id=e.reference_id),i}function we(e){let t=typeof e.action=="string"?e.action:String(e.action),i=typeof e.desc=="string"?e.desc:"",r=typeof e.locator=="string"?e.locator:void 0,o=typeof e.xpath=="string"?e.xpath:void 0,n=typeof e.use_pure_vision=="boolean"?e.use_pure_vision:void 0,s={};for(let[d,p]of Object.entries(e))yt.has(d)||(s[d]=p);let a={action_description:i,action_data:{action_name:t,kwargs:Object.keys(s).length>0?s:{}}};r&&(a.locator=r),o&&(a.xpath=o);let l={uid:(0,_.v4)(),type:"ACTION",description:i,action_entity:a};return n&&(l.use_pure_vision=!0),l}var $,_,ct,me,yt,G=f(()=>{"use strict";z();$=require("yaml"),_=require("uuid");ct={lineWidth:120,defaultKeyType:"PLAIN",defaultStringType:"PLAIN"};me=1024*1024;yt=new Set(["action","desc","locator","xpath","use_pure_vision"])});var be,Te=f(()=>{"use strict";G();be=require("yaml")});var B=f(()=>{"use strict"});var Ae=f(()=>{"use strict";G();B()});var ke=f(()=>{"use strict";B()});var ve=f(()=>{"use strict"});var Me=f(()=>{"use strict"});var Pe=f(()=>{"use strict"});var Ee=f(()=>{"use strict"});var xe=f(()=>{"use strict";H()});var O=f(()=>{"use strict";ie();re();oe();ne();le();ue();Te();Ae();G();z();ke();B();ve();Me();Pe();Ee();xe();H()});function vt(e){let t=e.frame_path;return!t||t.length===0?"page":`page.frameLocator('${t[0]}')`}function Mt(e){let t=e.xpath;return typeof t=="string"&&t.trim()?!t.startsWith("xpath=")&&!t.startsWith("/")&&!t.startsWith("//")?`xpath=//${t}`:t.startsWith("xpath=")?t:`xpath=${t}`:null}function Le(e){let t=vt(e),i=e.locator;if(typeof i=="string"&&i.trim())return i=i.trim(),i.endsWith("first()")?`${t}.${i}`:`${t}.${i}.first()`;let r=Mt(e);if(r){let o=JSON.stringify(r);return`${t}.locator(${o}).first()`}return null}function u(e,t){w.set(e,t)}function k(e,t,i=[]){let r=[...i];return t.locator?r.push(`locator: ${JSON.stringify(t.locator)}`):t.xpath&&r.push(`xpath: ${JSON.stringify(t.xpath)}`),t.frame_path&&t.frame_path.length>0&&r.push(`frame_path: ${JSON.stringify(t.frame_path)}`),r.length===0?[`await agent.execAction("${e}", page, {});`]:[`await agent.execAction("${e}", page, {`,...r.map(o=>` ${o},`),"});"]}function $e(e){let t=e.functionName;if(!t)return null;let i=Array.isArray(e.args)?e.args.map(String):[];if(i.length===0)return`await ${t}()`;let r=["page","testContext","request","agentServices"],o=["undefined","null","true","false"],n=i.map(s=>r.includes(s)||o.includes(s)||/^-?\d+(\.\d+)?$/.test(s)?s:s.startsWith("$")?`agent.agentServices.readVariable('${s.substring(1)}')`:`"${s}"`);return`await ${t}(${n.join(", ")})`}function Ne(e,t){let i={expandingPaths:new Set([(0,D.resolve)(t)]),depth:0,referencedPaths:new Set},r={...e};Array.isArray(r.statements)&&(r.statements=T(r.statements,t,i)),Array.isArray(r.teardown)&&(r.teardown=T(r.teardown,t,i));for(let o of["beforeAll","afterAll","beforeEach","afterEach"])Array.isArray(r[o])&&(r[o]=T(r[o],t,i));return{doc:r,referencedTemplatePaths:Array.from(i.referencedPaths)}}function T(e,t,i){let r=[];for(let o of e)if(Pt(o)){let n=Et(o,t,i);r.push(...n)}else r.push(xt(o,t,i));return r}function Pt(e){return typeof e=="object"&&e!==null&&typeof e.template=="string"}function Et(e,t,i){if(i.depth>=Oe)throw new Error(`Template expansion exceeded maximum depth of ${Oe}. Check for deeply nested or circular template references.`);let r=(0,D.resolve)((0,D.dirname)(t),e.template);if(i.expandingPaths.has(r))throw new Error(`Circular template reference detected: ${r} is already being expanded. Stack: ${Array.from(i.expandingPaths).join(" \u2192 ")} \u2192 ${r}`);i.referencedPaths.add(r);let o;try{o=(0,Ce.readFileSync)(r,"utf-8")}catch(p){throw new Error(`Failed to read template file: ${r} (referenced from ${t}): ${p.message}`)}let n=(0,C.parse)(o);if(!n||typeof n!="object")throw new Error(`Invalid template file: ${r} \u2014 expected a YAML object`);let s=n.params||[],a=e.params||{};for(let p of s)if(!(p in a))throw new Error(`Template ${e.template} requires param "${p}" but it was not provided. Required params: [${s.join(", ")}]`);let l=n.statements;if(!Array.isArray(l))throw new Error(`Template ${e.template} must have a "statements" array`);if(Object.keys(a).length>0){let g=(0,C.stringify)(l);for(let[y,h]of Object.entries(a))g=g.split(`<<${y}>>`).join(String(h));l=(0,C.parse)(g)}let d={expandingPaths:new Set([...i.expandingPaths,r]),depth:i.depth+1,referencedPaths:i.referencedPaths};return T(l,r,d)}function xt(e,t,i){if(typeof e!="object"||e===null)return e;let r={...e};return Array.isArray(r.statements)&&(r.statements=T(r.statements,t,i)),Array.isArray(r.THEN)&&(r.THEN=T(r.THEN,t,i)),Array.isArray(r.ELSE)&&(r.ELSE=T(r.ELSE,t,i)),Array.isArray(r.DO)&&(r.DO=T(r.DO,t,i)),r}function De(e,t){let i=(0,N.parse)(e),r=i?.name,o=i?.tags,n=i?.use;if(i&&(i.name!==void 0||i.tags!==void 0||i.use!==void 0)&&(delete i.name,delete i.tags,delete i.use),i?.suite){if(i.goal||i.statements)throw new Error('YAML file cannot have both "suite" and top-level "goal"/"statements". Use either suite format or single-test format.');return Ot(i,r,o,n,t)}return $t(i,r,o,n,t)}function $t(e,t,i,r,o){let n=e?.beforeEach,s=e?.afterEach,a=We(e?.parameters),l=e?.timeout,d=e?.skip,p=e?.fail,g=e?.only,y=e?.slow;e&&(delete e.beforeEach,delete e.afterEach,delete e.parameters,delete e.timeout,delete e.skip,delete e.fail,delete e.only,delete e.slow),e&&!e.goal&&t&&(e.goal=t);let h=[];if(o&&e&&typeof e=="object"){let I=Ne(e,o);e=I.doc,h=I.referencedTemplatePaths}let m=(0,N.stringify)(e);return{testFlow:S(m),name:t,tags:i,use:r,beforeEach:n,afterEach:s,parameters:a,timeout:l,skip:d,fail:p,only:g,slow:y,referencedTemplatePaths:h}}function Ot(e,t,i,r,o){let n=e.suite;if(!Array.isArray(n.tests)||n.tests.length===0)throw new Error('Suite must have a non-empty "tests" array.');let s=n.serial,a=n.beforeAll,l=n.afterAll,d=n.beforeEach,p=n.afterEach,g=[],y=n.tests.map(h=>{if(!h.name)throw new Error('Each test in a suite must have a "name" field.');if(!Array.isArray(h.statements)||h.statements.length===0)throw new Error(`Suite test "${h.name}" must have a non-empty "statements" array.`);let m={goal:h.name,statements:h.statements};h.teardown&&(m.teardown=h.teardown);let j=[],I=m;if(o&&typeof m=="object"){let q=Ne(m,o);I=q.doc,j=q.referencedTemplatePaths,g.push(...j)}let Ye=(0,N.stringify)(I),Xe=S(Ye),qe=We(h.parameters);return{testFlow:Xe,name:h.name,parameters:qe,timeout:h.timeout,skip:h.skip,fail:h.fail,only:h.only,slow:h.slow}});return{suite:{serial:s,beforeAll:a,afterAll:l,beforeEach:d,afterEach:p,tests:y},name:t,tags:i,use:r,referencedTemplatePaths:g}}function We(e){if(!(!Array.isArray(e)||e.length===0))return e.map((t,i)=>{if(!t.name)throw new Error(`Parameter set at index ${i} must have a "name" field.`);if(!t.values||typeof t.values!="object")throw new Error(`Parameter set "${t.name}" must have a "values" object.`);return{name:t.name,values:t.values}})}var kt,N,Ce,D,C,Ie,w,Oe,Fe=f(()=>{"use strict";O();kt=require("yaml");O();N=require("yaml");O();Ce=require("fs"),D=require("path"),C=require("yaml");O();Ie=1e4;w=new Map;u("click",e=>{let t=Le(e);return t?[`await ${t}.click({ timeout: ${Ie} });`]:['await agent.execAction("click", page, {});']});u("click_element",w.get("click"));u("click_element_by_index",w.get("click"));u("double_click",e=>k("double_click",e));u("double_click_on_element",w.get("double_click"));u("right_click",e=>k("right_click",e));u("right_click_on_element",w.get("right_click"));u("hover",e=>k("hover",e));u("hover_element_by_index",w.get("hover"));u("input_text",e=>{let t=e.action_data?.kwargs?.text??e.action_data?.kwargs?.value??"";return k("input_text",e,[`action_data: { kwargs: { text: ${JSON.stringify(t)} } }`])});u("fill",w.get("input_text"));u("clear_input",e=>k("clear_input",e));u("press",e=>{let t=e.action_data?.kwargs?.keys;return[`await page.keyboard.press(${JSON.stringify(t)});`]});u("send_keys",w.get("press"));u("send_keys_on_element",e=>{let t=Le(e),i=e.action_data?.kwargs?.keys||"";return t?[`await ${t}.press(${JSON.stringify(i)}, { timeout: ${Ie} });`]:['await agent.execAction("send_keys_on_element", page, {',` action_data: { kwargs: { keys: ${JSON.stringify(i)} } },`,"});"]});u("select_dropdown_option",e=>{let t=e.action_data?.kwargs?.text||e.action_data?.kwargs?.option||"";return k("select_dropdown_option",e,[`action_data: { kwargs: { text: ${JSON.stringify(t)} } }`])});u("scroll",e=>{let t=e.action_data?.kwargs?.down??!0;return[`await page.evaluate('window.scrollBy(0, window.innerHeight * ${(e.action_data?.kwargs?.num_pages??1)*(t?1:-1)})');`]});u("scroll_down",w.get("scroll"));u("scroll_up",w.get("scroll"));u("scroll_element",w.get("scroll"));u("scroll_to_text",e=>{let t=e.action_data?.kwargs?.text||"";return[`await page.getByText(${JSON.stringify(t)}, { exact: false }).first().scrollIntoViewIfNeeded();`]});u("scroll_on_element",e=>k("scroll_on_element",e,[`action_data: { kwargs: ${JSON.stringify(e.action_data?.kwargs||{})} }`]));u("go_to_url",e=>{let t=e.action_data?.kwargs?.url||"";return e.action_data?.kwargs?.new_tab===!0?['await agent.execAction("go_to_url", page, {',` action_data: { kwargs: { url: ${JSON.stringify(t)}, new_tab: true } },`,"});"]:['await agent.execAction("go_to_url", page, {',` action_data: { kwargs: { url: ${JSON.stringify(t)} } },`,"});"]});u("open_tab",w.get("go_to_url"));u("go_back",()=>['await agent.execAction("go_back", page, {});']);u("reload_page",()=>['await agent.execAction("reload_page", page, {});']);u("wait",e=>[`await page.waitForTimeout(${(e.action_data?.kwargs?.seconds||1)*1e3});`]);u("wait_for_page_ready",()=>["await page.waitForLoadState('domcontentloaded');"]);u("verify",(e,t)=>{let i=e.action_data?.kwargs,r=typeof i?.code=="string",o=i?.statement||e.action_description;if(r&&o){let s=i.code.split(`
2
- `),a=JSON.stringify(o);return["{ const _t = Date.now(); try {",...s.map(l=>` ${l}`),` console.log(\`[VERIFY:JS] \u2713 \${((Date.now()-_t)/1000).toFixed(1)}s: ${a}\`);`,"} catch (_e) {",` console.log(\`[VERIFY:JS\u2192AI] JS failed \${((Date.now()-_t)/1000).toFixed(1)}s: (\${_e instanceof Error ? _e.message : String(_e)}), falling back to AI: ${a}\`);`,` await agent.assert(page, ${a}, ${JSON.stringify(t||"")});`,"} }"]}return r?i.code.split(`
1
+ "use strict";var rt=Object.create;var F=Object.defineProperty;var ot=Object.getOwnPropertyDescriptor;var nt=Object.getOwnPropertyNames;var st=Object.getPrototypeOf,at=Object.prototype.hasOwnProperty;var g=(e,t)=>()=>(e&&(t=e(e=0)),t);var H=(e,t)=>{for(var i in t)F(e,i,{get:t[i],enumerable:!0})},ee=(e,t,i,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of nt(t))!at.call(e,o)&&o!==i&&F(e,o,{get:()=>t[o],enumerable:!(r=ot(t,o))||r.enumerable});return e};var x=(e,t,i)=>(i=e!=null?rt(st(e)):{},ee(t||!e||!e.__esModule?F(i,"default",{value:e,enumerable:!0}):i,e)),ct=e=>ee(F({},"__esModule",{value:!0}),e);var oe=g(()=>{"use strict"});var ne=g(()=>{"use strict"});var se=g(()=>{"use strict"});var G=g(()=>{"use strict"});var ae=g(()=>{"use strict";G()});var ce,ut,le,ue,C,ht,dt,he=g(()=>{"use strict";ce=112,ut=1080-ce,le={"Blackberry PlayBook":{name:"Blackberry PlayBook",userAgent:"Mozilla/5.0 (PlayBook; U; RIM Tablet OS 2.1.0; en-US) AppleWebKit/536.2+ (KHTML like Gecko) Version/26.0 Safari/536.2+",screen:{width:600,height:1024},viewport:{width:600,height:1024},deviceScaleFactor:1,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"BlackBerry Z30":{name:"BlackBerry Z30",userAgent:"Mozilla/5.0 (BB10; Touch) AppleWebKit/537.10+ (KHTML, like Gecko) Version/26.0 Mobile Safari/537.10+",screen:{width:360,height:640},viewport:{width:360,height:640},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"Galaxy Note 3":{name:"Galaxy Note 3",userAgent:"Mozilla/5.0 (Linux; U; Android 4.3; en-us; SM-N900T Build/JSS15J) AppleWebKit/534.30 (KHTML, like Gecko) Version/26.0 Mobile Safari/534.30",screen:{width:360,height:640},viewport:{width:360,height:640},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"Galaxy Note II":{name:"Galaxy Note II",userAgent:"Mozilla/5.0 (Linux; U; Android 4.1; en-us; GT-N7100 Build/JRO03C) AppleWebKit/534.30 (KHTML, like Gecko) Version/26.0 Mobile Safari/534.30",screen:{width:360,height:640},viewport:{width:360,height:640},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"Galaxy S III":{name:"Galaxy S III",userAgent:"Mozilla/5.0 (Linux; U; Android 4.0; en-us; GT-I9300 Build/IMM76D) AppleWebKit/534.30 (KHTML, like Gecko) Version/26.0 Mobile Safari/534.30",screen:{width:360,height:640},viewport:{width:360,height:640},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"Galaxy S5":{name:"Galaxy S5",userAgent:"Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/LRX21T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:360,height:640},viewport:{width:360,height:640},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Galaxy S8":{name:"Galaxy S8",userAgent:"Mozilla/5.0 (Linux; Android 7.0; SM-G950U Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:360,height:740},viewport:{width:360,height:740},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Galaxy S9+":{name:"Galaxy S9+",userAgent:"Mozilla/5.0 (Linux; Android 8.0.0; SM-G965U Build/R16NW) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:320,height:658},viewport:{width:320,height:658},deviceScaleFactor:4.5,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Galaxy S24":{name:"Galaxy S24",userAgent:"Mozilla/5.0 (Linux; Android 14; SM-S921U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:360,height:780},viewport:{width:360,height:780},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Galaxy A55":{name:"Galaxy A55",userAgent:"Mozilla/5.0 (Linux; Android 14; SM-A556B) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:480,height:1040},viewport:{width:480,height:1040},deviceScaleFactor:2.25,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Galaxy Tab S4":{name:"Galaxy Tab S4",userAgent:"Mozilla/5.0 (Linux; Android 8.1.0; SM-T837A) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36",screen:{width:712,height:1138},viewport:{width:712,height:1138},deviceScaleFactor:2.25,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Galaxy Tab S9":{name:"Galaxy Tab S9",userAgent:"Mozilla/5.0 (Linux; Android 14; SM-X710) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36",screen:{width:640,height:1024},viewport:{width:640,height:1024},deviceScaleFactor:2.5,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"iPad (gen 5)":{name:"iPad (gen 5)",userAgent:"Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:768,height:1024},viewport:{width:768,height:1024},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPad (gen 6)":{name:"iPad (gen 6)",userAgent:"Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:768,height:1024},viewport:{width:768,height:1024},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPad (gen 7)":{name:"iPad (gen 7)",userAgent:"Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:810,height:1080},viewport:{width:810,height:1080},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPad (gen 11)":{name:"iPad (gen 11)",userAgent:"Mozilla/5.0 (iPad; CPU OS 18_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/19E241 Safari/604.1",screen:{width:656,height:944},viewport:{width:656,height:944},deviceScaleFactor:2.5,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPad Mini":{name:"iPad Mini",userAgent:"Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:768,height:1024},viewport:{width:768,height:1024},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPad Pro 11":{name:"iPad Pro 11",userAgent:"Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:834,height:1194},viewport:{width:834,height:1194},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 6":{name:"iPhone 6",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.0 Mobile/15A372 Safari/604.1",screen:{width:375,height:667},viewport:{width:375,height:667},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 6 Plus":{name:"iPhone 6 Plus",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.0 Mobile/15A372 Safari/604.1",screen:{width:414,height:736},viewport:{width:414,height:736},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 7":{name:"iPhone 7",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.0 Mobile/15A372 Safari/604.1",screen:{width:375,height:667},viewport:{width:375,height:667},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 7 Plus":{name:"iPhone 7 Plus",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.0 Mobile/15A372 Safari/604.1",screen:{width:414,height:736},viewport:{width:414,height:736},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 8":{name:"iPhone 8",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.0 Mobile/15A372 Safari/604.1",screen:{width:375,height:667},viewport:{width:375,height:667},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 8 Plus":{name:"iPhone 8 Plus",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.0 Mobile/15A372 Safari/604.1",screen:{width:414,height:736},viewport:{width:414,height:736},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone SE":{name:"iPhone SE",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/26.0 Mobile/14E304 Safari/602.1",screen:{width:320,height:568},viewport:{width:320,height:568},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone SE (3rd gen)":{name:"iPhone SE (3rd gen)",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 18_5 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/26.0 Mobile/19E241 Safari/602.1",screen:{width:375,height:667},viewport:{width:375,height:667},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone X":{name:"iPhone X",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/26.0 Mobile/15A372 Safari/604.1",screen:{width:375,height:812},viewport:{width:375,height:812},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone XR":{name:"iPhone XR",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 12_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:414,height:896},viewport:{width:414,height:896},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 11":{name:"iPhone 11",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:414,height:896},viewport:{width:414,height:715},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 11 Pro":{name:"iPhone 11 Pro",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:375,height:812},viewport:{width:375,height:635},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 11 Pro Max":{name:"iPhone 11 Pro Max",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:414,height:896},viewport:{width:414,height:715},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 12":{name:"iPhone 12",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:390,height:844},viewport:{width:390,height:664},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 12 Pro":{name:"iPhone 12 Pro",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:390,height:844},viewport:{width:390,height:664},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 12 Pro Max":{name:"iPhone 12 Pro Max",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:428,height:926},viewport:{width:428,height:746},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 12 Mini":{name:"iPhone 12 Mini",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:375,height:812},viewport:{width:375,height:629},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 13":{name:"iPhone 13",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:390,height:844},viewport:{width:390,height:664},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 13 Pro":{name:"iPhone 13 Pro",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:390,height:844},viewport:{width:390,height:664},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 13 Pro Max":{name:"iPhone 13 Pro Max",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:428,height:926},viewport:{width:428,height:746},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 13 Mini":{name:"iPhone 13 Mini",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:375,height:812},viewport:{width:375,height:629},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 14":{name:"iPhone 14",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:390,height:844},viewport:{width:390,height:664},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 14 Plus":{name:"iPhone 14 Plus",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:428,height:926},viewport:{width:428,height:746},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 14 Pro":{name:"iPhone 14 Pro",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:393,height:852},viewport:{width:393,height:660},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 14 Pro Max":{name:"iPhone 14 Pro Max",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 16_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:430,height:932},viewport:{width:430,height:740},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 15":{name:"iPhone 15",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:393,height:852},viewport:{width:393,height:659},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 15 Plus":{name:"iPhone 15 Plus",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:430,height:932},viewport:{width:430,height:739},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 15 Pro":{name:"iPhone 15 Pro",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:393,height:852},viewport:{width:393,height:659},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"iPhone 15 Pro Max":{name:"iPhone 15 Pro Max",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",screen:{width:430,height:932},viewport:{width:430,height:739},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"Kindle Fire HDX":{name:"Kindle Fire HDX",userAgent:"Mozilla/5.0 (Linux; U; en-us; KFAPWI Build/JDQ39) AppleWebKit/535.19 (KHTML, like Gecko) Silk/3.13 Safari/535.19 Silk-Accelerated=true",screen:{width:800,height:1280},viewport:{width:800,height:1280},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"LG Optimus L70":{name:"LG Optimus L70",userAgent:"Mozilla/5.0 (Linux; U; Android 4.4.2; en-us; LGMS323 Build/KOT49I.MS32310c) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:384,height:640},viewport:{width:384,height:640},deviceScaleFactor:1.25,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Microsoft Lumia 550":{name:"Microsoft Lumia 550",userAgent:"Mozilla/5.0 (Windows Phone 10.0; Android 4.2.1; Microsoft; Lumia 550) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36 Edge/14.14263",screen:{width:360,height:640},viewport:{width:360,height:640},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Microsoft Lumia 950":{name:"Microsoft Lumia 950",userAgent:"Mozilla/5.0 (Windows Phone 10.0; Android 4.2.1; Microsoft; Lumia 950) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36 Edge/14.14263",screen:{width:360,height:640},viewport:{width:360,height:640},deviceScaleFactor:4,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Nexus 10":{name:"Nexus 10",userAgent:"Mozilla/5.0 (Linux; Android 6.0.1; Nexus 10 Build/MOB31T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36",screen:{width:800,height:1280},viewport:{width:800,height:1280},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Nexus 4":{name:"Nexus 4",userAgent:"Mozilla/5.0 (Linux; Android 4.4.2; Nexus 4 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:384,height:640},viewport:{width:384,height:640},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Nexus 5":{name:"Nexus 5",userAgent:"Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:360,height:640},viewport:{width:360,height:640},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Nexus 5X":{name:"Nexus 5X",userAgent:"Mozilla/5.0 (Linux; Android 8.0.0; Nexus 5X Build/OPR4.170623.006) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:412,height:732},viewport:{width:412,height:732},deviceScaleFactor:2.625,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Nexus 6":{name:"Nexus 6",userAgent:"Mozilla/5.0 (Linux; Android 7.1.1; Nexus 6 Build/N6F26U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:412,height:732},viewport:{width:412,height:732},deviceScaleFactor:3.5,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Nexus 6P":{name:"Nexus 6P",userAgent:"Mozilla/5.0 (Linux; Android 8.0.0; Nexus 6P Build/OPP3.170518.006) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:412,height:732},viewport:{width:412,height:732},deviceScaleFactor:3.5,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Nexus 7":{name:"Nexus 7",userAgent:"Mozilla/5.0 (Linux; Android 6.0.1; Nexus 7 Build/MOB30X) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36",screen:{width:600,height:960},viewport:{width:600,height:960},deviceScaleFactor:2,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Nokia Lumia 520":{name:"Nokia Lumia 520",userAgent:"Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; ARM; Touch; NOKIA; Lumia 520)",screen:{width:320,height:533},viewport:{width:320,height:533},deviceScaleFactor:1.5,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Nokia N9":{name:"Nokia N9",userAgent:"Mozilla/5.0 (MeeGo; NokiaN9) AppleWebKit/534.13 (KHTML, like Gecko) NokiaBrowser/8.5.0 Mobile Safari/534.13",screen:{width:480,height:854},viewport:{width:480,height:854},deviceScaleFactor:1,isMobile:!0,hasTouch:!0,defaultBrowserType:"webkit"},"Pixel 2":{name:"Pixel 2",userAgent:"Mozilla/5.0 (Linux; Android 8.0; Pixel 2 Build/OPD3.170816.012) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:411,height:731},viewport:{width:411,height:731},deviceScaleFactor:2.625,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Pixel 2 XL":{name:"Pixel 2 XL",userAgent:"Mozilla/5.0 (Linux; Android 8.0.0; Pixel 2 XL Build/OPD1.170816.004) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:411,height:823},viewport:{width:411,height:823},deviceScaleFactor:3.5,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Pixel 3":{name:"Pixel 3",userAgent:"Mozilla/5.0 (Linux; Android 9; Pixel 3 Build/PQ1A.181105.017.A1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:393,height:786},viewport:{width:393,height:786},deviceScaleFactor:2.75,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Pixel 4":{name:"Pixel 4",userAgent:"Mozilla/5.0 (Linux; Android 10; Pixel 4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:353,height:745},viewport:{width:353,height:745},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Pixel 4a (5G)":{name:"Pixel 4a (5G)",userAgent:"Mozilla/5.0 (Linux; Android 11; Pixel 4a (5G)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:412,height:892},viewport:{width:412,height:765},deviceScaleFactor:2.63,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Pixel 5":{name:"Pixel 5",userAgent:"Mozilla/5.0 (Linux; Android 11; Pixel 5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:393,height:851},viewport:{width:393,height:727},deviceScaleFactor:2.75,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Pixel 7":{name:"Pixel 7",userAgent:"Mozilla/5.0 (Linux; Android 14; Pixel 7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:412,height:915},viewport:{width:412,height:839},deviceScaleFactor:2.625,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Moto G4":{name:"Moto G4",userAgent:"Mozilla/5.0 (Linux; Android 7.0; Moto G (4)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Mobile Safari/537.36",screen:{width:360,height:640},viewport:{width:360,height:640},deviceScaleFactor:3,isMobile:!0,hasTouch:!0,defaultBrowserType:"chromium"},"Desktop Chrome HiDPI":{name:"Desktop Chrome HiDPI",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36",screen:{width:1792,height:1120},viewport:{width:1280,height:720},deviceScaleFactor:2,isMobile:!1,hasTouch:!1,defaultBrowserType:"chromium"},"Desktop Edge HiDPI":{name:"Desktop Edge HiDPI",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36 Edg/141.0.7390.16",screen:{width:1792,height:1120},viewport:{width:1280,height:720},deviceScaleFactor:2,isMobile:!1,hasTouch:!1,defaultBrowserType:"chromium"},"Desktop Firefox HiDPI":{name:"Desktop Firefox HiDPI",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:142.0.1) Gecko/20100101 Firefox/142.0.1",screen:{width:1792,height:1120},viewport:{width:1280,height:720},deviceScaleFactor:2,isMobile:!1,hasTouch:!1,defaultBrowserType:"firefox"},"Desktop Safari":{name:"Desktop Safari",userAgent:"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Safari/605.1.15",screen:{width:1792,height:1120},viewport:{width:1280,height:720},deviceScaleFactor:2,isMobile:!1,hasTouch:!1,defaultBrowserType:"webkit"},"Desktop Chrome":{name:"Desktop Chrome",displayName:"Playwright Chromium",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36",screen:{width:1920,height:1080},viewport:{width:1920,height:1080},deviceScaleFactor:1,isMobile:!1,hasTouch:!1,defaultBrowserType:"chromium"},"Desktop Chrome Medium Resolution":{name:"Desktop Chrome Medium Resolution",displayName:"Playwright Chromium",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36",screen:{width:1280,height:720},viewport:{width:1280,height:720},deviceScaleFactor:1,isMobile:!1,hasTouch:!1,defaultBrowserType:"chromium"},"Desktop Chrome (Branded)":{name:"Desktop Chrome (Branded)",displayName:"Google Chrome",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36",screen:{width:1920,height:1080},viewport:{width:1920,height:1080},deviceScaleFactor:1,isMobile:!1,hasTouch:!1,defaultBrowserType:"chromium",channel:"chrome"},"Desktop Chrome Medium Resolution (Branded)":{name:"Desktop Chrome Medium Resolution (Branded)",displayName:"Google Chrome",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36",screen:{width:1280,height:720},viewport:{width:1280,height:720},deviceScaleFactor:1,isMobile:!1,hasTouch:!1,defaultBrowserType:"chromium",channel:"chrome"},"Desktop Edge":{name:"Desktop Edge",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36 Edg/141.0.7390.16",screen:{width:1920,height:1080},viewport:{width:1280,height:720},deviceScaleFactor:1,isMobile:!1,hasTouch:!1,defaultBrowserType:"chromium"},"Desktop Edge (Branded)":{name:"Desktop Edge (Branded)",displayName:"Microsoft Edge",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36 Edg/141.0.7390.16",screen:{width:1920,height:1080},viewport:{width:1920,height:1080},deviceScaleFactor:1,isMobile:!1,hasTouch:!1,defaultBrowserType:"chromium",channel:"msedge"},"Desktop Edge Medium Resolution (Branded)":{name:"Desktop Edge Medium Resolution (Branded)",displayName:"Microsoft Edge",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.7390.16 Safari/537.36 Edg/141.0.7390.16",screen:{width:1280,height:720},viewport:{width:1280,height:720},deviceScaleFactor:1,isMobile:!1,hasTouch:!1,defaultBrowserType:"chromium",channel:"msedge"},"Desktop Firefox":{name:"Desktop Firefox",userAgent:"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:142.0.1) Gecko/20100101 Firefox/142.0.1",screen:{width:1920,height:1080},viewport:{width:1280,height:720},deviceScaleFactor:1,isMobile:!1,hasTouch:!1,defaultBrowserType:"firefox"}},ue={desktop:["Desktop Chrome","Desktop Chrome Medium Resolution","Desktop Chrome (Branded)","Desktop Chrome Medium Resolution (Branded)","Desktop Edge (Branded)","Desktop Edge Medium Resolution (Branded)","Desktop Safari"],mobile:["iPhone 15 Pro Max","iPhone 15 Pro","iPhone 15 Plus","iPhone 15","iPhone 14 Pro Max","iPhone 14 Pro","iPhone 14 Plus","iPhone 14","iPhone 13 Pro Max","iPhone 13 Pro","iPhone 13","iPhone 13 Mini","iPhone 12 Pro Max","iPhone 12 Pro","iPhone 12","iPhone 12 Mini","iPhone 11 Pro Max","iPhone 11 Pro","iPhone 11","iPhone XR","iPhone X","iPhone SE (3rd gen)","iPhone SE","iPhone 8 Plus","iPhone 8","iPhone 7 Plus","iPhone 7","iPhone 6 Plus","iPhone 6","Galaxy S24","Galaxy A55","Galaxy S9+","Galaxy S8","Galaxy S5","Galaxy Note 3","Galaxy Note II","Galaxy S III","Pixel 7","Pixel 5","Pixel 4a (5G)","Pixel 4","Pixel 3","Pixel 2 XL","Pixel 2","Nexus 6P","Nexus 6","Nexus 5X","Nexus 5","Nexus 4","Moto G4","LG Optimus L70","Microsoft Lumia 950","Microsoft Lumia 550","Nokia Lumia 520","Nokia N9","BlackBerry Z30"]},C=(e,t=!1)=>{let i=["chromium"];return t&&i.push("webkit"),ue[e].map(r=>le[r]).filter(r=>r.defaultBrowserType&&i.includes(r.defaultBrowserType))},ht={desktop:{label:"Desktop",type:"desktop",devices:C("desktop")},mobile:{label:"Mobile Web",type:"mobile",devices:C("mobile")}},dt={desktop:{label:"Desktop",type:"desktop",devices:C("desktop",!0)},mobile:{label:"Mobile Web",type:"mobile",devices:C("mobile",!0)}}});var de=g(()=>{"use strict"});var a,pe,V,fe,O,ge,me,we,_,ye,K,z,J=g(()=>{"use strict";a=require("zod"),pe=a.z.enum(["JS_CODE","AI_MODE"]),V=a.z.object({type:pe,expression:a.z.string()}),fe=a.z.enum(["DRAFT","STEP","ACTION","IF_ELSE","WHILE_LOOP"]),O=a.z.object({uid:a.z.string(),type:fe}),ge=a.z.object({action_data:a.z.object({action_name:a.z.string(),kwargs:a.z.record(a.z.any()).optional(),args:a.z.array(a.z.any()).optional()}),action_description:a.z.string().optional(),url:a.z.string().optional(),xpath:a.z.string().nullable().optional(),locator:a.z.string().nullable().optional(),css_selector:a.z.string().nullable().optional(),unique_selector:a.z.string().nullable().optional(),element_index:a.z.number().nullable().optional(),frame_path:a.z.array(a.z.any()).optional(),artifacts:a.z.record(a.z.any()).optional(),feedback:a.z.string().optional(),original_browser_use_action:a.z.any().optional()}).passthrough(),me=O.extend({type:a.z.literal("DRAFT"),description:a.z.string()}),we=O.extend({type:a.z.literal("ACTION"),description:a.z.string(),action_entity:ge.optional(),locator:a.z.string().optional(),use_pure_vision:a.z.boolean().optional()}),_=a.z.lazy(()=>a.z.union([me,we,O.extend({type:a.z.literal("STEP"),description:a.z.string().optional().default(""),statements:a.z.array(_),reference_id:a.z.number().optional()}),O.extend({type:a.z.literal("IF_ELSE"),description:a.z.string().optional(),condition:V,then:a.z.array(_),else:a.z.array(_).optional()}),O.extend({type:a.z.literal("WHILE_LOOP"),description:a.z.string().optional(),condition:V,body:a.z.array(_),timeout_ms:a.z.number().optional()})])),ye=a.z.object({name:a.z.string(),statements:a.z.array(_),teardown:a.z.array(_).optional(),skip:a.z.union([a.z.boolean(),a.z.string()]).optional(),timeout:a.z.number().optional(),fail:a.z.union([a.z.boolean(),a.z.string()]).optional(),only:a.z.boolean().optional(),slow:a.z.boolean().optional()}),K=a.z.object({tests:a.z.array(ye).min(1),beforeAll:a.z.array(_).optional(),afterAll:a.z.array(_).optional(),beforeEach:a.z.array(_).optional(),afterEach:a.z.array(_).optional()}),z=a.z.object({version:a.z.string().optional(),goal:a.z.string().optional(),url:a.z.string().optional(),baseURL:a.z.string().optional(),final_feedback:a.z.string().optional(),completed:a.z.boolean().optional(),success:a.z.boolean().optional(),statements:a.z.array(_).optional(),teardown:a.z.array(_).optional(),last_modified_at:a.z.string().optional(),testGroup:K.optional()}).refine(e=>e.testGroup!==void 0?e.goal===void 0&&(e.statements===void 0||e.statements.length===0):e.goal!==void 0,{message:"TestFlow must have either goal/statements (single test) or testGroup (suite), not both"})});function be(e,t){let i={...t?.test_case_id!==void 0?{test_case_id:t.test_case_id}:{},...t?.name?{name:t.name}:{},goal:e.goal??"",url:e.url,base_url:e.baseURL,statements:(e.statements??[]).map(S)};return e.final_feedback&&(i.final_feedback=e.final_feedback),e.teardown&&e.teardown.length>0&&(i.teardown=e.teardown.map(S)),i}function B(e,t){return e.testGroup?Ae(e,t):(0,P.stringify)(be(e,t),Te)}function Ae(e,t){let i=e.testGroup;if(!i)throw new Error("suiteToYaml requires a TestFlow with testGroup");let r={};t?.test_case_id!==void 0&&(r.test_case_id=t.test_case_id),t?.name&&(r.name=t.name),t?.tags&&t.tags.length>0&&(r.tags=t.tags),t?.use&&Object.keys(t.use).length>0&&(r.use=t.use);let o={};return e.baseURL&&(o.base_url=e.baseURL),i.beforeAll&&i.beforeAll.length>0&&(o.beforeAll=i.beforeAll.map(S)),i.beforeEach&&i.beforeEach.length>0&&(o.beforeEach=i.beforeEach.map(S)),i.afterEach&&i.afterEach.length>0&&(o.afterEach=i.afterEach.map(S)),i.afterAll&&i.afterAll.length>0&&(o.afterAll=i.afterAll.map(S)),o.tests=i.tests.map(n=>{let c={name:n.name};return n.skip!==void 0&&(c.skip=n.skip),n.timeout!==void 0&&(c.timeout=n.timeout),n.fail!==void 0&&(c.fail=n.fail),n.only!==void 0&&(c.only=n.only),n.slow!==void 0&&(c.slow=n.slow),c.statements=n.statements.map(S),n.teardown&&n.teardown.length>0&&(c.teardown=n.teardown.map(S)),c}),r.suite=o,(0,P.stringify)(r,Te)}function S(e){switch(e.type){case"DRAFT":return pt(e);case"ACTION":return ft(e);case"STEP":return gt(e);case"IF_ELSE":return mt(e);case"WHILE_LOOP":return wt(e)}}function pt(e){return{desc:e.description}}function ft(e){let t=e.action_entity?.action_data?.action_name??e.action_entity?.action?.action_name,i=e.action_entity?.action_data?.kwargs??e.action_entity?.action?.kwargs;if(t==="verify"){let s=i?.statement;if(typeof s=="string"&&!e.action_entity?.locator&&!e.action_entity?.xpath){let l=i?.code;return typeof l=="string"?{VERIFY:s,js:l}:{VERIFY:s}}}if(t==="go_to_url"){let s=i?.url;if(typeof s=="string"&&!e.action_entity?.locator&&!e.action_entity?.xpath){let l={URL:s};return i?.new_tab===!0&&(l.new_tab=!0),typeof i?.timeout_seconds=="number"&&(l.timeout_seconds=i.timeout_seconds),l}}if(t==="js_action"){let s=i?.code;if(typeof s=="string"&&e.description)return{desc:e.description,js:s}}if(t==="js_code"){let s=i?.code;if(typeof s=="string"&&!e.action_entity?.locator&&!e.action_entity?.xpath)return{CODE:s}}if(!e.action_entity)return{desc:e.description};let r=e.action_entity.action_data??e.action_entity.action;if(!r)return{desc:e.description};let o={desc:e.description,action:r.action_name},n=e.locator??e.action_entity.locator;n&&(o.locator=n);let c=e.action_entity.xpath;if(c&&(o.xpath=c),e.use_pure_vision&&(o.use_pure_vision=!0),r.kwargs&&Object.keys(r.kwargs).length>0)for(let[s,l]of Object.entries(r.kwargs))o[s]=l;return r.args&&r.args.length>0&&(o.args=r.args),o}function gt(e){let t={STEP:e.description,statements:e.statements.map(S)};return e.reference_id!==void 0&&(t.reference_id=e.reference_id),t}function mt(e){let t={IF:ve(e.condition),THEN:e.then.map(S)};return e.else&&e.else.length>0&&(t.ELSE=e.else.map(S)),t}function wt(e){let t={WHILE:ve(e.condition),DO:e.body.map(S)};return e.timeout_ms!==void 0&&(t.timeout_ms=e.timeout_ms),t}function ve(e){return e.type==="JS_CODE"?`js:${e.expression}`:e.expression}function Y(e){try{let t=(0,P.parse)(e);if(!t||typeof t!="object")return{};let i={};return typeof t.test_case_id=="number"&&Number.isFinite(t.test_case_id)&&(i.test_case_id=t.test_case_id),typeof t.template_id=="number"&&Number.isFinite(t.template_id)&&(i.template_id=t.template_id),typeof t.name=="string"&&t.name.trim()&&(i.name=t.name.trim()),i}catch{return{}}}function A(e){if(e.length>_e)throw new Error(`YAML input too large (${e.length} bytes, max ${_e})`);let t=(0,P.parse)(e);if(!t||typeof t!="object")throw new Error("Invalid YAML: expected an object at root level");if(t.suite)return yt(t);let i={version:"1.3.0",goal:t.goal,url:t.url,baseURL:t.base_url,statements:b(t.statements??[])};t.final_feedback&&(i.final_feedback=t.final_feedback),t.teardown&&Array.isArray(t.teardown)&&(i.teardown=b(t.teardown));let r=z.safeParse(i);if(!r.success)throw new Error(`Invalid TestFlow after YAML conversion: ${JSON.stringify(r.error.errors)}`);return r.data}function yt(e){let t=e.suite;if(!t||typeof t!="object")throw new Error("Invalid suite: expected an object");let i=t.tests;if(!Array.isArray(i)||i.length===0)throw new Error('Suite must have a non-empty "tests" array');let o={tests:i.map(s=>{if(!s.name)throw new Error('Each test in a suite must have a "name" field');if(!Array.isArray(s.statements)||s.statements.length===0)throw new Error(`Suite test "${s.name}" must have a non-empty "statements" array`);let l={name:s.name,statements:b(s.statements)};return Array.isArray(s.teardown)&&s.teardown.length>0&&(l.teardown=b(s.teardown)),s.skip!==void 0&&(l.skip=s.skip),typeof s.timeout=="number"&&(l.timeout=s.timeout),s.fail!==void 0&&(l.fail=s.fail),s.only===!0&&(l.only=!0),s.slow===!0&&(l.slow=!0),l})};Array.isArray(t.beforeAll)&&t.beforeAll.length>0&&(o.beforeAll=b(t.beforeAll)),Array.isArray(t.afterAll)&&t.afterAll.length>0&&(o.afterAll=b(t.afterAll)),Array.isArray(t.beforeEach)&&t.beforeEach.length>0&&(o.beforeEach=b(t.beforeEach)),Array.isArray(t.afterEach)&&t.afterEach.length>0&&(o.afterEach=b(t.afterEach));let n=K.safeParse(o);if(!n.success)throw new Error(`Invalid TestGroup: ${JSON.stringify(n.error.errors)}`);return{version:"1.3.0",baseURL:t.base_url||void 0,testGroup:n.data}}function b(e){if(!Array.isArray(e))throw new Error("Expected an array of statements");return e.map(_t)}function _t(e){if(typeof e=="string")throw new Error(`Plain string statements are not supported. Use "desc: ${e}" instead.`);if(typeof e!="object"||e===null)throw new Error(`Invalid statement: expected object, got ${typeof e}`);let t=e;if("IF"in t)return St(t);if("WHILE"in t)return bt(t);if("STEP"in t)return Tt(t);if("VERIFY"in t){let i=t.VERIFY,r={statement:typeof i=="string"?i:String(i)};return typeof t.js=="string"&&(r.code=t.js),{uid:(0,T.v4)(),type:"ACTION",description:`Verify: ${i}`,action_entity:{action_description:`Verify: ${i}`,action_data:{action_name:"verify",kwargs:r}}}}if("URL"in t){let i=t.URL,r=t.new_tab===!0?!0:void 0,o=typeof t.timeout_seconds=="number"?t.timeout_seconds:void 0,n={url:typeof i=="string"?i:String(i)};return r&&(n.new_tab=!0),o!==void 0&&(n.timeout_seconds=o),{uid:(0,T.v4)(),type:"ACTION",description:`Navigate to ${i}`,action_entity:{action_description:`Navigate to ${i}`,action_data:{action_name:"go_to_url",kwargs:n}}}}if("CODE"in t){let i=t.CODE;return{uid:(0,T.v4)(),type:"ACTION",description:"Code block",action_entity:{action_description:"Code block",action_data:{action_name:"js_code",kwargs:{code:typeof i=="string"?i:String(i)}}}}}if("js"in t&&"desc"in t&&!("VERIFY"in t)){let i=t.js,r=typeof t.desc=="string"?t.desc:"";return{uid:(0,T.v4)(),type:"ACTION",description:r,action_entity:{action_description:r,action_data:{action_name:"js_action",kwargs:{code:typeof i=="string"?i:String(i)}}}}}if("call"in t&&typeof t.call=="string"){let{call:i,...r}=t;return Se({...r,action:"function",functionName:i})}if("action"in t)return Se(t);if("desc"in t&&typeof t.desc=="string")return{uid:(0,T.v4)(),type:"DRAFT",description:t.desc};throw new Error(`Cannot infer statement type from object: ${JSON.stringify(t)}`)}function ke(e){if(typeof e!="string")throw new Error(`Condition must be a string, got ${typeof e}`);return e.startsWith("js:")?{type:"JS_CODE",expression:e.slice(3)}:{type:"AI_MODE",expression:e}}function St(e){let t=ke(e.IF),i=e.THEN;if(!Array.isArray(i))throw new Error("IF_ELSE requires a THEN array");let r={uid:(0,T.v4)(),type:"IF_ELSE",condition:t,then:b(i)};return"ELSE"in e&&Array.isArray(e.ELSE)&&(r.else=b(e.ELSE)),r}function bt(e){let t=ke(e.WHILE),i=e.DO;if(!Array.isArray(i))throw new Error("WHILE_LOOP requires a DO array");let r={uid:(0,T.v4)(),type:"WHILE_LOOP",condition:t,body:b(i)};return typeof e.timeout_ms=="number"&&(r.timeout_ms=e.timeout_ms),r}function Tt(e){let t=typeof e.STEP=="string"?e.STEP:"";if(!Array.isArray(e.statements))throw new Error("STEP requires a statements array");let i={uid:(0,T.v4)(),type:"STEP",description:t,statements:b(e.statements)};return typeof e.reference_id=="number"&&(i.reference_id=e.reference_id),i}function Se(e){let t=typeof e.action=="string"?e.action:String(e.action),i=typeof e.desc=="string"?e.desc:"",r=typeof e.locator=="string"?e.locator:void 0,o=typeof e.xpath=="string"?e.xpath:void 0,n=typeof e.use_pure_vision=="boolean"?e.use_pure_vision:void 0,c={};for(let[d,p]of Object.entries(e))At.has(d)||(c[d]=p);let s={action_description:i,action_data:{action_name:t,kwargs:Object.keys(c).length>0?c:{}}};r&&(s.locator=r),o&&(s.xpath=o);let l={uid:(0,T.v4)(),type:"ACTION",description:i,action_entity:s};return n&&(l.use_pure_vision=!0),l}var P,T,Te,_e,At,R=g(()=>{"use strict";J();P=require("yaml"),T=require("uuid");Te={lineWidth:120,defaultKeyType:"PLAIN",defaultStringType:"PLAIN"};_e=1024*1024;At=new Set(["action","desc","locator","xpath","use_pure_vision"])});var Me,Pe=g(()=>{"use strict";R();Me=require("yaml")});var U=g(()=>{"use strict"});var Ee=g(()=>{"use strict";R();U()});var xe=g(()=>{"use strict";U()});var $e=g(()=>{"use strict"});var Oe=g(()=>{"use strict"});var Ie=g(()=>{"use strict"});var Le=g(()=>{"use strict"});var Ce=g(()=>{"use strict";G()});var I=g(()=>{"use strict";oe();ne();se();ae();he();de();Pe();Ee();R();J();xe();U();$e();Oe();Ie();Le();Ce();G()});function $t(e){let t=e.frame_path;return!t||t.length===0?"page":`page.frameLocator('${t[0]}')`}function Ot(e){let t=e.xpath;return typeof t=="string"&&t.trim()?!t.startsWith("xpath=")&&!t.startsWith("/")&&!t.startsWith("//")?`xpath=//${t}`:t.startsWith("xpath=")?t:`xpath=${t}`:null}function Fe(e){let t=$t(e),i=e.locator;if(typeof i=="string"&&i.trim())return i=i.trim(),i.endsWith("first()")?`${t}.${i}`:`${t}.${i}.first()`;let r=Ot(e);if(r){let o=JSON.stringify(r);return`${t}.locator(${o}).first()`}return null}function u(e,t){w.set(e,t)}function E(e,t,i=[]){let r=[...i];return t.locator?r.push(`locator: ${JSON.stringify(t.locator)}`):t.xpath&&r.push(`xpath: ${JSON.stringify(t.xpath)}`),t.frame_path&&t.frame_path.length>0&&r.push(`frame_path: ${JSON.stringify(t.frame_path)}`),r.length===0?[`await agent.execAction("${e}", page, {});`]:[`await agent.execAction("${e}", page, {`,...r.map(o=>` ${o},`),"});"]}function De(e){let t=e.functionName;if(!t)return null;let i=Array.isArray(e.args)?e.args.map(String):[];if(i.length===0)return`await ${t}()`;let r=["page","testContext","request","agent"],o=["undefined","null","true","false"],n=i.map(c=>r.includes(c)||o.includes(c)||/^-?\d+(\.\d+)?$/.test(c)?c:c.startsWith("$")?`agent.agentServices.readVariable('${c.substring(1)}')`:`"${c}"`);return`await ${t}(${n.join(", ")})`}function Ge(e,t){let i={expandingPaths:new Set([(0,W.resolve)(t)]),depth:0,referencedPaths:new Set},r={...e};Array.isArray(r.statements)&&(r.statements=k(r.statements,t,i)),Array.isArray(r.teardown)&&(r.teardown=k(r.teardown,t,i));for(let o of["beforeAll","afterAll","beforeEach","afterEach"])Array.isArray(r[o])&&(r[o]=k(r[o],t,i));return{doc:r,referencedTemplatePaths:Array.from(i.referencedPaths)}}function k(e,t,i){let r=[];for(let o of e)if(It(o)){let n=Lt(o,t,i);r.push(...n)}else r.push(Ct(o,t,i));return r}function It(e){return typeof e=="object"&&e!==null&&typeof e.template=="string"}function Lt(e,t,i){if(i.depth>=Ne)throw new Error(`Template expansion exceeded maximum depth of ${Ne}. Check for deeply nested or circular template references.`);let r=(0,W.resolve)((0,W.dirname)(t),e.template);if(i.expandingPaths.has(r))throw new Error(`Circular template reference detected: ${r} is already being expanded. Stack: ${Array.from(i.expandingPaths).join(" \u2192 ")} \u2192 ${r}`);i.referencedPaths.add(r);let o;try{o=(0,He.readFileSync)(r,"utf-8")}catch(p){throw new Error(`Failed to read template file: ${r} (referenced from ${t}): ${p.message}`)}let n=(0,D.parse)(o);if(!n||typeof n!="object")throw new Error(`Invalid template file: ${r} \u2014 expected a YAML object`);let c=n.params||[],s=e.params||{};for(let p of c)if(!(p in s))throw new Error(`Template ${e.template} requires param "${p}" but it was not provided. Required params: [${c.join(", ")}]`);let l=n.statements;if(!Array.isArray(l))throw new Error(`Template ${e.template} must have a "statements" array`);if(Object.keys(s).length>0){let f=(0,D.stringify)(l);for(let[M,m]of Object.entries(s))f=f.split(`<<${M}>>`).join(String(m));l=(0,D.parse)(f)}let d={expandingPaths:new Set([...i.expandingPaths,r]),depth:i.depth+1,referencedPaths:i.referencedPaths};return k(l,r,d)}function Ct(e,t,i){if(typeof e!="object"||e===null)return e;let r={...e};return Array.isArray(r.statements)&&(r.statements=k(r.statements,t,i)),Array.isArray(r.THEN)&&(r.THEN=k(r.THEN,t,i)),Array.isArray(r.ELSE)&&(r.ELSE=k(r.ELSE,t,i)),Array.isArray(r.DO)&&(r.DO=k(r.DO,t,i)),r}function Ke(e,t){let i=(0,N.parse)(e),r=i?.name,o=i?.tags,n=i?.use;if(i&&(i.name!==void 0||i.tags!==void 0||i.use!==void 0)&&(delete i.name,delete i.tags,delete i.use),i?.suite){if(i.goal||i.statements)throw new Error('YAML file cannot have both "suite" and top-level "goal"/"statements". Use either suite format or single-test format.');return Nt(i,r,o,n,t)}return Dt(i,r,o,n,t)}function Dt(e,t,i,r,o){let n=e?.beforeEach,c=e?.afterEach,s=Be(e?.parameters),l=e?.timeout,d=e?.skip,p=e?.fail,f=e?.only,M=e?.slow;e&&(delete e.beforeEach,delete e.afterEach,delete e.parameters,delete e.timeout,delete e.skip,delete e.fail,delete e.only,delete e.slow),e&&!e.goal&&t&&(e.goal=t);let m=[];if(o&&e&&typeof e=="object"){let L=Ge(e,o);e=L.doc,m=L.referencedTemplatePaths}let h=(0,N.stringify)(e);return{testFlow:A(h),name:t,tags:i,use:r,beforeEach:n,afterEach:c,parameters:s,timeout:l,skip:d,fail:p,only:f,slow:M,referencedTemplatePaths:m}}function Nt(e,t,i,r,o){let n=e.suite;if(!Array.isArray(n.tests)||n.tests.length===0)throw new Error('Suite must have a non-empty "tests" array.');let c=n.beforeAll,s=n.afterAll,l=n.beforeEach,d=n.afterEach,p=[],f=n.tests.map(h=>{if(!h.name)throw new Error('Each test in a suite must have a "name" field.');if(!Array.isArray(h.statements)||h.statements.length===0)throw new Error(`Suite test "${h.name}" must have a non-empty "statements" array.`);let y={goal:h.name,statements:h.statements};h.teardown&&(y.teardown=h.teardown);let L=[],Z=y;if(o&&typeof y=="object"){let Q=Ge(y,o);Z=Q.doc,L=Q.referencedTemplatePaths,p.push(...L)}let et=(0,N.stringify)(Z),tt=A(et),it=Be(h.parameters);return{testFlow:tt,name:h.name,parameters:it,timeout:h.timeout,skip:h.skip,fail:h.fail,only:h.only,slow:h.slow}}),M=n.base_url,m=M?{...r,baseURL:M}:r;return{suite:{beforeAll:c,afterAll:s,beforeEach:l,afterEach:d,tests:f},name:t,tags:i,use:m,referencedTemplatePaths:p}}function Be(e){if(!(!Array.isArray(e)||e.length===0))return e.map((t,i)=>{if(!t.name)throw new Error(`Parameter set at index ${i} must have a "name" field.`);if(!t.values||typeof t.values!="object")throw new Error(`Parameter set "${t.name}" must have a "values" object.`);return{name:t.name,values:t.values}})}var xt,N,He,W,D,We,w,Ne,Re=g(()=>{"use strict";I();xt=require("yaml");I();N=require("yaml");I();He=require("fs"),W=require("path"),D=require("yaml");I();We=1e4;w=new Map;u("click",e=>{let t=Fe(e);return t?[`await ${t}.click({ timeout: ${We} });`]:['await agent.execAction("click", page, {});']});u("click_element",w.get("click"));u("click_element_by_index",w.get("click"));u("double_click",e=>E("double_click",e));u("double_click_on_element",w.get("double_click"));u("right_click",e=>E("right_click",e));u("right_click_on_element",w.get("right_click"));u("hover",e=>E("hover",e));u("hover_element_by_index",w.get("hover"));u("input_text",e=>{let t=e.action_data?.kwargs?.text??e.action_data?.kwargs?.value??"";return E("input_text",e,[`action_data: { kwargs: { text: ${JSON.stringify(t)} } }`])});u("fill",w.get("input_text"));u("clear_input",e=>E("clear_input",e));u("press",e=>{let t=e.action_data?.kwargs?.keys;return[`await page.keyboard.press(${JSON.stringify(t)});`]});u("send_keys",w.get("press"));u("send_keys_on_element",e=>{let t=Fe(e),i=e.action_data?.kwargs?.keys||"";return t?[`await ${t}.press(${JSON.stringify(i)}, { timeout: ${We} });`]:['await agent.execAction("send_keys_on_element", page, {',` action_data: { kwargs: { keys: ${JSON.stringify(i)} } },`,"});"]});u("select_dropdown_option",e=>{let t=e.action_data?.kwargs?.text||e.action_data?.kwargs?.option||"";return E("select_dropdown_option",e,[`action_data: { kwargs: { text: ${JSON.stringify(t)} } }`])});u("scroll",e=>{let t=e.action_data?.kwargs?.down??!0;return[`await page.evaluate('window.scrollBy(0, window.innerHeight * ${(e.action_data?.kwargs?.num_pages??1)*(t?1:-1)})');`]});u("scroll_down",w.get("scroll"));u("scroll_up",w.get("scroll"));u("scroll_element",w.get("scroll"));u("scroll_to_text",e=>{let t=e.action_data?.kwargs?.text||"";return[`await page.getByText(${JSON.stringify(t)}, { exact: false }).first().scrollIntoViewIfNeeded();`]});u("scroll_on_element",e=>E("scroll_on_element",e,[`action_data: { kwargs: ${JSON.stringify(e.action_data?.kwargs||{})} }`]));u("go_to_url",e=>{let t=e.action_data?.kwargs?.url||"";return e.action_data?.kwargs?.new_tab===!0?['await agent.execAction("go_to_url", page, {',` action_data: { kwargs: { url: ${JSON.stringify(t)}, new_tab: true } },`,"});"]:['await agent.execAction("go_to_url", page, {',` action_data: { kwargs: { url: ${JSON.stringify(t)} } },`,"});"]});u("open_tab",w.get("go_to_url"));u("go_back",()=>['await agent.execAction("go_back", page, {});']);u("reload_page",()=>['await agent.execAction("reload_page", page, {});']);u("wait",e=>[`await page.waitForTimeout(${(e.action_data?.kwargs?.seconds||1)*1e3});`]);u("wait_for_page_ready",()=>["await page.waitForLoadState('domcontentloaded');"]);u("verify",(e,t)=>{let i=e.action_data?.kwargs,r=typeof i?.code=="string",o=r?i?.statement||e.action_description:e.action_description||i?.statement;if(r&&o){let c=i.code.split(`
2
+ `),s=JSON.stringify(o);return["{ const _t = Date.now(); try {",...c.map(l=>` ${l}`),` console.log(\`[VERIFY:JS] \u2713 \${((Date.now()-_t)/1000).toFixed(1)}s: ${s}\`);`,"} catch (_e) {",` console.log(\`[VERIFY:JS\u2192AI] JS failed \${((Date.now()-_t)/1000).toFixed(1)}s: (\${_e instanceof Error ? _e.message : String(_e)}), falling back to AI: ${s}\`);`,` await agent.assert(page, ${s}, ${JSON.stringify(t||"")});`,"} }"]}return r?i.code.split(`
3
3
  `):o?[`await agent.assert(page, ${JSON.stringify(o)}, ${JSON.stringify(t||"")});`]:["// Skipping verify: missing statement or code"]});u("ai_assert",w.get("verify"));u("assert",w.get("verify"));u("ai_action",(e,t)=>{let i=e.action_data?.kwargs?.statement;if(!i)return["// Skipping ai_action: missing statement"];let r=JSON.stringify(i),o=e.action_data?.kwargs?.use_pure_vision;return[`await agent.execute(page, ${r}, '${t||""}', ${o});`]});u("ai_step",(e,t)=>{let i=e.action_data?.kwargs?.statement;return i?[`await agent.run(page, ${JSON.stringify(i)}, '${t||""}');`]:["// Skipping ai_step: missing statement"]});u("ai_extract",(e,t)=>{let i=e.action_data?.kwargs?.element_description,r=e.action_data?.kwargs?.variable_name;if(!i||!r)return["// Skipping ai_extract: missing element_description or variable_name"];let o=JSON.stringify(i),n=JSON.stringify(r);return[`await agent.extract(page, ${o}, ${n}, '${t||""}');`]});u("ai_wait_until",(e,t)=>{let i=e.action_data?.kwargs?.condition,r=e.action_data?.kwargs?.timeout_seconds||60;return i?[`await agent.waitUntilCondition(page, ${JSON.stringify(i)}, ${r}, '${t||""}');`]:["// Skipping ai_wait_until: missing condition"]});u("save_variable",e=>{let t=e.action_data?.kwargs?.name||"",i=e.action_data?.kwargs?.value;return['await agent.execAction("save_variable", page, {',` action_data: { kwargs: { name: ${JSON.stringify(t)}, value: ${JSON.stringify(i)} } },`,"});"]});u("js_code",e=>{let t=e.action_data?.kwargs?.code;if(!t)return["// Skipping js_code: missing code"];let i=["{"],r=t.split(`
4
- `);for(let o of r)i.push(` ${o}`);return i.push("}"),i});u("function",(e,t,i)=>{let r=e.action_data?.kwargs||{},o=r.functionName;if(o&&o.includes("#")){let[s,a]=o.split("#");if(s&&a){let l=s.replace(/\.(ts|js|mjs)$/,""),d=`import { ${a} } from '${l}';`;i?.imports?.add(d);let p={...r,functionName:a},g=$e(p);return g?[g.endsWith(";")?g:`${g};`]:["// Skipping function: invalid export pattern"]}}let n=$e(r);return n?[n.endsWith(";")?n:`${n};`]:["// Skipping function: missing functionName"]});u("generate_2fa_code",e=>{let t=e.action_data?.kwargs?.otp_secret_key||"";return['await agent.execAction("generate_2fa_code", page, {',` action_data: { kwargs: { otp_secret_key: ${JSON.stringify(t)} } },`,"});"]});u("upload_file",e=>{let t=e.action_data?.kwargs||{},i=[],r={};return t.paths?r.paths=t.paths:t.path&&(r.path=t.path),t.use_file_input&&(r.use_file_input=!0),i.push(`action_data: { kwargs: ${JSON.stringify(r)} }`),e.locator?i.push(`locator: ${JSON.stringify(e.locator)}`):e.xpath&&i.push(`xpath: ${JSON.stringify(e.xpath)}`),e.frame_path&&e.frame_path.length>0&&i.push(`frame_path: ${JSON.stringify(e.frame_path)}`),['await agent.execAction("upload_file", page, {',...i.map(o=>` ${o},`),"});"]});u("wait_for_download_complete",e=>['await agent.execAction("wait_for_download_complete", page, {',` action_data: { kwargs: { timeout_seconds: ${e.action_data?.kwargs?.timeout_seconds||10} } },`,"});"]);u("switch_tab",e=>['await agent.execAction("switch_tab", page, {',` action_data: { kwargs: { page_id: ${e.action_data?.kwargs?.page_id??0} } },`,"});"]);u("close_tab",e=>{let t=e.action_data?.kwargs?.page_id;return t=t??e.action_data?.kwargs?.index,['await agent.execAction("close_tab", page, {',` action_data: { kwargs: { page_id: ${t} } },`,"});"]});u("set_date_for_native_date_picker",e=>{let t=e.action_data?.kwargs?.date??"",i=[];return i.push(`action_data: { kwargs: { date: ${JSON.stringify(t)} } }`),e.locator?i.push(`locator: ${JSON.stringify(e.locator)}`):e.xpath&&i.push(`xpath: ${JSON.stringify(e.xpath)}`),e.frame_path&&e.frame_path.length>0&&i.push(`frame_path: ${JSON.stringify(e.frame_path)}`),['await agent.execAction("set_date_for_native_date_picker", page, {',...i.map(r=>` ${r},`),"});"]});u("done",()=>["// Done - no action needed"]);u("js_action",e=>{let t=e.action_data?.kwargs?.code;return t?t.split(`
5
- `):["// Skipping js_action: missing code"]});Oe=5});var Ge={};F(Ge,{createTestFlowRouter:()=>It});function R(e){if(!e||e.length===0)return[];let t=(0,Ke.stringify)({goal:"_hook",statements:e});return S(t).statements}function It(e){let t=(0,He.Router)();return t.get("/api/test-flow",async(i,r)=>{try{let o=await b.readFile(e,"utf-8"),n=J(o),s=De(o,e),a=await b.stat(e);s.suite?r.json({isSuite:!0,suite:{beforeAll:R(s.suite.beforeAll),afterAll:R(s.suite.afterAll),beforeEach:R(s.suite.beforeEach),afterEach:R(s.suite.afterEach),tests:s.suite.tests.map(l=>({name:l.name,testFlow:l.testFlow,skip:l.skip,timeout:l.timeout,fail:l.fail,only:l.only,slow:l.slow}))},metadata:n,name:s.name,tags:s.tags,use:s.use,filePath:e,fileName:Y.basename(e),lastModified:a.mtimeMs}):r.json({testFlow:s.testFlow,metadata:n,filePath:e,fileName:Y.basename(e),lastModified:a.mtimeMs})}catch(o){if(o.code==="ENOENT")return r.status(404).json({error:`File not found: ${e}`});console.error("[debugger] Error loading test flow:",o),r.status(500).json({error:o.message})}}),t.put("/api/test-flow",async(i,r)=>{try{let{testFlow:o,metadata:n}=i.body;if(!o)return r.status(400).json({error:"testFlow is required"});let s=K(o,n),a=e+".tmp";await b.writeFile(a,s,"utf-8"),await b.rename(a,e);let l=await b.stat(e);r.json({success:!0,lastModified:l.mtimeMs})}catch(o){console.error("[debugger] Error saving test flow:",o),r.status(500).json({error:o.message})}}),t}var He,b,Y,Ke,Be=f(()=>{"use strict";He=require("express"),b=v(require("fs/promises"),1),Y=v(require("path"),1);O();Ke=require("yaml");Fe()});var je={};F(je,{createIntRunnerRouter:()=>Lt});function Lt(e){let t=(0,Re.Router)();return t.post("/api/int-runner/create-session",async(i,r)=>{try{let o=i.body.startingUrl||i.body.testFlow?.url||i.body.urlOverride,n=await e.createSession({startingUrl:o});r.json({status:"success",sessionId:n.sessionId,searchParams:""})}catch(o){console.error("[debugger] create-session error:",o),r.status(500).json({status:"error",message:o.message})}}),t.post("/api/int-runner/login",async(i,r)=>{try{let{session:o}=i.body;if(!o?.sessionId)return r.status(400).json({status:"error",message:"Missing session"});let n=await e.executeLogin(o.sessionId);r.json(n)}catch(o){console.error("[debugger] login error:",o),r.status(500).json({status:"error",details:o.message})}}),t.post("/api/int-runner/liveview-url",async(i,r)=>{let{session:o}=i.body;if(!o?.sessionId)return r.status(400).json({status:"error",message:"Missing session"});r.json({liveviewUrl:"",browserWsUrl:""})}),t.post("/api/int-runner/end-debug",async(i,r)=>{let{session:o}=i.body;if(!o?.sessionId)return r.status(400).json({status:"error",message:"Missing session"});r.json({status:"success"})}),t.post("/api/int-runner/start-debug",async(i,r)=>{try{let{session:o}=i.body;if(!o?.sessionId)return r.status(400).json({status:"error",message:"Missing session"});let n=await e.startDebug(o.sessionId);r.json({status:"success",...n})}catch(o){console.error("[debugger] start-debug error:",o),r.status(500).json({status:"error",message:o.message})}}),t.post("/api/int-runner/execute-action",async(i,r)=>{try{let{session:o,actionEntity:n,stepId:s,withSelfHealing:a,stmtUid:l,executionHistory:d}=i.body;if(!o?.sessionId||!n)return r.status(400).json({status:"error",message:"Missing session or actionEntity"});let p=await e.executeAction(o.sessionId,n,s,{withSelfHealing:a,stmtUid:l,executionHistory:d});r.json(p)}catch(o){console.error("[debugger] execute-action error:",o),r.status(500).json({status:"error",details:o.message})}}),t.post("/api/int-runner/run-step",async(i,r)=>{let{session:o,statement:n,stepId:s,executionHistory:a}=i.body;if(!o?.sessionId||!n)return r.status(400).json({success:!1,message:"Session and statement required"});r.setHeader("Content-Type","text/event-stream"),r.setHeader("Cache-Control","no-cache"),r.setHeader("Connection","keep-alive"),r.flushHeaders();let l=d=>{r.write(`data: ${JSON.stringify(d)}
4
+ `);for(let o of r)i.push(` ${o}`);return i.push("}"),i});u("function",(e,t,i)=>{let r=e.action_data?.kwargs||{},o=r.functionName;if(o&&o.includes("#")){let[c,s]=o.split("#");if(c&&s){let l=c.replace(/\.(ts|js|mjs)$/,""),d=`import { ${s} } from '${l}';`;i?.imports?.add(d);let p={...r,functionName:s},f=De(p);return f?[f.endsWith(";")?f:`${f};`]:["// Skipping function: invalid export pattern"]}}let n=De(r);return n?[n.endsWith(";")?n:`${n};`]:["// Skipping function: missing functionName"]});u("generate_2fa_code",e=>{let t=e.action_data?.kwargs?.otp_secret_key||"";return['await agent.execAction("generate_2fa_code", page, {',` action_data: { kwargs: { otp_secret_key: ${JSON.stringify(t)} } },`,"});"]});u("upload_file",e=>{let t=e.action_data?.kwargs||{},i=[],r={};return t.paths?r.paths=t.paths:t.path&&(r.path=t.path),t.use_file_input&&(r.use_file_input=!0),i.push(`action_data: { kwargs: ${JSON.stringify(r)} }`),e.locator?i.push(`locator: ${JSON.stringify(e.locator)}`):e.xpath&&i.push(`xpath: ${JSON.stringify(e.xpath)}`),e.frame_path&&e.frame_path.length>0&&i.push(`frame_path: ${JSON.stringify(e.frame_path)}`),['await agent.execAction("upload_file", page, {',...i.map(o=>` ${o},`),"});"]});u("wait_for_download_complete",e=>['await agent.execAction("wait_for_download_complete", page, {',` action_data: { kwargs: { timeout_seconds: ${e.action_data?.kwargs?.timeout_seconds||10} } },`,"});"]);u("switch_tab",e=>['await agent.execAction("switch_tab", page, {',` action_data: { kwargs: { page_id: ${e.action_data?.kwargs?.page_id??e.action_data?.kwargs?.tab_index??0} } },`,"});"]);u("close_tab",e=>{let t=e.action_data?.kwargs?.page_id;return t=t??e.action_data?.kwargs?.index,['await agent.execAction("close_tab", page, {',` action_data: { kwargs: { page_id: ${t} } },`,"});"]});u("set_date_for_native_date_picker",e=>{let t=e.action_data?.kwargs?.date??"",i=[];return i.push(`action_data: { kwargs: { date: ${JSON.stringify(t)} } }`),e.locator?i.push(`locator: ${JSON.stringify(e.locator)}`):e.xpath&&i.push(`xpath: ${JSON.stringify(e.xpath)}`),e.frame_path&&e.frame_path.length>0&&i.push(`frame_path: ${JSON.stringify(e.frame_path)}`),['await agent.execAction("set_date_for_native_date_picker", page, {',...i.map(r=>` ${r},`),"});"]});u("done",()=>["// Done - no action needed"]);u("js_action",e=>{let t=e.action_data?.kwargs?.code;return t?t.split(`
5
+ `):["// Skipping js_action: missing code"]});Ne=5});var Ve={};H(Ve,{createTestFlowRouter:()=>Wt});function j(e){if(!e||e.length===0)return[];let i=(0,je.stringify)({goal:"_hook",statements:e});return A(i).statements??[]}function Wt(e){let t=(0,Ue.Router)();return t.get("/api/test-flow",async(i,r)=>{try{let o=await v.readFile(e,"utf-8"),n=await v.stat(e),c=Y(o),s=Ke(o,e);if(s.suite){let l=s.suite,d={tests:l.tests.map(f=>({name:f.name,statements:f.testFlow.statements??[],teardown:f.testFlow.teardown,skip:f.skip,timeout:f.timeout,fail:f.fail,only:f.only,slow:f.slow})),beforeAll:j(l.beforeAll),afterAll:j(l.afterAll),beforeEach:j(l.beforeEach),afterEach:j(l.afterEach)},p={version:"1.3.0",baseURL:s.use?.baseURL,testGroup:d};r.json({isSuite:!0,testFlow:p,metadata:c,name:s.name,tags:s.tags,use:s.use,filePath:e,fileName:X.basename(e),lastModified:n.mtimeMs})}else{let l=s.testFlow;r.json({isSuite:!1,testFlow:l,metadata:c,name:s.name,tags:s.tags,use:s.use,filePath:e,fileName:X.basename(e),lastModified:n.mtimeMs})}}catch(o){if(o.code==="ENOENT")return r.status(404).json({error:`File not found: ${e}`});console.error("[debugger] Error loading test flow:",o),r.status(500).json({error:o.message})}}),t.put("/api/test-flow",async(i,r)=>{try{let{testFlow:o,metadata:n}=i.body;if(!o)return r.status(400).json({error:"testFlow is required"});let c=B(o,n),s=e+".tmp";await v.writeFile(s,c,"utf-8"),await v.rename(s,e);let l=await v.stat(e);r.json({success:!0,lastModified:l.mtimeMs})}catch(o){console.error("[debugger] Error saving test flow:",o),r.status(500).json({error:o.message})}}),t}var Ue,v,X,je,ze=g(()=>{"use strict";Ue=require("express"),v=x(require("fs/promises"),1),X=x(require("path"),1);I();Re();je=require("yaml")});var Ye={};H(Ye,{createIntRunnerRouter:()=>Ft});function Ft(e){let t=(0,Je.Router)();return t.get("/api/browser-cdp",async(i,r)=>{let o=e.getCdpEndpoint();if(!o&&typeof e.fetchCdpEndpoint=="function"&&(o=await e.fetchCdpEndpoint()),!o)return r.status(404).json({error:"No browser running. Start a debug session first."});r.json({cdpUrl:o})}),t.post("/api/int-runner/create-session",async(i,r)=>{try{let o=i.body.startingUrl||i.body.testFlow?.url||i.body.urlOverride,n=await e.createSession({startingUrl:o});r.json({status:"success",sessionId:n.sessionId,searchParams:""})}catch(o){console.error("[debugger] create-session error:",o),r.status(500).json({status:"error",message:o.message})}}),t.post("/api/int-runner/login",async(i,r)=>{try{let{session:o}=i.body;if(!o?.sessionId)return r.status(400).json({status:"error",message:"Missing session"});let n=await e.executeLogin(o.sessionId);r.json(n)}catch(o){console.error("[debugger] login error:",o),r.status(500).json({status:"error",details:o.message})}}),t.post("/api/int-runner/liveview-url",async(i,r)=>{let{session:o}=i.body;if(!o?.sessionId)return r.status(400).json({status:"error",message:"Missing session"});r.json({liveviewUrl:"",browserWsUrl:""})}),t.post("/api/int-runner/end-debug",async(i,r)=>{let{session:o}=i.body;if(!o?.sessionId)return r.status(400).json({status:"error",message:"Missing session"});r.json({status:"success"})}),t.post("/api/int-runner/start-debug",async(i,r)=>{try{let{session:o}=i.body;if(!o?.sessionId)return r.status(400).json({status:"error",message:"Missing session"});let n=await e.startDebug(o.sessionId);r.json({status:"success",...n})}catch(o){console.error("[debugger] start-debug error:",o),r.status(500).json({status:"error",message:o.message})}}),t.post("/api/int-runner/execute-action",async(i,r)=>{try{let{session:o,actionEntity:n,stepId:c,withSelfHealing:s,stmtUid:l,executionHistory:d}=i.body;if(!o?.sessionId||!n)return r.status(400).json({status:"error",message:"Missing session or actionEntity"});let p=await e.executeAction(o.sessionId,n,c,{withSelfHealing:s,stmtUid:l,executionHistory:d});r.json(p)}catch(o){console.error("[debugger] execute-action error:",o),r.status(500).json({status:"error",details:o.message})}}),t.post("/api/int-runner/run-step",async(i,r)=>{let{session:o,statement:n,stepId:c,executionHistory:s}=i.body;if(!o?.sessionId||!n)return r.status(400).json({success:!1,message:"Session and statement required"});r.setHeader("Content-Type","text/event-stream"),r.setHeader("Cache-Control","no-cache"),r.setHeader("Connection","keep-alive"),r.flushHeaders();let l=d=>{r.write(`data: ${JSON.stringify(d)}
6
6
 
7
- `)};try{await e.runStep(o.sessionId,n,s,l,a)}catch(d){l({type:"error",data:{message:d.message}})}finally{r.end()}}),t.post("/api/int-runner/execute-step",async(i,r)=>{let{session:o,statement:n,stepId:s,executionHistory:a,maxSteps:l}=i.body;if(!o?.sessionId||!n)return r.status(400).json({success:!1,message:"Session and statement required"});r.setHeader("Content-Type","text/event-stream"),r.setHeader("Cache-Control","no-cache"),r.setHeader("Connection","keep-alive"),r.flushHeaders();let d=p=>{r.write(`data: ${JSON.stringify(p)}
7
+ `)};try{await e.runStep(o.sessionId,n,c,l,s)}catch(d){l({type:"error",data:{message:d.message}})}finally{r.end()}}),t.post("/api/int-runner/execute-step",async(i,r)=>{let{session:o,statement:n,stepId:c,executionHistory:s,maxSteps:l}=i.body;if(!o?.sessionId||!n)return r.status(400).json({success:!1,message:"Session and statement required"});r.setHeader("Content-Type","text/event-stream"),r.setHeader("Cache-Control","no-cache"),r.setHeader("Connection","keep-alive"),r.flushHeaders();let d=p=>{r.write(`data: ${JSON.stringify(p)}
8
8
 
9
- `)};try{await e.runStep(o.sessionId,n,s,d,a)}catch(p){d({type:"error",data:{message:p.message}})}finally{r.end()}}),t.post("/api/int-runner/stop-run-step",async(i,r)=>{try{let{session:o}=i.body;if(!o?.sessionId)return r.status(400).json({status:"error",message:"Missing session"});let n=e.stopRunStep(o.sessionId);r.json({status:"success",aborted:n})}catch(o){console.error("[debugger] stop-run-step error:",o),r.status(500).json({status:"error",aborted:!1,details:o.message})}}),t.post("/api/int-runner/evaluate",async(i,r)=>{try{let{session:o,statement:n,stepId:s,executionHistory:a}=i.body;if(!o?.sessionId||!n)return r.status(400).json({status:"error",message:"Missing session or statement"});let l=await e.evaluate(o.sessionId,n,a);r.json(l)}catch(o){console.error("[debugger] evaluate error:",o),r.status(500).json({status:"error",conclusion:"unknown",explanation:o.message})}}),t.post("/api/int-runner/generate-action",async(i,r)=>{try{let{session:o,statement:n,stepId:s,executionHistory:a,usePureVision:l,includeDebugInfo:d}=i.body;if(!o?.sessionId||!n)return r.status(400).json({status:"error",message:"Missing session or statement"});let p=await e.generateAction(o.sessionId,n,s,{executionHistory:a,usePureVision:l,includeDebugInfo:d});r.json(p)}catch(o){console.error("[debugger] generate-action error:",o),r.status(500).json({status:"error",details:o.message})}}),t.post("/api/int-runner/screenshot",async(i,r)=>{try{let{session:o}=i.body;if(!o?.sessionId)return r.status(400).json({status:"error",message:"Missing session"});let n=await e.takeScreenshot(o.sessionId);r.json({status:"success",...n})}catch(o){console.error("[debugger] screenshot error:",o),r.status(500).json({status:"error",message:o.message})}}),t.post("/api/int-runner/terminate-session",async(i,r)=>{try{let{session:o}=i.body;if(!o?.sessionId)return r.status(400).json({status:"error",message:"Missing session"});await e.terminateSession(o.sessionId),r.json({status:"success",details:`Session ${o.sessionId} terminated`})}catch(o){console.error("[debugger] terminate-session error:",o),r.status(500).json({status:"error",details:o.message})}}),t.post("/api/int-runner/session-status",async(i,r)=>{let{session:o}=i.body;if(!o?.sessionId)return r.status(400).json({status:"timed_out"});r.json({status:"active",remainingSeconds:9999})}),t}var Re,Ue=f(()=>{"use strict";Re=require("express")});var ze={};F(ze,{createCopilotRouter:()=>Ct});function Ct(e){let t=(0,Ve.Router)();return t.post("/api/int-runner/copilot/init",async(i,r)=>{try{let{session:o,initialTestFlow:n}=i.body;if(!o?.sessionId)return r.status(400).json({success:!1,message:"Missing session"});await e.initializeCopilot(o.sessionId,n),r.json({success:!0,status:"success"})}catch(o){console.error("[debugger] copilot/init error:",o),r.status(500).json({success:!1,message:o.message})}}),t.post("/api/int-runner/copilot/send",async(i,r)=>{let{session:o,message:n,testFlow:s}=i.body;if(!o?.sessionId||!n)return r.status(400).json({success:!1,message:"Session and message required"});r.setHeader("Content-Type","text/event-stream"),r.setHeader("Cache-Control","no-cache"),r.setHeader("Connection","keep-alive"),r.flushHeaders();let a=l=>{r.write(`data: ${JSON.stringify(l)}
9
+ `)};try{await e.runStep(o.sessionId,n,c,d,s)}catch(p){d({type:"error",data:{message:p.message}})}finally{r.end()}}),t.post("/api/int-runner/stop-run-step",async(i,r)=>{try{let{session:o}=i.body;if(!o?.sessionId)return r.status(400).json({status:"error",message:"Missing session"});let n=e.stopRunStep(o.sessionId);r.json({status:"success",aborted:n})}catch(o){console.error("[debugger] stop-run-step error:",o),r.status(500).json({status:"error",aborted:!1,details:o.message})}}),t.post("/api/int-runner/evaluate",async(i,r)=>{try{let{session:o,statement:n,stepId:c,executionHistory:s}=i.body;if(!o?.sessionId||!n)return r.status(400).json({status:"error",message:"Missing session or statement"});let l=await e.evaluate(o.sessionId,n,s);r.json(l)}catch(o){console.error("[debugger] evaluate error:",o),r.status(500).json({status:"error",conclusion:"unknown",explanation:o.message})}}),t.post("/api/int-runner/generate-action",async(i,r)=>{try{let{session:o,statement:n,stepId:c,executionHistory:s,usePureVision:l,includeDebugInfo:d}=i.body;if(!o?.sessionId||!n)return r.status(400).json({status:"error",message:"Missing session or statement"});let p=await e.generateAction(o.sessionId,n,c,{executionHistory:s,usePureVision:l,includeDebugInfo:d});r.json(p)}catch(o){console.error("[debugger] generate-action error:",o),r.status(500).json({status:"error",details:o.message})}}),t.post("/api/int-runner/screenshot",async(i,r)=>{try{let{session:o}=i.body;if(!o?.sessionId)return r.status(400).json({status:"error",message:"Missing session"});let n=await e.takeScreenshot(o.sessionId);r.json({status:"success",...n})}catch(o){console.error("[debugger] screenshot error:",o),r.status(500).json({status:"error",message:o.message})}}),t.post("/api/int-runner/terminate-session",async(i,r)=>{try{let{session:o}=i.body;if(!o?.sessionId)return r.status(400).json({status:"error",message:"Missing session"});await e.terminateSession(o.sessionId),r.json({status:"success",details:`Session ${o.sessionId} terminated`})}catch(o){console.error("[debugger] terminate-session error:",o),r.status(500).json({status:"error",details:o.message})}}),t.post("/api/int-runner/session-status",async(i,r)=>{let{session:o}=i.body;if(!o?.sessionId)return r.status(400).json({status:"timed_out"});r.json({status:"active",remainingSeconds:9999})}),t}var Je,Xe=g(()=>{"use strict";Je=require("express")});var Ze={};H(Ze,{createCopilotRouter:()=>Ht});function Ht(e){let t=(0,qe.Router)();return t.post("/api/int-runner/copilot/init",async(i,r)=>{try{let{session:o,initialTestFlow:n}=i.body;if(!o?.sessionId)return r.status(400).json({success:!1,message:"Missing session"});await e.initializeCopilot(o.sessionId,n),r.json({success:!0,status:"success"})}catch(o){console.error("[debugger] copilot/init error:",o),r.status(500).json({success:!1,message:o.message})}}),t.post("/api/int-runner/copilot/send",async(i,r)=>{let{session:o,message:n,testFlow:c}=i.body;if(!o?.sessionId||!n)return r.status(400).json({success:!1,message:"Session and message required"});r.setHeader("Content-Type","text/event-stream"),r.setHeader("Cache-Control","no-cache"),r.setHeader("Connection","keep-alive"),r.flushHeaders();let s=l=>{r.write(`data: ${JSON.stringify(l)}
10
10
 
11
- `)};try{await e.sendCopilotMessage(o.sessionId,n,a,s)}catch(l){a({type:"copilot_message",data:{type:"error",message:l.message},sequenceNumber:0,timestamp:new Date().toISOString()})}finally{r.end()}}),t.post("/api/int-runner/copilot/abort",async(i,r)=>{try{let{session:o}=i.body;if(!o?.sessionId)return r.status(400).json({success:!1,message:"Missing session"});let n=e.abortCopilot(o.sessionId);r.json({success:!0,status:"success",aborted:n})}catch(o){console.error("[debugger] copilot/abort error:",o),r.status(500).json({success:!1,message:o.message})}}),t.post("/api/int-runner/copilot/status",async(i,r)=>{try{let{session:o}=i.body;if(!o?.sessionId)return r.status(400).json({status:"error",message:"Missing session"});let n=e.getCopilotTestFlow(o.sessionId);r.json({status:"success",copilotInitialized:!0,testFlow:n})}catch(o){r.status(500).json({status:"error",details:o.message})}}),t}var Ve,Je=f(()=>{"use strict";Ve=require("express")});var Dt={};F(Dt,{PlaywrightSandboxService:()=>M,startPlaywrightDebugServer:()=>Nt});module.exports=rt(Dt);var X=v(require("express"),1);var Q=v(require("path"),1),ee=v(require("fs/promises"),1),te=v(require("os"),1),M=class{page;agent;sessionId="pw-"+Math.random().toString(36).slice(2,10);abortController=null;constructor(t,i){this.page=t,this.agent=i}async createSession(t){return{sessionId:this.sessionId}}async executeLogin(t){return{status:"success",details:"Handled by Playwright"}}async ensureBrowser(t){return{page:this.page,liveviewUrl:""}}async startDebug(t){return{sessionId:this.sessionId,liveviewUrl:"",browserWsUrl:""}}async executeAction(t,i,r,o){let n=i.action_data||i.action;if(!n)throw new Error("ActionEntity has no action_data");if(console.error(`[pw-sandbox] executeAction stepId=${JSON.stringify(r)} action_name=${JSON.stringify(n.action_name)} locator=${JSON.stringify(i.locator)} kwargs=${JSON.stringify(n.kwargs)}`),n.action_name==="js_code"&&r==="prelude"){if(this.page.url()==="about:blank"){let l=n.kwargs?.code?.match(/PLAYWRIGHT_STARTING_URL \|\| '([^']*)'/)?.[1];l&&await this.page.goto(l,{waitUntil:"domcontentloaded"})}return{status:"success"}}let s=i.action_description||n.action_name;return{status:"success",...await this.agent.step(this.page,async()=>{await this.agent.execAction(n.action_name,this.page,i)},s,r,o?.stmtUid,!!o?.withSelfHealing)}}async runStep(t,i,r,o,n){let s=[],a={},l=this.agent._actionHandler;this.abortController=new AbortController;try{let d=await this.agent.execute(this.page,i,r,!1);return{success:d?.success??!0,actions:s,details:d?.details}}finally{this.abortController=null}}stopRunStep(t){return this.abortController?(this.abortController.abort(),!0):!1}async evaluate(t,i,r){try{let o=await this.agent.evaluate(this.page,i);return{status:"success",conclusion:o?"true":"false",explanation:o?`Condition met: ${i}`:`Condition not met: ${i}`}}catch(o){return{status:"error",conclusion:"unknown",explanation:o.message}}}async generateAction(t,i,r,o){return this.agent.generate(this.page,i,r,o?.usePureVision)}async takeScreenshot(t){let i=await this.page.screenshot(),r=Q.join(te.tmpdir(),`shiplight-screenshot-${Date.now()}.png`);return await ee.writeFile(r,i),{screenshot:i.toString("base64"),screenshotPath:r}}async initializeCopilot(t,i){}async sendCopilotMessage(t,i,r,o){throw new Error("Copilot not supported in Playwright debug mode")}abortCopilot(t){return!1}getCopilotTestFlow(t){}async terminateSession(t){console.error("[debugger] Playwright session released")}async cleanupAll(){}};async function Nt(e){let{yamlFilePath:t,port:i,page:r,agent:o}=e,n=new M(r,o),s=(0,X.default)();s.use(X.default.json({limit:"10mb"})),s.use((y,h,m)=>{if(h.setHeader("Access-Control-Allow-Origin","*"),h.setHeader("Access-Control-Allow-Methods","GET, POST, PUT, DELETE, OPTIONS"),h.setHeader("Access-Control-Allow-Headers","Content-Type"),y.method==="OPTIONS")return h.sendStatus(204);m()});let{createTestFlowRouter:a}=await Promise.resolve().then(()=>(Be(),Ge)),{createIntRunnerRouter:l}=await Promise.resolve().then(()=>(Ue(),je)),{createCopilotRouter:d}=await Promise.resolve().then(()=>(Je(),ze));s.use(a(t)),s.use(l(n)),s.use(d(n));let p=await new Promise((y,h)=>{let m=s.listen(i,"localhost",()=>y(m));m.on("error",h)});return{url:`http://localhost:${i}`,close:async()=>{await n.cleanupAll(),await new Promise((y,h)=>{p.close(m=>m?h(m):y())})}}}0&&(module.exports={PlaywrightSandboxService,startPlaywrightDebugServer});
11
+ `)};try{await e.sendCopilotMessage(o.sessionId,n,s,c)}catch(l){s({type:"copilot_message",data:{type:"error",message:l.message},sequenceNumber:0,timestamp:new Date().toISOString()})}finally{r.end()}}),t.post("/api/int-runner/copilot/abort",async(i,r)=>{try{let{session:o}=i.body;if(!o?.sessionId)return r.status(400).json({success:!1,message:"Missing session"});let n=e.abortCopilot(o.sessionId);r.json({success:!0,status:"success",aborted:n})}catch(o){console.error("[debugger] copilot/abort error:",o),r.status(500).json({success:!1,message:o.message})}}),t.post("/api/int-runner/copilot/status",async(i,r)=>{try{let{session:o}=i.body;if(!o?.sessionId)return r.status(400).json({status:"error",message:"Missing session"});let n=e.getCopilotTestFlow(o.sessionId);r.json({status:"success",copilotInitialized:!0,testFlow:n})}catch(o){r.status(500).json({status:"error",details:o.message})}}),t}var qe,Qe=g(()=>{"use strict";qe=require("express")});var Kt={};H(Kt,{PlaywrightSandboxService:()=>$,startPlaywrightDebugServer:()=>Gt});module.exports=ct(Kt);var q=x(require("express"),1);var te=x(require("path"),1),ie=x(require("fs/promises"),1),re=x(require("os"),1),$=class{page;agent;sessionId="pw-"+Math.random().toString(36).slice(2,10);abortController=null;constructor(t,i){this.page=t,this.agent=i}cdpEndpoint=null;setCdpEndpoint(t){this.cdpEndpoint=t}getCdpEndpoint(){if(this.cdpEndpoint)return this.cdpEndpoint;let t=this.page.context().browser();if(!t)return null;let i=t.wsEndpoint?.();return typeof i=="string"?i:null}async createSession(t){return{sessionId:this.sessionId}}async executeLogin(t){return{status:"success",details:"Handled by Playwright"}}async ensureBrowser(t){return{page:this.page,liveviewUrl:""}}async startDebug(t){return{sessionId:this.sessionId,liveviewUrl:"",browserWsUrl:""}}async executeAction(t,i,r,o){let n=i.action_data||i.action;if(!n)throw new Error("ActionEntity has no action_data");if(console.error(`[pw-sandbox] executeAction stepId=${JSON.stringify(r)} action_name=${JSON.stringify(n.action_name)} locator=${JSON.stringify(i.locator)} kwargs=${JSON.stringify(n.kwargs)}`),n.action_name==="js_code"&&r==="prelude"){if(this.page.url()==="about:blank"){let l=n.kwargs?.code?.match(/PLAYWRIGHT_STARTING_URL \|\| '([^']*)'/)?.[1];l&&await this.page.goto(l,{waitUntil:"domcontentloaded"})}return{status:"success"}}let c=i.action_description||n.action_name;return{status:"success",...await this.agent.step(this.page,async()=>{await this.agent.execAction(n.action_name,this.page,i)},c,r,o?.stmtUid,!!o?.withSelfHealing)}}async runStep(t,i,r,o,n){let c=[],s={},l=this.agent._actionHandler;this.abortController=new AbortController;try{let d=await this.agent.execute(this.page,i,r,!1);return{success:d?.success??!0,actions:c,details:d?.details}}finally{this.abortController=null}}stopRunStep(t){return this.abortController?(this.abortController.abort(),!0):!1}async evaluate(t,i,r){try{let o=await this.agent.evaluate(this.page,i);return{status:"success",conclusion:o?"true":"false",explanation:o?`Condition met: ${i}`:`Condition not met: ${i}`}}catch(o){return{status:"error",conclusion:"unknown",explanation:o.message}}}async generateAction(t,i,r,o){return this.agent.generate(this.page,i,r,o?.usePureVision)}async takeScreenshot(t){let i=await this.page.screenshot(),r=te.join(re.tmpdir(),`shiplight-screenshot-${Date.now()}.png`);return await ie.writeFile(r,i),{screenshot:i.toString("base64"),screenshotPath:r}}async initializeCopilot(t,i){}async sendCopilotMessage(t,i,r,o){throw new Error("Copilot not supported in Playwright debug mode")}abortCopilot(t){return!1}getCopilotTestFlow(t){}async terminateSession(t){console.error("[debugger] Playwright session released")}async cleanupAll(){}};async function Gt(e){let{yamlFilePath:t,port:i,cdpPort:r,page:o,agent:n}=e,c=new $(o,n);if(r)try{let m=await fetch(`http://localhost:${r}/json/version`);if(m.ok){let h=await m.json();h.webSocketDebuggerUrl&&(c.setCdpEndpoint(h.webSocketDebuggerUrl),console.error(`[debugger] CDP endpoint: ${h.webSocketDebuggerUrl}`))}}catch{console.error(`[debugger] Could not fetch CDP endpoint from port ${r}`)}let s=(0,q.default)();s.use(q.default.json({limit:"10mb"})),s.use((m,h,y)=>{if(h.setHeader("Access-Control-Allow-Origin","*"),h.setHeader("Access-Control-Allow-Methods","GET, POST, PUT, DELETE, OPTIONS"),h.setHeader("Access-Control-Allow-Headers","Content-Type"),m.method==="OPTIONS")return h.sendStatus(204);y()});let{createTestFlowRouter:l}=await Promise.resolve().then(()=>(ze(),Ve)),{createIntRunnerRouter:d}=await Promise.resolve().then(()=>(Xe(),Ye)),{createCopilotRouter:p}=await Promise.resolve().then(()=>(Qe(),Ze));s.use(l(t)),s.use(d(c)),s.use(p(c));let f=await new Promise((m,h)=>{let y=s.listen(i,"localhost",()=>m(y));y.on("error",h)});return{url:`http://localhost:${i}`,close:async()=>{await c.cleanupAll(),await new Promise((m,h)=>{f.close(y=>y?h(y):m())})}}}0&&(module.exports={PlaywrightSandboxService,startPlaywrightDebugServer});