@probolabs/playwright 0.4.6 → 0.4.8

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/index.js CHANGED
@@ -1,4 +1,4 @@
1
- const highlighterCode = "(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\n typeof define === 'function' && define.amd ? define(['exports'], factory) :\n (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.ProboLabs = {}));\n})(this, (function (exports) { 'use strict';\n\n const ElementTag = {\n CLICKABLE: \"CLICKABLE\", // button, link, toggle switch, checkbox, radio, dropdowns, clickable divs\n FILLABLE: \"FILLABLE\", // input, textarea content_editable, date picker??\n SELECTABLE: \"SELECTABLE\", // select\n NON_INTERACTIVE_ELEMENT: 'NON_INTERACTIVE_ELEMENT',\n };\n\n class ElementInfo {\n constructor(element, index, {tag, type, text, html, xpath, css_selector, bounding_box, iframe_selector}) {\n this.index = index.toString();\n this.tag = tag;\n this.type = type;\n this.text = text;\n this.html = html;\n this.xpath = xpath;\n this.css_selector = css_selector;\n this.bounding_box = bounding_box;\n this.iframe_selector = iframe_selector;\n this.element = element;\n this.depth = -1;\n }\n\n getSelector() {\n return this.xpath ? this.xpath : this.css_selector;\n }\n\n getDepth() {\n if (this.depth >= 0) {\n return this.depth;\n }\n \n this.depth = 0;\n let currentElement = this.element;\n \n while (currentElement.nodeType === Node.ELEMENT_NODE) { \n this.depth++;\n if (currentElement.assignedSlot) {\n currentElement = currentElement.assignedSlot;\n }\n else {\n currentElement = currentElement.parentNode;\n // Check if we're at a shadow root\n if (currentElement && currentElement.nodeType !== Node.ELEMENT_NODE && currentElement.getRootNode() instanceof ShadowRoot) {\n // Get the shadow root's host element\n currentElement = currentElement.getRootNode().host; \n }\n }\n }\n \n return this.depth;\n }\n }\n\n // import { realpath } from \"fs\";\n\n function getAllDocumentElementsIncludingShadow(selectors, root = document) {\n const elements = Array.from(root.querySelectorAll(selectors));\n\n root.querySelectorAll('*').forEach(el => {\n if (el.shadowRoot) {\n elements.push(...getAllDocumentElementsIncludingShadow(selectors, el.shadowRoot));\n }\n });\n return elements;\n }\n\n function getAllFrames(root = document) {\n const result = [root];\n const frames = getAllDocumentElementsIncludingShadow('frame, iframe', root); \n frames.forEach(frame => {\n try {\n const frameDocument = frame.contentDocument || frame.contentWindow.document;\n if (frameDocument) {\n result.push(frameDocument);\n }\n } catch (e) {\n // Skip cross-origin frames\n console.warn('Could not access frame content:', e.message);\n }\n });\n\n return result;\n }\n\n function getAllElementsIncludingShadow(selectors, root = document) {\n const elements = [];\n\n getAllFrames(root).forEach(doc => {\n elements.push(...getAllDocumentElementsIncludingShadow(selectors, doc));\n });\n\n return elements;\n }\n\n /**\n * Deeply searches through DOM trees including Shadow DOM and frames/iframes\n * @param {string} selector - CSS selector to search for\n * @param {Document|Element} [root=document] - Starting point for the search\n * @param {Object} [options] - Search options\n * @param {boolean} [options.searchShadow=true] - Whether to search Shadow DOM\n * @param {boolean} [options.searchFrames=true] - Whether to search frames/iframes\n * @returns {Element[]} Array of found elements\n \n function getAllElementsIncludingShadow(selector, root = document, options = {}) {\n const {\n searchShadow = true,\n searchFrames = true\n } = options;\n\n const results = new Set();\n \n // Helper to check if an element is valid and not yet found\n const addIfValid = (element) => {\n if (element && !results.has(element)) {\n results.add(element);\n }\n };\n\n // Helper to process a single document or element\n function processNode(node) {\n // Search regular DOM\n node.querySelectorAll(selector).forEach(addIfValid);\n\n if (searchShadow) {\n // Search all shadow roots\n const treeWalker = document.createTreeWalker(\n node,\n NodeFilter.SHOW_ELEMENT,\n {\n acceptNode: (element) => {\n return element.shadowRoot ? \n NodeFilter.FILTER_ACCEPT : \n NodeFilter.FILTER_SKIP;\n }\n }\n );\n\n while (treeWalker.nextNode()) {\n const element = treeWalker.currentNode;\n if (element.shadowRoot) {\n // Search within shadow root\n element.shadowRoot.querySelectorAll(selector).forEach(addIfValid);\n // Recursively process the shadow root for nested shadow DOMs\n processNode(element.shadowRoot);\n }\n }\n }\n\n if (searchFrames) {\n // Search frames and iframes\n const frames = node.querySelectorAll('frame, iframe');\n frames.forEach(frame => {\n try {\n const frameDocument = frame.contentDocument;\n if (frameDocument) {\n processNode(frameDocument);\n }\n } catch (e) {\n // Skip cross-origin frames\n console.warn('Could not access frame content:', e.message);\n }\n });\n }\n }\n\n // Start processing from the root\n processNode(root);\n\n return Array.from(results);\n }\n */\n // <div x=1 y=2 role='combobox'> </div>\n function findDropdowns() {\n const dropdowns = [];\n \n // Native select elements\n dropdowns.push(...getAllElementsIncludingShadow('select'));\n \n // Elements with dropdown roles that don't have <input>..</input>\n const roleElements = getAllElementsIncludingShadow('[role=\"combobox\"], [role=\"listbox\"], [role=\"dropdown\"], [role=\"option\"], [role=\"menu\"], [role=\"menuitem\"]').filter(el => {\n return el.tagName.toLowerCase() !== 'input' || ![\"button\", \"checkbox\", \"radio\"].includes(el.getAttribute(\"type\"));\n });\n dropdowns.push(...roleElements);\n \n // Common dropdown class patterns\n const dropdownPattern = /.*(dropdown|select|combobox|menu).*/i;\n const elements = getAllElementsIncludingShadow('*');\n const dropdownClasses = Array.from(elements).filter(el => {\n const hasDropdownClass = dropdownPattern.test(el.className);\n const validTag = ['li', 'ul', 'span', 'div', 'p', 'a', 'button'].includes(el.tagName.toLowerCase());\n const style = window.getComputedStyle(el); \n const result = hasDropdownClass && validTag && (style.cursor === 'pointer' || el.tagName.toLowerCase() === 'a' || el.tagName.toLowerCase() === 'button');\n return result;\n });\n \n dropdowns.push(...dropdownClasses);\n \n // Elements with aria-haspopup attribute\n dropdowns.push(...getAllElementsIncludingShadow('[aria-haspopup=\"true\"], [aria-haspopup=\"listbox\"], [aria-haspopup=\"menu\"]'));\n\n // Improve navigation element detection\n // Semantic nav elements with list items\n dropdowns.push(...getAllElementsIncludingShadow('nav ul li, nav ol li'));\n \n // Navigation elements in common design patterns\n dropdowns.push(...getAllElementsIncludingShadow('header a, .header a, .nav a, .navigation a, .menu a, .sidebar a, aside a'));\n \n // Elements in primary navigation areas with common attributes\n dropdowns.push(...getAllElementsIncludingShadow('[role=\"navigation\"] a, [aria-label*=\"navigation\"] a, [aria-label*=\"menu\"] a'));\n\n return dropdowns;\n }\n\n function findClickables() {\n const clickables = [];\n \n const checkboxPattern = /checkbox/i;\n // Collect all clickable elements first\n const nativeLinks = [...getAllElementsIncludingShadow('a[href]')];\n const nativeButtons = [...getAllElementsIncludingShadow('button')];\n const inputButtons = [...getAllElementsIncludingShadow('input[type=\"button\"], input[type=\"submit\"], input[type=\"reset\"]')];\n const roleButtons = [...getAllElementsIncludingShadow('[role=\"button\"]')];\n // const tabbable = [...getAllElementsIncludingShadow('[tabindex=\"0\"]')];\n const clickHandlers = [...getAllElementsIncludingShadow('[onclick]')];\n const dropdowns = findDropdowns();\n const nativeCheckboxes = [...getAllElementsIncludingShadow('input[type=\"checkbox\"]')]; \n const fauxCheckboxes = getAllElementsIncludingShadow('*').filter(el => {\n if (checkboxPattern.test(el.className)) {\n const realCheckboxes = getAllElementsIncludingShadow('input[type=\"checkbox\"]', el);\n if (realCheckboxes.length === 1) {\n const boundingRect = realCheckboxes[0].getBoundingClientRect();\n return boundingRect.width <= 1 && boundingRect.height <= 1 \n }\n }\n return false;\n });\n const nativeRadios = [...getAllElementsIncludingShadow('input[type=\"radio\"]')];\n const toggles = findToggles();\n const pointerElements = findElementsWithPointer();\n // Add all elements at once\n clickables.push(\n ...nativeLinks,\n ...nativeButtons,\n ...inputButtons,\n ...roleButtons,\n // ...tabbable,\n ...clickHandlers,\n ...dropdowns,\n ...nativeCheckboxes,\n ...fauxCheckboxes,\n ...nativeRadios,\n ...toggles,\n ...pointerElements\n );\n\n // Only uniquify once at the end\n return clickables; // Let findElements handle the uniquification\n }\n\n function findToggles() {\n const toggles = [];\n const checkboxes = getAllElementsIncludingShadow('input[type=\"checkbox\"]');\n const togglePattern = /switch|toggle|slider/i;\n\n checkboxes.forEach(checkbox => {\n let isToggle = false;\n\n // Check the checkbox itself\n if (togglePattern.test(checkbox.className) || togglePattern.test(checkbox.getAttribute('role') || '')) {\n isToggle = true;\n }\n\n // Check parent elements (up to 3 levels)\n if (!isToggle) {\n let element = checkbox;\n for (let i = 0; i < 3; i++) {\n const parent = element.parentElement;\n if (!parent) break;\n\n const className = parent.className || '';\n const role = parent.getAttribute('role') || '';\n\n if (togglePattern.test(className) || togglePattern.test(role)) {\n isToggle = true;\n break;\n }\n element = parent;\n }\n }\n\n // Check next sibling\n if (!isToggle) {\n const nextSibling = checkbox.nextElementSibling;\n if (nextSibling) {\n const className = nextSibling.className || '';\n const role = nextSibling.getAttribute('role') || '';\n if (togglePattern.test(className) || togglePattern.test(role)) {\n isToggle = true;\n }\n }\n }\n\n if (isToggle) {\n toggles.push(checkbox);\n }\n });\n\n return toggles;\n }\n\n function findNonInteractiveElements() {\n // Get all elements in the document\n const all = Array.from(getAllElementsIncludingShadow('*'));\n \n // Filter elements based on Python implementation rules\n return all.filter(element => {\n if (!element.firstElementChild) {\n const tag = element.tagName.toLowerCase(); \n if (!['select', 'button', 'a'].includes(tag)) {\n const validTags = ['p', 'span', 'div', 'input', 'textarea'].includes(tag) || /^h\\d$/.test(tag) || /text/.test(tag);\n const boundingRect = element.getBoundingClientRect();\n return validTags && boundingRect.height > 1 && boundingRect.width > 1;\n }\n }\n return false;\n });\n }\n\n\n\n // export function findNonInteractiveElements() {\n // const all = [];\n // try {\n // const elements = getAllElementsIncludingShadow('*');\n // all.push(...elements);\n // } catch (e) {\n // console.warn('Error getting elements:', e);\n // }\n \n // console.debug('Total elements found:', all.length);\n \n // return all.filter(element => {\n // try {\n // const tag = element.tagName.toLowerCase(); \n\n // // Special handling for input elements\n // if (tag === 'input' || tag === 'textarea') {\n // const boundingRect = element.getBoundingClientRect();\n // const value = element.value || '';\n // const placeholder = element.placeholder || '';\n // return boundingRect.height > 1 && \n // boundingRect.width > 1 && \n // (value.trim() !== '' || placeholder.trim() !== '');\n // }\n\n \n // // Check if it's a valid tag for text content\n // const validTags = ['p', 'span', 'div', 'label', 'th', 'td', 'li', 'button', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'a', 'select'].includes(tag) || \n // /^h\\d$/.test(tag) || \n // /text/.test(tag);\n\n // const boundingRect = element.getBoundingClientRect();\n\n // // Get direct text content, excluding child element text\n // let directText = '';\n // for (const node of element.childNodes) {\n // // Only include text nodes (nodeType 3)\n // if (node.nodeType === 3) {\n // directText += node.textContent || '';\n // }\n // }\n \n // // If no direct text and it's a table cell or heading, check label content\n // if (!directText.trim() && (tag === 'th' || tag === 'td' || tag === 'h1')) {\n // const labels = element.getElementsByTagName('label');\n // for (const label of labels) {\n // directText += label.textContent || '';\n // }\n // }\n\n // // If still no text and it's a heading, get all text content\n // if (!directText.trim() && tag === 'h1') {\n // directText = element.textContent || '';\n // }\n\n // directText = directText.trim();\n\n // // Debug logging\n // if (directText) {\n // console.debugg('Text element found:', {\n // tag,\n // text: directText,\n // dimensions: boundingRect,\n // element\n // });\n // }\n\n // return validTags && \n // boundingRect.height > 1 && \n // boundingRect.width > 1 && \n // directText !== '';\n \n // } catch (e) {\n // console.warn('Error processing element:', e);\n // return false;\n // }\n // });\n // }\n\n\n\n\n\n function findElementsWithPointer() {\n const elements = [];\n const allElements = getAllElementsIncludingShadow('*');\n \n console.log('Checking elements with pointer style...');\n \n allElements.forEach(element => {\n // Skip SVG elements for now\n if (element instanceof SVGElement || element.tagName.toLowerCase() === 'svg') {\n return;\n }\n \n const style = window.getComputedStyle(element);\n if (style.cursor === 'pointer') {\n elements.push(element);\n }\n });\n \n console.log(`Found ${elements.length} elements with pointer cursor`);\n return elements;\n }\n\n function findCheckables() {\n const elements = [];\n\n elements.push(...getAllElementsIncludingShadow('input[type=\"checkbox\"]'));\n elements.push(...getAllElementsIncludingShadow('input[type=\"radio\"]'));\n const all_elements = getAllElementsIncludingShadow('label');\n const radioClasses = Array.from(all_elements).filter(el => {\n return /.*radio.*/i.test(el.className); \n });\n elements.push(...radioClasses);\n return elements;\n }\n\n function findFillables() {\n const elements = [];\n\n const inputs = [...getAllElementsIncludingShadow('input:not([type=\"radio\"]):not([type=\"checkbox\"])')];\n console.log('Found inputs:', inputs.length, inputs);\n elements.push(...inputs);\n \n const textareas = [...getAllElementsIncludingShadow('textarea')];\n console.log('Found textareas:', textareas.length);\n elements.push(...textareas);\n \n const editables = [...getAllElementsIncludingShadow('[contenteditable=\"true\"]')];\n console.log('Found editables:', editables.length);\n elements.push(...editables);\n\n return elements;\n }\n\n // Helper function to check if element is a form control\n function isFormControl(elementInfo) {\n return /^(input|select|textarea|button|label)$/i.test(elementInfo.tag);\n }\n\n const isDropdownItem = (elementInfo) => {\n const dropdownPatterns = [\n /dropdown[-_]?item/i, // matches: dropdown-item, dropdownitem, dropdown_item\n /menu[-_]?item/i, // matches: menu-item, menuitem, menu_item\n /dropdown[-_]?link/i, // matches: dropdown-link, dropdownlink, dropdown_link\n /list[-_]?item/i, // matches: list-item, listitem, list_item\n /select[-_]?item/i, // matches: select-item, selectitem, select_item \n ];\n\n const rolePatterns = [\n /menu[-_]?item/i, // matches: menuitem, menu-item\n /option/i, // matches: option\n /list[-_]?item/i, // matches: listitem, list-item\n /tree[-_]?item/i // matches: treeitem, tree-item\n ];\n\n const hasMatchingClass = elementInfo.element.className && \n dropdownPatterns.some(pattern => \n pattern.test(elementInfo.element.className)\n );\n\n const hasMatchingRole = elementInfo.element.getAttribute('role') && \n rolePatterns.some(pattern => \n pattern.test(elementInfo.element.getAttribute('role'))\n );\n\n return hasMatchingClass || hasMatchingRole;\n };\n\n /**\n * Finds the first element matching a CSS selector, traversing Shadow DOM if necessary\n * @param {string} selector - CSS selector to search for\n * @param {Element} [root=document] - Root element to start searching from\n * @returns {Element|null} - The first matching element or null if not found\n */\n function querySelectorShadow(selector, root = document) {\n // First try to find in light DOM\n let element = root.querySelector(selector);\n if (element) return element;\n \n // Get all elements with shadow root\n const shadowElements = Array.from(root.querySelectorAll('*'))\n .filter(el => el.shadowRoot);\n \n // Search through each shadow root until we find a match\n for (const el of shadowElements) {\n element = querySelectorShadow(selector, el.shadowRoot);\n if (element) return element;\n }\n \n return null;\n }\n\n const getElementByXPathOrCssSelector = (element_info) => {\n let element;\n\n if (element_info.xpath) { //try xpath if exists\n element = document.evaluate(\n element_info.xpath, \n document, \n null, \n XPathResult.FIRST_ORDERED_NODE_TYPE, \n null\n ).singleNodeValue;\n \n if (!element) {\n console.warn('Failed to find element with xpath:', element_info.xpath);\n }\n }\n else { //try CSS selector\n if (element_info.iframe_selector) {\n const frames = getAllDocumentElementsIncludingShadow('iframe');\n \n // Iterate over all frames and compare their CSS selectors\n frames.forEach(frame => { \n const cssSelector = generateCssPath(frame);\n if (cssSelector === element_info.iframe_selector) {\n const frameDocument = frame.contentDocument || frame.contentWindow.document;\n element = querySelectorShadow(element_info.css_selector, frameDocument);\n } \n }); \n }\n else\n element = querySelectorShadow(element_info.css_selector);\n // console.log('found element by CSS elector: ', element);\n if (!element) {\n console.warn('Failed to find element with CSS selector:', element_info.css_selector);\n }\n }\n\n return element;\n };\n\n function generateXPath(element) {\n if (!element || element.getRootNode() instanceof ShadowRoot) return '';\n \n // If element has an id, use that (it's unique and shorter)\n if (element.id) {\n return `//*[@id=\"${element.id}\"]`;\n }\n \n const parts = [];\n let current = element;\n \n while (current && current.nodeType === Node.ELEMENT_NODE) {\n let index = 1;\n let sibling = current.previousSibling;\n \n while (sibling) {\n if (sibling.nodeType === Node.ELEMENT_NODE && sibling.tagName === current.tagName) {\n index++;\n }\n sibling = sibling.previousSibling;\n }\n \n const tagName = current.tagName.toLowerCase();\n parts.unshift(`${tagName}[${index}]`);\n current = current.parentNode;\n }\n \n return '/' + parts.join('/');\n }\n\n function isDecendent(parent, child) {\n let element = child;\n while (element.nodeType === Node.ELEMENT_NODE) { \n \n if (element.assignedSlot) {\n element = element.assignedSlot;\n }\n else {\n element = element.parentNode;\n // Check if we're at a shadow root\n if (element && element.nodeType !== Node.ELEMENT_NODE && element.getRootNode() instanceof ShadowRoot) {\n // Get the shadow root's host element\n element = element.getRootNode().host; \n }\n }\n if (element === parent)\n return true;\n }\n return false;\n }\n\n function generateCssPath(element) {\n if (!element) {\n console.error('ERROR: No element provided to generateCssPath returning empty string');\n return '';\n }\n const path = [];\n // console.group('Generating CSS path for:', element);\n while (element && element.nodeType === Node.ELEMENT_NODE) { \n let selector = element.nodeName.toLowerCase();\n // console.log('Element:', selector, element);\n \n // if (element.id) {\n // //escape special characters\n // const normalized_id = element.id.replace(/[:;.#()[\\]!@$%^&*]/g, '\\\\$&');\n // selector = `#${normalized_id}`;\n // path.unshift(selector);\n // break;\n // } \n \n let sibling = element;\n let nth = 1;\n while (sibling = sibling.previousElementSibling) {\n if (sibling.nodeName.toLowerCase() === selector) nth++;\n }\n sibling = element;\n while (sibling = sibling.nextElementSibling) {\n if (sibling.nodeName.toLowerCase() === selector) {\n break;\n }\n }\n selector += `:nth-of-type(${nth})`;\n \n \n path.unshift(selector);\n //console.log(` Current path: ${path.join(' > ')}`);\n\n if (element.assignedSlot) {\n element = element.assignedSlot;\n // console.log(' Moving to assigned slot');\n }\n else {\n element = element.parentNode;\n // console.log(' Moving to parent:', element);\n\n // Check if we're at a shadow root\n if (element && element.nodeType !== Node.ELEMENT_NODE && element.getRootNode() instanceof ShadowRoot) {\n console.log(' Found shadow root, moving to host');\n // Get the shadow root's host element\n element = element.getRootNode().host; \n }\n }\n }\n \n // console.log('Final selector:', path.join(' > '));\n // console.groupEnd();\n return path.join(' > ');\n }\n\n\n function cleanHTML(rawHTML) {\n const parser = new DOMParser();\n const doc = parser.parseFromString(rawHTML, \"text/html\");\n\n function cleanElement(element) {\n const allowedAttributes = new Set([\n \"role\",\n \"type\",\n \"class\",\n \"href\",\n \"alt\",\n \"title\",\n \"readonly\",\n \"checked\",\n \"enabled\",\n \"disabled\",\n ]);\n\n [...element.attributes].forEach(attr => {\n const name = attr.name.toLowerCase();\n const value = attr.value;\n\n const isTestAttribute = /^(testid|test-id|data-test-id)$/.test(name);\n const isDataAttribute = name.startsWith(\"data-\") && value;\n const isBooleanAttribute = [\"readonly\", \"checked\", \"enabled\", \"disabled\"].includes(name);\n\n if (!allowedAttributes.has(name) && !isDataAttribute && !isTestAttribute && !isBooleanAttribute) {\n element.removeAttribute(name);\n }\n });\n\n // Handle SVG content - more aggressive replacement\n if (element.tagName.toLowerCase() === \"svg\") {\n // Remove all attributes except class and role\n [...element.attributes].forEach(attr => {\n const name = attr.name.toLowerCase();\n if (name !== \"class\" && name !== \"role\") {\n element.removeAttribute(name);\n }\n });\n element.innerHTML = \"CONTENT REMOVED\";\n } else {\n // Recursively clean child elements\n Array.from(element.children).forEach(cleanElement);\n }\n\n // Only remove empty elements that aren't semantic or icon elements\n const keepEmptyElements = ['i', 'span', 'svg', 'button', 'input'];\n if (!keepEmptyElements.includes(element.tagName.toLowerCase()) && \n !element.children.length && \n !element.textContent.trim()) {\n element.remove();\n }\n }\n\n // Process all elements in the document body\n Array.from(doc.body.children).forEach(cleanElement);\n return doc.body.innerHTML;\n }\n\n function getContainingIframe(element) {\n // If not in an iframe, return null\n if (element.ownerDocument.defaultView === window.top) {\n return null;\n }\n \n // Try to find the iframe in the parent document that contains our element\n try {\n const parentDocument = element.ownerDocument.defaultView.parent.document;\n const iframes = parentDocument.querySelectorAll('iframe');\n \n for (const iframe of iframes) {\n if (iframe.contentWindow === element.ownerDocument.defaultView) {\n return iframe;\n }\n }\n } catch (e) {\n // Cross-origin restriction\n return \"Cross-origin iframe - cannot access details\";\n }\n \n return null;\n }\n\n function getElementInfo(element, index) {\n\n const xpath = generateXPath(element);\n const css_selector = generateCssPath(element);\n\n const iframe = getContainingIframe(element);\n const iframe_selector = iframe ? generateCssPath(iframe) : \"\";\n\n // Return element info with pre-calculated values\n return new ElementInfo(element, index, {\n tag: element.tagName.toLowerCase(),\n type: element.type || '',\n text: element.innerText, //getTextContent(element),\n html: cleanHTML(element.outerHTML),\n xpath: xpath,\n css_selector: css_selector,\n bounding_box: element.getBoundingClientRect(),\n iframe_selector: iframe_selector\n });\n }\n\n\n\n\n const filterZeroDimensions = (elementInfo) => {\n const rect = elementInfo.bounding_box;\n //single pixel elements are typically faux controls and should be filtered too\n const hasSize = rect.width > 1 && rect.height > 1;\n const style = window.getComputedStyle(elementInfo.element);\n const isVisible = style.display !== 'none' && style.visibility !== 'hidden';\n \n if (!hasSize || !isVisible) {\n // if (elementInfo.element.isConnected) {\n // console.log('Filtered out invisible/zero-size element:', {\n // tag: elementInfo.tag,\n // xpath: elementInfo.xpath,\n // element: elementInfo.element,\n // hasSize,\n // isVisible,\n // dimensions: rect\n // });\n // }\n return false;\n }\n return true;\n };\n\n\n\n function uniquifyElements(elements) {\n const seen = new Set();\n\n console.log(`Starting uniquification with ${elements.length} elements`);\n\n // Filter out testing infrastructure elements first\n const filteredInfrastructure = elements.filter(element_info => {\n // Skip the highlight-overlay element completely - it's part of the testing infrastructure\n if (element_info.element.id === 'highlight-overlay' || \n (element_info.css_selector && element_info.css_selector.includes('#highlight-overlay'))) {\n console.log('Filtered out testing infrastructure element:', element_info.css_selector);\n return false;\n }\n \n // Filter out UI framework container/manager elements\n const el = element_info.element;\n // UI framework container checks - generic detection for any framework\n if ((el.getAttribute('data-rendered-by') || \n el.getAttribute('data-reactroot') || \n el.getAttribute('ng-version') || \n el.getAttribute('data-component-id') ||\n el.getAttribute('data-root') ||\n el.getAttribute('data-framework')) && \n (el.className && \n typeof el.className === 'string' && \n (el.className.includes('Container') || \n el.className.includes('container') || \n el.className.includes('Manager') || \n el.className.includes('manager')))) {\n console.log('Filtered out UI framework container element:', element_info.css_selector);\n return false;\n }\n \n // Direct filter for framework container elements that shouldn't be interactive\n // Consolidating multiple container detection patterns into one efficient check\n const isFullViewport = element_info.bounding_box && \n element_info.bounding_box.x <= 5 && \n element_info.bounding_box.y <= 5 && \n element_info.bounding_box.width >= (window.innerWidth * 0.95) && \n element_info.bounding_box.height >= (window.innerHeight * 0.95);\n \n // Empty content check\n const isEmpty = !el.innerText || el.innerText.trim() === '';\n \n // Check if it's a framework container element\n if (element_info.element.tagName === 'DIV' && \n isFullViewport && \n isEmpty && \n (\n // Pattern matching for root containers\n (element_info.xpath && \n (element_info.xpath.match(/^\\/html\\[\\d+\\]\\/body\\[\\d+\\]\\/div\\[\\d+\\]\\/div\\[\\d+\\]$/) || \n element_info.xpath.match(/^\\/\\/\\*\\[@id='[^']+'\\]\\/div\\[\\d+\\]$/))) ||\n \n // Simple DOM structure\n (element_info.css_selector.split(' > ').length <= 4 && element_info.depth <= 5) ||\n \n // Empty or container-like classes\n (!el.className || el.className === '' || \n (typeof el.className === 'string' && \n (el.className.includes('overlay') || \n el.className.includes('container') || \n el.className.includes('wrapper'))))\n )) {\n console.log('Filtered out framework container element:', element_info.css_selector);\n return false;\n }\n \n return true;\n });\n\n // First filter out elements with zero dimensions\n const nonZeroElements = filteredInfrastructure.filter(filterZeroDimensions);\n // sort by CSS selector depth so parents are processed first\n nonZeroElements.sort((a, b) => a.getDepth() - b.getDepth());\n console.log(`After dimension filtering: ${nonZeroElements.length} elements remain (${elements.length - nonZeroElements.length} removed)`);\n \n const filteredByParent = nonZeroElements.filter(element_info => {\n\n const parent = findClosestParent(seen, element_info);\n const keep = parent == null || shouldKeepNestedElement(element_info, parent);\n // console.log(\"node \", element_info.index, \": keep=\", keep, \" parent=\", parent);\n // if (!keep && !element_info.xpath) {\n // console.log(\"Filtered out element \", element_info,\" because it's a nested element of \", parent);\n // }\n if (keep)\n seen.add(element_info.css_selector);\n\n return keep;\n });\n\n console.log(`After parent/child filtering: ${filteredByParent.length} elements remain (${nonZeroElements.length - filteredByParent.length} removed)`);\n\n // Final overlap filtering\n const filteredResults = filteredByParent.filter(element => {\n\n // Look for any element that came BEFORE this one in the array\n const hasEarlierOverlap = filteredByParent.some(other => {\n // Only check elements that came before (lower index)\n if (filteredByParent.indexOf(other) >= filteredByParent.indexOf(element)) {\n return false;\n }\n \n const isOverlapping = areElementsOverlapping(element, other); \n return isOverlapping;\n }); \n\n // Keep element if it has no earlier overlapping elements\n return !hasEarlierOverlap;\n });\n \n \n \n // Check for overlay removal\n console.log(`After filtering: ${filteredResults.length} (${filteredByParent.length - filteredResults.length} removed by overlap)`);\n \n const nonOverlaidElements = filteredResults.filter(element => {\n return !isOverlaid(element);\n });\n\n console.log(`Final elements after overlay removal: ${nonOverlaidElements.length} (${filteredResults.length - nonOverlaidElements.length} removed)`);\n \n return nonOverlaidElements;\n\n }\n\n\n\n const areElementsOverlapping = (element1, element2) => {\n if (element1.css_selector === element2.css_selector) {\n return true;\n }\n \n const box1 = element1.bounding_box;\n const box2 = element2.bounding_box;\n \n return box1.x === box2.x &&\n box1.y === box2.y &&\n box1.width === box2.width &&\n box1.height === box2.height;\n // element1.text === element2.text &&\n // element2.tag === 'a';\n };\n\n function findClosestParent(seen, element_info) { \n // //Use element child/parent queries\n // let parent = element_info.element.parentNode;\n // if (parent.getRootNode() instanceof ShadowRoot) {\n // // Get the shadow root's host element\n // parent = parent.getRootNode().host; \n // }\n\n // while (parent.nodeType === Node.ELEMENT_NODE) { \n // const css_selector = generateCssPath(parent);\n // if (seen.has(css_selector)) {\n // console.log(\"element \", element_info, \" closest parent is \", parent)\n // return parent; \n // }\n // parent = parent.parentNode;\n // if (parent.getRootNode() instanceof ShadowRoot) {\n // // Get the shadow root's host element\n // parent = parent.getRootNode().host; \n // }\n // }\n\n // Split the xpath into segments\n const segments = element_info.css_selector.split(' > ');\n \n // Try increasingly shorter paths until we find one in the seen set\n for (let i = segments.length - 1; i > 0; i--) {\n const parentPath = segments.slice(0, i).join(' > ');\n if (seen.has(parentPath)) {\n return parentPath;\n }\n }\n\n return null;\n }\n\n function shouldKeepNestedElement(elementInfo, parentPath) {\n let result = false;\n const parentSegments = parentPath.split(' > ');\n\n const isParentLink = /^a(:nth-of-type\\(\\d+\\))?$/.test(parentSegments[parentSegments.length - 1]);\n if (isParentLink) {\n return false; \n }\n // If this is a checkbox/radio input\n if (elementInfo.tag === 'input' && \n (elementInfo.type === 'checkbox' || elementInfo.type === 'radio')) {\n \n // Check if parent is a label by looking at the parent xpath's last segment\n \n const isParentLabel = /^label(:nth-of-type\\(\\d+\\))?$/.test(parentSegments[parentSegments.length - 1]);\n \n // If parent is a label, don't keep the input (we'll keep the label instead)\n if (isParentLabel) {\n return false;\n }\n }\n \n // Keep all other form controls and dropdown items\n if (isFormControl(elementInfo) || isDropdownItem(elementInfo)) {\n result = true;\n }\n \n // console.log(`shouldKeepNestedElement: ${elementInfo.tag} ${elementInfo.text} ${elementInfo.xpath} -> ${parentXPath} -> ${result}`);\n return result;\n }\n\n\n\n function isOverlaid(elementInfo) {\n const element = elementInfo.element;\n const boundingRect = element.getBoundingClientRect();\n \n\n \n \n // Create a diagnostic logging function that only logs when needed\n const diagnosticLog = (...args) => {\n };\n\n // Special handling for tooltips\n if (elementInfo.element.className && typeof elementInfo.element.className === 'string' && \n elementInfo.element.className.includes('tooltip')) {\n return false;\n }\n \n // Special handling for deep component hierarchies\n const cssSelector = elementInfo.css_selector;\n \n // Identify complex components with deep hierarchy (important for Shadow DOM components)\n const isComplexComponent = cssSelector.length > 500 || \n (cssSelector.includes('slot:nth-of-type') && \n cssSelector.split('>').length > 15);\n \n // Special handling for deep component buttons in any framework\n const isFrameworkButton = cssSelector.split('>').length > 10 && \n cssSelector.includes('button:nth-of-type');\n \n if (isComplexComponent || isFrameworkButton) {\n // Check if the element is visible on screen\n if (boundingRect.width > 0 && \n boundingRect.height > 0 && \n boundingRect.bottom > 0 && \n boundingRect.right > 0 &&\n boundingRect.top < window.innerHeight &&\n boundingRect.left < window.innerWidth) {\n \n // Get element at the center point to check if it's covered by a popup/modal\n const middleX = boundingRect.x + boundingRect.width/2;\n const middleY = boundingRect.y + boundingRect.height/2;\n const elementAtMiddle = element.ownerDocument.elementFromPoint(middleX, middleY);\n \n if (elementAtMiddle && \n elementAtMiddle !== element && \n !isDecendent(element, elementAtMiddle) && \n !isDecendent(elementAtMiddle, element)) {\n // Make sure it doesn't have CSS that would hide it\n const style = window.getComputedStyle(element);\n if (style.display !== 'none' && \n style.visibility !== 'hidden' && \n style.opacity !== '0') {\n diagnosticLog('Style properties:', { \n display: style.display, \n visibility: style.visibility, \n opacity: style.opacity \n });\n return false; // It's visible and not covered, so not overlaid\n }\n }\n \n // Check specifically if the element at middle is a popup/modal\n if (elementAtMiddle && isElementOrAncestorPopup(elementAtMiddle)) {\n return true; // It's under a popup, so it is overlaid\n }\n }\n }\n \n // Function to check if an element is likely a popup/modal/dialog\n function isLikelyPopupOrModal(el) {\n if (!el) return false;\n \n try {\n // First check if this is actually a navigation element - we don't want to\n // misidentify navigation elements as popups\n if (isLikelyNavElement(el)) {\n return false;\n }\n \n // Navigation elements can still be overlaid - remove the automatic exclusion\n \n const rect = el.getBoundingClientRect();\n const style = window.getComputedStyle(el);\n \n // Quick checks first to fail fast\n const position = style.position;\n if (position !== 'fixed' && position !== 'absolute') {\n return false;\n }\n \n // Check tag name and role - very fast checks\n const isDialogElement = el.tagName.toLowerCase() === 'dialog';\n const hasDialogRole = el.getAttribute('role') === 'dialog' || el.getAttribute('role') === 'alertdialog';\n \n if (isDialogElement || hasDialogRole) {\n return true;\n }\n \n // Class name checks are unreliable as they depend entirely on developer conventions\n // We rely on structural properties instead\n \n // Most expensive checks last\n const zIndex = parseInt(style.zIndex, 10);\n const hasHighZIndex = !isNaN(zIndex) && zIndex > 100;\n \n // Size check for modals - they typically cover a significant portion of the screen\n // Navigation elements at the top are usually not this large\n const isSizeOfModal = rect.width > (window.innerWidth * 0.5) && \n rect.height > (window.innerHeight * 0.3) &&\n // Additional check: modals are usually not at the very top of the page\n rect.top > 50;\n \n return (hasHighZIndex && position === 'fixed' && rect.top > 50) || \n (isSizeOfModal && position === 'fixed');\n } catch (e) {\n return false;\n }\n }\n \n // Renamed from isLikelyTopNavElement to isLikelyNavElement since it detects navigation anywhere\n function isLikelyNavElement(el) {\n if (!el) return false;\n \n try {\n // Don't restrict navigation detection based on top position\n \n // Check tag names associated with navigation\n const tagName = el.tagName.toLowerCase();\n if (tagName === 'nav' || tagName === 'header') {\n return true;\n }\n \n // Check for navigation roles\n const role = el.getAttribute('role');\n if (role === 'navigation') {\n return true;\n }\n \n // Check for navigation-related class names - strong indicator\n const className = typeof el.className === 'string' ? el.className.toLowerCase() : '';\n if (className.includes('navbar') ||\n className.includes('navigation') ||\n className.includes('header') ||\n className.includes('nav-') ||\n className.includes('-nav') ||\n className.includes('sidebar') ||\n className.includes('menu')) {\n return true;\n }\n \n // Check for tab items (common in navigation)\n if (el.tagName === 'SPAN' && \n (el.classList.contains('tab') || \n el.classList.contains('nav'))) {\n return true;\n }\n \n return false;\n } catch (e) {\n return false;\n }\n }\n \n // Function to check if an element or any of its ancestors are part of top navigation\n function isElementOrAncestorTopNav(el, maxDepth = 4) {\n if (!el) return false;\n \n // Check self first - most common case\n if (isLikelyNavElement(el)) {\n return true;\n }\n \n // Then check ancestors if needed\n let current = el.parentElement;\n let depth = 1; // Start at 1 since we already checked self\n \n while (current && depth < maxDepth) {\n if (isLikelyNavElement(current)) {\n return true;\n }\n current = current.parentElement;\n depth++;\n }\n \n return false;\n }\n \n // Function to check if an element or any of its ancestors are a popup/modal\n function isElementOrAncestorPopup(el, maxDepth = 4) {\n if (!el) return false;\n \n // Check self first - most common case\n if (isLikelyPopupOrModal(el)) {\n return true;\n }\n \n // Then check ancestors if needed\n let current = el.parentElement;\n let depth = 1; // Start at 1 since we already checked self\n \n while (current && depth < maxDepth) {\n if (isLikelyPopupOrModal(current)) {\n return true;\n }\n current = current.parentElement;\n depth++;\n }\n \n return false;\n }\n \n // Check if element is at the top of the viewport\n const isNearTopOfViewport = boundingRect.top >= 0 && boundingRect.top < 100;\n \n // For elements near the top of the viewport, we need a special case\n // that handles fixed position elements at the top of the viewport\n if (isNearTopOfViewport) {\n // Get element at middle point of the row\n const middleX = boundingRect.x + boundingRect.width/2;\n const middleY = boundingRect.y + boundingRect.height/2;\n const elementAtMiddle = element.ownerDocument.elementFromPoint(middleX, middleY);\n \n // If we found an element and it's not the row itself or a descendant/ancestor\n if (elementAtMiddle && \n elementAtMiddle !== element && \n !isDecendent(element, elementAtMiddle) && \n !isDecendent(elementAtMiddle, element)) {\n \n // First check if the overlaying element is part of a popup/modal\n // If so, the element IS overlaid (regardless of whether it's also under nav)\n if (isElementOrAncestorPopup(elementAtMiddle)) {\n /* Debug code - commented out\n if (isRowToDebug) {\n console.log('Element is under a popup/modal');\n console.log('Final overlay decision: OVERLAID');\n console.log('-------------------------------------------');\n }\n */\n return true;\n }\n \n // Additional check specifically for the problematic span elements in debug logs\n if (elementAtMiddle.tagName === 'SPAN' && \n elementAtMiddle.className && \n typeof elementAtMiddle.className === 'string' && \n (elementAtMiddle.className.includes('tab') || \n elementAtMiddle.className.includes('nav'))) {\n /* Debug code - commented out\n if (isRowToDebug) {\n console.log('Element is under a navigation tab element');\n console.log('Final overlay decision: NOT OVERLAID');\n console.log('-------------------------------------------');\n }\n */\n return false;\n }\n \n // Check if the overlaying element is part of top navigation\n if (isElementOrAncestorTopNav(elementAtMiddle)) {\n /* Debug code - commented out\n if (isRowToDebug) {\n console.log('Element is under a top navigation element');\n console.log('Final overlay decision: NOT OVERLAID');\n console.log('-------------------------------------------');\n }\n */\n return false;\n }\n }\n }\n \n // Check if element is mostly or completely outside the viewport\n const viewportHeight = window.innerHeight;\n const viewportWidth = window.innerWidth;\n const elementHeight = boundingRect.height;\n const elementWidth = boundingRect.width;\n \n // Calculate how much of the element is visible in the viewport\n const visibleTop = Math.max(0, boundingRect.top);\n const visibleBottom = Math.min(viewportHeight, boundingRect.bottom);\n const visibleLeft = Math.max(0, boundingRect.left);\n const visibleRight = Math.min(viewportWidth, boundingRect.right);\n \n // Calculate visible area\n const visibleHeight = Math.max(0, visibleBottom - visibleTop);\n const visibleWidth = Math.max(0, visibleRight - visibleLeft);\n const visibleArea = visibleHeight * visibleWidth;\n const totalArea = elementHeight * elementWidth;\n \n // Check if less than half of the element is visible in the viewport\n const isPartiallyOffScreen = visibleArea < (totalArea / 2);\n \n // If the element is mostly offscreen, don't consider it overlaid - this avoids\n // false positives from elements near viewport boundaries\n if (isPartiallyOffScreen) {\n return false;\n }\n \n // Track if we find any popup elements covering our element\n let isUnderPopup = false;\n \n // Check multiple points to improve cross-browser consistency\n const points = [\n { x: boundingRect.x + boundingRect.width/2, y: boundingRect.y + boundingRect.height/2 }, // Center\n { x: boundingRect.x + 5, y: boundingRect.y + 5 }, // Top-left\n { x: boundingRect.x + boundingRect.width - 5, y: boundingRect.y + 5 }, // Top-right\n { x: boundingRect.x + 5, y: boundingRect.y + boundingRect.height - 5 }, // Bottom-left\n { x: boundingRect.x + boundingRect.width - 5, y: boundingRect.y + boundingRect.height - 5 } // Bottom-right\n ];\n \n // We'll only consider points that are inside the viewport\n let validPoints = 0;\n let overlaidPoints = 0;\n \n for (const point of points) {\n // Skip points outside viewport\n if (point.x < 0 || point.x >= viewportWidth || point.y < 0 || point.y >= viewportHeight) {\n continue;\n }\n \n validPoints++;\n const elementAtPoint = element.ownerDocument.elementFromPoint(point.x, point.y);\n \n if (isComplexComponent || isFrameworkButton) {\n diagnosticLog('Element at point:', elementAtPoint ? {\n tagName: elementAtPoint.tagName,\n className: elementAtPoint.className,\n id: elementAtPoint.id\n } : 'None found');\n }\n \n // Define helper functions for scroll detection outside the point loop\n function calculateVisibleAreaRatio(elementRect, containerRect) {\n // Calculate intersection\n const intersectionRect = {\n top: Math.max(elementRect.top, containerRect.top),\n left: Math.max(elementRect.left, containerRect.left),\n bottom: Math.min(elementRect.bottom, containerRect.bottom),\n right: Math.min(elementRect.right, containerRect.right)\n };\n \n // Check if there is any intersection at all\n if (intersectionRect.top >= intersectionRect.bottom || \n intersectionRect.left >= intersectionRect.right) {\n return 0; // No intersection, element is completely outside\n }\n \n // Calculate areas\n const intersectionArea = (intersectionRect.right - intersectionRect.left) * \n (intersectionRect.bottom - intersectionRect.top);\n const elementArea = (elementRect.right - elementRect.left) * \n (elementRect.bottom - elementRect.top);\n \n // Return ratio of visible area\n return elementArea > 0 ? intersectionArea / elementArea : 0;\n }\n \n function isInScrollableContainerButNotFullyVisible(el) {\n if (!el) return false;\n \n const rect = el.getBoundingClientRect();\n \n // First check if the element itself is sufficiently visible in the viewport\n const viewportVisibilityRatio = calculateVisibleAreaRatio(rect, {\n top: 0,\n left: 0,\n bottom: window.innerHeight,\n right: window.innerWidth\n });\n \n // If element is less than 80% visible in viewport, consider it overlaid\n if (viewportVisibilityRatio < 0.8) {\n if (isComplexComponent || isFrameworkButton) {\n diagnosticLog('Element is not sufficiently visible in viewport:', {\n visibilityRatio: viewportVisibilityRatio,\n elementRect: {\n top: rect.top,\n right: rect.right,\n bottom: rect.bottom,\n left: rect.left\n }\n });\n }\n return true;\n }\n \n // Then check all ancestor containers\n let parent = el.parentElement;\n while (parent) {\n const parentStyle = window.getComputedStyle(parent);\n \n // Reliable way to detect if an element has scrollbars or is scrollable\n const hasScrollHeight = parent.scrollHeight > parent.clientHeight;\n const hasScrollWidth = parent.scrollWidth > parent.clientWidth;\n \n // Check actual style properties\n const hasOverflowY = parentStyle.overflowY === 'auto' || \n parentStyle.overflowY === 'scroll' || \n parentStyle.overflowY === 'overlay';\n const hasOverflowX = parentStyle.overflowX === 'auto' || \n parentStyle.overflowX === 'scroll' || \n parentStyle.overflowX === 'overlay';\n \n // Check common class names and attributes for scrollable containers across frameworks\n const hasScrollClasses = parent.classList.contains('scroll') || \n parent.classList.contains('scrollable') ||\n parent.classList.contains('overflow') ||\n parent.classList.contains('overflow-auto') ||\n parent.classList.contains('overflow-scroll') ||\n parent.getAttribute('data-scrollable') === 'true';\n \n // Check for height/max-height constraints that often indicate scrolling content\n const hasHeightConstraint = parentStyle.maxHeight && \n parentStyle.maxHeight !== 'none' && \n parentStyle.maxHeight !== 'auto';\n \n // An element is scrollable if it has:\n // 1. Actual scrollbars in use (most reliable check) OR\n // 2. Overflow styles allowing scrolling AND content that would require scrolling\n const isScrollable = (hasScrollHeight && hasOverflowY) || \n (hasScrollWidth && hasOverflowX) ||\n (hasScrollClasses && (hasScrollHeight || hasScrollWidth)) ||\n (hasHeightConstraint && hasScrollHeight);\n \n if (isScrollable) {\n const parentRect = parent.getBoundingClientRect();\n \n // Calculate how much of the element is visible within the container\n const visibilityRatio = calculateVisibleAreaRatio(rect, parentRect);\n \n // Only consider elements as overlaid if they're completely invisible (0% visible)\n // This ensures elements partially visible at the bottom of scrollable containers are still detected\n if (visibilityRatio === 0) {\n diagnosticLog('Element is in scrollable container but completely invisible:', {\n visibilityRatio: visibilityRatio,\n elementRect: {\n top: rect.top,\n right: rect.right,\n bottom: rect.bottom,\n left: rect.left\n },\n containerRect: {\n top: parentRect.top,\n right: parentRect.right,\n bottom: parentRect.bottom,\n left: parentRect.left\n },\n containerClass: parent.className,\n hasScrollHeight,\n hasScrollWidth,\n hasOverflowY,\n hasOverflowX\n });\n return true;\n }\n }\n \n parent = parent.parentElement;\n }\n \n return false;\n }\n \n // Check if element is in a scrollable container but not fully visible\n let isInScrollableContainerOnly = false;\n \n // For all elements, check if in scrollable container but not fully visible\n isInScrollableContainerOnly = isInScrollableContainerButNotFullyVisible(element);\n \n // Special handling for elements in scrollable containers\n if (isInScrollableContainerOnly) {\n // Special handling for very deep nested selectors (which are often in scrollable containers)\n // These are typically elements in tables, lists, and grids with scroll\n if (elementInfo.css_selector && \n (elementInfo.css_selector.split('>').length > 10 || \n (elementInfo.element.className && \n typeof elementInfo.element.className === 'string' && \n (elementInfo.element.className.includes('widget') || \n elementInfo.element.className.includes('list-item') ||\n elementInfo.element.className.includes('item') ||\n elementInfo.element.className.includes('card') ||\n elementInfo.element.className.includes('result'))))) {\n \n diagnosticLog('Allowing deeply nested element in scrollable container:', \n elementInfo.css_selector.substring(0, 100) + '...');\n // Don't consider it overlaid, this is likely a valid item in a scrollable list/table/widget\n return false;\n }\n return true; // Element needs scrolling to be fully visible\n }\n \n // If no element found at this point, or if element is self/ancestor/descendant, \n // this point is not overlaid\n if (!elementAtPoint ||\n elementAtPoint === element || \n isDecendent(element, elementAtPoint) || \n isDecendent(elementAtPoint, element)) {\n continue;\n }\n \n // Check if this point is covered by a popup/modal - this takes precedence\n if (isElementOrAncestorPopup(elementAtPoint)) {\n isUnderPopup = true;\n overlaidPoints++;\n continue;\n }\n \n // Special handling for complex components like those with Shadow DOM\n if ((isComplexComponent || isFrameworkButton) && !isUnderPopup) {\n // Only count as overlaid if it's clearly not part of the component's internal structure\n // For complex components, elementFromPoint often returns internal implementation details\n // that shouldn't count as \"overlaying\" the component itself\n \n // Skip points that might be part of the same component system\n if (elementAtPoint.tagName && elementAtPoint.tagName.toLowerCase().includes('-')) {\n // Custom elements (containing dash in the name) are likely part of the component framework\n continue;\n }\n \n // Only count clear UI overlays like dialogs or tooltips as actual overlays\n const elementTag = elementAtPoint.tagName.toLowerCase();\n const isOverlayingElement = elementTag === 'dialog' || \n elementAtPoint.getAttribute('role') === 'dialog' ||\n elementAtPoint.getAttribute('role') === 'tooltip' ||\n (elementAtPoint.className && \n typeof elementAtPoint.className === 'string' && \n (elementAtPoint.className.includes('overlay') || \n elementAtPoint.className.includes('modal') ||\n elementAtPoint.className.includes('popup')));\n \n if (!isOverlayingElement) {\n continue; // Don't count this point as overlaid for complex components\n }\n }\n \n // Special check for debug rows and elements from topbar\n /* Debug code - commented out\n if (isRowToDebug && elementAtPoint.tagName === 'SPAN' && \n elementAtPoint.className && \n typeof elementAtPoint.className === 'string' && \n (elementAtPoint.className.includes('tab') || \n elementAtPoint.className.includes('nav') ||\n elementAtPoint.className.includes('topbar'))) {\n continue;\n }\n */\n \n // If this point is covered by a top navigation element, don't count it as overlaid\n if (isNearTopOfViewport && isElementOrAncestorTopNav(elementAtPoint)) {\n continue;\n }\n \n // This point is overlaid by something else\n overlaidPoints++;\n if (isComplexComponent || isFrameworkButton) {\n diagnosticLog('Point is overlaid by element:', elementAtPoint.tagName);\n }\n }\n \n // If we don't have any valid points (all outside viewport), element isn't overlaid\n if (validPoints === 0) {\n /* Debug code - commented out\n if (isRowToDebug) {\n console.log('No valid points inside viewport');\n console.log('Final overlay decision: NOT OVERLAID');\n console.log('-------------------------------------------');\n }\n */\n return false;\n }\n \n // If we detected the element is under a popup with significant coverage, it's overlaid\n if (isUnderPopup && overlaidPoints > (validPoints / 2)) {\n /* Debug code - commented out\n if (isRowToDebug) {\n console.log('Element is under a popup/modal with significant coverage');\n console.log('Final overlay decision: OVERLAID');\n console.log('-------------------------------------------');\n }\n */\n return true;\n }\n \n // Calculate percentage of points that are overlaid\n const overlaidPercentage = overlaidPoints / validPoints;\n \n // For complex components, we want to be especially certain they're truly overlaid\n // rather than just having framework-specific DOM complexities\n let overlayThreshold = 0.5; // Default threshold - 50% of points must be overlaid\n \n // Complex components require stronger evidence of overlay\n if ((isComplexComponent || isFrameworkButton) && !isUnderPopup) {\n // For complex components like those with Shadow DOM, \n // we need stronger evidence they're actually overlaid\n overlayThreshold = 0.7; // 70% of points must be overlaid for complex components\n }\n \n // More robust threshold - require sufficient points to be overlaid based on component type\n const isElementOverlaid = overlaidPercentage > overlayThreshold;\n \n return isElementOverlaid;\n }\n\n const highlight = {\n execute: async function(elementTypes, handleScroll=false) {\n const elements = await findElements(elementTypes);\n highlightElements(elements);\n return elements;\n },\n\n unexecute: function(handleScroll=false) {\n unhighlightElements(handleScroll);\n },\n\n generateJSON: async function() {\n const json = {};\n await Promise.all(Object.values(ElementTag).map(async elementType => {\n const elements = await findElements(elementType);\n json[elementType] = elements;\n }));\n\n // Serialize the JSON object\n const jsonString = JSON.stringify(json, null, 4); // Pretty print with 4 spaces\n\n console.log(`JSON: ${jsonString}`);\n return jsonString;\n },\n\n getElementInfo\n };\n\n\n function unhighlightElements(handleScroll=false) {\n const documents = getAllFrames();\n documents.forEach(doc => {\n const overlay = doc.getElementById('highlight-overlay');\n if (overlay) {\n if (handleScroll) {\n // Remove event listeners\n doc.removeEventListener('scroll', overlay.scrollHandler, true);\n doc.removeEventListener('resize', overlay.resizeHandler);\n }\n overlay.remove();\n }\n });\n }\n\n\n\n\n async function findElements(elementTypes, verbose=true) {\n const typesArray = Array.isArray(elementTypes) ? elementTypes : [elementTypes];\n console.log('Starting element search for types:', typesArray);\n\n const elements = [];\n typesArray.forEach(elementType => {\n if (elementType === ElementTag.FILLABLE) {\n elements.push(...findFillables());\n }\n if (elementType === ElementTag.SELECTABLE) {\n elements.push(...findDropdowns());\n }\n if (elementType === ElementTag.CLICKABLE) {\n elements.push(...findClickables());\n elements.push(...findToggles());\n elements.push(...findCheckables());\n }\n if (elementType === ElementTag.NON_INTERACTIVE_ELEMENT) {\n elements.push(...findNonInteractiveElements());\n }\n });\n\n // console.log('Before uniquify:', elements.length);\n const elementsWithInfo = elements.map((element, index) => \n getElementInfo(element, index)\n );\n \n const uniqueElements = uniquifyElements(elementsWithInfo);\n console.log(`Found ${uniqueElements.length} elements:`);\n \n // More comprehensive visibility check\n const visibleElements = uniqueElements.filter(elementInfo => {\n const el = elementInfo.element;\n const style = getComputedStyle(el);\n \n // Check various style properties that affect visibility\n if (style.display === 'none' || \n style.visibility === 'hidden' || \n parseFloat(style.opacity) === 0) {\n return false;\n }\n \n // Check if element has non-zero dimensions\n const rect = el.getBoundingClientRect();\n if (rect.width === 0 || rect.height === 0) {\n return false;\n }\n \n // Check if element is within viewport\n if (rect.bottom < 0 || \n rect.top > window.innerHeight || \n rect.right < 0 || \n rect.left > window.innerWidth) {\n // Element is outside viewport, but still might be valid \n // if user scrolls to it, so we'll include it\n return true;\n }\n \n return true;\n });\n \n console.log(`Out of which ${visibleElements.length} elements are visible:`);\n if (verbose) {\n visibleElements.forEach(info => {\n console.log(`Element ${info.index}:`, info);\n });\n }\n \n return visibleElements;\n }\n\n // elements is an array of objects with index, xpath\n function highlightElements(elements) {\n // console.log('Starting highlight for elements:', elements);\n \n // Create overlay if it doesn't exist and store it in a dictionary\n const documents = getAllFrames(); \n let overlays = {};\n documents.forEach(doc => {\n let overlay = doc.getElementById('highlight-overlay');\n if (!overlay) {\n overlay = doc.createElement('div');\n overlay.id = 'highlight-overlay';\n overlay.style.cssText = `\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n z-index: 10000;\n `;\n doc.body.appendChild(overlay);\n }\n overlays[doc.documentURI] = overlay;\n });\n \n\n const updateHighlights = (doc = null) => {\n if (doc) {\n overlays[doc.documentURI].innerHTML = '';\n } else {\n Object.values(overlays).forEach(overlay => { overlay.innerHTML = ''; });\n } \n elements.forEach(elementInfo => {\n // console.log('updateHighlights-Processing elementInfo:', elementInfo);\n let element = elementInfo.element; //getElementByXPathOrCssSelector(elementInfo);\n if (!element) {\n element = getElementByXPathOrCssSelector(elementInfo);\n if (!element)\n return;\n }\n \n //if highlights requested for a specific doc, skip unrelated elements\n if (doc && element.ownerDocument !== doc) {\n console.log(\"skipped element \", element, \" since it doesn't belong to document \", doc);\n return;\n }\n\n const rect = element.getBoundingClientRect();\n // console.log('Element rect:', elementInfo.tag, rect);\n \n if (rect.width === 0 || rect.height === 0) {\n console.warn('Element has zero dimensions:', elementInfo);\n return;\n }\n \n // Create border highlight (red rectangle)\n // use ownerDocument to support iframes/frames\n const highlight = element.ownerDocument.createElement('div');\n highlight.style.cssText = `\n position: fixed;\n left: ${rect.x}px;\n top: ${rect.y}px;\n width: ${rect.width}px;\n height: ${rect.height}px;\n border: 1px solid rgb(255, 0, 0);\n transition: all 0.2s ease-in-out;\n `;\n\n // Create index label container - now positioned to the right and slightly up\n const labelContainer = element.ownerDocument.createElement('div');\n labelContainer.style.cssText = `\n position: absolute;\n right: -10px; /* Offset to the right */\n top: -10px; /* Offset upwards */\n padding: 4px;\n background-color: rgba(255, 255, 0, 0.6);\n display: flex;\n align-items: center;\n justify-content: center;\n `;\n\n const text = element.ownerDocument.createElement('span');\n text.style.cssText = `\n color: rgb(0, 0, 0, 0.8);\n font-family: 'Courier New', Courier, monospace;\n font-size: 12px;\n font-weight: bold;\n line-height: 1;\n `;\n text.textContent = elementInfo.index;\n \n labelContainer.appendChild(text);\n highlight.appendChild(labelContainer); \n overlays[element.ownerDocument.documentURI].appendChild(highlight);\n });\n };\n\n // Initial highlight\n updateHighlights();\n\n documents.forEach(doc => {\n // Update highlights on scroll and resize\n console.log('registering scroll and resize handlers for document: ', doc);\n const scrollHandler = () => {\n requestAnimationFrame(() => updateHighlights(doc));\n };\n const resizeHandler = () => {\n updateHighlights(doc);\n };\n doc.addEventListener('scroll', scrollHandler, true);\n doc.addEventListener('resize', resizeHandler);\n // Store event handlers for cleanup\n overlays[doc.documentURI].scrollHandler = scrollHandler;\n overlays[doc.documentURI].resizeHandler = resizeHandler;\n }); \n }\n\n // function unexecute() {\n // unhighlightElements();\n // }\n\n // Make it available globally for both Extension and Playwright\n if (typeof window !== 'undefined') {\n window.ProboLabs = {\n ElementTag,\n highlight,\n unhighlightElements,\n findElements,\n highlightElements,\n getElementInfo\n };\n }\n\n exports.findElements = findElements;\n exports.getElementInfo = getElementInfo;\n exports.highlight = highlight;\n exports.highlightElements = highlightElements;\n exports.unhighlightElements = unhighlightElements;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n}));\n//# sourceMappingURL=probolabs.umd.js.map\n";
1
+ const highlighterCode = "(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\n typeof define === 'function' && define.amd ? define(['exports'], factory) :\n (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.ProboLabs = {}));\n})(this, (function (exports) { 'use strict';\n\n const ElementTag = {\n CLICKABLE: \"CLICKABLE\", // button, link, toggle switch, checkbox, radio, dropdowns, clickable divs\n FILLABLE: \"FILLABLE\", // input, textarea content_editable, date picker??\n SELECTABLE: \"SELECTABLE\", // select\n NON_INTERACTIVE_ELEMENT: 'NON_INTERACTIVE_ELEMENT',\n };\n\n class ElementInfo {\n constructor(element, index, {tag, type, text, html, xpath, css_selector, bounding_box, iframe_selector}) {\n this.index = index.toString();\n this.tag = tag;\n this.type = type;\n this.text = text;\n this.html = html;\n this.xpath = xpath;\n this.css_selector = css_selector;\n this.bounding_box = bounding_box;\n this.iframe_selector = iframe_selector;\n this.element = element;\n this.depth = -1;\n }\n\n getSelector() {\n return this.xpath ? this.xpath : this.css_selector;\n }\n\n getDepth() {\n if (this.depth >= 0) {\n return this.depth;\n }\n \n this.depth = 0;\n let currentElement = this.element;\n \n while (currentElement.nodeType === Node.ELEMENT_NODE) { \n this.depth++;\n if (currentElement.assignedSlot) {\n currentElement = currentElement.assignedSlot;\n }\n else {\n currentElement = currentElement.parentNode;\n // Check if we're at a shadow root\n if (currentElement && currentElement.nodeType !== Node.ELEMENT_NODE && currentElement.getRootNode() instanceof ShadowRoot) {\n // Get the shadow root's host element\n currentElement = currentElement.getRootNode().host; \n }\n }\n }\n \n return this.depth;\n }\n }\n\n // import { realpath } from \"fs\";\n\n function getAllDocumentElementsIncludingShadow(selectors, root = document) {\n const elements = Array.from(root.querySelectorAll(selectors));\n\n root.querySelectorAll('*').forEach(el => {\n if (el.shadowRoot) {\n elements.push(...getAllDocumentElementsIncludingShadow(selectors, el.shadowRoot));\n }\n });\n return elements;\n }\n\n function getAllFrames(root = document) {\n const result = [root];\n const frames = getAllDocumentElementsIncludingShadow('frame, iframe', root); \n frames.forEach(frame => {\n try {\n const frameDocument = frame.contentDocument || frame.contentWindow.document;\n if (frameDocument) {\n result.push(frameDocument);\n }\n } catch (e) {\n // Skip cross-origin frames\n console.warn('Could not access frame content:', e.message);\n }\n });\n\n return result;\n }\n\n function getAllElementsIncludingShadow(selectors, root = document) {\n const elements = [];\n\n getAllFrames(root).forEach(doc => {\n elements.push(...getAllDocumentElementsIncludingShadow(selectors, doc));\n });\n\n return elements;\n }\n\n /**\n * Deeply searches through DOM trees including Shadow DOM and frames/iframes\n * @param {string} selector - CSS selector to search for\n * @param {Document|Element} [root=document] - Starting point for the search\n * @param {Object} [options] - Search options\n * @param {boolean} [options.searchShadow=true] - Whether to search Shadow DOM\n * @param {boolean} [options.searchFrames=true] - Whether to search frames/iframes\n * @returns {Element[]} Array of found elements\n \n function getAllElementsIncludingShadow(selector, root = document, options = {}) {\n const {\n searchShadow = true,\n searchFrames = true\n } = options;\n\n const results = new Set();\n \n // Helper to check if an element is valid and not yet found\n const addIfValid = (element) => {\n if (element && !results.has(element)) {\n results.add(element);\n }\n };\n\n // Helper to process a single document or element\n function processNode(node) {\n // Search regular DOM\n node.querySelectorAll(selector).forEach(addIfValid);\n\n if (searchShadow) {\n // Search all shadow roots\n const treeWalker = document.createTreeWalker(\n node,\n NodeFilter.SHOW_ELEMENT,\n {\n acceptNode: (element) => {\n return element.shadowRoot ? \n NodeFilter.FILTER_ACCEPT : \n NodeFilter.FILTER_SKIP;\n }\n }\n );\n\n while (treeWalker.nextNode()) {\n const element = treeWalker.currentNode;\n if (element.shadowRoot) {\n // Search within shadow root\n element.shadowRoot.querySelectorAll(selector).forEach(addIfValid);\n // Recursively process the shadow root for nested shadow DOMs\n processNode(element.shadowRoot);\n }\n }\n }\n\n if (searchFrames) {\n // Search frames and iframes\n const frames = node.querySelectorAll('frame, iframe');\n frames.forEach(frame => {\n try {\n const frameDocument = frame.contentDocument;\n if (frameDocument) {\n processNode(frameDocument);\n }\n } catch (e) {\n // Skip cross-origin frames\n console.warn('Could not access frame content:', e.message);\n }\n });\n }\n }\n\n // Start processing from the root\n processNode(root);\n\n return Array.from(results);\n }\n */\n // <div x=1 y=2 role='combobox'> </div>\n function findDropdowns() {\n const dropdowns = [];\n \n // Native select elements\n dropdowns.push(...getAllElementsIncludingShadow('select'));\n \n // Elements with dropdown roles that don't have <input>..</input>\n const roleElements = getAllElementsIncludingShadow('[role=\"combobox\"], [role=\"listbox\"], [role=\"dropdown\"], [role=\"option\"], [role=\"menu\"], [role=\"menuitem\"]').filter(el => {\n return el.tagName.toLowerCase() !== 'input' || ![\"button\", \"checkbox\", \"radio\"].includes(el.getAttribute(\"type\"));\n });\n dropdowns.push(...roleElements);\n \n // Common dropdown class patterns\n const dropdownPattern = /.*(dropdown|select|combobox|menu).*/i;\n const elements = getAllElementsIncludingShadow('*');\n const dropdownClasses = Array.from(elements).filter(el => {\n const hasDropdownClass = dropdownPattern.test(el.className);\n const validTag = ['li', 'ul', 'span', 'div', 'p', 'a', 'button'].includes(el.tagName.toLowerCase());\n const style = window.getComputedStyle(el); \n const result = hasDropdownClass && validTag && (style.cursor === 'pointer' || el.tagName.toLowerCase() === 'a' || el.tagName.toLowerCase() === 'button');\n return result;\n });\n \n dropdowns.push(...dropdownClasses);\n \n // Elements with aria-haspopup attribute\n dropdowns.push(...getAllElementsIncludingShadow('[aria-haspopup=\"true\"], [aria-haspopup=\"listbox\"], [aria-haspopup=\"menu\"]'));\n\n // Improve navigation element detection\n // Semantic nav elements with list items\n dropdowns.push(...getAllElementsIncludingShadow('nav ul li, nav ol li'));\n \n // Navigation elements in common design patterns\n dropdowns.push(...getAllElementsIncludingShadow('header a, .header a, .nav a, .navigation a, .menu a, .sidebar a, aside a'));\n \n // Elements in primary navigation areas with common attributes\n dropdowns.push(...getAllElementsIncludingShadow('[role=\"navigation\"] a, [aria-label*=\"navigation\"] a, [aria-label*=\"menu\"] a'));\n\n return dropdowns;\n }\n\n function findClickables() {\n const clickables = [];\n \n const checkboxPattern = /checkbox/i;\n // Collect all clickable elements first\n const nativeLinks = [...getAllElementsIncludingShadow('a[href]')];\n const nativeButtons = [...getAllElementsIncludingShadow('button')];\n const inputButtons = [...getAllElementsIncludingShadow('input[type=\"button\"], input[type=\"submit\"], input[type=\"reset\"]')];\n const roleButtons = [...getAllElementsIncludingShadow('[role=\"button\"]')];\n // const tabbable = [...getAllElementsIncludingShadow('[tabindex=\"0\"]')];\n const clickHandlers = [...getAllElementsIncludingShadow('[onclick]')];\n const dropdowns = findDropdowns();\n const nativeCheckboxes = [...getAllElementsIncludingShadow('input[type=\"checkbox\"]')]; \n const fauxCheckboxes = getAllElementsIncludingShadow('*').filter(el => {\n if (checkboxPattern.test(el.className)) {\n const realCheckboxes = getAllElementsIncludingShadow('input[type=\"checkbox\"]', el);\n if (realCheckboxes.length === 1) {\n const boundingRect = realCheckboxes[0].getBoundingClientRect();\n return boundingRect.width <= 1 && boundingRect.height <= 1 \n }\n }\n return false;\n });\n const nativeRadios = [...getAllElementsIncludingShadow('input[type=\"radio\"]')];\n const toggles = findToggles();\n const pointerElements = findElementsWithPointer();\n // Add all elements at once\n clickables.push(\n ...nativeLinks,\n ...nativeButtons,\n ...inputButtons,\n ...roleButtons,\n // ...tabbable,\n ...clickHandlers,\n ...dropdowns,\n ...nativeCheckboxes,\n ...fauxCheckboxes,\n ...nativeRadios,\n ...toggles,\n ...pointerElements\n );\n\n // Only uniquify once at the end\n return clickables; // Let findElements handle the uniquification\n }\n\n function findToggles() {\n const toggles = [];\n const checkboxes = getAllElementsIncludingShadow('input[type=\"checkbox\"]');\n const togglePattern = /switch|toggle|slider/i;\n\n checkboxes.forEach(checkbox => {\n let isToggle = false;\n\n // Check the checkbox itself\n if (togglePattern.test(checkbox.className) || togglePattern.test(checkbox.getAttribute('role') || '')) {\n isToggle = true;\n }\n\n // Check parent elements (up to 3 levels)\n if (!isToggle) {\n let element = checkbox;\n for (let i = 0; i < 3; i++) {\n const parent = element.parentElement;\n if (!parent) break;\n\n const className = parent.className || '';\n const role = parent.getAttribute('role') || '';\n\n if (togglePattern.test(className) || togglePattern.test(role)) {\n isToggle = true;\n break;\n }\n element = parent;\n }\n }\n\n // Check next sibling\n if (!isToggle) {\n const nextSibling = checkbox.nextElementSibling;\n if (nextSibling) {\n const className = nextSibling.className || '';\n const role = nextSibling.getAttribute('role') || '';\n if (togglePattern.test(className) || togglePattern.test(role)) {\n isToggle = true;\n }\n }\n }\n\n if (isToggle) {\n toggles.push(checkbox);\n }\n });\n\n return toggles;\n }\n\n function findNonInteractiveElements() {\n // Get all elements in the document\n const all = Array.from(getAllElementsIncludingShadow('*'));\n \n // Filter elements based on Python implementation rules\n return all.filter(element => {\n if (!element.firstElementChild) {\n const tag = element.tagName.toLowerCase(); \n if (!['select', 'button', 'a'].includes(tag)) {\n const validTags = ['p', 'span', 'div', 'input', 'textarea'].includes(tag) || /^h\\d$/.test(tag) || /text/.test(tag);\n const boundingRect = element.getBoundingClientRect();\n return validTags && boundingRect.height > 1 && boundingRect.width > 1;\n }\n }\n return false;\n });\n }\n\n\n\n // export function findNonInteractiveElements() {\n // const all = [];\n // try {\n // const elements = getAllElementsIncludingShadow('*');\n // all.push(...elements);\n // } catch (e) {\n // console.warn('Error getting elements:', e);\n // }\n \n // console.debug('Total elements found:', all.length);\n \n // return all.filter(element => {\n // try {\n // const tag = element.tagName.toLowerCase(); \n\n // // Special handling for input elements\n // if (tag === 'input' || tag === 'textarea') {\n // const boundingRect = element.getBoundingClientRect();\n // const value = element.value || '';\n // const placeholder = element.placeholder || '';\n // return boundingRect.height > 1 && \n // boundingRect.width > 1 && \n // (value.trim() !== '' || placeholder.trim() !== '');\n // }\n\n \n // // Check if it's a valid tag for text content\n // const validTags = ['p', 'span', 'div', 'label', 'th', 'td', 'li', 'button', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'a', 'select'].includes(tag) || \n // /^h\\d$/.test(tag) || \n // /text/.test(tag);\n\n // const boundingRect = element.getBoundingClientRect();\n\n // // Get direct text content, excluding child element text\n // let directText = '';\n // for (const node of element.childNodes) {\n // // Only include text nodes (nodeType 3)\n // if (node.nodeType === 3) {\n // directText += node.textContent || '';\n // }\n // }\n \n // // If no direct text and it's a table cell or heading, check label content\n // if (!directText.trim() && (tag === 'th' || tag === 'td' || tag === 'h1')) {\n // const labels = element.getElementsByTagName('label');\n // for (const label of labels) {\n // directText += label.textContent || '';\n // }\n // }\n\n // // If still no text and it's a heading, get all text content\n // if (!directText.trim() && tag === 'h1') {\n // directText = element.textContent || '';\n // }\n\n // directText = directText.trim();\n\n // // Debug logging\n // if (directText) {\n // console.debugg('Text element found:', {\n // tag,\n // text: directText,\n // dimensions: boundingRect,\n // element\n // });\n // }\n\n // return validTags && \n // boundingRect.height > 1 && \n // boundingRect.width > 1 && \n // directText !== '';\n \n // } catch (e) {\n // console.warn('Error processing element:', e);\n // return false;\n // }\n // });\n // }\n\n\n\n\n\n function findElementsWithPointer() {\n const elements = [];\n const allElements = getAllElementsIncludingShadow('*');\n \n console.log('Checking elements with pointer style...');\n \n allElements.forEach(element => {\n // Skip SVG elements for now\n if (element instanceof SVGElement || element.tagName.toLowerCase() === 'svg') {\n return;\n }\n \n const style = window.getComputedStyle(element);\n if (style.cursor === 'pointer') {\n elements.push(element);\n }\n });\n \n console.log(`Found ${elements.length} elements with pointer cursor`);\n return elements;\n }\n\n function findCheckables() {\n const elements = [];\n\n elements.push(...getAllElementsIncludingShadow('input[type=\"checkbox\"]'));\n elements.push(...getAllElementsIncludingShadow('input[type=\"radio\"]'));\n const all_elements = getAllElementsIncludingShadow('label');\n const radioClasses = Array.from(all_elements).filter(el => {\n return /.*radio.*/i.test(el.className); \n });\n elements.push(...radioClasses);\n return elements;\n }\n\n function findFillables() {\n const elements = [];\n\n const inputs = [...getAllElementsIncludingShadow('input:not([type=\"radio\"]):not([type=\"checkbox\"])')];\n console.log('Found inputs:', inputs.length, inputs);\n elements.push(...inputs);\n \n const textareas = [...getAllElementsIncludingShadow('textarea')];\n console.log('Found textareas:', textareas.length);\n elements.push(...textareas);\n \n const editables = [...getAllElementsIncludingShadow('[contenteditable=\"true\"]')];\n console.log('Found editables:', editables.length);\n elements.push(...editables);\n\n return elements;\n }\n\n // Helper function to check if element is a form control\n function isFormControl(elementInfo) {\n return /^(input|select|textarea|button|label)$/i.test(elementInfo.tag);\n }\n\n const isDropdownItem = (elementInfo) => {\n const dropdownPatterns = [\n /dropdown[-_]?item/i, // matches: dropdown-item, dropdownitem, dropdown_item\n /menu[-_]?item/i, // matches: menu-item, menuitem, menu_item\n /dropdown[-_]?link/i, // matches: dropdown-link, dropdownlink, dropdown_link\n /list[-_]?item/i, // matches: list-item, listitem, list_item\n /select[-_]?item/i, // matches: select-item, selectitem, select_item \n ];\n\n const rolePatterns = [\n /menu[-_]?item/i, // matches: menuitem, menu-item\n /option/i, // matches: option\n /list[-_]?item/i, // matches: listitem, list-item\n /tree[-_]?item/i // matches: treeitem, tree-item\n ];\n\n const hasMatchingClass = elementInfo.element.className && \n dropdownPatterns.some(pattern => \n pattern.test(elementInfo.element.className)\n );\n\n const hasMatchingRole = elementInfo.element.getAttribute('role') && \n rolePatterns.some(pattern => \n pattern.test(elementInfo.element.getAttribute('role'))\n );\n\n return hasMatchingClass || hasMatchingRole;\n };\n\n /**\n * Finds the first element matching a CSS selector, traversing Shadow DOM if necessary\n * @param {string} selector - CSS selector to search for\n * @param {Element} [root=document] - Root element to start searching from\n * @returns {Element|null} - The first matching element or null if not found\n */\n function querySelectorShadow(selector, root = document) {\n // First try to find in light DOM\n let element = root.querySelector(selector);\n if (element) return element;\n \n // Get all elements with shadow root\n const shadowElements = Array.from(root.querySelectorAll('*'))\n .filter(el => el.shadowRoot);\n \n // Search through each shadow root until we find a match\n for (const el of shadowElements) {\n element = querySelectorShadow(selector, el.shadowRoot);\n if (element) return element;\n }\n \n return null;\n }\n\n const getElementByXPathOrCssSelector = (element_info) => {\n let element;\n\n console.log('getElementByXPathOrCssSelector:', element_info);\n // if (element_info.xpath) { //try xpath if exists\n // element = document.evaluate(\n // element_info.xpath, \n // document, \n // null, \n // XPathResult.FIRST_ORDERED_NODE_TYPE, \n // null\n // ).singleNodeValue;\n \n // if (!element) {\n // console.warn('Failed to find element with xpath:', element_info.xpath);\n // }\n // }\n // else { //try CSS selector\n if (element_info.iframe_selector) {\n console.log('elementInfo with iframe: ', element_info);\n const frames = getAllDocumentElementsIncludingShadow('iframe');\n \n // Iterate over all frames and compare their CSS selectors\n for (const frame of frames) {\n const cssSelector = generateCssPath(frame);\n if (cssSelector === element_info.iframe_selector) {\n const frameDocument = frame.contentDocument || frame.contentWindow.document;\n element = querySelectorShadow(element_info.css_selector, frameDocument);\n console.log('found element ', element);\n break;\n } \n } }\n else\n element = querySelectorShadow(element_info.css_selector);\n // console.log('found element by CSS elector: ', element);\n if (!element) {\n console.warn('Failed to find element with CSS selector:', element_info.css_selector);\n }\n // }\n\n return element;\n };\n\n function generateXPath(element) {\n if (!element || element.getRootNode() instanceof ShadowRoot) return '';\n \n // If element has an id, use that (it's unique and shorter)\n if (element.id) {\n return `//*[@id=\"${element.id}\"]`;\n }\n \n const parts = [];\n let current = element;\n \n while (current && current.nodeType === Node.ELEMENT_NODE) {\n let index = 1;\n let sibling = current.previousSibling;\n \n while (sibling) {\n if (sibling.nodeType === Node.ELEMENT_NODE && sibling.tagName === current.tagName) {\n index++;\n }\n sibling = sibling.previousSibling;\n }\n \n const tagName = current.tagName.toLowerCase();\n parts.unshift(`${tagName}[${index}]`);\n current = current.parentNode;\n }\n \n return '/' + parts.join('/');\n }\n\n function isDecendent(parent, child) {\n let element = child;\n while (element.nodeType === Node.ELEMENT_NODE) { \n \n if (element.assignedSlot) {\n element = element.assignedSlot;\n }\n else {\n element = element.parentNode;\n // Check if we're at a shadow root\n if (element && element.nodeType !== Node.ELEMENT_NODE && element.getRootNode() instanceof ShadowRoot) {\n // Get the shadow root's host element\n element = element.getRootNode().host; \n }\n }\n if (element === parent)\n return true;\n }\n return false;\n }\n\n function generateCssPath(element) {\n if (!element) {\n console.error('ERROR: No element provided to generateCssPath returning empty string');\n return '';\n }\n const path = [];\n // console.group('Generating CSS path for:', element);\n while (element && element.nodeType === Node.ELEMENT_NODE) { \n let selector = element.nodeName.toLowerCase();\n // console.log('Element:', selector, element);\n \n // if (element.id) {\n // //escape special characters\n // const normalized_id = element.id.replace(/[:;.#()[\\]!@$%^&*]/g, '\\\\$&');\n // selector = `#${normalized_id}`;\n // path.unshift(selector);\n // break;\n // } \n \n let sibling = element;\n let nth = 1;\n while (sibling = sibling.previousElementSibling) {\n if (sibling.nodeName.toLowerCase() === selector) nth++;\n }\n sibling = element;\n while (sibling = sibling.nextElementSibling) {\n if (sibling.nodeName.toLowerCase() === selector) {\n break;\n }\n }\n selector += `:nth-of-type(${nth})`;\n \n \n path.unshift(selector);\n //console.log(` Current path: ${path.join(' > ')}`);\n\n if (element.assignedSlot) {\n element = element.assignedSlot;\n // console.log(' Moving to assigned slot');\n }\n else {\n element = element.parentNode;\n // console.log(' Moving to parent:', element);\n\n // Check if we're at a shadow root\n if (element && element.nodeType !== Node.ELEMENT_NODE && element.getRootNode() instanceof ShadowRoot) {\n console.log(' Found shadow root, moving to host');\n // Get the shadow root's host element\n element = element.getRootNode().host; \n }\n }\n }\n \n // console.log('Final selector:', path.join(' > '));\n // console.groupEnd();\n return path.join(' > ');\n }\n\n\n function cleanHTML(rawHTML) {\n const parser = new DOMParser();\n const doc = parser.parseFromString(rawHTML, \"text/html\");\n\n function cleanElement(element) {\n const allowedAttributes = new Set([\n \"role\",\n \"type\",\n \"class\",\n \"href\",\n \"alt\",\n \"title\",\n \"readonly\",\n \"checked\",\n \"enabled\",\n \"disabled\",\n ]);\n\n [...element.attributes].forEach(attr => {\n const name = attr.name.toLowerCase();\n const value = attr.value;\n\n const isTestAttribute = /^(testid|test-id|data-test-id)$/.test(name);\n const isDataAttribute = name.startsWith(\"data-\") && value;\n const isBooleanAttribute = [\"readonly\", \"checked\", \"enabled\", \"disabled\"].includes(name);\n\n if (!allowedAttributes.has(name) && !isDataAttribute && !isTestAttribute && !isBooleanAttribute) {\n element.removeAttribute(name);\n }\n });\n\n // Handle SVG content - more aggressive replacement\n if (element.tagName.toLowerCase() === \"svg\") {\n // Remove all attributes except class and role\n [...element.attributes].forEach(attr => {\n const name = attr.name.toLowerCase();\n if (name !== \"class\" && name !== \"role\") {\n element.removeAttribute(name);\n }\n });\n element.innerHTML = \"CONTENT REMOVED\";\n } else {\n // Recursively clean child elements\n Array.from(element.children).forEach(cleanElement);\n }\n\n // Only remove empty elements that aren't semantic or icon elements\n const keepEmptyElements = ['i', 'span', 'svg', 'button', 'input'];\n if (!keepEmptyElements.includes(element.tagName.toLowerCase()) && \n !element.children.length && \n !element.textContent.trim()) {\n element.remove();\n }\n }\n\n // Process all elements in the document body\n Array.from(doc.body.children).forEach(cleanElement);\n return doc.body.innerHTML;\n }\n\n function getContainingIframe(element) {\n // If not in an iframe, return null\n if (element.ownerDocument.defaultView === window.top) {\n return null;\n }\n \n // Try to find the iframe in the parent document that contains our element\n try {\n const parentDocument = element.ownerDocument.defaultView.parent.document;\n const iframes = parentDocument.querySelectorAll('iframe');\n \n for (const iframe of iframes) {\n if (iframe.contentWindow === element.ownerDocument.defaultView) {\n return iframe;\n }\n }\n } catch (e) {\n // Cross-origin restriction\n return \"Cross-origin iframe - cannot access details\";\n }\n \n return null;\n }\n\n function getElementInfo(element, index) {\n\n const xpath = generateXPath(element);\n const css_selector = generateCssPath(element);\n\n const iframe = getContainingIframe(element);\n const iframe_selector = iframe ? generateCssPath(iframe) : \"\";\n\n // Return element info with pre-calculated values\n return new ElementInfo(element, index, {\n tag: element.tagName.toLowerCase(),\n type: element.type || '',\n text: element.innerText, //getTextContent(element),\n html: cleanHTML(element.outerHTML),\n xpath: xpath,\n css_selector: css_selector,\n bounding_box: element.getBoundingClientRect(),\n iframe_selector: iframe_selector\n });\n }\n\n\n\n\n const filterZeroDimensions = (elementInfo) => {\n const rect = elementInfo.bounding_box;\n //single pixel elements are typically faux controls and should be filtered too\n const hasSize = rect.width > 1 && rect.height > 1;\n const style = window.getComputedStyle(elementInfo.element);\n const isVisible = style.display !== 'none' && style.visibility !== 'hidden';\n \n if (!hasSize || !isVisible) {\n // if (elementInfo.element.isConnected) {\n // console.log('Filtered out invisible/zero-size element:', {\n // tag: elementInfo.tag,\n // xpath: elementInfo.xpath,\n // element: elementInfo.element,\n // hasSize,\n // isVisible,\n // dimensions: rect\n // });\n // }\n return false;\n }\n return true;\n };\n\n\n\n function uniquifyElements(elements) {\n const seen = new Set();\n\n console.log(`Starting uniquification with ${elements.length} elements`);\n\n // Filter out testing infrastructure elements first\n const filteredInfrastructure = elements.filter(element_info => {\n // Skip the highlight-overlay element completely - it's part of the testing infrastructure\n if (element_info.element.id === 'highlight-overlay' || \n (element_info.css_selector && element_info.css_selector.includes('#highlight-overlay'))) {\n console.log('Filtered out testing infrastructure element:', element_info.css_selector);\n return false;\n }\n \n // Filter out UI framework container/manager elements\n const el = element_info.element;\n // UI framework container checks - generic detection for any framework\n if ((el.getAttribute('data-rendered-by') || \n el.getAttribute('data-reactroot') || \n el.getAttribute('ng-version') || \n el.getAttribute('data-component-id') ||\n el.getAttribute('data-root') ||\n el.getAttribute('data-framework')) && \n (el.className && \n typeof el.className === 'string' && \n (el.className.includes('Container') || \n el.className.includes('container') || \n el.className.includes('Manager') || \n el.className.includes('manager')))) {\n console.log('Filtered out UI framework container element:', element_info.css_selector);\n return false;\n }\n \n // Direct filter for framework container elements that shouldn't be interactive\n // Consolidating multiple container detection patterns into one efficient check\n const isFullViewport = element_info.bounding_box && \n element_info.bounding_box.x <= 5 && \n element_info.bounding_box.y <= 5 && \n element_info.bounding_box.width >= (window.innerWidth * 0.95) && \n element_info.bounding_box.height >= (window.innerHeight * 0.95);\n \n // Empty content check\n const isEmpty = !el.innerText || el.innerText.trim() === '';\n \n // Check if it's a framework container element\n if (element_info.element.tagName === 'DIV' && \n isFullViewport && \n isEmpty && \n (\n // Pattern matching for root containers\n (element_info.xpath && \n (element_info.xpath.match(/^\\/html\\[\\d+\\]\\/body\\[\\d+\\]\\/div\\[\\d+\\]\\/div\\[\\d+\\]$/) || \n element_info.xpath.match(/^\\/\\/\\*\\[@id='[^']+'\\]\\/div\\[\\d+\\]$/))) ||\n \n // Simple DOM structure\n (element_info.css_selector.split(' > ').length <= 4 && element_info.depth <= 5) ||\n \n // Empty or container-like classes\n (!el.className || el.className === '' || \n (typeof el.className === 'string' && \n (el.className.includes('overlay') || \n el.className.includes('container') || \n el.className.includes('wrapper'))))\n )) {\n console.log('Filtered out framework container element:', element_info.css_selector);\n return false;\n }\n \n return true;\n });\n\n // First filter out elements with zero dimensions\n const nonZeroElements = filteredInfrastructure.filter(filterZeroDimensions);\n // sort by CSS selector depth so parents are processed first\n nonZeroElements.sort((a, b) => a.getDepth() - b.getDepth());\n console.log(`After dimension filtering: ${nonZeroElements.length} elements remain (${elements.length - nonZeroElements.length} removed)`);\n \n const filteredByParent = nonZeroElements.filter(element_info => {\n\n const parent = findClosestParent(seen, element_info);\n const keep = parent == null || shouldKeepNestedElement(element_info, parent);\n // console.log(\"node \", element_info.index, \": keep=\", keep, \" parent=\", parent);\n // if (!keep && !element_info.xpath) {\n // console.log(\"Filtered out element \", element_info,\" because it's a nested element of \", parent);\n // }\n if (keep)\n seen.add(element_info.css_selector);\n\n return keep;\n });\n\n console.log(`After parent/child filtering: ${filteredByParent.length} elements remain (${nonZeroElements.length - filteredByParent.length} removed)`);\n\n // Final overlap filtering\n const filteredResults = filteredByParent.filter(element => {\n\n // Look for any element that came BEFORE this one in the array\n const hasEarlierOverlap = filteredByParent.some(other => {\n // Only check elements that came before (lower index)\n if (filteredByParent.indexOf(other) >= filteredByParent.indexOf(element)) {\n return false;\n }\n \n const isOverlapping = areElementsOverlapping(element, other); \n return isOverlapping;\n }); \n\n // Keep element if it has no earlier overlapping elements\n return !hasEarlierOverlap;\n });\n \n \n \n // Check for overlay removal\n console.log(`After filtering: ${filteredResults.length} (${filteredByParent.length - filteredResults.length} removed by overlap)`);\n \n const nonOverlaidElements = filteredResults.filter(element => {\n return !isOverlaid(element);\n });\n\n console.log(`Final elements after overlay removal: ${nonOverlaidElements.length} (${filteredResults.length - nonOverlaidElements.length} removed)`);\n \n return nonOverlaidElements;\n\n }\n\n\n\n const areElementsOverlapping = (element1, element2) => {\n if (element1.css_selector === element2.css_selector) {\n return true;\n }\n \n const box1 = element1.bounding_box;\n const box2 = element2.bounding_box;\n \n return box1.x === box2.x &&\n box1.y === box2.y &&\n box1.width === box2.width &&\n box1.height === box2.height;\n // element1.text === element2.text &&\n // element2.tag === 'a';\n };\n\n function findClosestParent(seen, element_info) { \n // //Use element child/parent queries\n // let parent = element_info.element.parentNode;\n // if (parent.getRootNode() instanceof ShadowRoot) {\n // // Get the shadow root's host element\n // parent = parent.getRootNode().host; \n // }\n\n // while (parent.nodeType === Node.ELEMENT_NODE) { \n // const css_selector = generateCssPath(parent);\n // if (seen.has(css_selector)) {\n // console.log(\"element \", element_info, \" closest parent is \", parent)\n // return parent; \n // }\n // parent = parent.parentNode;\n // if (parent.getRootNode() instanceof ShadowRoot) {\n // // Get the shadow root's host element\n // parent = parent.getRootNode().host; \n // }\n // }\n\n // Split the xpath into segments\n const segments = element_info.css_selector.split(' > ');\n \n // Try increasingly shorter paths until we find one in the seen set\n for (let i = segments.length - 1; i > 0; i--) {\n const parentPath = segments.slice(0, i).join(' > ');\n if (seen.has(parentPath)) {\n return parentPath;\n }\n }\n\n return null;\n }\n\n function shouldKeepNestedElement(elementInfo, parentPath) {\n let result = false;\n const parentSegments = parentPath.split(' > ');\n\n const isParentLink = /^a(:nth-of-type\\(\\d+\\))?$/.test(parentSegments[parentSegments.length - 1]);\n if (isParentLink) {\n return false; \n }\n // If this is a checkbox/radio input\n if (elementInfo.tag === 'input' && \n (elementInfo.type === 'checkbox' || elementInfo.type === 'radio')) {\n \n // Check if parent is a label by looking at the parent xpath's last segment\n \n const isParentLabel = /^label(:nth-of-type\\(\\d+\\))?$/.test(parentSegments[parentSegments.length - 1]);\n \n // If parent is a label, don't keep the input (we'll keep the label instead)\n if (isParentLabel) {\n return false;\n }\n }\n \n // Keep all other form controls and dropdown items\n if (isFormControl(elementInfo) || isDropdownItem(elementInfo)) {\n result = true;\n }\n\n if(isTableCell(elementInfo)) {\n result = true;\n }\n \n \n // console.log(`shouldKeepNestedElement: ${elementInfo.tag} ${elementInfo.text} ${elementInfo.xpath} -> ${parentXPath} -> ${result}`);\n return result;\n }\n\n\n function isTableCell(elementInfo) {\n const element = elementInfo.element;\n if(!element || !(element instanceof HTMLElement)) {\n return false;\n }\n const validTags = new Set(['td', 'th']);\n const validRoles = new Set(['cell', 'gridcell', 'columnheader', 'rowheader']);\n \n const tag = element.tagName.toLowerCase();\n const role = element.getAttribute('role')?.toLowerCase();\n\n if (validTags.has(tag) || (role && validRoles.has(role))) {\n return true;\n }\n return false;\n \n }\n\n function isOverlaid(elementInfo) {\n const element = elementInfo.element;\n const boundingRect = elementInfo.bounding_box;\n\n // Special handling for tooltips\n if (elementInfo.element.className && typeof elementInfo.element.className === 'string' && \n elementInfo.element.className.includes('tooltip')) {\n return false;\n }\n \n // Special handling for deep component hierarchies\n // const cssSelector = elementInfo.css_selector;\n \n // Identify complex components with deep hierarchy (important for Shadow DOM components)\n // const isComplexComponent = cssSelector.length > 500 || \n // (cssSelector.includes('slot:nth-of-type') && \n // cssSelector.split('>').length > 15);\n \n // Special handling for deep component buttons in any framework\n // const isFrameworkButton = cssSelector.split('>').length > 10 && \n // cssSelector.includes('button:nth-of-type');\n \n // if (isComplexComponent || isFrameworkButton) {\n // Check if the element is visible on screen\n // if (boundingRect.width > 0 && \n // boundingRect.height > 0 && \n // boundingRect.bottom > 0 && \n // boundingRect.right > 0 &&\n // boundingRect.top < window.innerHeight &&\n // boundingRect.left < window.innerWidth) {\n \n // Get element at the center point to check if it's covered by a popup/modal\n const middleX = boundingRect.x + boundingRect.width/2;\n const middleY = boundingRect.y + boundingRect.height/2;\n const elementAtMiddle = element.ownerDocument.elementFromPoint(middleX, middleY);\n \n if (elementAtMiddle && \n elementAtMiddle !== element && \n !isDecendent(element, elementAtMiddle) && \n !isDecendent(elementAtMiddle, element)) {\n // Make sure it doesn't have CSS that would hide it\n // const style = window.getComputedStyle(element);\n // if (style.display !== 'none' && \n // style.visibility !== 'hidden' && \n // style.opacity !== '0') {\n // diagnosticLog('Element at middle is self or related, not overlaid');\n // diagnosticLog('Style properties:', { \n // display: style.display, \n // visibility: style.visibility, \n // opacity: style.opacity \n // });\n // return false; // It's visible and not covered, so not overlaid\n // }\n return true;\n }\n \n // Check specifically if the element at middle is a popup/modal\n // if (elementAtMiddle && isElementOrAncestorPopup(elementAtMiddle)) {\n // diagnosticLog('Element at middle is a popup/modal, element IS overlaid');\n // return true; // It's under a popup, so it is overlaid\n // }\n return false;\n // }\n // return false;\n }\n\n const highlight = {\n execute: async function(elementTypes, handleScroll=false) {\n const elements = await findElements(elementTypes);\n highlightElements(elements);\n return elements;\n },\n\n unexecute: function(handleScroll=false) {\n unhighlightElements(handleScroll);\n },\n\n generateJSON: async function() {\n const json = {};\n\n // Capture viewport dimensions\n const viewportData = {\n width: window.innerWidth,\n height: window.innerHeight,\n documentWidth: document.documentElement.clientWidth,\n documentHeight: document.documentElement.clientHeight,\n timestamp: new Date().toISOString()\n };\n\n // Add viewport data to the JSON output\n json.viewport = viewportData;\n\n\n await Promise.all(Object.values(ElementTag).map(async elementType => {\n const elements = await findElements(elementType);\n json[elementType] = elements;\n }));\n\n // Serialize the JSON object\n const jsonString = JSON.stringify(json, null, 4); // Pretty print with 4 spaces\n\n console.log(`JSON: ${jsonString}`);\n return jsonString;\n },\n\n getElementInfo\n };\n\n\n function unhighlightElements(handleScroll=false) {\n const documents = getAllFrames();\n documents.forEach(doc => {\n const overlay = doc.getElementById('highlight-overlay');\n if (overlay) {\n if (handleScroll) {\n // Remove event listeners\n doc.removeEventListener('scroll', overlay.scrollHandler, true);\n doc.removeEventListener('resize', overlay.resizeHandler);\n }\n overlay.remove();\n }\n });\n }\n\n\n\n\n async function findElements(elementTypes, verbose=true) {\n const typesArray = Array.isArray(elementTypes) ? elementTypes : [elementTypes];\n console.log('Starting element search for types:', typesArray);\n\n const elements = [];\n typesArray.forEach(elementType => {\n if (elementType === ElementTag.FILLABLE) {\n elements.push(...findFillables());\n }\n if (elementType === ElementTag.SELECTABLE) {\n elements.push(...findDropdowns());\n }\n if (elementType === ElementTag.CLICKABLE) {\n elements.push(...findClickables());\n elements.push(...findToggles());\n elements.push(...findCheckables());\n }\n if (elementType === ElementTag.NON_INTERACTIVE_ELEMENT) {\n elements.push(...findNonInteractiveElements());\n }\n });\n\n // console.log('Before uniquify:', elements.length);\n const elementsWithInfo = elements.map((element, index) => \n getElementInfo(element, index)\n );\n \n const uniqueElements = uniquifyElements(elementsWithInfo);\n console.log(`Found ${uniqueElements.length} elements:`);\n \n // More comprehensive visibility check\n const visibleElements = uniqueElements.filter(elementInfo => {\n const el = elementInfo.element;\n const style = getComputedStyle(el);\n \n // Check various style properties that affect visibility\n if (style.display === 'none' || \n style.visibility === 'hidden' || \n parseFloat(style.opacity) === 0) {\n return false;\n }\n \n // Check if element has non-zero dimensions\n const rect = el.getBoundingClientRect();\n if (rect.width === 0 || rect.height === 0) {\n return false;\n }\n \n // Check if element is within viewport\n if (rect.bottom < 0 || \n rect.top > window.innerHeight || \n rect.right < 0 || \n rect.left > window.innerWidth) {\n // Element is outside viewport, but still might be valid \n // if user scrolls to it, so we'll include it\n return true;\n }\n \n return true;\n });\n \n console.log(`Out of which ${visibleElements.length} elements are visible:`);\n if (verbose) {\n visibleElements.forEach(info => {\n console.log(`Element ${info.index}:`, info);\n });\n }\n \n return visibleElements;\n }\n\n // elements is an array of objects with index, xpath\n function highlightElements(elements) {\n // console.log('Starting highlight for elements:', elements);\n \n // Create overlay if it doesn't exist and store it in a dictionary\n const documents = getAllFrames(); \n let overlays = {};\n documents.forEach(doc => {\n let overlay = doc.getElementById('highlight-overlay');\n if (!overlay) {\n overlay = doc.createElement('div');\n overlay.id = 'highlight-overlay';\n overlay.style.cssText = `\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n z-index: 10000;\n `;\n doc.body.appendChild(overlay);\n }\n overlays[doc.documentURI] = overlay;\n });\n \n\n const updateHighlights = (doc = null) => {\n if (doc) {\n overlays[doc.documentURI].innerHTML = '';\n } else {\n Object.values(overlays).forEach(overlay => { overlay.innerHTML = ''; });\n } \n elements.forEach(elementInfo => {\n // console.log('updateHighlights-Processing elementInfo:', elementInfo);\n let element = elementInfo.element; //getElementByXPathOrCssSelector(elementInfo);\n if (!element) {\n element = getElementByXPathOrCssSelector(elementInfo);\n if (!element)\n return;\n }\n \n //if highlights requested for a specific doc, skip unrelated elements\n if (doc && element.ownerDocument !== doc) {\n console.log(\"skipped element \", element, \" since it doesn't belong to document \", doc);\n return;\n }\n\n const rect = element.getBoundingClientRect();\n // console.log('Element rect:', elementInfo.tag, rect);\n \n if (rect.width === 0 || rect.height === 0) {\n console.warn('Element has zero dimensions:', elementInfo);\n return;\n }\n \n // Create border highlight (red rectangle)\n // use ownerDocument to support iframes/frames\n const highlight = element.ownerDocument.createElement('div');\n highlight.style.cssText = `\n position: fixed;\n left: ${rect.x}px;\n top: ${rect.y}px;\n width: ${rect.width}px;\n height: ${rect.height}px;\n border: 1px solid rgb(255, 0, 0);\n transition: all 0.2s ease-in-out;\n `;\n\n // Create index label container - now positioned to the right and slightly up\n const labelContainer = element.ownerDocument.createElement('div');\n labelContainer.style.cssText = `\n position: absolute;\n right: -10px; /* Offset to the right */\n top: -10px; /* Offset upwards */\n padding: 4px;\n background-color: rgba(255, 255, 0, 0.6);\n display: flex;\n align-items: center;\n justify-content: center;\n `;\n\n const text = element.ownerDocument.createElement('span');\n text.style.cssText = `\n color: rgb(0, 0, 0, 0.8);\n font-family: 'Courier New', Courier, monospace;\n font-size: 12px;\n font-weight: bold;\n line-height: 1;\n `;\n text.textContent = elementInfo.index;\n \n labelContainer.appendChild(text);\n highlight.appendChild(labelContainer); \n overlays[element.ownerDocument.documentURI].appendChild(highlight);\n });\n };\n\n // Initial highlight\n updateHighlights();\n\n documents.forEach(doc => {\n // Update highlights on scroll and resize\n console.log('registering scroll and resize handlers for document: ', doc);\n const scrollHandler = () => {\n requestAnimationFrame(() => updateHighlights(doc));\n };\n const resizeHandler = () => {\n updateHighlights(doc);\n };\n doc.addEventListener('scroll', scrollHandler, true);\n doc.addEventListener('resize', resizeHandler);\n // Store event handlers for cleanup\n overlays[doc.documentURI].scrollHandler = scrollHandler;\n overlays[doc.documentURI].resizeHandler = resizeHandler;\n }); \n }\n\n // function unexecute() {\n // unhighlightElements();\n // }\n\n // Make it available globally for both Extension and Playwright\n if (typeof window !== 'undefined') {\n window.ProboLabs = {\n ElementTag,\n highlight,\n unhighlightElements,\n findElements,\n highlightElements,\n getElementInfo\n };\n }\n\n exports.findElements = findElements;\n exports.getElementInfo = getElementInfo;\n exports.highlight = highlight;\n exports.highlightElements = highlightElements;\n exports.unhighlightElements = unhighlightElements;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n}));\n//# sourceMappingURL=probolabs.umd.js.map\n";
2
2
  const ElementTag = {
3
3
  CLICKABLE: "CLICKABLE", // button, link, toggle switch, checkbox, radio, dropdowns, clickable divs
4
4
  FILLABLE: "FILLABLE", // input, textarea content_editable, date picker??
@@ -124,6 +124,18 @@ const PlaywrightAction = {
124
124
  VALIDATE_CONTAINS_VALUE: 'VALIDATE_CONTAINS_VALUE',
125
125
  VALIDATE_URL: 'VALIDATE_URL',
126
126
  };
127
+ const SPECIAL_KEYS = [
128
+ 'Enter', 'Tab', 'Escape', 'Backspace', 'Delete',
129
+ 'ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown',
130
+ 'Home', 'End', 'PageUp', 'PageDown',
131
+ 'Insert', 'F1', 'F2', 'F3', 'F4', 'F5', 'F6', 'F7', 'F8', 'F9', 'F10', 'F11', 'F12',
132
+ 'Shift', 'Control', 'Alt', 'Meta',
133
+ 'CapsLock', 'NumLock', 'ScrollLock',
134
+ 'Pause', 'PrintScreen', 'ContextMenu',
135
+ 'AudioVolumeUp', 'AudioVolumeDown', 'AudioVolumeMute',
136
+ 'MediaTrackNext', 'MediaTrackPrevious', 'MediaStop', 'MediaPlayPause',
137
+ 'BrowserBack', 'BrowserForward', 'BrowserRefresh', 'BrowserFavorites'
138
+ ];
127
139
  /**
128
140
  * Handle potential navigation exactly like Python's handle_potential_navigation
129
141
  */
@@ -361,14 +373,36 @@ async function executePlaywrightAction(page, action, value, iframe_selector, ele
361
373
  locator = page.locator(element_css_selector);
362
374
  switch (action) {
363
375
  case PlaywrightAction.CLICK:
364
- await handlePotentialNavigation(page, locator);
376
+ await handlePotentialNavigation(page, locator, value);
365
377
  break;
366
378
  case PlaywrightAction.FILL_IN:
367
379
  await locator.click();
368
380
  await locator.fill(value);
369
381
  break;
370
382
  case PlaywrightAction.TYPE_KEYS:
371
- await (locator === null || locator === void 0 ? void 0 : locator.pressSequentially(value));
383
+ // Check if the value contains any special keys
384
+ const specialKey = SPECIAL_KEYS.find(key => value.includes(key));
385
+ if (specialKey) {
386
+ // If it's a single special key, just press it
387
+ if (value === specialKey) {
388
+ await (locator === null || locator === void 0 ? void 0 : locator.press(specialKey));
389
+ }
390
+ else {
391
+ // Handle combinations like 'Control+A' or 'Shift+ArrowRight'
392
+ const parts = value.split('+');
393
+ if (parts.length === 2 && SPECIAL_KEYS.includes(parts[0]) && SPECIAL_KEYS.includes(parts[1])) {
394
+ await (locator === null || locator === void 0 ? void 0 : locator.press(value));
395
+ }
396
+ else {
397
+ // If it's a mix of special keys and text, use pressSequentially
398
+ await (locator === null || locator === void 0 ? void 0 : locator.pressSequentially(value));
399
+ }
400
+ }
401
+ }
402
+ else {
403
+ // No special keys, just type normally
404
+ await (locator === null || locator === void 0 ? void 0 : locator.pressSequentially(value));
405
+ }
372
406
  break;
373
407
  case PlaywrightAction.SELECT_DROPDOWN:
374
408
  await selectDropdownOption(page, locator, value);
@@ -457,7 +491,29 @@ async function executeCachedPlaywrightAction(page, action, value, iframe_selecto
457
491
  await locator.fill(value);
458
492
  break;
459
493
  case PlaywrightAction.TYPE_KEYS:
460
- await locator.pressSequentially(value);
494
+ // Check if the value contains any special keys
495
+ const specialKey = SPECIAL_KEYS.find(key => value.includes(key));
496
+ if (specialKey) {
497
+ // If it's a single special key, just press it
498
+ if (value === specialKey) {
499
+ await locator.press(specialKey);
500
+ }
501
+ else {
502
+ // Handle combinations like 'Control+A' or 'Shift+ArrowRight'
503
+ const parts = value.split('+');
504
+ if (parts.length === 2 && SPECIAL_KEYS.includes(parts[0]) && SPECIAL_KEYS.includes(parts[1])) {
505
+ await locator.press(value);
506
+ }
507
+ else {
508
+ // If it's a mix of special keys and text, use pressSequentially
509
+ await locator.pressSequentially(value);
510
+ }
511
+ }
512
+ }
513
+ else {
514
+ // No special keys, just type normally
515
+ await locator.pressSequentially(value);
516
+ }
461
517
  break;
462
518
  case PlaywrightAction.SELECT_DROPDOWN:
463
519
  await locator.selectOption(value);
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../probo-highlighter/src/constants.js","../src/utils.ts","../src/actions.ts","../src/highlight.ts","../../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry_operation.js","../../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry.js","../../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/index.js","../../../node_modules/.pnpm/is-network-error@1.1.0/node_modules/is-network-error/index.js","../../../node_modules/.pnpm/p-retry@6.2.1/node_modules/p-retry/index.js","../src/api-client.ts","../src/index.ts"],"sourcesContent":["export const ElementTag = {\n CLICKABLE: \"CLICKABLE\", // button, link, toggle switch, checkbox, radio, dropdowns, clickable divs\n FILLABLE: \"FILLABLE\", // input, textarea content_editable, date picker??\n SELECTABLE: \"SELECTABLE\", // select\n NON_INTERACTIVE_ELEMENT: 'NON_INTERACTIVE_ELEMENT',\n};\n\nexport class ElementInfo {\n constructor(element, index, {tag, type, text, html, xpath, css_selector, bounding_box, iframe_selector}) {\n this.index = index.toString();\n this.tag = tag;\n this.type = type;\n this.text = text;\n this.html = html;\n this.xpath = xpath;\n this.css_selector = css_selector;\n this.bounding_box = bounding_box;\n this.iframe_selector = iframe_selector;\n this.element = element;\n this.depth = -1;\n }\n\n getSelector() {\n return this.xpath ? this.xpath : this.css_selector;\n }\n\n getDepth() {\n if (this.depth >= 0) {\n return this.depth;\n }\n \n this.depth = 0;\n let currentElement = this.element;\n \n while (currentElement.nodeType === Node.ELEMENT_NODE) { \n this.depth++;\n if (currentElement.assignedSlot) {\n currentElement = currentElement.assignedSlot;\n }\n else {\n currentElement = currentElement.parentNode;\n // Check if we're at a shadow root\n if (currentElement && currentElement.nodeType !== Node.ELEMENT_NODE && currentElement.getRootNode() instanceof ShadowRoot) {\n // Get the shadow root's host element\n currentElement = currentElement.getRootNode().host; \n }\n }\n }\n \n return this.depth;\n }\n}\n","export enum ProboLogLevel {\n DEBUG = 'DEBUG',\n INFO = 'INFO',\n LOG = 'LOG',\n WARN = 'WARN',\n ERROR = 'ERROR'\n}\n\n// Add a severity map for comparison\nexport const LogLevelSeverity: Record<ProboLogLevel, number> = {\n [ProboLogLevel.DEBUG]: 0,\n [ProboLogLevel.INFO]: 1,\n [ProboLogLevel.LOG]: 2,\n [ProboLogLevel.WARN]: 3,\n [ProboLogLevel.ERROR]: 4,\n};\n\nexport class ProboLogger {\n constructor(\n private prefix: string,\n private logLevel: ProboLogLevel = ProboLogLevel.LOG\n ) {}\n\n setLogLevel(level: ProboLogLevel): void {\n this.logLevel = level;\n console.log(`[${this.prefix}-INFO] Log level set to: ${ProboLogLevel[level]}`);\n }\n\n debug(...args: any[]): void {\n this.msg(ProboLogLevel.DEBUG, ...args);\n }\n\n info(...args: any[]): void {\n this.msg(ProboLogLevel.INFO, ...args);\n }\n\n log(...args: any[]): void {\n this.msg(ProboLogLevel.LOG, ...args);\n }\n\n warn(...args: any[]): void {\n this.msg(ProboLogLevel.WARN, ...args);\n }\n\n error(...args: any[]): void {\n this.msg(ProboLogLevel.ERROR, ...args);\n }\n\n private msg(logLevel: ProboLogLevel, ...args: any[]): void {\n if (LogLevelSeverity[logLevel] >= LogLevelSeverity[this.logLevel]) {\n const now = new Date();\n const timestamp = now.toLocaleString('en-GB', {\n day: '2-digit',\n month: 'short',\n year: 'numeric',\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit',\n hour12: false\n }).replace(',', '');\n\n // const stack = new Error().stack;\n // const callerLine = stack?.split('\\n')[3];\n // const callerInfo = callerLine?.match(/at\\s+(?:(.+)\\s+\\()?(.+):(\\d+):(\\d+)\\)?/);\n // const [, fnName, file, line] = callerInfo || [];\n // const fileInfo = file ? `${file.split('/').pop()}:${line}` : '';\n // const functionInfo = fnName ? `${fnName}` : '';\n\n // console.log(`[${timestamp}] ${logLevel} [${this.prefix}.${fileInfo}${functionInfo ? ` ${functionInfo}` : ''}]`, ...args);\n console.log(`[${timestamp}] ${logLevel} [${this.prefix}]`, ...args);\n }\n }\n}\n\nexport const proboLogger = new ProboLogger('probolib');\n\nexport interface ElementInfo {\n index: string;\n tag: string;\n type: string;\n text: string;\n html: string;\n xpath: string;\n css_selector: string;\n bounding_box: {\n x: number;\n y: number;\n width: number;\n height: number;\n top: number;\n right: number;\n bottom: number;\n left: number;\n };\n iframe_selector: string;\n element: any;\n depth?: number;\n getSelector(): string;\n getDepth(): number;\n}\n\nexport interface CleanElementInfo {\n index: string;\n tag: string;\n type: string;\n text: string;\n html: string;\n xpath: string;\n css_selector: string;\n iframe_selector: string;\n bounding_box: {\n x: number;\n y: number;\n width: number;\n height: number;\n top: number;\n right: number;\n bottom: number;\n left: number;\n };\n depth: number;\n}\n\nconst elementLogger = new ProboLogger('element-cleaner');\n\nexport function cleanupElementInfo(elementInfo: ElementInfo): CleanElementInfo {\n elementLogger.debug(`Cleaning up element info for ${elementInfo.tag} element at index ${elementInfo.index}`);\n \n const depth = elementInfo.depth ?? elementInfo.getDepth();\n \n const cleanElement = {\n index: elementInfo.index,\n tag: elementInfo.tag,\n type: elementInfo.type,\n text: elementInfo.text,\n html: elementInfo.html,\n xpath: elementInfo.xpath,\n css_selector: elementInfo.css_selector,\n iframe_selector: elementInfo.iframe_selector,\n bounding_box: elementInfo.bounding_box,\n depth: depth\n };\n\n elementLogger.debug(`Cleaned element structure:`, cleanElement);\n return cleanElement;\n}\n\nexport function cleanupInstructionElements(instruction: any): any {\n if (!instruction?.result?.highlighted_elements) {\n elementLogger.debug('No highlighted elements to clean');\n return instruction;\n }\n\n elementLogger.debug(`Cleaning ${instruction.result.highlighted_elements.length} highlighted elements`);\n \n const cleanInstruction = {\n ...instruction,\n result: {\n ...instruction.result,\n highlighted_elements: instruction.result.highlighted_elements.map((element: ElementInfo) => \n cleanupElementInfo(element)\n )\n }\n };\n\n elementLogger.debug('Instruction cleaning completed');\n return cleanInstruction;\n}\n","import { Page, Frame, Locator } from 'playwright';\nimport { proboLogger } from './utils';\n\n// Action constants\nexport const PlaywrightAction = {\n VISIT_BASE_URL: 'VISIT_BASE_URL',\n VISIT_URL: 'VISIT_URL',\n CLICK: 'CLICK',\n FILL_IN: 'FILL_IN',\n SELECT_DROPDOWN: 'SELECT_DROPDOWN',\n SELECT_MULTIPLE_DROPDOWN: 'SELECT_MULTIPLE_DROPDOWN',\n CHECK_CHECKBOX: 'CHECK_CHECKBOX',\n SELECT_RADIO: 'SELECT_RADIO',\n TOGGLE_SWITCH: 'TOGGLE_SWITCH',\n TYPE_KEYS: 'TYPE_KEYS',\n VALIDATE_EXACT_VALUE: 'VALIDATE_EXACT_VALUE',\n VALIDATE_CONTAINS_VALUE: 'VALIDATE_CONTAINS_VALUE',\n VALIDATE_URL: 'VALIDATE_URL',\n} as const;\nexport type PlaywrightActionType = typeof PlaywrightAction[keyof typeof PlaywrightAction];\n\n/**\n * Handle potential navigation exactly like Python's handle_potential_navigation\n */\nexport async function handlePotentialNavigation(\n page: Page,\n locator: Locator | null = null,\n value: string | null = null,\n options: {\n initialTimeout?: number;\n navigationTimeout?: number;\n globalTimeout?: number;\n } = {}\n): Promise<boolean> {\n const {\n initialTimeout = 5000,\n navigationTimeout = 7000,\n globalTimeout = 15000,\n } = options;\n\n const startTime = Date.now();\n let navigationCount = 0;\n let lastNavTime: number | null = null;\n\n const onFrameNav = (frame: Frame) => {\n if (frame === page.mainFrame()) {\n navigationCount++;\n lastNavTime = Date.now();\n proboLogger.debug(\n `DEBUG_NAV[${((Date.now() - startTime) / 1000).toFixed(3)}s]: navigation detected (count=${navigationCount})`\n );\n }\n };\n\n proboLogger.debug(`DEBUG_NAV[0.000s]: Starting navigation detection`);\n page.on(\"framenavigated\", onFrameNav);\n\n try {\n if (locator) {\n proboLogger.debug(`DEBUG_NAV: Executing click(${value})`);\n await clickAtPosition(page, locator, value as ClickPosition | null);\n }\n\n // wait for any initial nav to fire\n await page.waitForTimeout(initialTimeout);\n proboLogger.debug(\n `DEBUG_NAV[${((Date.now() - startTime) / 1000).toFixed(3)}s]: After initial wait, count=${navigationCount}`\n );\n\n if (navigationCount > 0) {\n // loop until either per-nav or global timeout\n while (true) {\n const now = Date.now();\n if (\n lastNavTime !== null &&\n now - lastNavTime > navigationTimeout\n ) {\n proboLogger.debug(\n `DEBUG_NAV[${((now - startTime) / 1000).toFixed(3)}s]: per‐navigation timeout reached`\n );\n break;\n }\n if (now - startTime > globalTimeout) {\n proboLogger.debug(\n `DEBUG_NAV[${((now - startTime) / 1000).toFixed(3)}s]: overall timeout reached`\n );\n break;\n }\n await page.waitForTimeout(500);\n }\n\n // now wait for load + idle\n proboLogger.debug(`DEBUG_NAV: waiting for load state`);\n await page.waitForLoadState(\"load\", { timeout: globalTimeout });\n\n proboLogger.debug(`DEBUG_NAV: waiting for networkidle`);\n try {\n // shorter idle‐wait so we don't hang the full globalTimeout here\n await page.waitForLoadState(\"networkidle\", {\n timeout: navigationTimeout,\n });\n } catch {\n proboLogger.debug(\n `DEBUG_NAV: networkidle not reached in ${navigationTimeout}ms, proceeding anyway`\n );\n }\n\n await scrollToBottomRight(page);\n proboLogger.debug(`DEBUG_NAV: done`);\n return true;\n }\n\n proboLogger.debug(`DEBUG_NAV: no navigation detected`);\n return false;\n } finally {\n page.removeListener(\"framenavigated\", onFrameNav);\n proboLogger.debug(`DEBUG_NAV: listener removed`);\n }\n}\n\n\n/**\n * Scroll entire page to bottom-right, triggering lazy-loaded content\n */\nexport async function scrollToBottomRight(page: Page): Promise<void> {\n const startTime = performance.now();\n proboLogger.debug(`Starting scroll to bottom-right`);\n\n let lastHeight = await page.evaluate(() => document.documentElement.scrollHeight);\n let lastWidth = await page.evaluate(() => document.documentElement.scrollWidth);\n\n while (true) {\n let smoothingSteps = 0;\n const initY = await page.evaluate(() => window.scrollY);\n const clientHeight = await page.evaluate(() => document.documentElement.clientHeight);\n const maxHeight = await page.evaluate(() => document.documentElement.scrollHeight);\n \n let currY = initY;\n while (currY <= maxHeight - clientHeight) {\n currY += clientHeight;\n await page.evaluate(y => window.scrollTo(0, y), currY);\n await page.waitForTimeout(50);\n smoothingSteps++;\n }\n\n proboLogger.debug(\n `performed ${smoothingSteps} smoothing steps while scrolling`\n );\n\n const newHeight = await page.evaluate(() => document.documentElement.scrollHeight);\n const newWidth = await page.evaluate(() => document.documentElement.scrollWidth);\n if (newHeight === lastHeight && newWidth === lastWidth) break;\n proboLogger.debug(`page dimensions updated, repeating scroll`);\n lastHeight = newHeight;\n lastWidth = newWidth;\n }\n\n await page.waitForTimeout(200);\n await page.evaluate('window.scrollTo(0, 0)');\n await page.waitForTimeout(50);\n proboLogger.debug(`Scroll completed in ${(performance.now() - startTime).toFixed(3)}ms`);\n}\n\n/**\n * Wait for DOM mutations to settle using MutationObserver logic\n */\nexport async function waitForMutationsToSettle(\n page: Page,\n mutationTimeout: number = 1500,\n initTimeout: number = 2000\n): Promise<boolean> {\n const startTime = Date.now();\n proboLogger.debug(\n `Starting mutation settlement (initTimeout=${initTimeout}, mutationTimeout=${mutationTimeout})`\n );\n\n const result = await page.evaluate(\n async ({ mutationTimeout, initTimeout }) => {\n async function blockUntilStable(\n targetNode: HTMLElement,\n options = { childList: true, subtree: true }\n ) {\n return new Promise<boolean>((resolve) => {\n let initTimerExpired = false;\n let mutationsOccurred = false;\n const observerTimers = new Set<number>();\n\n const initTimer = window.setTimeout(() => {\n initTimerExpired = true;\n if (observerTimers.size === 0) resolve(mutationsOccurred);\n }, initTimeout);\n\n const observer = new MutationObserver(() => {\n mutationsOccurred = true;\n observerTimers.forEach((t) => clearTimeout(t));\n observerTimers.clear();\n const t = window.setTimeout(() => {\n observerTimers.delete(t);\n if (initTimerExpired && observerTimers.size === 0) {\n observer.disconnect();\n resolve(mutationsOccurred);\n }\n }, mutationTimeout);\n observerTimers.add(t);\n });\n\n observer.observe(targetNode, options);\n });\n }\n return blockUntilStable(document.body as HTMLElement);\n },\n { mutationTimeout, initTimeout }\n );\n\n const total = ((Date.now() - startTime) / 1000).toFixed(2);\n proboLogger.debug(\n result\n ? `Mutations settled. Took ${total}s`\n : `No mutations observed. Took ${total}s`\n );\n\n return result;\n}\n\n\n/**\n * Get element text value: allTextContents + innerText fallback\n */\nexport async function getElementValue(\n page: Page,\n locator: Locator\n): Promise<string> {\n const texts = await locator.allTextContents();\n let allText = texts.join('').trim();\n if (!allText) {\n allText = await locator.evaluate((el: HTMLElement) => el.innerText);\n }\n proboLogger.debug(`getElementValue: [${allText}]`);\n return allText;\n}\n\n/**\n * Select dropdown option: native <select>, <option>, child select, or ARIA listbox\n */\nexport async function selectDropdownOption(\n page: Page,\n locator: Locator,\n value: string | string[]\n): Promise<void> { \n const tagName = await locator?.evaluate((el) => el.tagName.toLowerCase());\n const role = await locator?.getAttribute('role');\n\n if (tagName === 'option' || role === 'option') {\n proboLogger.debug('selectDropdownOption: option role detected');\n await locator?.click();\n } else if (tagName === 'select') {\n proboLogger.debug('selectDropdownOption: simple select tag detected');\n try {\n await locator?.selectOption(value as any);\n } catch {\n proboLogger.debug('selectDropdownOption: manual change event fallback');\n const handle = locator ? await locator.elementHandle() : null;\n await page.evaluate(\n ({ h, val }: { h: HTMLElement | SVGElement | null, val: string | string[] }) => {\n const el = h as HTMLSelectElement;\n if (el) {\n el.value = Array.isArray(val) ? val[0] : (val as string);\n el.dispatchEvent(new Event('change', { bubbles: true }));\n }\n },\n { h: handle, val: value }\n );\n }\n } else {\n proboLogger.debug('selectDropdownOption: custom dropdown path');\n let listbox = locator.locator('select');\n let count = await listbox.count();\n if (count > 1) throw new Error(`selectDropdownOption: ambiguous <select> count=${count}`);\n if (count === 1) {\n proboLogger.debug('selectDropdownOption: child <select> found');\n await listbox.selectOption(value as any);\n return;\n }\n await locator.click();\n let container = locator;\n count = 0;\n if (role !== 'listbox') {\n for (let i = 0; i < 7; i++) {\n listbox = container.getByRole('listbox');\n count = await listbox.count();\n if (count >= 1) break;\n proboLogger.debug(`selectDropdownOption: iteration #${i} no listbox found`);\n container = container.locator('xpath=..');\n }\n } else {\n listbox = container;\n count = await listbox.count();\n }\n if (count !== 1) throw new Error(`selectDropdownOption: found ${count} listbox locators`);\n const vals = Array.isArray(value) ? value : [value];\n for (const val of vals) {\n const option = listbox.getByRole('option').getByText(new RegExp(`^${val}$`, 'i'));\n const optCount = await option.count();\n if (optCount !== 1) throw new Error(`selectDropdownOption: ${optCount} options for '${val}'`);\n await option.click();\n }\n }\n}\n\n/**\n * Execute a given Playwright action, mirroring Python's _perform_action\n */\nexport async function executePlaywrightAction(\n page: Page,\n action: PlaywrightActionType,\n value: string,\n iframe_selector: string,\n element_css_selector: string\n): Promise<boolean> {\n proboLogger.info(`performing Action: ${action} Value: ${value}`);\n try {\n \n if (action === PlaywrightAction.VISIT_BASE_URL || action === PlaywrightAction.VISIT_URL) {\n await page.goto(value, { waitUntil: 'load' });\n await handlePotentialNavigation(page, null); \n }\n else {\n let locator = undefined;\n if (iframe_selector)\n locator = page.frameLocator(iframe_selector).locator(element_css_selector);\n else\n locator = page.locator(element_css_selector);\n\n switch (action) { \n case PlaywrightAction.CLICK:\n await handlePotentialNavigation(page, locator);\n break;\n\n case PlaywrightAction.FILL_IN:\n await locator.click();\n await locator.fill(value);\n break;\n\n case PlaywrightAction.TYPE_KEYS:\n await locator?.pressSequentially(value);\n break;\n\n case PlaywrightAction.SELECT_DROPDOWN:\n await selectDropdownOption(page, locator, value);\n break;\n\n case PlaywrightAction.SELECT_MULTIPLE_DROPDOWN:\n let optsArr: string[];\n if (value.startsWith('[')) {\n try { optsArr = JSON.parse(value); } catch {\n optsArr = value.slice(1, -1).split(',').map(o => o.trim());\n }\n } else {\n optsArr = value.split(',').map(o => o.trim());\n }\n await locator?.selectOption(optsArr as any);\n break;\n\n case PlaywrightAction.CHECK_CHECKBOX:\n await locator?.setChecked(value.toLowerCase() === 'true');\n break;\n\n case PlaywrightAction.SELECT_RADIO:\n case PlaywrightAction.TOGGLE_SWITCH:\n await locator?.click();\n break;\n\n case PlaywrightAction.VALIDATE_EXACT_VALUE:\n const actualExact = await getElementValue(page, locator);\n proboLogger.debug(`actual value is [${actualExact}]`);\n if (actualExact !== value) {\n proboLogger.info(`Validation *FAIL* expected '${value}' but got '${actualExact}'`);\n return false;\n }\n proboLogger.info('Validation *PASS*');\n break;\n\n case PlaywrightAction.VALIDATE_CONTAINS_VALUE:\n const actualContains = await getElementValue(page, locator);\n proboLogger.debug(`actual value is [${actualContains}]`);\n if (!actualContains.includes(value)) {\n proboLogger.info(`Validation *FAIL* expected '${value}' to be contained in '${actualContains}'`);\n return false;\n }\n proboLogger.info('Validation *PASS*');\n break;\n\n case PlaywrightAction.VALIDATE_URL:\n const currUrl = page.url();\n if (currUrl !== value) {\n proboLogger.info(`Validation *FAIL* expected url '${value}' while is '${currUrl}'`);\n return false;\n }\n proboLogger.info('Validation *PASS*');\n break;\n\n default:\n throw new Error(`Unknown action: ${action}`);\n }\n }\n return true;\n } catch (e) {\n proboLogger.debug(`***ERROR failed to execute action ${action}: ${e}`);\n throw e;\n }\n}\n\n/**\n * Execute a given Playwright action using native Playwright functions where possible\n */\nexport async function executeCachedPlaywrightAction(\n page: Page,\n action: PlaywrightActionType,\n value: string,\n iframe_selector: string,\n element_css_selector: string\n): Promise<boolean> {\n proboLogger.log(`performing Cached Action: ${action} Value: ${value} on locator: ${element_css_selector}`);\n try {\n let locator = undefined;\n if (iframe_selector)\n locator = page.frameLocator(iframe_selector).locator(element_css_selector);\n else\n locator = page.locator(element_css_selector);\n\n switch (action) {\n case PlaywrightAction.VISIT_BASE_URL:\n case PlaywrightAction.VISIT_URL:\n await page.goto(value, { waitUntil: 'networkidle' });\n break;\n\n case PlaywrightAction.CLICK:\n await clickAtPosition(page, locator, value as ClickPosition | null);\n await handlePotentialNavigation(page);\n break;\n\n case PlaywrightAction.FILL_IN:\n await locator.click();\n await locator.fill(value);\n break;\n\n case PlaywrightAction.TYPE_KEYS:\n await locator.pressSequentially(value);\n break;\n\n case PlaywrightAction.SELECT_DROPDOWN:\n await locator.selectOption(value as any);\n break;\n\n case PlaywrightAction.SELECT_MULTIPLE_DROPDOWN:\n let optsArr: string[];\n if (value.startsWith('[')) {\n try { optsArr = JSON.parse(value); } catch {\n optsArr = value.slice(1, -1).split(',').map(o => o.trim());\n }\n } else {\n optsArr = value.split(',').map(o => o.trim());\n }\n await locator.selectOption(optsArr as any);\n break;\n\n case PlaywrightAction.CHECK_CHECKBOX:\n await locator.setChecked(value.toLowerCase() === 'true');\n break;\n\n case PlaywrightAction.SELECT_RADIO:\n case PlaywrightAction.TOGGLE_SWITCH:\n await locator.click();\n break;\n\n case PlaywrightAction.VALIDATE_EXACT_VALUE:\n const actualExact = await getElementValue(page, locator);\n proboLogger.debug(`actual value is [${actualExact}]`);\n if (actualExact !== value) {\n proboLogger.info(`Validation *FAIL* expected '${value}' but got '${actualExact}'`);\n return false;\n }\n proboLogger.info('Validation *PASS*');\n break;\n\n case PlaywrightAction.VALIDATE_CONTAINS_VALUE:\n const actualContains = await getElementValue(page, locator);\n proboLogger.debug(`actual value is [${actualContains}]`);\n if (!actualContains.includes(value)) {\n proboLogger.info(`Validation *FAIL* expected '${value}' to be contained in '${actualContains}'`);\n return false;\n }\n proboLogger.info('Validation *PASS*');\n break;\n\n case PlaywrightAction.VALIDATE_URL:\n const currUrl = page.url();\n if (currUrl !== value) {\n proboLogger.info(`Validation *FAIL* expected url '${value}' while is '${currUrl}'`);\n return false;\n }\n proboLogger.info('Validation *PASS*');\n break;\n\n default:\n throw new Error(`Unknown action: ${action}`);\n }\n return true;\n } catch (e) {\n proboLogger.debug(`***ERROR failed to execute cached action ${action}: ${e}`);\n throw e;\n }\n}\n\nexport enum ClickPosition {\n LEFT = 'LEFT',\n RIGHT = 'RIGHT',\n CENTER = 'CENTER'\n}\n\n/**\n * Click on an element at a specific position\n */\nexport async function clickAtPosition(page: Page, locator: Locator, clickPosition: ClickPosition | null): Promise<void> {\n if (!clickPosition || clickPosition === ClickPosition.CENTER) {\n await locator.click({noWaitAfter: false});\n return\n }\n const boundingBox = await locator.boundingBox();\n if (boundingBox) {\n if (clickPosition === ClickPosition.LEFT) {\n await page.mouse.click(boundingBox.x + 10, boundingBox.y + boundingBox.height/2);\n }\n else if (clickPosition === ClickPosition.RIGHT) {\n await page.mouse.click(boundingBox.x + boundingBox.width - 10, boundingBox.y + boundingBox.height/2);\n }\n }\n}\n\n","import type { Page } from 'playwright';\nimport { ElementTag } from '@probolabs/highlighter/src/constants';\nimport { proboLogger } from './utils';\n\n// Fix the type definition\ntype ElementTagType = typeof ElementTag[keyof typeof ElementTag];\n\n// Add type declaration for the ProboLabs global\ndeclare global {\n // Declare highlighterCode in the global scope\n var highlighterCode: string;\n \n interface Window {\n ProboLabs?: {\n highlight: {\n execute: (elementTypes: ElementTagType[]) => Promise<any>;\n unexecute: () => Promise<any>;\n };\n highlightElements: (elements: Array<{ css_selector: string, iframe_selector: string, index: string }>) => void;\n ElementTag: typeof ElementTag;\n };\n }\n}\n\nexport class Highlighter {\n constructor(private enableConsoleLogs: boolean = true) {}\n\n private async ensureHighlighterScript(page: Page, maxRetries = 3) {\n for (let attempt = 0; attempt < maxRetries; attempt++) {\n try {\n const scriptExists = await page.evaluate(\n `typeof window.ProboLabs?.highlight?.execute === 'function'`\n );\n\n if (!scriptExists) {\n proboLogger.debug('Injecting highlighter script...');\n await page.evaluate(highlighterCode);\n \n // Verify the script was injected correctly\n const verified = await page.evaluate(`\n //console.log('ProboLabs global:', window.ProboLabs);\n typeof window.ProboLabs?.highlight?.execute === 'function'\n `);\n proboLogger.debug('Script injection verified:', verified);\n }\n return; // Success - exit the function\n } catch (error) {\n if (attempt === maxRetries - 1) {\n throw error;\n }\n proboLogger.debug(`Script injection attempt ${attempt + 1} failed, retrying after delay...`);\n await new Promise(resolve => setTimeout(resolve, 100));\n }\n }\n }\n\n public async highlightElements(page: Page, elementTag: ElementTagType) {\n proboLogger.debug('highlightElements called with:', elementTag);\n await this.ensureHighlighterScript(page);\n \n // Execute the highlight function and await its result\n const result = await page.evaluate(\n async (tag) => {\n //proboLogger.debug('Browser: Starting highlight execution with tag:', tag);\n if (!window.ProboLabs?.highlight?.execute) {\n console.error('Browser: ProboLabs.highlight.execute is not available!');\n return null;\n }\n const elements = await window.ProboLabs.highlight.execute([tag]);\n //proboLogger.debug('Browser: Found elements:', elements);\n return elements;\n },\n elementTag\n );\n \n // for (let i = 0; i < result.length; i++) { \n // result[i].element = '';\n // };\n // console.log('highlighted elements: ', result);\n return result;\n }\n\n public async unhighlightElements(page: Page) {\n proboLogger.debug('unhighlightElements called');\n await this.ensureHighlighterScript(page);\n await page.evaluate(() => {\n window?.ProboLabs?.highlight?.unexecute();\n });\n }\n\n public async highlightElement(page: Page, element_css_selector: string, iframe_selector: string, element_index: string) {\n await this.ensureHighlighterScript(page);\n proboLogger.debug('Highlighting element with:', { element_css_selector, iframe_selector, element_index });\n \n await page.evaluate(\n ({ css_selector, iframe_selector, index }) => {\n const proboLabs = window.ProboLabs;\n if (!proboLabs) {\n proboLogger.warn('ProboLabs not initialized');\n return;\n }\n // Create ElementInfo object for the element\n const elementInfo = {\n css_selector: css_selector,\n iframe_selector: iframe_selector,\n index: index\n };\n \n // Call highlightElements directly\n proboLabs.highlightElements([elementInfo]);\n },\n { \n css_selector: element_css_selector,\n iframe_selector: iframe_selector,\n index: element_index \n }\n );\n }\n}\n\nexport { ElementTag, ElementTagType };\n","function RetryOperation(timeouts, options) {\n // Compatibility for the old (timeouts, retryForever) signature\n if (typeof options === 'boolean') {\n options = { forever: options };\n }\n\n this._originalTimeouts = JSON.parse(JSON.stringify(timeouts));\n this._timeouts = timeouts;\n this._options = options || {};\n this._maxRetryTime = options && options.maxRetryTime || Infinity;\n this._fn = null;\n this._errors = [];\n this._attempts = 1;\n this._operationTimeout = null;\n this._operationTimeoutCb = null;\n this._timeout = null;\n this._operationStart = null;\n this._timer = null;\n\n if (this._options.forever) {\n this._cachedTimeouts = this._timeouts.slice(0);\n }\n}\nmodule.exports = RetryOperation;\n\nRetryOperation.prototype.reset = function() {\n this._attempts = 1;\n this._timeouts = this._originalTimeouts.slice(0);\n}\n\nRetryOperation.prototype.stop = function() {\n if (this._timeout) {\n clearTimeout(this._timeout);\n }\n if (this._timer) {\n clearTimeout(this._timer);\n }\n\n this._timeouts = [];\n this._cachedTimeouts = null;\n};\n\nRetryOperation.prototype.retry = function(err) {\n if (this._timeout) {\n clearTimeout(this._timeout);\n }\n\n if (!err) {\n return false;\n }\n var currentTime = new Date().getTime();\n if (err && currentTime - this._operationStart >= this._maxRetryTime) {\n this._errors.push(err);\n this._errors.unshift(new Error('RetryOperation timeout occurred'));\n return false;\n }\n\n this._errors.push(err);\n\n var timeout = this._timeouts.shift();\n if (timeout === undefined) {\n if (this._cachedTimeouts) {\n // retry forever, only keep last error\n this._errors.splice(0, this._errors.length - 1);\n timeout = this._cachedTimeouts.slice(-1);\n } else {\n return false;\n }\n }\n\n var self = this;\n this._timer = setTimeout(function() {\n self._attempts++;\n\n if (self._operationTimeoutCb) {\n self._timeout = setTimeout(function() {\n self._operationTimeoutCb(self._attempts);\n }, self._operationTimeout);\n\n if (self._options.unref) {\n self._timeout.unref();\n }\n }\n\n self._fn(self._attempts);\n }, timeout);\n\n if (this._options.unref) {\n this._timer.unref();\n }\n\n return true;\n};\n\nRetryOperation.prototype.attempt = function(fn, timeoutOps) {\n this._fn = fn;\n\n if (timeoutOps) {\n if (timeoutOps.timeout) {\n this._operationTimeout = timeoutOps.timeout;\n }\n if (timeoutOps.cb) {\n this._operationTimeoutCb = timeoutOps.cb;\n }\n }\n\n var self = this;\n if (this._operationTimeoutCb) {\n this._timeout = setTimeout(function() {\n self._operationTimeoutCb();\n }, self._operationTimeout);\n }\n\n this._operationStart = new Date().getTime();\n\n this._fn(this._attempts);\n};\n\nRetryOperation.prototype.try = function(fn) {\n console.log('Using RetryOperation.try() is deprecated');\n this.attempt(fn);\n};\n\nRetryOperation.prototype.start = function(fn) {\n console.log('Using RetryOperation.start() is deprecated');\n this.attempt(fn);\n};\n\nRetryOperation.prototype.start = RetryOperation.prototype.try;\n\nRetryOperation.prototype.errors = function() {\n return this._errors;\n};\n\nRetryOperation.prototype.attempts = function() {\n return this._attempts;\n};\n\nRetryOperation.prototype.mainError = function() {\n if (this._errors.length === 0) {\n return null;\n }\n\n var counts = {};\n var mainError = null;\n var mainErrorCount = 0;\n\n for (var i = 0; i < this._errors.length; i++) {\n var error = this._errors[i];\n var message = error.message;\n var count = (counts[message] || 0) + 1;\n\n counts[message] = count;\n\n if (count >= mainErrorCount) {\n mainError = error;\n mainErrorCount = count;\n }\n }\n\n return mainError;\n};\n","var RetryOperation = require('./retry_operation');\n\nexports.operation = function(options) {\n var timeouts = exports.timeouts(options);\n return new RetryOperation(timeouts, {\n forever: options && (options.forever || options.retries === Infinity),\n unref: options && options.unref,\n maxRetryTime: options && options.maxRetryTime\n });\n};\n\nexports.timeouts = function(options) {\n if (options instanceof Array) {\n return [].concat(options);\n }\n\n var opts = {\n retries: 10,\n factor: 2,\n minTimeout: 1 * 1000,\n maxTimeout: Infinity,\n randomize: false\n };\n for (var key in options) {\n opts[key] = options[key];\n }\n\n if (opts.minTimeout > opts.maxTimeout) {\n throw new Error('minTimeout is greater than maxTimeout');\n }\n\n var timeouts = [];\n for (var i = 0; i < opts.retries; i++) {\n timeouts.push(this.createTimeout(i, opts));\n }\n\n if (options && options.forever && !timeouts.length) {\n timeouts.push(this.createTimeout(i, opts));\n }\n\n // sort the array numerically ascending\n timeouts.sort(function(a,b) {\n return a - b;\n });\n\n return timeouts;\n};\n\nexports.createTimeout = function(attempt, opts) {\n var random = (opts.randomize)\n ? (Math.random() + 1)\n : 1;\n\n var timeout = Math.round(random * Math.max(opts.minTimeout, 1) * Math.pow(opts.factor, attempt));\n timeout = Math.min(timeout, opts.maxTimeout);\n\n return timeout;\n};\n\nexports.wrap = function(obj, options, methods) {\n if (options instanceof Array) {\n methods = options;\n options = null;\n }\n\n if (!methods) {\n methods = [];\n for (var key in obj) {\n if (typeof obj[key] === 'function') {\n methods.push(key);\n }\n }\n }\n\n for (var i = 0; i < methods.length; i++) {\n var method = methods[i];\n var original = obj[method];\n\n obj[method] = function retryWrapper(original) {\n var op = exports.operation(options);\n var args = Array.prototype.slice.call(arguments, 1);\n var callback = args.pop();\n\n args.push(function(err) {\n if (op.retry(err)) {\n return;\n }\n if (err) {\n arguments[0] = op.mainError();\n }\n callback.apply(this, arguments);\n });\n\n op.attempt(function() {\n original.apply(obj, args);\n });\n }.bind(obj, original);\n obj[method].options = options;\n }\n};\n","module.exports = require('./lib/retry');","const objectToString = Object.prototype.toString;\n\nconst isError = value => objectToString.call(value) === '[object Error]';\n\nconst errorMessages = new Set([\n\t'network error', // Chrome\n\t'Failed to fetch', // Chrome\n\t'NetworkError when attempting to fetch resource.', // Firefox\n\t'The Internet connection appears to be offline.', // Safari 16\n\t'Load failed', // Safari 17+\n\t'Network request failed', // `cross-fetch`\n\t'fetch failed', // Undici (Node.js)\n\t'terminated', // Undici (Node.js)\n]);\n\nexport default function isNetworkError(error) {\n\tconst isValid = error\n\t\t&& isError(error)\n\t\t&& error.name === 'TypeError'\n\t\t&& typeof error.message === 'string';\n\n\tif (!isValid) {\n\t\treturn false;\n\t}\n\n\t// We do an extra check for Safari 17+ as it has a very generic error message.\n\t// Network errors in Safari have no stack.\n\tif (error.message === 'Load failed') {\n\t\treturn error.stack === undefined;\n\t}\n\n\treturn errorMessages.has(error.message);\n}\n","import retry from 'retry';\nimport isNetworkError from 'is-network-error';\n\nexport class AbortError extends Error {\n\tconstructor(message) {\n\t\tsuper();\n\n\t\tif (message instanceof Error) {\n\t\t\tthis.originalError = message;\n\t\t\t({message} = message);\n\t\t} else {\n\t\t\tthis.originalError = new Error(message);\n\t\t\tthis.originalError.stack = this.stack;\n\t\t}\n\n\t\tthis.name = 'AbortError';\n\t\tthis.message = message;\n\t}\n}\n\nconst decorateErrorWithCounts = (error, attemptNumber, options) => {\n\t// Minus 1 from attemptNumber because the first attempt does not count as a retry\n\tconst retriesLeft = options.retries - (attemptNumber - 1);\n\n\terror.attemptNumber = attemptNumber;\n\terror.retriesLeft = retriesLeft;\n\treturn error;\n};\n\nexport default async function pRetry(input, options) {\n\treturn new Promise((resolve, reject) => {\n\t\toptions = {...options};\n\t\toptions.onFailedAttempt ??= () => {};\n\t\toptions.shouldRetry ??= () => true;\n\t\toptions.retries ??= 10;\n\n\t\tconst operation = retry.operation(options);\n\n\t\tconst abortHandler = () => {\n\t\t\toperation.stop();\n\t\t\treject(options.signal?.reason);\n\t\t};\n\n\t\tif (options.signal && !options.signal.aborted) {\n\t\t\toptions.signal.addEventListener('abort', abortHandler, {once: true});\n\t\t}\n\n\t\tconst cleanUp = () => {\n\t\t\toptions.signal?.removeEventListener('abort', abortHandler);\n\t\t\toperation.stop();\n\t\t};\n\n\t\toperation.attempt(async attemptNumber => {\n\t\t\ttry {\n\t\t\t\tconst result = await input(attemptNumber);\n\t\t\t\tcleanUp();\n\t\t\t\tresolve(result);\n\t\t\t} catch (error) {\n\t\t\t\ttry {\n\t\t\t\t\tif (!(error instanceof Error)) {\n\t\t\t\t\t\tthrow new TypeError(`Non-error was thrown: \"${error}\". You should only throw errors.`);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (error instanceof AbortError) {\n\t\t\t\t\t\tthrow error.originalError;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (error instanceof TypeError && !isNetworkError(error)) {\n\t\t\t\t\t\tthrow error;\n\t\t\t\t\t}\n\n\t\t\t\t\tdecorateErrorWithCounts(error, attemptNumber, options);\n\n\t\t\t\t\tif (!(await options.shouldRetry(error))) {\n\t\t\t\t\t\toperation.stop();\n\t\t\t\t\t\treject(error);\n\t\t\t\t\t}\n\n\t\t\t\t\tawait options.onFailedAttempt(error);\n\n\t\t\t\t\tif (!operation.retry(error)) {\n\t\t\t\t\t\tthrow operation.mainError();\n\t\t\t\t\t}\n\t\t\t\t} catch (finalError) {\n\t\t\t\t\tdecorateErrorWithCounts(finalError, attemptNumber, options);\n\t\t\t\t\tcleanUp();\n\t\t\t\t\treject(finalError);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t});\n}\n","import pRetry from 'p-retry';\nimport { proboLogger } from './utils';\nimport { inspect } from 'util';\nimport { cleanupInstructionElements } from './utils';\n\nexport interface Instruction {\n what_to_do: string;\n args: any;\n result: any;\n}\n\nexport interface CreateStepOptions {\n stepIdFromServer?: number | null; // Make optional and allow null\n scenarioName: string;\n stepPrompt: string;\n initial_screenshot_url: string;\n initial_html_content: string;\n use_cache: boolean;\n}\n\nexport interface StepMinimal {\n id: string;\n prompt: string;\n step_runner_state: string;\n status: string;\n action: string;\n action_value: string;\n element_css_selector: string;\n iframe_selector: string;\n}\n\n\nexport interface FindStepByPromptResult {\n step: StepMinimal;\n total_count: number;\n}\n\nexport class ApiError extends Error {\n constructor(\n public status: number,\n message: string,\n public data?: any\n ) {\n super(message);\n this.name = 'ApiError';\n \n // Remove stack trace for cleaner error messages\n this.stack = undefined;\n }\n\n toString() {\n return `${this.message} (Status: ${this.status})`;\n }\n}\n\nexport class ApiClient {\n constructor(\n private apiUrl: string,\n private token: string = 'b31793f81a1f58b8a153c86a5fdf4df0e5179c51', // Default to demo token\n private maxRetries: number = 3,\n private initialBackoff: number = 1000\n ) {}\n\n private async handleResponse(response: Response) {\n try {\n const data = await response.json();\n \n if (!response.ok) {\n switch (response.status) {\n case 401:\n throw new ApiError(401, 'Unauthorized - Invalid or missing authentication token');\n case 403:\n throw new ApiError(403, 'Forbidden - You do not have permission to perform this action');\n case 400:\n throw new ApiError(400, 'Bad Request', data);\n case 404:\n throw new ApiError(404, 'Not Found', data);\n case 500:\n throw new ApiError(500, 'Internal Server Error', data);\n default:\n throw new ApiError(response.status, `API Error: ${data.error || 'Unknown error'}`, data);\n }\n }\n \n return data;\n } catch (error: any) {\n // Only throw the original error if it's not a network error\n if (!error.message?.includes('fetch failed')) {\n throw error;\n }\n throw new ApiError(0, 'Network error: fetch failed');\n }\n }\n\n private getHeaders() {\n const headers: Record<string, string> = {\n 'Content-Type': 'application/json',\n };\n \n // Always include token in headers now that we have a default\n headers['Authorization'] = `Token ${this.token}`;\n \n return headers;\n }\n\n async createStep(options: CreateStepOptions): Promise<string> {\n proboLogger.debug('creating step ', options.stepPrompt);\n return pRetry(async () => {\n const response = await fetch(`${this.apiUrl}/step-runners/`, {\n method: 'POST',\n headers: this.getHeaders(),\n body: JSON.stringify({ \n step_id: options.stepIdFromServer,\n scenario_name: options.scenarioName,\n step_prompt: options.stepPrompt, \n initial_screenshot: options.initial_screenshot_url, \n initial_html_content: options.initial_html_content,\n use_cache: options.use_cache,\n }),\n });\n \n const data = await this.handleResponse(response);\n return data.step.id;\n }, {\n retries: this.maxRetries,\n minTimeout: this.initialBackoff,\n onFailedAttempt: error => {\n proboLogger.warn(`API call failed, attempt ${error.attemptNumber} of ${error.retriesLeft + error.attemptNumber}...`);\n }\n });\n }\n\n async resolveNextInstruction(stepId: string, instruction: Instruction | null, aiModel?: string) {\n proboLogger.debug(`resolving next instruction: ${instruction}`);\n return pRetry(async () => {\n proboLogger.debug(`API client: Resolving next instruction for step ${stepId}`);\n \n const cleanInstruction = cleanupInstructionElements(instruction);\n \n const response = await fetch(`${this.apiUrl}/step-runners/${stepId}/run/`, {\n method: 'POST',\n headers: this.getHeaders(),\n body: JSON.stringify({ \n executed_instruction: cleanInstruction,\n ai_model: aiModel \n }),\n });\n \n const data = await this.handleResponse(response);\n return data.instruction;\n }, {\n retries: this.maxRetries,\n minTimeout: this.initialBackoff,\n onFailedAttempt: error => {\n proboLogger.warn(`API call failed, attempt ${error.attemptNumber} of ${error.retriesLeft + error.attemptNumber}...`);\n }\n });\n }\n\n async uploadScreenshot(screenshot_bytes: Buffer): Promise<string> {\n return pRetry(async () => {\n const response = await fetch(`${this.apiUrl}/upload-screenshots/`, {\n method: 'POST',\n headers: {\n 'Authorization': `Token ${this.token}`\n },\n body: screenshot_bytes,\n });\n \n const data = await this.handleResponse(response);\n return data.screenshot_url;\n }, {\n retries: this.maxRetries,\n minTimeout: this.initialBackoff,\n onFailedAttempt: error => {\n proboLogger.warn(`API call failed, attempt ${error.attemptNumber} of ${error.retriesLeft + error.attemptNumber}...`);\n }\n });\n }\n\n async findStepByPrompt(prompt: string, scenarioName: string): Promise<FindStepByPromptResult | null> {\n proboLogger.debug(`Finding step by prompt: ${prompt} and scenario: ${scenarioName}`);\n return pRetry(async () => {\n const response = await fetch(`${this.apiUrl}/step-runners/find-step-by-prompt/`, {\n method: 'POST',\n headers: this.getHeaders(),\n body: JSON.stringify({\n prompt: prompt,\n scenario_name: scenarioName\n }),\n });\n \n try {\n const data = await this.handleResponse(response);\n return {\n step: data.step,\n total_count: data.total_count\n };\n } catch (error: any) {\n // If we get a 404, the step doesn't exist\n if (error instanceof ApiError && error.status === 404) {\n return null;\n }\n // For any other error, rethrow\n throw error;\n }\n }, {\n retries: this.maxRetries,\n minTimeout: this.initialBackoff,\n onFailedAttempt: error => {\n proboLogger.warn(`API call failed, attempt ${error.attemptNumber} of ${error.retriesLeft + error.attemptNumber}...`);\n }\n });\n }\n\n async resetStep(stepId: string) {\n return pRetry(async () => {\n const response = await fetch(`${this.apiUrl}/steps/${stepId}/reset/`, {\n method: 'POST',\n headers: this.getHeaders(),\n });\n const data = await this.handleResponse(response);\n return data;\n });\n }\n}\n","import type { Page } from 'playwright';\nimport { ElementTag } from '@probolabs/highlighter/src/constants';\nimport { executePlaywrightAction, PlaywrightAction, waitForMutationsToSettle, executeCachedPlaywrightAction, PlaywrightActionType } from './actions';\nimport { Highlighter, ElementTagType } from './highlight';\nimport { ApiClient, Instruction, FindStepByPromptResult } from './api-client';\nimport { proboLogger , ProboLogLevel } from './utils';\nimport pRetry, { FailedAttemptError } from 'p-retry';\n\n/**\n * Available AI models for LLM operations\n */\nexport enum AIModel {\n AZURE_GPT4 = \"AZURE_GPT4\",\n AZURE_GPT4_MINI = \"AZURE_GPT4_MINI\",\n GEMINI_1_5_FLASH = \"GEMINI_1_5_FLASH\",\n GEMINI_2_5_FLASH = \"GEMINI_2_5_FLASH\",\n GPT4 = \"GPT4\",\n GPT4_MINI = \"GPT4_MINI\",\n CLAUDE_3_5 = \"CLAUDE_3_5\",\n GROK_2 = \"GROK_2\",\n LLAMA_4_SCOUT = \"LLAMA_4_SCOUT\",\n DEEPSEEK_V3 = \"DEEPSEEK_V3\",\n DEFAULT_AI_MODEL = \"DEFAULT_AI_MODEL\"\n}\n\nexport const DEMO_TOKEN = 'b31793f81a1f58b8a153c86a5fdf4df0e5179c51';\nexport { ProboLogLevel };\ninterface ProboConfig {\n scenarioName: string;\n token: string;\n apiUrl: string;\n enableConsoleLogs?: boolean;\n debugLevel?: ProboLogLevel;\n aiModel?: AIModel;\n}\n\nexport interface RunStepOptions {\n useCache: boolean;\n stepIdFromServer: number | null | undefined;\n aiModel?: AIModel;\n}\n\nconst retryOptions = {\n retries: 3,\n minTimeout: 1000,\n onFailedAttempt: (error: FailedAttemptError) => {\n proboLogger.warn(\n `Page operation failed, attempt ${error.attemptNumber} of ${error.retriesLeft + error.attemptNumber}...`\n );\n }\n};\n\nexport class Probo {\n private highlighter: Highlighter;\n private apiClient: ApiClient;\n private readonly enableConsoleLogs: boolean; \n private readonly scenarioName: string;\n private readonly aiModel: AIModel;\n constructor({\n scenarioName,\n token,\n apiUrl,\n enableConsoleLogs = false,\n debugLevel = ProboLogLevel.LOG,\n aiModel = AIModel.DEFAULT_AI_MODEL\n }: ProboConfig) {\n this.highlighter = new Highlighter(enableConsoleLogs);\n this.apiClient = new ApiClient(apiUrl, token);\n this.enableConsoleLogs = enableConsoleLogs;\n this.scenarioName = scenarioName;\n this.aiModel = aiModel;\n proboLogger.setLogLevel(debugLevel);\n proboLogger.log(`Initializing: scenarioName: ${scenarioName}, apiUrl: ${apiUrl}, enableConsoleLogs: ${enableConsoleLogs}, debugLevel: ${debugLevel}, aiModel: ${aiModel}`);\n }\n\n public async runStep(\n page: Page, \n stepPrompt: string, \n options: RunStepOptions = { useCache: true, stepIdFromServer: undefined, aiModel: this.aiModel }\n ): Promise<boolean> {\n // Use the aiModel from options if provided, otherwise use the one from constructor\n const aiModelToUse = options.aiModel !== undefined ? options.aiModel : this.aiModel;\n \n proboLogger.log(`runStep: ${options.stepIdFromServer ? '#'+options.stepIdFromServer+' - ' : ''}${stepPrompt}, aiModel: ${aiModelToUse}, pageUrl: ${page.url()}`);\n this.setupConsoleLogs(page);\n \n // First check if the step exists in the database\n let stepId: string;\n \n if (options.useCache) {\n const isCachedStep = await this._handleCachedStep(page, stepPrompt);\n if (isCachedStep) {\n proboLogger.debug('performed cached step!');\n return true;\n }\n }\n \n proboLogger.debug(`Cache disabled or step not found, creating new step`);\n stepId = await this._handleStepCreation(page, stepPrompt, options.stepIdFromServer, options.useCache);\n proboLogger.debug('Step ID:', stepId);\n let instruction: Instruction | null = null;\n // Main execution loop\n while (true) {\n try {\n // Get next instruction from server\n const nextInstruction = await this.apiClient.resolveNextInstruction(stepId, instruction, aiModelToUse);\n proboLogger.debug('Next Instruction from server:', nextInstruction);\n\n // Exit conditions\n \n if (nextInstruction.what_to_do === 'do_nothing') {\n if (nextInstruction.args.success) {\n proboLogger.info(`Reasoning: ${nextInstruction.args.message}`)\n proboLogger.info('Step completed successfully');\n return nextInstruction.args.status;\n }\n else { \n throw new Error(nextInstruction.args.message)\n } \n }\n\n // Handle different instruction types\n switch (nextInstruction.what_to_do) {\n case 'highlight_candidate_elements':\n proboLogger.debug('Highlighting candidate elements:', nextInstruction.args.element_type);\n const highlighted_elements = await this.highlightElements(page, nextInstruction.args.element_type);\n proboLogger.debug(`Highlighted ${highlighted_elements.length} elements`);\n const candidate_elements_screenshot_url = await this.screenshot(page);\n // proboLogger.log('candidate_elements_screenshot_url:', candidate_elements_screenshot_url);\n const executed_instruction: Instruction = {\n what_to_do: 'highlight_candidate_elements',\n args: {\n element_type: nextInstruction.args.element_type\n },\n result: {\n highlighted_elements: highlighted_elements,\n candidate_elements_screenshot_url: candidate_elements_screenshot_url\n }\n }\n proboLogger.debug('Executed Instruction:', executed_instruction);\n instruction = executed_instruction;\n break;\n\n case 'perform_action':\n instruction = await this._handlePerformAction(page, nextInstruction);\n break;\n\n default:\n throw new Error(`Unknown instruction type: ${nextInstruction.what_to_do}`);\n }\n\n } catch (error: any) {\n proboLogger.error(error.message); \n throw Error(error.message); \n }\n }\n \n\n }\n \n private async _handleCachedStep(page: Page, stepPrompt: string): Promise<boolean> {\n proboLogger.debug(`Checking if step exists in database: ${stepPrompt}`);\n const result: FindStepByPromptResult | null = await this.apiClient.findStepByPrompt(stepPrompt, this.scenarioName);\n if (result) {\n proboLogger.log(`Found existing step with ID: ${result.step.id} going to perform action: ${result.step.action} with value: ${result.step.action_value}`);\n proboLogger.debug(`Step in the DB: #${result.step.id} status: ${result.step.status} action: ${result.step.action} action_value: ${result.step.action_value} locator: ${result.step.element_css_selector}`);\n if (result.step.status !== 'EXECUTED') {\n proboLogger.debug(`Step ${result.step.id} is not executed, returning false`);\n return false;\n }\n proboLogger.debug(`Step ${result.step.id} is in status executed, performing action directly with Playwright`);\n const element_css_selector = result.step.element_css_selector\n const iframe_selector = result.step.iframe_selector\n try {\n await executeCachedPlaywrightAction(page, result.step.action as PlaywrightActionType, result.step.action_value, iframe_selector, element_css_selector);\n } catch (error: any) {\n proboLogger.error(`Error executing action for step ${result.step.id} going to reset the step`);\n proboLogger.debug('Error details:', error);\n await this.apiClient.resetStep(result.step.id);\n return false;\n }\n return true\n } else {\n proboLogger.debug(`Step not found in database, continuing with the normal flow`);\n return false\n }\n\n }\n \n private async _handleStepCreation(\n page: Page, \n stepPrompt: string, \n stepIdFromServer: number | null | undefined, \n useCache: boolean\n ): Promise<string> {\n \n proboLogger.debug(`Taking initial screenshot from the page ${page.url()}`);\n // not sure if this is needed\n // await handlePotentialNavigation(page);\n await waitForMutationsToSettle(page);\n const initial_screenshot_url = await pRetry(() => this.screenshot(page), retryOptions);\n proboLogger.debug(`Taking initial html content from the page ${page.url()}`);\n const initial_html_content = await pRetry(async () => {\n try {\n return await page.content();\n } catch (error: any) {\n console.log('Error caught:', {\n name: error.name,\n message: error.message,\n code: error.code,\n constructor: error.constructor.name,\n prototype: Object.getPrototypeOf(error).constructor.name\n });\n throw error; // Re-throw to trigger retry\n }\n }, retryOptions);\n \n return await this.apiClient.createStep({\n stepIdFromServer,\n scenarioName: this.scenarioName,\n stepPrompt: stepPrompt,\n initial_screenshot_url,\n initial_html_content,\n use_cache: useCache\n });\n }\n\n\n private setupConsoleLogs(page: Page) {\n if (this.enableConsoleLogs) {\n page.on('console', msg => {\n const type = msg.type();\n const text = msg.text();\n proboLogger.log(`[Browser-${type}]: ${text}`);\n });\n }\n }\n\n public async highlightElements(page: Page, elementTag: ElementTagType) {\n return this.highlighter.highlightElements(page, elementTag);\n }\n\n public async unhighlightElements(page: Page) {\n return this.highlighter.unhighlightElements(page);\n }\n\n public async highlightElement(page: Page, element_css_selector: string, iframe_selector: string, element_index: string) {\n return this.highlighter.highlightElement(page, element_css_selector, iframe_selector, element_index);\n }\n\n public async screenshot(page: Page) { \n proboLogger.debug(`taking screenshot of current page: ${page.url()}`);\n // await page.evaluate(() => document.fonts?.ready.catch(() => {}));\n const screenshot_bytes = await page.screenshot({ fullPage: true, animations: 'disabled' });\n // make an api call to upload the screenshot to cloudinary\n proboLogger.debug('uploading image data to cloudinary');\n const screenshot_url = await this.apiClient.uploadScreenshot(screenshot_bytes);\n return screenshot_url;\n \n }\n\n private async _handlePerformAction(page: Page, nextInstruction: Instruction) {\n proboLogger.debug('Handling perform action:', nextInstruction);\n const action = nextInstruction.args.action;\n const value = nextInstruction.args.value;\n const element_css_selector = nextInstruction.args.element_css_selector;\n const iframe_selector = nextInstruction.args.iframe_selector;\n const element_index = nextInstruction.args.element_index;\n if(action !== PlaywrightAction.VISIT_URL) {\n await this.unhighlightElements(page);\n proboLogger.debug('Unhighlighted elements');\n await this.highlightElement(page, element_css_selector,iframe_selector, element_index);\n proboLogger.debug('Highlighted element');\n }\n const pre_action_screenshot_url = await this.screenshot(page);\n const step_status = await executePlaywrightAction(page, action, value, iframe_selector, element_css_selector); \n await this.unhighlightElements(page);\n proboLogger.debug('UnHighlighted element');\n await waitForMutationsToSettle(page);\n const post_action_screenshot_url = await this.screenshot(page);\n const post_html_content = await pRetry(async () => {\n try {\n return await page.content();\n } catch (error: any) {\n console.log('Error caught:', {\n name: error.name,\n message: error.message,\n code: error.code,\n constructor: error.constructor.name,\n prototype: Object.getPrototypeOf(error).constructor.name\n });\n throw error; // Re-throw to trigger retry\n }\n }, retryOptions);\n \n\n const executed_instruction: Instruction = {\n what_to_do: 'perform_action',\n args: {\n action: action,\n value: value,\n element_css_selector: element_css_selector,\n iframe_selector: iframe_selector\n },\n result: {\n pre_action_screenshot_url: pre_action_screenshot_url,\n post_action_screenshot_url: post_action_screenshot_url,\n post_html_content: post_html_content,\n validation_status: step_status ?? true\n }\n }\n return executed_instruction;\n }\n\n \n}\n\n// Re-export ElementTag for convenience\nexport { ElementTag };\n\n\n\n"],"names":["require$$0","retry"],"mappings":";AAAY,MAAC,UAAU,GAAG;AAC1B,EAAE,SAAS,EAAE,WAAW;AACxB,EAAE,QAAQ,EAAE,UAAU;AACtB,EAAE,UAAU,EAAE,YAAY;AAC1B,EAAE,uBAAuB,EAAE,yBAAyB;AACpD;;ICLY,cAMX;AAND,CAAA,UAAY,aAAa,EAAA;AACrB,IAAA,aAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;AACf,IAAA,aAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACb,IAAA,aAAA,CAAA,KAAA,CAAA,GAAA,KAAW,CAAA;AACX,IAAA,aAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACb,IAAA,aAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;AACnB,CAAC,EANW,aAAa,KAAb,aAAa,GAMxB,EAAA,CAAA,CAAA,CAAA;AAED;AACO,MAAM,gB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H,MAAM,KAAK,CAAC;aACf;SACJ,EAAE,YAAY,CAAC,CAAC;AAGf,QAAA,MAAM,oBAAoB,GAAgB;AACxC,YAAA,UAAU,EAAE,gBAAgB;AAC5B,YAAA,IAAI,EAAE;AACJ,gBAAA,MAAM,EAAE,MAAM;AACd,gBAAA,KAAK,EAAE,KAAK;AACZ,gBAAA,oBAAoB,EAAE,oBAAoB;AAC1C,gBAAA,eAAe,EAAE,eAAe;AACjC,aAAA;AACD,YAAA,MAAM,EAAE;AACN,gBAAA,yBAAyB,EAAE,yBAAyB;AACpD,gBAAA,0BAA0B,EAAE,0BAA0B;AACtD,gBAAA,iBAAiB,EAAE,iBAAiB;AACpC,gBAAA,iBAAiB,EAAE,WAAW,KAAA,IAAA,IAAX,WAAW,KAAX,KAAA,CAAA,GAAA,WAAW,GAAI,IAAI;AACvC,aAAA;SACF,CAAA;AACD,QAAA,OAAO,oBAAoB,CAAC;KAC7B;AAGF;;;;","x_google_ignoreList":[4,5,6,7,8]}
1
+ {"version":3,"file":"index.js","sources":["../../probo-highlighter/src/constants.js","../src/utils.ts","../src/actions.ts","../src/highlight.ts","../../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry_operation.js","../../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/lib/retry.js","../../../node_modules/.pnpm/retry@0.13.1/node_modules/retry/index.js","../../../node_modules/.pnpm/is-network-error@1.1.0/node_modules/is-network-error/index.js","../../../node_modules/.pnpm/p-retry@6.2.1/node_modules/p-retry/index.js","../src/api-client.ts","../src/index.ts"],"sourcesContent":["export const ElementTag = {\n CLICKABLE: \"CLICKABLE\", // button, link, toggle switch, checkbox, radio, dropdowns, clickable divs\n FILLABLE: \"FILLABLE\", // input, textarea content_editable, date picker??\n SELECTABLE: \"SELECTABLE\", // select\n NON_INTERACTIVE_ELEMENT: 'NON_INTERACTIVE_ELEMENT',\n};\n\nexport class ElementInfo {\n constructor(element, index, {tag, type, text, html, xpath, css_selector, bounding_box, iframe_selector}) {\n this.index = index.toString();\n this.tag = tag;\n this.type = type;\n this.text = text;\n this.html = html;\n this.xpath = xpath;\n this.css_selector = css_selector;\n this.bounding_box = bounding_box;\n this.iframe_selector = iframe_selector;\n this.element = element;\n this.depth = -1;\n }\n\n getSelector() {\n return this.xpath ? this.xpath : this.css_selector;\n }\n\n getDepth() {\n if (this.depth >= 0) {\n return this.depth;\n }\n \n this.depth = 0;\n let currentElement = this.element;\n \n while (currentElement.nodeType === Node.ELEMENT_NODE) { \n this.depth++;\n if (currentElement.assignedSlot) {\n currentElement = currentElement.assignedSlot;\n }\n else {\n currentElement = currentElement.parentNode;\n // Check if we're at a shadow root\n if (currentElement && currentElement.nodeType !== Node.ELEMENT_NODE && currentElement.getRootNode() instanceof ShadowRoot) {\n // Get the shadow root's host element\n currentElement = currentElement.getRootNode().host; \n }\n }\n }\n \n return this.depth;\n }\n}\n","export enum ProboLogLevel {\n DEBUG = 'DEBUG',\n INFO = 'INFO',\n LOG = 'LOG',\n WARN = 'WARN',\n ERROR = 'ERROR'\n}\n\n// Add a severity map for comparison\nexport const LogLevelSeverity: Record<ProboLogLevel, number> = {\n [ProboLogLevel.DEBUG]: 0,\n [ProboLogLevel.INFO]: 1,\n [ProboLogLevel.LOG]: 2,\n [ProboLogLevel.WARN]: 3,\n [ProboLogLevel.ERROR]: 4,\n};\n\nexport class ProboLogger {\n constructor(\n private prefix: string,\n private logLevel: ProboLogLevel = ProboLogLevel.LOG\n ) {}\n\n setLogLevel(level: ProboLogLevel): void {\n this.logLevel = level;\n console.log(`[${this.prefix}-INFO] Log level set to: ${ProboLogLevel[level]}`);\n }\n\n debug(...args: any[]): void {\n this.msg(ProboLogLevel.DEBUG, ...args);\n }\n\n info(...args: any[]): void {\n this.msg(ProboLogLevel.INFO, ...args);\n }\n\n log(...args: any[]): void {\n this.msg(ProboLogLevel.LOG, ...args);\n }\n\n warn(...args: any[]): void {\n this.msg(ProboLogLevel.WARN, ...args);\n }\n\n error(...args: any[]): void {\n this.msg(ProboLogLevel.ERROR, ...args);\n }\n\n private msg(logLevel: ProboLogLevel, ...args: any[]): void {\n if (LogLevelSeverity[logLevel] >= LogLevelSeverity[this.logLevel]) {\n const now = new Date();\n const timestamp = now.toLocaleString('en-GB', {\n day: '2-digit',\n month: 'short',\n year: 'numeric',\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit',\n hour12: false\n }).replace(',', '');\n\n // const stack = new Error().stack;\n // const callerLine = stack?.split('\\n')[3];\n // const callerInfo = callerLine?.match(/at\\s+(?:(.+)\\s+\\()?(.+):(\\d+):(\\d+)\\)?/);\n // const [, fnName, file, line] = callerInfo || [];\n // const fileInfo = file ? `${file.split('/').pop()}:${line}` : '';\n // const functionInfo = fnName ? `${fnName}` : '';\n\n // console.log(`[${timestamp}] ${logLevel} [${this.prefix}.${fileInfo}${functionInfo ? ` ${functionInfo}` : ''}]`, ...args);\n console.log(`[${timestamp}] ${logLevel} [${this.prefix}]`, ...args);\n }\n }\n}\n\nexport const proboLogger = new ProboLogger('probolib');\n\nexport interface ElementInfo {\n index: string;\n tag: string;\n type: string;\n text: string;\n html: string;\n xpath: string;\n css_selector: string;\n bounding_box: {\n x: number;\n y: number;\n width: number;\n height: number;\n top: number;\n right: number;\n bottom: number;\n left: number;\n };\n iframe_selector: string;\n element: any;\n depth?: number;\n getSelector(): string;\n getDepth(): number;\n}\n\nexport interface CleanElementInfo {\n index: string;\n tag: string;\n type: string;\n text: string;\n html: string;\n xpath: string;\n css_selector: string;\n iframe_selector: string;\n bounding_box: {\n x: number;\n y: number;\n width: number;\n height: number;\n top: number;\n right: number;\n bottom: number;\n left: number;\n };\n depth: number;\n}\n\nconst elementLogger = new ProboLogger('element-cleaner');\n\nexport function cleanupElementInfo(elementInfo: ElementInfo): CleanElementInfo {\n elementLogger.debug(`Cleaning up element info for ${elementInfo.tag} element at index ${elementInfo.index}`);\n \n const depth = elementInfo.depth ?? elementInfo.getDepth();\n \n const cleanElement = {\n index: elementInfo.index,\n tag: elementInfo.tag,\n type: elementInfo.type,\n text: elementInfo.text,\n html: elementInfo.html,\n xpath: elementInfo.xpath,\n css_selector: elementInfo.css_selector,\n iframe_selector: elementInfo.iframe_selector,\n bounding_box: elementInfo.bounding_box,\n depth: depth\n };\n\n elementLogger.debug(`Cleaned element structure:`, cleanElement);\n return cleanElement;\n}\n\nexport function cleanupInstructionElements(instruction: any): any {\n if (!instruction?.result?.highlighted_elements) {\n elementLogger.debug('No highlighted elements to clean');\n return instruction;\n }\n\n elementLogger.debug(`Cleaning ${instruction.result.highlighted_elements.length} highlighted elements`);\n \n const cleanInstruction = {\n ...instruction,\n result: {\n ...instruction.result,\n highlighted_elements: instruction.result.highlighted_elements.map((element: ElementInfo) => \n cleanupElementInfo(element)\n )\n }\n };\n\n elementLogger.debug('Instruction cleaning completed');\n return cleanInstruction;\n}\n","import { Page, Frame, Locator } from 'playwright';\nimport { proboLogger } from './utils';\n\n// Action constants\nexport const PlaywrightAction = {\n VISIT_BASE_URL: 'VISIT_BASE_URL',\n VISIT_URL: 'VISIT_URL',\n CLICK: 'CLICK',\n FILL_IN: 'FILL_IN',\n SELECT_DROPDOWN: 'SELECT_DROPDOWN',\n SELECT_MULTIPLE_DROPDOWN: 'SELECT_MULTIPLE_DROPDOWN',\n CHECK_CHECKBOX: 'CHECK_CHECKBOX',\n SELECT_RADIO: 'SELECT_RADIO',\n TOGGLE_SWITCH: 'TOGGLE_SWITCH',\n TYPE_KEYS: 'TYPE_KEYS',\n VALIDATE_EXACT_VALUE: 'VALIDATE_EXACT_VALUE',\n VALIDATE_CONTAINS_VALUE: 'VALIDATE_CONTAINS_VALUE',\n VALIDATE_URL: 'VALIDATE_URL',\n} as const;\nexport type PlaywrightActionType = typeof PlaywrightAction[keyof typeof PlaywrightAction];\n\nexport const SPECIAL_KEYS = [\n 'Enter', 'Tab', 'Escape', 'Backspace', 'Delete',\n 'ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown',\n 'Home', 'End', 'PageUp', 'PageDown',\n 'Insert', 'F1', 'F2', 'F3', 'F4', 'F5', 'F6', 'F7', 'F8', 'F9', 'F10', 'F11', 'F12',\n 'Shift', 'Control', 'Alt', 'Meta',\n 'CapsLock', 'NumLock', 'ScrollLock',\n 'Pause', 'PrintScreen', 'ContextMenu',\n 'AudioVolumeUp', 'AudioVolumeDown', 'AudioVolumeMute',\n 'MediaTrackNext', 'MediaTrackPrevious', 'MediaStop', 'MediaPlayPause',\n 'BrowserBack', 'BrowserForward', 'BrowserRefresh', 'BrowserFavorites'\n] as const;\n\n/**\n * Handle potential navigation exactly like Python's handle_potential_navigation\n */\nexport async function handlePotentialNavigation(\n page: Page,\n locator: Locator | null = null,\n value: string | null = null,\n options: {\n initialTimeout?: number;\n navigationTimeout?: number;\n globalTimeout?: number;\n } = {}\n): Promise<boolean> {\n const {\n initialTimeout = 5000,\n navigationTimeout = 7000,\n globalTimeout = 15000,\n } = options;\n\n const startTime = Date.now();\n let navigationCount = 0;\n let lastNavTime: number | null = null;\n\n const onFrameNav = (frame: Frame) => {\n if (frame === page.mainFrame()) {\n navigationCount++;\n lastNavTime = Date.now();\n proboLogger.debug(\n `DEBUG_NAV[${((Date.now() - startTime) / 1000).toFixed(3)}s]: navigation detected (count=${navigationCount})`\n );\n }\n };\n\n proboLogger.debug(`DEBUG_NAV[0.000s]: Starting navigation detection`);\n page.on(\"framenavigated\", onFrameNav);\n\n try {\n if (locator) {\n proboLogger.debug(`DEBUG_NAV: Executing click(${value})`);\n await clickAtPosition(page, locator, value as ClickPosition | null);\n }\n\n // wait for any initial nav to fire\n await page.waitForTimeout(initialTimeout);\n proboLogger.debug(\n `DEBUG_NAV[${((Date.now() - startTime) / 1000).toFixed(3)}s]: After initial wait, count=${navigationCount}`\n );\n\n if (navigationCount > 0) {\n // loop until either per-nav or global timeout\n while (true) {\n const now = Date.now();\n if (\n lastNavTime !== null &&\n now - lastNavTime > navigationTimeout\n ) {\n proboLogger.debug(\n `DEBUG_NAV[${((now - startTime) / 1000).toFixed(3)}s]: per‐navigation timeout reached`\n );\n break;\n }\n if (now - startTime > globalTimeout) {\n proboLogger.debug(\n `DEBUG_NAV[${((now - startTime) / 1000).toFixed(3)}s]: overall timeout reached`\n );\n break;\n }\n await page.waitForTimeout(500);\n }\n\n // now wait for load + idle\n proboLogger.debug(`DEBUG_NAV: waiting for load state`);\n await page.waitForLoadState(\"load\", { timeout: globalTimeout });\n\n proboLogger.debug(`DEBUG_NAV: waiting for networkidle`);\n try {\n // shorter idle‐wait so we don't hang the full globalTimeout here\n await page.waitForLoadState(\"networkidle\", {\n timeout: navigationTimeout,\n });\n } catch {\n proboLogger.debug(\n `DEBUG_NAV: networkidle not reached in ${navigationTimeout}ms, proceeding anyway`\n );\n }\n\n await scrollToBottomRight(page);\n proboLogger.debug(`DEBUG_NAV: done`);\n return true;\n }\n\n proboLogger.debug(`DEBUG_NAV: no navigation detected`);\n return false;\n } finally {\n page.removeListener(\"framenavigated\", onFrameNav);\n proboLogger.debug(`DEBUG_NAV: listener removed`);\n }\n}\n\n\n/**\n * Scroll entire page to bottom-right, triggering lazy-loaded content\n */\nexport async function scrollToBottomRight(page: Page): Promise<void> {\n const startTime = performance.now();\n proboLogger.debug(`Starting scroll to bottom-right`);\n\n let lastHeight = await page.evaluate(() => document.documentElement.scrollHeight);\n let lastWidth = await page.evaluate(() => document.documentElement.scrollWidth);\n\n while (true) {\n let smoothingSteps = 0;\n const initY = await page.evaluate(() => window.scrollY);\n const clientHeight = await page.evaluate(() => document.documentElement.clientHeight);\n const maxHeight = await page.evaluate(() => document.documentElement.scrollHeight);\n \n let currY = initY;\n while (currY <= maxHeight - clientHeight) {\n currY += clientHeight;\n await page.evaluate(y => window.scrollTo(0, y), currY);\n await page.waitForTimeout(50);\n smoothingSteps++;\n }\n\n proboLogger.debug(\n `performed ${smoothingSteps} smoothing steps while scrolling`\n );\n\n const newHeight = await page.evaluate(() => document.documentElement.scrollHeight);\n const newWidth = await page.evaluate(() => document.documentElement.scrollWidth);\n if (newHeight === lastHeight && newWidth === lastWidth) break;\n proboLogger.debug(`page dimensions updated, repeating scroll`);\n lastHeight = newHeight;\n lastWidth = newWidth;\n }\n\n await page.waitForTimeout(200);\n await page.evaluate('window.scrollTo(0, 0)');\n await page.waitForTimeout(50);\n proboLogger.debug(`Scroll completed in ${(performance.now() - startTime).toFixed(3)}ms`);\n}\n\n/**\n * Wait for DOM mutations to settle using MutationObserver logic\n */\nexport async function waitForMutationsToSettle(\n page: Page,\n mutationTimeout: number = 1500,\n initTimeout: number = 2000\n): Promise<boolean> {\n const startTime = Date.now();\n proboLogger.debug(\n `Starting mutation settlement (initTimeout=${initTimeout}, mutationTimeout=${mutationTimeout})`\n );\n\n const result = await page.evaluate(\n async ({ mutationTimeout, initTimeout }) => {\n async function blockUntilStable(\n targetNode: HTMLElement,\n options = { childList: true, subtree: true }\n ) {\n return new Promise<boolean>((resolve) => {\n let initTimerExpired = false;\n let mutationsOccurred = false;\n const observerTimers = new Set<number>();\n\n const initTimer = window.setTimeout(() => {\n initTimerExpired = true;\n if (observerTimers.size === 0) resolve(mutationsOccurred);\n }, initTimeout);\n\n const observer = new MutationObserver(() => {\n mutationsOccurred = true;\n observerTimers.forEach((t) => clearTimeout(t));\n observerTimers.clear();\n const t = window.setTimeout(() => {\n observerTimers.delete(t);\n if (initTimerExpired && observerTimers.size === 0) {\n observer.disconnect();\n resolve(mutationsOccurred);\n }\n }, mutationTimeout);\n observerTimers.add(t);\n });\n\n observer.observe(targetNode, options);\n });\n }\n return blockUntilStable(document.body as HTMLElement);\n },\n { mutationTimeout, initTimeout }\n );\n\n const total = ((Date.now() - startTime) / 1000).toFixed(2);\n proboLogger.debug(\n result\n ? `Mutations settled. Took ${total}s`\n : `No mutations observed. Took ${total}s`\n );\n\n return result;\n}\n\n\n/**\n * Get element text value: allTextContents + innerText fallback\n */\nexport async function getElementValue(\n page: Page,\n locator: Locator\n): Promise<string> {\n const texts = await locator.allTextContents();\n let allText = texts.join('').trim();\n if (!allText) {\n allText = await locator.evaluate((el: HTMLElement) => el.innerText);\n }\n proboLogger.debug(`getElementValue: [${allText}]`);\n return allText;\n}\n\n/**\n * Select dropdown option: native <select>, <option>, child select, or ARIA listbox\n */\nexport async function selectDropdownOption(\n page: Page,\n locator: Locator,\n value: string | string[]\n): Promise<void> { \n const tagName = await locator?.evaluate((el) => el.tagName.toLowerCase());\n const role = await locator?.getAttribute('role');\n\n if (tagName === 'option' || role === 'option') {\n proboLogger.debug('selectDropdownOption: option role detected');\n await locator?.click();\n } else if (tagName === 'select') {\n proboLogger.debug('selectDropdownOption: simple select tag detected');\n try {\n await locator?.selectOption(value as any);\n } catch {\n proboLogger.debug('selectDropdownOption: manual change event fallback');\n const handle = locator ? await locator.elementHandle() : null;\n await page.evaluate(\n ({ h, val }: { h: HTMLElement | SVGElement | null, val: string | string[] }) => {\n const el = h as HTMLSelectElement;\n if (el) {\n el.value = Array.isArray(val) ? val[0] : (val as string);\n el.dispatchEvent(new Event('change', { bubbles: true }));\n }\n },\n { h: handle, val: value }\n );\n }\n } else {\n proboLogger.debug('selectDropdownOption: custom dropdown path');\n let listbox = locator.locator('select');\n let count = await listbox.count();\n if (count > 1) throw new Error(`selectDropdownOption: ambiguous <select> count=${count}`);\n if (count === 1) {\n proboLogger.debug('selectDropdownOption: child <select> found');\n await listbox.selectOption(value as any);\n return;\n }\n await locator.click();\n let container = locator;\n count = 0;\n if (role !== 'listbox') {\n for (let i = 0; i < 7; i++) {\n listbox = container.getByRole('listbox');\n count = await listbox.count();\n if (count >= 1) break;\n proboLogger.debug(`selectDropdownOption: iteration #${i} no listbox found`);\n container = container.locator('xpath=..');\n }\n } else {\n listbox = container;\n count = await listbox.count();\n }\n if (count !== 1) throw new Error(`selectDropdownOption: found ${count} listbox locators`);\n const vals = Array.isArray(value) ? value : [value];\n for (const val of vals) {\n const option = listbox.getByRole('option').getByText(new RegExp(`^${val}$`, 'i'));\n const optCount = await option.count();\n if (optCount !== 1) throw new Error(`selectDropdownOption: ${optCount} options for '${val}'`);\n await option.click();\n }\n }\n}\n\n/**\n * Execute a given Playwright action, mirroring Python's _perform_action\n */\nexport async function executePlaywrightAction(\n page: Page,\n action: PlaywrightActionType,\n value: string,\n iframe_selector: string,\n element_css_selector: string\n): Promise<boolean> {\n proboLogger.info(`performing Action: ${action} Value: ${value}`);\n try {\n \n if (action === PlaywrightAction.VISIT_BASE_URL || action === PlaywrightAction.VISIT_URL) {\n await page.goto(value, { waitUntil: 'load' });\n await handlePotentialNavigation(page, null); \n }\n else {\n let locator = undefined;\n if (iframe_selector)\n locator = page.frameLocator(iframe_selector).locator(element_css_selector);\n else\n locator = page.locator(element_css_selector);\n\n switch (action) { \n case PlaywrightAction.CLICK:\n await handlePotentialNavigation(page, locator, value as ClickPosition | null);\n break;\n\n case PlaywrightAction.FILL_IN:\n await locator.click();\n await locator.fill(value);\n break;\n\n case PlaywrightAction.TYPE_KEYS:\n // Check if the value contains any special keys\n const specialKey = SPECIAL_KEYS.find(key => value.includes(key));\n if (specialKey) {\n // If it's a single special key, just press it\n if (value === specialKey) {\n await locator?.press(specialKey);\n } else {\n // Handle combinations like 'Control+A' or 'Shift+ArrowRight'\n const parts = value.split('+');\n if (parts.length === 2 && SPECIAL_KEYS.includes(parts[0] as any) && SPECIAL_KEYS.includes(parts[1] as any)) {\n await locator?.press(value);\n } else {\n // If it's a mix of special keys and text, use pressSequentially\n await locator?.pressSequentially(value);\n }\n }\n } else {\n // No special keys, just type normally\n await locator?.pressSequentially(value);\n }\n break;\n\n case PlaywrightAction.SELECT_DROPDOWN:\n await selectDropdownOption(page, locator, value);\n break;\n\n case PlaywrightAction.SELECT_MULTIPLE_DROPDOWN:\n let optsArr: string[];\n if (value.startsWith('[')) {\n try { optsArr = JSON.parse(value); } catch {\n optsArr = value.slice(1, -1).split(',').map(o => o.trim());\n }\n } else {\n optsArr = value.split(',').map(o => o.trim());\n }\n await locator?.selectOption(optsArr as any);\n break;\n\n case PlaywrightAction.CHECK_CHECKBOX:\n await locator?.setChecked(value.toLowerCase() === 'true');\n break;\n\n case PlaywrightAction.SELECT_RADIO:\n case PlaywrightAction.TOGGLE_SWITCH:\n await locator?.click();\n break;\n\n case PlaywrightAction.VALIDATE_EXACT_VALUE:\n const actualExact = await getElementValue(page, locator);\n proboLogger.debug(`actual value is [${actualExact}]`);\n if (actualExact !== value) {\n proboLogger.info(`Validation *FAIL* expected '${value}' but got '${actualExact}'`);\n return false;\n }\n proboLogger.info('Validation *PASS*');\n break;\n\n case PlaywrightAction.VALIDATE_CONTAINS_VALUE:\n const actualContains = await getElementValue(page, locator);\n proboLogger.debug(`actual value is [${actualContains}]`);\n if (!actualContains.includes(value)) {\n proboLogger.info(`Validation *FAIL* expected '${value}' to be contained in '${actualContains}'`);\n return false;\n }\n proboLogger.info('Validation *PASS*');\n break;\n\n case PlaywrightAction.VALIDATE_URL:\n const currUrl = page.url();\n if (currUrl !== value) {\n proboLogger.info(`Validation *FAIL* expected url '${value}' while is '${currUrl}'`);\n return false;\n }\n proboLogger.info('Validation *PASS*');\n break;\n\n default:\n throw new Error(`Unknown action: ${action}`);\n }\n }\n return true;\n } catch (e) {\n proboLogger.debug(`***ERROR failed to execute action ${action}: ${e}`);\n throw e;\n }\n}\n\n/**\n * Execute a given Playwright action using native Playwright functions where possible\n */\nexport async function executeCachedPlaywrightAction(\n page: Page,\n action: PlaywrightActionType,\n value: string,\n iframe_selector: string,\n element_css_selector: string\n): Promise<boolean> {\n proboLogger.log(`performing Cached Action: ${action} Value: ${value} on locator: ${element_css_selector}`);\n try {\n let locator = undefined;\n if (iframe_selector)\n locator = page.frameLocator(iframe_selector).locator(element_css_selector);\n else\n locator = page.locator(element_css_selector);\n\n switch (action) {\n case PlaywrightAction.VISIT_BASE_URL:\n case PlaywrightAction.VISIT_URL:\n await page.goto(value, { waitUntil: 'networkidle' });\n break;\n\n case PlaywrightAction.CLICK:\n await clickAtPosition(page, locator, value as ClickPosition | null);\n await handlePotentialNavigation(page);\n break;\n\n case PlaywrightAction.FILL_IN:\n await locator.click();\n await locator.fill(value);\n break;\n\n case PlaywrightAction.TYPE_KEYS:\n // Check if the value contains any special keys\n const specialKey = SPECIAL_KEYS.find(key => value.includes(key));\n if (specialKey) {\n // If it's a single special key, just press it\n if (value === specialKey) {\n await locator.press(specialKey);\n } else {\n // Handle combinations like 'Control+A' or 'Shift+ArrowRight'\n const parts = value.split('+');\n if (parts.length === 2 && SPECIAL_KEYS.includes(parts[0] as any) && SPECIAL_KEYS.includes(parts[1] as any)) {\n await locator.press(value);\n } else {\n // If it's a mix of special keys and text, use pressSequentially\n await locator.pressSequentially(value);\n }\n }\n } else {\n // No special keys, just type normally\n await locator.pressSequentially(value);\n }\n break;\n\n case PlaywrightAction.SELECT_DROPDOWN:\n await locator.selectOption(value as any);\n break;\n\n case PlaywrightAction.SELECT_MULTIPLE_DROPDOWN:\n let optsArr: string[];\n if (value.startsWith('[')) {\n try { optsArr = JSON.parse(value); } catch {\n optsArr = value.slice(1, -1).split(',').map(o => o.trim());\n }\n } else {\n optsArr = value.split(',').map(o => o.trim());\n }\n await locator.selectOption(optsArr as any);\n break;\n\n case PlaywrightAction.CHECK_CHECKBOX:\n await locator.setChecked(value.toLowerCase() === 'true');\n break;\n\n case PlaywrightAction.SELECT_RADIO:\n case PlaywrightAction.TOGGLE_SWITCH:\n await locator.click();\n break;\n\n case PlaywrightAction.VALIDATE_EXACT_VALUE:\n const actualExact = await getElementValue(page, locator);\n proboLogger.debug(`actual value is [${actualExact}]`);\n if (actualExact !== value) {\n proboLogger.info(`Validation *FAIL* expected '${value}' but got '${actualExact}'`);\n return false;\n }\n proboLogger.info('Validation *PASS*');\n break;\n\n case PlaywrightAction.VALIDATE_CONTAINS_VALUE:\n const actualContains = await getElementValue(page, locator);\n proboLogger.debug(`actual value is [${actualContains}]`);\n if (!actualContains.includes(value)) {\n proboLogger.info(`Validation *FAIL* expected '${value}' to be contained in '${actualContains}'`);\n return false;\n }\n proboLogger.info('Validation *PASS*');\n break;\n\n case PlaywrightAction.VALIDATE_URL:\n const currUrl = page.url();\n if (currUrl !== value) {\n proboLogger.info(`Validation *FAIL* expected url '${value}' while is '${currUrl}'`);\n return false;\n }\n proboLogger.info('Validation *PASS*');\n break;\n\n default:\n throw new Error(`Unknown action: ${action}`);\n }\n return true;\n } catch (e) {\n proboLogger.debug(`***ERROR failed to execute cached action ${action}: ${e}`);\n throw e;\n }\n}\n\nexport enum ClickPosition {\n LEFT = 'LEFT',\n RIGHT = 'RIGHT',\n CENTER = 'CENTER'\n}\n\n/**\n * Click on an element at a specific position\n */\nexport async function clickAtPosition(page: Page, locator: Locator, clickPosition: ClickPosition | null): Promise<void> {\n if (!clickPosition || clickPosition === ClickPosition.CENTER) {\n await locator.click({noWaitAfter: false});\n return\n }\n const boundingBox = await locator.boundingBox();\n if (boundingBox) {\n if (clickPosition === ClickPosition.LEFT) {\n await page.mouse.click(boundingBox.x + 10, boundingBox.y + boundingBox.height/2);\n }\n else if (clickPosition === ClickPosition.RIGHT) {\n await page.mouse.click(boundingBox.x + boundingBox.width - 10, boundingBox.y + boundingBox.height/2);\n }\n }\n}\n\n","import type { Page } from 'playwright';\nimport { ElementTag } from '@probolabs/highlighter/src/constants';\nimport { proboLogger } from './utils';\n\n// Fix the type definition\ntype ElementTagType = typeof ElementTag[keyof typeof ElementTag];\n\n// Add type declaration for the ProboLabs global\ndeclare global {\n // Declare highlighterCode in the global scope\n var highlighterCode: string;\n \n interface Window {\n ProboLabs?: {\n highlight: {\n execute: (elementTypes: ElementTagType[]) => Promise<any>;\n unexecute: () => Promise<any>;\n };\n highlightElements: (elements: Array<{ css_selector: string, iframe_selector: string, index: string }>) => void;\n ElementTag: typeof ElementTag;\n };\n }\n}\n\nexport class Highlighter {\n constructor(private enableConsoleLogs: boolean = true) {}\n\n private async ensureHighlighterScript(page: Page, maxRetries = 3) {\n for (let attempt = 0; attempt < maxRetries; attempt++) {\n try {\n const scriptExists = await page.evaluate(\n `typeof window.ProboLabs?.highlight?.execute === 'function'`\n );\n\n if (!scriptExists) {\n proboLogger.debug('Injecting highlighter script...');\n await page.evaluate(highlighterCode);\n \n // Verify the script was injected correctly\n const verified = await page.evaluate(`\n //console.log('ProboLabs global:', window.ProboLabs);\n typeof window.ProboLabs?.highlight?.execute === 'function'\n `);\n proboLogger.debug('Script injection verified:', verified);\n }\n return; // Success - exit the function\n } catch (error) {\n if (attempt === maxRetries - 1) {\n throw error;\n }\n proboLogger.debug(`Script injection attempt ${attempt + 1} failed, retrying after delay...`);\n await new Promise(resolve => setTimeout(resolve, 100));\n }\n }\n }\n\n public async highlightElements(page: Page, elementTag: ElementTagType) {\n proboLogger.debug('highlightElements called with:', elementTag);\n await this.ensureHighlighterScript(page);\n \n // Execute the highlight function and await its result\n const result = await page.evaluate(\n async (tag) => {\n //proboLogger.debug('Browser: Starting highlight execution with tag:', tag);\n if (!window.ProboLabs?.highlight?.execute) {\n console.error('Browser: ProboLabs.highlight.execute is not available!');\n return null;\n }\n const elements = await window.ProboLabs.highlight.execute([tag]);\n //proboLogger.debug('Browser: Found elements:', elements);\n return elements;\n },\n elementTag\n );\n \n // for (let i = 0; i < result.length; i++) { \n // result[i].element = '';\n // };\n // console.log('highlighted elements: ', result);\n return result;\n }\n\n public async unhighlightElements(page: Page) {\n proboLogger.debug('unhighlightElements called');\n await this.ensureHighlighterScript(page);\n await page.evaluate(() => {\n window?.ProboLabs?.highlight?.unexecute();\n });\n }\n\n public async highlightElement(page: Page, element_css_selector: string, iframe_selector: string, element_index: string) {\n await this.ensureHighlighterScript(page);\n proboLogger.debug('Highlighting element with:', { element_css_selector, iframe_selector, element_index });\n \n await page.evaluate(\n ({ css_selector, iframe_selector, index }) => {\n const proboLabs = window.ProboLabs;\n if (!proboLabs) {\n proboLogger.warn('ProboLabs not initialized');\n return;\n }\n // Create ElementInfo object for the element\n const elementInfo = {\n css_selector: css_selector,\n iframe_selector: iframe_selector,\n index: index\n };\n \n // Call highlightElements directly\n proboLabs.highlightElements([elementInfo]);\n },\n { \n css_selector: element_css_selector,\n iframe_selector: iframe_selector,\n index: element_index \n }\n );\n }\n}\n\nexport { ElementTag, ElementTagType };\n","function RetryOperation(timeouts, options) {\n // Compatibility for the old (timeouts, retryForever) signature\n if (typeof options === 'boolean') {\n options = { forever: options };\n }\n\n this._originalTimeouts = JSON.parse(JSON.stringify(timeouts));\n this._timeouts = timeouts;\n this._options = options || {};\n this._maxRetryTime = options && options.maxRetryTime || Infinity;\n this._fn = null;\n this._errors = [];\n this._attempts = 1;\n this._operationTimeout = null;\n this._operationTimeoutCb = null;\n this._timeout = null;\n this._operationStart = null;\n this._timer = null;\n\n if (this._options.forever) {\n this._cachedTimeouts = this._timeouts.slice(0);\n }\n}\nmodule.exports = RetryOperation;\n\nRetryOperation.prototype.reset = function() {\n this._attempts = 1;\n this._timeouts = this._originalTimeouts.slice(0);\n}\n\nRetryOperation.prototype.stop = function() {\n if (this._timeout) {\n clearTimeout(this._timeout);\n }\n if (this._timer) {\n clearTimeout(this._timer);\n }\n\n this._timeouts = [];\n this._cachedTimeouts = null;\n};\n\nRetryOperation.prototype.retry = function(err) {\n if (this._timeout) {\n clearTimeout(this._timeout);\n }\n\n if (!err) {\n return false;\n }\n var currentTime = new Date().getTime();\n if (err && currentTime - this._operationStart >= this._maxRetryTime) {\n this._errors.push(err);\n this._errors.unshift(new Error('RetryOperation timeout occurred'));\n return false;\n }\n\n this._errors.push(err);\n\n var timeout = this._timeouts.shift();\n if (timeout === undefined) {\n if (this._cachedTimeouts) {\n // retry forever, only keep last error\n this._errors.splice(0, this._errors.length - 1);\n timeout = this._cachedTimeouts.slice(-1);\n } else {\n return false;\n }\n }\n\n var self = this;\n this._timer = setTimeout(function() {\n self._attempts++;\n\n if (self._operationTimeoutCb) {\n self._timeout = setTimeout(function() {\n self._operationTimeoutCb(self._attempts);\n }, self._operationTimeout);\n\n if (self._options.unref) {\n self._timeout.unref();\n }\n }\n\n self._fn(self._attempts);\n }, timeout);\n\n if (this._options.unref) {\n this._timer.unref();\n }\n\n return true;\n};\n\nRetryOperation.prototype.attempt = function(fn, timeoutOps) {\n this._fn = fn;\n\n if (timeoutOps) {\n if (timeoutOps.timeout) {\n this._operationTimeout = timeoutOps.timeout;\n }\n if (timeoutOps.cb) {\n this._operationTimeoutCb = timeoutOps.cb;\n }\n }\n\n var self = this;\n if (this._operationTimeoutCb) {\n this._timeout = setTimeout(function() {\n self._operationTimeoutCb();\n }, self._operationTimeout);\n }\n\n this._operationStart = new Date().getTime();\n\n this._fn(this._attempts);\n};\n\nRetryOperation.prototype.try = function(fn) {\n console.log('Using RetryOperation.try() is deprecated');\n this.attempt(fn);\n};\n\nRetryOperation.prototype.start = function(fn) {\n console.log('Using RetryOperation.start() is deprecated');\n this.attempt(fn);\n};\n\nRetryOperation.prototype.start = RetryOperation.prototype.try;\n\nRetryOperation.prototype.errors = function() {\n return this._errors;\n};\n\nRetryOperation.prototype.attempts = function() {\n return this._attempts;\n};\n\nRetryOperation.prototype.mainError = function() {\n if (this._errors.length === 0) {\n return null;\n }\n\n var counts = {};\n var mainError = null;\n var mainErrorCount = 0;\n\n for (var i = 0; i < this._errors.length; i++) {\n var error = this._errors[i];\n var message = error.message;\n var count = (counts[message] || 0) + 1;\n\n counts[message] = count;\n\n if (count >= mainErrorCount) {\n mainError = error;\n mainErrorCount = count;\n }\n }\n\n return mainError;\n};\n","var RetryOperation = require('./retry_operation');\n\nexports.operation = function(options) {\n var timeouts = exports.timeouts(options);\n return new RetryOperation(timeouts, {\n forever: options && (options.forever || options.retries === Infinity),\n unref: options && options.unref,\n maxRetryTime: options && options.maxRetryTime\n });\n};\n\nexports.timeouts = function(options) {\n if (options instanceof Array) {\n return [].concat(options);\n }\n\n var opts = {\n retries: 10,\n factor: 2,\n minTimeout: 1 * 1000,\n maxTimeout: Infinity,\n randomize: false\n };\n for (var key in options) {\n opts[key] = options[key];\n }\n\n if (opts.minTimeout > opts.maxTimeout) {\n throw new Error('minTimeout is greater than maxTimeout');\n }\n\n var timeouts = [];\n for (var i = 0; i < opts.retries; i++) {\n timeouts.push(this.createTimeout(i, opts));\n }\n\n if (options && options.forever && !timeouts.length) {\n timeouts.push(this.createTimeout(i, opts));\n }\n\n // sort the array numerically ascending\n timeouts.sort(function(a,b) {\n return a - b;\n });\n\n return timeouts;\n};\n\nexports.createTimeout = function(attempt, opts) {\n var random = (opts.randomize)\n ? (Math.random() + 1)\n : 1;\n\n var timeout = Math.round(random * Math.max(opts.minTimeout, 1) * Math.pow(opts.factor, attempt));\n timeout = Math.min(timeout, opts.maxTimeout);\n\n return timeout;\n};\n\nexports.wrap = function(obj, options, methods) {\n if (options instanceof Array) {\n methods = options;\n options = null;\n }\n\n if (!methods) {\n methods = [];\n for (var key in obj) {\n if (typeof obj[key] === 'function') {\n methods.push(key);\n }\n }\n }\n\n for (var i = 0; i < methods.length; i++) {\n var method = methods[i];\n var original = obj[method];\n\n obj[method] = function retryWrapper(original) {\n var op = exports.operation(options);\n var args = Array.prototype.slice.call(arguments, 1);\n var callback = args.pop();\n\n args.push(function(err) {\n if (op.retry(err)) {\n return;\n }\n if (err) {\n arguments[0] = op.mainError();\n }\n callback.apply(this, arguments);\n });\n\n op.attempt(function() {\n original.apply(obj, args);\n });\n }.bind(obj, original);\n obj[method].options = options;\n }\n};\n","module.exports = require('./lib/retry');","const objectToString = Object.prototype.toString;\n\nconst isError = value => objectToString.call(value) === '[object Error]';\n\nconst errorMessages = new Set([\n\t'network error', // Chrome\n\t'Failed to fetch', // Chrome\n\t'NetworkError when attempting to fetch resource.', // Firefox\n\t'The Internet connection appears to be offline.', // Safari 16\n\t'Load failed', // Safari 17+\n\t'Network request failed', // `cross-fetch`\n\t'fetch failed', // Undici (Node.js)\n\t'terminated', // Undici (Node.js)\n]);\n\nexport default function isNetworkError(error) {\n\tconst isValid = error\n\t\t&& isError(error)\n\t\t&& error.name === 'TypeError'\n\t\t&& typeof error.message === 'string';\n\n\tif (!isValid) {\n\t\treturn false;\n\t}\n\n\t// We do an extra check for Safari 17+ as it has a very generic error message.\n\t// Network errors in Safari have no stack.\n\tif (error.message === 'Load failed') {\n\t\treturn error.stack === undefined;\n\t}\n\n\treturn errorMessages.has(error.message);\n}\n","import retry from 'retry';\nimport isNetworkError from 'is-network-error';\n\nexport class AbortError extends Error {\n\tconstructor(message) {\n\t\tsuper();\n\n\t\tif (message instanceof Error) {\n\t\t\tthis.originalError = message;\n\t\t\t({message} = message);\n\t\t} else {\n\t\t\tthis.originalError = new Error(message);\n\t\t\tthis.originalError.stack = this.stack;\n\t\t}\n\n\t\tthis.name = 'AbortError';\n\t\tthis.message = message;\n\t}\n}\n\nconst decorateErrorWithCounts = (error, attemptNumber, options) => {\n\t// Minus 1 from attemptNumber because the first attempt does not count as a retry\n\tconst retriesLeft = options.retries - (attemptNumber - 1);\n\n\terror.attemptNumber = attemptNumber;\n\terror.retriesLeft = retriesLeft;\n\treturn error;\n};\n\nexport default async function pRetry(input, options) {\n\treturn new Promise((resolve, reject) => {\n\t\toptions = {...options};\n\t\toptions.onFailedAttempt ??= () => {};\n\t\toptions.shouldRetry ??= () => true;\n\t\toptions.retries ??= 10;\n\n\t\tconst operation = retry.operation(options);\n\n\t\tconst abortHandler = () => {\n\t\t\toperation.stop();\n\t\t\treject(options.signal?.reason);\n\t\t};\n\n\t\tif (options.signal && !options.signal.aborted) {\n\t\t\toptions.signal.addEventListener('abort', abortHandler, {once: true});\n\t\t}\n\n\t\tconst cleanUp = () => {\n\t\t\toptions.signal?.removeEventListener('abort', abortHandler);\n\t\t\toperation.stop();\n\t\t};\n\n\t\toperation.attempt(async attemptNumber => {\n\t\t\ttry {\n\t\t\t\tconst result = await input(attemptNumber);\n\t\t\t\tcleanUp();\n\t\t\t\tresolve(result);\n\t\t\t} catch (error) {\n\t\t\t\ttry {\n\t\t\t\t\tif (!(error instanceof Error)) {\n\t\t\t\t\t\tthrow new TypeError(`Non-error was thrown: \"${error}\". You should only throw errors.`);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (error instanceof AbortError) {\n\t\t\t\t\t\tthrow error.originalError;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (error instanceof TypeError && !isNetworkError(error)) {\n\t\t\t\t\t\tthrow error;\n\t\t\t\t\t}\n\n\t\t\t\t\tdecorateErrorWithCounts(error, attemptNumber, options);\n\n\t\t\t\t\tif (!(await options.shouldRetry(error))) {\n\t\t\t\t\t\toperation.stop();\n\t\t\t\t\t\treject(error);\n\t\t\t\t\t}\n\n\t\t\t\t\tawait options.onFailedAttempt(error);\n\n\t\t\t\t\tif (!operation.retry(error)) {\n\t\t\t\t\t\tthrow operation.mainError();\n\t\t\t\t\t}\n\t\t\t\t} catch (finalError) {\n\t\t\t\t\tdecorateErrorWithCounts(finalError, attemptNumber, options);\n\t\t\t\t\tcleanUp();\n\t\t\t\t\treject(finalError);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t});\n}\n","import pRetry from 'p-retry';\nimport { proboLogger } from './utils';\nimport { inspect } from 'util';\nimport { cleanupInstructionElements } from './utils';\n\nexport interface Instruction {\n what_to_do: string;\n args: any;\n result: any;\n}\n\nexport interface CreateStepOptions {\n stepIdFromServer?: number | null; // Make optional and allow null\n scenarioName: string;\n stepPrompt: string;\n initial_screenshot_url: string;\n initial_html_content: string;\n use_cache: boolean;\n}\n\nexport interface StepMinimal {\n id: string;\n prompt: string;\n step_runner_state: string;\n status: string;\n action: string;\n action_value: string;\n element_css_selector: string;\n iframe_selector: string;\n}\n\n\nexport interface FindStepByPromptResult {\n step: StepMinimal;\n total_count: number;\n}\n\nexport class ApiError extends Error {\n constructor(\n public status: number,\n message: string,\n public data?: any\n ) {\n super(message);\n this.name = 'ApiError';\n \n // Remove stack trace for cleaner error messages\n this.stack = undefined;\n }\n\n toString() {\n return `${this.message} (Status: ${this.status})`;\n }\n}\n\nexport class ApiClient {\n constructor(\n private apiUrl: string,\n private token: string = 'b31793f81a1f58b8a153c86a5fdf4df0e5179c51', // Default to demo token\n private maxRetries: number = 3,\n private initialBackoff: number = 1000\n ) {}\n\n private async handleResponse(response: Response) {\n try {\n const data = await response.json();\n \n if (!response.ok) {\n switch (response.status) {\n case 401:\n throw new ApiError(401, 'Unauthorized - Invalid or missing authentication token');\n case 403:\n throw new ApiError(403, 'Forbidden - You do not have permission to perform this action');\n case 400:\n throw new ApiError(400, 'Bad Request', data);\n case 404:\n throw new ApiError(404, 'Not Found', data);\n case 500:\n throw new ApiError(500, 'Internal Server Error', data);\n default:\n throw new ApiError(response.status, `API Error: ${data.error || 'Unknown error'}`, data);\n }\n }\n \n return data;\n } catch (error: any) {\n // Only throw the original error if it's not a network error\n if (!error.message?.includes('fetch failed')) {\n throw error;\n }\n throw new ApiError(0, 'Network error: fetch failed');\n }\n }\n\n private getHeaders() {\n const headers: Record<string, string> = {\n 'Content-Type': 'application/json',\n };\n \n // Always include token in headers now that we have a default\n headers['Authorization'] = `Token ${this.token}`;\n \n return headers;\n }\n\n async createStep(options: CreateStepOptions): Promise<string> {\n proboLogger.debug('creating step ', options.stepPrompt);\n return pRetry(async () => {\n const response = await fetch(`${this.apiUrl}/step-runners/`, {\n method: 'POST',\n headers: this.getHeaders(),\n body: JSON.stringify({ \n step_id: options.stepIdFromServer,\n scenario_name: options.scenarioName,\n step_prompt: options.stepPrompt, \n initial_screenshot: options.initial_screenshot_url, \n initial_html_content: options.initial_html_content,\n use_cache: options.use_cache,\n }),\n });\n \n const data = await this.handleResponse(response);\n return data.step.id;\n }, {\n retries: this.maxRetries,\n minTimeout: this.initialBackoff,\n onFailedAttempt: error => {\n proboLogger.warn(`API call failed, attempt ${error.attemptNumber} of ${error.retriesLeft + error.attemptNumber}...`);\n }\n });\n }\n\n async resolveNextInstruction(stepId: string, instruction: Instruction | null, aiModel?: string) {\n proboLogger.debug(`resolving next instruction: ${instruction}`);\n return pRetry(async () => {\n proboLogger.debug(`API client: Resolving next instruction for step ${stepId}`);\n \n const cleanInstruction = cleanupInstructionElements(instruction);\n \n const response = await fetch(`${this.apiUrl}/step-runners/${stepId}/run/`, {\n method: 'POST',\n headers: this.getHeaders(),\n body: JSON.stringify({ \n executed_instruction: cleanInstruction,\n ai_model: aiModel \n }),\n });\n \n const data = await this.handleResponse(response);\n return data.instruction;\n }, {\n retries: this.maxRetries,\n minTimeout: this.initialBackoff,\n onFailedAttempt: error => {\n proboLogger.warn(`API call failed, attempt ${error.attemptNumber} of ${error.retriesLeft + error.attemptNumber}...`);\n }\n });\n }\n\n async uploadScreenshot(screenshot_bytes: Buffer): Promise<string> {\n return pRetry(async () => {\n const response = await fetch(`${this.apiUrl}/upload-screenshots/`, {\n method: 'POST',\n headers: {\n 'Authorization': `Token ${this.token}`\n },\n body: screenshot_bytes,\n });\n \n const data = await this.handleResponse(response);\n return data.screenshot_url;\n }, {\n retries: this.maxRetries,\n minTimeout: this.initialBackoff,\n onFailedAttempt: error => {\n proboLogger.warn(`API call failed, attempt ${error.attemptNumber} of ${error.retriesLeft + error.attemptNumber}...`);\n }\n });\n }\n\n async findStepByPrompt(prompt: string, scenarioName: string): Promise<FindStepByPromptResult | null> {\n proboLogger.debug(`Finding step by prompt: ${prompt} and scenario: ${scenarioName}`);\n return pRetry(async () => {\n const response = await fetch(`${this.apiUrl}/step-runners/find-step-by-prompt/`, {\n method: 'POST',\n headers: this.getHeaders(),\n body: JSON.stringify({\n prompt: prompt,\n scenario_name: scenarioName\n }),\n });\n \n try {\n const data = await this.handleResponse(response);\n return {\n step: data.step,\n total_count: data.total_count\n };\n } catch (error: any) {\n // If we get a 404, the step doesn't exist\n if (error instanceof ApiError && error.status === 404) {\n return null;\n }\n // For any other error, rethrow\n throw error;\n }\n }, {\n retries: this.maxRetries,\n minTimeout: this.initialBackoff,\n onFailedAttempt: error => {\n proboLogger.warn(`API call failed, attempt ${error.attemptNumber} of ${error.retriesLeft + error.attemptNumber}...`);\n }\n });\n }\n\n async resetStep(stepId: string) {\n return pRetry(async () => {\n const response = await fetch(`${this.apiUrl}/steps/${stepId}/reset/`, {\n method: 'POST',\n headers: this.getHeaders(),\n });\n const data = await this.handleResponse(response);\n return data;\n });\n }\n}\n","import type { Page } from 'playwright';\nimport { ElementTag } from '@probolabs/highlighter/src/constants';\nimport { executePlaywrightAction, PlaywrightAction, waitForMutationsToSettle, executeCachedPlaywrightAction, PlaywrightActionType } from './actions';\nimport { Highlighter, ElementTagType } from './highlight';\nimport { ApiClient, Instruction, FindStepByPromptResult } from './api-client';\nimport { proboLogger , ProboLogLevel } from './utils';\nimport pRetry, { FailedAttemptError } from 'p-retry';\n\n/**\n * Available AI models for LLM operations\n */\nexport enum AIModel {\n AZURE_GPT4 = \"AZURE_GPT4\",\n AZURE_GPT4_MINI = \"AZURE_GPT4_MINI\",\n GEMINI_1_5_FLASH = \"GEMINI_1_5_FLASH\",\n GEMINI_2_5_FLASH = \"GEMINI_2_5_FLASH\",\n GPT4 = \"GPT4\",\n GPT4_MINI = \"GPT4_MINI\",\n CLAUDE_3_5 = \"CLAUDE_3_5\",\n GROK_2 = \"GROK_2\",\n LLAMA_4_SCOUT = \"LLAMA_4_SCOUT\",\n DEEPSEEK_V3 = \"DEEPSEEK_V3\",\n DEFAULT_AI_MODEL = \"DEFAULT_AI_MODEL\"\n}\n\nexport const DEMO_TOKEN = 'b31793f81a1f58b8a153c86a5fdf4df0e5179c51';\nexport { ProboLogLevel };\ninterface ProboConfig {\n scenarioName: string;\n token: string;\n apiUrl: string;\n enableConsoleLogs?: boolean;\n debugLevel?: ProboLogLevel;\n aiModel?: AIModel;\n}\n\nexport interface RunStepOptions {\n useCache: boolean;\n stepIdFromServer: number | null | undefined;\n aiModel?: AIModel;\n}\n\nconst retryOptions = {\n retries: 3,\n minTimeout: 1000,\n onFailedAttempt: (error: FailedAttemptError) => {\n proboLogger.warn(\n `Page operation failed, attempt ${error.attemptNumber} of ${error.retriesLeft + error.attemptNumber}...`\n );\n }\n};\n\nexport class Probo {\n private highlighter: Highlighter;\n private apiClient: ApiClient;\n private readonly enableConsoleLogs: boolean; \n private readonly scenarioName: string;\n private readonly aiModel: AIModel;\n constructor({\n scenarioName,\n token,\n apiUrl,\n enableConsoleLogs = false,\n debugLevel = ProboLogLevel.LOG,\n aiModel = AIModel.DEFAULT_AI_MODEL\n }: ProboConfig) {\n this.highlighter = new Highlighter(enableConsoleLogs);\n this.apiClient = new ApiClient(apiUrl, token);\n this.enableConsoleLogs = enableConsoleLogs;\n this.scenarioName = scenarioName;\n this.aiModel = aiModel;\n proboLogger.setLogLevel(debugLevel);\n proboLogger.log(`Initializing: scenarioName: ${scenarioName}, apiUrl: ${apiUrl}, enableConsoleLogs: ${enableConsoleLogs}, debugLevel: ${debugLevel}, aiModel: ${aiModel}`);\n }\n\n public async runStep(\n page: Page, \n stepPrompt: string, \n options: RunStepOptions = { useCache: true, stepIdFromServer: undefined, aiModel: this.aiModel }\n ): Promise<boolean> {\n // Use the aiModel from options if provided, otherwise use the one from constructor\n const aiModelToUse = options.aiModel !== undefined ? options.aiModel : this.aiModel;\n \n proboLogger.log(`runStep: ${options.stepIdFromServer ? '#'+options.stepIdFromServer+' - ' : ''}${stepPrompt}, aiModel: ${aiModelToUse}, pageUrl: ${page.url()}`);\n this.setupConsoleLogs(page);\n \n // First check if the step exists in the database\n let stepId: string;\n \n if (options.useCache) {\n const isCachedStep = await this._handleCachedStep(page, stepPrompt);\n if (isCachedStep) {\n proboLogger.debug('performed cached step!');\n return true;\n }\n }\n \n proboLogger.debug(`Cache disabled or step not found, creating new step`);\n stepId = await this._handleStepCreation(page, stepPrompt, options.stepIdFromServer, options.useCache);\n proboLogger.debug('Step ID:', stepId);\n let instruction: Instruction | null = null;\n // Main execution loop\n while (true) {\n try {\n // Get next instruction from server\n const nextInstruction = await this.apiClient.resolveNextInstruction(stepId, instruction, aiModelToUse);\n proboLogger.debug('Next Instruction from server:', nextInstruction);\n\n // Exit conditions\n \n if (nextInstruction.what_to_do === 'do_nothing') {\n if (nextInstruction.args.success) {\n proboLogger.info(`Reasoning: ${nextInstruction.args.message}`)\n proboLogger.info('Step completed successfully');\n return nextInstruction.args.status;\n }\n else { \n throw new Error(nextInstruction.args.message)\n } \n }\n\n // Handle different instruction types\n switch (nextInstruction.what_to_do) {\n case 'highlight_candidate_elements':\n proboLogger.debug('Highlighting candidate elements:', nextInstruction.args.element_type);\n const highlighted_elements = await this.highlightElements(page, nextInstruction.args.element_type);\n proboLogger.debug(`Highlighted ${highlighted_elements.length} elements`);\n const candidate_elements_screenshot_url = await this.screenshot(page);\n // proboLogger.log('candidate_elements_screenshot_url:', candidate_elements_screenshot_url);\n const executed_instruction: Instruction = {\n what_to_do: 'highlight_candidate_elements',\n args: {\n element_type: nextInstruction.args.element_type\n },\n result: {\n highlighted_elements: highlighted_elements,\n candidate_elements_screenshot_url: candidate_elements_screenshot_url\n }\n }\n proboLogger.debug('Executed Instruction:', executed_instruction);\n instruction = executed_instruction;\n break;\n\n case 'perform_action':\n instruction = await this._handlePerformAction(page, nextInstruction);\n break;\n\n default:\n throw new Error(`Unknown instruction type: ${nextInstruction.what_to_do}`);\n }\n\n } catch (error: any) {\n proboLogger.error(error.message); \n throw Error(error.message); \n }\n }\n \n\n }\n \n private async _handleCachedStep(page: Page, stepPrompt: string): Promise<boolean> {\n proboLogger.debug(`Checking if step exists in database: ${stepPrompt}`);\n const result: FindStepByPromptResult | null = await this.apiClient.findStepByPrompt(stepPrompt, this.scenarioName);\n if (result) {\n proboLogger.log(`Found existing step with ID: ${result.step.id} going to perform action: ${result.step.action} with value: ${result.step.action_value}`);\n proboLogger.debug(`Step in the DB: #${result.step.id} status: ${result.step.status} action: ${result.step.action} action_value: ${result.step.action_value} locator: ${result.step.element_css_selector}`);\n if (result.step.status !== 'EXECUTED') {\n proboLogger.debug(`Step ${result.step.id} is not executed, returning false`);\n return false;\n }\n proboLogger.debug(`Step ${result.step.id} is in status executed, performing action directly with Playwright`);\n const element_css_selector = result.step.element_css_selector\n const iframe_selector = result.step.iframe_selector\n try {\n await executeCachedPlaywrightAction(page, result.step.action as PlaywrightActionType, result.step.action_value, iframe_selector, element_css_selector);\n } catch (error: any) {\n proboLogger.error(`Error executing action for step ${result.step.id} going to reset the step`);\n proboLogger.debug('Error details:', error);\n await this.apiClient.resetStep(result.step.id);\n return false;\n }\n return true\n } else {\n proboLogger.debug(`Step not found in database, continuing with the normal flow`);\n return false\n }\n\n }\n \n private async _handleStepCreation(\n page: Page, \n stepPrompt: string, \n stepIdFromServer: number | null | undefined, \n useCache: boolean\n ): Promise<string> {\n \n proboLogger.debug(`Taking initial screenshot from the page ${page.url()}`);\n // not sure if this is needed\n // await handlePotentialNavigation(page);\n await waitForMutationsToSettle(page);\n const initial_screenshot_url = await pRetry(() => this.screenshot(page), retryOptions);\n proboLogger.debug(`Taking initial html content from the page ${page.url()}`);\n const initial_html_content = await pRetry(async () => {\n try {\n return await page.content();\n } catch (error: any) {\n console.log('Error caught:', {\n name: error.name,\n message: error.message,\n code: error.code,\n constructor: error.constructor.name,\n prototype: Object.getPrototypeOf(error).constructor.name\n });\n throw error; // Re-throw to trigger retry\n }\n }, retryOptions);\n \n return await this.apiClient.createStep({\n stepIdFromServer,\n scenarioName: this.scenarioName,\n stepPrompt: stepPrompt,\n initial_screenshot_url,\n initial_html_content,\n use_cache: useCache\n });\n }\n\n\n private setupConsoleLogs(page: Page) {\n if (this.enableConsoleLogs) {\n page.on('console', msg => {\n const type = msg.type();\n const text = msg.text();\n proboLogger.log(`[Browser-${type}]: ${text}`);\n });\n }\n }\n\n public async highlightElements(page: Page, elementTag: ElementTagType) {\n return this.highlighter.highlightElements(page, elementTag);\n }\n\n public async unhighlightElements(page: Page) {\n return this.highlighter.unhighlightElements(page);\n }\n\n public async highlightElement(page: Page, element_css_selector: string, iframe_selector: string, element_index: string) {\n return this.highlighter.highlightElement(page, element_css_selector, iframe_selector, element_index);\n }\n\n public async screenshot(page: Page) { \n proboLogger.debug(`taking screenshot of current page: ${page.url()}`);\n // await page.evaluate(() => document.fonts?.ready.catch(() => {}));\n const screenshot_bytes = await page.screenshot({ fullPage: true, animations: 'disabled' });\n // make an api call to upload the screenshot to cloudinary\n proboLogger.debug('uploading image data to cloudinary');\n const screenshot_url = await this.apiClient.uploadScreenshot(screenshot_bytes);\n return screenshot_url;\n \n }\n\n private async _handlePerformAction(page: Page, nextInstruction: Instruction) {\n proboLogger.debug('Handling perform action:', nextInstruction);\n const action = nextInstruction.args.action;\n const value = nextInstruction.args.value;\n const element_css_selector = nextInstruction.args.element_css_selector;\n const iframe_selector = nextInstruction.args.iframe_selector;\n const element_index = nextInstruction.args.element_index;\n if(action !== PlaywrightAction.VISIT_URL) {\n await this.unhighlightElements(page);\n proboLogger.debug('Unhighlighted elements');\n await this.highlightElement(page, element_css_selector,iframe_selector, element_index);\n proboLogger.debug('Highlighted element');\n }\n const pre_action_screenshot_url = await this.screenshot(page);\n const step_status = await executePlaywrightAction(page, action, value, iframe_selector, element_css_selector); \n await this.unhighlightElements(page);\n proboLogger.debug('UnHighlighted element');\n await waitForMutationsToSettle(page);\n const post_action_screenshot_url = await this.screenshot(page);\n const post_html_content = await pRetry(async () => {\n try {\n return await page.content();\n } catch (error: any) {\n console.log('Error caught:', {\n name: error.name,\n message: error.message,\n code: error.code,\n constructor: error.constructor.name,\n prototype: Object.getPrototypeOf(error).constructor.name\n });\n throw error; // Re-throw to trigger retry\n }\n }, retryOptions);\n \n\n const executed_instruction: Instruction = {\n what_to_do: 'perform_action',\n args: {\n action: action,\n value: value,\n element_css_selector: element_css_selector,\n iframe_selector: iframe_selector\n },\n result: {\n pre_action_screenshot_url: pre_action_screenshot_url,\n post_action_screenshot_url: post_action_screenshot_url,\n post_html_content: post_html_content,\n validation_status: step_status ?? true\n }\n }\n return executed_instruction;\n }\n\n \n}\n\n// Re-export ElementTag for convenience\nexport { ElementTag };\n\n\n\n"],"names":["require$$0","retry"],"mappings":";AAAY,MAAC,UAAU,GAAG;AAC1B,EAAE,SAAS,EAAE,WAAW;AACxB,EAAE,QAAQ,EAAE,UAAU;AACtB,EAAE,UAAU,EAAE,YAAY;AAC1B,EAAE,uBAAuB,EAAE,yBAAyB;A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;;GAEG;AACH,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,oBAAoB,EAC5B,KAAK,EAAE,MAAM,EACb,eAAe,EAAE,MAAM,EACvB,oBAAoB,EAAE,MAAM,GAC3B,OAAO,CAAC,OAAO,CAAC,CA+GlB;AAED;;GAEG;AACH,wBAAsB,6BAA6B,CACjD,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,oBAAoB,EAC5B,KAAK,EAAE,MAAM,EACb,eAAe,EAAE,MAAM,EACvB,oBAAoB,EAAE,MAAM,GAC3B,OAAO,CAAC,OAAO,CAAC,CA8GlB;AAED,oBAAY,aAAa;IACvB,IAAI,SAAS;IACb,KAAK,UAAU;IACf,MAAM,WAAW;CAClB;AAED;;GAEG;AACH,wBAAsB,eAAe,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,aAAa,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CActH"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@probolabs/playwright",
3
- "version": "0.4.6",
3
+ "version": "0.4.8",
4
4
  "description": "Playwright utilities for testing and automation",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -22,7 +22,7 @@
22
22
  "license": "MIT",
23
23
  "dependencies": {
24
24
  "p-retry": "^6.2.1",
25
- "@probolabs/highlighter": "0.2.16"
25
+ "@probolabs/highlighter": "0.2.18"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@rollup/plugin-commonjs": "^28.0.2",