shiplightai 0.1.73 → 0.1.74

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.
package/dist/fixture.js CHANGED
@@ -4546,4 +4546,4 @@ await page.waitForTimeout(2000);
4546
4546
  `;return e}generatePostlude(){return""}}});function ed(e){if(!e)return"desktop";for(let t of Gp)if(t.test(e))return"mobile";return"desktop"}var Gp,td=y(()=>{"use strict";Gp=[/iphone/i,/ipad/i,/android/i,/pixel/i,/galaxy/i,/mobile/i,/nexus/i,/blackberry/i,/kindle/i]});function id(e,t){if(!e||typeof e!="string")return e;let i=t instanceof Map?Object.fromEntries(t):t,n=a=>{let r=a.startsWith("$")?a.slice(1):a,s=i[r]??i[`$${r}`];return s!=null?String(s):void 0},o=e;return o=o.replace(/\{\{\s*\$?([^}]+?)\s*\}\}/g,(a,r)=>{let s=n(r.trim());return s!==void 0?s:a}),o=o.replace(/<secret>\$?([\w-]+)<\/secret>/g,(a,r)=>{let s=n(r);return s!==void 0?s:a}),o=o.replace(/\$\{([^}]+)\}/g,(a,r)=>{let s=n(r.trim());return s!==void 0?s:a}),o=o.replace(/\$([a-zA-Z_]\w*)/g,(a,r)=>{let s=n(r);return s!==void 0?s:a}),o}var nd=y(()=>{"use strict"});import{v4 as Kp}from"uuid";function Sa(e){let t=e.match(/\.getByRole\(['"]([^'"]+)['"]/);if(t&&t[1]){let p=e.match(/\.filter\(\{\s*hasText:\s*['"]([^'"]*(?:\\.[^'"]*)*)['"]\s*\}\)/);if(p&&p[1]){let S=p[1].replace(/\\(.)/g,"$1");return`${t[1]} element with text "${S}"`}let f=e.match(/\.filter\(\{\s*hasText:\s*(\/.*?\/[gimuy]*)\s*\}\)/);if(f&&f[1]){let S=f[1].replace(/^\/|\/$/g,""),_=S.length>30?`${S.substring(0,27)}...`:S;return`${t[1]} element with text matching "${_}"`}return`${t[1]} element`}let i=e.match(/\.filter\(\{\s*hasText:\s*['"]([^'"]*(?:\\.[^'"]*)*)['"]\s*\}\)/);if(i&&i[1]){let p=St(e),f=i[1].replace(/\\(.)/g,"$1");return`${p} with text "${f}"`}let n=e.match(/\.filter\(\{\s*hasText:\s*(\/.*?\/[gimuy]*)\s*\}\)/);if(n&&n[1])return`${St(e)} with text matching ${n[1]}`;let o=e.match(/\.filter\(\{\s*has:\s*[^}]+getByText\('((?:[^'\\]|\\.)*)'(?:,\s*\{[^}]*\})?\)/);if(o&&o[1]){let p=St(e),f=o[1].replace(/\\(.)/g,"$1");return`${p} containing "${f}"`}let a=e.match(/\.filter\(\{\s*has:\s*[^}]+getByText\("((?:[^"\\]|\\.)*)"(?:,\s*\{[^}]*\})?\)/);if(a&&a[1]){let p=St(e),f=a[1].replace(/\\(.)/g,"$1");return`${p} containing "${f}"`}let r=e.match(/\.filter\(\{\s*hasNot:\s*[^}]+getByText\('((?:[^'\\]|\\.)*)'(?:,\s*\{[^}]*\})?\)/);if(r&&r[1]){let p=St(e),f=r[1].replace(/\\(.)/g,"$1");return`${p} not containing "${f}"`}let s=e.match(/\.filter\(\{\s*hasNot:\s*[^}]+getByText\("((?:[^"\\]|\\.)*)"(?:,\s*\{[^}]*\})?\)/);if(s&&s[1]){let p=St(e),f=s[1].replace(/\\(.)/g,"$1");return`${p} not containing "${f}"`}let l=e.match(/name:\s*'((?:[^'\\]|\\.)*)'/);if(l&&l[1])return`"${l[1].replace(/\\(.)/g,"$1")}"`;let d=e.match(/name:\s*"((?:[^"\\]|\\.)*)"/);if(d&&d[1])return`"${d[1].replace(/\\(.)/g,"$1")}"`;let c=e.match(/getByText\('((?:[^'\\]|\\.)*)'(?:,\s*\{[^}]*\})?\)/);if(c&&c[1])return`"${c[1].replace(/\\(.)/g,"$1")}"`;let u=e.match(/getByText\("((?:[^"\\]|\\.)*)"(?:,\s*\{[^}]*\})?\)/);if(u&&u[1])return`"${u[1].replace(/\\(.)/g,"$1")}"`;let m=e.match(/getByPlaceholder\('((?:[^'\\]|\\.)*)'(?:,\s*\{[^}]*\})?\)/);if(m&&m[1])return`input with placeholder "${m[1].replace(/\\(.)/g,"$1")}"`;let g=e.match(/getByPlaceholder\("((?:[^"\\]|\\.)*)"(?:,\s*\{[^}]*\})?\)/);if(g&&g[1])return`input with placeholder "${g[1].replace(/\\(.)/g,"$1")}"`;let w=e.match(/getByLabel\('((?:[^'\\]|\\.)*)'(?:,\s*\{[^}]*\})?\)/);if(w&&w[1])return`"${w[1].replace(/\\(.)/g,"$1")}"`;let v=e.match(/getByLabel\("((?:[^"\\]|\\.)*)"(?:,\s*\{[^}]*\})?\)/);if(v&&v[1])return`"${v[1].replace(/\\(.)/g,"$1")}"`;let x=e.match(/getByRole\(['"]([^'"]+)['"]/);return x&&x[1]?`${x[1]} element`:e.length>50?`${e.substring(0,47)}...`:e}function Ea(e,t){if(!e||!t)return null;let i=t.replace(/^ref=/,""),n=e.split(`
4547
4547
  `);for(let o of n){if(!o.includes(`[ref=${i}]`))continue;let s=o.replace(/\s+\[[^\]]+\](?:\s*\[[^\]]+\])*.*$/,"").trim().replace(/^[-–—]\s*/,"").trim().replace(/\\"/g,'"');return s.length>0?s:null}return null}function Ta(e,t=""){let i=e.match(/page\d*\.(.+?)\.(click|fill|press|check|uncheck|hover|selectOption|dragTo|dblclick|screenshot|setInputFiles|locator|frameLocator)/);if(i&&i[1])return i[1].trim();let n=e.match(/page\d*\.locator\(([^)]+)\)/);if(n&&n[1])return`locator(${n[1]})`;let o=e.match(/page\d*\.frameLocator\(([^)]+)\)/);return o&&o[1]?`frameLocator(${o[1]})`:t}function St(e){let t=e.match(/^locator\(['"]([^'"]+)['"]\)/);if(t&&t[1]){let o=t[1],a=o.match(/^([a-zA-Z][\w-]*)/);return a?a[1]:o.length>20?`${o.substring(0,17)}...`:o}let i=e.match(/getByRole\(['"]([^'"]+)['"]/);if(i&&i[1])return i[1];let n=e.match(/getByTestId\(['"]([^'"]+)['"]/);return n&&n[1]?`element with testId "${n[1]}"`:"element"}function ka(e){let t=e.match(/\.fill\(['"]([^'"]*)['"]\)/);if(t&&t[1]!==void 0)return t[1];let i=e.match(/\.press\(['"]([^'"]+)['"]\)/);if(i&&i[1])return i[1];let n=e.match(/\.selectOption\(['"]([^'"]+)['"]\)/);return n&&n[1]?n[1]:""}function jp(e){let t=e.match(/button:\s*['"]([^'"]+)['"]/);return t?t[1]:void 0}function zp(e){let t=e.match(/modifiers:\s*\[([^\]]+)\]/);if(t&&t[1])return t[1].split(",").map(i=>i.trim().replace(/['"]/g,""))}function ad(e,t){let i=e.name||"unknown",n=Ta(t,e.selector||""),o=e.ariaSnapshot??e.arIAaSnapshot??"",a=e.ref,r=/getByTestId\s*\(/.test(n),l=(a&&o&&r?Ea(o,a):null)??Sa(n),d,c,u={};switch(i){case"click":{let m=jp(t),g=zp(t);m==="right"?(d="right_click_on_element",c=`Right click on ${l}`):(d="click_element",c=`Click on ${l}`),u={index:0},m&&m!=="left"&&(u.button=m),g&&(u.modifiers=g);break}case"fill":{let m=e.text||e.value||ka(t)||"";d="fill",c=m?`Fill ${l} with '${m}'`:`Fill ${l}`,u={value:m,index:0};break}case"press":{let m=e.key||ka(t)||"";d="press",c=`Press '${m}' on ${l}`,u={keyComb:m,index:0};break}case"selectOption":{let m=e.options?.[0]||ka(t)||"";d="select_dropdown_option",c=`Select '${m}' from ${l}`,u={text:m,index:0};break}case"check":d="click_element",c=`Check ${l}`,u={index:0};break;case"uncheck":d="click_element",c=`Uncheck ${l}`,u={index:0};break;case"setInputFiles":{let m=e.files||[];d="upload_file",c=m.length>0?`Upload file(s) to ${l}`:`Upload file to ${l}`,u={paths:m,index:0};break}case"navigate":case"goto":d="go_to_url",c=`Navigate to ${e.url||"URL"}`,u={url:e.url||"",new_tab:!1};break;case"dblclick":d="double_click_on_element",c=`Double click on ${l}`,u={index:0};break;case"hover":d="hover",c=`Hover over ${l}`,u={index:0};break;case"wheel":case"scroll":d="scroll",c=`Scroll on ${l}`,u={x:e.deltaX||0,y:e.deltaY||0,index:e.selector?0:-1};break;case"dragTo":d="drag_drop",c=`Drag ${l} to target`,u={index:0};break;case"screenshot":d="wait",c="Take screenshot",u={seconds:.5};break;case"wait":d="wait",c=`Wait for ${e.timeout||1e3}ms`,u={seconds:(e.timeout||1e3)/1e3};break;default:d="click_element",c=`${i} on ${l}`,u={index:0};break}return{locator:n,xpath:e.xpath||"",css_selector:e.css_selector||"",unique_selector:e.selector||e.css_selector||"",frame_path:e.frame_path||[],action_data:{action_name:d,args:[],kwargs:u},action_description:c,url:"",feedback:""}}var od,rd=y(()=>{"use strict";od=()=>Kp()});import{z as A}from"zod";var Aa,uo,Ma,Je,Ia,Pa,Ca,te,$a,Li,ho,La=y(()=>{"use strict";Aa=A.enum(["JS_CODE","AI_MODE"]),uo=A.object({type:Aa,expression:A.string()}),Ma=A.enum(["DRAFT","STEP","ACTION","IF_ELSE","WHILE_LOOP"]),Je=A.object({uid:A.string(),type:Ma,comment:A.string().optional()}),Ia=A.object({action_data:A.object({action_name:A.string(),kwargs:A.record(A.any()).optional(),args:A.array(A.any()).optional()}),action_description:A.string().optional(),url:A.string().optional(),xpath:A.string().nullable().optional(),locator:A.string().nullable().optional(),css_selector:A.string().nullable().optional(),unique_selector:A.string().nullable().optional(),element_index:A.number().nullable().optional(),frame_path:A.array(A.any()).optional(),artifacts:A.record(A.any()).optional(),feedback:A.string().optional(),original_browser_use_action:A.any().optional()}).passthrough(),Pa=Je.extend({type:A.literal("DRAFT"),description:A.string()}),Ca=Je.extend({type:A.literal("ACTION"),description:A.string(),action_entity:Ia.optional(),locator:A.string().optional(),use_pure_vision:A.boolean().optional()}),te=A.lazy(()=>A.union([Pa,Ca,Je.extend({type:A.literal("STEP"),description:A.string().optional().default(""),statements:A.array(te),reference_id:A.number().optional(),template_path:A.string().optional(),template_params:A.record(A.string()).optional()}),Je.extend({type:A.literal("IF_ELSE"),description:A.string().optional(),condition:uo,then:A.array(te),else:A.array(te).optional()}),Je.extend({type:A.literal("WHILE_LOOP"),description:A.string().optional(),condition:uo,body:A.array(te),timeout_ms:A.number().optional()})])),$a=A.object({name:A.string(),statements:A.array(te),teardown:A.array(te).optional(),skip:A.union([A.boolean(),A.string()]).optional(),timeout:A.number().optional(),fail:A.union([A.boolean(),A.string()]).optional(),only:A.boolean().optional(),slow:A.boolean().optional()}),Li=A.object({tests:A.array($a).min(1),beforeAll:A.array(te).optional(),afterAll:A.array(te).optional(),beforeEach:A.array(te).optional(),afterEach:A.array(te).optional()}),ho=A.object({comment:A.string().optional(),version:A.string().optional(),goal:A.string().optional(),url:A.string().optional(),baseURL:A.string().optional(),final_feedback:A.string().optional(),completed:A.boolean().optional(),success:A.boolean().optional(),statements:A.array(te).optional(),teardown:A.array(te).optional(),last_modified_at:A.string().optional(),testGroup:Li.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"})});import{stringify as mo,parse as po,parseAllDocuments as Vp,parseDocument as Xp,Document as dd,isMap as Tt,isSeq as ie}from"yaml";import{v4 as de}from"uuid";function Oa(e,t){let i={...t?.test_case_id!==void 0?{test_case_id:t.test_case_id}:{},...t?.name?{name:t.name}:{},...t?.tags&&t.tags.length>0?{tags:t.tags}:{},...t?.skip!==void 0?{skip:t.skip}:{},...t?.fail!==void 0?{fail:t.fail}:{},...t?.only?{only:t.only}:{},...t?.slow?{slow:t.slow}:{},goal:e.goal??"",url:e.url,base_url:e.baseURL,...t?.timeout!==void 0?{timeout:t.timeout}:{},...t?.settings&&Object.keys(t.settings).length>0?{settings:t.settings}:{},...t?.use&&Object.keys(t.use).length>0?{use:t.use}:{},...t?.beforeEach&&t.beforeEach.length>0?{beforeEach:t.beforeEach}:{},...t?.afterEach&&t.afterEach.length>0?{afterEach:t.afterEach}:{},...t?.parameters&&t.parameters.length>0?{parameters:t.parameters}:{},statements:(e.statements??[]).map(ae)};return e.final_feedback&&(i.final_feedback=e.final_feedback),e.teardown&&e.teardown.length>0&&(i.teardown=e.teardown.map(ae)),i}function ud(e,t){if(e.testGroup)return Na(e,t);let i=Oa(e,t),n=new dd(i),o=n.contents?.get("tags",!0);return ie(o)&&(o.flow=!0),e.comment&&(n.commentBefore=e.comment),sd(n,e.statements??[]),e.teardown&&sd(n,e.teardown,"teardown"),n.toString(At)}function sd(e,t,i="statements"){let n=e.contents;if(!n||!Tt(n))return;let o=n.get(i,!0);ie(o)&&Di(o,t)}function Di(e,t){for(let i=0;i<Math.min(e.items.length,t.length);i++){let n=t[i],o=e.items[i];if(i>0&&(o.spaceBefore=!0),n.comment&&(i===0?e.commentBefore=n.comment:o.commentBefore=n.comment),Tt(o)){let a=o;if(n.type==="STEP"){let r=a.get("statements",!0);ie(r)&&Di(r,n.statements)}else if(n.type==="IF_ELSE"){let r=a.get("THEN",!0);ie(r)&&Di(r,n.then);let s=a.get("ELSE",!0);ie(s)&&n.else&&Di(s,n.else)}else if(n.type==="WHILE_LOOP"){let r=a.get("DO",!0);ie(r)&&Di(r,n.body)}}}}function Na(e,t){let i=e.testGroup;if(!i)throw new Error("suiteToYaml requires a TestFlow with testGroup");let n={};t?.test_case_id!==void 0&&(n.test_case_id=t.test_case_id),t?.name&&(n.name=t.name),t?.tags&&t.tags.length>0&&(n.tags=t.tags),t?.use&&Object.keys(t.use).length>0&&(n.use=t.use),t?.settings&&Object.keys(t.settings).length>0&&(n.settings=t.settings);let o={};e.baseURL&&(o.base_url=e.baseURL),i.beforeAll&&i.beforeAll.length>0&&(o.beforeAll=i.beforeAll.map(ae)),i.beforeEach&&i.beforeEach.length>0&&(o.beforeEach=i.beforeEach.map(ae)),i.afterEach&&i.afterEach.length>0&&(o.afterEach=i.afterEach.map(ae)),i.afterAll&&i.afterAll.length>0&&(o.afterAll=i.afterAll.map(ae)),o.tests=i.tests.map(s=>{let l={name:s.name};return s.skip!==void 0&&(l.skip=s.skip),s.timeout!==void 0&&(l.timeout=s.timeout),s.fail!==void 0&&(l.fail=s.fail),s.only!==void 0&&(l.only=s.only),s.slow!==void 0&&(l.slow=s.slow),l.statements=s.statements.map(ae),s.teardown&&s.teardown.length>0&&(l.teardown=s.teardown.map(ae)),l}),n.suite=o;let a=new dd(n),r=a.contents?.get("tags",!0);return ie(r)&&(r.flow=!0),a.toString(At)}function hd(e){return e.map(t=>mo(t,At)).join(`---
4548
4548
  `)}function ae(e){switch(e.type){case"DRAFT":return Yp(e);case"ACTION":return md(e);case"STEP":return qp(e);case"IF_ELSE":return Zp(e);case"WHILE_LOOP":return Qp(e)}}function Yp(e){return{intent:e.description}}function md(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"&&l.trim()?{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"&&s.trim()&&e.description)return{description:e.description,js:s}}if(t==="ai_wait_until"){let s=i?.condition;if(typeof s=="string"){let l={WAIT_UNTIL:s};return typeof i?.timeout_seconds=="number"&&i.timeout_seconds!==60&&(l.timeout_seconds=i.timeout_seconds),l}}if(t==="wait"){let s=i?.seconds,d={WAIT:e.description||`Wait ${s}s`};return typeof s=="number"&&(d.seconds=s),d}if(t==="js_code"){let s=i?.code;if(typeof s=="string"&&!e.action_entity?.locator&&!e.action_entity?.xpath)return{description:e.description||"Code block",js:s}}if(!e.action_entity)return{intent:e.description};let n=e.action_entity.action_data??e.action_entity.action;if(!n)return{intent:e.description};let o={intent:e.description,action:n.action_name},a=e.locator??e.action_entity.locator;a&&(o.locator=a);let r=e.action_entity.xpath;if(r&&(o.xpath=r),e.use_pure_vision&&(o.use_pure_vision=!0),n.kwargs&&Object.keys(n.kwargs).length>0)for(let[s,l]of Object.entries(n.kwargs))s!=="uid"&&(s==="statement"&&(t==="ai_action"||t==="ai_step")||(o[s]=l));return n.args&&n.args.length>0&&(o.args=n.args),o}function pd(e,t,i){let n={uid:"",type:"ACTION",description:t||e.action_description||"",action_entity:e,locator:i},o=md(n);if(typeof o=="object"&&o!==null){let a={...o};return delete a.intent,delete a.description,delete a.VERIFY,delete a.WAIT_UNTIL,delete a.WAIT,delete a.statement,Object.keys(a).length>0?mo(a,At).trim():""}return mo(o,At).trim()}function gd(e){let t=po(e);if(!t||typeof t!="object")throw new Error("Invalid YAML: expected an object");if("VERIFY"in t){let c=String(t.VERIFY),u=typeof t.js=="string"?t.js:void 0;return{description:c,actionEntity:{action_description:c,action_data:{action_name:"verify",kwargs:{statement:c,...u?{code:u}:{}}}}}}if("URL"in t){let c=String(t.URL),u={url:c};return t.new_tab===!0&&(u.new_tab=!0),typeof t.timeout_seconds=="number"&&(u.timeout_seconds=t.timeout_seconds),{description:`Navigate to ${c}`,actionEntity:{action_description:`Navigate to ${c}`,action_data:{action_name:"go_to_url",kwargs:u}}}}if("CODE"in t){let c=String(t.CODE);return{description:c,actionEntity:{action_description:c,action_data:{action_name:"js_code",kwargs:{code:c}}}}}if("js"in t&&typeof t.js=="string"&&!("VERIFY"in t)&&!("action"in t)){let c=typeof t.description=="string"?t.description:typeof t.intent=="string"?t.intent:"";return{description:c,actionEntity:{action_description:c,action_data:{action_name:"js_code",kwargs:{code:t.js}}}}}if("WAIT_UNTIL"in t){let c=String(t.WAIT_UNTIL),u={condition:c};return typeof t.timeout_seconds=="number"&&(u.timeout_seconds=t.timeout_seconds),{description:`Wait until ${c}`,actionEntity:{action_description:`Wait until ${c}`,action_data:{action_name:"ai_wait_until",kwargs:u}}}}if("WAIT"in t){let c=String(t.WAIT),u={};return typeof t.seconds=="number"&&(u.seconds=t.seconds),{description:c,actionEntity:{action_description:c,action_data:{action_name:"wait",kwargs:u}}}}let i=typeof t.intent=="string"?t.intent:void 0,n=typeof t.action=="string"?t.action:void 0,o=typeof t.locator=="string"?t.locator:void 0,a=typeof t.xpath=="string"?t.xpath:void 0,r=Array.isArray(t.frame_path)?t.frame_path:void 0,s=Array.isArray(t.args)?t.args:void 0,l={};for(let[c,u]of Object.entries(t))Jp.has(c)||(l[c]=u);return n?{actionEntity:{action_description:i||"",action_data:{action_name:n,kwargs:l,...s&&s.length>0?{args:s}:{}},...o?{locator:o}:{},...a?{xpath:a}:{},...r?{frame_path:r}:{}},description:i,locator:o}:{description:i,actionEntity:{action_description:i||""}}}function qp(e){if(e.template_path){let i={template:e.template_path};return e.template_params&&Object.keys(e.template_params).length>0&&(i.params=e.template_params),i}let t={STEP:e.description,statements:e.statements.map(ae)};return e.reference_id!==void 0&&(t.reference_id=e.reference_id),t}function Zp(e){let t={IF:fd(e.condition),THEN:e.then.map(ae)};return e.else&&e.else.length>0&&(t.ELSE=e.else.map(ae)),t}function Qp(e){let t={WHILE:fd(e.condition),DO:e.body.map(ae)};return e.timeout_ms!==void 0&&(t.timeout_ms=e.timeout_ms),t}function fd(e){return e.type==="JS_CODE"?`js:${e.expression}`:e.expression}function wd(e){let t=Vp(e),i;if(t.length>1||t.length===1&&!Array.isArray(t[0]?.toJSON()))i=t.map((n,o)=>n.errors.length>0?{__parseError:`Document ${o+1}: ${n.errors[0].message}`}:n.toJSON());else{let n;try{n=po(e)}catch(o){throw new Error(`Invalid YAML: ${o instanceof Error?o.message:String(o)}`)}if(!Array.isArray(n))throw new Error("Expected a YAML array or multi-document YAML (separated by ---)");i=n}return i.map((n,o)=>{try{if(n&&typeof n=="object"&&"__parseError"in n)return{error:n.__parseError};if(!n||typeof n!="object")return{error:`Item ${o+1}: expected an object`};let a=n,r=typeof a.name=="string"&&a.name.trim()||void 0,s=typeof a.goal=="string"?a.goal.trim():"";if(!s)return{error:`Item ${o+1}: missing "goal" field`};if(Array.isArray(a.statements))try{let l=mo(a,At),d=qe(l);return{name:r,goal:d.goal??s,testFlow:d}}catch{}return{name:r,goal:s}}catch(a){return{error:`Item ${o+1}: ${a instanceof Error?a.message:String(a)}`}}})}function bd(e){try{let t=po(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()),typeof t.timeout=="number"&&Number.isFinite(t.timeout)&&(i.timeout=t.timeout),t.settings&&typeof t.settings=="object"&&!Array.isArray(t.settings)&&(i.settings=t.settings),t.use&&typeof t.use=="object"&&!Array.isArray(t.use)&&(i.use=t.use),Array.isArray(t.tags)&&t.tags.every(n=>typeof n=="string")&&(i.tags=t.tags),(typeof t.skip=="boolean"||typeof t.skip=="string")&&(i.skip=t.skip),(typeof t.fail=="boolean"||typeof t.fail=="string")&&(i.fail=t.fail),t.only===!0&&(i.only=!0),t.slow===!0&&(i.slow=!0),Array.isArray(t.beforeEach)&&t.beforeEach.length>0&&(i.beforeEach=t.beforeEach),Array.isArray(t.afterEach)&&t.afterEach.length>0&&(i.afterEach=t.afterEach),Array.isArray(t.parameters)&&t.parameters.length>0&&(i.parameters=t.parameters),i}catch{return{}}}function Da(e){if(e==null||typeof e!="object")return e;if(Array.isArray(e))return e.map(Da);let t=e,i=Object.keys(t);if(i.length===1){let o=i[0];if(o.startsWith("{ ")&&o.endsWith(" }")&&t[o]===null)return`{{${o.slice(2,-2)}}}`}let n={};for(let[o,a]of Object.entries(t))n[o]=Da(a);return n}function qe(e){if(e.length>ld)throw new Error(`YAML input too large (${e.length} bytes, max ${ld})`);let t=Da(po(e));if(!t||typeof t!="object")throw new Error("Invalid YAML: expected an object at root level");if(t.suite)return eg(t);let i={version:"1.3.0",goal:t.goal,url:t.url,baseURL:t.base_url,statements:re(t.statements??[])};t.final_feedback&&(i.final_feedback=t.final_feedback),t.teardown&&Array.isArray(t.teardown)&&(i.teardown=re(t.teardown));let n=ho.safeParse(i);if(!n.success)throw new Error(`Invalid TestFlow after YAML conversion: ${JSON.stringify(n.error.errors)}`);let o=n.data;return Ra(e,o),o}function eg(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:re(s.statements)};return Array.isArray(s.teardown)&&s.teardown.length>0&&(l.teardown=re(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=re(t.beforeAll)),Array.isArray(t.afterAll)&&t.afterAll.length>0&&(o.afterAll=re(t.afterAll)),Array.isArray(t.beforeEach)&&t.beforeEach.length>0&&(o.beforeEach=re(t.beforeEach)),Array.isArray(t.afterEach)&&t.afterEach.length>0&&(o.afterEach=re(t.afterEach));let a=Li.safeParse(o);if(!a.success)throw new Error(`Invalid TestGroup: ${JSON.stringify(a.error.errors)}`);return{version:"1.3.0",baseURL:t.base_url||void 0,testGroup:a.data}}function re(e){if(!Array.isArray(e))throw new Error("Expected an array of statements");return e.map(tg)}function tg(e){if(typeof e=="string")throw new Error(`Plain string statements are not supported. Use an object with a "desc" key instead. Example: { "desc": "${e}" }`);if(typeof e!="object"||e===null)throw new Error(`Invalid statement: expected object, got ${typeof e}`);let t=e;if("IF"in t)return ig(t);if("WHILE"in t)return ng(t);if("STEP"in t)return og(t);if("VERIFY"in t){let i=t.VERIFY,n={statement:typeof i=="string"?i:String(i)};return typeof t.js=="string"&&(n.code=t.js),{uid:de(),type:"ACTION",description:String(i),action_entity:{action_description:String(i),action_data:{action_name:"verify",kwargs:n}}}}if("URL"in t){let i=t.URL,n=t.new_tab===!0?!0:void 0,o=typeof t.timeout_seconds=="number"?t.timeout_seconds:void 0,a={url:typeof i=="string"?i:String(i)};return n&&(a.new_tab=!0),o!==void 0&&(a.timeout_seconds=o),{uid:de(),type:"ACTION",description:`Navigate to ${i}`,action_entity:{action_description:`Navigate to ${i}`,action_data:{action_name:"go_to_url",kwargs:a}}}}if("WAIT_UNTIL"in t){let i=t.WAIT_UNTIL,n=typeof t.timeout_seconds=="number"?t.timeout_seconds:60;return{uid:de(),type:"ACTION",description:`Wait until: ${i}`,action_entity:{action_description:`Wait until: ${i}`,action_data:{action_name:"ai_wait_until",kwargs:{condition:typeof i=="string"?i:String(i),timeout_seconds:n}}}}}if("WAIT"in t){let i=t.WAIT,n=typeof t.seconds=="number"?t.seconds:3;return{uid:de(),type:"ACTION",description:typeof i=="string"?i:`Wait ${n}s`,action_entity:{action_description:typeof i=="string"?i:`Wait ${n}s`,action_data:{action_name:"wait",kwargs:{seconds:n}}}}}if("CODE"in t){let i=t.CODE;if(i==null)throw new Error('CODE statement has no code. Use "CODE: |" followed by indented code on the next line.');let n=typeof t.description=="string"?t.description:"Code block";return{uid:de(),type:"ACTION",description:n,action_entity:{action_description:n,action_data:{action_name:"js_code",kwargs:{code:typeof i=="string"?i:String(i)}}}}}if("js"in t&&!("VERIFY"in t)&&!("action"in t)){if("intent"in t||"desc"in t)throw new Error("A `js:` statement uses `description:`, not `intent:`. Raw JS does not self-heal \u2014 use `description: + js:` for code, or express it as a structured action (`intent:` + `action:`/`locator:`) to keep self-healing.");let i=typeof t.description=="string"&&t.description.trim()!==""?t.description:"Code block",n=t.js;return{uid:de(),type:"ACTION",description:i,action_entity:{action_description:i,action_data:{action_name:"js_code",kwargs:{code:typeof n=="string"?n:String(n)}}}}}if("call"in t&&typeof t.call=="string"){let{call:i,...n}=t;return cd({...n,action:"function",functionName:i})}if("action"in t)return cd(t);if("intent"in t&&typeof t.intent=="string"||"desc"in t&&typeof t.desc=="string")return{uid:de(),type:"DRAFT",description:typeof t.intent=="string"?t.intent:t.desc};throw new Error(`Cannot infer statement type from object: ${JSON.stringify(t)}`)}function yd(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 ig(e){let t=yd(e.IF),i=e.THEN;if(!Array.isArray(i))throw new Error("IF_ELSE requires a THEN array");let n={uid:de(),type:"IF_ELSE",condition:t,then:re(i)};return"ELSE"in e&&Array.isArray(e.ELSE)&&(n.else=re(e.ELSE)),n}function ng(e){let t=yd(e.WHILE),i=e.DO;if(!Array.isArray(i))throw new Error("WHILE_LOOP requires a DO array");let n={uid:de(),type:"WHILE_LOOP",condition:t,body:re(i)};return typeof e.timeout_ms=="number"&&(n.timeout_ms=e.timeout_ms),n}function og(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:de(),type:"STEP",description:t,statements:re(e.statements)};if(typeof e.reference_id=="number"&&(i.reference_id=e.reference_id),typeof e.template_path=="string"&&(i.template_path=e.template_path),e.template_params&&typeof e.template_params=="object"&&!Array.isArray(e.template_params)){let n=e.template_params,o={};for(let[a,r]of Object.entries(n))o[a]=String(r);i.template_params=o}return i}function cd(e){let t=typeof e.action=="string"?e.action:String(e.action),i=typeof e.intent=="string"?e.intent:typeof e.desc=="string"?e.desc:"",n=typeof e.locator=="string"?e.locator:void 0,o=typeof e.xpath=="string"?e.xpath:void 0,a=typeof e.use_pure_vision=="boolean"?e.use_pure_vision:void 0,r={};for(let[d,c]of Object.entries(e))ag.has(d)||(r[d]=c);t==="verify"&&typeof r.js=="string"&&(r.code=r.js,delete r.js),(t==="ai_action"||t==="ai_step")&&r.statement===void 0&&(r.statement=i);let s={action_description:i,action_data:{action_name:t,kwargs:Object.keys(r).length>0?r:{}}};n&&(s.locator=n),o&&(s.xpath=o);let l={uid:de(),type:"ACTION",description:i,action_entity:s};return a&&(l.use_pure_vision=!0),l}function Ra(e,t){let i;try{i=Xp(e)}catch{return}let n=i.contents;if(!n||!Tt(n))return;if(i.commentBefore)t.comment=i.commentBefore;else{let l=n.items?.[0];l?.key&&l.key.commentBefore&&(t.comment=l.key.commentBefore)}let o=n,a=o.get("statements",!0);ie(a)&&t.statements&&Et(a,t.statements);let r=o.get("teardown",!0);ie(r)&&t.teardown&&Et(r,t.teardown)}function Et(e,t){e.commentBefore&&t.length>0&&(t[0].comment=e.commentBefore);for(let i=0;i<Math.min(e.items.length,t.length);i++){let n=e.items[i];n.commentBefore&&!(i===0&&e.commentBefore)&&(t[i].comment=n.commentBefore);let o=t[i];if(o.type==="STEP"&&Tt(n)){let a=n.get("statements",!0);ie(a)&&Et(a,o.statements)}else if(o.type==="IF_ELSE"&&Tt(n)){let a=n.get("THEN",!0);ie(a)&&Et(a,o.then);let r=n.get("ELSE",!0);ie(r)&&o.else&&Et(r,o.else)}else if(o.type==="WHILE_LOOP"&&Tt(n)){let a=n.get("DO",!0);ie(a)&&Et(a,o.body)}}}var At,Jp,ld,ag,go=y(()=>{"use strict";La();At={lineWidth:120,defaultKeyType:"PLAIN",defaultStringType:"PLAIN"};Jp=new Set(["intent","description","action","locator","xpath","frame_path","args","js"]);ld=1024*1024;ag=new Set(["action","intent","desc","locator","xpath","use_pure_vision"])});import{parse as rg,stringify as sg}from"yaml";function Fa(e,t){let i=[];t.version!=="1.0"&&i.push(`Unsupported patch version: ${t.version}`),(!Array.isArray(t.operations)||t.operations.length===0)&&i.push("Patch must have at least one operation");for(let n=0;n<t.operations.length;n++){let o=t.operations[n],a=`operations[${n}]`;switch(o.reason||i.push(`${a}: missing reason`),o.op){case"remove":{(typeof o.index!="number"||o.index<0||o.index>=e.length)&&i.push(`${a}: index ${o.index} out of bounds (0..${e.length-1})`);break}case"modify":{(typeof o.index!="number"||o.index<0||o.index>=e.length)&&i.push(`${a}: index ${o.index} out of bounds (0..${e.length-1})`),(o.statement===void 0||o.statement===null)&&i.push(`${a}: missing statement`);break}case"insert":{(typeof o.index!="number"||o.index<0||o.index>=e.length)&&i.push(`${a}: index ${o.index} out of bounds (0..${e.length-1})`),o.position!=="before"&&o.position!=="after"&&i.push(`${a}: position must be 'before' or 'after'`),(o.statement===void 0||o.statement===null)&&i.push(`${a}: missing statement`);break}default:i.push(`${a}: unknown operation type "${o.op}"`)}}return{valid:i.length===0,errors:i}}function Ha(e,t){let i=Fa(e,t);if(!i.valid)throw new Error(`Invalid patch: ${i.errors.join("; ")}`);let n=[...e],o=t.operations.map((s,l)=>({...s,originalOrder:l})),a={remove:0,modify:1,insert:2},r=[...o].sort((s,l)=>s.index!==l.index?l.index-s.index:a[s.op]-a[l.op]);for(let s of r)switch(s.op){case"remove":n.splice(s.index,1);break;case"modify":n[s.index]=s.statement;break;case"insert":s.position==="before"?n.splice(s.index,0,s.statement):n.splice(s.index+1,0,s.statement);break}return n}function xd(e,t){let i=rg(e);if(!i||typeof i!="object")throw new Error("Invalid YAML: expected an object at root level");let n=i.statements;if(!Array.isArray(n))throw new Error('YAML must have a "statements" array');let o=Ha(n,t);i.statements=o;let a=sg(i,{lineWidth:120,defaultKeyType:"PLAIN",defaultStringType:"PLAIN"});return qe(a),{modifiedYaml:a,modifiedStatements:o}}var vd=y(()=>{"use strict";go()});function Wa(e){for(let t of e){if(t.type==="STEP"){let n=t;if(n.reference_id||n.template_path)return!0}let i=Me(t);for(let n of i)if(Wa(n.statements))return!0}return!1}function Sd(e){let t=new Set;function i(n){for(let o of n){if(o.type==="STEP"){let r=o;r.reference_id&&t.add(r.reference_id)}let a=Me(o);for(let r of a)i(r.statements)}}return i(e),Array.from(t)}function Ad(e){if(!e?.statements||!Array.isArray(e.statements))return{};let t={};return Ue(e.statements,"main",t),e.teardown&&Array.isArray(e.teardown)&&Ue(e.teardown,"teardown",t),t}function Re(e,t,i){let n=e+".",o=t.filter(([c])=>c===e||c.startsWith(n));if(o.length===0)return[];let a=[],r=new Set;for(let[c]of o){let u=c===e?"":c.slice(n.length);if(!u)continue;let m=u.split(".")[0];r.has(m)||r.add(m)}let s=Array.from(r);s.sort((c,u)=>{let m=/^\d+$/.test(c)?parseInt(c,10):-1,g=/^\d+$/.test(u)?parseInt(u,10):-1;return m>=0&&g>=0?m-g:c==="then"&&u==="else"?-1:c==="else"&&u==="then"||c==="body"?1:u==="body"?-1:c.localeCompare(u)});function l(c){return i[c]}function d(c){let u=c.match(/^(IF|WHILE)\s+([\s\S]+)$/);return{type:"AI_MODE",expression:(u?u[2].trim():c)||"true"}}for(let c of s){let u=e?`${e}.${c}`:c,m=l(u),g=m?.description??"",w=u;if(c==="then"){let _=`${e}.then`,k=`${e}.else`,E=Re(_,t,i),I=Re(k,t,i),P=l(e),$=P?d(P.description):{type:"JS_CODE",expression:"true"};a.push({uid:e,type:"IF_ELSE",condition:$,then:E,...I.length>0?{else:I}:{}});continue}if(c==="else")continue;if(c==="body"){let _=`${e}.body`,k=Re(_,t,i),E=l(e),I=E?d(E.description):{type:"JS_CODE",expression:"true"};a.push({uid:e,type:"WHILE_LOOP",condition:I,body:k});continue}let v=`${e}.${c}`,x=t.some(([_])=>_.startsWith(v+".then.")||_===v+".then"),p=t.some(([_])=>_.startsWith(v+".else.")||_===v+".else"),f=t.some(([_])=>_.startsWith(v+".body.")||_===v+".body"),S=t.filter(([_])=>{if(!_.startsWith(v+"."))return!1;let E=_.slice(v.length+1).split(".")[0];return/^\d+$/.test(E)&&E!=="then"&&E!=="else"&&E!=="body"});if(x||p){let _=v+".then",k=v+".else",E=Re(_,t,i),I=Re(k,t,i),P=m?d(g):{type:"JS_CODE",expression:"true"};a.push({uid:u,type:"IF_ELSE",condition:P,then:E,...I.length>0?{else:I}:{}})}else if(f){let _=v+".body",k=Re(_,t,i),E=m?d(g):{type:"JS_CODE",expression:"true"};a.push({uid:u,type:"WHILE_LOOP",condition:E,body:k})}else if(S.length>0){let _=Re(v,t,i);a.push({uid:u,type:"STEP",description:g||"Group",statements:_})}else a.push({uid:u,type:"ACTION",description:g||"Action",action_entity:m?.action_entity})}return a}function Md(e){let t=Object.entries(e),i=n=>{let o=n+".";return t.some(([r])=>r===n||r.startsWith(o))?Re(n,t,e):[]};return{before:i("before"),main:i("main"),teardown:i("teardown"),after:i("after")}}var Me,ne,Fe,He,We,Oi,_d,kd,lg,cg,Ed,Td,Ue,fo=y(()=>{"use strict";Me=e=>{let t=[];switch(e.type){case"STEP":e.statements&&t.push({key:"statements",statements:e.statements});break;case"IF_ELSE":e.then&&t.push({key:"then",statements:e.then}),e.else&&t.push({key:"else",statements:e.else});break;case"WHILE_LOOP":e.body&&t.push({key:"body",statements:e.body});break}return t},ne=(e,t,i=void 0,n="root")=>{for(let o=0;o<e.length;o++){let a=e[o],r=a.uid;if(r===t)return{stableId:r,path:[o],statement:a,parent:i,containerKey:n,index:o};let s=Me(a);for(let l of s){let d=ne(l.statements,t,a,l.key);if(d)return{...d,path:[o,l.key,...d.path]}}}return null},Fe=(e,t,i)=>{let n=ne(e,t);if(!n)return null;let{statement:o,parent:a,containerKey:r,index:s}=n,l=null;switch(o.type){case"DRAFT":case"ACTION":l=He(e,n)||We(e,n);break;case"STEP":if(o.statements&&o.statements.length>0)return o.statements[0];l=He(e,n)||We(e,n);break;case"IF_ELSE":if(i===!0&&o.then&&o.then.length>0)return o.then[0];if(i===!1&&o.else&&o.else.length>0)return o.else[0];l=He(e,n)||We(e,n);break;case"WHILE_LOOP":if(i===!0&&o.body&&o.body.length>0)return o.body[0];l=He(e,n)||We(e,n);break;default:l=He(e,n)||We(e,n);break}if(a&&a.type==="WHILE_LOOP"&&r==="body"){if(!l)return a;let d=ne(e,l.uid);if(!d||d.parent!==a)return a}return l},He=(e,t)=>{if(!t.parent)return e[t.index+1]||null;let n=Me(t.parent).find(o=>o.key===t.containerKey);return n&&t.index+1<n.statements.length?n.statements[t.index+1]:null},We=(e,t)=>{if(!t.parent)return null;let i=t.parent.uid,n=ne(e,i);return n?He(e,n)||We(e,n):null},Oi=e=>{let t=[],i=n=>{for(let o of n){t.push(o);let a=Me(o);for(let r of a)i(r.statements)}};return i(e),t},_d=e=>{switch(e.type){case"DRAFT":case"ACTION":return!0;case"STEP":return!0;case"IF_ELSE":case"WHILE_LOOP":return!0;default:return!1}},kd=(e,t,i)=>{if(!ne(e,t))return null;if(i===null){let s=[],l=t;for(;l!==null&&ne(e,l);)if(s.push(l),l=Fe(e,l)?.uid||null,s.length>1e3)return null;return s}if(!ne(e,i))return null;if(t===i)return[];let a=[],r=t;for(;r&&r!==i;){let s=ne(e,r);if(!s)break;if(a.push(r),s.statement.type==="IF_ELSE"){let l=lg(s.statement,i);l?r=Fe(e,r,l==="then")?.uid||null:r=Fe(e,r)?.uid||null}else s.statement.type==="WHILE_LOOP"?cg(s.statement,i)?r=Fe(e,r,!0)?.uid||null:r=Fe(e,r,!1)?.uid||null:r=Fe(e,r)?.uid||null;if(a.length>1e3)return null}return r===i?a:null},lg=(e,t)=>{if(e.type!=="IF_ELSE")return null;let i=e;return i.then&&ne(i.then,t)?"then":i.else&&ne(i.else,t)?"else":null},cg=(e,t)=>{if(e.type!=="WHILE_LOOP")return!1;let i=e;return!!(i.body&&ne(i.body,t))};Ed=e=>e.startsWith("ai_")?!0:["js_code","function","assert","verify","wait_for_download_complete","extract_activation_code","extract_email_content"].includes(e),Td=e=>!["js_code","function","assert","ai_assert","verify","ai_extract","ai_wait_until","upload_file","login","extract_activation_code","extract_email_content","ai_step"].includes(e),Ue=(e,t,i)=>{e.forEach((n,o)=>{let a=`${t}.${o}`;n.type==="DRAFT"?i[a]={description:n.description||"Draft",action_entity:void 0}:n.type==="ACTION"?i[a]={description:n.description||"Action",action_entity:n.action_entity,locator:n.locator}:n.type==="STEP"&&n.statements?Ue(n.statements,a,i):n.type==="IF_ELSE"?(i[a]={description:"IF "+(n.condition?.expression||""),action_entity:void 0},n.then&&Ue(n.then,`${a}.then`,i),n.else&&Ue(n.else,`${a}.else`,i)):n.type==="WHILE_LOOP"&&(i[a]={description:"WHILE "+(n.condition?.expression||""),action_entity:void 0},n.body&&Ue(n.body,`${a}.body`,i))})}});function Ba(e){let t=0,i=0;for(let n of e)if(n.type==="DRAFT")i++;else if(n.type==="ACTION"){let o=n.action_entity?.action_data?.action_name??"";Ua.has(o)||t++}return{action:t,draft:i}}function ug(e){try{return new Function(`return async function() { ${e} }`),null}catch(t){return t.message}}function Cd(e){try{return new Function(`return async function() { return (${e}) }`),null}catch(t){return t.message}}function hg(e){let t=e.split(/\r?\n/).map(a=>a.trim()).filter(a=>a.length>0&&!a.startsWith("//")),i=t.length,n=t.join(`
4549
- `).match(/\bawait\b/g),o=n?n.length:0;return i<=Id&&o<=Pd?null:`${i} non-blank line(s), ${o} await(s) \u2014 limits are ${Id} lines and ${Pd} awaits. The VERIFY js: field is a cache for one natural-language assertion, not a place for multi-step logic. Break this into multiple statements \u2014 one VERIFY per assertion \u2014 so each step is visible in the debugger and self-healable. For freeform setup code (mocking, storage), use the description: + js: escape hatch, which has no complexity cap.`}function $d(e,t){let i=t?.coverageThreshold??dg,n=[],o=[],a;try{a=qe(e)}catch(m){return{valid:!1,errors:[`Invalid YAML: ${m.message}`],warnings:[],stats:{total:0,action:0,draft:0,coverage:0}}}a.goal||n.push('Missing required field: "goal"'),a.statements?.length||n.push('Missing required field: "statements"');let r=[...Oi(a.statements??[]),...a.teardown?Oi(a.teardown):[]],{action:s,draft:l}=Ba(r),d="Hint: in YAML double-quoted strings, backslashes are escape characters \u2014 use \\\\/ instead of \\/ for regex, or use single quotes.";for(let m of r){let g=m;if(g.reference_id!==void 0){let w=g.description||m.uid;n.push(`Unresolved cloud template reference on statement "${w}" (reference_id: ${g.reference_id}). Local YAML tests cannot use reference_id \u2014 inline the template statements or use the local "template:" key instead.`)}if(m.type==="ACTION"){let w=m,v=w.action_entity?.action_data?.action_name??"";if(v==="js_code"||v==="js_action"||v==="verify"||v==="ai_assert"){let x=w.action_entity?.action_data?.kwargs?.code;if(typeof x=="string"){let p=ug(x);if(p){let f=w.description||v;n.push(`Invalid JS in "${f}": ${p}. ${d}`)}else if(v==="verify"){let f=hg(x);if(f){let S=w.description||v;n.push(`JS cache for "${S}" is too complex: ${f}`)}}}}}if(m.type==="IF_ELSE"){let w=m;if(w.condition.type==="JS_CODE"){let v=Cd(w.condition.expression);v&&n.push(`Invalid JS in IF condition "${w.condition.expression}": ${v}. ${d}`)}}if(m.type==="WHILE_LOOP"){let w=m;if(w.condition.type==="JS_CODE"){let v=Cd(w.condition.expression);v&&n.push(`Invalid JS in WHILE condition "${w.condition.expression}": ${v}. ${d}`)}}}let c=s+l,u=c>0?Math.round(s/c*100):0;return c>0&&u/100<i&&o.push(`Low action coverage: ${s}/${c} statements (${u}%) are enriched with action/js. ${l} draft statement(s) still need enrichment. Use MCP tools (act, get_locators) to convert drafts to actions.`),{valid:n.length===0,errors:n,warnings:o,stats:{total:c,action:s,draft:l,coverage:u}}}var dg,Id,Pd,Ua,Ld=y(()=>{"use strict";go();fo();dg=.5,Id=5,Pd=3,Ua=new Set(["verify","ai_assert","done","go_to_url","ai_wait_until","wait","js_code"])});function Dd(e){return e?e.startsWith(ue)?"android":e.startsWith(he)?"ios":"web":"web"}function Od(e){return e?e.startsWith(ue)||e.startsWith(he):!1}function Nd(e){return!!e&&e.startsWith(ue)}function Rd(e){return!!e&&e.startsWith(he)}function Fd(e){return e.startsWith(ue)?e.slice(ue.length):e.startsWith(he)?e.slice(he.length):e}function Hd(e){return`${ue}${e}`}function Wd(e){return`${he}${e}`}function wo(e){return e?e.startsWith("http://")||e.startsWith("https://"):!1}function Ud(e){return e?!wo(e):!1}function Ga(e){return e?wo(e)?["web"]:["android","ios"]:["web","android","ios"]}function Bd(e,t){if(!t)return!0;let i=Ga(t);return e==="desktop"||e==="mobile"?i.includes("web"):i.includes(e)}var ue,he,bo=y(()=>{"use strict";ue="android:",he="ios:"});function Gd(e){return e.startsWith(he)?e:`${he}${e}`}function Kd(e){let t=e.iosVersion?` (iOS ${e.iosVersion})`:"";return e.deviceType==="simulator"?`${e.name}${t} - Simulator`:`${e.name}${t}`}function jd(e){return!!(/^[0-9a-fA-F]{40}$/.test(e)||/^[0-9a-fA-F]{8}-[0-9a-fA-F]{16}$/.test(e))}var zd=y(()=>{"use strict";bo()});var Ka,yo,ja,za,Va,Xa,Ya,Ja,qa,Za,Ze,Qa,Ni,er,tr,Mt,Vd,Ri,Xd,Yd,xo,Jd,qd,Zd,Qd,eu=y(()=>{"use strict";Ka="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36",yo=112,ja=1920,za=1080,Va=1920,Xa=1080-yo,Ya=1280,Ja=720,qa=500,Za=500,Ze="Desktop Chrome",Qa=(e=>(e.Chromium="chromium",e.Firefox="firefox",e.Webkit="webkit",e))(Qa||{}),Ni={"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"}},er=(e=>(e.Desktop="desktop",e.Mobile="mobile",e))(er||{}),tr={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"]},Mt=(e,t=!1)=>{let i=["chromium"];return t&&i.push("webkit"),tr[e].map(n=>Ni[n]).filter(n=>n.defaultBrowserType&&i.includes(n.defaultBrowserType))},Vd=()=>Object.keys(Ni),Ri=e=>Ni[e],Xd={desktop:{label:"Desktop",type:"desktop",devices:Mt("desktop")},mobile:{label:"Mobile Web",type:"mobile",devices:Mt("mobile")}},Yd={desktop:{label:"Desktop",type:"desktop",devices:Mt("desktop",!0)},mobile:{label:"Mobile Web",type:"mobile",devices:Mt("mobile",!0)}},xo=(e,t=!1)=>{let i={userAgent:Ka,viewport:{width:Va,height:Xa},isMobile:!1,hasTouch:!1};if(!e||e===Ze)return i;let n=Ri(e);if(!n)return i;let{width:o,height:a}=n.viewport,r=Math.max(qa/o,1),s=Math.max(Za/a,1),l=Math.max(r,s),d={width:Math.round(o*l),height:Math.round(a*l)};return{userAgent:n.userAgent,viewport:t?d:n.viewport,isMobile:n.isMobile,hasTouch:n.hasTouch}},Jd=e=>{let t={width:ja,height:za};if(!e||e===Ze)return t;let i=xo(e);return i.viewport?{width:i.viewport.width,height:i.viewport.height+yo}:t},qd=e=>{let t={width:Ya,height:Ja};if(!e||e===Ze)return t;let i=xo(e);return i.viewport?{width:i.viewport.width,height:i.viewport.height}:t},Zd=e=>!e||e===Ze?void 0:Ri(e)?.channel,Qd=e=>!e||e===Ze?"chromium":Ri(e)?.defaultBrowserType??"chromium"});var ir,nr,tu=y(()=>{"use strict";ir=(e=>(e.PASSWORD="password",e.OAUTH2="oauth2",e.SSO="sso",e.API="api",e))(ir||{}),nr=(e=>(e.SMS="sms",e.EMAIL="email",e.TOTP="totp",e))(nr||{})});function iu(){return{version:"1.0",entries:{}}}function nu(e,t){return{action_entity:e,updated_at:new Date().toISOString(),updated_by:{source:"runner",test_run_id:t}}}function ou(e,t){let i=t?.entries[e.uid],n=i?.action_entity??e.action_entity;return e.locator&&n?{...n,locator:e.locator}:i?i.action_entity:e.action_entity?e.action_entity:null}function au(e,t,i,n){return e.entries[t]={action_entity:i,updated_at:new Date().toISOString(),updated_by:n},e}function ru(e,t){let i=e??{version:"1.0",entries:{}};for(let[n,o]of t)i.entries[n]=o;return i}function su(e){return e?Object.keys(e.entries).length===0:!0}function lu(e){return e?Object.keys(e.entries).length:0}function cu(e,t){if(!t||Object.keys(t.entries).length===0)return e;let i=or(e.statements??[],t),n=e.teardown?or(e.teardown,t):void 0;return{...e,statements:i,teardown:n}}function or(e,t){return e.map(i=>mg(i,t))}function mg(e,t){if(e.type==="ACTION"){let o=e,a=t.entries[o.uid];return a?{...o,action_entity:a.action_entity}:o}let i=Me(e);if(i.length===0)return e;let n={};for(let o of i)n[o.key]=or(o.statements,t);return{...e,...n}}var du=y(()=>{"use strict";fo()});var ar,rr,uu,hu=y(()=>{"use strict";ar=(e=>(e.DRAFT="DRAFT",e.STEP="STEP",e.ACTION="ACTION",e.IF_ELSE="IF_ELSE",e.WHILE_LOOP="WHILE_LOOP",e))(ar||{}),rr=(e=>(e.JS_CODE="JS_CODE",e.AI_MODE="AI_MODE",e))(rr||{}),uu=18e4});var mu,gu=y(()=>{"use strict";mu=class pu{data={};sensitive=new Set;get(t){return this.data[t]}set(t,i,n=!1){this.data[t]=i,n?this.sensitive.add(t):this.sensitive.has(t)&&this.sensitive.delete(t)}getAll(){return{...this.data}}isSensitive(t){return this.sensitive.has(t)}getAllSensitiveKeys(){return new Set(this.sensitive)}delete(t){return this.sensitive.delete(t),delete this.data[t]}clear(){this.data={},this.sensitive.clear()}has(t){return t in this.data}get size(){return Object.keys(this.data).length}merge(t){for(let[i,n]of Object.entries(t.getAll()))this.set(i,n,t.isSensitive(i))}toJSON(){return{data:{...this.data},sensitiveKeys:Array.from(this.sensitive)}}static fromJSON(t){let i=new pu;if(t.data){let n=new Set(t.sensitiveKeys||[]);for(let[o,a]of Object.entries(t.data))i.set(o,a,n.has(o))}return i}}});function fu(e,t=pg()){return{copilot:e?.models?.copilot||t.COPILOT_MODEL||_o,webagent:e?.models?.webagent||t.WEB_AGENT_MODEL||dr,computer_use:e?.models?.computer_use||t.COMPUTER_USE_MODEL||ur}}function wu(e){if(e){if(e.WEB_AGENT_MODEL)return e.WEB_AGENT_MODEL;if(e.GOOGLE_API_KEY)return vo;if(e.ANTHROPIC_API_KEY)return sr;if(e.OPENAI_API_KEY)return lr;if(e.SHIPLIGHT_API_TOKEN)return _o}}function bu(e){if(e){if(e.COMPUTER_USE_MODEL)return e.COMPUTER_USE_MODEL;if(e.GOOGLE_API_KEY)return Fi;if(e.OPENAI_API_KEY)return cr;if(e.SHIPLIGHT_API_TOKEN)return Fi}}var sr,vo,lr,Fi,cr,_o,dr,ur,pg,yu=y(()=>{"use strict";sr="claude-haiku-4-5",vo="gemini-3.1-flash-lite",lr="gpt-5.4-mini",Fi="gemini-3-flash-preview",cr="gpt-5.4",_o="claude-sonnet-4-6",dr=vo,ur=Fi,pg=()=>typeof process<"u"?process.env:{}});var hr,xu=y(()=>{"use strict";hr=(e=>(e.INITIALIZING="initializing",e.READY="ready",e.PROCESSING="processing",e.STOPPING="stopping",e.WAITING_USER="waiting_user",e.COMPLETED="completed",e.FAILED="failed",e))(hr||{})});function vu(e){let t=e.trim();if(!t||t.startsWith("List of devices"))return null;let i=t.split(/\s+/);if(i.length<2)return null;let n=i[0],o=i[1],a="usb";return n.startsWith("emulator-")?a="emulator":n.includes(":")&&(a="wifi"),{id:n,state:o,connectionType:a}}function _u(e){return e.startsWith(ue)?e:`${ue}${e}`}function ku(e){return e.model?`${e.model} (${e.id})`:e.connectionType==="emulator"?`Android Emulator (${e.id})`:e.id}var Su=y(()=>{"use strict";bo()});var mr={};et(mr,{ADDRESS_BAR_HEIGHT:()=>yo,ANDROID_DEVICE_PREFIX:()=>ue,ActionEntitySchema:()=>Ia,ActionSchema:()=>Ca,AgentStatus:()=>hr,BaseStatementSchema:()=>Je,BrowserType:()=>Qa,ConditionSchema:()=>uo,ConditionType:()=>rr,ConditionTypeSchema:()=>Aa,DEFAULT_ANTHROPIC_MODEL:()=>sr,DEFAULT_COMPUTER_USE_MODEL:()=>ur,DEFAULT_COPILOT_MODEL:()=>_o,DEFAULT_DEVICE_NAME:()=>Ze,DEFAULT_GEMINI_COMPUTER_USE_MODEL:()=>Fi,DEFAULT_GOOGLE_MODEL:()=>vo,DEFAULT_OPENAI_COMPUTER_USE_MODEL:()=>cr,DEFAULT_OPENAI_MODEL:()=>lr,DEFAULT_WEBAGENT_MODEL:()=>dr,DEFAULT_WHILE_LOOP_TIMEOUT_MS:()=>uu,DEVICE_CATEGORIES:()=>tr,DeviceType:()=>er,DraftSchema:()=>Pa,IOS_DEVICE_PREFIX:()=>he,LoginType:()=>ir,MIN_WINDOW_HEIGHT:()=>Za,MIN_WINDOW_WIDTH:()=>qa,NON_INTENT_ACTIONS:()=>Ua,NodeJSCodeCommon:()=>Zc,PLAYWRIGHT_DEVICES:()=>Ni,RECORD_VIDEO_HEIGHT:()=>Ja,RECORD_VIDEO_WIDTH:()=>Ya,StatementSchema:()=>te,StatementType:()=>ar,StatementTypeSchema:()=>Ma,TestFlowSchema:()=>ho,TestGroupEntrySchema:()=>$a,TestGroupSchema:()=>Li,TwoFactorAuthType:()=>nr,UI_DEVICE_CATEGORIES:()=>Xd,UI_DEVICE_CATEGORIES_ELECTRON:()=>Yd,USER_AGENT:()=>Ka,VIEWPORT_HEIGHT:()=>Xa,VIEWPORT_WIDTH:()=>Va,VariableStore:()=>mu,WINDOW_HEIGHT:()=>za,WINDOW_WIDTH:()=>ja,actionEntityToYaml:()=>pd,actionStepsMapToTestFlowSections:()=>Md,allowPureVisionAction:()=>Td,applyPatchToYaml:()=>Ha,applyPatchToYamlString:()=>xd,collectActionSteps:()=>Ue,convertPlaywrightActionToEntity:()=>ad,countIntentStatements:()=>Ba,createAndroidDeviceName:()=>Hd,createEmptyStore:()=>iu,createIOSDeviceName:()=>Wd,createRunnerStoreEntry:()=>nu,extractActionStepsFromTestFlow:()=>Ad,extractAndAttachComments:()=>Ra,extractDeviceIdentifier:()=>Fd,extractElementDescription:()=>Sa,extractElementDescriptionFromAriaSnapshot:()=>Ea,extractLocatorFromCode:()=>Ta,extractYamlMetadata:()=>bd,findNextAfterContainer:()=>We,findNextSibling:()=>He,findNextStatement:()=>Fe,findPathBetweenStatements:()=>kd,findStatementPathById:()=>ne,generateUid:()=>od,getAllDeviceNames:()=>Vd,getAllReferenceIds:()=>Sd,getAllStatementsInOrder:()=>Oi,getAndroidDeviceDisplayName:()=>ku,getBrowserWindowSize:()=>Jd,getCompatiblePlatforms:()=>Ga,getDeviceBrowserType:()=>Qd,getDeviceByName:()=>Ri,getDeviceChannel:()=>Zd,getDeviceOptions:()=>xo,getDevicesByCategory:()=>Mt,getIOSDeviceDisplayName:()=>Kd,getLoginConfigPlatform:()=>ed,getRecordVideoSize:()=>qd,getStatementContainers:()=>Me,getStoreSize:()=>lu,getTestPlatformFromDeviceName:()=>Dd,hasReferenceIds:()=>Wa,isAndroidDevice:()=>Nd,isAppPackage:()=>Ud,isDynamicAction:()=>Ed,isExecutableStatement:()=>_d,isIOSDevice:()=>Rd,isNativeDevice:()=>Od,isPhysicalDeviceUDID:()=>jd,isPlatformCompatibleWithUrl:()=>Bd,isStoreEmpty:()=>su,isWebUrl:()=>wo,mergeActionEntitiesIntoTestFlow:()=>cu,mergeStoreUpdates:()=>ru,parseAdbDeviceLine:()=>vu,parseYamlArrayItems:()=>wd,replaceVariables:()=>id,resolveActionEntity:()=>ou,resolveComputerUseModelFromEnv:()=>bu,resolveModels:()=>fu,resolveWebAgentModelFromEnv:()=>wu,suiteToYaml:()=>Na,testFlowToYaml:()=>ud,testFlowToYamlObject:()=>Oa,toAndroidDeviceName:()=>_u,toIOSDeviceName:()=>Gd,updateStoreEntry:()=>au,validatePatch:()=>Fa,validateTestYaml:()=>$d,yamlObjectsToString:()=>hd,yamlToActionEntity:()=>gd,yamlToTestFlow:()=>qe});var pr=y(()=>{"use strict";Qc();td();nd();rd();vd();Ld();go();La();zd();eu();tu();du();fo();hu();gu();yu();xu();Su();bo()});import*as Ie from"path";import*as Mu from"fs";import{test as gg,expect as vA,chromium as fg}from"@playwright/test";import*as Z from"fs";import*as tt from"path";import{randomUUID as wr}from"crypto";import{tmpdir as br}from"os";function yr(e){return[`--disable-extensions-except=${e}`,`--load-extension=${e}`,"--no-first-run","--disable-default-apps"]}function xr(e){if(!Z.existsSync(e))return console.warn(`[fixture] extensionStorageState file not found: ${e}`),null;let t;try{t=JSON.parse(Z.readFileSync(e,"utf-8"))}catch(a){throw new Error(`[fixture] Failed to parse extensionStorageState at ${e}: ${a}`)}let i=t;if(!Array.isArray(i.cookies))return null;let n=(Date.now()+365*24*60*60*1e3)/1e3,o=i.cookies.filter(a=>a&&typeof a=="object"&&typeof a.name=="string"&&typeof a.domain=="string");return o.length<i.cookies.length&&console.warn(`[fixture] Skipped ${i.cookies.length-o.length} malformed cookies (missing name or domain)`),o.map(a=>({...a,expires:n}))}function vr(e){if(e){let i=tt.resolve(process.cwd(),e),n=tt.join(br(),`ext-profile-${wr()}`);if(Z.existsSync(i)){try{Z.cpSync(i,n,{recursive:!0})}catch(a){try{Z.rmSync(n,{recursive:!0,force:!0})}catch(r){console.warn("[fixture] Failed to clean up partial profile copy:",n,r)}throw new Error(`[fixture] Failed to copy extension profile from ${i}: ${a}`)}let o=tt.join(n,"SingletonLock");Z.existsSync(o)&&Z.rmSync(o,{force:!0})}else Z.mkdirSync(n,{recursive:!0});return n}let t=tt.join(br(),`ext-profile-${wr()}`);return Z.mkdirSync(t,{recursive:!0}),t}va();import v1 from"dotenv";var Up="__shiplightDotenvCache__";function Bp(){return globalThis[Up]}function _a(){let e=Bp();return e===void 0?process.env:e}async function wg(e){let i=await import(Ie.resolve(process.cwd(),e.auth)),n=i.login||i.default;if(typeof n!="function")throw new Error(`auth module "${e.auth}" must export a login(args) function that returns a storageState file path`);let o=await n(e.args||{});if(typeof o!="string")throw new Error(`auth module "${e.auth}" login() must return a storageState file path (got ${typeof o})`);return o}function Eu(e){return!(!e||e==="off")}function Iu(e,t){return!e||e==="off"?!1:e==="on"?!0:e==="retain-on-failure"?t.status!==t.expectedStatus:e==="on-first-retry"?t.retry>0:typeof e=="object"&&e!==null&&"mode"in e?Iu(e.mode,t):!0}async function Tu(e,t,i){let n=Iu(t,i);for(let o of e)try{if(n){let a=await o.path();await i.attach("video",{path:a,contentType:"video/webm"})}else await o.delete()}catch(a){console.warn("[fixture] Failed to process video:",a)}}var ko;async function Au(){return ko||(ko=await Promise.resolve().then(()=>(va(),qc)),ko)}var bg=new Set(["get","set","getAll","has","__variableStore"]);function yg(e){let t={__variableStore:e,get(i){return e.get(i)},set(i,n,o=!1){e.set(i,n,o)},getAll(){return e.getAll()}};return new Proxy(t,{get(i,n,o){if(n in i)return Reflect.get(i,n,o);if(typeof n=="string")return i.get(n)},set(i,n,o){return typeof n!="string"||bg.has(n)?Reflect.set(i,n,o):(i.set(n,o),!0)},has(i,n){return n in i?!0:typeof n=="string"?e.has?.(n)??!1:!1}})}function xg(e){if(!e)return null;let t;try{t=JSON.parse(e)}catch(n){throw new Error(`SHIPLIGHT_VARS_OVERRIDE is not valid JSON: ${n.message}`)}if(t===null||typeof t!="object"||Array.isArray(t))throw new Error("SHIPLIGHT_VARS_OVERRIDE must be a JSON object");let i={};for(let[n,o]of Object.entries(t)){if(typeof o!="string")throw new Error(`SHIPLIGHT_VARS_OVERRIDE key "${n}" must be a string`);i[n]=o}return i}function vg(e,t,i){let n=r=>{if(!r||!(e in r))return null;let s=r[e];return s&&typeof s=="object"&&"value"in s?s.sensitive===!0:!1},o=n(i);if(o!==null)return o;let a=n(t);return a!==null?a:!1}function _g(e,t,i,n=process.env.SHIPLIGHT_VARS_OVERRIDE){let o=xg(n);if(o)for(let[a,r]of Object.entries(o)){let s=vg(a,t,i);e.set(a,r,s)}}var kg=["GOOGLE_API_KEY","ANTHROPIC_API_KEY","OPENAI_API_KEY","OPENAI_BASE_URL","ANTHROPIC_MODELS_USE_VERTEXAI","GOOGLE_GENAI_USE_VERTEXAI","GOOGLE_CLOUD_PROJECT","GOOGLE_CLOUD_LOCATION","MAILGUN_API_KEY","MAILGUN_DOMAIN","SHIPLIGHT_API_TOKEN","SHIPLIGHT_API_URL"];function Sg(e=_a()){let t={};for(let i of kg)t[i]=e[i]??"";return t}var EA=gg.extend({account:[void 0,{option:!0}],autoDismissModal:[!1,{option:!0}],variables:[void 0,{option:!0}],extensionDir:[void 0,{option:!0}],userDataDir:[void 0,{option:!0}],extensionStorageState:[void 0,{option:!0}],launchOptions:async({launchOptions:e},t)=>{if(!process.env.SHIPLIGHT_REGISTRY_URL){await t(e);return}let i=e?.args??[],n={...e,args:[...i,"--remote-debugging-port=0"]};await t(n)},browser:async({browser:e},t)=>{let i=null;if(process.env.SHIPLIGHT_REGISTRY_URL)try{let n=await oo(process.pid),o=process.env.TEST_WORKER_INDEX??"?";i=await yt({cdpUrl:n,label:`shiplight test w${o}`,pid:process.pid})}catch{}await t(e),await xt(i)},context:async({browser:e,account:t,extensionDir:i,userDataDir:n,extensionStorageState:o},a,r)=>{if(i||n){if(t||r.project.use.auth)throw new Error('Cannot use both "extensionDir"/"userDataDir" and "auth" \u2014 persistent context tests manage their own context. Use extensionStorageState for authentication instead.');let l=r.project.use?.browserName;l&&l!=="chromium"&&console.warn(`[fixture] Persistent context requires Chromium but project is configured for "${l}". Forcing Chromium.`);let d=process.env.PLAYWRIGHT_HEADLESS==="true";i&&d&&console.warn("[fixture] PLAYWRIGHT_HEADLESS=true with extensionDir \u2014 Chrome extensions will not function in headless mode.");let c=vr(n),u=i?yr(Ie.resolve(process.cwd(),i)):[],m={...r.project.use},{storageState:g,account:w,extensionDir:v,userDataDir:x,extensionStorageState:p,autoDismissModal:f,video:S,..._}=m,k=Eu(S)?{dir:r.outputDir}:void 0,E;try{if(E=await fg.launchPersistentContext(c,{..._,headless:d,args:u,viewport:_.viewport??{width:1280,height:720},...k?{recordVideo:k}:{}}),o){let I=Ie.resolve(process.cwd(),o),P=xr(I);P&&await E.addCookies(P)}await a(E)}finally{let I=E?.pages().map(P=>P.video()).filter(P=>P!==null)??[];if(await E?.close().catch(P=>{console.warn("[fixture] Failed to close persistent context:",P)}),await Tu(I,S,r),!n)try{Mu.rmSync(c,{recursive:!0,force:!0})}catch(P){console.warn("[fixture] Failed to clean up temp profile dir:",c,P)}}}else{let l={...r.project.use},d=r.project.use,c=d.auth?{auth:d.auth,args:d.args}:t;if(c){if(!c.auth)throw new Error("Auth is declared but missing the script path. Provide auth in playwright.config.ts: use: { auth: './auth.login.ts' }");l.storageState=await wg(c)}let u=l.video;Eu(u)&&!l.recordVideo&&(l.recordVideo={dir:r.outputDir});let m=await e.newContext(l);m.addInitScript(Ne);try{await a(m)}finally{let g=m.pages().map(w=>w.video()).filter(w=>w!==null);await m.close(),await Tu(g,u,r)}}},page:async({context:e},t)=>{let i=await e.newPage();await t(i)},testContext:async({variables:e},t,i)=>{let{VariableStore:n}=await Au(),o=new n,a=l=>{if(l)for(let[d,c]of Object.entries(l))typeof c=="string"?o.set(d,c,!1):c&&typeof c=="object"&&"value"in c&&o.set(d,c.value,c.sensitive===!0)},r=i.project.use.variables;a(r),a(e),_g(o,r,e);let s=yg(o);global.testContext=s,global.$=s,global.ctx=s,await t(s),delete global.testContext,delete global.$,delete global.ctx},$:async({testContext:e},t)=>{await t(e)},ctx:async({testContext:e},t)=>{await t(e)},agent:async({page:e,testContext:t,autoDismissModal:i},n,o)=>{let{WebAgent:a,createAgentContext:r,configureSdk:s,parseSdkLogLevelFromEnv:l}=await Au(),d=l();s({env:Sg(),...d!==void 0&&{logLevel:d}});let{resolveWebAgentModelFromEnv:c,resolveComputerUseModelFromEnv:u}=await Promise.resolve().then(()=>(pr(),mr)),m=_a(),g=c(m);if(!g)throw new Error("No AI model configured. Set WEB_AGENT_MODEL, GOOGLE_API_KEY, ANTHROPIC_API_KEY, OPENAI_API_KEY, or SHIPLIGHT_API_TOKEN in your .env file (or in the runner environment for CI).");let w=u(m),v=t.__variableStore,x=r({model:g,computer_use_model:w,variableStore:v,autoDismissModal:i,downloadDir:Ie.join(o.outputDir,"downloads")}),p=Ie.join(o.outputDir,"artifacts");x.stepTracking={results:{},artifactsDir:p};let f=new a(x),S=e.context();f.agentServices.setupPageTracking(S);for(let _ of S.pages())f.setupDownloadTracking(_),f.setupDialogHandling(_);S.on("page",_=>{f.setupDownloadTracking(_),f.setupDialogHandling(_)}),global.agent=f,await n(f),delete global.agent;try{let _=o.outputDir;await f.writeExecutionResults(_);let k=Ie.join(_,"test-results.json");await(await import("fs/promises")).stat(k).catch(()=>null)&&await o.attach("shiplight-results",{path:k,contentType:"application/json"})}catch(_){console.error("[Shiplight] Failed to attach step results:",_)}try{let _=f.getNewActionEntities();if(_.size>0&&o.status==="passed"){let{createEmptyStore:k,createRunnerStoreEntry:E}=await Promise.resolve().then(()=>(pr(),mr)),I=await import("fs/promises"),P=k();for(let[B,z]of _)P.entries[B]=E(z,0);let $=Ie.join(o.outputDir,"new-action-entities.json");await I.writeFile($,JSON.stringify(P,null,2)),await o.attach("shiplight-new-action-entities",{path:$,contentType:"application/json"}),console.log(`[Shiplight] ${_.size} healed action entit${_.size===1?"y":"ies"} saved`)}}catch(_){console.warn("[Shiplight] Failed to persist new action entities:",_)}}});export{kg as SDK_ENV_ALLOWLIST,_g as applyVarsOverride,Sg as buildSdkEnv,yg as createTestContext,vA as expect,vg as isDeclaredSensitive,xg as parseVarsOverrideEnv,wg as resolveAuthState,EA as test};
4549
+ `).match(/\bawait\b/g),o=n?n.length:0;return i<=Id&&o<=Pd?null:`${i} non-blank line(s), ${o} await(s) \u2014 limits are ${Id} lines and ${Pd} awaits. The VERIFY js: field is a cache for one natural-language assertion, not a place for multi-step logic. Break this into multiple statements \u2014 one VERIFY per assertion \u2014 so each step is visible in the debugger and self-healable. For freeform setup code (mocking, storage), use the description: + js: escape hatch, which has no complexity cap.`}function $d(e,t){let i=t?.coverageThreshold??dg,n=[],o=[],a;try{a=qe(e)}catch(m){return{valid:!1,errors:[`Invalid YAML: ${m.message}`],warnings:[],stats:{total:0,action:0,draft:0,coverage:0}}}a.goal||n.push('Missing required field: "goal"'),a.statements?.length||n.push('Missing required field: "statements"');let r=[...Oi(a.statements??[]),...a.teardown?Oi(a.teardown):[]],{action:s,draft:l}=Ba(r),d="Hint: in YAML double-quoted strings, backslashes are escape characters \u2014 use \\\\/ instead of \\/ for regex, or use single quotes.";for(let m of r){let g=m;if(g.reference_id!==void 0){let w=g.description||m.uid;n.push(`Unresolved cloud template reference on statement "${w}" (reference_id: ${g.reference_id}). Local YAML tests cannot use reference_id \u2014 inline the template statements or use the local "template:" key instead.`)}if(m.type==="ACTION"){let w=m,v=w.action_entity?.action_data?.action_name??"";if(v==="js_code"||v==="js_action"||v==="verify"||v==="ai_assert"){let x=w.action_entity?.action_data?.kwargs?.code;if(typeof x=="string"){let p=ug(x);if(p){let f=w.description||v;n.push(`Invalid JS in "${f}": ${p}. ${d}`)}else if(v==="verify"){let f=hg(x);if(f){let S=w.description||v;n.push(`JS cache for "${S}" is too complex: ${f}`)}}}}}if(m.type==="IF_ELSE"){let w=m;if(w.condition.type==="JS_CODE"){let v=Cd(w.condition.expression);v&&n.push(`Invalid JS in IF condition "${w.condition.expression}": ${v}. ${d}`)}}if(m.type==="WHILE_LOOP"){let w=m;if(w.condition.type==="JS_CODE"){let v=Cd(w.condition.expression);v&&n.push(`Invalid JS in WHILE condition "${w.condition.expression}": ${v}. ${d}`)}}}let c=s+l,u=c>0?Math.round(s/c*100):0;return c>0&&u/100<i&&o.push(`Low action coverage: ${s}/${c} statements (${u}%) are enriched with action/js. ${l} draft statement(s) still need enrichment. Use MCP tools (act, get_locators) to convert drafts to actions.`),{valid:n.length===0,errors:n,warnings:o,stats:{total:c,action:s,draft:l,coverage:u}}}var dg,Id,Pd,Ua,Ld=y(()=>{"use strict";go();fo();dg=.5,Id=5,Pd=3,Ua=new Set(["verify","ai_assert","done","go_to_url","ai_wait_until","wait","js_code"])});function Dd(e){return e?e.startsWith(ue)?"android":e.startsWith(he)?"ios":"web":"web"}function Od(e){return e?e.startsWith(ue)||e.startsWith(he):!1}function Nd(e){return!!e&&e.startsWith(ue)}function Rd(e){return!!e&&e.startsWith(he)}function Fd(e){return e.startsWith(ue)?e.slice(ue.length):e.startsWith(he)?e.slice(he.length):e}function Hd(e){return`${ue}${e}`}function Wd(e){return`${he}${e}`}function wo(e){return e?e.startsWith("http://")||e.startsWith("https://"):!1}function Ud(e){return e?!wo(e):!1}function Ga(e){return e?wo(e)?["web"]:["android","ios"]:["web","android","ios"]}function Bd(e,t){if(!t)return!0;let i=Ga(t);return e==="desktop"||e==="mobile"?i.includes("web"):i.includes(e)}var ue,he,bo=y(()=>{"use strict";ue="android:",he="ios:"});function Gd(e){return e.startsWith(he)?e:`${he}${e}`}function Kd(e){let t=e.iosVersion?` (iOS ${e.iosVersion})`:"";return e.deviceType==="simulator"?`${e.name}${t} - Simulator`:`${e.name}${t}`}function jd(e){return!!(/^[0-9a-fA-F]{40}$/.test(e)||/^[0-9a-fA-F]{8}-[0-9a-fA-F]{16}$/.test(e))}var zd=y(()=>{"use strict";bo()});var Ka,yo,ja,za,Va,Xa,Ya,Ja,qa,Za,Ze,Qa,Ni,er,tr,Mt,Vd,Ri,Xd,Yd,xo,Jd,qd,Zd,Qd,eu=y(()=>{"use strict";Ka="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36",yo=112,ja=1920,za=1080,Va=1920,Xa=1080-yo,Ya=1280,Ja=720,qa=500,Za=500,Ze="Desktop Chrome",Qa=(e=>(e.Chromium="chromium",e.Firefox="firefox",e.Webkit="webkit",e))(Qa||{}),Ni={"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"}},er=(e=>(e.Desktop="desktop",e.Mobile="mobile",e))(er||{}),tr={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"]},Mt=(e,t=!1)=>{let i=["chromium"];return t&&i.push("webkit"),tr[e].map(n=>Ni[n]).filter(n=>n.defaultBrowserType&&i.includes(n.defaultBrowserType))},Vd=()=>Object.keys(Ni),Ri=e=>Ni[e],Xd={desktop:{label:"Desktop",type:"desktop",devices:Mt("desktop")},mobile:{label:"Mobile Web",type:"mobile",devices:Mt("mobile")}},Yd={desktop:{label:"Desktop",type:"desktop",devices:Mt("desktop",!0)},mobile:{label:"Mobile Web",type:"mobile",devices:Mt("mobile",!0)}},xo=(e,t=!1)=>{let i={userAgent:Ka,viewport:{width:Va,height:Xa},isMobile:!1,hasTouch:!1};if(!e||e===Ze)return i;let n=Ri(e);if(!n)return i;let{width:o,height:a}=n.viewport,r=Math.max(qa/o,1),s=Math.max(Za/a,1),l=Math.max(r,s),d={width:Math.round(o*l),height:Math.round(a*l)};return{userAgent:n.userAgent,viewport:t?d:n.viewport,isMobile:n.isMobile,hasTouch:n.hasTouch}},Jd=e=>{let t={width:ja,height:za};if(!e||e===Ze)return t;let i=xo(e);return i.viewport?{width:i.viewport.width,height:i.viewport.height+yo}:t},qd=e=>{let t={width:Ya,height:Ja};if(!e||e===Ze)return t;let i=xo(e);return i.viewport?{width:i.viewport.width,height:i.viewport.height}:t},Zd=e=>!e||e===Ze?void 0:Ri(e)?.channel,Qd=e=>!e||e===Ze?"chromium":Ri(e)?.defaultBrowserType??"chromium"});var ir,nr,tu=y(()=>{"use strict";ir=(e=>(e.PASSWORD="password",e.OAUTH2="oauth2",e.SSO="sso",e.API="api",e))(ir||{}),nr=(e=>(e.SMS="sms",e.EMAIL="email",e.TOTP="totp",e))(nr||{})});function iu(){return{version:"1.0",entries:{}}}function nu(e,t){return{action_entity:e,updated_at:new Date().toISOString(),updated_by:{source:"runner",test_run_id:t}}}function ou(e,t){let i=t?.entries[e.uid],n=i?.action_entity??e.action_entity;return e.locator&&n?{...n,locator:e.locator}:i?i.action_entity:e.action_entity?e.action_entity:null}function au(e,t,i,n){return e.entries[t]={action_entity:i,updated_at:new Date().toISOString(),updated_by:n},e}function ru(e,t){let i=e??{version:"1.0",entries:{}};for(let[n,o]of t)i.entries[n]=o;return i}function su(e){return e?Object.keys(e.entries).length===0:!0}function lu(e){return e?Object.keys(e.entries).length:0}function cu(e,t){if(!t||Object.keys(t.entries).length===0)return e;let i=or(e.statements??[],t),n=e.teardown?or(e.teardown,t):void 0;return{...e,statements:i,teardown:n}}function or(e,t){return e.map(i=>mg(i,t))}function mg(e,t){if(e.type==="ACTION"){let o=e,a=t.entries[o.uid];return a?{...o,action_entity:a.action_entity}:o}let i=Me(e);if(i.length===0)return e;let n={};for(let o of i)n[o.key]=or(o.statements,t);return{...e,...n}}var du=y(()=>{"use strict";fo()});var ar,rr,uu,hu=y(()=>{"use strict";ar=(e=>(e.DRAFT="DRAFT",e.STEP="STEP",e.ACTION="ACTION",e.IF_ELSE="IF_ELSE",e.WHILE_LOOP="WHILE_LOOP",e))(ar||{}),rr=(e=>(e.JS_CODE="JS_CODE",e.AI_MODE="AI_MODE",e))(rr||{}),uu=18e4});var mu,gu=y(()=>{"use strict";mu=class pu{data={};sensitive=new Set;get(t){return this.data[t]}set(t,i,n=!1){this.data[t]=i,n?this.sensitive.add(t):this.sensitive.has(t)&&this.sensitive.delete(t)}getAll(){return{...this.data}}isSensitive(t){return this.sensitive.has(t)}getAllSensitiveKeys(){return new Set(this.sensitive)}delete(t){return this.sensitive.delete(t),delete this.data[t]}clear(){this.data={},this.sensitive.clear()}has(t){return t in this.data}get size(){return Object.keys(this.data).length}merge(t){for(let[i,n]of Object.entries(t.getAll()))this.set(i,n,t.isSensitive(i))}toJSON(){return{data:{...this.data},sensitiveKeys:Array.from(this.sensitive)}}static fromJSON(t){let i=new pu;if(t.data){let n=new Set(t.sensitiveKeys||[]);for(let[o,a]of Object.entries(t.data))i.set(o,a,n.has(o))}return i}}});function fu(e,t=pg()){return{copilot:e?.models?.copilot||t.COPILOT_MODEL||_o,webagent:e?.models?.webagent||t.WEB_AGENT_MODEL||dr,computer_use:e?.models?.computer_use||t.COMPUTER_USE_MODEL||ur}}function wu(e){if(e){if(e.WEB_AGENT_MODEL)return e.WEB_AGENT_MODEL;if(e.GOOGLE_API_KEY)return vo;if(e.ANTHROPIC_API_KEY)return sr;if(e.OPENAI_API_KEY)return lr;if(e.SHIPLIGHT_API_TOKEN)return _o}}function bu(e){if(e){if(e.COMPUTER_USE_MODEL)return e.COMPUTER_USE_MODEL;if(e.GOOGLE_API_KEY)return Fi;if(e.OPENAI_API_KEY)return cr;if(e.SHIPLIGHT_API_TOKEN)return Fi}}var sr,vo,lr,Fi,cr,_o,dr,ur,pg,yu=y(()=>{"use strict";sr="claude-haiku-4-5",vo="gemini-3.1-pro-preview",lr="gpt-5.4-mini",Fi="gemini-3-flash-preview",cr="gpt-5.4",_o="claude-sonnet-4-6",dr=vo,ur=Fi,pg=()=>typeof process<"u"?process.env:{}});var hr,xu=y(()=>{"use strict";hr=(e=>(e.INITIALIZING="initializing",e.READY="ready",e.PROCESSING="processing",e.STOPPING="stopping",e.WAITING_USER="waiting_user",e.COMPLETED="completed",e.FAILED="failed",e))(hr||{})});function vu(e){let t=e.trim();if(!t||t.startsWith("List of devices"))return null;let i=t.split(/\s+/);if(i.length<2)return null;let n=i[0],o=i[1],a="usb";return n.startsWith("emulator-")?a="emulator":n.includes(":")&&(a="wifi"),{id:n,state:o,connectionType:a}}function _u(e){return e.startsWith(ue)?e:`${ue}${e}`}function ku(e){return e.model?`${e.model} (${e.id})`:e.connectionType==="emulator"?`Android Emulator (${e.id})`:e.id}var Su=y(()=>{"use strict";bo()});var mr={};et(mr,{ADDRESS_BAR_HEIGHT:()=>yo,ANDROID_DEVICE_PREFIX:()=>ue,ActionEntitySchema:()=>Ia,ActionSchema:()=>Ca,AgentStatus:()=>hr,BaseStatementSchema:()=>Je,BrowserType:()=>Qa,ConditionSchema:()=>uo,ConditionType:()=>rr,ConditionTypeSchema:()=>Aa,DEFAULT_ANTHROPIC_MODEL:()=>sr,DEFAULT_COMPUTER_USE_MODEL:()=>ur,DEFAULT_COPILOT_MODEL:()=>_o,DEFAULT_DEVICE_NAME:()=>Ze,DEFAULT_GEMINI_COMPUTER_USE_MODEL:()=>Fi,DEFAULT_GOOGLE_MODEL:()=>vo,DEFAULT_OPENAI_COMPUTER_USE_MODEL:()=>cr,DEFAULT_OPENAI_MODEL:()=>lr,DEFAULT_WEBAGENT_MODEL:()=>dr,DEFAULT_WHILE_LOOP_TIMEOUT_MS:()=>uu,DEVICE_CATEGORIES:()=>tr,DeviceType:()=>er,DraftSchema:()=>Pa,IOS_DEVICE_PREFIX:()=>he,LoginType:()=>ir,MIN_WINDOW_HEIGHT:()=>Za,MIN_WINDOW_WIDTH:()=>qa,NON_INTENT_ACTIONS:()=>Ua,NodeJSCodeCommon:()=>Zc,PLAYWRIGHT_DEVICES:()=>Ni,RECORD_VIDEO_HEIGHT:()=>Ja,RECORD_VIDEO_WIDTH:()=>Ya,StatementSchema:()=>te,StatementType:()=>ar,StatementTypeSchema:()=>Ma,TestFlowSchema:()=>ho,TestGroupEntrySchema:()=>$a,TestGroupSchema:()=>Li,TwoFactorAuthType:()=>nr,UI_DEVICE_CATEGORIES:()=>Xd,UI_DEVICE_CATEGORIES_ELECTRON:()=>Yd,USER_AGENT:()=>Ka,VIEWPORT_HEIGHT:()=>Xa,VIEWPORT_WIDTH:()=>Va,VariableStore:()=>mu,WINDOW_HEIGHT:()=>za,WINDOW_WIDTH:()=>ja,actionEntityToYaml:()=>pd,actionStepsMapToTestFlowSections:()=>Md,allowPureVisionAction:()=>Td,applyPatchToYaml:()=>Ha,applyPatchToYamlString:()=>xd,collectActionSteps:()=>Ue,convertPlaywrightActionToEntity:()=>ad,countIntentStatements:()=>Ba,createAndroidDeviceName:()=>Hd,createEmptyStore:()=>iu,createIOSDeviceName:()=>Wd,createRunnerStoreEntry:()=>nu,extractActionStepsFromTestFlow:()=>Ad,extractAndAttachComments:()=>Ra,extractDeviceIdentifier:()=>Fd,extractElementDescription:()=>Sa,extractElementDescriptionFromAriaSnapshot:()=>Ea,extractLocatorFromCode:()=>Ta,extractYamlMetadata:()=>bd,findNextAfterContainer:()=>We,findNextSibling:()=>He,findNextStatement:()=>Fe,findPathBetweenStatements:()=>kd,findStatementPathById:()=>ne,generateUid:()=>od,getAllDeviceNames:()=>Vd,getAllReferenceIds:()=>Sd,getAllStatementsInOrder:()=>Oi,getAndroidDeviceDisplayName:()=>ku,getBrowserWindowSize:()=>Jd,getCompatiblePlatforms:()=>Ga,getDeviceBrowserType:()=>Qd,getDeviceByName:()=>Ri,getDeviceChannel:()=>Zd,getDeviceOptions:()=>xo,getDevicesByCategory:()=>Mt,getIOSDeviceDisplayName:()=>Kd,getLoginConfigPlatform:()=>ed,getRecordVideoSize:()=>qd,getStatementContainers:()=>Me,getStoreSize:()=>lu,getTestPlatformFromDeviceName:()=>Dd,hasReferenceIds:()=>Wa,isAndroidDevice:()=>Nd,isAppPackage:()=>Ud,isDynamicAction:()=>Ed,isExecutableStatement:()=>_d,isIOSDevice:()=>Rd,isNativeDevice:()=>Od,isPhysicalDeviceUDID:()=>jd,isPlatformCompatibleWithUrl:()=>Bd,isStoreEmpty:()=>su,isWebUrl:()=>wo,mergeActionEntitiesIntoTestFlow:()=>cu,mergeStoreUpdates:()=>ru,parseAdbDeviceLine:()=>vu,parseYamlArrayItems:()=>wd,replaceVariables:()=>id,resolveActionEntity:()=>ou,resolveComputerUseModelFromEnv:()=>bu,resolveModels:()=>fu,resolveWebAgentModelFromEnv:()=>wu,suiteToYaml:()=>Na,testFlowToYaml:()=>ud,testFlowToYamlObject:()=>Oa,toAndroidDeviceName:()=>_u,toIOSDeviceName:()=>Gd,updateStoreEntry:()=>au,validatePatch:()=>Fa,validateTestYaml:()=>$d,yamlObjectsToString:()=>hd,yamlToActionEntity:()=>gd,yamlToTestFlow:()=>qe});var pr=y(()=>{"use strict";Qc();td();nd();rd();vd();Ld();go();La();zd();eu();tu();du();fo();hu();gu();yu();xu();Su();bo()});import*as Ie from"path";import*as Mu from"fs";import{test as gg,expect as vA,chromium as fg}from"@playwright/test";import*as Z from"fs";import*as tt from"path";import{randomUUID as wr}from"crypto";import{tmpdir as br}from"os";function yr(e){return[`--disable-extensions-except=${e}`,`--load-extension=${e}`,"--no-first-run","--disable-default-apps"]}function xr(e){if(!Z.existsSync(e))return console.warn(`[fixture] extensionStorageState file not found: ${e}`),null;let t;try{t=JSON.parse(Z.readFileSync(e,"utf-8"))}catch(a){throw new Error(`[fixture] Failed to parse extensionStorageState at ${e}: ${a}`)}let i=t;if(!Array.isArray(i.cookies))return null;let n=(Date.now()+365*24*60*60*1e3)/1e3,o=i.cookies.filter(a=>a&&typeof a=="object"&&typeof a.name=="string"&&typeof a.domain=="string");return o.length<i.cookies.length&&console.warn(`[fixture] Skipped ${i.cookies.length-o.length} malformed cookies (missing name or domain)`),o.map(a=>({...a,expires:n}))}function vr(e){if(e){let i=tt.resolve(process.cwd(),e),n=tt.join(br(),`ext-profile-${wr()}`);if(Z.existsSync(i)){try{Z.cpSync(i,n,{recursive:!0})}catch(a){try{Z.rmSync(n,{recursive:!0,force:!0})}catch(r){console.warn("[fixture] Failed to clean up partial profile copy:",n,r)}throw new Error(`[fixture] Failed to copy extension profile from ${i}: ${a}`)}let o=tt.join(n,"SingletonLock");Z.existsSync(o)&&Z.rmSync(o,{force:!0})}else Z.mkdirSync(n,{recursive:!0});return n}let t=tt.join(br(),`ext-profile-${wr()}`);return Z.mkdirSync(t,{recursive:!0}),t}va();import v1 from"dotenv";var Up="__shiplightDotenvCache__";function Bp(){return globalThis[Up]}function _a(){let e=Bp();return e===void 0?process.env:e}async function wg(e){let i=await import(Ie.resolve(process.cwd(),e.auth)),n=i.login||i.default;if(typeof n!="function")throw new Error(`auth module "${e.auth}" must export a login(args) function that returns a storageState file path`);let o=await n(e.args||{});if(typeof o!="string")throw new Error(`auth module "${e.auth}" login() must return a storageState file path (got ${typeof o})`);return o}function Eu(e){return!(!e||e==="off")}function Iu(e,t){return!e||e==="off"?!1:e==="on"?!0:e==="retain-on-failure"?t.status!==t.expectedStatus:e==="on-first-retry"?t.retry>0:typeof e=="object"&&e!==null&&"mode"in e?Iu(e.mode,t):!0}async function Tu(e,t,i){let n=Iu(t,i);for(let o of e)try{if(n){let a=await o.path();await i.attach("video",{path:a,contentType:"video/webm"})}else await o.delete()}catch(a){console.warn("[fixture] Failed to process video:",a)}}var ko;async function Au(){return ko||(ko=await Promise.resolve().then(()=>(va(),qc)),ko)}var bg=new Set(["get","set","getAll","has","__variableStore"]);function yg(e){let t={__variableStore:e,get(i){return e.get(i)},set(i,n,o=!1){e.set(i,n,o)},getAll(){return e.getAll()}};return new Proxy(t,{get(i,n,o){if(n in i)return Reflect.get(i,n,o);if(typeof n=="string")return i.get(n)},set(i,n,o){return typeof n!="string"||bg.has(n)?Reflect.set(i,n,o):(i.set(n,o),!0)},has(i,n){return n in i?!0:typeof n=="string"?e.has?.(n)??!1:!1}})}function xg(e){if(!e)return null;let t;try{t=JSON.parse(e)}catch(n){throw new Error(`SHIPLIGHT_VARS_OVERRIDE is not valid JSON: ${n.message}`)}if(t===null||typeof t!="object"||Array.isArray(t))throw new Error("SHIPLIGHT_VARS_OVERRIDE must be a JSON object");let i={};for(let[n,o]of Object.entries(t)){if(typeof o!="string")throw new Error(`SHIPLIGHT_VARS_OVERRIDE key "${n}" must be a string`);i[n]=o}return i}function vg(e,t,i){let n=r=>{if(!r||!(e in r))return null;let s=r[e];return s&&typeof s=="object"&&"value"in s?s.sensitive===!0:!1},o=n(i);if(o!==null)return o;let a=n(t);return a!==null?a:!1}function _g(e,t,i,n=process.env.SHIPLIGHT_VARS_OVERRIDE){let o=xg(n);if(o)for(let[a,r]of Object.entries(o)){let s=vg(a,t,i);e.set(a,r,s)}}var kg=["GOOGLE_API_KEY","ANTHROPIC_API_KEY","OPENAI_API_KEY","OPENAI_BASE_URL","ANTHROPIC_MODELS_USE_VERTEXAI","GOOGLE_GENAI_USE_VERTEXAI","GOOGLE_CLOUD_PROJECT","GOOGLE_CLOUD_LOCATION","MAILGUN_API_KEY","MAILGUN_DOMAIN","SHIPLIGHT_API_TOKEN","SHIPLIGHT_API_URL"];function Sg(e=_a()){let t={};for(let i of kg)t[i]=e[i]??"";return t}var EA=gg.extend({account:[void 0,{option:!0}],autoDismissModal:[!1,{option:!0}],variables:[void 0,{option:!0}],extensionDir:[void 0,{option:!0}],userDataDir:[void 0,{option:!0}],extensionStorageState:[void 0,{option:!0}],launchOptions:async({launchOptions:e},t)=>{if(!process.env.SHIPLIGHT_REGISTRY_URL){await t(e);return}let i=e?.args??[],n={...e,args:[...i,"--remote-debugging-port=0"]};await t(n)},browser:async({browser:e},t)=>{let i=null;if(process.env.SHIPLIGHT_REGISTRY_URL)try{let n=await oo(process.pid),o=process.env.TEST_WORKER_INDEX??"?";i=await yt({cdpUrl:n,label:`shiplight test w${o}`,pid:process.pid})}catch{}await t(e),await xt(i)},context:async({browser:e,account:t,extensionDir:i,userDataDir:n,extensionStorageState:o},a,r)=>{if(i||n){if(t||r.project.use.auth)throw new Error('Cannot use both "extensionDir"/"userDataDir" and "auth" \u2014 persistent context tests manage their own context. Use extensionStorageState for authentication instead.');let l=r.project.use?.browserName;l&&l!=="chromium"&&console.warn(`[fixture] Persistent context requires Chromium but project is configured for "${l}". Forcing Chromium.`);let d=process.env.PLAYWRIGHT_HEADLESS==="true";i&&d&&console.warn("[fixture] PLAYWRIGHT_HEADLESS=true with extensionDir \u2014 Chrome extensions will not function in headless mode.");let c=vr(n),u=i?yr(Ie.resolve(process.cwd(),i)):[],m={...r.project.use},{storageState:g,account:w,extensionDir:v,userDataDir:x,extensionStorageState:p,autoDismissModal:f,video:S,..._}=m,k=Eu(S)?{dir:r.outputDir}:void 0,E;try{if(E=await fg.launchPersistentContext(c,{..._,headless:d,args:u,viewport:_.viewport??{width:1280,height:720},...k?{recordVideo:k}:{}}),o){let I=Ie.resolve(process.cwd(),o),P=xr(I);P&&await E.addCookies(P)}await a(E)}finally{let I=E?.pages().map(P=>P.video()).filter(P=>P!==null)??[];if(await E?.close().catch(P=>{console.warn("[fixture] Failed to close persistent context:",P)}),await Tu(I,S,r),!n)try{Mu.rmSync(c,{recursive:!0,force:!0})}catch(P){console.warn("[fixture] Failed to clean up temp profile dir:",c,P)}}}else{let l={...r.project.use},d=r.project.use,c=d.auth?{auth:d.auth,args:d.args}:t;if(c){if(!c.auth)throw new Error("Auth is declared but missing the script path. Provide auth in playwright.config.ts: use: { auth: './auth.login.ts' }");l.storageState=await wg(c)}let u=l.video;Eu(u)&&!l.recordVideo&&(l.recordVideo={dir:r.outputDir});let m=await e.newContext(l);m.addInitScript(Ne);try{await a(m)}finally{let g=m.pages().map(w=>w.video()).filter(w=>w!==null);await m.close(),await Tu(g,u,r)}}},page:async({context:e},t)=>{let i=await e.newPage();await t(i)},testContext:async({variables:e},t,i)=>{let{VariableStore:n}=await Au(),o=new n,a=l=>{if(l)for(let[d,c]of Object.entries(l))typeof c=="string"?o.set(d,c,!1):c&&typeof c=="object"&&"value"in c&&o.set(d,c.value,c.sensitive===!0)},r=i.project.use.variables;a(r),a(e),_g(o,r,e);let s=yg(o);global.testContext=s,global.$=s,global.ctx=s,await t(s),delete global.testContext,delete global.$,delete global.ctx},$:async({testContext:e},t)=>{await t(e)},ctx:async({testContext:e},t)=>{await t(e)},agent:async({page:e,testContext:t,autoDismissModal:i},n,o)=>{let{WebAgent:a,createAgentContext:r,configureSdk:s,parseSdkLogLevelFromEnv:l}=await Au(),d=l();s({env:Sg(),...d!==void 0&&{logLevel:d}});let{resolveWebAgentModelFromEnv:c,resolveComputerUseModelFromEnv:u}=await Promise.resolve().then(()=>(pr(),mr)),m=_a(),g=c(m);if(!g)throw new Error("No AI model configured. Set WEB_AGENT_MODEL, GOOGLE_API_KEY, ANTHROPIC_API_KEY, OPENAI_API_KEY, or SHIPLIGHT_API_TOKEN in your .env file (or in the runner environment for CI).");let w=u(m),v=t.__variableStore,x=r({model:g,computer_use_model:w,variableStore:v,autoDismissModal:i,downloadDir:Ie.join(o.outputDir,"downloads")}),p=Ie.join(o.outputDir,"artifacts");x.stepTracking={results:{},artifactsDir:p};let f=new a(x),S=e.context();f.agentServices.setupPageTracking(S);for(let _ of S.pages())f.setupDownloadTracking(_),f.setupDialogHandling(_);S.on("page",_=>{f.setupDownloadTracking(_),f.setupDialogHandling(_)}),global.agent=f,await n(f),delete global.agent;try{let _=o.outputDir;await f.writeExecutionResults(_);let k=Ie.join(_,"test-results.json");await(await import("fs/promises")).stat(k).catch(()=>null)&&await o.attach("shiplight-results",{path:k,contentType:"application/json"})}catch(_){console.error("[Shiplight] Failed to attach step results:",_)}try{let _=f.getNewActionEntities();if(_.size>0&&o.status==="passed"){let{createEmptyStore:k,createRunnerStoreEntry:E}=await Promise.resolve().then(()=>(pr(),mr)),I=await import("fs/promises"),P=k();for(let[B,z]of _)P.entries[B]=E(z,0);let $=Ie.join(o.outputDir,"new-action-entities.json");await I.writeFile($,JSON.stringify(P,null,2)),await o.attach("shiplight-new-action-entities",{path:$,contentType:"application/json"}),console.log(`[Shiplight] ${_.size} healed action entit${_.size===1?"y":"ies"} saved`)}}catch(_){console.warn("[Shiplight] Failed to persist new action entities:",_)}}});export{kg as SDK_ENV_ALLOWLIST,_g as applyVarsOverride,Sg as buildSdkEnv,yg as createTestContext,vA as expect,vg as isDeclaredSensitive,xg as parseVarsOverrideEnv,wg as resolveAuthState,EA as test};