@eko-ai/eko 1.0.9 → 1.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (286) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +139 -139
  3. package/dist/core/eko.d.ts +3 -2
  4. package/dist/extension/script/bing.js +0 -0
  5. package/dist/extension/script/build_dom_tree.js +661 -661
  6. package/dist/extension/script/common.js +12 -4
  7. package/dist/extension/script/duckduckgo.js +0 -0
  8. package/dist/extension/script/google.js +0 -0
  9. package/dist/extension/tools/cancel_workflow.d.ts +9 -0
  10. package/dist/extension/utils.d.ts +1 -1
  11. package/dist/extension.cjs.js +117 -111
  12. package/dist/extension.esm.js +117 -111
  13. package/dist/extension_content_script.js +79 -61
  14. package/dist/fellou.cjs.js +18 -18
  15. package/dist/fellou.esm.js +18 -18
  16. package/dist/index.cjs.js +262 -172
  17. package/dist/index.esm.js +262 -172
  18. package/dist/jest.config.js +10 -0
  19. package/dist/jest.config.js.map +1 -0
  20. package/dist/models/workflow.d.ts +3 -1
  21. package/dist/nodejs.cjs.js +1651 -1633
  22. package/dist/nodejs.esm.js +1651 -1633
  23. package/dist/rollup.config.js +171 -0
  24. package/dist/rollup.config.js.map +1 -0
  25. package/dist/script.js +10 -0
  26. package/dist/script.js.map +1 -0
  27. package/dist/services/llm/deepseek-provider.d.ts +13 -0
  28. package/dist/services/llm/provider-factory.d.ts +4 -0
  29. package/dist/services/llm/siliconflow-provider.d.ts +13 -0
  30. package/dist/services/parser/workflow-parser.d.ts +2 -1
  31. package/dist/services/workflow/generator.d.ts +3 -2
  32. package/dist/src/core/eko.js +99 -0
  33. package/dist/src/core/eko.js.map +1 -0
  34. package/dist/src/core/tool-registry.js +51 -0
  35. package/dist/src/core/tool-registry.js.map +1 -0
  36. package/dist/src/extension/content/index.js +409 -0
  37. package/dist/src/extension/content/index.js.map +1 -0
  38. package/dist/src/extension/core.js +29 -0
  39. package/dist/src/extension/core.js.map +1 -0
  40. package/dist/src/extension/index.js +12 -0
  41. package/dist/src/extension/index.js.map +1 -0
  42. package/dist/src/extension/script/bing.js +25 -0
  43. package/dist/src/extension/script/bing.js.map +1 -0
  44. package/dist/src/extension/script/build_dom_tree.js +585 -0
  45. package/dist/src/extension/script/build_dom_tree.js.map +1 -0
  46. package/dist/src/extension/script/common.js +203 -0
  47. package/dist/src/extension/script/common.js.map +1 -0
  48. package/dist/src/extension/script/duckduckgo.js +25 -0
  49. package/dist/src/extension/script/duckduckgo.js.map +1 -0
  50. package/dist/src/extension/script/google.js +26 -0
  51. package/dist/src/extension/script/google.js.map +1 -0
  52. package/dist/src/extension/tools/browser.js +174 -0
  53. package/dist/src/extension/tools/browser.js.map +1 -0
  54. package/dist/src/extension/tools/browser_use.js +186 -0
  55. package/dist/src/extension/tools/browser_use.js.map +1 -0
  56. package/dist/src/extension/tools/element_click.js +123 -0
  57. package/dist/src/extension/tools/element_click.js.map +1 -0
  58. package/dist/src/extension/tools/export_file.js +93 -0
  59. package/dist/src/extension/tools/export_file.js.map +1 -0
  60. package/dist/src/extension/tools/extract_content.js +38 -0
  61. package/dist/src/extension/tools/extract_content.js.map +1 -0
  62. package/dist/src/extension/tools/find_element_position.js +125 -0
  63. package/dist/src/extension/tools/find_element_position.js.map +1 -0
  64. package/dist/src/extension/tools/html_script.js +219 -0
  65. package/dist/src/extension/tools/html_script.js.map +1 -0
  66. package/dist/src/extension/tools/index.js +12 -0
  67. package/dist/src/extension/tools/index.js.map +1 -0
  68. package/dist/src/extension/tools/open_url.js +68 -0
  69. package/dist/src/extension/tools/open_url.js.map +1 -0
  70. package/dist/src/extension/tools/request_login.js +87 -0
  71. package/dist/src/extension/tools/request_login.js.map +1 -0
  72. package/dist/src/extension/tools/screenshot.js +26 -0
  73. package/dist/src/extension/tools/screenshot.js.map +1 -0
  74. package/dist/src/extension/tools/tab_management.js +160 -0
  75. package/dist/src/extension/tools/tab_management.js.map +1 -0
  76. package/dist/src/extension/tools/web_search.js +281 -0
  77. package/dist/src/extension/tools/web_search.js.map +1 -0
  78. package/dist/src/extension/utils.js +244 -0
  79. package/dist/src/extension/utils.js.map +1 -0
  80. package/dist/src/fellou/computer.js +104 -0
  81. package/dist/src/fellou/computer.js.map +1 -0
  82. package/dist/src/fellou/index.js +7 -0
  83. package/dist/src/fellou/index.js.map +1 -0
  84. package/dist/src/fellou/tools/computer_use.js +111 -0
  85. package/dist/src/fellou/tools/computer_use.js.map +1 -0
  86. package/dist/src/index.js +9 -0
  87. package/dist/src/index.js.map +1 -0
  88. package/dist/src/models/action.js +364 -0
  89. package/dist/src/models/action.js.map +1 -0
  90. package/dist/src/models/workflow.js +120 -0
  91. package/dist/src/models/workflow.js.map +1 -0
  92. package/dist/src/nodejs/core.js +18 -0
  93. package/dist/src/nodejs/core.js.map +1 -0
  94. package/dist/src/nodejs/index.js +6 -0
  95. package/dist/src/nodejs/index.js.map +1 -0
  96. package/dist/src/nodejs/script/build_dom_tree.js +586 -0
  97. package/dist/src/nodejs/script/build_dom_tree.js.map +1 -0
  98. package/dist/src/nodejs/tools/browser_use.js +458 -0
  99. package/dist/src/nodejs/tools/browser_use.js.map +1 -0
  100. package/dist/src/nodejs/tools/command_execute.js +65 -0
  101. package/dist/src/nodejs/tools/command_execute.js.map +1 -0
  102. package/dist/src/nodejs/tools/file_read.js +45 -0
  103. package/dist/src/nodejs/tools/file_read.js.map +1 -0
  104. package/dist/src/nodejs/tools/file_write.js +95 -0
  105. package/dist/src/nodejs/tools/file_write.js.map +1 -0
  106. package/dist/src/nodejs/tools/index.js +5 -0
  107. package/dist/src/nodejs/tools/index.js.map +1 -0
  108. package/dist/src/schemas/workflow.schema.js +64 -0
  109. package/dist/src/schemas/workflow.schema.js.map +1 -0
  110. package/dist/src/services/llm/claude-provider.js +140 -0
  111. package/dist/src/services/llm/claude-provider.js.map +1 -0
  112. package/dist/src/services/llm/deepseek-provider.js +432 -0
  113. package/dist/src/services/llm/deepseek-provider.js.map +1 -0
  114. package/dist/src/services/llm/glm-provider.js +317 -0
  115. package/dist/src/services/llm/glm-provider.js.map +1 -0
  116. package/dist/src/services/llm/openai-provider copy.js +317 -0
  117. package/dist/src/services/llm/openai-provider copy.js.map +1 -0
  118. package/dist/src/services/llm/openai-provider.js +317 -0
  119. package/dist/src/services/llm/openai-provider.js.map +1 -0
  120. package/dist/src/services/parser/workflow-parser.js +208 -0
  121. package/dist/src/services/parser/workflow-parser.js.map +1 -0
  122. package/dist/src/services/workflow/generator.js +105 -0
  123. package/dist/src/services/workflow/generator.js.map +1 -0
  124. package/dist/src/services/workflow/templates.js +42 -0
  125. package/dist/src/services/workflow/templates.js.map +1 -0
  126. package/dist/src/types/action.types.js +2 -0
  127. package/dist/src/types/action.types.js.map +1 -0
  128. package/dist/src/types/eko.types.js +2 -0
  129. package/dist/src/types/eko.types.js.map +1 -0
  130. package/dist/src/types/index.js +6 -0
  131. package/dist/src/types/index.js.map +1 -0
  132. package/dist/src/types/llm.types.js +2 -0
  133. package/dist/src/types/llm.types.js.map +1 -0
  134. package/dist/src/types/parser.types.js +2 -0
  135. package/dist/src/types/parser.types.js.map +1 -0
  136. package/dist/src/types/tools.types.js +2 -0
  137. package/dist/src/types/tools.types.js.map +1 -0
  138. package/dist/src/types/workflow.types.js +3 -0
  139. package/dist/src/types/workflow.types.js.map +1 -0
  140. package/dist/src/web/core.js +18 -0
  141. package/dist/src/web/core.js.map +1 -0
  142. package/dist/src/web/index.js +9 -0
  143. package/dist/src/web/index.js.map +1 -0
  144. package/dist/src/web/script/build_dom_tree.js +584 -0
  145. package/dist/src/web/script/build_dom_tree.js.map +1 -0
  146. package/dist/src/web/tools/browser.js +249 -0
  147. package/dist/src/web/tools/browser.js.map +1 -0
  148. package/dist/src/web/tools/browser_use.js +176 -0
  149. package/dist/src/web/tools/browser_use.js.map +1 -0
  150. package/dist/src/web/tools/element_click.js +121 -0
  151. package/dist/src/web/tools/element_click.js.map +1 -0
  152. package/dist/src/web/tools/export_file.js +74 -0
  153. package/dist/src/web/tools/export_file.js.map +1 -0
  154. package/dist/src/web/tools/extract_content.js +24 -0
  155. package/dist/src/web/tools/extract_content.js.map +1 -0
  156. package/dist/src/web/tools/find_element_position.js +121 -0
  157. package/dist/src/web/tools/find_element_position.js.map +1 -0
  158. package/dist/src/web/tools/html_script.js +219 -0
  159. package/dist/src/web/tools/html_script.js.map +1 -0
  160. package/dist/src/web/tools/index.js +8 -0
  161. package/dist/src/web/tools/index.js.map +1 -0
  162. package/dist/src/web/tools/screenshot.js +24 -0
  163. package/dist/src/web/tools/screenshot.js.map +1 -0
  164. package/dist/test/integration/claude-provider.test.js +170 -0
  165. package/dist/test/integration/claude-provider.test.js.map +1 -0
  166. package/dist/test/integration/deepseek-provider.test.js +171 -0
  167. package/dist/test/integration/deepseek-provider.test.js.map +1 -0
  168. package/dist/test/integration/glm-provider.test.js +173 -0
  169. package/dist/test/integration/glm-provider.test.js.map +1 -0
  170. package/dist/test/integration/openai-provider.test copy.js +170 -0
  171. package/dist/test/integration/openai-provider.test copy.js.map +1 -0
  172. package/dist/test/integration/openai-provider.test.js +170 -0
  173. package/dist/test/integration/openai-provider.test.js.map +1 -0
  174. package/dist/test/integration/qwen-provider.js +170 -0
  175. package/dist/test/integration/qwen-provider.js.map +1 -0
  176. package/dist/test/integration/qwen-provider.test copy.js +170 -0
  177. package/dist/test/integration/qwen-provider.test copy.js.map +1 -0
  178. package/dist/test/integration/qwen-provider.test.js +170 -0
  179. package/dist/test/integration/qwen-provider.test.js.map +1 -0
  180. package/dist/test/integration/workflow.execution.test.js +152 -0
  181. package/dist/test/integration/workflow.execution.test.js.map +1 -0
  182. package/dist/test/integration/workflow.generation-and-execution.test.js +131 -0
  183. package/dist/test/integration/workflow.generation-and-execution.test.js.map +1 -0
  184. package/dist/test/integration/workflow.generator.test.js +207 -0
  185. package/dist/test/integration/workflow.generator.test.js.map +1 -0
  186. package/dist/test/unit/action.test.js +186 -0
  187. package/dist/test/unit/action.test.js.map +1 -0
  188. package/dist/test/unit/tool-registry.test.js +99 -0
  189. package/dist/test/unit/tool-registry.test.js.map +1 -0
  190. package/dist/test/unit/workflow-parser.test.js +189 -0
  191. package/dist/test/unit/workflow-parser.test.js.map +1 -0
  192. package/dist/test/unit/workflow.test.js +102 -0
  193. package/dist/test/unit/workflow.test.js.map +1 -0
  194. package/dist/types/action.types.d.ts +2 -0
  195. package/dist/types/eko.types.d.ts +4 -1
  196. package/dist/types/jest.config.d.ts +10 -0
  197. package/dist/types/llm.types.d.ts +0 -2
  198. package/dist/types/rollup.config.d.ts +16 -0
  199. package/dist/types/script.d.ts +1 -0
  200. package/dist/types/src/core/eko.d.ts +20 -0
  201. package/dist/types/src/core/tool-registry.d.ts +13 -0
  202. package/dist/types/src/extension/content/index.d.ts +16 -0
  203. package/dist/types/src/extension/core.d.ts +11 -0
  204. package/dist/types/src/extension/index.d.ts +7 -0
  205. package/dist/types/src/extension/script/bing.d.ts +0 -0
  206. package/dist/types/src/extension/script/build_dom_tree.d.ts +38 -0
  207. package/dist/types/src/extension/script/common.d.ts +0 -0
  208. package/dist/types/src/extension/script/duckduckgo.d.ts +0 -0
  209. package/dist/types/src/extension/script/google.d.ts +0 -0
  210. package/dist/types/src/extension/tools/browser.d.ts +22 -0
  211. package/dist/types/src/extension/tools/browser_use.d.ts +19 -0
  212. package/dist/types/src/extension/tools/element_click.d.ts +12 -0
  213. package/dist/types/src/extension/tools/export_file.d.ts +18 -0
  214. package/dist/types/src/extension/tools/extract_content.d.ts +18 -0
  215. package/dist/types/src/extension/tools/find_element_position.d.ts +12 -0
  216. package/dist/types/src/extension/tools/html_script.d.ts +10 -0
  217. package/dist/types/src/extension/tools/index.d.ts +11 -0
  218. package/dist/types/src/extension/tools/open_url.d.ts +18 -0
  219. package/dist/{extension/tools/form_autofill.d.ts → types/src/extension/tools/request_login.d.ts} +3 -4
  220. package/dist/types/src/extension/tools/screenshot.d.ts +18 -0
  221. package/dist/types/src/extension/tools/tab_management.d.ts +19 -0
  222. package/dist/types/src/extension/tools/web_search.d.ts +18 -0
  223. package/dist/types/src/extension/utils.d.ts +31 -0
  224. package/dist/types/src/fellou/computer.d.ts +20 -0
  225. package/dist/types/src/fellou/index.d.ts +6 -0
  226. package/dist/types/src/fellou/tools/computer_use.d.ts +18 -0
  227. package/dist/types/src/index.d.ts +8 -0
  228. package/dist/types/src/models/action.d.ts +22 -0
  229. package/dist/types/src/models/workflow.d.ts +16 -0
  230. package/dist/types/src/nodejs/core.d.ts +2 -0
  231. package/dist/types/src/nodejs/index.d.ts +3 -0
  232. package/dist/types/src/nodejs/script/build_dom_tree.d.ts +1 -0
  233. package/dist/types/src/nodejs/tools/browser_use.d.ts +28 -0
  234. package/dist/types/src/nodejs/tools/command_execute.d.ts +12 -0
  235. package/dist/types/src/nodejs/tools/file_read.d.ts +11 -0
  236. package/dist/types/src/nodejs/tools/file_write.d.ts +15 -0
  237. package/dist/types/src/nodejs/tools/index.d.ts +4 -0
  238. package/dist/types/src/schemas/workflow.schema.d.ts +88 -0
  239. package/dist/types/src/services/llm/claude-provider.d.ts +11 -0
  240. package/dist/types/src/services/llm/deepseek-provider.d.ts +15 -0
  241. package/dist/types/src/services/llm/glm-provider.d.ts +11 -0
  242. package/dist/types/src/services/llm/openai-provider copy.d.ts +11 -0
  243. package/dist/types/src/services/llm/openai-provider.d.ts +11 -0
  244. package/dist/types/src/services/parser/workflow-parser.d.ts +29 -0
  245. package/dist/types/src/services/workflow/generator.d.ts +13 -0
  246. package/dist/types/src/services/workflow/templates.d.ts +8 -0
  247. package/dist/types/src/types/action.types.d.ts +38 -0
  248. package/dist/types/src/types/eko.types.d.ts +21 -0
  249. package/dist/types/src/types/index.d.ts +5 -0
  250. package/dist/types/src/types/llm.types.d.ts +54 -0
  251. package/dist/types/src/types/parser.types.d.ts +9 -0
  252. package/dist/types/src/types/tools.types.d.ts +88 -0
  253. package/dist/types/src/types/workflow.types.d.ts +39 -0
  254. package/dist/types/src/web/core.d.ts +2 -0
  255. package/dist/types/src/web/index.d.ts +5 -0
  256. package/dist/types/src/web/script/build_dom_tree.d.ts +10 -0
  257. package/dist/types/src/web/tools/browser.d.ts +21 -0
  258. package/dist/types/src/web/tools/browser_use.d.ts +19 -0
  259. package/dist/types/src/web/tools/element_click.d.ts +12 -0
  260. package/dist/types/src/web/tools/export_file.d.ts +18 -0
  261. package/dist/types/src/web/tools/extract_content.d.ts +17 -0
  262. package/dist/types/src/web/tools/find_element_position.d.ts +12 -0
  263. package/dist/types/src/web/tools/html_script.d.ts +10 -0
  264. package/dist/types/src/web/tools/index.d.ts +7 -0
  265. package/dist/types/src/web/tools/screenshot.d.ts +18 -0
  266. package/dist/types/test/integration/claude-provider.test.d.ts +1 -0
  267. package/dist/types/test/integration/deepseek-provider.test.d.ts +1 -0
  268. package/dist/types/test/integration/glm-provider.test.d.ts +1 -0
  269. package/dist/types/test/integration/openai-provider.test copy.d.ts +1 -0
  270. package/dist/types/test/integration/openai-provider.test.d.ts +1 -0
  271. package/dist/types/test/integration/qwen-provider.d.ts +1 -0
  272. package/dist/types/test/integration/qwen-provider.test copy.d.ts +1 -0
  273. package/dist/types/test/integration/qwen-provider.test.d.ts +1 -0
  274. package/dist/types/test/integration/workflow.execution.test.d.ts +1 -0
  275. package/dist/types/test/integration/workflow.generation-and-execution.test.d.ts +1 -0
  276. package/dist/types/test/integration/workflow.generator.test.d.ts +1 -0
  277. package/dist/types/test/unit/action.test.d.ts +1 -0
  278. package/dist/types/test/unit/tool-registry.test.d.ts +1 -0
  279. package/dist/types/test/unit/workflow-parser.test.d.ts +1 -0
  280. package/dist/types/test/unit/workflow.test.d.ts +1 -0
  281. package/dist/universal_tools/human/text.d.ts +9 -0
  282. package/dist/web.cjs.js +128 -121
  283. package/dist/web.esm.js +128 -121
  284. package/package.json +106 -106
  285. package/dist/fellou/tools/index.d.ts +0 -2
  286. package/dist/types/framework.types.d.ts +0 -11
package/dist/web.esm.js CHANGED
@@ -397,11 +397,11 @@ function build_dom_tree(doHighlightElements) {
397
397
  // Check for click-related events on the element itself
398
398
  const listeners = getEventListeners(element);
399
399
  const hasClickListeners = listeners &&
400
- (((_a = listeners.click) === null || _a === void 0 ? void 0 : _a.length) > 0 ||
401
- ((_b = listeners.mousedown) === null || _b === void 0 ? void 0 : _b.length) > 0 ||
402
- ((_c = listeners.mouseup) === null || _c === void 0 ? void 0 : _c.length) > 0 ||
403
- ((_d = listeners.touchstart) === null || _d === void 0 ? void 0 : _d.length) > 0 ||
404
- ((_e = listeners.touchend) === null || _e === void 0 ? void 0 : _e.length) > 0);
400
+ (((_a = listeners.click) === null || _a === undefined ? undefined : _a.length) > 0 ||
401
+ ((_b = listeners.mousedown) === null || _b === undefined ? undefined : _b.length) > 0 ||
402
+ ((_c = listeners.mouseup) === null || _c === undefined ? undefined : _c.length) > 0 ||
403
+ ((_d = listeners.touchstart) === null || _d === undefined ? undefined : _d.length) > 0 ||
404
+ ((_e = listeners.touchend) === null || _e === undefined ? undefined : _e.length) > 0);
405
405
  // Check for ARIA properties that suggest interactivity
406
406
  const hasAriaProps = element.hasAttribute('aria-expanded') ||
407
407
  element.hasAttribute('aria-pressed') ||
@@ -488,7 +488,7 @@ function build_dom_tree(doHighlightElements) {
488
488
  rect.height !== 0 &&
489
489
  rect.top >= 0 &&
490
490
  rect.top <= window.innerHeight &&
491
- ((_a = textNode.parentElement) === null || _a === void 0 ? void 0 : _a.checkVisibility({
491
+ ((_a = textNode.parentElement) === null || _a === undefined ? undefined : _a.checkVisibility({
492
492
  checkOpacity: true,
493
493
  checkVisibilityCSS: true,
494
494
  })));
@@ -523,7 +523,7 @@ function build_dom_tree(doHighlightElements) {
523
523
  // Copy all attributes if the node is an element
524
524
  if (node.nodeType === Node.ELEMENT_NODE && node.attributes) {
525
525
  // Use getAttributeNames() instead of directly iterating attributes
526
- const attributeNames = ((_a = node.getAttributeNames) === null || _a === void 0 ? void 0 : _a.call(node)) || [];
526
+ const attributeNames = ((_a = node.getAttributeNames) === null || _a === undefined ? undefined : _a.call(node)) || [];
527
527
  for (const name of attributeNames) {
528
528
  nodeData.attributes[name] = node.getAttribute(name);
529
529
  }
@@ -663,7 +663,7 @@ function __generator(thisArg, body) {
663
663
  }
664
664
  op = body.call(thisArg, _);
665
665
  } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
666
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
666
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : undefined, done: true };
667
667
  }
668
668
  }
669
669
 
@@ -1043,7 +1043,7 @@ var LINE_BREAKS = HARD_LINE_BREAKS.concat(SPACE$1);
1043
1043
  var KOREAN_SYLLABLE_BLOCK = [JL, JV, JT, H2, H3];
1044
1044
  var HYPHEN = [HY, BA];
1045
1045
  var codePointsToCharacterClasses = function (codePoints, lineBreak) {
1046
- if (lineBreak === void 0) { lineBreak = 'strict'; }
1046
+ if (lineBreak === undefined) { lineBreak = 'strict'; }
1047
1047
  var types = [];
1048
1048
  var indices = [];
1049
1049
  var categories = [];
@@ -1388,7 +1388,7 @@ var Break = /** @class */ (function () {
1388
1388
  this.end = end;
1389
1389
  }
1390
1390
  Break.prototype.slice = function () {
1391
- return fromCodePoint$1.apply(void 0, this.codePoints.slice(this.start, this.end));
1391
+ return fromCodePoint$1.apply(undefined, this.codePoints.slice(this.start, this.end));
1392
1392
  };
1393
1393
  return Break;
1394
1394
  }());
@@ -1542,7 +1542,7 @@ var stringToNumber = function (codePoints) {
1542
1542
  while (isDigit(codePoints[c])) {
1543
1543
  integers.push(codePoints[c++]);
1544
1544
  }
1545
- var int = integers.length ? parseInt(fromCodePoint$1.apply(void 0, integers), 10) : 0;
1545
+ var int = integers.length ? parseInt(fromCodePoint$1.apply(undefined, integers), 10) : 0;
1546
1546
  if (codePoints[c] === FULL_STOP) {
1547
1547
  c++;
1548
1548
  }
@@ -1551,7 +1551,7 @@ var stringToNumber = function (codePoints) {
1551
1551
  fraction.push(codePoints[c++]);
1552
1552
  }
1553
1553
  var fracd = fraction.length;
1554
- var frac = fracd ? parseInt(fromCodePoint$1.apply(void 0, fraction), 10) : 0;
1554
+ var frac = fracd ? parseInt(fromCodePoint$1.apply(undefined, fraction), 10) : 0;
1555
1555
  if (codePoints[c] === E || codePoints[c] === e) {
1556
1556
  c++;
1557
1557
  }
@@ -1566,7 +1566,7 @@ var stringToNumber = function (codePoints) {
1566
1566
  while (isDigit(codePoints[c])) {
1567
1567
  exponent.push(codePoints[c++]);
1568
1568
  }
1569
- var exp = exponent.length ? parseInt(fromCodePoint$1.apply(void 0, exponent), 10) : 0;
1569
+ var exp = exponent.length ? parseInt(fromCodePoint$1.apply(undefined, exponent), 10) : 0;
1570
1570
  return sign * (int + frac * Math.pow(10, -fracd)) * Math.pow(10, expsign * exp);
1571
1571
  };
1572
1572
  var LEFT_PARENTHESIS_TOKEN = {
@@ -1812,11 +1812,11 @@ var Tokenizer = /** @class */ (function () {
1812
1812
  questionMarks = true;
1813
1813
  }
1814
1814
  if (questionMarks) {
1815
- var start_1 = parseInt(fromCodePoint$1.apply(void 0, digits.map(function (digit) { return (digit === QUESTION_MARK ? ZERO : digit); })), 16);
1816
- var end = parseInt(fromCodePoint$1.apply(void 0, digits.map(function (digit) { return (digit === QUESTION_MARK ? F : digit); })), 16);
1815
+ var start_1 = parseInt(fromCodePoint$1.apply(undefined, digits.map(function (digit) { return (digit === QUESTION_MARK ? ZERO : digit); })), 16);
1816
+ var end = parseInt(fromCodePoint$1.apply(undefined, digits.map(function (digit) { return (digit === QUESTION_MARK ? F : digit); })), 16);
1817
1817
  return { type: 30 /* UNICODE_RANGE_TOKEN */, start: start_1, end: end };
1818
1818
  }
1819
- var start = parseInt(fromCodePoint$1.apply(void 0, digits), 16);
1819
+ var start = parseInt(fromCodePoint$1.apply(undefined, digits), 16);
1820
1820
  if (this.peekCodePoint(0) === HYPHEN_MINUS && isHex(this.peekCodePoint(1))) {
1821
1821
  this.consumeCodePoint();
1822
1822
  codePoint = this.consumeCodePoint();
@@ -1825,7 +1825,7 @@ var Tokenizer = /** @class */ (function () {
1825
1825
  endDigits.push(codePoint);
1826
1826
  codePoint = this.consumeCodePoint();
1827
1827
  }
1828
- var end = parseInt(fromCodePoint$1.apply(void 0, endDigits), 16);
1828
+ var end = parseInt(fromCodePoint$1.apply(undefined, endDigits), 16);
1829
1829
  return { type: 30 /* UNICODE_RANGE_TOKEN */, start: start, end: end };
1830
1830
  }
1831
1831
  else {
@@ -1866,13 +1866,13 @@ var Tokenizer = /** @class */ (function () {
1866
1866
  while (true) {
1867
1867
  var codePoint = this.consumeCodePoint();
1868
1868
  if (codePoint === EOF || codePoint === RIGHT_PARENTHESIS) {
1869
- return { type: 22 /* URL_TOKEN */, value: fromCodePoint$1.apply(void 0, value) };
1869
+ return { type: 22 /* URL_TOKEN */, value: fromCodePoint$1.apply(undefined, value) };
1870
1870
  }
1871
1871
  else if (isWhiteSpace(codePoint)) {
1872
1872
  this.consumeWhiteSpace();
1873
1873
  if (this.peekCodePoint(0) === EOF || this.peekCodePoint(0) === RIGHT_PARENTHESIS) {
1874
1874
  this.consumeCodePoint();
1875
- return { type: 22 /* URL_TOKEN */, value: fromCodePoint$1.apply(void 0, value) };
1875
+ return { type: 22 /* URL_TOKEN */, value: fromCodePoint$1.apply(undefined, value) };
1876
1876
  }
1877
1877
  this.consumeBadUrlRemnants();
1878
1878
  return BAD_URL_TOKEN;
@@ -1919,7 +1919,7 @@ var Tokenizer = /** @class */ (function () {
1919
1919
  var value = '';
1920
1920
  while (count > 0) {
1921
1921
  var amount = Math.min(SLICE_STACK_SIZE, count);
1922
- value += fromCodePoint$1.apply(void 0, this._value.splice(0, amount));
1922
+ value += fromCodePoint$1.apply(undefined, this._value.splice(0, amount));
1923
1923
  count -= amount;
1924
1924
  }
1925
1925
  this._value.shift();
@@ -4250,8 +4250,8 @@ var CSSParsedDeclaration = /** @class */ (function () {
4250
4250
  this.paintOrder = parse(context, paintOrder, declaration.paintOrder);
4251
4251
  this.position = parse(context, position, declaration.position);
4252
4252
  this.textAlign = parse(context, textAlign, declaration.textAlign);
4253
- this.textDecorationColor = parse(context, textDecorationColor, (_a = declaration.textDecorationColor) !== null && _a !== void 0 ? _a : declaration.color);
4254
- this.textDecorationLine = parse(context, textDecorationLine, (_b = declaration.textDecorationLine) !== null && _b !== void 0 ? _b : declaration.textDecoration);
4253
+ this.textDecorationColor = parse(context, textDecorationColor, (_a = declaration.textDecorationColor) !== null && _a !== undefined ? _a : declaration.color);
4254
+ this.textDecorationLine = parse(context, textDecorationLine, (_b = declaration.textDecorationLine) !== null && _b !== undefined ? _b : declaration.textDecoration);
4255
4255
  this.textShadow = parse(context, textShadow, declaration.textShadow);
4256
4256
  this.textTransform = parse(context, textTransform, declaration.textTransform);
4257
4257
  this.transform = parse(context, transform$1, declaration.transform);
@@ -5020,7 +5020,7 @@ var createRange = function (node, offset, length) {
5020
5020
  var segmentGraphemes = function (value) {
5021
5021
  if (FEATURES.SUPPORT_NATIVE_TEXT_SEGMENTATION) {
5022
5022
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
5023
- var segmenter = new Intl.Segmenter(void 0, { granularity: 'grapheme' });
5023
+ var segmenter = new Intl.Segmenter(undefined, { granularity: 'grapheme' });
5024
5024
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
5025
5025
  return Array.from(segmenter.segment(value)).map(function (segment) { return segment.segment; });
5026
5026
  }
@@ -5029,7 +5029,7 @@ var segmentGraphemes = function (value) {
5029
5029
  var segmentWords = function (value, styles) {
5030
5030
  if (FEATURES.SUPPORT_NATIVE_TEXT_SEGMENTATION) {
5031
5031
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
5032
- var segmenter = new Intl.Segmenter(void 0, {
5032
+ var segmenter = new Intl.Segmenter(undefined, {
5033
5033
  granularity: 'word'
5034
5034
  });
5035
5035
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -5304,7 +5304,7 @@ var IFrameElementContainer = /** @class */ (function (_super) {
5304
5304
 
5305
5305
  var LIST_OWNERS = ['OL', 'UL', 'MENU'];
5306
5306
  var parseNodeTree = function (context, node, parent, root) {
5307
- for (var childNode = node.firstChild, nextNode = void 0; childNode; childNode = nextNode) {
5307
+ for (var childNode = node.firstChild, nextNode = undefined; childNode; childNode = nextNode) {
5308
5308
  nextNode = childNode.nextSibling;
5309
5309
  if (isTextNode(childNode) && childNode.data.trim().length > 0) {
5310
5310
  parent.textNodes.push(new TextContainer(context, childNode, parent.styles));
@@ -5630,7 +5630,7 @@ var createCounterStyleFromRange = function (value, codePointRangeStart, codePoin
5630
5630
  suffix));
5631
5631
  };
5632
5632
  var createCounterStyleFromSymbols = function (value, symbols, suffix) {
5633
- if (suffix === void 0) { suffix = '. '; }
5633
+ if (suffix === undefined) { suffix = '. '; }
5634
5634
  var codePointRangeLength = symbols.length;
5635
5635
  return (createCounterStyleWithSymbolResolver(Math.abs(value), codePointRangeLength, false, function (codePoint) { return symbols[Math.floor(codePoint % codePointRangeLength)]; }) + suffix);
5636
5636
  };
@@ -5803,7 +5803,7 @@ var DocumentCloner = /** @class */ (function () {
5803
5803
  /* Chrome doesn't detect relative background-images assigned in inline <style> sheets when fetched through getComputedStyle
5804
5804
  if window url is about:blank, we can assign the url to current by writing onto the document
5805
5805
  */
5806
- var iframeLoad = iframeLoader(iframe).then(function () { return __awaiter(_this, void 0, void 0, function () {
5806
+ var iframeLoad = iframeLoader(iframe).then(function () { return __awaiter(_this, undefined, undefined, function () {
5807
5807
  var onclone, referenceElement;
5808
5808
  return __generator(this, function (_a) {
5809
5809
  switch (_a.label) {
@@ -6303,7 +6303,7 @@ var Cache = /** @class */ (function () {
6303
6303
  return this._cache[src];
6304
6304
  };
6305
6305
  Cache.prototype.loadImage = function (key) {
6306
- return __awaiter(this, void 0, void 0, function () {
6306
+ return __awaiter(this, undefined, undefined, function () {
6307
6307
  var isSameOrigin, useCORS, useProxy, src;
6308
6308
  var _this = this;
6309
6309
  return __generator(this, function (_a) {
@@ -7241,7 +7241,7 @@ var CanvasRenderer = /** @class */ (function (_super) {
7241
7241
  this.ctx.restore();
7242
7242
  };
7243
7243
  CanvasRenderer.prototype.renderStack = function (stack) {
7244
- return __awaiter(this, void 0, void 0, function () {
7244
+ return __awaiter(this, undefined, undefined, function () {
7245
7245
  var styles;
7246
7246
  return __generator(this, function (_a) {
7247
7247
  switch (_a.label) {
@@ -7258,7 +7258,7 @@ var CanvasRenderer = /** @class */ (function (_super) {
7258
7258
  });
7259
7259
  };
7260
7260
  CanvasRenderer.prototype.renderNode = function (paint) {
7261
- return __awaiter(this, void 0, void 0, function () {
7261
+ return __awaiter(this, undefined, undefined, function () {
7262
7262
  return __generator(this, function (_a) {
7263
7263
  switch (_a.label) {
7264
7264
  case 0:
@@ -7306,7 +7306,7 @@ var CanvasRenderer = /** @class */ (function (_super) {
7306
7306
  ];
7307
7307
  };
7308
7308
  CanvasRenderer.prototype.renderTextNode = function (text, styles) {
7309
- return __awaiter(this, void 0, void 0, function () {
7309
+ return __awaiter(this, undefined, undefined, function () {
7310
7310
  var _a, font, fontFamily, fontSize, _b, baseline, middle, paintOrder;
7311
7311
  var _this = this;
7312
7312
  return __generator(this, function (_c) {
@@ -7392,7 +7392,7 @@ var CanvasRenderer = /** @class */ (function (_super) {
7392
7392
  }
7393
7393
  };
7394
7394
  CanvasRenderer.prototype.renderNodeContent = function (paint) {
7395
- return __awaiter(this, void 0, void 0, function () {
7395
+ return __awaiter(this, undefined, undefined, function () {
7396
7396
  var container, curves, styles, _i, _a, child, image, image, iframeRenderer, canvas, size, _b, fontFamily, fontSize, baseline, bounds, x, textBounds, img, image, url, fontFamily, bounds;
7397
7397
  return __generator(this, function (_c) {
7398
7398
  switch (_c.label) {
@@ -7527,7 +7527,7 @@ var CanvasRenderer = /** @class */ (function (_super) {
7527
7527
  if (!(container.styles.listStyleImage !== null)) return [3 /*break*/, 19];
7528
7528
  img = container.styles.listStyleImage;
7529
7529
  if (!(img.type === 0 /* URL */)) return [3 /*break*/, 18];
7530
- image = void 0;
7530
+ image = undefined;
7531
7531
  url = img.url;
7532
7532
  _c.label = 15;
7533
7533
  case 15:
@@ -7561,7 +7561,7 @@ var CanvasRenderer = /** @class */ (function (_super) {
7561
7561
  });
7562
7562
  };
7563
7563
  CanvasRenderer.prototype.renderStackContent = function (stack) {
7564
- return __awaiter(this, void 0, void 0, function () {
7564
+ return __awaiter(this, undefined, undefined, function () {
7565
7565
  var _i, _a, child, _b, _c, child, _d, _e, child, _f, _g, child, _h, _j, child, _k, _l, child, _m, _o, child;
7566
7566
  return __generator(this, function (_p) {
7567
7567
  switch (_p.label) {
@@ -7718,7 +7718,7 @@ var CanvasRenderer = /** @class */ (function (_super) {
7718
7718
  if (image.width === width && image.height === height) {
7719
7719
  return image;
7720
7720
  }
7721
- var ownerDocument = (_a = this.canvas.ownerDocument) !== null && _a !== void 0 ? _a : document;
7721
+ var ownerDocument = (_a = this.canvas.ownerDocument) !== null && _a !== undefined ? _a : document;
7722
7722
  var canvas = ownerDocument.createElement('canvas');
7723
7723
  canvas.width = Math.max(1, width);
7724
7724
  canvas.height = Math.max(1, height);
@@ -7727,7 +7727,7 @@ var CanvasRenderer = /** @class */ (function (_super) {
7727
7727
  return canvas;
7728
7728
  };
7729
7729
  CanvasRenderer.prototype.renderBackgroundImage = function (container) {
7730
- return __awaiter(this, void 0, void 0, function () {
7730
+ return __awaiter(this, undefined, undefined, function () {
7731
7731
  var index, _loop_1, this_1, _i, _a, backgroundImage;
7732
7732
  return __generator(this, function (_b) {
7733
7733
  switch (_b.label) {
@@ -7739,7 +7739,7 @@ var CanvasRenderer = /** @class */ (function (_super) {
7739
7739
  switch (_h.label) {
7740
7740
  case 0:
7741
7741
  if (!(backgroundImage.type === 0 /* URL */)) return [3 /*break*/, 5];
7742
- image = void 0;
7742
+ image = undefined;
7743
7743
  url = backgroundImage.url;
7744
7744
  _h.label = 1;
7745
7745
  case 1:
@@ -7842,7 +7842,7 @@ var CanvasRenderer = /** @class */ (function (_super) {
7842
7842
  });
7843
7843
  };
7844
7844
  CanvasRenderer.prototype.renderSolidBorder = function (color, side, curvePoints) {
7845
- return __awaiter(this, void 0, void 0, function () {
7845
+ return __awaiter(this, undefined, undefined, function () {
7846
7846
  return __generator(this, function (_a) {
7847
7847
  this.path(parsePathForBorder(curvePoints, side));
7848
7848
  this.ctx.fillStyle = asString(color);
@@ -7852,7 +7852,7 @@ var CanvasRenderer = /** @class */ (function (_super) {
7852
7852
  });
7853
7853
  };
7854
7854
  CanvasRenderer.prototype.renderDoubleBorder = function (color, width, side, curvePoints) {
7855
- return __awaiter(this, void 0, void 0, function () {
7855
+ return __awaiter(this, undefined, undefined, function () {
7856
7856
  var outerPaths, innerPaths;
7857
7857
  return __generator(this, function (_a) {
7858
7858
  switch (_a.label) {
@@ -7876,7 +7876,7 @@ var CanvasRenderer = /** @class */ (function (_super) {
7876
7876
  });
7877
7877
  };
7878
7878
  CanvasRenderer.prototype.renderNodeBackgroundAndBorders = function (paint) {
7879
- return __awaiter(this, void 0, void 0, function () {
7879
+ return __awaiter(this, undefined, undefined, function () {
7880
7880
  var styles, hasBackground, borders, backgroundPaintingArea, side, _i, borders_1, border;
7881
7881
  var _this = this;
7882
7882
  return __generator(this, function (_a) {
@@ -7972,7 +7972,7 @@ var CanvasRenderer = /** @class */ (function (_super) {
7972
7972
  });
7973
7973
  };
7974
7974
  CanvasRenderer.prototype.renderDashedDottedBorder = function (color, width, side, curvePoints, style) {
7975
- return __awaiter(this, void 0, void 0, function () {
7975
+ return __awaiter(this, undefined, undefined, function () {
7976
7976
  var strokePaths, boxPaths, startX, startY, endX, endY, length, dashLength, spaceLength, useLineDash, multiplier, numberOfDashes, minSpace, maxSpace, path1, path2, path1, path2;
7977
7977
  return __generator(this, function (_a) {
7978
7978
  this.ctx.save();
@@ -8076,7 +8076,7 @@ var CanvasRenderer = /** @class */ (function (_super) {
8076
8076
  });
8077
8077
  };
8078
8078
  CanvasRenderer.prototype.render = function (element) {
8079
- return __awaiter(this, void 0, void 0, function () {
8079
+ return __awaiter(this, undefined, undefined, function () {
8080
8080
  var stack;
8081
8081
  return __generator(this, function (_a) {
8082
8082
  switch (_a.label) {
@@ -8156,7 +8156,7 @@ var ForeignObjectRenderer = /** @class */ (function (_super) {
8156
8156
  return _this;
8157
8157
  }
8158
8158
  ForeignObjectRenderer.prototype.render = function (element) {
8159
- return __awaiter(this, void 0, void 0, function () {
8159
+ return __awaiter(this, undefined, undefined, function () {
8160
8160
  var svg, img;
8161
8161
  return __generator(this, function (_a) {
8162
8162
  switch (_a.label) {
@@ -8273,20 +8273,20 @@ var Context = /** @class */ (function () {
8273
8273
  this.windowBounds = windowBounds;
8274
8274
  this.instanceName = "#" + Context.instanceCount++;
8275
8275
  this.logger = new Logger({ id: this.instanceName, enabled: options.logging });
8276
- this.cache = (_a = options.cache) !== null && _a !== void 0 ? _a : new Cache(this, options);
8276
+ this.cache = (_a = options.cache) !== null && _a !== undefined ? _a : new Cache(this, options);
8277
8277
  }
8278
8278
  Context.instanceCount = 1;
8279
8279
  return Context;
8280
8280
  }());
8281
8281
 
8282
8282
  var html2canvas = function (element, options) {
8283
- if (options === void 0) { options = {}; }
8283
+ if (options === undefined) { options = {}; }
8284
8284
  return renderElement(element, options);
8285
8285
  };
8286
8286
  if (typeof window !== 'undefined') {
8287
8287
  CacheStorage.setContext(window);
8288
8288
  }
8289
- var renderElement = function (element, opts) { return __awaiter(void 0, void 0, void 0, function () {
8289
+ var renderElement = function (element, opts) { return __awaiter(undefined, undefined, undefined, function () {
8290
8290
  var ownerDocument, defaultView, resourceOptions, contextOptions, windowOptions, windowBounds, context, foreignObjectRendering, cloneOptions, documentCloner, clonedElement, container, _a, width, height, left, top, backgroundColor, renderOptions, canvas, renderer, root, renderer;
8291
8291
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
8292
8292
  return __generator(this, function (_u) {
@@ -8304,23 +8304,23 @@ var renderElement = function (element, opts) { return __awaiter(void 0, void 0,
8304
8304
  throw new Error("Document is not attached to a Window");
8305
8305
  }
8306
8306
  resourceOptions = {
8307
- allowTaint: (_b = opts.allowTaint) !== null && _b !== void 0 ? _b : false,
8308
- imageTimeout: (_c = opts.imageTimeout) !== null && _c !== void 0 ? _c : 15000,
8307
+ allowTaint: (_b = opts.allowTaint) !== null && _b !== undefined ? _b : false,
8308
+ imageTimeout: (_c = opts.imageTimeout) !== null && _c !== undefined ? _c : 15000,
8309
8309
  proxy: opts.proxy,
8310
- useCORS: (_d = opts.useCORS) !== null && _d !== void 0 ? _d : false
8310
+ useCORS: (_d = opts.useCORS) !== null && _d !== undefined ? _d : false
8311
8311
  };
8312
- contextOptions = __assign({ logging: (_e = opts.logging) !== null && _e !== void 0 ? _e : true, cache: opts.cache }, resourceOptions);
8312
+ contextOptions = __assign({ logging: (_e = opts.logging) !== null && _e !== undefined ? _e : true, cache: opts.cache }, resourceOptions);
8313
8313
  windowOptions = {
8314
- windowWidth: (_f = opts.windowWidth) !== null && _f !== void 0 ? _f : defaultView.innerWidth,
8315
- windowHeight: (_g = opts.windowHeight) !== null && _g !== void 0 ? _g : defaultView.innerHeight,
8316
- scrollX: (_h = opts.scrollX) !== null && _h !== void 0 ? _h : defaultView.pageXOffset,
8317
- scrollY: (_j = opts.scrollY) !== null && _j !== void 0 ? _j : defaultView.pageYOffset
8314
+ windowWidth: (_f = opts.windowWidth) !== null && _f !== undefined ? _f : defaultView.innerWidth,
8315
+ windowHeight: (_g = opts.windowHeight) !== null && _g !== undefined ? _g : defaultView.innerHeight,
8316
+ scrollX: (_h = opts.scrollX) !== null && _h !== undefined ? _h : defaultView.pageXOffset,
8317
+ scrollY: (_j = opts.scrollY) !== null && _j !== undefined ? _j : defaultView.pageYOffset
8318
8318
  };
8319
8319
  windowBounds = new Bounds(windowOptions.scrollX, windowOptions.scrollY, windowOptions.windowWidth, windowOptions.windowHeight);
8320
8320
  context = new Context(contextOptions, windowBounds);
8321
- foreignObjectRendering = (_k = opts.foreignObjectRendering) !== null && _k !== void 0 ? _k : false;
8321
+ foreignObjectRendering = (_k = opts.foreignObjectRendering) !== null && _k !== undefined ? _k : false;
8322
8322
  cloneOptions = {
8323
- allowTaint: (_l = opts.allowTaint) !== null && _l !== void 0 ? _l : false,
8323
+ allowTaint: (_l = opts.allowTaint) !== null && _l !== undefined ? _l : false,
8324
8324
  onclone: opts.onclone,
8325
8325
  ignoreElements: opts.ignoreElements,
8326
8326
  inlineImages: foreignObjectRendering,
@@ -8342,11 +8342,11 @@ var renderElement = function (element, opts) { return __awaiter(void 0, void 0,
8342
8342
  renderOptions = {
8343
8343
  canvas: opts.canvas,
8344
8344
  backgroundColor: backgroundColor,
8345
- scale: (_o = (_m = opts.scale) !== null && _m !== void 0 ? _m : defaultView.devicePixelRatio) !== null && _o !== void 0 ? _o : 1,
8346
- x: ((_p = opts.x) !== null && _p !== void 0 ? _p : 0) + left,
8347
- y: ((_q = opts.y) !== null && _q !== void 0 ? _q : 0) + top,
8348
- width: (_r = opts.width) !== null && _r !== void 0 ? _r : Math.ceil(width),
8349
- height: (_s = opts.height) !== null && _s !== void 0 ? _s : Math.ceil(height)
8345
+ scale: (_o = (_m = opts.scale) !== null && _m !== undefined ? _m : defaultView.devicePixelRatio) !== null && _o !== undefined ? _o : 1,
8346
+ x: ((_p = opts.x) !== null && _p !== undefined ? _p : 0) + left,
8347
+ y: ((_q = opts.y) !== null && _q !== undefined ? _q : 0) + top,
8348
+ width: (_r = opts.width) !== null && _r !== undefined ? _r : Math.ceil(width),
8349
+ height: (_s = opts.height) !== null && _s !== undefined ? _s : Math.ceil(height)
8350
8350
  };
8351
8351
  if (!foreignObjectRendering) return [3 /*break*/, 3];
8352
8352
  context.logger.debug("Document cloned, using foreign object rendering");
@@ -8369,7 +8369,7 @@ var renderElement = function (element, opts) { return __awaiter(void 0, void 0,
8369
8369
  canvas = _u.sent();
8370
8370
  _u.label = 5;
8371
8371
  case 5:
8372
- if ((_t = opts.removeContainer) !== null && _t !== void 0 ? _t : true) {
8372
+ if ((_t = opts.removeContainer) !== null && _t !== undefined ? _t : true) {
8373
8373
  if (!DocumentCloner.destroy(container)) {
8374
8374
  context.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore");
8375
8375
  }
@@ -8601,13 +8601,20 @@ function do_input(text, xpath, highlightIndex) {
8601
8601
  }
8602
8602
  input.focus && input.focus();
8603
8603
  if (!text) {
8604
- if (input.value == '') {
8605
- return true;
8604
+ if (input.value == undefined) {
8605
+ input.textContent = '';
8606
+ }
8607
+ else {
8608
+ input.value = '';
8606
8609
  }
8607
- input.value = '';
8608
8610
  }
8609
8611
  else {
8610
- input.value += text;
8612
+ if (input.value == undefined) {
8613
+ input.textContent += text;
8614
+ }
8615
+ else {
8616
+ input.value += text;
8617
+ }
8611
8618
  }
8612
8619
  let result = input.dispatchEvent(new Event('input', { bubbles: true }));
8613
8620
  if (enter) {
@@ -8672,35 +8679,35 @@ var browser = /*#__PURE__*/Object.freeze({
8672
8679
  class BrowserUse {
8673
8680
  constructor() {
8674
8681
  this.name = 'browser_use';
8675
- this.description = `Use structured commands to interact with the browser, manipulating page elements through screenshots and webpage element extraction.
8676
- * This is a browser GUI interface where you need to analyze webpages by taking screenshots and extracting page element structures, and specify action sequences to complete designated tasks.
8677
- * Before any operation, you must first call the \`screenshot_extract_element\` command, which will return the browser page screenshot and structured element information, both specially processed.
8678
- * ELEMENT INTERACTION:
8679
- - Only use indexes that exist in the provided element list
8680
- - Each element has a unique index number (e.g., "[33]:<button>")
8681
- - Elements marked with "[]:" are non-interactive (for context only)
8682
- * NAVIGATION & ERROR HANDLING:
8683
- - If no suitable elements exist, use other functions to complete the task
8684
- - If stuck, try alternative approaches
8685
- - Handle popups/cookies by accepting or closing them
8682
+ this.description = `Use structured commands to interact with the browser, manipulating page elements through screenshots and webpage element extraction.
8683
+ * This is a browser GUI interface where you need to analyze webpages by taking screenshots and extracting page element structures, and specify action sequences to complete designated tasks.
8684
+ * Before any operation, you must first call the \`screenshot_extract_element\` command, which will return the browser page screenshot and structured element information, both specially processed.
8685
+ * ELEMENT INTERACTION:
8686
+ - Only use indexes that exist in the provided element list
8687
+ - Each element has a unique index number (e.g., "[33]:<button>")
8688
+ - Elements marked with "[]:" are non-interactive (for context only)
8689
+ * NAVIGATION & ERROR HANDLING:
8690
+ - If no suitable elements exist, use other functions to complete the task
8691
+ - If stuck, try alternative approaches
8692
+ - Handle popups/cookies by accepting or closing them
8686
8693
  - Use scroll to find elements you are looking for`;
8687
8694
  this.input_schema = {
8688
8695
  type: 'object',
8689
8696
  properties: {
8690
8697
  action: {
8691
8698
  type: 'string',
8692
- description: `The action to perform. The available actions are:
8693
- * \`screenshot_extract_element\`: Take a screenshot of the web page and extract operable elements.
8694
- - Screenshots are used to understand page layouts, with labeled bounding boxes corresponding to element indexes. Each bounding box and its label share the same color, with labels typically positioned in the top-right corner of the box.
8695
- - Screenshots help verify element positions and relationships. Labels may sometimes overlap, so extracted elements are used to verify the correct elements.
8696
- - In addition to screenshots, simplified information about interactive elements is returned, with element indexes corresponding to those in the screenshots.
8697
- * \`input_text\`: Enter a string in the interactive element.
8698
- * \`click\`: Click to element.
8699
- * \`right_click\`: Right-click on the element.
8700
- * \`double_click\`: Double-click on the element.
8701
- * \`scroll_to\`: Scroll to the specified element.
8702
- * \`extract_content\`: Extract the text content of the current webpage.
8703
- * \`get_dropdown_options\`: Get all options from a native dropdown element.
8699
+ description: `The action to perform. The available actions are:
8700
+ * \`screenshot_extract_element\`: Take a screenshot of the web page and extract operable elements.
8701
+ - Screenshots are used to understand page layouts, with labeled bounding boxes corresponding to element indexes. Each bounding box and its label share the same color, with labels typically positioned in the top-right corner of the box.
8702
+ - Screenshots help verify element positions and relationships. Labels may sometimes overlap, so extracted elements are used to verify the correct elements.
8703
+ - In addition to screenshots, simplified information about interactive elements is returned, with element indexes corresponding to those in the screenshots.
8704
+ * \`input_text\`: Enter a string in the interactive element.
8705
+ * \`click\`: Click to element.
8706
+ * \`right_click\`: Right-click on the element.
8707
+ * \`double_click\`: Double-click on the element.
8708
+ * \`scroll_to\`: Scroll to the specified element.
8709
+ * \`extract_content\`: Extract the text content of the current webpage.
8710
+ * \`get_dropdown_options\`: Get all options from a native dropdown element.
8704
8711
  * \`select_dropdown_option\`: Select dropdown option for interactive element index by the text of the option you want to select.`,
8705
8712
  enum: [
8706
8713
  'screenshot_extract_element',
@@ -8829,7 +8836,7 @@ class BrowserUse {
8829
8836
  }
8830
8837
  }
8831
8838
  catch (e) {
8832
- return { success: false, error: e === null || e === void 0 ? void 0 : e.message };
8839
+ return { success: false, error: e === null || e === undefined ? undefined : e.message };
8833
8840
  }
8834
8841
  }
8835
8842
  destroy(context) {
@@ -8950,7 +8957,7 @@ function extractOperableElements() {
8950
8957
  return NodeFilter.FILTER_SKIP;
8951
8958
  }
8952
8959
  // text <= 100
8953
- const text = (_a = node.innerText) === null || _a === void 0 ? void 0 : _a.trim();
8960
+ const text = (_a = node.innerText) === null || _a === undefined ? undefined : _a.trim();
8954
8961
  if (isElementVisible(node) &&
8955
8962
  text &&
8956
8963
  text.length <= 100 &&
@@ -9055,21 +9062,21 @@ async function executeWithHtmlElement$1(context, task_prompt) {
9055
9062
  let messages = [
9056
9063
  {
9057
9064
  role: 'user',
9058
- content: `# Task
9059
- Determine the operation intent based on user input, find the element ID that the user needs to operate on in the webpage HTML, and if the element does not exist, do nothing.
9060
- Output JSON format, no explanation required.
9061
-
9062
- # User input
9063
- ${task_prompt}
9064
-
9065
- # Output example (when the element exists)
9066
- {"elementId": "1", "operationType": "click"}
9067
-
9068
- # Output example (when the element does not exist)
9069
- {"elementId": null, "operationType": "unknown"}
9070
-
9071
- # HTML
9072
- ${pseudoHtml}
9065
+ content: `# Task
9066
+ Determine the operation intent based on user input, find the element ID that the user needs to operate on in the webpage HTML, and if the element does not exist, do nothing.
9067
+ Output JSON format, no explanation required.
9068
+
9069
+ # User input
9070
+ ${task_prompt}
9071
+
9072
+ # Output example (when the element exists)
9073
+ {"elementId": "1", "operationType": "click"}
9074
+
9075
+ # Output example (when the element does not exist)
9076
+ {"elementId": null, "operationType": "unknown"}
9077
+
9078
+ # HTML
9079
+ ${pseudoHtml}
9073
9080
  `,
9074
9081
  },
9075
9082
  ];
@@ -9270,21 +9277,21 @@ async function executeWithHtmlElement(context, task_prompt) {
9270
9277
  let messages = [
9271
9278
  {
9272
9279
  role: 'user',
9273
- content: `# Task
9274
- Find the element ID that the user needs to operate on in the webpage HTML, and if the element does not exist, do nothing.
9275
- Output JSON format, no explanation required.
9276
-
9277
- # User input
9278
- ${task_prompt}
9279
-
9280
- # Output example (when the element exists)
9281
- {"elementId": "1"}
9282
-
9283
- # Output example (when the element does not exist)
9284
- {"elementId": null}
9285
-
9286
- # HTML
9287
- ${pseudoHtml}
9280
+ content: `# Task
9281
+ Find the element ID that the user needs to operate on in the webpage HTML, and if the element does not exist, do nothing.
9282
+ Output JSON format, no explanation required.
9283
+
9284
+ # User input
9285
+ ${task_prompt}
9286
+
9287
+ # Output example (when the element exists)
9288
+ {"elementId": "1"}
9289
+
9290
+ # Output example (when the element does not exist)
9291
+ {"elementId": null}
9292
+
9293
+ # HTML
9294
+ ${pseudoHtml}
9288
9295
  `,
9289
9296
  },
9290
9297
  ];