@heycys/gallery 0.1.2 → 0.2.1

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 (338) hide show
  1. package/THIRD-PARTY-NOTICES.md +2 -2
  2. package/browser/editor/components/align.mjs +58 -0
  3. package/browser/editor/components/code/index.mjs +1 -1
  4. package/browser/editor/components/embed/page.mjs +1 -1
  5. package/browser/editor/components/file/page.mjs +4 -4
  6. package/browser/editor/components/heading/index.mjs +7 -6
  7. package/browser/editor/components/icon/page.mjs +6 -4
  8. package/browser/editor/components/icons.mjs +5 -2
  9. package/browser/editor/components/image/index.mjs +2 -0
  10. package/browser/editor/components/image/page.mjs +172 -90
  11. package/browser/editor/components/installed/index.mjs +6 -2
  12. package/browser/editor/components/installed/page.mjs +80 -13
  13. package/browser/editor/components/media/icons.mjs +13 -8
  14. package/browser/editor/components/media/page.mjs +5 -3
  15. package/browser/editor/components/media/toolbar.mjs +12 -3
  16. package/browser/editor/components/paragraph/index.mjs +4 -3
  17. package/browser/editor/components/registry.mjs +17 -5
  18. package/browser/editor/components/table/index.mjs +4 -2
  19. package/browser/editor/page/after/index.mjs +288 -0
  20. package/browser/editor/page/align.mjs +91 -0
  21. package/browser/editor/page/beside.mjs +5 -6
  22. package/browser/editor/page/block-menu/index.mjs +6 -3
  23. package/browser/editor/page/blocks.mjs +3 -1
  24. package/browser/editor/page/board/hint.mjs +64 -27
  25. package/browser/editor/page/board/index.mjs +160 -71
  26. package/browser/editor/page/board/motion.mjs +177 -0
  27. package/browser/editor/page/board/settings.mjs +4 -3
  28. package/browser/editor/page/clipboard/import/read.mjs +20 -2
  29. package/browser/editor/page/clipboard/index.mjs +10 -3
  30. package/browser/editor/page/clipboard/own/blocks.mjs +3 -4
  31. package/browser/editor/page/clipboard/own/describe.mjs +6 -2
  32. package/browser/editor/page/commit.mjs +2 -2
  33. package/browser/editor/page/core.mjs +3 -1
  34. package/browser/editor/page/custom-page.mjs +15 -11
  35. package/browser/editor/page/editor.mjs +31 -14
  36. package/browser/editor/page/history.mjs +19 -4
  37. package/browser/editor/page/insert/index.mjs +20 -22
  38. package/browser/editor/page/menu.mjs +15 -7
  39. package/browser/editor/page/page-objects.mjs +3 -7
  40. package/browser/editor/page/present-links.mjs +5 -4
  41. package/browser/editor/page/present-shell.mjs +63 -0
  42. package/browser/editor/page/selection/index.mjs +10 -2
  43. package/browser/editor/page/table/binding.mjs +87 -0
  44. package/browser/editor/page/table/icons.mjs +0 -2
  45. package/browser/editor/page/table/index.mjs +10 -14
  46. package/browser/editor/page/table/views.mjs +5 -52
  47. package/browser/editor/page/table/widths.mjs +82 -10
  48. package/browser/editor/page/typing/index.mjs +44 -12
  49. package/browser/editor/page/typing/leave.mjs +19 -5
  50. package/browser/shared/block-packs.mjs +23 -8
  51. package/browser/shared/component-catalog.mjs +15 -8
  52. package/browser/shared/component-source.mjs +3 -1
  53. package/browser/shared/components/heading.mjs +2 -1
  54. package/browser/shared/components/installed.mjs +1 -1
  55. package/browser/shared/components/page.mjs +2 -0
  56. package/browser/shared/components/paragraph.mjs +8 -1
  57. package/browser/shared/components/table.mjs +1 -0
  58. package/browser/shared/document-copy.mjs +43 -0
  59. package/browser/shared/drafts.mjs +10 -3
  60. package/browser/shared/emoji/icon-value.mjs +2 -2
  61. package/browser/shared/emoji/line-icons.mjs +37 -0
  62. package/browser/shared/extensions.mjs +83 -7
  63. package/browser/shared/http.mjs +9 -0
  64. package/browser/shared/i18n/en.mjs +50 -17
  65. package/browser/shared/outline-shape.mjs +6 -0
  66. package/browser/shared/outline.mjs +165 -12
  67. package/browser/shared/pack-manifest.mjs +12 -1
  68. package/browser/shared/pages.mjs +169 -57
  69. package/browser/shared/pinyin.mjs +92 -0
  70. package/browser/shared/present-step.mjs +17 -0
  71. package/browser/shared/sidebar-head.mjs +70 -0
  72. package/browser/shared/web-links.mjs +5 -0
  73. package/browser/shared/workspace-columns.mjs +11 -7
  74. package/dist/{chunk-N7AZZLGT.mjs → chunk-2GKGEVMR.mjs} +29 -24
  75. package/dist/chunk-2OHANJ6Q.mjs +2 -0
  76. package/dist/{chunk-HYMEEXKN.mjs → chunk-2RKIHJI2.mjs} +1 -1
  77. package/dist/{chunk-742D2WWJ.mjs → chunk-36FIRJIF.mjs} +2 -2
  78. package/dist/{chunk-BPL64HGA.mjs → chunk-3A5I2GJK.mjs} +1 -1
  79. package/dist/{chunk-RFDZXFJF.mjs → chunk-3OFXMN6N.mjs} +1 -1
  80. package/dist/chunk-46ACXOU5.mjs +2 -0
  81. package/dist/{chunk-PUOQ65NC.mjs → chunk-4AMTKWDO.mjs} +1 -1
  82. package/dist/{chunk-VTKNEYT3.mjs → chunk-4DNHHJSL.mjs} +1 -1
  83. package/dist/chunk-5DPABPBI.mjs +2 -0
  84. package/dist/chunk-5IIH335D.mjs +3 -0
  85. package/dist/chunk-5L26JUYA.mjs +2 -0
  86. package/dist/{chunk-3NJACR4W.mjs → chunk-5MEXZ2UF.mjs} +1 -1
  87. package/dist/{chunk-ZHEHPMBK.mjs → chunk-6MPKCH3P.mjs} +1 -1
  88. package/dist/{chunk-C564NU2H.mjs → chunk-74RPP2M2.mjs} +1 -1
  89. package/dist/chunk-7M2BQQGZ.mjs +2 -0
  90. package/dist/{chunk-VXACTLO3.mjs → chunk-7M7UPWU6.mjs} +1 -1
  91. package/dist/{chunk-ZB4H7ZN4.mjs → chunk-7N2LPG33.mjs} +1 -1
  92. package/dist/{chunk-UBBRTJ2R.mjs → chunk-7XDYK3UC.mjs} +1 -1
  93. package/dist/chunk-AEMVZYZQ.mjs +166 -0
  94. package/dist/{chunk-POQSE4C2.mjs → chunk-AFGUR7SY.mjs} +1 -1
  95. package/dist/{chunk-QKXMPUXC.mjs → chunk-AMDGVDNV.mjs} +1 -1
  96. package/dist/{chunk-KTKHRC6H.mjs → chunk-ASAXY2DJ.mjs} +1 -1
  97. package/dist/{chunk-NVRNLK25.mjs → chunk-BYSF5UMM.mjs} +2 -2
  98. package/dist/{chunk-U3SSPL4K.mjs → chunk-CCSGFCLZ.mjs} +1 -1
  99. package/dist/{chunk-NWFBE2YA.mjs → chunk-CG3UHDKH.mjs} +1 -1
  100. package/dist/chunk-CPS4SRPF.mjs +5 -0
  101. package/dist/{chunk-B4P2CM2J.mjs → chunk-CZ5KJSGK.mjs} +1 -1
  102. package/dist/chunk-DAMVDXR3.mjs +2 -0
  103. package/dist/{chunk-NG375ILQ.mjs → chunk-DH6GMDNN.mjs} +1 -1
  104. package/dist/chunk-DHB7UZ7F.mjs +3 -0
  105. package/dist/{chunk-MHW7ZKOU.mjs → chunk-DKR7LFIY.mjs} +1 -1
  106. package/dist/chunk-DLFZJJEE.mjs +2 -0
  107. package/dist/{chunk-6EZ7FNIK.mjs → chunk-F4ZA6JRZ.mjs} +1 -1
  108. package/dist/{chunk-6VTU6KEO.mjs → chunk-FCK6NXON.mjs} +1 -1
  109. package/dist/{chunk-ZWPMCK7P.mjs → chunk-FX42XU6J.mjs} +1 -1
  110. package/dist/chunk-FXQBADMN.mjs +5 -0
  111. package/dist/{chunk-W3BGBJQW.mjs → chunk-G4YP7GVC.mjs} +1 -1
  112. package/dist/{chunk-V6XZ4VIR.mjs → chunk-GWOYMENX.mjs} +1 -1
  113. package/dist/chunk-HATA2W7X.mjs +2 -0
  114. package/dist/{chunk-YI43RG4P.mjs → chunk-HBAUKKQH.mjs} +1 -1
  115. package/dist/{chunk-MAFIGVXY.mjs → chunk-HM4E43VM.mjs} +1 -1
  116. package/dist/{chunk-CRJEG7MT.mjs → chunk-JI6T3A4Y.mjs} +1 -1
  117. package/dist/{chunk-NFMCP2HI.mjs → chunk-JJNRIFND.mjs} +2 -2
  118. package/dist/chunk-JL6R4FG4.mjs +4 -0
  119. package/dist/{chunk-UMHUSOPJ.mjs → chunk-JXLSHVJ2.mjs} +1 -1
  120. package/dist/{chunk-FJYN7RTH.mjs → chunk-KFZBYDIS.mjs} +1 -1
  121. package/dist/{chunk-ZTHICSSF.mjs → chunk-KH24LWAT.mjs} +1 -1
  122. package/dist/{chunk-RKPWLGZ3.mjs → chunk-KUILYI7H.mjs} +1 -1
  123. package/dist/{chunk-RMECZA2K.mjs → chunk-L7W624FD.mjs} +1 -1
  124. package/dist/chunk-LE44MD3O.mjs +4 -0
  125. package/dist/{chunk-4K5KC6V2.mjs → chunk-LV24RY2E.mjs} +1 -1
  126. package/dist/{chunk-43B75J5T.mjs → chunk-MKTX5PGV.mjs} +1 -1
  127. package/dist/{chunk-LKX55H76.mjs → chunk-NAGMRVW4.mjs} +1 -1
  128. package/dist/{chunk-D4CKRD3V.mjs → chunk-NFABH3QW.mjs} +2 -2
  129. package/dist/{chunk-PVER7LSC.mjs → chunk-NIW7F7LU.mjs} +2 -2
  130. package/dist/{chunk-PAREWQGB.mjs → chunk-NWRZXELO.mjs} +1 -1
  131. package/dist/{chunk-OJKMINIU.mjs → chunk-OU3S466R.mjs} +15 -15
  132. package/dist/{chunk-5ZJA7CXT.mjs → chunk-PAFSFVYB.mjs} +1 -1
  133. package/dist/chunk-QCEATQC4.mjs +2 -0
  134. package/dist/{chunk-Y34NR5JL.mjs → chunk-QJ3TFJLQ.mjs} +1 -1
  135. package/dist/{chunk-IA4PSIMD.mjs → chunk-QK3VISCA.mjs} +1 -1
  136. package/dist/{chunk-ZUNVAXLH.mjs → chunk-QXVNUASA.mjs} +1 -1
  137. package/dist/{chunk-GRAXKKG4.mjs → chunk-QZ35UAB4.mjs} +1 -1
  138. package/dist/{chunk-UGWYKHBL.mjs → chunk-S2Y7VI4H.mjs} +2 -2
  139. package/dist/{chunk-OW5NWPOJ.mjs → chunk-SAHS56QM.mjs} +1 -1
  140. package/dist/{chunk-QOUEFUCH.mjs → chunk-SOD23RGL.mjs} +1 -1
  141. package/dist/chunk-TDWJKOLN.mjs +2 -0
  142. package/dist/{chunk-V6RIYQZZ.mjs → chunk-TOE6DPLH.mjs} +1 -1
  143. package/dist/chunk-UGO5N3EI.mjs +15 -0
  144. package/dist/{chunk-Q47PLKIJ.mjs → chunk-UGWMMEJ5.mjs} +1 -1
  145. package/dist/{chunk-NWR2LT5B.mjs → chunk-V5JRSGZF.mjs} +1 -1
  146. package/dist/{chunk-BZ5RAF7L.mjs → chunk-VA3KAQZD.mjs} +1 -1
  147. package/dist/chunk-VG5JEIUQ.mjs +12 -0
  148. package/dist/{chunk-UNOYVIYR.mjs → chunk-VGTMLQWZ.mjs} +1 -1
  149. package/dist/chunk-VKSRM7EY.mjs +22 -0
  150. package/dist/{chunk-YQGT4AB2.mjs → chunk-VNUWREXU.mjs} +1 -1
  151. package/dist/{chunk-AGDILNWB.mjs → chunk-VPVOAJ7X.mjs} +1 -1
  152. package/dist/{chunk-HLYV7RIH.mjs → chunk-WCWYNFDF.mjs} +1 -1
  153. package/dist/chunk-WTEGUPFG.mjs +16 -0
  154. package/dist/{chunk-N76HWBA3.mjs → chunk-XKOHV4H6.mjs} +1 -1
  155. package/dist/{chunk-HMYTM3GT.mjs → chunk-XMKHCUI6.mjs} +1 -1
  156. package/dist/{chunk-OUUP3WKT.mjs → chunk-XQRUG4G3.mjs} +1 -1
  157. package/dist/{chunk-32ZUEFZ7.mjs → chunk-YBB5LWZK.mjs} +1 -1
  158. package/dist/{chunk-SX4LJYT6.mjs → chunk-YFJU3O7G.mjs} +1 -1
  159. package/dist/chunk-YPPJVDQI.mjs +2 -0
  160. package/dist/chunk-ZANMKAWS.mjs +2 -0
  161. package/dist/{chunk-6QBHU4DF.mjs → chunk-ZCP7BTOZ.mjs} +1 -1
  162. package/dist/{chunk-ERLAIBOA.mjs → chunk-ZEY2RLBT.mjs} +2 -2
  163. package/dist/{chunk-SQ6Y2ZMA.mjs → chunk-ZO7SFB2E.mjs} +2 -2
  164. package/dist/cli.mjs +1 -1
  165. package/dist/server.mjs +1 -1
  166. package/dist/worker.mjs +1 -1
  167. package/kit/board.css +5 -5
  168. package/kit/code.js +15 -15
  169. package/kit/math.js +1 -1
  170. package/kit/report.css +123 -44
  171. package/kit/runtime.js +45 -7
  172. package/kit/tables.js +2 -0
  173. package/kit/ui.js +2 -0
  174. package/package.json +1 -1
  175. package/packs/gallery/chart-view/kit.js +3 -3
  176. package/packs/gallery/chart-view/writing.md +1 -1
  177. package/packs/gallery/countdown/component.json +1 -1
  178. package/packs/gallery/countdown/kit.js +89 -29
  179. package/packs/gallery/countdown/preview.svg +1 -1
  180. package/packs/gallery/countdown/style.css +88 -100
  181. package/packs/gallery/countdown/writing.md +2 -2
  182. package/packs/gallery/habit/component.json +3 -3
  183. package/packs/gallery/habit/kit.js +114 -75
  184. package/packs/gallery/habit/preview.svg +1 -1
  185. package/packs/gallery/habit/style.css +133 -205
  186. package/packs/gallery/habit/writing.md +2 -2
  187. package/packs/gallery/heatmap/component.json +2 -2
  188. package/packs/gallery/heatmap/kit.js +335 -173
  189. package/packs/gallery/heatmap/preview.svg +1 -1
  190. package/packs/gallery/heatmap/style.css +158 -170
  191. package/packs/gallery/heatmap/writing.md +2 -2
  192. package/packs/gallery/kanban/kit.js +3 -3
  193. package/packs/gallery/kanban/writing.md +1 -1
  194. package/packs/gallery/metric/kit.js +3 -3
  195. package/packs/gallery/metric/writing.md +1 -1
  196. package/packs/gallery/note/component.json +3 -3
  197. package/packs/gallery/note/kit.js +40 -13
  198. package/packs/gallery/note/preview.svg +1 -1
  199. package/packs/gallery/note/style.css +51 -30
  200. package/packs/gallery/note/writing.md +2 -2
  201. package/packs/gallery/recent/component.json +2 -2
  202. package/packs/gallery/recent/kit.js +141 -86
  203. package/packs/gallery/recent/preview.svg +1 -1
  204. package/packs/gallery/recent/style.css +53 -126
  205. package/packs/gallery/recent/writing.md +2 -2
  206. package/packs/gallery/static/component.json +2 -2
  207. package/packs/gallery/static/preview.svg +1 -1
  208. package/packs/gallery/static/style.css +99 -66
  209. package/packs/gallery/static/writing.md +2 -2
  210. package/packs/gallery/stats/component.json +3 -3
  211. package/packs/gallery/stats/kit.js +253 -72
  212. package/packs/gallery/stats/preview.svg +1 -1
  213. package/packs/gallery/stats/style.css +64 -142
  214. package/packs/gallery/stats/writing.md +2 -2
  215. package/packs/gallery/today/component.json +2 -2
  216. package/packs/gallery/today/kit.js +62 -27
  217. package/packs/gallery/today/preview.svg +1 -1
  218. package/packs/gallery/today/style.css +101 -72
  219. package/packs/gallery/today/writing.md +2 -2
  220. package/packs/gallery/todos/component.json +1 -1
  221. package/packs/gallery/todos/kit.js +218 -71
  222. package/packs/gallery/todos/preview.svg +1 -1
  223. package/packs/gallery/todos/style.css +170 -223
  224. package/packs/gallery/todos/writing.md +1 -1
  225. package/packs/gallery/weather/component.json +2 -2
  226. package/packs/gallery/weather/kit.js +165 -90
  227. package/packs/gallery/weather/preview.svg +1 -1
  228. package/packs/gallery/weather/style.css +100 -218
  229. package/packs/gallery/weather/writing.md +1 -1
  230. package/packs/gallery-soft/countdown/component.json +18 -0
  231. package/packs/gallery-soft/countdown/example.html +3 -0
  232. package/packs/gallery-soft/countdown/kit.js +206 -0
  233. package/packs/gallery-soft/countdown/preview.svg +1 -0
  234. package/packs/gallery-soft/countdown/style.css +211 -0
  235. package/packs/gallery-soft/countdown/template.html +3 -0
  236. package/packs/gallery-soft/countdown/writing.md +24 -0
  237. package/packs/gallery-soft/habit/component.json +14 -0
  238. package/packs/gallery-soft/habit/example.html +3 -0
  239. package/packs/gallery-soft/habit/kit.js +366 -0
  240. package/packs/gallery-soft/habit/preview.svg +1 -0
  241. package/packs/gallery-soft/habit/style.css +251 -0
  242. package/packs/gallery-soft/habit/template.html +3 -0
  243. package/packs/gallery-soft/habit/writing.md +23 -0
  244. package/packs/gallery-soft/heatmap/component.json +18 -0
  245. package/packs/gallery-soft/heatmap/example.html +3 -0
  246. package/packs/gallery-soft/heatmap/kit.js +498 -0
  247. package/packs/gallery-soft/heatmap/preview.svg +1 -0
  248. package/packs/gallery-soft/heatmap/style.css +181 -0
  249. package/packs/gallery-soft/heatmap/template.html +3 -0
  250. package/packs/gallery-soft/heatmap/writing.md +23 -0
  251. package/packs/gallery-soft/note/component.json +14 -0
  252. package/packs/gallery-soft/note/example.html +3 -0
  253. package/packs/gallery-soft/note/kit.js +162 -0
  254. package/packs/gallery-soft/note/preview.svg +1 -0
  255. package/packs/gallery-soft/note/style.css +148 -0
  256. package/packs/gallery-soft/note/template.html +3 -0
  257. package/packs/gallery-soft/note/writing.md +20 -0
  258. package/packs/gallery-soft/recent/component.json +13 -0
  259. package/packs/gallery-soft/recent/example.html +1 -0
  260. package/packs/gallery-soft/recent/kit.js +335 -0
  261. package/packs/gallery-soft/recent/preview.svg +1 -0
  262. package/packs/gallery-soft/recent/style.css +160 -0
  263. package/packs/gallery-soft/recent/template.html +1 -0
  264. package/packs/gallery-soft/recent/writing.md +17 -0
  265. package/packs/gallery-soft/static/component.json +13 -0
  266. package/packs/gallery-soft/static/example.html +12 -0
  267. package/packs/gallery-soft/static/preview.svg +1 -0
  268. package/packs/gallery-soft/static/style.css +186 -0
  269. package/packs/gallery-soft/static/template.html +1 -0
  270. package/packs/gallery-soft/static/writing.md +20 -0
  271. package/packs/gallery-soft/stats/component.json +13 -0
  272. package/packs/gallery-soft/stats/example.html +1 -0
  273. package/packs/gallery-soft/stats/kit.js +341 -0
  274. package/packs/gallery-soft/stats/preview.svg +1 -0
  275. package/packs/gallery-soft/stats/style.css +119 -0
  276. package/packs/gallery-soft/stats/template.html +1 -0
  277. package/packs/gallery-soft/stats/writing.md +13 -0
  278. package/packs/gallery-soft/today/component.json +12 -0
  279. package/packs/gallery-soft/today/example.html +1 -0
  280. package/packs/gallery-soft/today/kit.js +222 -0
  281. package/packs/gallery-soft/today/preview.svg +1 -0
  282. package/packs/gallery-soft/today/style.css +178 -0
  283. package/packs/gallery-soft/today/template.html +1 -0
  284. package/packs/gallery-soft/today/writing.md +16 -0
  285. package/packs/gallery-soft/todos/component.json +19 -0
  286. package/packs/gallery-soft/todos/example.html +3 -0
  287. package/packs/gallery-soft/todos/kit.js +527 -0
  288. package/packs/gallery-soft/todos/preview.svg +1 -0
  289. package/packs/gallery-soft/todos/style.css +212 -0
  290. package/packs/gallery-soft/todos/template.html +3 -0
  291. package/packs/gallery-soft/todos/writing.md +32 -0
  292. package/packs/gallery-soft/weather/component.json +19 -0
  293. package/packs/gallery-soft/weather/example.html +3 -0
  294. package/packs/gallery-soft/weather/kit.js +411 -0
  295. package/packs/gallery-soft/weather/preview.svg +1 -0
  296. package/packs/gallery-soft/weather/style.css +185 -0
  297. package/packs/gallery-soft/weather/template.html +3 -0
  298. package/packs/gallery-soft/weather/writing.md +28 -0
  299. package/release.json +10 -10
  300. package/skill/SKILL.md +15 -14
  301. package/skill/references/building-blocks.md +4 -4
  302. package/skill/references/extensions.md +11 -7
  303. package/skill/references/pages-and-data.md +13 -9
  304. package/skill/references/writing-html.md +2 -0
  305. package/web/assets/index-BHC5ZOMh.js +15 -0
  306. package/web/assets/index-xP0uw3a0.css +1 -0
  307. package/web/index.html +2 -2
  308. package/dist/chunk-2NRBY6AJ.mjs +0 -2
  309. package/dist/chunk-35NQ4PLQ.mjs +0 -2
  310. package/dist/chunk-3KJHLHUO.mjs +0 -2
  311. package/dist/chunk-4AV456RQ.mjs +0 -2
  312. package/dist/chunk-5XYHDBJ5.mjs +0 -2
  313. package/dist/chunk-6A53MZYZ.mjs +0 -2
  314. package/dist/chunk-6EXH3ORZ.mjs +0 -166
  315. package/dist/chunk-BVEFGE4B.mjs +0 -2
  316. package/dist/chunk-D4EURAX4.mjs +0 -4
  317. package/dist/chunk-DQCE7TJY.mjs +0 -5
  318. package/dist/chunk-FWNRPMCJ.mjs +0 -12
  319. package/dist/chunk-FWW4CSAZ.mjs +0 -2
  320. package/dist/chunk-GY3FAUVM.mjs +0 -2
  321. package/dist/chunk-JVHHHGEA.mjs +0 -3
  322. package/dist/chunk-L7UP52JO.mjs +0 -2
  323. package/dist/chunk-NAMN3RAF.mjs +0 -2
  324. package/dist/chunk-PZDLJJTJ.mjs +0 -3
  325. package/dist/chunk-SXHBYZST.mjs +0 -16
  326. package/dist/chunk-TEZAWDSQ.mjs +0 -2
  327. package/dist/chunk-UFNYFFKO.mjs +0 -20
  328. package/dist/chunk-UKSHDZZ6.mjs +0 -2
  329. package/dist/chunk-VJPFVNNW.mjs +0 -15
  330. package/dist/chunk-VS3ZMVGX.mjs +0 -5
  331. package/web/assets/index-BK2e_07w.js +0 -13
  332. package/web/assets/index-CWFI83mF.css +0 -1
  333. /package/dist/{chunk-YEY3RSFQ.mjs → chunk-5MMN3N5J.mjs} +0 -0
  334. /package/dist/{chunk-UH4SIXTR.mjs → chunk-74UW7QSL.mjs} +0 -0
  335. /package/dist/{chunk-W7XHE4CT.mjs → chunk-EKGYYOSP.mjs} +0 -0
  336. /package/dist/{chunk-QAIHRH3I.mjs → chunk-KNZJT4ET.mjs} +0 -0
  337. /package/dist/{chunk-A55HN5OK.mjs → chunk-N3DSBH5S.mjs} +0 -0
  338. /package/dist/{chunk-QR6A54KJ.mjs → chunk-ZW2A6GBW.mjs} +0 -0
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __galleryRequire } from "node:module"; import { fileURLToPath as __galleryPath } from "node:url"; const require = __galleryRequire(import.meta.url); const __filename = __galleryPath(import.meta.url); const __dirname = __galleryPath(new URL(".", import.meta.url));
2
- import{a as rn}from"./chunk-YEY3RSFQ.mjs";import{a as Xi,b as ee,c as E,d as tn}from"./chunk-W7XHE4CT.mjs";import{a as Qi}from"./chunk-UH4SIXTR.mjs";Symbol.dispose??=Symbol("dispose");Symbol.asyncDispose??=Symbol("asyncDispose");var F=Symbol.dispose,q=Symbol.asyncDispose,Ji=class i{#e=!1;#t=[];get disposed(){return this.#e}dispose(){this[F]()}use(e){return e&&typeof e[F]=="function"&&this.#t.push(e),e}adopt(e,t){return this.#t.push({[F](){t(e)}}),e}defer(e){this.#t.push({[F](){e()}})}move(){if(this.#e)throw new ReferenceError("A disposed stack can not use anything new");let e=new i;return e.#t=this.#t,this.#t=[],this.#e=!0,e}[F](){if(this.#e)return;this.#e=!0;let e=[];for(let t of this.#t.reverse())try{t[F]()}catch(r){e.push(r)}if(e.length===1)throw e[0];if(e.length>1){let t=null;for(let r of e)t===null?t=r:t=new nr(r,t);throw t}}[Symbol.toStringTag]="DisposableStack"},G=globalThis.DisposableStack??Ji,Yi=class i{#e=!1;#t=[];get disposed(){return this.#e}async disposeAsync(){await this[q]()}use(e){if(e){let t=e[q],r=e[F];typeof t=="function"?this.#t.push(e):typeof r=="function"&&this.#t.push({[q]:async()=>{e[F]()}})}return e}adopt(e,t){return this.#t.push({[q](){return t(e)}}),e}defer(e){this.#t.push({[q](){return e()}})}move(){if(this.#e)throw new ReferenceError("A disposed stack can not use anything new");let e=new i;return e.#t=this.#t,this.#t=[],this.#e=!0,e}async[q](){if(this.#e)return;this.#e=!0;let e=[];for(let t of this.#t.reverse())try{await t[q]()}catch(r){e.push(r)}if(e.length===1)throw e[0];if(e.length>1){let t=null;for(let r of e)t===null?t=r:t=new nr(r,t);throw t}}[Symbol.toStringTag]="AsyncDisposableStack"},Pr=globalThis.AsyncDisposableStack??Yi,nr=class extends Error{#e;#t;constructor(e,t,r="An error was suppressed during disposal"){super(r),this.name="SuppressedError",this.#e=e,this.#t=t}get error(){return this.#e}get suppressed(){return this.#t}},bl=globalThis.SuppressedError??nr;function sn(i){return{all:i=i||new Map,on:function(e,t){var r=i.get(e);r?r.push(t):i.set(e,[t])},off:function(e,t){var r=i.get(e);r&&(t?r.splice(r.indexOf(t)>>>0,1):i.set(e,[]))},emit:function(e,t){var r=i.get(e);r&&r.slice().map(function(s){s(t)}),(r=i.get("*"))&&r.slice().map(function(s){s(e,t)})}}}var C=class{#e;#t=new Map;#r;constructor(e=sn(new Map),t){this.#e=e,this.#r=t}on(e,t){let r=this.#t.get(e);return r===void 0?this.#t.set(e,[t]):r.push(t),this.#e.on(e,t),this}off(e,t){let r=this.#t.get(e)??[];if(t===void 0){for(let n of r)this.#e.off(e,n);return this.#t.delete(e),this}let s=r.lastIndexOf(t);return s>-1&&this.#e.off(e,...r.splice(s,1)),this}emit(e,t){return this.#e.emit(e,t),this.listenerCount(e)>0}once(e,t){let r=s=>{t(s),this.off(e,r)};return this.on(e,r)}listenerCount(e){return this.#t.get(e)?.length||0}removeAllListeners(e){return e!==void 0?this.off(e):(this[F](),this)}[F](){this[q]().catch(e=>{this.#r?.(E.error)?.(e)})}async[q](){for(let[e,t]of this.#t)for(let r of t)this.#e.off(e,r);this.#t.clear()}};var P=(i,e)=>{if(!i)throw new Error(e)};var Ht=class extends Error{constructor(e,t){super(e,t),this.name=this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}},He=class extends Ht{},Et=class extends Ht{},Le=class extends Ht{#e;#t="";set code(e){this.#e=e}get code(){return this.#e}set originalMessage(e){this.#t=e}get originalMessage(){return this.#t}},at=class extends Ht{},ge=class extends Le{},_r=class extends Le{};var nn={letter:{cm:{width:21.59,height:27.94},in:{width:8.5,height:11}},legal:{cm:{width:21.59,height:35.56},in:{width:8.5,height:14}},tabloid:{cm:{width:27.94,height:43.18},in:{width:11,height:17}},ledger:{cm:{width:43.18,height:27.94},in:{width:17,height:11}},a0:{cm:{width:84.1,height:118.9},in:{width:33.1102,height:46.811}},a1:{cm:{width:59.4,height:84.1},in:{width:23.3858,height:33.1102}},a2:{cm:{width:42,height:59.4},in:{width:16.5354,height:23.3858}},a3:{cm:{width:29.7,height:42},in:{width:11.6929,height:16.5354}},a4:{cm:{width:21,height:29.7},in:{width:8.2677,height:11.6929}},a5:{cm:{width:14.8,height:21},in:{width:5.8268,height:8.2677}},a6:{cm:{width:10.5,height:14.8},in:{width:4.1339,height:5.8268}}};var rs=function(i,e){return rs=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=r[s])},rs(i,e)};function Xe(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");rs(i,e);function t(){this.constructor=i}i.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function ra(i,e,t,r){function s(n){return n instanceof t?n:new t(function(o){o(n)})}return new(t||(t=Promise))(function(n,o){function a(u){try{l(r.next(u))}catch(h){o(h)}}function c(u){try{l(r.throw(u))}catch(h){o(h)}}function l(u){u.done?n(u.value):s(u.value).then(a,c)}l((r=r.apply(i,e||[])).next())})}function dn(i,e){var t={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},r,s,n,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(u){return c([l,u])}}function c(l){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(t=0)),t;)try{if(r=1,s&&(n=l[0]&2?s.return:l[0]?s.throw||((n=s.return)&&n.call(s),0):s.next)&&!(n=n.call(s,l[1])).done)return n;switch(s=0,n&&(l=[l[0]&2,n.value]),l[0]){case 0:case 1:n=l;break;case 4:return t.label++,{value:l[1],done:!1};case 5:t.label++,s=l[1],l=[0];continue;case 7:l=t.ops.pop(),t.trys.pop();continue;default:if(n=t.trys,!(n=n.length>0&&n[n.length-1])&&(l[0]===6||l[0]===2)){t=0;continue}if(l[0]===3&&(!n||l[1]>n[0]&&l[1]<n[3])){t.label=l[1];break}if(l[0]===6&&t.label<n[1]){t.label=n[1],n=l;break}if(n&&t.label<n[2]){t.label=n[2],t.ops.push(l);break}n[2]&&t.ops.pop(),t.trys.pop();continue}l=e.call(i,t)}catch(u){l=[6,u],s=0}finally{r=n=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function $e(i){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&i[e],r=0;if(t)return t.call(i);if(i&&typeof i.length=="number")return{next:function(){return i&&r>=i.length&&(i=void 0),{value:i&&i[r++],done:!i}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ge(i,e){var t=typeof Symbol=="function"&&i[Symbol.iterator];if(!t)return i;var r=t.call(i),s,n=[],o;try{for(;(e===void 0||e-- >0)&&!(s=r.next()).done;)n.push(s.value)}catch(a){o={error:a}}finally{try{s&&!s.done&&(t=r.return)&&t.call(r)}finally{if(o)throw o.error}}return n}function ct(i,e,t){if(t||arguments.length===2)for(var r=0,s=e.length,n;r<s;r++)(n||!(r in e))&&(n||(n=Array.prototype.slice.call(e,0,r)),n[r]=e[r]);return i.concat(n||Array.prototype.slice.call(e))}function Wt(i){return this instanceof Wt?(this.v=i,this):new Wt(i)}function ia(i,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=t.apply(i,e||[]),s,n=[];return s=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),s[Symbol.asyncIterator]=function(){return this},s;function o(p){return function(w){return Promise.resolve(w).then(p,h)}}function a(p,w){r[p]&&(s[p]=function(y){return new Promise(function(b,T){n.push([p,y,b,T])>1||c(p,y)})},w&&(s[p]=w(s[p])))}function c(p,w){try{l(r[p](w))}catch(y){f(n[0][3],y)}}function l(p){p.value instanceof Wt?Promise.resolve(p.value.v).then(u,h):f(n[0][2],p)}function u(p){c("next",p)}function h(p){c("throw",p)}function f(p,w){p(w),n.shift(),n.length&&c(n[0][0],n[0][1])}}function sa(i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=i[Symbol.asyncIterator],t;return e?e.call(i):(i=typeof $e=="function"?$e(i):i[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=i[n]&&function(o){return new Promise(function(a,c){o=i[n](o),s(a,c,o.done,o.value)})}}function s(n,o,a,c){Promise.resolve(c).then(function(l){n({value:l,done:a})},o)}}function z(i){return typeof i=="function"}function is(i){var e=function(r){Error.call(r),r.stack=new Error().stack},t=i(e);return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var Zi=is(function(i){return function(t){i(this),this.message=t?t.length+` errors occurred during unsubscription:
2
+ import{a as rn}from"./chunk-5MMN3N5J.mjs";import{a as Xi,b as ee,c as E,d as tn}from"./chunk-EKGYYOSP.mjs";import{a as Qi}from"./chunk-74UW7QSL.mjs";Symbol.dispose??=Symbol("dispose");Symbol.asyncDispose??=Symbol("asyncDispose");var F=Symbol.dispose,q=Symbol.asyncDispose,Ji=class i{#e=!1;#t=[];get disposed(){return this.#e}dispose(){this[F]()}use(e){return e&&typeof e[F]=="function"&&this.#t.push(e),e}adopt(e,t){return this.#t.push({[F](){t(e)}}),e}defer(e){this.#t.push({[F](){e()}})}move(){if(this.#e)throw new ReferenceError("A disposed stack can not use anything new");let e=new i;return e.#t=this.#t,this.#t=[],this.#e=!0,e}[F](){if(this.#e)return;this.#e=!0;let e=[];for(let t of this.#t.reverse())try{t[F]()}catch(r){e.push(r)}if(e.length===1)throw e[0];if(e.length>1){let t=null;for(let r of e)t===null?t=r:t=new nr(r,t);throw t}}[Symbol.toStringTag]="DisposableStack"},G=globalThis.DisposableStack??Ji,Yi=class i{#e=!1;#t=[];get disposed(){return this.#e}async disposeAsync(){await this[q]()}use(e){if(e){let t=e[q],r=e[F];typeof t=="function"?this.#t.push(e):typeof r=="function"&&this.#t.push({[q]:async()=>{e[F]()}})}return e}adopt(e,t){return this.#t.push({[q](){return t(e)}}),e}defer(e){this.#t.push({[q](){return e()}})}move(){if(this.#e)throw new ReferenceError("A disposed stack can not use anything new");let e=new i;return e.#t=this.#t,this.#t=[],this.#e=!0,e}async[q](){if(this.#e)return;this.#e=!0;let e=[];for(let t of this.#t.reverse())try{await t[q]()}catch(r){e.push(r)}if(e.length===1)throw e[0];if(e.length>1){let t=null;for(let r of e)t===null?t=r:t=new nr(r,t);throw t}}[Symbol.toStringTag]="AsyncDisposableStack"},Pr=globalThis.AsyncDisposableStack??Yi,nr=class extends Error{#e;#t;constructor(e,t,r="An error was suppressed during disposal"){super(r),this.name="SuppressedError",this.#e=e,this.#t=t}get error(){return this.#e}get suppressed(){return this.#t}},bl=globalThis.SuppressedError??nr;function sn(i){return{all:i=i||new Map,on:function(e,t){var r=i.get(e);r?r.push(t):i.set(e,[t])},off:function(e,t){var r=i.get(e);r&&(t?r.splice(r.indexOf(t)>>>0,1):i.set(e,[]))},emit:function(e,t){var r=i.get(e);r&&r.slice().map(function(s){s(t)}),(r=i.get("*"))&&r.slice().map(function(s){s(e,t)})}}}var C=class{#e;#t=new Map;#r;constructor(e=sn(new Map),t){this.#e=e,this.#r=t}on(e,t){let r=this.#t.get(e);return r===void 0?this.#t.set(e,[t]):r.push(t),this.#e.on(e,t),this}off(e,t){let r=this.#t.get(e)??[];if(t===void 0){for(let n of r)this.#e.off(e,n);return this.#t.delete(e),this}let s=r.lastIndexOf(t);return s>-1&&this.#e.off(e,...r.splice(s,1)),this}emit(e,t){return this.#e.emit(e,t),this.listenerCount(e)>0}once(e,t){let r=s=>{t(s),this.off(e,r)};return this.on(e,r)}listenerCount(e){return this.#t.get(e)?.length||0}removeAllListeners(e){return e!==void 0?this.off(e):(this[F](),this)}[F](){this[q]().catch(e=>{this.#r?.(E.error)?.(e)})}async[q](){for(let[e,t]of this.#t)for(let r of t)this.#e.off(e,r);this.#t.clear()}};var P=(i,e)=>{if(!i)throw new Error(e)};var Ht=class extends Error{constructor(e,t){super(e,t),this.name=this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}},He=class extends Ht{},Et=class extends Ht{},Le=class extends Ht{#e;#t="";set code(e){this.#e=e}get code(){return this.#e}set originalMessage(e){this.#t=e}get originalMessage(){return this.#t}},at=class extends Ht{},ge=class extends Le{},_r=class extends Le{};var nn={letter:{cm:{width:21.59,height:27.94},in:{width:8.5,height:11}},legal:{cm:{width:21.59,height:35.56},in:{width:8.5,height:14}},tabloid:{cm:{width:27.94,height:43.18},in:{width:11,height:17}},ledger:{cm:{width:43.18,height:27.94},in:{width:17,height:11}},a0:{cm:{width:84.1,height:118.9},in:{width:33.1102,height:46.811}},a1:{cm:{width:59.4,height:84.1},in:{width:23.3858,height:33.1102}},a2:{cm:{width:42,height:59.4},in:{width:16.5354,height:23.3858}},a3:{cm:{width:29.7,height:42},in:{width:11.6929,height:16.5354}},a4:{cm:{width:21,height:29.7},in:{width:8.2677,height:11.6929}},a5:{cm:{width:14.8,height:21},in:{width:5.8268,height:8.2677}},a6:{cm:{width:10.5,height:14.8},in:{width:4.1339,height:5.8268}}};var rs=function(i,e){return rs=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=r[s])},rs(i,e)};function Xe(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");rs(i,e);function t(){this.constructor=i}i.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function ra(i,e,t,r){function s(n){return n instanceof t?n:new t(function(o){o(n)})}return new(t||(t=Promise))(function(n,o){function a(u){try{l(r.next(u))}catch(h){o(h)}}function c(u){try{l(r.throw(u))}catch(h){o(h)}}function l(u){u.done?n(u.value):s(u.value).then(a,c)}l((r=r.apply(i,e||[])).next())})}function dn(i,e){var t={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},r,s,n,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(u){return c([l,u])}}function c(l){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(t=0)),t;)try{if(r=1,s&&(n=l[0]&2?s.return:l[0]?s.throw||((n=s.return)&&n.call(s),0):s.next)&&!(n=n.call(s,l[1])).done)return n;switch(s=0,n&&(l=[l[0]&2,n.value]),l[0]){case 0:case 1:n=l;break;case 4:return t.label++,{value:l[1],done:!1};case 5:t.label++,s=l[1],l=[0];continue;case 7:l=t.ops.pop(),t.trys.pop();continue;default:if(n=t.trys,!(n=n.length>0&&n[n.length-1])&&(l[0]===6||l[0]===2)){t=0;continue}if(l[0]===3&&(!n||l[1]>n[0]&&l[1]<n[3])){t.label=l[1];break}if(l[0]===6&&t.label<n[1]){t.label=n[1],n=l;break}if(n&&t.label<n[2]){t.label=n[2],t.ops.push(l);break}n[2]&&t.ops.pop(),t.trys.pop();continue}l=e.call(i,t)}catch(u){l=[6,u],s=0}finally{r=n=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function $e(i){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&i[e],r=0;if(t)return t.call(i);if(i&&typeof i.length=="number")return{next:function(){return i&&r>=i.length&&(i=void 0),{value:i&&i[r++],done:!i}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ge(i,e){var t=typeof Symbol=="function"&&i[Symbol.iterator];if(!t)return i;var r=t.call(i),s,n=[],o;try{for(;(e===void 0||e-- >0)&&!(s=r.next()).done;)n.push(s.value)}catch(a){o={error:a}}finally{try{s&&!s.done&&(t=r.return)&&t.call(r)}finally{if(o)throw o.error}}return n}function ct(i,e,t){if(t||arguments.length===2)for(var r=0,s=e.length,n;r<s;r++)(n||!(r in e))&&(n||(n=Array.prototype.slice.call(e,0,r)),n[r]=e[r]);return i.concat(n||Array.prototype.slice.call(e))}function Wt(i){return this instanceof Wt?(this.v=i,this):new Wt(i)}function ia(i,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=t.apply(i,e||[]),s,n=[];return s=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),s[Symbol.asyncIterator]=function(){return this},s;function o(p){return function(w){return Promise.resolve(w).then(p,h)}}function a(p,w){r[p]&&(s[p]=function(y){return new Promise(function(b,T){n.push([p,y,b,T])>1||c(p,y)})},w&&(s[p]=w(s[p])))}function c(p,w){try{l(r[p](w))}catch(y){f(n[0][3],y)}}function l(p){p.value instanceof Wt?Promise.resolve(p.value.v).then(u,h):f(n[0][2],p)}function u(p){c("next",p)}function h(p){c("throw",p)}function f(p,w){p(w),n.shift(),n.length&&c(n[0][0],n[0][1])}}function sa(i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=i[Symbol.asyncIterator],t;return e?e.call(i):(i=typeof $e=="function"?$e(i):i[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=i[n]&&function(o){return new Promise(function(a,c){o=i[n](o),s(a,c,o.done,o.value)})}}function s(n,o,a,c){Promise.resolve(c).then(function(l){n({value:l,done:a})},o)}}function z(i){return typeof i=="function"}function is(i){var e=function(r){Error.call(r),r.stack=new Error().stack},t=i(e);return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var Zi=is(function(i){return function(t){i(this),this.message=t?t.length+` errors occurred during unsubscription:
3
3
  `+t.map(function(r,s){return s+1+") "+r.toString()}).join(`
4
4
  `):"",this.name="UnsubscriptionError",this.errors=t}});function or(i,e){if(i){var t=i.indexOf(e);0<=t&&i.splice(t,1)}}var lr=(function(){function i(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return i.prototype.unsubscribe=function(){var e,t,r,s,n;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=$e(o),c=a.next();!c.done;c=a.next()){var l=c.value;l.remove(this)}}catch(y){e={error:y}}finally{try{c&&!c.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}else o.remove(this);var u=this.initialTeardown;if(z(u))try{u()}catch(y){n=y instanceof Zi?y.errors:[y]}var h=this._finalizers;if(h){this._finalizers=null;try{for(var f=$e(h),p=f.next();!p.done;p=f.next()){var w=p.value;try{on(w)}catch(y){n=n??[],y instanceof Zi?n=ct(ct([],Ge(n)),Ge(y.errors)):n.push(y)}}}catch(y){r={error:y}}finally{try{p&&!p.done&&(s=f.return)&&s.call(f)}finally{if(r)throw r.error}}}if(n)throw new Zi(n)}},i.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)on(e);else{if(e instanceof i){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(t=this._finalizers)!==null&&t!==void 0?t:[]).push(e)}},i.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},i.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},i.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&or(t,e)},i.prototype.remove=function(e){var t=this._finalizers;t&&or(t,e),e instanceof i&&e._removeParent(this)},i.EMPTY=(function(){var e=new i;return e.closed=!0,e})(),i})(),fn=lr.EMPTY;function pn(i){return i instanceof lr||i&&"closed"in i&&z(i.remove)&&z(i.add)&&z(i.unsubscribe)}function on(i){z(i)?i():i.unsubscribe()}var Pt={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Ir={setTimeout:function(i,e){for(var t=[],r=2;r<arguments.length;r++)t[r-2]=arguments[r];var s=Ir.delegate;return s?.setTimeout?s.setTimeout.apply(s,ct([i,e],Ge(t))):setTimeout.apply(void 0,ct([i,e],Ge(t)))},clearTimeout:function(i){var e=Ir.delegate;return(e?.clearTimeout||clearTimeout)(i)},delegate:void 0};function mn(i){Ir.setTimeout(function(){var e=Pt.onUnhandledError;if(e)e(i);else throw i})}function Tt(){}var na=(function(){return ss("C",void 0,void 0)})();function oa(i){return ss("E",void 0,i)}function aa(i){return ss("N",i,void 0)}function ss(i,e,t){return{kind:i,value:e,error:t}}var kt=null;function xr(i){if(Pt.useDeprecatedSynchronousErrorHandling){var e=!kt;if(e&&(kt={errorThrown:!1,error:null}),i(),e){var t=kt,r=t.errorThrown,s=t.error;if(kt=null,r)throw s}}else i()}function ca(i){Pt.useDeprecatedSynchronousErrorHandling&&kt&&(kt.errorThrown=!0,kt.error=i)}var ns=(function(i){Xe(e,i);function e(t){var r=i.call(this)||this;return r.isStopped=!1,t?(r.destination=t,pn(t)&&t.add(r)):r.destination=da,r}return e.create=function(t,r,s){return new Ar(t,r,s)},e.prototype.next=function(t){this.isStopped?ts(aa(t),this):this._next(t)},e.prototype.error=function(t){this.isStopped?ts(oa(t),this):(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped?ts(na,this):(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,i.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e})(lr),la=Function.prototype.bind;function es(i,e){return la.call(i,e)}var ua=(function(){function i(e){this.partialObserver=e}return i.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(r){Mr(r)}},i.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(r){Mr(r)}else Mr(e)},i.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){Mr(t)}},i})(),Ar=(function(i){Xe(e,i);function e(t,r,s){var n=i.call(this)||this,o;if(z(t)||!t)o={next:t??void 0,error:r??void 0,complete:s??void 0};else{var a;n&&Pt.useDeprecatedNextContext?(a=Object.create(t),a.unsubscribe=function(){return n.unsubscribe()},o={next:t.next&&es(t.next,a),error:t.error&&es(t.error,a),complete:t.complete&&es(t.complete,a)}):o=t}return n.destination=new ua(o),n}return e})(ns);function Mr(i){Pt.useDeprecatedSynchronousErrorHandling?ca(i):mn(i)}function ha(i){throw i}function ts(i,e){var t=Pt.onStoppedNotification;t&&Ir.setTimeout(function(){return t(i,e)})}var da={closed:!0,next:Tt,error:ha,complete:Tt},os=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function Fe(i){return i}function gn(){for(var i=[],e=0;e<arguments.length;e++)i[e]=arguments[e];return wn(i)}function wn(i){return i.length===0?Fe:i.length===1?i[0]:function(t){return i.reduce(function(r,s){return s(r)},t)}}var ie=(function(){function i(e){e&&(this._subscribe=e)}return i.prototype.lift=function(e){var t=new i;return t.source=this,t.operator=e,t},i.prototype.subscribe=function(e,t,r){var s=this,n=pa(e)?e:new Ar(e,t,r);return xr(function(){var o=s,a=o.operator,c=o.source;n.add(a?a.call(n,c):c?s._subscribe(n):s._trySubscribe(n))}),n},i.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},i.prototype.forEach=function(e,t){var r=this;return t=an(t),new t(function(s,n){var o=new Ar({next:function(a){try{e(a)}catch(c){n(c),o.unsubscribe()}},error:n,complete:s});r.subscribe(o)})},i.prototype._subscribe=function(e){var t;return(t=this.source)===null||t===void 0?void 0:t.subscribe(e)},i.prototype[os]=function(){return this},i.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return wn(e)(this)},i.prototype.toPromise=function(e){var t=this;return e=an(e),new e(function(r,s){var n;t.subscribe(function(o){return n=o},function(o){return s(o)},function(){return r(n)})})},i.create=function(e){return new i(e)},i})();function an(i){var e;return(e=i??Pt.Promise)!==null&&e!==void 0?e:Promise}function fa(i){return i&&z(i.next)&&z(i.error)&&z(i.complete)}function pa(i){return i&&i instanceof ns||fa(i)&&pn(i)}function ma(i){return z(i?.lift)}function ue(i){return function(e){if(ma(e))return e.lift(function(t){try{return i(t,this)}catch(r){this.error(r)}});throw new TypeError("Unable to lift unknown Observable type")}}function se(i,e,t,r,s){return new ga(i,e,t,r,s)}var ga=(function(i){Xe(e,i);function e(t,r,s,n,o,a){var c=i.call(this,t)||this;return c.onFinalize=o,c.shouldUnsubscribe=a,c._next=r?function(l){try{r(l)}catch(u){t.error(u)}}:i.prototype._next,c._error=n?function(l){try{n(l)}catch(u){t.error(u)}finally{this.unsubscribe()}}:i.prototype._error,c._complete=s?function(){try{s()}catch(l){t.error(l)}finally{this.unsubscribe()}}:i.prototype._complete,c}return e.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;i.prototype.unsubscribe.call(this),!r&&((t=this.onFinalize)===null||t===void 0||t.call(this))}},e})(ns),wa=is(function(i){return function(){i(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),yn=(function(i){Xe(e,i);function e(){var t=i.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return e.prototype.lift=function(t){var r=new cn(this,this);return r.operator=t,r},e.prototype._throwIfClosed=function(){if(this.closed)throw new wa},e.prototype.next=function(t){var r=this;xr(function(){var s,n;if(r._throwIfClosed(),!r.isStopped){r.currentObservers||(r.currentObservers=Array.from(r.observers));try{for(var o=$e(r.currentObservers),a=o.next();!a.done;a=o.next()){var c=a.value;c.next(t)}}catch(l){s={error:l}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(s)throw s.error}}}})},e.prototype.error=function(t){var r=this;xr(function(){if(r._throwIfClosed(),!r.isStopped){r.hasError=r.isStopped=!0,r.thrownError=t;for(var s=r.observers;s.length;)s.shift().error(t)}})},e.prototype.complete=function(){var t=this;xr(function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var r=t.observers;r.length;)r.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return((t=this.observers)===null||t===void 0?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(t){return this._throwIfClosed(),i.prototype._trySubscribe.call(this,t)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var r=this,s=this,n=s.hasError,o=s.isStopped,a=s.observers;return n||o?fn:(this.currentObservers=null,a.push(t),new lr(function(){r.currentObservers=null,or(a,t)}))},e.prototype._checkFinalizedStatuses=function(t){var r=this,s=r.hasError,n=r.thrownError,o=r.isStopped;s?t.error(n):o&&t.complete()},e.prototype.asObservable=function(){var t=new ie;return t.source=this,t},e.create=function(t,r){return new cn(t,r)},e})(ie),cn=(function(i){Xe(e,i);function e(t,r){var s=i.call(this)||this;return s.destination=t,s.source=r,s}return e.prototype.next=function(t){var r,s;(s=(r=this.destination)===null||r===void 0?void 0:r.next)===null||s===void 0||s.call(r,t)},e.prototype.error=function(t){var r,s;(s=(r=this.destination)===null||r===void 0?void 0:r.error)===null||s===void 0||s.call(r,t)},e.prototype.complete=function(){var t,r;(r=(t=this.destination)===null||t===void 0?void 0:t.complete)===null||r===void 0||r.call(t)},e.prototype._subscribe=function(t){var r,s;return(s=(r=this.source)===null||r===void 0?void 0:r.subscribe(t))!==null&&s!==void 0?s:fn},e})(yn),as={now:function(){return(as.delegate||Date).now()},delegate:void 0},vn=(function(i){Xe(e,i);function e(t,r,s){t===void 0&&(t=1/0),r===void 0&&(r=1/0),s===void 0&&(s=as);var n=i.call(this)||this;return n._bufferSize=t,n._windowTime=r,n._timestampProvider=s,n._buffer=[],n._infiniteTimeWindow=!0,n._infiniteTimeWindow=r===1/0,n._bufferSize=Math.max(1,t),n._windowTime=Math.max(1,r),n}return e.prototype.next=function(t){var r=this,s=r.isStopped,n=r._buffer,o=r._infiniteTimeWindow,a=r._timestampProvider,c=r._windowTime;s||(n.push(t),!o&&n.push(a.now()+c)),this._trimBuffer(),i.prototype.next.call(this,t)},e.prototype._subscribe=function(t){this._throwIfClosed(),this._trimBuffer();for(var r=this._innerSubscribe(t),s=this,n=s._infiniteTimeWindow,o=s._buffer,a=o.slice(),c=0;c<a.length&&!t.closed;c+=n?1:2)t.next(a[c]);return this._checkFinalizedStatuses(t),r},e.prototype._trimBuffer=function(){var t=this,r=t._bufferSize,s=t._timestampProvider,n=t._buffer,o=t._infiniteTimeWindow,a=(o?1:2)*r;if(r<1/0&&a<n.length&&n.splice(0,n.length-a),!o){for(var c=s.now(),l=0,u=1;u<n.length&&n[u]<=c;u+=2)l=u;l&&n.splice(0,l+1)}},e})(yn),ya=(function(i){Xe(e,i);function e(t,r){return i.call(this)||this}return e.prototype.schedule=function(t,r){return r===void 0&&(r=0),this},e})(lr),Cr={setInterval:function(i,e){for(var t=[],r=2;r<arguments.length;r++)t[r-2]=arguments[r];var s=Cr.delegate;return s?.setInterval?s.setInterval.apply(s,ct([i,e],Ge(t))):setInterval.apply(void 0,ct([i,e],Ge(t)))},clearInterval:function(i){var e=Cr.delegate;return(e?.clearInterval||clearInterval)(i)},delegate:void 0},va=(function(i){Xe(e,i);function e(t,r){var s=i.call(this,t,r)||this;return s.scheduler=t,s.work=r,s.pending=!1,s}return e.prototype.schedule=function(t,r){var s;if(r===void 0&&(r=0),this.closed)return this;this.state=t;var n=this.id,o=this.scheduler;return n!=null&&(this.id=this.recycleAsyncId(o,n,r)),this.pending=!0,this.delay=r,this.id=(s=this.id)!==null&&s!==void 0?s:this.requestAsyncId(o,this.id,r),this},e.prototype.requestAsyncId=function(t,r,s){return s===void 0&&(s=0),Cr.setInterval(t.flush.bind(t,this),s)},e.prototype.recycleAsyncId=function(t,r,s){if(s===void 0&&(s=0),s!=null&&this.delay===s&&this.pending===!1)return r;r!=null&&Cr.clearInterval(r)},e.prototype.execute=function(t,r){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var s=this._execute(t,r);if(s)return s;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,r){var s=!1,n;try{this.work(t)}catch(o){s=!0,n=o||new Error("Scheduled action threw falsy error")}if(s)return this.unsubscribe(),n},e.prototype.unsubscribe=function(){if(!this.closed){var t=this,r=t.id,s=t.scheduler,n=s.actions;this.work=this.state=this.scheduler=null,this.pending=!1,or(n,this),r!=null&&(this.id=this.recycleAsyncId(s,r,null)),this.delay=null,i.prototype.unsubscribe.call(this)}},e})(ya),ln=(function(){function i(e,t){t===void 0&&(t=i.now),this.schedulerActionCtor=e,this.now=t}return i.prototype.schedule=function(e,t,r){return t===void 0&&(t=0),new this.schedulerActionCtor(this,e).schedule(r,t)},i.now=as.now,i})(),ba=(function(i){Xe(e,i);function e(t,r){r===void 0&&(r=ln.now);var s=i.call(this,t,r)||this;return s.actions=[],s._active=!1,s}return e.prototype.flush=function(t){var r=this.actions;if(this._active){r.push(t);return}var s;this._active=!0;do if(s=t.execute(t.state,t.delay))break;while(t=r.shift());if(this._active=!1,s){for(;t=r.shift();)t.unsubscribe();throw s}},e})(ln),Sa=new ba(va),Ea=Sa,Qe=new ie(function(i){return i.complete()});function bn(i){return i&&z(i.schedule)}function cs(i){return i[i.length-1]}function ka(i){return z(cs(i))?i.pop():void 0}function ur(i){return bn(cs(i))?i.pop():void 0}function Ta(i,e){return typeof cs(i)=="number"?i.pop():e}var ls=(function(i){return i&&typeof i.length=="number"&&typeof i!="function"});function Sn(i){return z(i?.then)}function En(i){return z(i[os])}function kn(i){return Symbol.asyncIterator&&z(i?.[Symbol.asyncIterator])}function Tn(i){return new TypeError("You provided "+(i!==null&&typeof i=="object"?"an invalid object":"'"+i+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function Pa(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Pn=Pa();function _n(i){return z(i?.[Pn])}function Mn(i){return ia(this,arguments,function(){var t,r,s,n;return dn(this,function(o){switch(o.label){case 0:t=i.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,Wt(t.read())];case 3:return r=o.sent(),s=r.value,n=r.done,n?[4,Wt(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,Wt(s)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}})})}function xn(i){return z(i?.getReader)}function Se(i){if(i instanceof ie)return i;if(i!=null){if(En(i))return _a(i);if(ls(i))return Ma(i);if(Sn(i))return xa(i);if(kn(i))return In(i);if(_n(i))return Ia(i);if(xn(i))return Aa(i)}throw Tn(i)}function _a(i){return new ie(function(e){var t=i[os]();if(z(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Ma(i){return new ie(function(e){for(var t=0;t<i.length&&!e.closed;t++)e.next(i[t]);e.complete()})}function xa(i){return new ie(function(e){i.then(function(t){e.closed||(e.next(t),e.complete())},function(t){return e.error(t)}).then(null,mn)})}function Ia(i){return new ie(function(e){var t,r;try{for(var s=$e(i),n=s.next();!n.done;n=s.next()){var o=n.value;if(e.next(o),e.closed)return}}catch(a){t={error:a}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}e.complete()})}function In(i){return new ie(function(e){Ca(i,e).catch(function(t){return e.error(t)})})}function Aa(i){return In(Mn(i))}function Ca(i,e){var t,r,s,n;return ra(this,void 0,void 0,function(){var o,a;return dn(this,function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),t=sa(i),c.label=1;case 1:return[4,t.next()];case 2:if(r=c.sent(),!!r.done)return[3,4];if(o=r.value,e.next(o),e.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return a=c.sent(),s={error:a},[3,11];case 6:return c.trys.push([6,,9,10]),r&&!r.done&&(n=t.return)?[4,n.call(t)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(s)throw s.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}})})}function Ve(i,e,t,r,s){r===void 0&&(r=0),s===void 0&&(s=!1);var n=e.schedule(function(){t(),s?i.add(this.schedule(null,r)):this.unsubscribe()},r);if(i.add(n),!s)return n}function An(i,e){return e===void 0&&(e=0),ue(function(t,r){t.subscribe(se(r,function(s){return Ve(r,i,function(){return r.next(s)},e)},function(){return Ve(r,i,function(){return r.complete()},e)},function(s){return Ve(r,i,function(){return r.error(s)},e)}))})}function Cn(i,e){return e===void 0&&(e=0),ue(function(t,r){r.add(i.schedule(function(){return t.subscribe(r)},e))})}function La(i,e){return Se(i).pipe(Cn(e),An(e))}function Fa(i,e){return Se(i).pipe(Cn(e),An(e))}function Oa(i,e){return new ie(function(t){var r=0;return e.schedule(function(){r===i.length?t.complete():(t.next(i[r++]),t.closed||this.schedule())})})}function Ra(i,e){return new ie(function(t){var r;return Ve(t,e,function(){r=i[Pn](),Ve(t,e,function(){var s,n,o;try{s=r.next(),n=s.value,o=s.done}catch(a){t.error(a);return}o?t.complete():t.next(n)},0,!0)}),function(){return z(r?.return)&&r.return()}})}function Ln(i,e){if(!i)throw new Error("Iterable cannot be null");return new ie(function(t){Ve(t,e,function(){var r=i[Symbol.asyncIterator]();Ve(t,e,function(){r.next().then(function(s){s.done?t.complete():t.next(s.value)})},0,!0)})})}function Da(i,e){return Ln(Mn(i),e)}function Na(i,e){if(i!=null){if(En(i))return La(i,e);if(ls(i))return Oa(i,e);if(Sn(i))return Fa(i,e);if(kn(i))return Ln(i,e);if(_n(i))return Ra(i,e);if(xn(i))return Da(i,e)}throw Tn(i)}function H(i,e){return e?Na(i,e):Se(i)}function _t(){for(var i=[],e=0;e<arguments.length;e++)i[e]=arguments[e];var t=ur(i);return H(i,t)}var Fr=is(function(i){return function(){i(this),this.name="EmptyError",this.message="no elements in sequence"}});function Al(i,e){var t=typeof e=="object";return new Promise(function(r,s){var n=!1,o;i.subscribe({next:function(a){o=a,n=!0},error:s,complete:function(){n?r(o):t?r(e.defaultValue):s(new Fr)}})})}function ne(i,e){var t=typeof e=="object";return new Promise(function(r,s){var n=new Ar({next:function(o){r(o),n.unsubscribe()},error:s,complete:function(){t?r(e.defaultValue):s(new Fr)}});i.subscribe(n)})}function Ha(i){return i instanceof Date&&!isNaN(i)}function oe(i,e){return ue(function(t,r){var s=0;t.subscribe(se(r,function(n){r.next(i.call(e,n,s++))}))})}var Wa=Array.isArray;function Ba(i,e){return Wa(e)?i.apply(void 0,ct([],Ge(e))):i(e)}function Fn(i){return oe(function(e){return Ba(i,e)})}var Ua=Array.isArray,Ka=Object.getPrototypeOf,qa=Object.prototype,ja=Object.keys;function za(i){if(i.length===1){var e=i[0];if(Ua(e))return{args:e,keys:null};if($a(e)){var t=ja(e);return{args:t.map(function(r){return e[r]}),keys:t}}}return{args:i,keys:null}}function $a(i){return i&&typeof i=="object"&&Ka(i)===qa}function Va(i,e){return i.reduce(function(t,r,s){return t[r]=e[s],t},{})}function Cl(){for(var i=[],e=0;e<arguments.length;e++)i[e]=arguments[e];var t=ur(i),r=ka(i),s=za(i),n=s.args,o=s.keys;if(n.length===0)return H([],t);var a=new ie(Ga(n,t,o?function(c){return Va(o,c)}:Fe));return r?a.pipe(Fn(r)):a}function Ga(i,e,t){return t===void 0&&(t=Fe),function(r){un(e,function(){for(var s=i.length,n=new Array(s),o=s,a=s,c=function(u){un(e,function(){var h=H(i[u],e),f=!1;h.subscribe(se(r,function(p){n[u]=p,f||(f=!0,a--),a||r.next(t(n.slice()))},function(){--o||r.complete()}))},r)},l=0;l<s;l++)c(l)},r)}}function un(i,e,t){i?Ve(t,i,e):e()}function On(i,e,t,r,s,n,o,a){var c=[],l=0,u=0,h=!1,f=function(){h&&!c.length&&!l&&e.complete()},p=function(y){return l<r?w(y):c.push(y)},w=function(y){n&&e.next(y),l++;var b=!1;Se(t(y,u++)).subscribe(se(e,function(T){s?.(T),n?p(T):e.next(T)},function(){b=!0},void 0,function(){if(b)try{l--;for(var T=function(){var W=c.shift();o?Ve(e,o,function(){return w(W)}):w(W)};c.length&&l<r;)T();f()}catch(W){e.error(W)}}))};return i.subscribe(se(e,p,function(){h=!0,f()})),function(){a?.()}}function J(i,e,t){return t===void 0&&(t=1/0),z(e)?J(function(r,s){return oe(function(n,o){return e(r,n,s,o)})(Se(i(r,s)))},t):(typeof e=="number"&&(t=e),ue(function(r,s){return On(r,s,i,t)}))}function Rn(i){return i===void 0&&(i=1/0),J(Fe,i)}function Xa(){return Rn(1)}function ar(){for(var i=[],e=0;e<arguments.length;e++)i[e]=arguments[e];return Xa()(H(i,ur(i)))}function Mt(i){return new ie(function(e){Se(i()).subscribe(e)})}var Qa=["addListener","removeListener"],Ja=["addEventListener","removeEventListener"],Ya=["on","off"];function Lr(i,e,t,r){if(z(t)&&(r=t,t=void 0),r)return Lr(i,e,t).pipe(Fn(r));var s=Ge(tc(i)?Ja.map(function(a){return function(c){return i[a](e,c,t)}}):Za(i)?Qa.map(hn(i,e)):ec(i)?Ya.map(hn(i,e)):[],2),n=s[0],o=s[1];if(!n&&ls(i))return J(function(a){return Lr(a,e,t)})(Se(i));if(!n)throw new TypeError("Invalid event target");return new ie(function(a){var c=function(){for(var l=[],u=0;u<arguments.length;u++)l[u]=arguments[u];return a.next(1<l.length?l:l[0])};return n(c),function(){return o(c)}})}function hn(i,e){return function(t){return function(r){return i[t](e,r)}}}function Za(i){return z(i.addListener)&&z(i.removeListener)}function ec(i){return z(i.on)&&z(i.off)}function tc(i){return z(i.addEventListener)&&z(i.removeEventListener)}function hr(i,e,t){i===void 0&&(i=0),t===void 0&&(t=Ea);var r=-1;return e!=null&&(bn(e)?t=e:r=e),new ie(function(s){var n=Ha(i)?+i-t.now():i;n<0&&(n=0);var o=0;return t.schedule(function(){s.closed||(s.next(o++),0<=r?this.schedule(void 0,r):s.complete())},n)})}function Je(){for(var i=[],e=0;e<arguments.length;e++)i[e]=arguments[e];var t=ur(i),r=Ta(i,1/0),s=i;return s.length?s.length===1?Se(s[0]):Rn(r)(H(s,t)):Qe}var us=new ie(Tt),rc=Array.isArray;function ic(i){return i.length===1&&rc(i[0])?i[0]:i}function Ye(i,e){return ue(function(t,r){var s=0;t.subscribe(se(r,function(n){return i.call(e,n,s++)&&r.next(n)}))})}function Dn(){for(var i=[],e=0;e<arguments.length;e++)i[e]=arguments[e];return i=ic(i),i.length===1?Se(i[0]):new ie(Nn(i))}function Nn(i){return function(e){for(var t=[],r=function(n){t.push(Se(i[n]).subscribe(se(e,function(o){if(t){for(var a=0;a<t.length;a++)a!==n&&t[a].unsubscribe();t=null}e.next(o)})))},s=0;t&&!e.closed&&s<i.length;s++)r(s)}}function Ll(i,e){return e===void 0&&(e=null),e=e??i,ue(function(t,r){var s=[],n=0;t.subscribe(se(r,function(o){var a,c,l,u,h=null;n++%e===0&&s.push([]);try{for(var f=$e(s),p=f.next();!p.done;p=f.next()){var w=p.value;w.push(o),i<=w.length&&(h=h??[],h.push(w))}}catch(T){a={error:T}}finally{try{p&&!p.done&&(c=f.return)&&c.call(f)}finally{if(a)throw a.error}}if(h)try{for(var y=$e(h),b=y.next();!b.done;b=y.next()){var w=b.value;or(s,w),r.next(w)}}catch(T){l={error:T}}finally{try{b&&!b.done&&(u=y.return)&&u.call(y)}finally{if(l)throw l.error}}},function(){var o,a;try{for(var c=$e(s),l=c.next();!l.done;l=c.next()){var u=l.value;r.next(u)}}catch(h){o={error:h}}finally{try{l&&!l.done&&(a=c.return)&&a.call(c)}finally{if(o)throw o.error}}r.complete()},void 0,function(){s=null}))})}function Bt(i){return ue(function(e,t){var r=null,s=!1,n;r=e.subscribe(se(t,void 0,void 0,function(o){n=Se(i(o,Bt(i)(e))),r?(r.unsubscribe(),r=null,n.subscribe(t)):s=!0})),s&&(r.unsubscribe(),r=null,n.subscribe(t))})}function Fl(i,e){return z(e)?J(i,e,1):J(i,1)}function hs(i){return ue(function(e,t){var r=!1;e.subscribe(se(t,function(s){r=!0,t.next(s)},function(){r||t.next(i),t.complete()}))})}function cr(i){return i<=0?function(){return Qe}:ue(function(e,t){var r=0;e.subscribe(se(t,function(s){++r<=i&&(t.next(s),i<=r&&t.complete())}))})}function Ut(){return ue(function(i,e){i.subscribe(se(e,Tt))})}function sc(i){return oe(function(){return i})}function nc(i,e){return e?function(t){return ar(e.pipe(cr(1),Ut()),t.pipe(nc(i)))}:J(function(t,r){return Se(i(t,r)).pipe(cr(1),sc(t))})}function Hn(i,e){return e===void 0&&(e=Fe),i=i??oc,ue(function(t,r){var s,n=!0;t.subscribe(se(r,function(o){var a=e(o);(n||!i(s,a))&&(n=!1,s=a,r.next(o))}))})}function oc(i,e){return i===e}function dr(i){return i===void 0&&(i=ac),ue(function(e,t){var r=!1;e.subscribe(se(t,function(s){r=!0,t.next(s)},function(){return r?t.complete():t.error(i())}))})}function ac(){return new Fr}function Kt(i,e){var t=arguments.length>=2;return function(r){return r.pipe(i?Ye(function(s,n){return i(s,n,r)}):Fe,cr(1),t?hs(e):dr(function(){return new Fr}))}}function Wn(i,e,t){return t===void 0&&(t=1/0),ue(function(r,s){var n=e;return On(r,s,function(o,a){return i(n,o,a)},t,function(o){n=o},!1,void 0,function(){return n=null})})}function we(){for(var i=[],e=0;e<arguments.length;e++)i[e]=arguments[e];return i.length?ue(function(t,r){Nn(ct([t],Ge(i)))(r)}):Fe}function fr(i){i===void 0&&(i=1/0);var e;i&&typeof i=="object"?e=i:e={count:i};var t=e.count,r=t===void 0?1/0:t,s=e.delay,n=e.resetOnSuccess,o=n===void 0?!1:n;return r<=0?Fe:ue(function(a,c){var l=0,u,h=function(){var f=!1;u=a.subscribe(se(c,function(p){o&&(l=0),c.next(p)},void 0,function(p){if(l++<r){var w=function(){u?(u.unsubscribe(),u=null,h()):f=!0};if(s!=null){var y=typeof s=="number"?hr(s):Se(s(p,l)),b=se(c,function(){b.unsubscribe(),w()},function(){c.complete()});y.subscribe(b)}else w()}else c.error(p)})),f&&(u.unsubscribe(),u=null,h())};h()})}function Bn(){for(var i=[],e=0;e<arguments.length;e++)i[e]=arguments[e];var t=ur(i);return ue(function(r,s){(t?ar(i,r,t):ar(i,r)).subscribe(s)})}function Un(i,e){return ue(function(t,r){var s=null,n=0,o=!1,a=function(){return o&&!s&&r.complete()};t.subscribe(se(r,function(c){s?.unsubscribe();var l=0,u=n++;Se(i(c,u)).subscribe(s=se(r,function(h){return r.next(e?e(c,h,u,l++):h)},function(){s=null,a()}))},function(){o=!0,a()}))})}function Kn(i){return ue(function(e,t){Se(i).subscribe(se(t,function(){return t.complete()},Tt)),!t.closed&&e.subscribe(t)})}function pr(i,e,t){var r=z(i)||e||t?{next:i,error:e,complete:t}:i;return r?ue(function(s,n){var o;(o=r.subscribe)===null||o===void 0||o.call(r);var a=!0;s.subscribe(se(n,function(c){var l;(l=r.next)===null||l===void 0||l.call(r,c),n.next(c)},function(){var c;a=!1,(c=r.complete)===null||c===void 0||c.call(r),n.complete()},function(c){var l;a=!1,(l=r.error)===null||l===void 0||l.call(r,c),n.error(c)},function(){var c,l;a&&((c=r.unsubscribe)===null||c===void 0||c.call(r)),(l=r.finalize)===null||l===void 0||l.call(r)}))}):Fe}function Ue(i,e=!1){return e?"fromBase64"in Uint8Array?Uint8Array.fromBase64(i):typeof Buffer=="function"?Buffer.from(i,"base64"):Uint8Array.from(atob(i),t=>t.codePointAt(0)):new TextEncoder().encode(i)}function qn(i){return ds(new TextEncoder().encode(i))}function ds(i){let t=[];for(let s=0;s<i.length;s+=65534){let n=i.subarray(s,s+65534);t.push(String.fromCodePoint.apply(null,n))}let r=t.join("");return btoa(r)}function Or(i){let e=0;for(let s of i)e+=s.length;let t=new Uint8Array(e),r=0;for(let s of i)t.set(s,r),r+=s.length;return t}var Dr=Object.freeze({width:800,height:600}),Rr=Symbol("Source URL for Puppeteer evaluation scripts"),xe=class i{static INTERNAL_URL="pptr:internal";static fromCallSite(e,t){let r=new i;return r.#e=e,r.#t=t.toString(),r}static parse=e=>{e=e.slice(5);let[t="",r=""]=e.split(";"),s=new i;return s.#e=t,s.#t=decodeURIComponent(r),s};static isPuppeteerURL=e=>e.startsWith("pptr:");#e;#t;get functionName(){return this.#e}get siteString(){return this.#t}toString(){return`pptr:${[this.#e,encodeURIComponent(this.#t)].join(";")}`}},Y=(i,e)=>{if(Object.prototype.hasOwnProperty.call(e,Rr))return e;let t=Error.prepareStackTrace;Error.prepareStackTrace=(s,n)=>n[2];let r=new Error().stack;return Error.prepareStackTrace=t,Object.assign(e,{[Rr]:xe.fromCallSite(i,r)})},jn=i=>{if(Object.prototype.hasOwnProperty.call(i,Rr))return i[Rr]},Oe=i=>typeof i=="string"||i instanceof String,cc=i=>typeof i=="number"||i instanceof Number,jl=i=>typeof i=="object"&&i?.constructor===Object,zl=i=>typeof i=="object"&&i?.constructor===RegExp,$l=i=>typeof i=="object"&&i?.constructor===Date;function Nr(i,...e){if(Oe(i))return P(e.length===0,"Cannot evaluate a string with arguments"),i;function t(r){return Object.is(r,void 0)?"undefined":JSON.stringify(r)}return`(${i})(${e.map(t).join(",")})`}async function Hr(i,e,t){let r=[],s=i.getReader();if(e){let n=await ee.value.openFileForWriting(e);try{for(;;){let{done:o,value:a}=await s.read();if(o)break;r.push(a),await n.writeFile(a)}}finally{await n.close()}}else for(;;){let{done:n,value:o}=await s.read();if(n)break;r.push(o)}try{let n=Or(r);return n.length===0?null:n}catch(n){return t?.(E.error)?.(n),null}}async function Wr(i,e){return new ReadableStream({async pull(t){let{data:r,base64Encoded:s,eof:n}=await i.send("IO.read",{handle:e});t.enqueue(Ue(r,s??!1)),n&&(await i.send("IO.close",{handle:e}),t.close())}})}var lc=new Set(["alert","confirm","prompt","beforeunload"]);function zn(i){let e=null;return lc.has(i)&&(e=i),P(e,`Unknown javascript dialog type: ${i}`),e}function ye(i,e){return i===0?us:hr(i).pipe(oe(()=>{throw new He(`Timed out after waiting ${i}ms`,{cause:e})}))}var ps="__puppeteer_utility_world__"+rn,ms=/^[\x20\t]*\/\/[@#] sourceURL=\s{0,10}(\S*?)\s{0,10}$/m;function $n(i){return`//# sourceURL=${i}`}var Vn=500;function Gn(i={},e="in"){let t={scale:1,displayHeaderFooter:!1,headerTemplate:"",footerTemplate:"",printBackground:!1,landscape:!1,pageRanges:"",preferCSSPageSize:!1,omitBackground:!1,outline:!1,tagged:!0,waitForFonts:!0},r=8.5,s=11;if(i.format){let o=nn[i.format.toLowerCase()][e];P(o,"Unknown paper format: "+i.format),r=o.width,s=o.height}else r=qt(i.width,e)??r,s=qt(i.height,e)??s;let n={top:qt(i.margin?.top,e)||0,left:qt(i.margin?.left,e)||0,bottom:qt(i.margin?.bottom,e)||0,right:qt(i.margin?.right,e)||0};return i.outline&&(i.tagged=!0),{...t,...i,width:r,height:s,margin:n}}var fs={px:1,in:96,cm:37.8,mm:3.78};function qt(i,e="in"){if(typeof i>"u")return;let t;if(cc(i))t=i;else if(Oe(i)){let r=i,s=r.substring(r.length-2).toLowerCase(),n="";s in fs?n=r.substring(0,r.length-2):(s="px",n=r);let o=Number(n);P(!isNaN(o),"Failed to parse parameter value: "+r),t=o*fs[s]}else throw new Error("page.pdf() Cannot handle parameter type: "+typeof i);return t/fs[e]}function Z(i,e){return new ie(t=>{let r=s=>{t.next(s)};return i.on(e,r),()=>{i.off(e,r)}})}function Ze(i,e){return i?Lr(i,"abort").pipe(oe(()=>{throw i.reason instanceof Error?(i.reason.cause=e,i.reason):new Error(i.reason,{cause:e})})):us}function lt(i){return J(e=>H(Promise.resolve(i(e))).pipe(Ye(t=>t),oe(()=>e)))}var Xn=new Map([["accelerometer","sensors"],["ambient-light-sensor","sensors"],["background-sync","backgroundSync"],["camera","videoCapture"],["clipboard-read","clipboardReadWrite"],["clipboard-sanitized-write","clipboardSanitizedWrite"],["clipboard-write","clipboardReadWrite"],["geolocation","geolocation"],["gyroscope","sensors"],["idle-detection","idleDetection"],["keyboard-lock","keyboardLock"],["magnetometer","sensors"],["microphone","audioCapture"],["midi","midi"],["notifications","notifications"],["payment-handler","paymentHandler"],["persistent-storage","durableStorage"],["pointer-lock","pointerLock"],["midi-sysex","midiSysex"]]),Br=class extends C{#e;constructor(e){super(void 0,e),this.#e=e}get logger(){return this.#e}async waitForTarget(e,t={}){let{timeout:r=3e4,signal:s}=t;return await ne(Je(Z(this,"targetcreated"),Z(this,"targetchanged"),H(this.targets())).pipe(lt(e),we(Ze(s),ye(r))))}async pages(e=!1){return(await Promise.all(this.browserContexts().map(r=>r.pages(e)))).reduce((r,s)=>r.concat(s),[])}async cookies(){return await this.defaultBrowserContext().cookies()}async setCookie(...e){return await this.defaultBrowserContext().setCookie(...e)}async deleteCookie(...e){return await this.defaultBrowserContext().deleteCookie(...e)}async deleteMatchingCookies(...e){return await this.defaultBrowserContext().deleteMatchingCookies(...e)}async setPermission(e,...t){return await this.defaultBrowserContext().setPermission(e,...t)}[F](){this[q]().catch(e=>{this.#e?.(E.error)?.(e)})}async[q](){this.process()?await this.close():await this.disconnect(),await super[q]()}};var O=class i{static create(e){return new i(e)}static async race(e){let t=new Set;try{let r=e.map(s=>s instanceof i?(s.#n&&t.add(s),s.valueOrThrow()):s);return await Promise.race(r)}finally{for(let r of t)r.reject(new Error("Timeout cleared"))}}#e=!1;#t=!1;#r;#i;#s=new Promise(e=>{this.#i=e});#n;#a;constructor(e){e&&e.timeout>0&&(this.#a=new He(e.message),this.#n=setTimeout(()=>{this.reject(this.#a)},e.timeout))}#u(e){clearTimeout(this.#n),this.#r=e,this.#i()}resolve(e){this.#t||this.#e||(this.#e=!0,this.#u(e))}reject(e){this.#t||this.#e||(this.#t=!0,this.#u(e))}resolved(){return this.#e}finished(){return this.#e||this.#t}value(){return this.#r}#c;valueOrThrow(){return this.#c||(this.#c=(async()=>{if(await this.#s,this.#t)throw this.#r;return this.#r})()),this.#c}};var gs=class{#e;#t;constructor(e,t){this.#e=e,this.#t=t}[F](){return this.#t?.(),this.#e.release()}},ut=class i{static Guard=gs;#e=!1;#t=[];async acquire(e){if(!this.#e)return this.#e=!0,new i.Guard(this,e);let t=O.create();return this.#t.push(t.resolve.bind(t)),await t.valueOrThrow(),new i.Guard(this,e)}release(){let e=this.#t.shift();if(!e){this.#e=!1;return}e()}};var Ur=class extends C{#e;constructor(e){super(void 0,e),this.#e=e}get logger(){return this.#e}#t;#r=0;startScreenshot(){let e=this.#t||new ut;return this.#t=e,this.#r++,e.acquire(()=>{this.#r--,this.#r===0&&(this.#t=void 0)})}waitForScreenshotOperations(){return this.#t?.acquire()}async waitForTarget(e,t={}){let{timeout:r=3e4}=t;return await ne(Je(Z(this,"targetcreated"),Z(this,"targetchanged"),H(this.targets())).pipe(lt(e),we(ye(r))))}async deleteCookie(...e){return await this.setCookie(...e.map(t=>({...t,expires:1})))}async deleteMatchingCookies(...e){let r=(await this.cookies()).filter(s=>e.some(n=>{if(n.name===s.name){if(n.domain!==void 0&&n.domain===s.domain||n.path!==void 0&&n.path===s.path)return!0;if(n.partitionKey!==void 0&&s.partitionKey!==void 0){if(typeof s.partitionKey!="object")throw new Error("Unexpected string partition key");if(typeof n.partitionKey=="string"){if(n.partitionKey===s.partitionKey?.sourceOrigin)return!0}else if(n.partitionKey.sourceOrigin===s.partitionKey?.sourceOrigin)return!0}if(n.url!==void 0){let o=new URL(n.url);if(o.hostname===s.domain&&o.pathname===s.path)return!0}return!0}return!1}));await this.deleteCookie(...r)}get closed(){return!this.browser().browserContexts().includes(this)}get id(){}[F](){this[q]().catch(e=>{this.#e?.(E.error)?.(e)})}async[q](){await this.close(),await super[q]()}};var B;(function(i){i.Disconnected=Symbol("CDPSession.Disconnected"),i.Swapped=Symbol("CDPSession.Swapped"),i.Ready=Symbol("CDPSession.Ready"),i.SessionAttached="sessionattached",i.SessionDetached="sessiondetached"})(B||(B={}));var Kr=class extends C{constructor(){super()}parentSession(){}};var qr=class{devices=[]};var jr=class{#e;#t;#r;#i=!1;get handled(){return this.#i}set handled(e){this.#i=e}constructor(e,t,r=""){this.#e=e,this.#t=t,this.#r=r}type(){return this.#e}message(){return this.#t}defaultValue(){return this.#r}async accept(e){P(!this.handled,"Cannot accept dialog which is already handled!"),this.handled=!0,await this.handle({accept:!0,text:e})}async dismiss(){P(!this.handled,"Cannot dismiss dialog which is already handled!"),this.handled=!0,await this.handle({accept:!1})}};var Ke=class{static async*map(e,t){for await(let r of e)yield await t(r)}static async*flatMap(e,t){for await(let r of e)yield*t(r)}static async collect(e){let t=[];for await(let r of e)t.push(r);return t}static async first(e){for await(let t of e)return t}};function Q(i){return typeof i=="object"&&i!==null&&"name"in i&&"message"in i}function yu(i){return Q(i)&&("errno"in i||"code"in i||"path"in i||"syscall"in i)}function ws(i,e,t){return i.message=e,i.originalMessage=t??i.originalMessage,i}function zr(i){let e=i.error.message;return i.error&&typeof i.error=="object"&&"data"in i.error&&(e+=` ${i.error.data}`),e}var $r=function(i,e,t){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var r,s;if(t){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=e[Symbol.asyncDispose]}if(r===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=e[Symbol.dispose],t&&(s=r)}if(typeof r!="function")throw new TypeError("Object not disposable.");s&&(r=function(){try{s.call(this)}catch(n){return Promise.reject(n)}}),i.stack.push({value:e,dispose:r,async:t})}else t&&i.stack.push({async:!0});return e},ys=(function(i){return function(e){function t(o){e.error=e.hasError?new i(o,e.error,"An error was suppressed during disposal."):o,e.hasError=!0}var r,s=0;function n(){for(;r=e.stack.pop();)try{if(!r.async&&s===1)return s=0,e.stack.push(r),Promise.resolve().then(n);if(r.dispose){var o=r.dispose.call(r.value);if(r.async)return s|=2,Promise.resolve(o).then(n,function(a){return t(a),n()})}else s|=1}catch(a){t(a)}if(s===1)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}return n()}})(typeof SuppressedError=="function"?SuppressedError:function(i,e,t){var r=new Error(t);return r.name="SuppressedError",r.error=i,r.suppressed=e,r}),uc=20;async function*hc(i,e){let t={stack:[],error:void 0,hasError:!1};try{let s=await $r(t,await i.evaluateHandle(async(a,c)=>{let l=[];for(;l.length<c;){let u=await a.next();if(u.done)break;l.push(u.value)}return l},e),!1).getProperties(),n=s.values();return $r(t,new G,!1).defer(()=>{for(let a of n){let c={stack:[],error:void 0,hasError:!1};try{$r(c,a,!1)[F]()}catch(l){c.error=l,c.hasError=!0}finally{ys(c)}}}),yield*n,s.size===0}catch(r){t.error=r,t.hasError=!0}finally{ys(t)}}async function*dc(i){let e=uc;for(;!(yield*hc(i,e));)e<<=1}async function*Vr(i){let e={stack:[],error:void 0,hasError:!1};try{let t=$r(e,await i.evaluateHandle(r=>(async function*(){yield*r})()),!1);yield*dc(t)}catch(t){e.error=t,e.hasError=!0}finally{ys(e)}}var Ee=class i{static create=e=>new i(e);#e;constructor(e){this.#e=e}async get(e){return await this.#e(e)}};var jt=Symbol("_isElementHandle");var Qn=new Map,fc=i=>{let e=Qn.get(i);return e||(e=new Function(`return ${i}`)(),Qn.set(i,e),e)};function Re(i){let e=i.toString();if(e.match(/^(async )*function(\(|\s)/)||e.match(/^(async )*function\s*\*\s*/)||e.startsWith("(")||e.match(/^async\s*\(/)||e.match(/^(async)*\s*(?:[$_\p{ID_Start}])(?:[$\u200C\u200D\p{ID_Continue}])*\s*=>/u))return e;let r="function ";return e.startsWith("async ")&&(r=`async ${r}`,e=e.substring(6)),`${r}${e}`}var xt=(i,e)=>{let t=Re(i);for(let[r,s]of Object.entries(e))t=t.replace(new RegExp(`PLACEHOLDER\\(\\s*(?:'${r}'|"${r}")\\s*\\)`,"g"),`(${s})`);return fc(t)};var Gr=function(i,e,t){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var r,s;if(t){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=e[Symbol.asyncDispose]}if(r===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=e[Symbol.dispose],t&&(s=r)}if(typeof r!="function")throw new TypeError("Object not disposable.");s&&(r=function(){try{s.call(this)}catch(n){return Promise.reject(n)}}),i.stack.push({value:e,dispose:r,async:t})}else t&&i.stack.push({async:!0});return e},Xr=(function(i){return function(e){function t(o){e.error=e.hasError?new i(o,e.error,"An error was suppressed during disposal."):o,e.hasError=!0}var r,s=0;function n(){for(;r=e.stack.pop();)try{if(!r.async&&s===1)return s=0,e.stack.push(r),Promise.resolve().then(n);if(r.dispose){var o=r.dispose.call(r.value);if(r.async)return s|=2,Promise.resolve(o).then(n,function(a){return t(a),n()})}else s|=1}catch(a){t(a)}if(s===1)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}return n()}})(typeof SuppressedError=="function"?SuppressedError:function(i,e,t){var r=new Error(t);return r.name="SuppressedError",r.error=i,r.suppressed=e,r}),ve=class{static querySelectorAll;static querySelector;static get _querySelector(){if(this.querySelector)return this.querySelector;if(!this.querySelectorAll)throw new Error("Cannot create default `querySelector`.");return this.querySelector=xt(async(e,t,r)=>{let n=PLACEHOLDER("querySelectorAll")(e,t,r);for await(let o of n)return o;return null},{querySelectorAll:Re(this.querySelectorAll)})}static get _querySelectorAll(){if(this.querySelectorAll)return this.querySelectorAll;if(!this.querySelector)throw new Error("Cannot create default `querySelectorAll`.");return this.querySelectorAll=xt(async function*(e,t,r){let n=await PLACEHOLDER("querySelector")(e,t,r);n&&(yield n)},{querySelector:Re(this.querySelector)})}static async*queryAll(e,t){let r={stack:[],error:void 0,hasError:!1};try{let s=Gr(r,await e.evaluateHandle(this._querySelectorAll,t,Ee.create(n=>n.puppeteerUtil)),!1);yield*Vr(s)}catch(s){r.error=s,r.hasError=!0}finally{Xr(r)}}static async queryOne(e,t){let r={stack:[],error:void 0,hasError:!1};try{let s=Gr(r,await e.evaluateHandle(this._querySelector,t,Ee.create(n=>n.puppeteerUtil)),!1);return jt in s?s.move():null}catch(s){r.error=s,r.hasError=!0}finally{Xr(r)}}static async waitFor(e,t,r){let s={stack:[],error:void 0,hasError:!1};try{let n,o=Gr(s,await(async()=>{if(!(jt in e)){n=e;return}return n=e.frame,await n.isolatedRealm().adoptHandle(e)})(),!1),{visible:a=!1,hidden:c=!1,timeout:l,signal:u}=r,h=a||c?"raf":r.polling;try{let f={stack:[],error:void 0,hasError:!1};try{u?.throwIfAborted();let p=Gr(f,await n.isolatedRealm().waitForFunction(async(w,y,b,T,W)=>{let j=await w.createFunction(y)(T??document,b,w);return w.checkVisibility(j,W)},{polling:h,root:o,timeout:l,signal:u},Ee.create(w=>w.puppeteerUtil),Re(this._querySelector),t,o,a?!0:c?!1:void 0),!1);if(u?.aborted)throw u.reason;return jt in p?await n.mainRealm().transferHandle(p):null}catch(p){f.error=p,f.hasError=!0}finally{Xr(f)}}catch(f){if(!Q(f)||f.name==="AbortError")throw f;let p=new(f instanceof He?He:Error)(`Waiting for selector \`${t}\` failed`);throw p.cause=f,p}}catch(n){s.error=n,s.hasError=!0}finally{Xr(s)}}};var pc=i=>["name","role"].includes(i),mc=/\[\s*(?<attribute>\w+)\s*=\s*(?<quote>"|')(?<value>\\.|.*?(?=\k<quote>))\k<quote>\s*\]/g,gc=i=>{if(i.length>1e4)throw new Error(`Selector ${i} is too long`);let e={},t=i.replace(mc,(r,s,n,o)=>(P(pc(s),`Unknown aria attribute "${s}" in selector`),e[s]=o,""));return t&&!e.name&&(e.name=t),e},It=class extends ve{static querySelector=async(e,t,{ariaQuerySelector:r})=>await r(e,t);static async*queryAll(e,t){let{name:r,role:s}=gc(t);yield*e.queryAXTree(r,s)}static queryOne=async(e,t)=>await Ke.first(this.queryAll(e,t))??null};var Jn='"use strict";var g=Object.defineProperty;var X=Object.getOwnPropertyDescriptor;var Y=Object.getOwnPropertyNames;var G=Object.prototype.hasOwnProperty;var l=(t,e)=>{for(var r in e)g(t,r,{get:e[r],enumerable:!0})},J=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Y(e))!G.call(t,n)&&n!==r&&g(t,n,{get:()=>e[n],enumerable:!(o=X(e,n))||o.enumerable});return t};var z=t=>J(g({},"__esModule",{value:!0}),t);var Se={};l(Se,{default:()=>Te});module.exports=z(Se);var b=class extends Error{constructor(e,r){super(e,r),this.name=this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}},p=class extends b{};var c=class t{static create(e){return new t(e)}static async race(e){let r=new Set;try{let o=e.map(n=>n instanceof t?(n.#s&&r.add(n),n.valueOrThrow()):n);return await Promise.race(o)}finally{for(let o of r)o.reject(new Error("Timeout cleared"))}}#e=!1;#r=!1;#t;#o;#n=new Promise(e=>{this.#o=e});#s;#l;constructor(e){e&&e.timeout>0&&(this.#l=new p(e.message),this.#s=setTimeout(()=>{this.reject(this.#l)},e.timeout))}#i(e){clearTimeout(this.#s),this.#t=e,this.#o()}resolve(e){this.#r||this.#e||(this.#e=!0,this.#i(e))}reject(e){this.#r||this.#e||(this.#r=!0,this.#i(e))}resolved(){return this.#e}finished(){return this.#e||this.#r}value(){return this.#t}#a;valueOrThrow(){return this.#a||(this.#a=(async()=>{if(await this.#n,this.#r)throw this.#t;return this.#t})()),this.#a}};var W=new Map,F=t=>{let e=W.get(t);return e||(e=new Function(`return ${t}`)(),W.set(t,e),e)};var E={};l(E,{ariaQuerySelector:()=>K,ariaQuerySelectorAll:()=>x});var K=(t,e)=>globalThis.__ariaQuerySelector(t,e),x=async function*(t,e){yield*await globalThis.__ariaQuerySelectorAll(t,e)};var v={};l(v,{cssQuerySelector:()=>Z,cssQuerySelectorAll:()=>ee});var Z=(t,e)=>t.querySelector(e),ee=function(t,e){return t.querySelectorAll(e)};var A={};l(A,{CustomQuerySelectorRegistry:()=>y,customQuerySelectors:()=>P});var y=class{#e=new Map;register(e,r){if(!r.queryOne&&r.queryAll){let o=r.queryAll;r.queryOne=(n,i)=>{for(let s of o(n,i))return s;return null}}else if(r.queryOne&&!r.queryAll){let o=r.queryOne;r.queryAll=(n,i)=>{let s=o(n,i);return s?[s]:[]}}else if(!r.queryOne||!r.queryAll)throw new Error("At least one query method must be defined.");this.#e.set(e,{querySelector:r.queryOne,querySelectorAll:r.queryAll})}unregister(e){this.#e.delete(e)}get(e){return this.#e.get(e)}clear(){this.#e.clear()}},P=new y;var R={};l(R,{pierceQuerySelector:()=>te,pierceQuerySelectorAll:()=>re});var te=(t,e)=>{let r=null,o=n=>{let i=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT);do{let s=i.currentNode;s.shadowRoot&&o(s.shadowRoot),!(s instanceof ShadowRoot)&&s!==n&&!r&&s.matches(e)&&(r=s)}while(!r&&i.nextNode())};return t instanceof Document&&(t=t.documentElement),o(t),r},re=(t,e)=>{let r=[],o=n=>{let i=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT);do{let s=i.currentNode;s.shadowRoot&&o(s.shadowRoot),!(s instanceof ShadowRoot)&&s!==n&&s.matches(e)&&r.push(s)}while(i.nextNode())};return t instanceof Document&&(t=t.documentElement),o(t),r};var u=(t,e)=>{if(!t)throw new Error(e)};var oe={childList:!0,subtree:!0,attributes:!0};function ne(t){return t.nodeType===Node.ELEMENT_NODE||t.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function se(t){return t.parentNode??t.host??null}function ie(t,e){let r=t,o;for(;o=se(r);){if(e.has(o))return!0;r=o}return!1}var w=class{#e;#r;#t;#o=new WeakSet;#n;constructor(e,r){this.#e=e,this.#r=r}async start(){let e=this.#n=c.create(),r=await this.#e();if(r){e.resolve(r);return}this.#o=new WeakSet,this.#t=new MutationObserver(async o=>{this.#l(o);let n=await this.#e();n&&(e.resolve(n),await this.stop())}),this.#s(this.#r)}#s(e){!this.#t||this.#o.has(e)||(this.#o.add(e),this.#t.observe(e,oe),this.#i(e))}#l(e){let r=new Set;for(let o of e)for(let n of o.addedNodes)ne(n)&&r.add(n);for(let o of r)ie(o,r)||this.#i(o)}#i(e){let r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT);do{let{shadowRoot:o}=r.currentNode;o&&this.#s(o)}while(r.nextNode())}async stop(){u(this.#n,"Polling never started."),this.#n.finished()||this.#n.reject(new Error("Polling stopped")),this.#t&&(this.#t.disconnect(),this.#t=void 0)}result(){return u(this.#n,"Polling never started."),this.#n.valueOrThrow()}},N=class{#e;#r;constructor(e){this.#e=e}async start(){let e=this.#r=c.create(),r=await this.#e();if(r){e.resolve(r);return}let o=async()=>{if(e.finished())return;let n=await this.#e();if(!n){window.requestAnimationFrame(o);return}e.resolve(n),await this.stop()};window.requestAnimationFrame(o)}async stop(){u(this.#r,"Polling never started."),this.#r.finished()||this.#r.reject(new Error("Polling stopped"))}result(){return u(this.#r,"Polling never started."),this.#r.valueOrThrow()}},T=class{#e;#r;#t;#o;constructor(e,r){this.#e=e,this.#r=r}async start(){let e=this.#o=c.create(),r=await this.#e();if(r){e.resolve(r);return}this.#t=setInterval(async()=>{let o=await this.#e();o&&(e.resolve(o),await this.stop())},this.#r)}async stop(){u(this.#o,"Polling never started."),this.#o.finished()||this.#o.reject(new Error("Polling stopped")),this.#t&&(clearInterval(this.#t),this.#t=void 0)}result(){return u(this.#o,"Polling never started."),this.#o.valueOrThrow()}};var L={};l(L,{PCombinator:()=>V,pQuerySelector:()=>we,pQuerySelectorAll:()=>B});var a=class{static async*map(e,r){for await(let o of e)yield await r(o)}static async*flatMap(e,r){for await(let o of e)yield*r(o)}static async collect(e){let r=[];for await(let o of e)r.push(o);return r}static async first(e){for await(let r of e)return r}};var C={};l(C,{textQuerySelectorAll:()=>m});var le=new Set(["checkbox","image","radio"]),ae=t=>t instanceof HTMLSelectElement||t instanceof HTMLTextAreaElement||t instanceof HTMLInputElement&&!le.has(t.type),ce=new Set(["SCRIPT","STYLE"]),f=t=>!ce.has(t.nodeName)&&!document.head?.contains(t),O=new WeakMap,H=t=>{for(;t;)O.delete(t),t instanceof ShadowRoot?t=t.host:t=t.parentNode},j=new WeakSet,I,ue=()=>{let t=globalThis.MutationObserver;if(!t)throw new Error("MutationObserver is not available in this environment.");return I||(I=new t(e=>{for(let r of e)H(r.target)})),I},d=t=>{let e=O.get(t);if(e||(e={full:"",immediate:[]},!f(t)))return e;let r="";if(ae(t))e.full=t.value,e.immediate.push(t.value),t.addEventListener("input",o=>{H(o.target)},{once:!0,capture:!0});else{for(let o=t.firstChild;o;o=o.nextSibling){if(o.nodeType===Node.TEXT_NODE){e.full+=o.nodeValue??"",r+=o.nodeValue??"";continue}r&&e.immediate.push(r),r="",o.nodeType===Node.ELEMENT_NODE&&(e.full+=d(o).full)}r&&e.immediate.push(r),t instanceof Element&&t.shadowRoot&&(e.full+=d(t.shadowRoot).full),j.has(t)||(ue().observe(t,{childList:!0,characterData:!0,subtree:!0}),j.add(t))}return O.set(t,e),e};var m=function*(t,e){let r=!1;for(let o of t.childNodes)if(o instanceof Element&&f(o)){let n;o.shadowRoot?n=m(o.shadowRoot,e):n=m(o,e);for(let i of n)yield i,r=!0}r||t instanceof Element&&f(t)&&d(t).full.includes(e)&&(yield t)};var k={};l(k,{checkVisibility:()=>fe,pierce:()=>S,pierceAll:()=>M});var de=["hidden","collapse"],fe=(t,e)=>{if(!t)return e===!1;if(e===void 0)return t;let r=t.nodeType===Node.TEXT_NODE?t.parentElement:t;if(!r)return e===!1;let o=window.getComputedStyle(r),n=o&&!de.includes(o.visibility)&&!me(r);return e===n?t:!1};function me(t){let e=t.getBoundingClientRect();return e.width===0||e.height===0}var he=t=>"shadowRoot"in t&&t.shadowRoot instanceof ShadowRoot;function*S(t){he(t)?yield t.shadowRoot:yield t}function*M(t){t=S(t).next().value,yield t;let e=[document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT)];for(let r of e){let o;for(;o=r.nextNode();)o.shadowRoot&&(yield o.shadowRoot,e.push(document.createTreeWalker(o.shadowRoot,NodeFilter.SHOW_ELEMENT)))}}var _={};l(_,{xpathQuerySelectorAll:()=>D});var D=function*(t,e,r=-1){let n=(t.ownerDocument||document).evaluate(e,t,null,XPathResult.ORDERED_NODE_ITERATOR_TYPE),i=[],s;for(;(s=n.iterateNext())&&(i.push(s),!(r&&i.length===r)););for(let h=0;h<i.length;h++)s=i[h],yield s,i[h]=null};var pe=/[-\\w\\P{ASCII}*]/u,V=(r=>(r.Descendent=">>>",r.Child=">>>>",r))(V||{}),U=t=>"querySelectorAll"in t,q=class{#e;#r=[];#t=void 0;elements;constructor(e,r){this.elements=[e],this.#e=r,this.#o()}async run(){for(typeof this.#t=="string"&&this.#t.trimStart()===":scope"&&this.#o();this.#t!==void 0;this.#o()){let e=this.#t;typeof e=="string"?e[0]&&pe.test(e[0])?this.elements=a.flatMap(this.elements,async function*(r){U(r)&&(yield*r.querySelectorAll(e))}):this.elements=a.flatMap(this.elements,async function*(r){if(!r.parentElement){if(!U(r))return;yield*r.querySelectorAll(e);return}let o=0;for(let n of r.parentElement.children)if(++o,n===r)break;yield*r.parentElement.querySelectorAll(`:scope>:nth-child(${o})${e}`)}):this.elements=a.flatMap(this.elements,async function*(r){switch(e.name){case"text":yield*m(r,e.value);break;case"xpath":yield*D(r,e.value);break;case"aria":yield*x(r,e.value);break;default:let o=P.get(e.name);if(!o)throw new Error(`Unknown selector type: ${e.name}`);yield*o.querySelectorAll(r,e.value)}})}}#o(){if(this.#r.length!==0){this.#t=this.#r.shift();return}if(this.#e.length===0){this.#t=void 0;return}let e=this.#e.shift();switch(e){case">>>>":{this.elements=a.flatMap(this.elements,S),this.#o();break}case">>>":{this.elements=a.flatMap(this.elements,M),this.#o();break}default:this.#r=e,this.#o();break}}},Q=class{#e=new WeakMap;calculate(e,r=[]){if(e===null)return r;e instanceof ShadowRoot&&(e=e.host);let o=this.#e.get(e);if(o)return[...o,...r];let n=0;for(let s=e.previousSibling;s;s=s.previousSibling)++n;let i=this.calculate(e.parentNode,[n]);return this.#e.set(e,i),[...i,...r]}},$=(t,e)=>{if(t.length+e.length===0)return 0;let[r=-1,...o]=t,[n=-1,...i]=e;return r===n?$(o,i):r<n?-1:1},ye=async function*(t){let e=new Set;for await(let o of t)e.add(o);let r=new Q;yield*[...e.values()].map(o=>[o,r.calculate(o)]).sort(([,o],[,n])=>$(o,n)).map(([o])=>o)},B=function(t,e){let r=JSON.parse(e);if(r.some(o=>{let n=0;return o.some(i=>(typeof i=="string"?++n:n=0,n>1))}))throw new Error("Multiple deep combinators found in sequence.");return ye(a.flatMap(r,o=>{let n=new q(t,o);return n.run(),n.elements}))},we=async function(t,e){for await(let r of B(t,e))return r;return null};var Ne=Object.freeze({...E,...A,...R,...L,...C,...k,..._,...v,Deferred:c,createFunction:F,createTextContent:d,IntervalPoller:T,isSuitableNodeForTextMatching:f,MutationPoller:w,RAFPoller:N}),Te=Ne;\n';var vs=class{#e=!1;#t=new Set;append(e){this.#r(()=>{this.#t.add(e)})}pop(e){this.#r(()=>{this.#t.delete(e)})}inject(e,t=!1){(this.#e||t)&&e(this.#i()),this.#e=!1}#r(e){e(),this.#e=!0}#i(){return`(() => {
5
5
  const module = {};
@@ -44,5 +44,5 @@ ${s}
44
44
  `,a;try{a=this.#r.send("Runtime.callFunctionOn",{functionDeclaration:o,executionContextId:this.#s,arguments:r.some(f=>f instanceof Ee)?await Promise.all(r.map(f=>u(this,f))):r.map(f=>h(this,f)),returnByValue:e,awaitPromise:!0,userGesture:!0})}catch(f){throw f instanceof TypeError&&f.message.startsWith("Converting circular structure to JSON")&&(f.message+=" Recursive objects are not allowed."),f}let{exceptionDetails:c,result:l}=await a.catch(yo);if(c)throw Cs(c);if(e)return rt(l);return this.#i.createCdpHandle(l);async function u(f,p){return p instanceof Ee&&(p=await p.get(f)),h(f,p)}function h(f,p){if(typeof p=="bigint")return{unserializableValue:`${p.toString()}n`};if(Object.is(p,-0))return{unserializableValue:"-0"};if(Object.is(p,1/0))return{unserializableValue:"Infinity"};if(Object.is(p,-1/0))return{unserializableValue:"-Infinity"};if(Object.is(p,NaN))return{unserializableValue:"NaN"};let w=p&&(p instanceof yt||p instanceof _i)?p:null;if(w){if(w.realm!==f.#i)throw new Error("JSHandles can be evaluated only in the context they were created!");if(w.disposed)throw new Error("JSHandle is disposed!");return w.remoteObject().unserializableValue?{unserializableValue:w.remoteObject().unserializableValue}:w.remoteObject().objectId?{objectId:w.remoteObject().objectId}:{value:w.remoteObject().value}}return{value:p}}}[F](){this.#a.dispose(),this.emit("disposed",void 0),super[F]()}},yo=i=>{if(i.message.includes("Object reference chain is too long"))return{result:{type:"undefined"}};if(i.message.includes("Object couldn't be returned by value"))return{result:{type:"undefined"}};throw i.message.endsWith("Cannot find context with specified id")||i.message.endsWith("Inspected target navigated or closed")?new Error("Execution context was destroyed, most likely because of a navigation."):i};var te;(function(i){i.FrameAttached=Symbol("FrameManager.FrameAttached"),i.FrameNavigated=Symbol("FrameManager.FrameNavigated"),i.FrameDetached=Symbol("FrameManager.FrameDetached"),i.FrameSwapped=Symbol("FrameManager.FrameSwapped"),i.LifecycleEvent=Symbol("FrameManager.LifecycleEvent"),i.FrameNavigatedWithinDocument=Symbol("FrameManager.FrameNavigatedWithinDocument"),i.ConsoleApiCalled=Symbol("FrameManager.ConsoleApiCalled"),i.BindingCalled=Symbol("FrameManager.BindingCalled")})(te||(te={}));var me=Symbol("mainWorld"),Ct=Symbol("puppeteerWorld");var it=class extends pi{#e;#t=new C;#r;#i;#s;#n;constructor(e,t,r,s){super(t),this.#s=e,this.#r=r,this.#n=s}get environment(){return this.#s}get client(){return this.#s.client}get emitter(){return this.#t}setContext(e){this.#e?.[F](),e.once("disposed",this.#a.bind(this)),e.on("consoleapicalled",this.#u.bind(this)),e.on("bindingcalled",this.#c.bind(this)),this.#e=e,this.#t.emit("context",e),this.taskManager.rerunAll()}#a(){this.#e=void 0,"clearDocumentHandle"in this.#s&&this.#s.clearDocumentHandle()}#u(e){this.#t.emit("consoleapicalled",e)}#c(e){this.#t.emit("bindingcalled",e)}hasContext(){return!!this.#e}get context(){return this.#e}#l(){if(this.disposed)throw new Error(`Execution context is not available in detached frame or worker "${this.environment.url()}" (are you trying to evaluate?)`);return this.#e}async#o(){let e=new Error("Execution context was destroyed");return await ne(Z(this.#t,"context").pipe(we(Z(this.#t,"disposed").pipe(oe(()=>{throw e})),ye(this.timeoutSettings.timeout()))))}async evaluateHandle(e,...t){e=Y(this.evaluateHandle.name,e);let r=this.#l();return r||(r=await this.#o()),await r.evaluateHandle(e,...t)}async evaluate(e,...t){e=Y(this.evaluate.name,e);let r=this.#l();return r||(r=await this.#o()),await r.evaluate(e,...t)}async adoptBackendNode(e){let t=this.#l();t||(t=await this.#o());let{object:r}=await this.client.send("DOM.resolveNode",{backendNodeId:e,executionContextId:t.id});return this.createCdpHandle(r)}async adoptHandle(e){if(e.realm===this)return await e.evaluateHandle(r=>r);let t=await this.client.send("DOM.describeNode",{objectId:e.id});return await this.adoptBackendNode(t.node.backendNodeId)}async transferHandle(e){if(e.realm===this||e.remoteObject().objectId===void 0)return e;let t=await this.client.send("DOM.describeNode",{objectId:e.remoteObject().objectId}),r=await this.adoptBackendNode(t.node.backendNodeId);return await e.dispose(),r}createCdpHandle(e){return e.subtype==="node"?new _i(this,e,this.#n):new yt(this,e,this.#n)}[F](){this.#e?.[F](),this.#t.emit("disposed",void 0),this.#t.removeAllListeners(),super[F]()}get origin(){return this.#i}set origin(e){this.#i=e}setWorldId(e){this.#r=e}async extension(){if(this.#s instanceof vt)throw new Error("Unable to get extension from Realm");return this.#r===me?null:typeof this.#r=="string"?(await this.#s._frameManager.page().browser().extensions()).get(this.#r)??null:null}};var vt=class extends Xt{#e;#t;#r;#i;#s;#n;#a=new O;get internalEmitter(){return this.#n}constructor(e,t,r,s,n,o,a){super(t),this.#r=r,this.#t=e,this.#s=a,this.#i=s,this.#e=new it(this,new mt,me,a),this.#n=new C(void 0,a),this.#t.once("Runtime.executionContextCreated",async c=>{this.#e.setContext(new Zt(e,c.context,this.#e,a))}),this.#t.once("Inspector.workerScriptLoaded",()=>{this.#a.resolve()}),this.#e.emitter.on("consoleapicalled",async c=>{try{let l=c.args.map(p=>this.#e.createCdpHandle(p)),u=this.#n.listenerCount(Be.Console)===0,h=this.listenerCount(Be.Console)===0;if(u&&h){for(let p of l)p.dispose().catch(w=>this.#s?.(E.error)?.(w));return}let f=Ti(c,l,this.#r);this.#n.emit(Be.Console,f),h||this.emit(Be.Console,f)}catch(l){this.#s?.(E.error)?.(l)}}),this.#t.on("Runtime.exceptionThrown",n),this.#t.once(B.Disconnected,()=>{this.#e.dispose()}),o?.addClient(this.#t).catch(c=>this.#s?.(E.error)?.(c)),this.#t.send("Runtime.enable").catch(c=>this.#s?.(E.error)?.(c))}mainRealm(){return this.#e}get client(){return this.#t}async close(){switch(this.#i){case ke.SERVICE_WORKER:{await this.client.connection()?.send("Target.closeTarget",{targetId:this.#r}),await this.client.connection()?.send("Target.detachFromTarget",{sessionId:this.client.id()});break}case ke.SHARED_WORKER:{await this.client.connection()?.send("Target.closeTarget",{targetId:this.#r});break}default:await this.evaluate(()=>{self.close()})}}async evaluate(e,...t){return await this.#a.valueOrThrow(),await super.evaluate(e,...t)}async evaluateHandle(e,...t){return await this.#a.valueOrThrow(),await super.evaluateHandle(e,...t)}};var Jc=new Map([["load","load"],["domcontentloaded","DOMContentLoaded"],["networkidle0","networkIdle"],["networkidle2","networkAlmostIdle"]]),er=class{#e;#t;#r;#i=null;#s=new G;#n;#a;#u=O.create();#c=O.create();#l=O.create();#o=new Error("LifecycleWatcher terminated");#h;#p;#m;constructor(e,t,r,s,n){Array.isArray(r)?r=r.slice():typeof r=="string"&&(r=[r]),this.#n=t._loaderId,this.#e=r.map(l=>{let u=Jc.get(l);return P(u,"Unknown value for options.waitUntil: "+l),u}),n?.addEventListener("abort",()=>{n.reason instanceof Error&&(n.reason.cause=this.#o),this.#a.reject(n.reason)}),this.#t=t,this.#r=s,this.#s.use(new C(t._frameManager)).on(te.LifecycleEvent,this.#y.bind(this));let a=this.#s.use(new C(t));a.on(ce.FrameNavigatedWithinDocument,this.#w.bind(this)),a.on(ce.FrameNavigated,this.#b.bind(this)),a.on(ce.FrameSwapped,this.#P.bind(this)),a.on(ce.FrameSwappedByActivation,this.#P.bind(this)),a.on(ce.FrameDetached,this.#v.bind(this));let c=this.#s.use(new C(e));c.on(re.Request,this.#d.bind(this)),c.on(re.Response,this.#g.bind(this)),c.on(re.RequestFailed,this.#f.bind(this)),this.#a=O.create({timeout:this.#r,message:`Navigation timeout of ${this.#r} ms exceeded`}),this.#y()}#d(e){e.frame()!==this.#t||!e.isNavigationRequest()||(this.#i=e,this.#m?.resolve(),this.#m=O.create(),e.response()!==null&&this.#m?.resolve())}#f(e){this.#i?.id===e.id&&this.#m?.resolve()}#g(e){this.#i?.id===e.request().id&&this.#m?.resolve()}#v(e){if(this.#t===e){this.#o.message="Navigating frame was detached",this.#a.resolve(this.#o);return}this.#y()}async navigationResponse(){return await this.#m?.valueOrThrow(),this.#i?this.#i.response():null}sameDocumentNavigationPromise(){return this.#u.valueOrThrow()}newDocumentNavigationPromise(){return this.#l.valueOrThrow()}lifecyclePromise(){return this.#c.valueOrThrow()}terminationPromise(){return this.#a.valueOrThrow()}#w(){this.#h=!0,this.#y()}#b(e){if(e==="BackForwardCacheRestore")return this.#P();this.#y()}#P(){this.#p=!0,this.#y()}#y(){if(!e(this.#t,this.#e))return;this.#c.resolve(),this.#h&&this.#u.resolve(void 0),(this.#p||this.#t._loaderId!==this.#n)&&this.#l.resolve(void 0);function e(t,r){for(let s of r)if(!t._lifecycleEvents.has(s))return!1;for(let s of t.childFrames())if(s._hasStartedLoading&&!e(s,r))return!1;return!0}}dispose(){this.#s.dispose(),this.#o.cause=new Error("LifecycleWatcher disposed"),this.#a.resolve(this.#o)}};var Yc=function(i,e,t){for(var r=arguments.length>2,s=0;s<e.length;s++)t=r?e[s].call(i,t):e[s].call(i);return r?t:void 0},Lt=function(i,e,t,r,s,n){function o(T){if(T!==void 0&&typeof T!="function")throw new TypeError("Function expected");return T}for(var a=r.kind,c=a==="getter"?"get":a==="setter"?"set":"value",l=!e&&i?r.static?i:i.prototype:null,u=e||(l?Object.getOwnPropertyDescriptor(l,r.name):{}),h,f=!1,p=t.length-1;p>=0;p--){var w={};for(var y in r)w[y]=y==="access"?{}:r[y];for(var y in r.access)w.access[y]=r.access[y];w.addInitializer=function(T){if(f)throw new TypeError("Cannot add initializers after decoration has completed");n.push(o(T||null))};var b=(0,t[p])(a==="accessor"?{get:u.get,set:u.set}:u[c],w);if(a==="accessor"){if(b===void 0)continue;if(b===null||typeof b!="object")throw new TypeError("Object expected");(h=o(b.get))&&(u.get=h),(h=o(b.set))&&(u.set=h),(h=o(b.init))&&s.unshift(h)}else(h=o(b))&&(a==="field"?s.unshift(h):u[c]=h)}l&&Object.defineProperty(l,r.name,u),f=!0},Rs=(()=>{let i=so,e=[],t,r,s,n,o,a,c;return class extends i{static{let u=typeof Symbol=="function"&&Symbol.metadata?Object.create(i[Symbol.metadata]??null):void 0;Lt(this,null,t,{kind:"method",name:"goto",static:!1,private:!1,access:{has:h=>"goto"in h,get:h=>h.goto},metadata:u},null,e),Lt(this,null,r,{kind:"method",name:"waitForNavigation",static:!1,private:!1,access:{has:h=>"waitForNavigation"in h,get:h=>h.waitForNavigation},metadata:u},null,e),Lt(this,null,s,{kind:"method",name:"setContent",static:!1,private:!1,access:{has:h=>"setContent"in h,get:h=>h.setContent},metadata:u},null,e),Lt(this,null,n,{kind:"method",name:"addPreloadScript",static:!1,private:!1,access:{has:h=>"addPreloadScript"in h,get:h=>h.addPreloadScript},metadata:u},null,e),Lt(this,null,o,{kind:"method",name:"addExposedFunctionBinding",static:!1,private:!1,access:{has:h=>"addExposedFunctionBinding"in h,get:h=>h.addExposedFunctionBinding},metadata:u},null,e),Lt(this,null,a,{kind:"method",name:"removeExposedFunctionBinding",static:!1,private:!1,access:{has:h=>"removeExposedFunctionBinding"in h,get:h=>h.removeExposedFunctionBinding},metadata:u},null,e),Lt(this,null,c,{kind:"method",name:"waitForDevicePrompt",static:!1,private:!1,access:{has:h=>"waitForDevicePrompt"in h,get:h=>h.waitForDevicePrompt},metadata:u},null,e),u&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:u})}#e=(Yc(this,e),"");#t=!1;#r;_frameManager;_loaderId="";_lifecycleEvents=new Set;_id;_parentId;accessibility;worlds;extensionWorlds={};#i;constructor(u,h,f,p,w){super(w),this._frameManager=u,this.#e="",this._id=h,this._parentId=f,this.#t=!1,this.#r=p,this.#i=w,this._loaderId="",this.worlds={[me]:new it(this,this._frameManager.timeoutSettings,me,w),[Ct]:new it(this,this._frameManager.timeoutSettings,Ct,w)},this.accessibility=new wi(this.worlds[me],h,w),this.on(ce.FrameSwappedByActivation,()=>{this._onLoadingStarted(),this._onLoadingStopped()}),this.registerWorldListeners(this.worlds[me])}registerWorldListeners(u){u.emitter.on("consoleapicalled",h=>{this._frameManager.emit(te.ConsoleApiCalled,[u,h])}),u.emitter.on("bindingcalled",h=>{this._frameManager.emit(te.BindingCalled,[u,h])})}_client(){return this.#r}updateId(u){this._id=u}updateClient(u){this.#r=u}page(){return this._frameManager.page()}async goto(u,h={}){if(!this.page()._isUrlAllowed(u))throw new Error(`Navigation to ${u} is blocked by blocklist/allowlist rules`);let{referer:f=this._frameManager.networkManager.extraHTTPHeaders().referer,referrerPolicy:p=this._frameManager.networkManager.extraHTTPHeaders()["referer-policy"],waitUntil:w=["load"],timeout:y=this._frameManager.timeoutSettings.navigationTimeout()}=h,b=!1,T=new er(this._frameManager.networkManager,this,w,y),W=await O.race([N(this.#r,u,f,p?Zc(p):void 0,this._id),T.terminationPromise()]);W||(W=await O.race([T.terminationPromise(),b?T.newDocumentNavigationPromise():T.sameDocumentNavigationPromise()]));try{if(W)throw W;return await T.navigationResponse()}finally{T.dispose()}async function N(j,$,le,S,m){try{let _=await j.send("Page.navigate",{url:$,referrer:le,frameId:m,referrerPolicy:S});return b=!!_.loaderId,_.errorText==="net::ERR_HTTP_RESPONSE_CODE_FAILURE"?null:_.errorText?new Error(`${_.errorText} at ${$}`):null}catch(_){if(Q(_))return _;throw _}}}async waitForNavigation(u={}){let{waitUntil:h=["load"],timeout:f=this._frameManager.timeoutSettings.navigationTimeout(),signal:p}=u,w=new er(this._frameManager.networkManager,this,h,f,p),y=await O.race([w.terminationPromise(),...u.ignoreSameDocumentNavigation?[]:[w.sameDocumentNavigationPromise()],w.newDocumentNavigationPromise()]);try{if(y)throw y;let b=await O.race([w.terminationPromise(),w.navigationResponse()]);if(b instanceof Error)throw y;return b||null}finally{w.dispose()}}get client(){return this.#r}mainRealm(){return this.worlds[me]}isolatedRealm(){return this.worlds[Ct]}async setContent(u,h={}){let{waitUntil:f=["load"],timeout:p=this._frameManager.timeoutSettings.navigationTimeout()}=h;await this.setFrameContent(u);let w=new er(this._frameManager.networkManager,this,f,p),y=await O.race([w.terminationPromise(),w.lifecyclePromise()]);if(w.dispose(),y)throw y}async setFrameContent(u){await this.#r.send("Page.setDocumentContent",{frameId:this._id,html:u})}url(){return this.#e}parentFrame(){return this._frameManager._frameTree.parentFrame(this._id)||null}childFrames(){return this._frameManager._frameTree.childFrames(this._id)}#s(){return this._frameManager._deviceRequestPromptManager(this.#r)}async addPreloadScript(u){let h=this.parentFrame();if(h&&this.#r===h.client||u.getIdForFrame(this))return;let{identifier:f}=await this.#r.send("Page.addScriptToEvaluateOnNewDocument",{source:u.source});u.setIdForFrame(this,f)}async addExposedFunctionBinding(u){this!==this._frameManager.mainFrame()&&!this._hasStartedLoading||await Promise.all([this.#r.send("Runtime.addBinding",{name:wt+u.name}),this.evaluate(u.initSource).catch(h=>{this.#i?.(E.error)?.(h)})])}async removeExposedFunctionBinding(u){this!==this._frameManager.mainFrame()&&!this._hasStartedLoading||await Promise.all([this.#r.send("Runtime.removeBinding",{name:wt+u.name}),this.evaluate(h=>{globalThis[h]=void 0},u.name).catch(h=>{this.#i?.(E.error)?.(h)})])}async waitForDevicePrompt(u={}){return await this.#s().waitForDevicePrompt(u)}_navigated(u){this._name=u.name,this.#e=`${u.url}${u.urlFragment||""}`}_navigatedWithinDocument(u){this.#e=u}_onLifecycleEvent(u,h){h==="init"&&(this._loaderId=u,this._lifecycleEvents.clear()),this._lifecycleEvents.add(h)}_onLoadingStopped(){this._lifecycleEvents.add("DOMContentLoaded"),this._lifecycleEvents.add("load")}_onLoadingStarted(){this._hasStartedLoading=!0}get detached(){return this.#t}[(t=[V],r=[V],s=[V],n=[V],o=[V],a=[V],c=[V],F)](){if(!this.#t){this.#t=!0,this.worlds[me][F](),this.worlds[Ct][F]();for(let u of Object.values(this.extensionWorlds))u[F]();super[F]()}}exposeFunction(){throw new at}async frameElement(){let u=this.parentFrame();if(!u)return null;let{backendNodeId:h}=await u.client.send("DOM.getFrameOwner",{frameId:this._id});return await u.mainRealm().adoptBackendNode(h)}extensionRealms(){return Object.values(this.extensionWorlds)}}})();function Zc(i){return i.replaceAll(/-./g,e=>e[1].toUpperCase())}var Mi=class{#e=new Map;#t=new Map;#r=new Map;#i;#s=!1;#n=new Map;getMainFrame(){return this.#i}getById(e){return this.#e.get(e)}waitForFrame(e){let t=this.getById(e);if(t)return Promise.resolve(t);let r=O.create();return(this.#n.get(e)||new Set).add(r),r.valueOrThrow()}frames(){return Array.from(this.#e.values())}addFrame(e){this.#e.set(e._id,e),e._parentId?(this.#t.set(e._id,e._parentId),this.#r.has(e._parentId)||this.#r.set(e._parentId,new Set),this.#r.get(e._parentId).add(e._id)):(!this.#i||this.#s)&&(this.#i=e,this.#s=!1),this.#n.get(e._id)?.forEach(t=>t.resolve(e))}removeFrame(e){this.#e.delete(e._id),this.#t.delete(e._id),e._parentId?this.#r.get(e._parentId)?.delete(e._id):this.#s=!0}childFrames(e){let t=this.#r.get(e);return t?Array.from(t).map(r=>this.getById(r)).filter(r=>r!==void 0):[]}parentFrame(e){let t=this.#t.get(e);return t?this.getById(t):void 0}};var Ft=class extends br{id;#e;#t;#r;#i;#s;#n=!1;#a;#u={};#c;#l;#o;get client(){return this.#e}set client(e){this.#e=e}constructor(e,t,r,s,n,o,a){super(),this.#o=a,this.#e=e,this.id=n.requestId,this.#t=n.requestId===n.loaderId&&n.type==="Document",this._interceptionId=r,this.#r=n.request.url+(n.request.urlFragment??""),this.#i=(n.type||"other").toLowerCase(),this.#s=n.request.method,n.request.postDataEntries&&n.request.postDataEntries.length>0?this.#a=new TextDecoder().decode(Or(n.request.postDataEntries.map(c=>c.bytes?Ue(c.bytes,!0):null).filter(c=>c!==null))):this.#a=n.request.postData,this.#n=n.request.hasPostData??!1,this.#c=t,this._redirectChain=o,this.#l=n.initiator,this.interception.enabled=s,this.updateHeaders(n.request.headers)}updateHeaders(e){for(let[t,r]of Object.entries(e))this.#u[t.toLowerCase()]=r}url(){return this.#r}resourceType(){return this.#i}method(){return this.#s}postData(){return this.#a}hasPostData(){return this.#n}async fetchPostData(){try{return(await this.#e.send("Network.getRequestPostData",{requestId:this.id})).postData}catch(e){this.#o?.(E.error)?.(e);return}}headers(){return structuredClone(this.#u)}response(){return this._response}frame(){return this.#c}isNavigationRequest(){return this.#t}initiator(){return this.#l}redirectChain(){return this._redirectChain.slice()}failure(){return this._failureText?{errorText:this._failureText}:null}canBeIntercepted(){return!this.url().startsWith("data:")&&!this._fromMemoryCache}async _continue(e={}){let{url:t,method:r,postData:s,headers:n}=e;this.interception.handled=!0;let o=s?qn(s):void 0;if(this._interceptionId===void 0)throw new Error("HTTPRequest is missing _interceptionId needed for Fetch.continueRequest");await this.#e.send("Fetch.continueRequest",{requestId:this._interceptionId,url:t,method:r,postData:o,headers:n?Ts(n):void 0}).catch(a=>(this.interception.handled=!1,ai(a,this.#o)))}async _respond(e){this.interception.handled=!0;let t;e.body&&(t=br.getResponse(e.body));let r={};if(e.headers)for(let n of Object.keys(e.headers)){let o=e.headers[n];r[n.toLowerCase()]=Array.isArray(o)?o.map(a=>String(a)):String(o)}e.contentType&&(r["content-type"]=e.contentType),t?.contentLength&&!("content-length"in r)&&(r["content-length"]=String(t.contentLength));let s=e.status||200;if(this._interceptionId===void 0)throw new Error("HTTPRequest is missing _interceptionId needed for Fetch.fulfillRequest");await this.#e.send("Fetch.fulfillRequest",{requestId:this._interceptionId,responseCode:s,responsePhrase:no[s],responseHeaders:Ts(r),body:t?.base64}).catch(n=>(this.interception.handled=!1,ai(n,this.#o)))}async _abort(e){if(this.interception.handled=!0,this._interceptionId===void 0)throw new Error("HTTPRequest is missing _interceptionId needed for Fetch.failRequest");await this.#e.send("Fetch.failRequest",{requestId:this._interceptionId,errorReason:e||"Failed"}).catch(t=>ai(t,this.#o))}};var xi=class{#e;#t;#r;#i;#s;#n;constructor(e){this.#e=e.subjectName,this.#t=e.issuer,this.#r=e.validFrom,this.#i=e.validTo,this.#s=e.protocol,this.#n=e.sanList}issuer(){return this.#t}validFrom(){return this.#r}validTo(){return this.#i}protocol(){return this.#s}subjectName(){return this.#e}subjectAlternativeNames(){return this.#n}};function vo(i,e){return e.includes(`
45
45
  `)?e.split(`
46
46
  `).map(t=>t.trim()).filter(Boolean).join(i==="set-cookie"?`
47
- `:", "):e}var Sr=class extends ci{#e;#t=null;#r=O.create();#i;#s;#n;#a;#u;#c={};#l;#o;constructor(e,t,r){super(),this.#e=e,this.#i={ip:t.remoteIPAddress,port:t.remotePort},this.#n=this.#h(r)||t.statusText,this.#a=!!t.fromDiskCache,this.#u=!!t.fromServiceWorker,this.#s=r?r.statusCode:t.status;let s=r?r.headers:t.headers;for(let[n,o]of Object.entries(s)){let a=n.toLowerCase();this.#c[a]=vo(a,o)}this.#l=t.securityDetails?new xi(t.securityDetails):null,this.#o=t.timing||null}#h(e){if(!e||!e.headersText)return;let t=e.headersText.split("\r",1)[0];if(!t||t.length>1e3)return;let r=t.match(/[^ ]* [^ ]* (.*)/);if(!r)return;let s=r[1];if(s)return s}_resolveBody(e){return e?this.#r.reject(e):this.#r.resolve()}remoteAddress(){return this.#i}url(){return this.#e.url()}status(){return this.#s}statusText(){return this.#n}headers(){return this.#c}securityDetails(){return this.#l}timing(){return this.#o}content(){return this.#t||(this.#t=this.#r.valueOrThrow().then(async()=>{try{let e=await this.#e.client.send("Network.getResponseBody",{requestId:this.#e.id});return Ue(e.body,e.base64Encoded)}catch(e){throw e instanceof Le&&e.originalMessage==="No resource with given identifier found"?new Le("Could not load response body for this request. This might happen if the request is a preflight request."):e}})),this.#t}request(){return this.#e}fromCache(){return this.#a||this.#e._fromMemoryCache}fromServiceWorker(){return this.#u}frame(){return this.#e.frame()}};var Ii=class{#e=new Map;#t=new Map;#r=new Map;#i=new Map;#s=new Map;#n=new Map;#a=new Map;forget(e){this.#e.delete(e),this.#t.delete(e),this.#i.delete(e),this.#a.delete(e),this.#n.delete(e),this.#s.delete(e)}requestExtraInfo(e){return this.#i.has(e)||this.#i.set(e,[]),this.#i.get(e)}responseExtraInfo(e){return this.#s.has(e)||this.#s.set(e,[]),this.#s.get(e)}queuedRedirectInfo(e){return this.#n.has(e)||this.#n.set(e,[]),this.#n.get(e)}queueRedirectInfo(e,t){this.queuedRedirectInfo(e).push(t)}takeQueuedRedirectInfo(e){return this.queuedRedirectInfo(e).shift()}inFlightRequestsCount(){let e=0;for(let t of this.#r.values())t.response()||e++;return e}storeRequestWillBeSent(e,t){this.#e.set(e,t)}getRequestWillBeSent(e){return this.#e.get(e)}forgetRequestWillBeSent(e){this.#e.delete(e)}getRequestPaused(e){return this.#t.get(e)}forgetRequestPaused(e){this.#t.delete(e)}storeRequestPaused(e,t){this.#t.set(e,t)}getRequest(e){return this.#r.get(e)}storeRequest(e,t){this.#r.set(e,t)}forgetRequest(e){this.#r.delete(e)}getQueuedEventGroup(e){return this.#a.get(e)}queueEventGroup(e,t){this.#a.set(e,t)}forgetQueuedEventGroup(e){this.#a.delete(e)}printState(){function e(t,r){return r instanceof Map?{dataType:"Map",value:Array.from(r.entries())}:r instanceof Ft?{dataType:"CdpHTTPRequest",value:`${r.id}: ${r.url()}`}:r}console.log("httpRequestsMap",JSON.stringify(this.#r,e,2)),console.log("requestWillBeSentMap",JSON.stringify(this.#e,e,2)),console.log("requestWillBeSentMap",JSON.stringify(this.#s,e,2)),console.log("requestWillBeSentMap",JSON.stringify(this.#t,e,2))}};var Ai=class extends C{#e;#t=new Ii;#r;#i=null;#s=new Set;#n=!1;#a;#u;#c;#l;#o;#h;#p;#m=!1;#d=[["Fetch.requestPaused",this.#k],["Fetch.authRequired",this.#I],["Network.requestWillBeSent",this.#M],["Network.requestWillBeSentExtraInfo",this.#D],["Network.requestServedFromCache",this.#N],["Network.responseReceived",this.#H],["Network.loadingFinished",this.#O],["Network.loadingFailed",this.#q],["Network.responseReceivedExtraInfo",this.#W],[B.Disconnected,this.#b]];#f=new Map;#g;#v;constructor(e,t=!0,r){super(void 0,r),this.#e=e,this.#g=t??!0,this.#v=r}#w(e){return Q(e)&&(je(e)||e.message.includes("Not supported")||e.message.includes("wasn't found"))}async addClient(e){if(!this.#g||this.#f.has(e))return;let t=new G;this.#f.set(e,t);let r=t.use(new C(e));for(let[s,n]of this.#d)r.on(s,o=>n.bind(this)(e,o));try{await Promise.all([e.send("Network.enable"),this.#P(e),this.#E(e),this.#T(e),this.#_(e),this.#S(e)])}catch(s){if(this.#w(s))return;throw s}}async#b(e){this.#f.get(e)?.dispose(),this.#f.delete(e)}async authenticate(e){this.#i=e;let t=this.#n||!!this.#i;t!==this.#a&&(this.#a=t,await this.#y(this.#_.bind(this)))}async setExtraHTTPHeaders(e){let t={};for(let[r,s]of Object.entries(e))P(Oe(s),`Expected value of header "${r}" to be String, but "${typeof s}" is found.`),t[r.toLowerCase()]=s;this.#r=t,await this.#y(this.#P.bind(this))}async#P(e){if(this.#r!==void 0)try{await e.send("Network.setExtraHTTPHeaders",{headers:this.#r})}catch(t){if(this.#w(t))return;throw t}}extraHTTPHeaders(){return Object.assign({},this.#r)}inFlightRequestsCount(){return this.#t.inFlightRequestsCount()}async setOfflineMode(e){this.#c||(this.#c={offline:!1,upload:-1,download:-1,latency:0}),this.#c.offline=e,await this.#y(this.#E.bind(this))}async emulateNetworkConditions(e){this.#c||(this.#c={offline:e?.offline??!1,upload:-1,download:-1,latency:0}),this.#c.upload=e?e.upload:-1,this.#c.download=e?e.download:-1,this.#c.latency=e?e.latency:0,this.#c.offline=e?.offline??!1,await this.#y(this.#E.bind(this))}async#y(e){await Promise.all(Array.from(this.#f.keys()).map(t=>e(t)))}async#E(e){if(this.#c!==void 0)try{await e.send("Network.emulateNetworkConditions",{offline:this.#c.offline,latency:this.#c.latency,uploadThroughput:this.#c.upload,downloadThroughput:this.#c.download})}catch(t){if(this.#w(t))return;throw t}}async setUserAgent(e,t,r){this.#l=e,this.#o=t,this.#h=r,await this.#y(this.#S.bind(this))}async setAcceptLanguage(e){this.#p=e,await this.#y(this.#S.bind(this))}async#S(e){let t=this.#l===void 0&&this.#o===void 0&&this.#p===void 0&&this.#h===void 0;if(t&&!this.#m)return;let r=this.#l??await this.#e.page().browser().userAgent();if(r!==void 0)try{await e.send("Network.setUserAgentOverride",{userAgent:r,acceptLanguage:this.#p,userAgentMetadata:this.#o,platform:this.#h}),this.#m=!t}catch(s){if(this.#w(s))return;throw s}}async setCacheEnabled(e){this.#u=!e,await this.#y(this.#T.bind(this))}async setRequestInterception(e){this.#n=e;let t=this.#n||!!this.#i;t!==this.#a&&(this.#a=t,await this.#y(this.#_.bind(this)))}async#_(e){if(this.#a!==void 0){this.#u===void 0&&(this.#u=!1);try{this.#a?await Promise.all([this.#T(e),e.send("Fetch.enable",{handleAuthRequests:!0,patterns:[{urlPattern:"*"}]})]):await Promise.all([this.#T(e),e.send("Fetch.disable")])}catch(t){if(this.#w(t))return;throw t}}}async#T(e){if(this.#u!==void 0)try{await e.send("Network.setCacheDisabled",{cacheDisabled:this.#u})}catch(t){if(this.#w(t))return;throw t}}#M(e,t){if(this.#n&&!t.request.url.startsWith("data:")){let{requestId:r}=t;this.#t.storeRequestWillBeSent(r,t);let s=this.#t.getRequestPaused(r);if(s){let{requestId:n}=s;this.#x(t,s),this.#A(e,t,n),this.#t.forgetRequestPaused(r)}return}this.#A(e,t,void 0)}#I(e,t){let r="Default";this.#s.has(t.requestId)?r="CancelAuth":this.#i&&(r="ProvideCredentials",this.#s.add(t.requestId));let{username:s,password:n}=this.#i||{username:void 0,password:void 0};e.send("Fetch.continueWithAuth",{requestId:t.requestId,authChallengeResponse:{response:r,username:s,password:n}}).catch(o=>{this.#v?.(E.error)?.(o)})}#k(e,t){!this.#n&&this.#a&&e.send("Fetch.continueRequest",{requestId:t.requestId}).catch(o=>{this.#v?.(E.error)?.(o)});let{networkId:r,requestId:s}=t;if(!r){this.#R(e,t);return}let n=(()=>{let o=this.#t.getRequestWillBeSent(r);if(o&&(o.request.url!==t.request.url||o.request.method!==t.request.method)){this.#t.forgetRequestWillBeSent(r);return}return o})();n?(this.#x(n,t),this.#A(e,n,s)):this.#t.storeRequestPaused(r,t)}#x(e,t){e.request.headers={...e.request.headers,...t.request.headers}}#R(e,t){let r=t.frameId?this.#e.frame(t.frameId):null,s=new Ft(e,r,t.requestId,this.#n,t,[],this.#v);this.emit(re.Request,s),s.finalizeInterceptions()}#A(e,t,r,s=!1){let n=[];if(t.redirectResponse){let l=null;if(t.redirectHasExtraInfo&&(l=this.#t.responseExtraInfo(t.requestId).shift(),!l)){this.#t.queueRedirectInfo(t.requestId,{event:t,fetchRequestId:r});return}let u=this.#t.getRequest(t.requestId);if(u){this.#F(e,u,t.redirectResponse,l),n=u._redirectChain;let h=this.#t.requestExtraInfo(t.requestId).shift();h&&u.updateHeaders(h.headers)}}let o=t.frameId?this.#e.frame(t.frameId):null,a=new Ft(e,o,r,this.#n,t,n,this.#v),c=this.#t.requestExtraInfo(t.requestId).shift();c&&a.updateHeaders(c.headers),a._fromMemoryCache=s,this.#t.storeRequest(t.requestId,a),this.emit(re.Request,a),a.finalizeInterceptions()}#D(e,t){let r=this.#t.getRequest(t.requestId);r?r.updateHeaders(t.headers):this.#t.requestExtraInfo(t.requestId).push(t)}#N(e,t){let r=this.#t.getRequestWillBeSent(t.requestId),s=this.#t.getRequest(t.requestId);if(s&&(s._fromMemoryCache=!0),!s&&r&&(this.#A(e,r,void 0,!0),s=this.#t.getRequest(t.requestId)),!s){this.#v?.(E.error)?.(new Error(`Request ${t.requestId} was served from cache but we could not find the corresponding request object`));return}this.emit(re.RequestServedFromCache,s)}#F(e,t,r,s){let n=new Sr(t,r,s);t._response=n,t._redirectChain.push(t),n._resolveBody(new Error("Response body is unavailable for redirect responses")),this.#L(t,!1),this.emit(re.Response,n),this.emit(re.RequestFinished,t)}#C(e,t,r){let s=this.#t.getRequest(t.requestId);if(!s)return;this.#t.responseExtraInfo(t.requestId).length&&this.#v?.(E.error)?.(new Error("Unexpected extraInfo events for request "+t.requestId)),t.response.fromDiskCache&&(r=null);let o=new Sr(s,t.response,r);s._response=o,this.emit(re.Response,o)}#H(e,t){let r=this.#t.getRequest(t.requestId),s=null;if(r&&!r._fromMemoryCache&&t.hasExtraInfo&&(s=this.#t.responseExtraInfo(t.requestId).shift(),!s)){this.#t.queueEventGroup(t.requestId,{responseReceivedEvent:t});return}this.#C(e,t,s)}#W(e,t){let r=this.#t.takeQueuedRedirectInfo(t.requestId);if(r){this.#t.responseExtraInfo(t.requestId).push(t),this.#A(e,r.event,r.fetchRequestId);return}let s=this.#t.getQueuedEventGroup(t.requestId);if(s){this.#t.forgetQueuedEventGroup(t.requestId),this.#C(e,s.responseReceivedEvent,t),s.loadingFinishedEvent&&this.#B(e,s.loadingFinishedEvent),s.loadingFailedEvent&&this.#U(e,s.loadingFailedEvent);return}this.#t.responseExtraInfo(t.requestId).push(t)}#L(e,t){let r=e.id,s=e._interceptionId;this.#t.forgetRequest(r),s!==void 0&&this.#s.delete(s),t&&this.#t.forget(r)}#O(e,t){let r=this.#t.getQueuedEventGroup(t.requestId);r?r.loadingFinishedEvent=t:this.#B(e,t)}#B(e,t){let r=this.#t.getRequest(t.requestId);r&&(this.#K(e,r),r.response()&&r.response()?._resolveBody(),this.#L(r,!0),this.emit(re.RequestFinished,r))}#q(e,t){let r=this.#t.getQueuedEventGroup(t.requestId);r?r.loadingFailedEvent=t:this.#U(e,t)}#U(e,t){let r=this.#t.getRequest(t.requestId);if(!r)return;this.#K(e,r),r._failureText=t.errorText;let s=r.response();s&&s._resolveBody(),this.#L(r,!0),this.emit(re.RequestFailed,r)}#K(e,t){e!==t.client&&(t.client=e)}};var Ci=class{#e;#t;constructor(e){this.#e=e.code,this.#t=e.details}get code(){return this.#e}get details(){return this.#t}};var el=function(i,e,t){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var r,s;if(t){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=e[Symbol.asyncDispose]}if(r===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=e[Symbol.dispose],t&&(s=r)}if(typeof r!="function")throw new TypeError("Object not disposable.");s&&(r=function(){try{s.call(this)}catch(n){return Promise.reject(n)}}),i.stack.push({value:e,dispose:r,async:t})}else t&&i.stack.push({async:!0});return e},tl=(function(i){return function(e){function t(o){e.error=e.hasError?new i(o,e.error,"An error was suppressed during disposal."):o,e.hasError=!0}var r,s=0;function n(){for(;r=e.stack.pop();)try{if(!r.async&&s===1)return s=0,e.stack.push(r),Promise.resolve().then(n);if(r.dispose){var o=r.dispose.call(r.value);if(r.async)return s|=2,Promise.resolve(o).then(n,function(a){return t(a),n()})}else s|=1}catch(a){t(a)}if(s===1)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}return n()}})(typeof SuppressedError=="function"?SuppressedError:function(i,e,t){var r=new Error(t);return r.name="SuppressedError",r.error=i,r.suppressed=e,r}),bo="chrome-extension://",Li=class extends C{#e;#t;#r;#i=new Set;#s;#n=new Map;#a=new Set;_frameTree=new Mi;#u=new Set;#c=new WeakMap;#l;#o;get timeoutSettings(){return this.#r}get networkManager(){return this.#t}get client(){return this.#s}constructor(e,t,r,s){super(void 0,s),this.#s=e,this.#e=t,this.#t=new Ai(this,t.browser().isNetworkEnabled(),s),this.#r=r,this.#o=s,this.setupEventListeners(this.#s),e.once(B.Disconnected,()=>{this.#h(e).catch(n=>{this.#o?.(E.error)?.(n)})})}async#h(e){let t={stack:[],error:void 0,hasError:!1};try{let r=this._frameTree.getMainFrame();if(!r||this.#s!==e)return;if(!this.#e.browser().connected||this.#e.isClosed()){this.#T(r);return}for(let c of r.childFrames())this.#T(c);let s=O.create(),n=el(t,new G,!1),o=n.use(new C(r)),a=n.use(new C(this.#e));o.once(ce.FrameSwappedByActivation,()=>{s.resolve()}),a.once("close",()=>{s.reject(new Error("Page closed"))});try{await s.valueOrThrow()}catch{this.#T(r)}}catch(r){t.error=r,t.hasError=!0}finally{tl(t)}}async swapFrameTree(e){this.#s=e;let t=this._frameTree.getMainFrame();t&&(this.#u.add(this.#s.target()._targetId),this._frameTree.removeFrame(t),t.updateId(this.#s.target()._targetId),this._frameTree.addFrame(t),t.updateClient(e)),this.setupEventListeners(e),e.once(B.Disconnected,()=>{this.#h(e).catch(r=>{this.#o?.(E.error)?.(r)})}),await this.initialize(e,t),await this.#t.addClient(e),t&&t.emit(ce.FrameSwappedByActivation,void 0)}async registerSpeculativeSession(e){await this.#t.addClient(e)}setupEventListeners(e){e.on("Page.frameAttached",async t=>{await this.#l?.valueOrThrow(),this.#v(e,t.frameId,t.parentFrameId)}),e.on("Page.frameNavigated",async t=>{this.#u.add(t.frame.id),await this.#l?.valueOrThrow(),this.#w(t.frame,t.type)}),e.on("Page.navigatedWithinDocument",async t=>{await this.#l?.valueOrThrow(),this.#P(t.frameId,t.url)}),e.on("Page.frameDetached",async t=>{await this.#l?.valueOrThrow(),this.#y(t.frameId,t.reason)}),e.on("Page.frameStartedLoading",async t=>{await this.#l?.valueOrThrow(),this.#d(t.frameId)}),e.on("Page.frameStoppedLoading",async t=>{await this.#l?.valueOrThrow(),this.#f(t.frameId)}),e.on("Runtime.executionContextCreated",async t=>{await this.#l?.valueOrThrow(),this.#_(t.context,e)}),e.on("Page.lifecycleEvent",async t=>{await this.#l?.valueOrThrow(),this.#m(t)}),e.on("Audits.issueAdded",t=>{this.#e.emit("issue",new Ci(t.issue))})}async initialize(e,t){try{this.#l?.resolve(),this.#l=O.create(),await Promise.all([this.#t.addClient(e),e.send("Page.enable"),e.send("Page.getFrameTree").then(({frameTree:r})=>{this.#g(e,r),this.#l?.resolve()}),e.send("Page.setLifecycleEventsEnabled",{enabled:!0}),e.send("Runtime.enable").then(()=>this.#b(e,ps)),...(t?Array.from(this.#n.values()):[]).map(r=>t?.addPreloadScript(r)),...(t?Array.from(this.#a.values()):[]).map(r=>t?.addExposedFunctionBinding(r)),this.#e.browser().isIssuesEnabled()&&e.send("Audits.enable")])}catch(r){if(this.#l?.resolve(),Q(r)&&je(r))return;throw r}}page(){return this.#e}mainFrame(){let e=this._frameTree.getMainFrame();return P(e,"Requesting main frame too early!"),e}frames(){return Array.from(this._frameTree.frames())}frame(e){return this._frameTree.getById(e)||null}async#p(e){await Promise.all(this.frames().map(async t=>{try{await e(t)}catch(r){if(t._client()===this.#s||!Q(r)||!je(r))throw r}}))}async addExposedFunctionBinding(e){this.#a.add(e),await this.#p(t=>t.addExposedFunctionBinding(e))}async removeExposedFunctionBinding(e){this.#a.delete(e),await this.#p(t=>t.removeExposedFunctionBinding(e))}async evaluateOnNewDocument(e){let{identifier:t}=await this.mainFrame()._client().send("Page.addScriptToEvaluateOnNewDocument",{source:e}),r=new Ei(this.mainFrame(),t,e);return this.#n.set(t,r),await this.#p(s=>s.addPreloadScript(r)),{identifier:t}}async removeScriptToEvaluateOnNewDocument(e){let t=this.#n.get(e);if(!t)throw new Error(`Script to evaluate on new document with id ${e} not found`);this.#n.delete(e),await Promise.all(this.frames().map(r=>{let s=t.getIdForFrame(r);if(s)return r._client().send("Page.removeScriptToEvaluateOnNewDocument",{identifier:s}).catch(n=>{this.#o?.(E.error)?.(n)})}))}onAttachedToTarget(e){if(e._getTargetInfo().type!=="iframe")return;let t=this.frame(e._getTargetInfo().targetId);t&&t.updateClient(e._session()),this.setupEventListeners(e._session()),this.initialize(e._session(),t).catch(r=>{this.#o?.(E.error)?.(r)})}_deviceRequestPromptManager(e){let t=this.#c.get(e);return t===void 0&&(t=new ki(e,this.#r),this.#c.set(e,t)),t}#m(e){let t=this.frame(e.frameId);t&&(t._onLifecycleEvent(e.loaderId,e.name),this.emit(te.LifecycleEvent,t),t.emit(ce.LifecycleEvent,void 0))}#d(e){let t=this.frame(e);t&&t._onLoadingStarted()}#f(e){let t=this.frame(e);t&&(t._onLoadingStopped(),this.emit(te.LifecycleEvent,t),t.emit(ce.LifecycleEvent,void 0))}#g(e,t){if(t.frame.parentId&&this.#v(e,t.frame.id,t.frame.parentId),this.#u.has(t.frame.id)?this.#u.delete(t.frame.id):this.#w(t.frame,"Navigation"),!!t.childFrames)for(let r of t.childFrames)this.#g(e,r)}#v(e,t,r){let s=this.frame(t);if(s){let n=this.frame(r);e&&n&&s.client!==n?.client&&s.updateClient(e);return}s=new Rs(this,t,r,e,this.#o),this._frameTree.addFrame(s),this.emit(te.FrameAttached,s)}async#w(e,t){let r=e.id,s=!e.parentId,n=this._frameTree.getById(r);if(n)for(let o of n.childFrames())this.#T(o);s&&(n?(this._frameTree.removeFrame(n),n._id=r):n=new Rs(this,r,void 0,this.#s,this.#o),this._frameTree.addFrame(n)),n=await this._frameTree.waitForFrame(r),n._navigated(e),this.emit(te.FrameNavigated,n),n.emit(ce.FrameNavigated,t)}async#b(e,t){let r=`${e.id()}:${t}`;this.#i.has(r)||(await e.send("Page.addScriptToEvaluateOnNewDocument",{source:`//# sourceURL=${xe.INTERNAL_URL}`,worldName:t}),await Promise.all(this.frames().filter(s=>s.client===e).map(s=>e.send("Page.createIsolatedWorld",{frameId:s._id,worldName:t,grantUniveralAccess:!0}).catch(n=>{this.#o?.(E.error)?.(n)}))),this.#i.add(r))}#P(e,t){let r=this.frame(e);r&&(r._navigatedWithinDocument(t),this.emit(te.FrameNavigatedWithinDocument,r),r.emit(ce.FrameNavigatedWithinDocument,void 0),this.emit(te.FrameNavigated,r),r.emit(ce.FrameNavigated,"Navigation"))}#y(e,t){let r=this.frame(e);if(r)switch(t){case"remove":this.#T(r);break;case"swap":this.emit(te.FrameSwapped,r),r.emit(ce.FrameSwapped,void 0);break}}#E(e){return e.startsWith(bo)}#S(e){if(!e||!this.#E(e))return null;let t=e.substring(bo.length),r=t.indexOf("/");return r===-1?t:t.substring(0,r)}#_(e,t){let r=e.auxData,s=e.origin,n=r&&r.frameId,o=typeof n=="string"?this.frame(n):void 0,a;if(o){if(o.client!==t)return;if(e.auxData&&e.auxData.isDefault)a=o.worlds[me];else if(e.name===ps)a=o.worlds[Ct];else if(this.#E(s)){let l=this.#S(s);if(!l){this.#o?.(E.error)?.("Error while parsing extension id");return}o.extensionWorlds[l]?a=o.extensionWorlds[l]:(a=new it(o,this.timeoutSettings,l,this.#o),o.extensionWorlds[l]=a,o.registerWorldListeners(a),a.origin=s,a.setWorldId(l))}}if(!a)return;let c=new Zt(o?.client||this.#s,e,a,this.#o);a.setContext(c)}#T(e){for(let t of e.childFrames())this.#T(t);this._frameTree.removeFrame(e),this.emit(te.FrameDetached,e),e.emit(ce.FrameDetached,e),e[F]()}};var Fi=class extends li{#e;#t=new Set;_modifiers=0;constructor(e){super(),this.#e=e}updateClient(e){this.#e=e}async down(e,t={text:void 0,commands:[]}){let r=this.#i(e),s=this.#t.has(r.code);this.#t.add(r.code),this._modifiers|=this.#r(r.key);let n=t.text===void 0?r.text:t.text;await this.#e.send("Input.dispatchKeyEvent",{type:n?"keyDown":"rawKeyDown",modifiers:this._modifiers,windowsVirtualKeyCode:r.keyCode,code:r.code,key:r.key,text:n,unmodifiedText:n,autoRepeat:s,location:r.location,isKeypad:r.location===3,commands:t.commands})}#r(e){return e==="Alt"?1:e==="Control"?2:e==="Meta"?4:e==="Shift"?8:0}#i(e){let t=this._modifiers&8,r={key:"",keyCode:0,code:"",text:"",location:0},s=Qi[e];return P(s,`Unknown key: "${e}"`),s.key&&(r.key=s.key),t&&s.shiftKey&&(r.key=s.shiftKey),s.keyCode&&(r.keyCode=s.keyCode),t&&s.shiftKeyCode&&(r.keyCode=s.shiftKeyCode),s.code&&(r.code=s.code),s.location&&(r.location=s.location),r.key.length===1&&(r.text=r.key),s.text&&(r.text=s.text),t&&s.shiftText&&(r.text=s.shiftText),this._modifiers&-9&&(r.text=""),r}async up(e){let t=this.#i(e);this._modifiers&=~this.#r(t.key),this.#t.delete(t.code),await this.#e.send("Input.dispatchKeyEvent",{type:"keyUp",modifiers:this._modifiers,key:t.key,windowsVirtualKeyCode:t.keyCode,code:t.code,location:t.location})}async sendCharacter(e){await this.#e.send("Input.insertText",{text:e})}charIsKey(e){return!!Qi[e]}async type(e,t={}){let r=t.delay||void 0;for(let s of e)this.charIsKey(s)?await this.press(s,{delay:r}):(r&&await new Promise(n=>setTimeout(n,r)),await this.sendCharacter(s))}async press(e,t={}){let{delay:r=null}=t;await this.down(e,t),r&&await new Promise(s=>setTimeout(s,t.delay)),await this.up(e)}},So=i=>{switch(i){case de.Left:return 1;case de.Right:return 2;case de.Middle:return 4;case de.Back:return 8;case de.Forward:return 16}},rl=i=>i&1?de.Left:i&2?de.Right:i&4?de.Middle:i&8?de.Back:i&16?de.Forward:"none",Oi=class extends ui{#e;#t;constructor(e,t){super(),this.#e=e,this.#t=t}updateClient(e){this.#e=e}#r={position:{x:0,y:0},buttons:0};get#i(){return Object.assign({...this.#r},...this.#s)}#s=[];#n(){let e={};this.#s.push(e);let t=()=>{this.#s.splice(this.#s.indexOf(e),1)};return{update:r=>{Object.assign(e,r)},commit:()=>{this.#r={...this.#r,...e},t()},rollback:t}}async#a(e){let{update:t,commit:r,rollback:s}=this.#n();try{await e(t),r()}catch(n){throw s(),n}}async reset(){let e=[];for(let[t,r]of[[1,de.Left],[4,de.Middle],[2,de.Right],[16,de.Forward],[8,de.Back]])this.#i.buttons&t&&e.push(this.up({button:r}));(this.#i.position.x!==0||this.#i.position.y!==0)&&e.push(this.move(0,0)),await Promise.all(e)}async move(e,t,r={}){let{steps:s=1}=r,n=this.#i.position,o={x:e,y:t};for(let a=1;a<=s;a++)await this.#a(c=>{c({position:{x:n.x+(o.x-n.x)*(a/s),y:n.y+(o.y-n.y)*(a/s)}});let{buttons:l,position:u}=this.#i;return this.#e.send("Input.dispatchMouseEvent",{type:"mouseMoved",modifiers:this.#t._modifiers,buttons:l,button:rl(l),...u})})}async down(e={}){let{button:t=de.Left,clickCount:r=1}=e,s=So(t);if(!s)throw new Error(`Unsupported mouse button: ${t}`);if(this.#i.buttons&s)throw new Error(`'${t}' is already pressed.`);await this.#a(n=>{n({buttons:this.#i.buttons|s});let{buttons:o,position:a}=this.#i;return this.#e.send("Input.dispatchMouseEvent",{type:"mousePressed",modifiers:this.#t._modifiers,clickCount:r,buttons:o,button:t,...a})})}async up(e={}){let{button:t=de.Left,clickCount:r=1}=e,s=So(t);if(!s)throw new Error(`Unsupported mouse button: ${t}`);if(!(this.#i.buttons&s))throw new Error(`'${t}' is not pressed.`);await this.#a(n=>{n({buttons:this.#i.buttons&~s});let{buttons:o,position:a}=this.#i;return this.#e.send("Input.dispatchMouseEvent",{type:"mouseReleased",modifiers:this.#t._modifiers,clickCount:r,buttons:o,button:t,...a})})}async click(e,t,r={}){let{delay:s,count:n=1}=r;if(n<1)throw new Error("Click must occur a positive number of times.");let o=[this.move(e,t)];for(let a=1;a<n;++a)o.push(this.down({...r,clickCount:a}),this.up({...r,clickCount:a}));o.push(this.down({...r,clickCount:n})),typeof s=="number"&&(await Promise.all(o),o.length=0,await new Promise(a=>{setTimeout(a,s)})),o.push(this.up({...r,clickCount:n})),await Promise.all(o)}async wheel(e={}){let{deltaX:t=0,deltaY:r=0}=e,{position:s,buttons:n}=this.#i;await this.#e.send("Input.dispatchMouseEvent",{type:"mouseWheel",pointerType:"mouse",modifiers:this.#t._modifiers,deltaY:r,deltaX:t,buttons:n,...s})}async drag(e,t){let r=new Promise(s=>{this.#e.once("Input.dragIntercepted",n=>s(n.data))});return await this.move(e.x,e.y),await this.down(),await this.move(t.x,t.y),await r}async dragEnter(e,t){await this.#e.send("Input.dispatchDragEvent",{type:"dragEnter",x:e.x,y:e.y,modifiers:this.#t._modifiers,data:t})}async dragOver(e,t){await this.#e.send("Input.dispatchDragEvent",{type:"dragOver",x:e.x,y:e.y,modifiers:this.#t._modifiers,data:t})}async drop(e,t){await this.#e.send("Input.dispatchDragEvent",{type:"drop",x:e.x,y:e.y,modifiers:this.#t._modifiers,data:t})}async dragAndDrop(e,t,r={}){let{delay:s=null}=r,n=await this.drag(e,t);await this.dragEnter(t,n),await this.dragOver(t,n),s&&await new Promise(o=>setTimeout(o,s)),await this.drop(t,n),await this.up()}},Ds=class{#e=!1;#t;#r;#i;#s;constructor(e,t,r,s){this.#i=e,this.#t=t,this.#s=r,this.#r=s}updateClient(e){this.#i=e}async start(){if(this.#e)throw new Et("Touch has already started");await this.#i.send("Input.dispatchTouchEvent",{type:"touchStart",touchPoints:[this.#r],modifiers:this.#s._modifiers}),this.#e=!0}move(e,t){return this.#r.x=Math.round(e),this.#r.y=Math.round(t),this.#i.send("Input.dispatchTouchEvent",{type:"touchMove",touchPoints:[this.#r],modifiers:this.#s._modifiers})}async end(){await this.#i.send("Input.dispatchTouchEvent",{type:"touchEnd",touchPoints:[this.#r],modifiers:this.#s._modifiers}),this.#t.removeHandle(this)}},Ri=class extends hi{#e;#t;constructor(e,t){super(),this.#e=e,this.#t=t}updateClient(e){this.#e=e,this.touches.forEach(t=>{t.updateClient(e)})}async touchStart(e,t){let r=this.idGenerator(),s={x:Math.round(e),y:Math.round(t),radiusX:.5,radiusY:.5,force:.5,id:r},n=new Ds(this.#e,this,this.#t,s);return await n.start(),this.touches.push(n),n}};var il=function(i,e,t){for(var r=arguments.length>2,s=0;s<e.length;s++)t=r?e[s].call(i,t):e[s].call(i);return r?t:void 0},sl=function(i,e,t,r,s,n){function o(T){if(T!==void 0&&typeof T!="function")throw new TypeError("Function expected");return T}for(var a=r.kind,c=a==="getter"?"get":a==="setter"?"set":"value",l=!e&&i?r.static?i:i.prototype:null,u=e||(l?Object.getOwnPropertyDescriptor(l,r.name):{}),h,f=!1,p=t.length-1;p>=0;p--){var w={};for(var y in r)w[y]=y==="access"?{}:r[y];for(var y in r.access)w.access[y]=r.access[y];w.addInitializer=function(T){if(f)throw new TypeError("Cannot add initializers after decoration has completed");n.push(o(T||null))};var b=(0,t[p])(a==="accessor"?{get:u.get,set:u.set}:u[c],w);if(a==="accessor"){if(b===void 0)continue;if(b===null||typeof b!="object")throw new TypeError("Object expected");(h=o(b.get))&&(u.get=h),(h=o(b.set))&&(u.set=h),(h=o(b.init))&&s.unshift(h)}else(h=o(b))&&(a==="field"?s.unshift(h):u[c]=h)}l&&Object.defineProperty(l,r.name,u),f=!0},Eo=(()=>{let i=mi,e=[],t;return class extends i{static{let s=typeof Symbol=="function"&&Symbol.metadata?Object.create(i[Symbol.metadata]??null):void 0;t=[ti()],sl(this,null,t,{kind:"method",name:"stop",static:!1,private:!1,access:{has:n=>"stop"in n,get:n=>n.stop},metadata:s},null,e),s&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s})}#e=il(this,e);constructor(s,n={},o){super(s,n,o);let{client:a}=this.page.mainFrame();a?.once?.(B.Disconnected,()=>{this.stop().catch(c=>{this.logger(E.error)?.(c)})})}async _start(){let{client:s}=this.page.mainFrame(),n=this.options.frameRate??this.options.fps,o=await s.send("Page.startScreenRecording",{audio:this.options.audio,maxWidth:this.options.maxWidth,maxHeight:this.options.maxHeight,frameRate:n});this.#e=o.stream}async stop(){if(!this.stopped){this.stopped=!0;try{let{client:s}=this.page.mainFrame();if(await s.send("Page.stopScreenRecording").catch(o=>{this.logger(E.error)?.(o)}),!this.#e)throw new Error("Screen recording stream handle is missing.");let n=!1;for(;!n;){let{data:o,base64Encoded:a,eof:c}=await s.send("IO.read",{handle:this.#e});if(n=c,o){let l=Ue(o,a??!1);this.controller.enqueue(l);for(let u of this.destinations)u.write(l)}}await s.send("IO.close",{handle:this.#e}).catch(o=>{this.logger(E.error)?.(o)})}finally{await this.closeDestinations()}}}}})();var Di=class{#e;#t=!1;#r;#i;constructor(e,t){this.#e=e,this.#i=t}updateClient(e){this.#e=e}async start(e={}){P(!this.#t,"Cannot start recording trace while already recording trace.");let t=["-*","devtools.timeline","v8.execute","disabled-by-default-devtools.timeline","disabled-by-default-devtools.timeline.frame","toplevel","blink.console","blink.user_timing","latencyInfo","disabled-by-default-devtools.timeline.stack","disabled-by-default-v8.cpu_profiler"],{path:r,screenshots:s=!1,categories:n=t,bufferSize:o}=e;s&&n.push("disabled-by-default-devtools.screenshot");let a=n.filter(l=>l.startsWith("-")).map(l=>l.slice(1)),c=n.filter(l=>!l.startsWith("-"));this.#r=r,this.#t=!0,await this.#e.send("Tracing.start",{transferMode:"ReturnAsStream",traceConfig:{excludedCategories:a,includedCategories:c,traceBufferSizeInKb:o}})}async stop(){let e=O.create();return this.#e.once("Tracing.tracingComplete",async t=>{try{P(t.stream,'Missing "stream"');let r=await Wr(this.#e,t.stream),s=await Hr(r,this.#r,this.#i);e.resolve(s??void 0)}catch(r){Q(r)?e.reject(r):e.reject(new Error(`Unknown error: ${r}`))}}),await this.#e.send("Tracing.end"),this.#t=!1,await e.valueOrThrow()}};var Ns=class extends C{#e;#t;#r;name;description;inputSchema;annotations;frame;location;rawStackTrace;constructor(e,t,r){super(),this.#e=e,this.name=t.name,this.description=t.description,this.inputSchema=t.inputSchema,this.annotations=t.annotations,this.frame=r,this.#t=t.backendNodeId,t.stackTrace?.callFrames.length&&(this.location={url:t.stackTrace.callFrames[0].url,lineNumber:t.stackTrace.callFrames[0].lineNumber,columnNumber:t.stackTrace.callFrames[0].columnNumber}),this.rawStackTrace=t.stackTrace}get formElement(){return(async()=>{if(this.#r&&!this.#r.disposed)return this.#r;if(this.#t)return this.#r=await this.frame.worlds[me].adoptBackendNode(this.#t),this.#r})()}async execute(e={},t={}){let{invocationId:r}=await this.#e.invokeTool(this,e);return await new Promise(s=>{let n=()=>{this.#e.cancelInvocation(r)},o=a=>{a.id===r&&(t.signal?.removeEventListener("abort",n),this.#e.off("toolresponded",o),s(a))};this.#e.on("toolresponded",o),t.signal?.aborted?n():t.signal?.addEventListener("abort",n,{once:!0})})}},Hs=class{id;tool;input;#e;constructor(e,t,r,s){this.id=e,this.tool=t,this.#e=s;try{this.input=JSON.parse(r)}catch(n){this.input={},this.#e?.(E.error)?.(n)}}},Ni=class extends C{#e;#t;#r=new Map;#i=new Map;#s;#n=new G;#a=e=>{let t=[];for(let r of e.tools){let s=this.#t.frame(r.frameId);if(!s)continue;let n=this.#r.get(r.frameId)??new Map;this.#r.has(r.frameId)||(this.#r.set(r.frameId,n),this.#h(s));let o=new Ns(this,r,s);n.set(r.name,o),t.push(o)}this.emit("toolsadded",{tools:t})};#u=e=>{let t=[];e.tools.forEach(r=>{let s=this.#r.get(r.frameId)?.get(r.name);s&&t.push(s),this.#r.get(r.frameId)?.delete(r.name)}),this.emit("toolsremoved",{tools:t})};#c=e=>{let t=this.#r.get(e.frameId)?.get(e.toolName);if(!t)return;let r=new Hs(e.invocationId,t,e.input,this.#s);this.#i.set(r.id,r),t.emit("toolinvoked",r),this.emit("toolinvoked",r)};#l=e=>{let t=this.#i.get(e.invocationId);t&&this.#i.delete(e.invocationId);let r={id:e.invocationId,call:t,status:e.status,output:e.output,errorText:e.errorText,exception:e.exception};this.emit("toolresponded",r)};#o=e=>{this.#i.clear();let t=this.#r.get(e._id);if(!t)return;let r=Array.from(t.values());this.#r.delete(e._id),r.length&&this.emit("toolsremoved",{tools:r})};#h(e){e.mainRealm().context?.once("disposed",()=>{this.#o(e)})}constructor(e,t,r){super(void 0,r),this.#e=e,this.#t=t,this.#s=r,this.#p()}async initialize(){return await this.#e.send("WebMCP.enable").catch(e=>{this.#s?.(E.error)?.(e)})}async invokeTool(e,t){return await this.#e.send("WebMCP.invokeTool",{frameId:e.frame._id,toolName:e.name,input:t})}async cancelInvocation(e){return await this.#e.send("WebMCP.cancelInvocation",{invocationId:e}).catch(t=>{this.#s?.(E.error)?.(t)})}tools(){return Array.from(this.#r.values()).flatMap(e=>Array.from(e.values()))}#p(){let e=this.#n.use(new C(this.#e));e.on("WebMCP.toolsAdded",this.#a),e.on("WebMCP.toolsRemoved",this.#u),e.on("WebMCP.toolInvoked",this.#c),e.on("WebMCP.toolResponded",this.#l)}updateClient(e){this.#n.dispose(),this.#n=new G,this.#e=e,this.#p()}};var Hi=function(i,e,t){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var r,s;if(t){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=e[Symbol.asyncDispose]}if(r===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=e[Symbol.dispose],t&&(s=r)}if(typeof r!="function")throw new TypeError("Object not disposable.");s&&(r=function(){try{s.call(this)}catch(n){return Promise.reject(n)}}),i.stack.push({value:e,dispose:r,async:t})}else t&&i.stack.push({async:!0});return e},Wi=(function(i){return function(e){function t(o){e.error=e.hasError?new i(o,e.error,"An error was suppressed during disposal."):o,e.hasError=!0}var r,s=0;function n(){for(;r=e.stack.pop();)try{if(!r.async&&s===1)return s=0,e.stack.push(r),Promise.resolve().then(n);if(r.dispose){var o=r.dispose.call(r.value);if(r.async)return s|=2,Promise.resolve(o).then(n,function(a){return t(a),n()})}else s|=1}catch(a){t(a)}if(s===1)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}return n()}})(typeof SuppressedError=="function"?SuppressedError:function(i,e,t){var r=new Error(t);return r.name="SuppressedError",r.error=i,r.suppressed=e,r});function Ws(i){switch(i){case"Strict":case"Lax":case"None":return i;default:return}}var Er=class i extends lo{static async _create(e,t,r,s){let n=new i(e,t,s);if(await n.#x(),r)try{await n.setViewport(r)}catch(o){if(Q(o)&&je(o))n.logger?.(E.error)?.(o);else throw o}return n}#e=!1;#t;#r;#i;#s;#n;#a;#u;#c;#l;#o;#h;#p;#m;#d=new Map;#f=new Map;#g;#v;#w=new Map;#b=new Set;#P=O.create();#y=!1;#E=!1;constructor(e,t,r){super(r),this.#i=e,this.#n=e.parentSession(),P(this.#n,"Tab target session is not defined."),this.#a=this.#n.target(),P(this.#a,"Tab target is not defined."),this._tabId=this.#a._getTargetInfo().targetId,this.#s=t,this.#t=t._targetManager(),this.#u=new Fi(e),this.#c=new Oi(e,this.#u),this.#l=new Ri(e,this.#u),this.#o=new Li(e,this,this._timeoutSettings,r),this.#h=new po(e,this.logger),this.#p=new Di(e,this.logger),this.#m=new Ni(e,this.#o,r),this.#g=new bi(e),this.#v=null,this.#r=new yi(this.#i.connection());let s=new C(this.#o);s.on(te.FrameAttached,o=>{this.emit("frameattached",o)}),s.on(te.FrameDetached,o=>{this.emit("framedetached",o)}),s.on(te.FrameNavigated,o=>{this.emit("framenavigated",o)}),s.on(te.ConsoleApiCalled,([o,a])=>{this.#H(o,a)}),s.on(te.BindingCalled,([o,a])=>{this.#W(o,a)});let n=new C(this.#o.networkManager);n.on(re.Request,o=>{this.emit("request",o)}),n.on(re.RequestServedFromCache,o=>{this.emit("requestservedfromcache",o)}),n.on(re.Response,o=>{this.emit("response",o)}),n.on(re.RequestFailed,o=>{this.emit("requestfailed",o)}),n.on(re.RequestFinished,o=>{this.emit("requestfinished",o)}),this.#n.on(B.Swapped,this.#_.bind(this)),this.#n.on(B.Ready,this.#T.bind(this)),this.#t.on("targetGone",this.#I),this.#a._isClosedDeferred.valueOrThrow().then(()=>{this.#t.off("targetGone",this.#I),this.emit("close",void 0),this.#e=!0}).catch(o=>{this.logger?.(E.error)?.(o)}),this.#M(),this.#S()}#S(){let e=[];for(let r of this.#t.getChildTargets(this.#s))e.push(r);let t=0;for(;t<e.length;){let r=e[t];t++;let s=r._session();s&&this.#k(s);for(let n of this.#t.getChildTargets(r))e.push(n)}}async#_(e){P(e instanceof Ae,"CDPSession is not instance of CdpCDPSession"),this.#i=e,this.#s=e.target(),P(this.#s,"Missing target on swap"),this.#u.updateClient(e),this.#c.updateClient(e),this.#l.updateClient(e),this.#h.updateClient(e),this.#p.updateClient(e),this.#m.updateClient(e),this.#g.updateClient(e),await this.#o.swapFrameTree(e),this.#M()}async#T(e){P(e instanceof Ae),e.target()._subtype()==="prerender"&&(this.#o.registerSpeculativeSession(e).catch(t=>{this.logger?.(E.error)?.(t)}),this.#h.registerSpeculativeSession(e).catch(t=>{this.logger?.(E.error)?.(t)}))}#M(){let e=new C(this.#i);e.on(B.Ready,this.#k),e.on(B.Disconnected,()=>{this.#P.reject(new ge("Target closed"))}),e.on("Page.domContentEventFired",()=>{this.emit("domcontentloaded",void 0)}),e.on("Page.loadEventFired",()=>{this.emit("load",void 0)}),e.on("Page.javascriptDialogOpening",this.#L.bind(this)),e.on("Runtime.exceptionThrown",this.#C.bind(this)),e.on("Inspector.targetCrashed",this.#A.bind(this)),e.on("Performance.metrics",this.#N.bind(this)),e.on("Log.entryAdded",this.#D.bind(this)),e.on("Page.fileChooserOpened",this.#R.bind(this))}#I=e=>{let t=e._session()?.id(),r=this.#w.get(t);r&&(this.#w.delete(t),this.emit("workerdestroyed",r))};#k=e=>{if(P(e instanceof Ae),this.#o.onAttachedToTarget(e.target()),e.target()._getTargetInfo().type==="worker"){let t=new vt(e,e.target().url(),e.target()._targetId,e.target().type(),this.#C.bind(this),this.#o.networkManager,this.logger);this.#w.set(e.id(),t),t.internalEmitter.on(Be.Console,r=>{let s=this.listenerCount("console")===0,n=t.listenerCount(Be.Console)===0;if(s&&n){for(let o of r.args())o.dispose().catch(a=>{this.logger?.(E.error)?.(a)});return}s||this.emit("console",r)}),this.emit("workercreated",t)}e.on(B.Ready,this.#k)};async#x(){try{await Promise.all([this.#o.initialize(this.#i),this.#i.send("Performance.enable"),this.#i.send("Log.enable"),this.#m.initialize()])}catch(e){if(Q(e)&&je(e))this.logger?.(E.error)?.(e);else throw e}}async resize(e){let t=await this.windowId();await this.#i.send("Browser.setContentsSize",{windowId:Number(t),width:e.contentWidth,height:e.contentHeight})}async windowId(){let{windowId:e}=await this.#i.send("Browser.getWindowForTarget");return e.toString()}async#R(e){let t={stack:[],error:void 0,hasError:!1};try{if(!this.#b.size)return;let r=this.#o.frame(e.frameId);P(r,"This should never happen.");let s=Hi(t,await r.worlds[me].adoptBackendNode(e.backendNodeId),!1),n=new vi(s.move(),e.mode!=="selectSingle");for(let o of this.#b)o.resolve(n);this.#b.clear()}catch(r){t.error=r,t.hasError=!0}finally{Wi(t)}}_client(){return this.#i}_isUrlAllowed(e){return this.#t.isUrlAllowed(e)}isServiceWorkerBypassed(){return this.#y}isDragInterceptionEnabled(){return this.#E}isJavaScriptEnabled(){return this.#h.javascriptEnabled}async openDevTools(){let e=this.target()._targetId,t=this.browser(),r=await t._hasDevToolsTarget(this.target()._targetId);return r?await t._getDevToolsTargetPage(r):await t._createDevToolsPage(e)}async hasDevTools(){return!!await this.browser()._hasDevToolsTarget(this.target()._targetId)}async waitForFileChooser(e={}){let t=this.#b.size===0,{timeout:r=this._timeoutSettings.timeout()}=e,s=O.create({message:`Waiting for \`FileChooser\` failed: ${r}ms exceeded`,timeout:r});e.signal&&e.signal.addEventListener("abort",()=>{s.reject(e.signal?.reason)},{once:!0}),this.#b.add(s);let n;t&&(n=this.#i.send("Page.setInterceptFileChooserDialog",{enabled:!0}));try{let[o]=await Promise.all([s.valueOrThrow(),n]);return o}catch(o){throw this.#b.delete(s),o}}async setGeolocation(e){return await this.#h.setGeolocation(e)}target(){return this.#s}browser(){return this.#s.browser()}browserContext(){return this.#s.browserContext()}#A(){this.emit("error",new Error("Page crashed!"))}#D(e){let{level:t,text:r,args:s,source:n,url:o,lineNumber:a,stackTrace:c}=e.entry;s&&s.map(l=>{Os(this.#i,l,this.logger)}),n!=="worker"&&this.emit("console",new Qt(Fs(t),r,[],[{url:o,lineNumber:a}],void 0,c,this.#s._targetId))}mainFrame(){return this.#o.mainFrame()}get keyboard(){return this.#u}get touchscreen(){return this.#l}get coverage(){return this.#g}get tracing(){return this.#p}get webmcp(){return this.#m}frames(){return this.#o.frames()}workers(){return Array.from(this.#w.values())}async setRequestInterception(e){return await this.#o.networkManager.setRequestInterception(e)}async setBypassServiceWorker(e){return this.#y=e,await this.#i.send("Network.setBypassServiceWorker",{bypass:e})}async setDragInterception(e){return this.#E=e,await this.#i.send("Input.setInterceptDrags",{enabled:e})}async setOfflineMode(e){return await this.#o.networkManager.setOfflineMode(e)}async emulateNetworkConditions(e){return await this.#o.networkManager.emulateNetworkConditions(e)}async emulateFocusedPage(e){return await this.#h.emulateFocus(e)}setDefaultNavigationTimeout(e){this._timeoutSettings.setDefaultNavigationTimeout(e)}setDefaultTimeout(e){this._timeoutSettings.setDefaultTimeout(e)}getDefaultTimeout(){return this._timeoutSettings.timeout()}getDefaultNavigationTimeout(){return this._timeoutSettings.navigationTimeout()}async queryObjects(e){P(!e.disposed,"Prototype JSHandle is disposed!"),P(e.id,"Prototype JSHandle must not be referencing primitive value");let t=await this.mainFrame().client.send("Runtime.queryObjects",{prototypeObjectId:e.id});return this.mainFrame().mainRealm().createCdpHandle(t.objects)}async cookies(...e){let t=(await this.#i.send("Network.getCookies",{urls:e.length?e:[this.url()]})).cookies,r=["sourcePort"],s=n=>{for(let o of r)delete n[o];return n};return t.map(s).map(n=>({...n,partitionKey:n.partitionKey?n.partitionKey.topLevelSite:void 0}))}async deleteCookie(...e){let t=this.url();for(let r of e){let s={...r,partitionKey:Bi(r.partitionKey)};if(!r.url&&t.startsWith("http")&&(s.url=t),await this.#i.send("Network.deleteCookies",s),t.startsWith("http")&&!s.partitionKey){let n=new URL(t);await this.#i.send("Network.deleteCookies",{...s,partitionKey:{topLevelSite:n.origin.replace(`:${n.port}`,""),hasCrossSiteAncestor:!1}})}}}async setCookie(...e){let t=this.url(),r=t.startsWith("http"),s=e.map(n=>{let o=Object.assign({},n);return!o.url&&r&&(o.url=t),P(o.url!=="about:blank",`Blank page can not have cookie "${o.name}"`),P(!String.prototype.startsWith.call(o.url||"","data:"),`Data URL page can not have cookie "${o.name}"`),o});await this.deleteCookie(...s),s.length&&await this.#i.send("Network.setCookies",{cookies:s.map(n=>({...n,partitionKey:Bi(n.partitionKey),sameSite:Ws(n.sameSite)}))})}async exposeFunction(e,t){if(this.#d.has(e))throw new Error(`Failed to add page binding with name ${e}: window['${e}'] already exists!`);let r=wo("exposedFun",e),s;typeof t==="function"?s=new gt(e,t,r,this.logger):s=new gt(e,t.default,r,this.logger),this.#d.set(e,s);let[{identifier:n}]=await Promise.all([this.#o.evaluateOnNewDocument(r),this.#o.addExposedFunctionBinding(s)]);this.#f.set(e,n)}async removeExposedFunction(e){let t=this.#f.get(e);if(!t)throw new Error(`Function with name "${e}" does not exist`);let r=this.#d.get(e);this.#f.delete(e),this.#d.delete(e),await Promise.all([this.#o.removeScriptToEvaluateOnNewDocument(t),this.#o.removeExposedFunctionBinding(r)])}async authenticate(e){return await this.#o.networkManager.authenticate(e)}async setExtraHTTPHeaders(e){return await this.#o.networkManager.setExtraHTTPHeaders(e)}async setUserAgent(e,t){if(typeof e=="string")return await this.#o.networkManager.setUserAgent(e,t);{let r=e.userAgent??await this.browser().userAgent();return await this.#o.networkManager.setUserAgent(r,e.userAgentMetadata,e.platform)}}async metrics(){let e=await this.#i.send("Performance.getMetrics");return this.#F(e.metrics)}async captureHeapSnapshot(e){let t={stack:[],error:void 0,hasError:!1};try{let r=ee.value.createWriteStream(e.path),s=new Promise((a,c)=>{r.on("error",c),r.on("finish",a)}),n=this.#i;await n.send("HeapProfiler.enable"),await n.send("HeapProfiler.collectGarbage"),Hi(t,new C(n),!1).on("HeapProfiler.addHeapSnapshotChunk",a=>{r.write(a.chunk)});try{await n.send("HeapProfiler.takeHeapSnapshot",{reportProgress:!1})}finally{await n.send("HeapProfiler.disable")}r.end(),await s}catch(r){t.error=r,t.hasError=!0}finally{Wi(t)}}#N(e){this.emit("metrics",{title:e.title,metrics:this.#F(e.metrics)})}#F(e){let t={};for(let r of e||[])nl.has(r.name)&&(t[r.name]=r.value);return t}#C(e){this.emit("pageerror",go(e.exceptionDetails))}#H(e,t,r){r||(r=t.args.map(a=>e.createCdpHandle(a)));let s=this.listenerCount("console")>0,n=e.environment instanceof Xt&&e.environment.listenerCount(Be.Console)>0;if(!s){if(!n)for(let a of r)a.dispose().catch(c=>{this.logger?.(E.error)?.(c)});return}let o;e.environment.client instanceof Ae&&(o=e.environment.client.target()._targetId),this.emit("console",Ti(t,r,o))}async#W(e,t){let r;try{r=JSON.parse(t.payload)}catch{return}let{type:s,name:n,seq:o,args:a,isTrivial:c}=r;if(s!=="exposedFun")return;let l=e.context;if(!l)return;await this.#d.get(n)?.run(l,o,a,c)}#L(e){let t=zn(e.type),r=new Si(this.#i,t,e.message,e.defaultPrompt);this.emit("dialog",r)}async reload(e){let[t]=await Promise.all([this.waitForNavigation({...e,ignoreSameDocumentNavigation:!0}),this.#i.send("Page.reload",{ignoreCache:e?.ignoreCache??!1})]);return t}async createCDPSession(){return await this.target().createCDPSession()}async goBack(e={}){return await this.#O(-1,e)}async goForward(e={}){return await this.#O(1,e)}async#O(e,t){let r=await this.#i.send("Page.getNavigationHistory"),s=r.entries[r.currentIndex+e];if(!s)throw new Error("History entry to navigate to not found.");return(await Promise.all([this.waitForNavigation(t),this.#i.send("Page.navigateToHistoryEntry",{entryId:s.id})]))[0]}async bringToFront(){await this.#i.send("Page.bringToFront")}async setJavaScriptEnabled(e){return await this.#h.setJavaScriptEnabled(e)}async setBypassCSP(e){await this.#i.send("Page.setBypassCSP",{enabled:e})}async triggerExtensionAction(e){return await e.triggerAction(this)}async emulateMediaType(e){return await this.#h.emulateMediaType(e)}async emulateCPUThrottling(e){return await this.#h.emulateCPUThrottling(e)}async emulateMediaFeatures(e){return await this.#h.emulateMediaFeatures(e)}async emulateTimezone(e){return await this.#h.emulateTimezone(e)}async emulateLocale(e){await this.#h.emulateLocale(e),await this.#o.networkManager.setAcceptLanguage(e)}async emulateIdleState(e){return await this.#h.emulateIdleState(e)}async emulateVisionDeficiency(e){return await this.#h.emulateVisionDeficiency(e)}async setViewport(e){let t=await this.#h.emulateViewport(e);this.#v=e,t&&await this.reload()}viewport(){return this.#v}async evaluateOnNewDocument(e,...t){let r=Nr(e,...t);return await this.#o.evaluateOnNewDocument(r)}async removeScriptToEvaluateOnNewDocument(e){return await this.#o.removeScriptToEvaluateOnNewDocument(e)}async setCacheEnabled(e=!0){await this.#o.networkManager.setCacheEnabled(e)}async _screenshot(e){let t={stack:[],error:void 0,hasError:!1};try{let{fromSurface:r,omitBackground:s,optimizeForSpeed:n,quality:o,clip:a,type:c,captureBeyondViewport:l}=e,u=Hi(t,new Pr,!0);s&&(c==="png"||c==="webp")&&(await this.#h.setTransparentBackgroundColor(),u.defer(async()=>{await this.#h.resetDefaultBackgroundColor().catch(p=>{this.logger?.(E.error)?.(p)})}));let h=a;if(h&&!l){let p=await this.mainFrame().isolatedRealm().evaluate(()=>{let{height:w,pageLeft:y,pageTop:b,width:T}=window.visualViewport;return{x:y,y:b,height:w,width:T}});h=ol(h,p)}let{data:f}=await this.#i.send("Page.captureScreenshot",{format:c,optimizeForSpeed:n,fromSurface:r,...o!==void 0?{quality:Math.round(o)}:{},...h?{clip:{...h,scale:h.scale??1}}:{},captureBeyondViewport:l});return f}catch(r){t.error=r,t.hasError=!0}finally{let r=Wi(t);r&&await r}}async createPDFStream(e={}){let{timeout:t=this._timeoutSettings.timeout()}=e,{landscape:r,displayHeaderFooter:s,headerTemplate:n,footerTemplate:o,printBackground:a,scale:c,width:l,height:u,margin:h,pageRanges:f,preferCSSPageSize:p,omitBackground:w,tagged:y,outline:b,waitForFonts:T}=Gn(e);w&&await this.#h.setTransparentBackgroundColor(),T&&await ne(H(this.mainFrame().isolatedRealm().evaluate(()=>document.fonts.ready)).pipe(we(ye(t))));let W=this.#i.send("Page.printToPDF",{transferMode:"ReturnAsStream",landscape:r,displayHeaderFooter:s,headerTemplate:n,footerTemplate:o,printBackground:a,scale:c,paperWidth:l,paperHeight:u,marginTop:h.top,marginBottom:h.bottom,marginLeft:h.left,marginRight:h.right,pageRanges:f,preferCSSPageSize:p,generateTaggedPDF:y,generateDocumentOutline:b}),N=await ne(H(W).pipe(we(ye(t))));return w&&await this.#h.resetDefaultBackgroundColor(),P(N.stream,"`stream` is missing from `Page.printToPDF"),await Wr(this.#i,N.stream)}async pdf(e={}){let{path:t=void 0}=e,r=await this.createPDFStream(e),s=await Hr(r,t,this.logger);return P(s,"Could not create typed array"),s}async close(e={runBeforeUnload:void 0}){let t={stack:[],error:void 0,hasError:!1};try{let r=Hi(t,await this.browserContext().waitForScreenshotOperations(),!1),s=this.#i.connection();P(s,"Connection closed. Most likely the page has been closed."),!!e.runBeforeUnload?await this.#i.send("Page.close"):(await s.send("Target.closeTarget",{targetId:this.#s._targetId}),await this.#a._isClosedDeferred.valueOrThrow())}catch(r){t.error=r,t.hasError=!0}finally{Wi(t)}}isClosed(){return this.#e}get mouse(){return this.#c}async waitForDevicePrompt(e={}){return await this.mainFrame().waitForDevicePrompt(e)}get bluetooth(){return this.#r}extensionRealms(){return this.mainFrame().extensionRealms()}createScreenRecording(e){return new Eo(this,e,this.logger)}},nl=new Set(["Timestamp","Documents","Frames","JSEventListeners","Nodes","LayoutCount","RecalcStyleCount","LayoutDuration","RecalcStyleDuration","ScriptDuration","TaskDuration","JSHeapUsedSize","JSHeapTotalSize"]);function ol(i,e){let t=Math.max(i.x,e.x),r=Math.max(i.y,e.y);return{x:t,y:r,width:Math.max(Math.min(i.x+i.width,e.x+e.width)-t,0),height:Math.max(Math.min(i.y+i.height,e.y+e.height)-r,0)}}function Bi(i){if(i!==void 0)return typeof i=="string"?{topLevelSite:i,hasCrossSiteAncestor:!1}:{topLevelSite:i.sourceOrigin,hasCrossSiteAncestor:i.hasCrossSiteAncestor??!1}}var al=function(i,e,t){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var r,s;if(t){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=e[Symbol.asyncDispose]}if(r===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=e[Symbol.dispose],t&&(s=r)}if(typeof r!="function")throw new TypeError("Object not disposable.");s&&(r=function(){try{s.call(this)}catch(n){return Promise.reject(n)}}),i.stack.push({value:e,dispose:r,async:t})}else t&&i.stack.push({async:!0});return e},cl=(function(i){return function(e){function t(o){e.error=e.hasError?new i(o,e.error,"An error was suppressed during disposal."):o,e.hasError=!0}var r,s=0;function n(){for(;r=e.stack.pop();)try{if(!r.async&&s===1)return s=0,e.stack.push(r),Promise.resolve().then(n);if(r.dispose){var o=r.dispose.call(r.value);if(r.async)return s|=2,Promise.resolve(o).then(n,function(a){return t(a),n()})}else s|=1}catch(a){t(a)}if(s===1)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}return n()}})(typeof SuppressedError=="function"?SuppressedError:function(i,e,t){var r=new Error(t);return r.name="SuppressedError",r.error=i,r.suppressed=e,r}),tr=class extends Ur{#e;#t;#r;constructor(e,t,r=void 0,s){super(s),this.#e=e,this.#t=t,this.#r=r}get id(){return this.#r}targets(){return this.#t.targets().filter(e=>e.browserContext()===this)}async pages(e=!1){return(await Promise.all(this.targets().filter(r=>r.type()==="page"||(r.type()==="other"||e)&&this.#t._getIsPageTargetCallback()?.(r)).map(r=>r.page()))).filter(r=>!!r)}async overridePermissions(e,t){let r=t.map(s=>{let n=Xn.get(s);if(!n)throw new Error("Unknown permission: "+s);return n});await this.#e.send("Browser.grantPermissions",{origin:e,browserContextId:this.#r||void 0,permissions:r})}async setPermission(e,...t){await Promise.all(t.map(async r=>{let s={name:r.permission.name,userVisibleOnly:r.permission.userVisibleOnly,sysex:r.permission.sysex,allowWithoutSanitization:r.permission.allowWithoutSanitization,panTiltZoom:r.permission.panTiltZoom};await this.#e.send("Browser.setPermission",{origin:e==="*"?void 0:e,browserContextId:this.#r||void 0,permission:s,setting:r.state})}))}async clearPermissionOverrides(){await this.#e.send("Browser.resetPermissions",{browserContextId:this.#r||void 0})}async newPage(e){let t={stack:[],error:void 0,hasError:!1};try{let r=al(t,await this.waitForScreenshotOperations(),!1);return await this.#t._createPageInContext(this.#r,e)}catch(r){t.error=r,t.hasError=!0}finally{cl(t)}}browser(){return this.#t}async close(){P(this.#r,"Default BrowserContext cannot be closed!"),await this.#t._disposeContext(this.#r)}async cookies(){let{cookies:e}=await this.#e.send("Storage.getCookies",{browserContextId:this.#r});return e.map(t=>({...t,partitionKey:t.partitionKey?{sourceOrigin:t.partitionKey.topLevelSite,hasCrossSiteAncestor:t.partitionKey.hasCrossSiteAncestor}:void 0}))}async setCookie(...e){return await this.#e.send("Storage.setCookies",{browserContextId:this.#r,cookies:e.map(t=>({...t,partitionKey:Bi(t.partitionKey),sameSite:Ws(t.sameSite)}))})}async setDownloadBehavior(e){await this.#e.send("Browser.setDownloadBehavior",{behavior:e.policy,downloadPath:e.downloadPath,browserContextId:this.#r})}};var Te;(function(i){i.SUCCESS="success",i.ABORTED="aborted"})(Te||(Te={}));var kr=class extends gi{#e;#t;#r;#i;#s;#n;#a=new Set;_initializedDeferred=O.create();_isClosedDeferred=O.create();_targetId;_asPagePromise;pagePromise;constructor(e,t,r,s,n,o){super(o),this.#t=t,this.#i=s,this.#r=e,this.#e=r,this._targetId=e.targetId,this.#s=n,this.#n=o,this.#t&&this.#t.setTarget(this)}async asPage(){if(this.pagePromise){let e=await this.pagePromise;if(e)return e}if(!this._asPagePromise){let e=this._session();this._asPagePromise=(e?Promise.resolve(e):this._sessionFactory()(!1)).then(t=>Er._create(t,this,null,this.#n))}return await this._asPagePromise??null}_subtype(){return this.#r.subtype}_session(){return this.#t}_addChildTarget(e){this.#a.add(e)}_removeChildTarget(e){this.#a.delete(e)}_childTargets(){return this.#a}_sessionFactory(){if(!this.#s)throw new Error("sessionFactory is not initialized");return this.#s}createCDPSession(){if(!this.#s)throw new Error("sessionFactory is not initialized");return this.#s(!1).then(e=>(e.setTarget(this),e))}url(){return this.#r.url}type(){switch(this.#r.type){case"page":return ke.PAGE;case"background_page":return ke.BACKGROUND_PAGE;case"service_worker":return ke.SERVICE_WORKER;case"shared_worker":return ke.SHARED_WORKER;case"browser":return ke.BROWSER;case"webview":return ke.WEBVIEW;case"tab":return ke.TAB;default:return ke.OTHER}}_targetManager(){if(!this.#i)throw new Error("targetManager is not initialized");return this.#i}_getTargetInfo(){return this.#r}browser(){if(!this.#e)throw new Error("browserContext is not initialized");return this.#e.browser()}browserContext(){if(!this.#e)throw new Error("browserContext is not initialized");return this.#e}opener(){let{openerId:e}=this.#r;if(e)return this.browser().targets().find(t=>t._targetId===e)}_targetInfoChanged(e){this.#r=e,this._checkIfInitialized()}_initialize(){this._initializedDeferred.resolve(Te.SUCCESS)}_isTargetExposed(){return this.type()!==ke.TAB&&!this._subtype()}_checkIfInitialized(){this._initializedDeferred.resolved()||this._initializedDeferred.resolve(Te.SUCCESS)}},Tr=class i extends kr{#e;constructor(e,t,r,s,n,o,a){super(e,t,r,s,n,a),this.#e=o??void 0}_initialize(){this._initializedDeferred.valueOrThrow().then(async e=>{if(e===Te.ABORTED)return;let t=this.opener();if(!(t instanceof i))return;if(!t||!t.pagePromise||this.type()!=="page")return!0;let r=await t.pagePromise;if(!r.listenerCount("popup"))return!0;let s=await this.page();return r.emit("popup",s),!0}).catch(e=>{this.logger?.(E.error)?.(e)}),this._checkIfInitialized()}async page(){if(!this.pagePromise){let e=this._session();this.pagePromise=(e?Promise.resolve(e):this._sessionFactory()(!1)).then(t=>Er._create(t,this,this.#e??null,this.logger))}return await this.pagePromise??null}_checkIfInitialized(){this._initializedDeferred.resolved()||this._getTargetInfo().url!==""&&this._initializedDeferred.resolve(Te.SUCCESS)}},Ui=class extends Tr{},Ki=class extends kr{#e;async worker(){if(!this.#e){let e=this._session();this.#e=(e?Promise.resolve(e):this._sessionFactory()(!1)).then(t=>new vt(t,this._getTargetInfo().url,this._targetId,this.type(),()=>{},void 0,this.logger))}return await this.#e}},qi=class extends kr{};var ll=Object.defineProperty,L=(i,e)=>ll(i,"name",{value:e,configurable:!0}),sr=class{type=3;name="";prefix="";value="";suffix="";modifier=3;constructor(i,e,t,r,s,n){this.type=i,this.name=e,this.prefix=t,this.value=r,this.suffix=s,this.modifier=n}hasCustomName(){return this.name!==""&&typeof this.name!="number"}};L(sr,"Part");var ul=/[$_\p{ID_Start}]/u,hl=/[$_\u200C\u200D\p{ID_Continue}]/u,Us=".*";function ko(i,e){return(e?/^[\x00-\xFF]*$/:/^[\x00-\x7F]*$/).test(i)}L(ko,"isASCII");function js(i,e=!1){let t=[],r=0;for(;r<i.length;){let s=i[r],n=L(function(o){if(!e)throw new TypeError(o);t.push({type:"INVALID_CHAR",index:r,value:i[r++]})},"ErrorOrInvalid");if(s==="*"){t.push({type:"ASTERISK",index:r,value:i[r++]});continue}if(s==="+"||s==="?"){t.push({type:"OTHER_MODIFIER",index:r,value:i[r++]});continue}if(s==="\\"){t.push({type:"ESCAPED_CHAR",index:r++,value:i[r++]});continue}if(s==="{"){t.push({type:"OPEN",index:r,value:i[r++]});continue}if(s==="}"){t.push({type:"CLOSE",index:r,value:i[r++]});continue}if(s===":"){let o="",a=r+1;for(;a<i.length;){let c=i.substr(a,1);if(a===r+1&&ul.test(c)||a!==r+1&&hl.test(c)){o+=i[a++];continue}break}if(!o){n(`Missing parameter name at ${r}`);continue}t.push({type:"NAME",index:r,value:o}),r=a;continue}if(s==="("){let o=1,a="",c=r+1,l=!1;if(i[c]==="?"){n(`Pattern cannot start with "?" at ${c}`);continue}for(;c<i.length;){if(!ko(i[c],!1)){n(`Invalid character '${i[c]}' at ${c}.`),l=!0;break}if(i[c]==="\\"){a+=i[c++]+i[c++];continue}if(i[c]===")"){if(o--,o===0){c++;break}}else if(i[c]==="("&&(o++,i[c+1]!=="?")){n(`Capturing groups are not allowed at ${c}`),l=!0;break}a+=i[c++]}if(l)continue;if(o){n(`Unbalanced pattern at ${r}`);continue}if(!a){n(`Missing pattern at ${r}`);continue}t.push({type:"REGEX",index:r,value:a}),r=c;continue}t.push({type:"CHAR",index:r,value:i[r++]})}return t.push({type:"END",index:r,value:""}),t}L(js,"lexer");function zs(i,e={}){let t=js(i);e.delimiter??="/#?",e.prefixes??="./";let r=`[^${Ce(e.delimiter)}]+?`,s=[],n=0,o=0,a="",c=new Set,l=L(N=>{if(o<t.length&&t[o].type===N)return t[o++].value},"tryConsume"),u=L(()=>l("OTHER_MODIFIER")??l("ASTERISK"),"tryConsumeModifier"),h=L(N=>{let j=l(N);if(j!==void 0)return j;let{type:$,index:le}=t[o];throw new TypeError(`Unexpected ${$} at ${le}, expected ${N}`)},"mustConsume"),f=L(()=>{let N="",j;for(;j=l("CHAR")??l("ESCAPED_CHAR");)N+=j;return N},"consumeText"),p=L(N=>N,"DefaultEncodePart"),w=e.encodePart||p,y="",b=L(N=>{y+=N},"appendToPendingFixedValue"),T=L(()=>{y.length&&(s.push(new sr(3,"","",w(y),"",3)),y="")},"maybeAddPartFromPendingFixedValue"),W=L((N,j,$,le,S)=>{let m=3;switch(S){case"?":m=1;break;case"*":m=0;break;case"+":m=2;break}if(!j&&!$&&m===3){b(N);return}if(T(),!j&&!$){if(!N)return;s.push(new sr(3,"","",w(N),"",m));return}let _;$?$==="*"?_=Us:_=$:_=r;let k=2;_===r?(k=1,_=""):_===Us&&(k=0,_="");let v;if(j?v=j:$&&(v=n++),c.has(v))throw new TypeError(`Duplicate name '${v}'.`);c.add(v),s.push(new sr(k,v,w(N),_,w(le),m))},"addPart");for(;o<t.length;){let N=l("CHAR"),j=l("NAME"),$=l("REGEX");if(!j&&!$&&($=l("ASTERISK")),j||$){let S=N??"";e.prefixes.indexOf(S)===-1&&(b(S),S=""),T();let m=u();W(S,j,$,"",m);continue}let le=N??l("ESCAPED_CHAR");if(le){b(le);continue}if(l("OPEN")){let S=f(),m=l("NAME"),_=l("REGEX");!m&&!_&&(_=l("ASTERISK"));let k=f();h("CLOSE");let v=u();W(S,m,_,k,v);continue}T(),h("END")}return s}L(zs,"parse");function Ce(i){return i.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")}L(Ce,"escapeString");function Ks(i){return i&&i.ignoreCase?"ui":"u"}L(Ks,"flags");function To(i,e,t){return $s(zs(i,t),e,t)}L(To,"stringToRegexp");function Ot(i){switch(i){case 0:return"*";case 1:return"?";case 2:return"+";case 3:return""}}L(Ot,"modifierToString");function $s(i,e,t={}){t.delimiter??="/#?",t.prefixes??="./",t.sensitive??=!1,t.strict??=!1,t.end??=!0,t.start??=!0,t.endsWith="";let r=t.start?"^":"";for(let a of i){if(a.type===3){a.modifier===3?r+=Ce(a.value):r+=`(?:${Ce(a.value)})${Ot(a.modifier)}`;continue}e&&e.push(a.name);let c=`[^${Ce(t.delimiter)}]+?`,l=a.value;if(a.type===1?l=c:a.type===0&&(l=Us),!a.prefix.length&&!a.suffix.length){a.modifier===3||a.modifier===1?r+=`(${l})${Ot(a.modifier)}`:r+=`((?:${l})${Ot(a.modifier)})`;continue}if(a.modifier===3||a.modifier===1){r+=`(?:${Ce(a.prefix)}(${l})${Ce(a.suffix)})`,r+=Ot(a.modifier);continue}r+=`(?:${Ce(a.prefix)}`,r+=`((?:${l})(?:`,r+=Ce(a.suffix),r+=Ce(a.prefix),r+=`(?:${l}))*)${Ce(a.suffix)})`,a.modifier===0&&(r+="?")}let s=`[${Ce(t.endsWith)}]|$`,n=`[${Ce(t.delimiter)}]`;if(t.end)return t.strict||(r+=`${n}?`),t.endsWith.length?r+=`(?=${s})`:r+="$",new RegExp(r,Ks(t));t.strict||(r+=`(?:${n}(?=${s}))?`);let o=!1;if(i.length){let a=i[i.length-1];a.type===3&&a.modifier===3&&(o=t.delimiter.indexOf(a)>-1)}return o||(r+=`(?=${n}|${s})`),new RegExp(r,Ks(t))}L($s,"partsToRegexp");var St={delimiter:"",prefixes:"",sensitive:!0,strict:!0},dl={delimiter:".",prefixes:"",sensitive:!0,strict:!0},fl={delimiter:"/",prefixes:"/",sensitive:!0,strict:!0};function Po(i,e){return i.length?i[0]==="/"?!0:!e||i.length<2?!1:(i[0]=="\\"||i[0]=="{")&&i[1]=="/":!1}L(Po,"isAbsolutePathname");function Vs(i,e){return i.startsWith(e)?i.substring(e.length,i.length):i}L(Vs,"maybeStripPrefix");function _o(i,e){return i.endsWith(e)?i.substr(0,i.length-e.length):i}L(_o,"maybeStripSuffix");function Gs(i){return!i||i.length<2?!1:i[0]==="["||(i[0]==="\\"||i[0]==="{")&&i[1]==="["}L(Gs,"treatAsIPv6Hostname");var Mo=["ftp","file","http","https","ws","wss"];function Xs(i){if(!i)return!0;for(let e of Mo)if(i.test(e))return!0;return!1}L(Xs,"isSpecialScheme");function xo(i,e){if(i=Vs(i,"#"),e||i==="")return i;let t=new URL("https://example.com");return t.hash=i,t.hash?t.hash.substring(1,t.hash.length):""}L(xo,"canonicalizeHash");function Io(i,e){if(i=Vs(i,"?"),e||i==="")return i;let t=new URL("https://example.com");return t.search=i,t.search?t.search.substring(1,t.search.length):""}L(Io,"canonicalizeSearch");function Ao(i,e){return e||i===""?i:Gs(i)?Ys(i):Js(i)}L(Ao,"canonicalizeHostname");function Co(i,e){if(e||i==="")return i;let t=new URL("https://example.com");return t.password=i,t.password}L(Co,"canonicalizePassword");function Lo(i,e){if(e||i==="")return i;let t=new URL("https://example.com");return t.username=i,t.username}L(Lo,"canonicalizeUsername");function Fo(i,e,t){if(t||i==="")return i;if(e&&!Mo.includes(e))return new URL(`${e}:${i}`).pathname;let r=i[0]=="/";return i=new URL(r?i:"/-"+i,"https://example.com").pathname,r||(i=i.substring(2,i.length)),i}L(Fo,"canonicalizePathname");function Oo(i,e,t){return Qs(e)===i&&(i=""),t||i===""?i:Zs(i)}L(Oo,"canonicalizePort");function Ro(i,e){return i=_o(i,":"),e||i===""?i:ji(i)}L(Ro,"canonicalizeProtocol");function Qs(i){switch(i){case"ws":case"http":return"80";case"wws":case"https":return"443";case"ftp":return"21";default:return""}}L(Qs,"defaultPortForProtocol");function ji(i){if(i==="")return i;if(/^[-+.A-Za-z0-9]*$/.test(i))return i.toLowerCase();throw new TypeError(`Invalid protocol '${i}'.`)}L(ji,"protocolEncodeCallback");function Do(i){if(i==="")return i;let e=new URL("https://example.com");return e.username=i,e.username}L(Do,"usernameEncodeCallback");function No(i){if(i==="")return i;let e=new URL("https://example.com");return e.password=i,e.password}L(No,"passwordEncodeCallback");function Js(i){if(i==="")return i;if(/[\t\n\r #%/:<>?@[\]^\\|]/g.test(i))throw new TypeError(`Invalid hostname '${i}'`);let e=new URL("https://example.com");return e.hostname=i,e.hostname}L(Js,"hostnameEncodeCallback");function Ys(i){if(i==="")return i;if(/[^0-9a-fA-F[\]:]/g.test(i))throw new TypeError(`Invalid IPv6 hostname '${i}'`);return i.toLowerCase()}L(Ys,"ipv6HostnameEncodeCallback");function Zs(i){if(i===""||/^[0-9]*$/.test(i)&&parseInt(i)<=65535)return i;throw new TypeError(`Invalid port '${i}'.`)}L(Zs,"portEncodeCallback");function Ho(i){if(i==="")return i;let e=new URL("https://example.com");return e.pathname=i[0]!=="/"?"/-"+i:i,i[0]!=="/"?e.pathname.substring(2,e.pathname.length):e.pathname}L(Ho,"standardURLPathnameEncodeCallback");function Wo(i){return i===""?i:new URL(`data:${i}`).pathname}L(Wo,"pathURLPathnameEncodeCallback");function Bo(i){if(i==="")return i;let e=new URL("https://example.com");return e.search=i,e.search.substring(1,e.search.length)}L(Bo,"searchEncodeCallback");function Uo(i){if(i==="")return i;let e=new URL("https://example.com");return e.hash=i,e.hash.substring(1,e.hash.length)}L(Uo,"hashEncodeCallback");var Ko=class{#e;#t=[];#r={};#i=0;#s=1;#n=0;#a=0;#u=0;#c=0;#l=!1;constructor(i){this.#e=i}get result(){return this.#r}parse(){for(this.#t=js(this.#e,!0);this.#i<this.#t.length;this.#i+=this.#s){if(this.#s=1,this.#t[this.#i].type==="END"){if(this.#a===0){this.#p(),this.#S()?this.#o(9,1):this.#E()?this.#o(8,1):this.#o(7,0);continue}else if(this.#a===2){this.#m(5);continue}this.#o(10,0);break}if(this.#u>0)if(this.#T())this.#u-=1;else continue;if(this.#_()){this.#u+=1;continue}switch(this.#a){case 0:this.#g()&&this.#m(1);break;case 1:if(this.#g()){this.#x();let i=7,e=1;this.#v()?(i=2,e=3):this.#l&&(i=2),this.#o(i,e)}break;case 2:this.#w()?this.#m(3):(this.#y()||this.#E()||this.#S())&&this.#m(5);break;case 3:this.#b()?this.#o(4,1):this.#w()&&this.#o(5,1);break;case 4:this.#w()&&this.#o(5,1);break;case 5:this.#M()?this.#c+=1:this.#I()&&(this.#c-=1),this.#P()&&!this.#c?this.#o(6,1):this.#y()?this.#o(7,0):this.#E()?this.#o(8,1):this.#S()&&this.#o(9,1);break;case 6:this.#y()?this.#o(7,0):this.#E()?this.#o(8,1):this.#S()&&this.#o(9,1);break;case 7:this.#E()?this.#o(8,1):this.#S()&&this.#o(9,1);break;case 8:this.#S()&&this.#o(9,1);break;case 9:break;case 10:break}}this.#r.hostname!==void 0&&this.#r.port===void 0&&(this.#r.port="")}#o(i,e){switch(this.#a){case 0:break;case 1:this.#r.protocol=this.#k();break;case 2:break;case 3:this.#r.username=this.#k();break;case 4:this.#r.password=this.#k();break;case 5:this.#r.hostname=this.#k();break;case 6:this.#r.port=this.#k();break;case 7:this.#r.pathname=this.#k();break;case 8:this.#r.search=this.#k();break;case 9:this.#r.hash=this.#k();break;case 10:break}this.#a!==0&&i!==10&&([1,2,3,4].includes(this.#a)&&[6,7,8,9].includes(i)&&(this.#r.hostname??=""),[1,2,3,4,5,6].includes(this.#a)&&[8,9].includes(i)&&(this.#r.pathname??=this.#l?"/":""),[1,2,3,4,5,6,7].includes(this.#a)&&i===9&&(this.#r.search??="")),this.#h(i,e)}#h(i,e){this.#a=i,this.#n=this.#i+e,this.#i+=e,this.#s=0}#p(){this.#i=this.#n,this.#s=0}#m(i){this.#p(),this.#a=i}#d(i){return i<0&&(i=this.#t.length-i),i<this.#t.length?this.#t[i]:this.#t[this.#t.length-1]}#f(i,e){let t=this.#d(i);return t.value===e&&(t.type==="CHAR"||t.type==="ESCAPED_CHAR"||t.type==="INVALID_CHAR")}#g(){return this.#f(this.#i,":")}#v(){return this.#f(this.#i+1,"/")&&this.#f(this.#i+2,"/")}#w(){return this.#f(this.#i,"@")}#b(){return this.#f(this.#i,":")}#P(){return this.#f(this.#i,":")}#y(){return this.#f(this.#i,"/")}#E(){if(this.#f(this.#i,"?"))return!0;if(this.#t[this.#i].value!=="?")return!1;let i=this.#d(this.#i-1);return i.type!=="NAME"&&i.type!=="REGEX"&&i.type!=="CLOSE"&&i.type!=="ASTERISK"}#S(){return this.#f(this.#i,"#")}#_(){return this.#t[this.#i].type=="OPEN"}#T(){return this.#t[this.#i].type=="CLOSE"}#M(){return this.#f(this.#i,"[")}#I(){return this.#f(this.#i,"]")}#k(){let i=this.#t[this.#i],e=this.#d(this.#n).index;return this.#e.substring(e,i.index)}#x(){let i={};Object.assign(i,St),i.encodePart=ji;let e=To(this.#k(),void 0,i);this.#l=Xs(e)}};L(Ko,"Parser");var Bs=["protocol","username","password","hostname","port","pathname","search","hash"],bt="*";function qs(i,e){if(typeof i!="string")throw new TypeError("parameter 1 is not of type 'string'.");let t=new URL(i,e);return{protocol:t.protocol.substring(0,t.protocol.length-1),username:t.username,password:t.password,hostname:t.hostname,port:t.port,pathname:t.pathname,search:t.search!==""?t.search.substring(1,t.search.length):void 0,hash:t.hash!==""?t.hash.substring(1,t.hash.length):void 0}}L(qs,"extractValues");function ze(i,e){return e?ir(i):i}L(ze,"processBaseURLString");function rr(i,e,t){let r;if(typeof e.baseURL=="string")try{r=new URL(e.baseURL),e.protocol===void 0&&(i.protocol=ze(r.protocol.substring(0,r.protocol.length-1),t)),!t&&e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&e.username===void 0&&(i.username=ze(r.username,t)),!t&&e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&e.username===void 0&&e.password===void 0&&(i.password=ze(r.password,t)),e.protocol===void 0&&e.hostname===void 0&&(i.hostname=ze(r.hostname,t)),e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&(i.port=ze(r.port,t)),e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&e.pathname===void 0&&(i.pathname=ze(r.pathname,t)),e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&e.pathname===void 0&&e.search===void 0&&(i.search=ze(r.search.substring(1,r.search.length),t)),e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&e.pathname===void 0&&e.search===void 0&&e.hash===void 0&&(i.hash=ze(r.hash.substring(1,r.hash.length),t))}catch{throw new TypeError(`invalid baseURL '${e.baseURL}'.`)}if(typeof e.protocol=="string"&&(i.protocol=Ro(e.protocol,t)),typeof e.username=="string"&&(i.username=Lo(e.username,t)),typeof e.password=="string"&&(i.password=Co(e.password,t)),typeof e.hostname=="string"&&(i.hostname=Ao(e.hostname,t)),typeof e.port=="string"&&(i.port=Oo(e.port,i.protocol,t)),typeof e.pathname=="string"){if(i.pathname=e.pathname,r&&!Po(i.pathname,t)){let s=r.pathname.lastIndexOf("/");s>=0&&(i.pathname=ze(r.pathname.substring(0,s+1),t)+i.pathname)}i.pathname=Fo(i.pathname,i.protocol,t)}return typeof e.search=="string"&&(i.search=Io(e.search,t)),typeof e.hash=="string"&&(i.hash=xo(e.hash,t)),i}L(rr,"applyInit");function ir(i){return i.replace(/([+*?:{}()\\])/g,"\\$1")}L(ir,"escapePatternString");function qo(i){return i.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")}L(qo,"escapeRegexpString");function jo(i,e){e.delimiter??="/#?",e.prefixes??="./",e.sensitive??=!1,e.strict??=!1,e.end??=!0,e.start??=!0,e.endsWith="";let t=".*",r=`[^${qo(e.delimiter)}]+?`,s=/[$_\u200C\u200D\p{ID_Continue}]/u,n="";for(let o=0;o<i.length;++o){let a=i[o];if(a.type===3){if(a.modifier===3){n+=ir(a.value);continue}n+=`{${ir(a.value)}}${Ot(a.modifier)}`;continue}let c=a.hasCustomName(),l=!!a.suffix.length||!!a.prefix.length&&(a.prefix.length!==1||!e.prefixes.includes(a.prefix)),u=o>0?i[o-1]:null,h=o<i.length-1?i[o+1]:null;if(!l&&c&&a.type===1&&a.modifier===3&&h&&!h.prefix.length&&!h.suffix.length)if(h.type===3){let f=h.value.length>0?h.value[0]:"";l=s.test(f)}else l=!h.hasCustomName();if(!l&&!a.prefix.length&&u&&u.type===3){let f=u.value[u.value.length-1];l=e.prefixes.includes(f)}l&&(n+="{"),n+=ir(a.prefix),c&&(n+=`:${a.name}`),a.type===2?n+=`(${a.value})`:a.type===1?c||(n+=`(${r})`):a.type===0&&(!c&&(!u||u.type===3||u.modifier!==3||l||a.prefix!=="")?n+="*":n+=`(${t})`),a.type===1&&c&&a.suffix.length&&s.test(a.suffix[0])&&(n+="\\"),n+=ir(a.suffix),l&&(n+="}"),a.modifier!==3&&(n+=Ot(a.modifier))}return n}L(jo,"partsToPattern");var Rt=class{#e;#t={};#r={};#i={};#s={};#n=!1;constructor(i={},e,t){try{let r;if(typeof e=="string"?r=e:t=e,typeof i=="string"){let a=new Ko(i);if(a.parse(),i=a.result,r===void 0&&typeof i.protocol!="string")throw new TypeError("A base URL must be provided for a relative constructor string.");i.baseURL=r}else{if(!i||typeof i!="object")throw new TypeError("parameter 1 is not of type 'string' and cannot convert to dictionary.");if(r)throw new TypeError("parameter 1 is not of type 'string'.")}typeof t>"u"&&(t={ignoreCase:!1});let s={ignoreCase:t.ignoreCase===!0},n={pathname:bt,protocol:bt,username:bt,password:bt,hostname:bt,port:bt,search:bt,hash:bt};this.#e=rr(n,i,!0),Qs(this.#e.protocol)===this.#e.port&&(this.#e.port="");let o;for(o of Bs){if(!(o in this.#e))continue;let a={},c=this.#e[o];switch(this.#r[o]=[],o){case"protocol":Object.assign(a,St),a.encodePart=ji;break;case"username":Object.assign(a,St),a.encodePart=Do;break;case"password":Object.assign(a,St),a.encodePart=No;break;case"hostname":Object.assign(a,dl),Gs(c)?a.encodePart=Ys:a.encodePart=Js;break;case"port":Object.assign(a,St),a.encodePart=Zs;break;case"pathname":Xs(this.#t.protocol)?(Object.assign(a,fl,s),a.encodePart=Ho):(Object.assign(a,St,s),a.encodePart=Wo);break;case"search":Object.assign(a,St,s),a.encodePart=Bo;break;case"hash":Object.assign(a,St,s),a.encodePart=Uo;break}try{this.#s[o]=zs(c,a),this.#t[o]=$s(this.#s[o],this.#r[o],a),this.#i[o]=jo(this.#s[o],a),this.#n=this.#n||this.#s[o].some(l=>l.type===2)}catch{throw new TypeError(`invalid ${o} pattern '${this.#e[o]}'.`)}}}catch(r){throw new TypeError(`Failed to construct 'URLPattern': ${r.message}`)}}get[Symbol.toStringTag](){return"URLPattern"}test(i={},e){let t={pathname:"",protocol:"",username:"",password:"",hostname:"",port:"",search:"",hash:""};if(typeof i!="string"&&e)throw new TypeError("parameter 1 is not of type 'string'.");if(typeof i>"u")return!1;try{typeof i=="object"?t=rr(t,i,!1):t=rr(t,qs(i,e),!1)}catch{return!1}let r;for(r of Bs)if(!this.#t[r].exec(t[r]))return!1;return!0}exec(i={},e){let t={pathname:"",protocol:"",username:"",password:"",hostname:"",port:"",search:"",hash:""};if(typeof i!="string"&&e)throw new TypeError("parameter 1 is not of type 'string'.");if(typeof i>"u")return;try{typeof i=="object"?t=rr(t,i,!1):t=rr(t,qs(i,e),!1)}catch{return null}let r={};e?r.inputs=[i,e]:r.inputs=[i];let s;for(s of Bs){let n=this.#t[s].exec(t[s]);if(!n)return null;let o={};for(let[a,c]of this.#r[s].entries())if(typeof c=="string"||typeof c=="number"){let l=n[a+1];o[c]=l}r[s]={input:t[s]??"",groups:o}}return r}static compareComponent(i,e,t){let r=L((a,c)=>{for(let l of["type","modifier","prefix","value","suffix"]){if(a[l]<c[l])return-1;if(a[l]!==c[l])return 1}return 0},"comparePart"),s=new sr(3,"","","","",3),n=new sr(0,"","","","",3),o=L((a,c)=>{let l=0;for(;l<Math.min(a.length,c.length);++l){let u=r(a[l],c[l]);if(u)return u}return a.length===c.length?0:r(a[l]??s,c[l]??s)},"comparePartList");return!e.#i[i]&&!t.#i[i]?0:e.#i[i]&&!t.#i[i]?o(e.#s[i],[n]):!e.#i[i]&&t.#i[i]?o([n],t.#s[i]):o(e.#s[i],t.#s[i])}get protocol(){return this.#i.protocol}get username(){return this.#i.username}get password(){return this.#i.password}get hostname(){return this.#i.hostname}get port(){return this.#i.port}get pathname(){return this.#i.pathname}get search(){return this.#i.search}get hash(){return this.#i.hash}get hasRegExpGroups(){return this.#n}};L(Rt,"URLPattern");globalThis.URLPattern||(globalThis.URLPattern=Rt);function pl(i,e){return!!i._subtype()&&!e.subtype}var zi=class extends C{#e;#t=new Map;#r=new Map;#i=new Map;#s=new Set;#n;#a;#u=new G;#c=new WeakMap;#l=O.create();#o=!0;#h=[{}];#p=new Set;#m=!1;#d=[];#f=[];#g;constructor(e,t,r,s=!0,n,o,a){if(super(void 0,a),n&&o)throw new Error("Cannot specify both blockList and allowList");this.#e=e,this.#n=r,this.#a=t,this.#o=s,this.#g=a,this.#d=this.#k(n),this.#f=this.#k(o);let c=this.#u.use(new C(this.#e));c.on("Target.targetCreated",this.#E),c.on("Target.targetDestroyed",this.#S),c.on("Target.targetInfoChanged",this.#_),c.on(B.SessionDetached,this.#y),this.#v(this.#e)}async initialize(){await this.#e.send("Target.setDiscoverTargets",{discover:!0,filter:this.#h}),await this.#e.send("Target.setAutoAttach",{waitForDebuggerOnStart:!0,flatten:!0,autoAttach:!0,filter:[{type:"page",exclude:!0},...this.#h]}),this.#m=!0,this.#M(),await this.#l.valueOrThrow()}addToIgnoreTarget(e){this.#s.add(e)}getChildTargets(e){return e._childTargets()}dispose(){this.#u.dispose(),this.#w(this.#e)}getAvailableTargets(){return this.#r}getDiscoveredTargetInfos(){return this.#t}#v(e){P(!this.#c.has(e));let t=new G,r=t.use(new C(e));r.on("Target.attachedToTarget",s=>{this.#T(e,s)}),r.on("Target.detachedFromTarget",s=>this.#I(e,s)),this.#c.set(e,t)}#w(e){let t=this.#c.get(e);t&&(t.dispose(),this.#c.delete(e))}#b=async(e,t)=>{await e.send("Runtime.runIfWaitingForDebugger").catch(r=>{this.#g?.(E.error)?.(r)}),await t.send("Target.detachFromTarget",{sessionId:e.id()}).catch(r=>{this.#g?.(E.error)?.(r)})};#P=e=>e instanceof Ae?e.target():null;#y=e=>{this.#w(e)};#E=async e=>{if(this.#t.set(e.targetInfo.targetId,e.targetInfo),this.emit("targetDiscovered",e.targetInfo),e.targetInfo.type==="browser"&&e.targetInfo.attached){if(this.#r.has(e.targetInfo.targetId))return;let t=this.#a(e.targetInfo,void 0);t._initialize(),this.#r.set(e.targetInfo.targetId,t)}};#S=e=>{let t=this.#t.get(e.targetId);if(this.#t.delete(e.targetId),this.#M(e.targetId),t?.type==="service_worker"){let r=this.#r.get(e.targetId);r&&(this.emit("targetGone",r),this.#r.delete(e.targetId))}};#_=e=>{if(this.#t.set(e.targetInfo.targetId,e.targetInfo),this.#s.has(e.targetInfo.targetId)||!e.targetInfo.attached)return;let t=this.#r.get(e.targetInfo.targetId);if(!t)return;let r=t.url(),s=t._initializedDeferred.value()===Te.SUCCESS;if(pl(t,e.targetInfo)){let n=t._session();P(n,"Target that is being activated is missing a CDPSession."),n.parentSession()?.emit(B.Swapped,n)}t._targetInfoChanged(e.targetInfo),s&&r!==t.url()&&this.emit("targetChanged",{target:t,wasInitialized:s,previousURL:r})};#T=async(e,t)=>{let r=t.targetInfo,s=this.#e._session(t.sessionId);if(!s)throw new Error(`Session ${t.sessionId} was not created.`);if(!this.#e.isAutoAttached(r.targetId)){await this.#x(s,r);return}if(!this.#m&&!this.isUrlAllowed(r.url)){await this.#b(s,e);return}if(r.type==="service_worker"){if(!this.isUrlAllowed(r.url)){await Promise.all([this.#x(s,r),s.send("Runtime.runIfWaitingForDebugger")]).catch(l=>{this.#g?.(E.error)?.(l)});return}if(await this.#b(s,e),this.#r.has(r.targetId)||this.#s.has(r.targetId)||!this.#t.has(r.targetId))return;let c=this.#a(r);c._initialize(),this.#r.set(r.targetId,c),this.emit("targetAvailable",c);return}let n=this.#r.get(r.targetId),o=n!==void 0;n||(n=this.#a(r,s,e instanceof Ae?e:void 0));let a=this.#P(e);if(this.#n&&!this.#n(n)){this.#s.add(r.targetId),a?.type()==="tab"&&this.#M(a._targetId),await this.#b(s,e);return}this.#o&&t.targetInfo.type==="tab"&&!this.#m&&this.#p.add(t.targetInfo.targetId),this.#v(s),o?(s.setTarget(n),this.#i.set(s.id(),n)):(n._initialize(),this.#r.set(r.targetId,n),this.#i.set(s.id(),n)),a?._addChildTarget(n),e.emit(B.Ready,s),o||this.emit("targetAvailable",n),a?.type()==="tab"&&this.#M(a._targetId),await Promise.all([s.send("Target.setAutoAttach",{waitForDebuggerOnStart:!0,flatten:!0,autoAttach:!0,filter:this.#h}),this.#x(s,r),s.send("Runtime.runIfWaitingForDebugger")]).catch(c=>{this.#g?.(E.error)?.(c)})};#M(e){e!==void 0&&this.#p.delete(e),this.#m&&this.#p.size===0&&this.#l.resolve()}#I=(e,t)=>{let r=this.#i.get(t.sessionId);this.#i.delete(t.sessionId),r&&(e instanceof Ae&&e.target()._removeChildTarget(r),this.#r.delete(r._targetId),this.emit("targetGone",r))};isUrlAllowed=e=>{if(this.#d.length===0&&this.#f.length===0||!e||e==="about:blank")return!0;for(let t of this.#d)if(t.pattern.test(e))return!1;if(this.#f.length>0){for(let t of this.#f)if(t.pattern.test(e))return!0;return!1}return!0};#k(e){let t=[];for(let r of e??[])t.push({pattern:new Rt(r),rule:r});return t}#x=async(e,t)=>{if(this.#d.length===0&&this.#f.length===0)return;let r=[];for(let o of this.#d)r.push({urlPattern:o.rule,offline:!0,latency:0,downloadThroughput:-1,uploadThroughput:-1});if(this.#f.length>0){for(let o of this.#f)r.push({urlPattern:o.rule,offline:!1,latency:0,downloadThroughput:-1,uploadThroughput:-1});r.push({urlPattern:"",offline:!0,latency:0,downloadThroughput:-1,uploadThroughput:-1})}let s=t.type==="worker"||t.type==="service_worker"||t.type==="shared_worker",n=[];s&&n.push(e.send("Network.enable")),n.push(e.send("Network.emulateNetworkConditionsByRule",{offline:this.#d.length>0?!0:void 0,matchedNetworkConditions:r})),await Promise.all(n).catch(o=>{this.#g?.(E.error)?.(o)})}};var $i=class extends oi{#e;#t;constructor(e,t,r,s,n,o,a){super(e,t,r,s,n),this.#e=o,this.#t=a}async workers(){let t=this.#e.targets().filter(s=>{let n=s.url();return s.type()==="service_worker"&&n.startsWith("chrome-extension://"+this.id)});return(await Promise.all(t.map(async s=>{try{return await s.worker()}catch(n){if(this.#r(n))return this.#t?.(E.error)?.(n),null;throw n}}))).filter(s=>s!==null)}async pages(){let t=this.#e.targets().filter(s=>{let n=s.url();return(s.type()==="page"||s.type()==="background_page")&&n.startsWith("chrome-extension://"+this.id)});return(await Promise.all(t.map(async s=>{try{return await s.asPage()}catch(n){if(this.#r(n))return this.#t?.(E.error)?.(n),null;throw n}}))).filter(s=>s!==null)}async triggerAction(e){await this.#e._connection.send("Extensions.triggerAction",{id:this.id,targetId:e._tabId})}#r(e){return Q(e)&&(je(e)||e.message.includes("No target with given id found"))}};function zo(i){return i.startsWith("devtools://devtools/bundled/devtools_app.html")}var Vi=class i extends Br{protocol="cdp";static async _create(e,t,r,s=void 0,n=void 0,o=void 0,a=void 0,c=void 0,l=void 0,u=!0,h=!0,f=!0,p=!1,w=void 0,y=void 0,b){let T=new i(e,t,s,o,a,c,l,u,h,f,p,w,y,b);if(y){let W=await T.#S();if(parseInt(W.product.match(/\d+/)?.[0]??"0",10)<149)throw new Error("The allowlist option require Chrome 149 or greater.")}return r&&await e.send("Security.setIgnoreCertificateErrors",{ignore:!0}),await T._attach(n),T}#e;#t;#r;#i;#s;#n;#a;#u=new Map;#c=!0;#l=!0;#o;#h=!1;#p=new Map;#m;#d=!1;#f=new G;constructor(e,t,r=void 0,s=void 0,n=void 0,o=void 0,a=void 0,c=!0,l=!0,u=!0,h=!1,f=void 0,p=void 0,w){super(w),this.#c=l,this.#l=u,this.#e=r,this.#t=s,this.#r=e,this.#i=n||(()=>{}),this.#s=o||(()=>!0),this.#h=h,this.#v(a),this.#d=!!(f&&f.length>0||p&&p.length>0),e.rejectEmulateNetworkConditionsCalls=this.#d,this.#o=new zi(e,this.#w,this.#s,c,f,p,w),this.#a=new tr(this.#r,this,void 0,w);for(let y of t)this.#u.set(y,new tr(this.#r,this,y,w))}#g=()=>{this.emit("disconnected",void 0)};async _attach(e){this.#f.use(new C(this.#r)).on(B.Disconnected,this.#g),e&&await this.#a.setDownloadBehavior(e);let r=this.#f.use(new C(this.#o));r.on("targetAvailable",this.#b),r.on("targetGone",this.#P),r.on("targetChanged",this.#y),r.on("targetDiscovered",this.#E),await this.#o.initialize()}_detach(){this.#f.dispose()}process(){return this.#t??null}_targetManager(){return this.#o}#v(e){this.#n=e||(t=>t.type()==="page"||t.type()==="background_page"||t.type()==="webview"||this.#h&&t.type()==="other"&&zo(t.url()))}_getIsPageTargetCallback(){return this.#n}async createBrowserContext(e={}){let{proxyServer:t,proxyBypassList:r,downloadBehavior:s}=e,{browserContextId:n}=await this.#r.send("Target.createBrowserContext",{proxyServer:t,proxyBypassList:r&&r.join(",")}),o=new tr(this.#r,this,n,this.logger);return s&&await o.setDownloadBehavior(s),this.#u.set(n,o),o}browserContexts(){return[this.#a,...Array.from(this.#u.values())]}defaultBrowserContext(){return this.#a}async _disposeContext(e){e&&(await this.#r.send("Target.disposeBrowserContext",{browserContextId:e}),this.#u.delete(e))}#w=(e,t)=>{let{browserContextId:r}=e,s=r&&this.#u.has(r)?this.#u.get(r):this.#a;if(!s)throw new Error("Missing browser context");let n=a=>this.#r._createSession(e,a),o=new qi(e,t,s,this.#o,n,this.logger);return e.url&&zo(e.url)?new Ui(e,t,s,this.#o,n,this.#e??null,this.logger):this.#n(o)?new Tr(e,t,s,this.#o,n,this.#e??null,this.logger):e.type==="service_worker"||e.type==="shared_worker"?new Ki(e,t,s,this.#o,n,this.logger):o};#b=async e=>{e._isTargetExposed()&&await e._initializedDeferred.valueOrThrow()===Te.SUCCESS&&(this.emit("targetcreated",e),e.browserContext().emit("targetcreated",e))};#P=async e=>{e._initializedDeferred.resolve(Te.ABORTED),e._isClosedDeferred.resolve(),e._isTargetExposed()&&await e._initializedDeferred.valueOrThrow()===Te.SUCCESS&&(this.emit("targetdestroyed",e),e.browserContext().emit("targetdestroyed",e))};#y=({target:e})=>{this.emit("targetchanged",e),e.browserContext().emit("targetchanged",e)};#E=e=>{this.emit("targetdiscovered",e)};wsEndpoint(){return this.#r.url()}async newPage(e){return await this.#a.newPage(e)}async _createPageInContext(e,t){let r=this.targets().filter(l=>l.browserContext().id===e).length>0,s=t?.type==="window"?t.windowBounds:void 0,{targetId:n}=await this.#r.send("Target.createTarget",{url:"about:blank",browserContextId:e||void 0,left:s?.left,top:s?.top,width:s?.width,height:s?.height,windowState:s?.windowState,newWindow:r&&t?.type==="window"?!0:void 0,background:t?.background}),o=await this.waitForTarget(l=>l._targetId===n);if(!o)throw new Error(`Missing target for page (id = ${n})`);if(!(await o._initializedDeferred.valueOrThrow()===Te.SUCCESS))throw new Error(`Failed to create target for page (id = ${n})`);let c=await o.page();if(!c)throw new Error(`Failed to create a page for context (id = ${e})`);return c}async _createDevToolsPage(e){let t=await this.#r.send("Target.openDevTools",{targetId:e});return await this._getDevToolsTargetPage(t.targetId)}async _getDevToolsTargetPage(e){let t=await this.waitForTarget(n=>n._targetId===e);if(!t)throw new Error(`Missing target for DevTools page (id = ${e})`);if(!(await t._initializedDeferred.valueOrThrow()===Te.SUCCESS))throw new Error(`Failed to create target for DevTools page (id = ${e})`);let s=await t.page();if(!s)throw new Error(`Failed to create a DevTools Page for target (id = ${e})`);return s}async _hasDevToolsTarget(e){return(await this.#r.send("Target.getDevToolsTarget",{targetId:e})).targetId}async installExtension(e,t){let{id:r}=await this.#r.send("Extensions.loadUnpacked",{path:e,enableInIncognito:t?.enabledInIncognito??!1});return this.#p.delete(r),r}async uninstallExtension(e){await this.#r.send("Extensions.uninstall",{id:e});let t=[];for(let[r,s]of this._targetManager().getDiscoveredTargetInfos().entries())s.url.includes(e)&&s.type==="service_worker"&&(this._targetManager().addToIgnoreTarget(r),t.push(new Promise(n=>setTimeout(()=>{this.#r.emit("Target.targetDestroyed",{targetId:r}),n(null)},0))));await Promise.all(t),this.#p.delete(e)}async installPWA(e){if(this.#d)throw new Error("PWA APIs are not supported when network restrictions are configured.");return await this.#r.send("PWA.install",{manifestId:e.manifestId,installUrlOrBundleUrl:e.installUrlOrBundleUrl}),e.displayMode&&await this.#r.send("PWA.changeAppUserSettings",{manifestId:e.manifestId,displayMode:e.displayMode}),e.manifestId}async uninstallPWA(e){if(this.#d)throw new Error("PWA APIs are not supported when network restrictions are configured.");await this.#r.send("PWA.uninstall",{manifestId:e.manifestId})}async launchPWA(e){if(this.#d)throw new Error("PWA APIs are not supported when network restrictions are configured.");let{targetId:t}=await this.#r.send("PWA.launch",{manifestId:e.manifestId,url:e.url}),s=await(await this.waitForTarget(n=>{let o=this.#o.getAvailableTargets().get(t);if(o?.type()!=="tab")return!1;for(let a of o._childTargets())if(a===n)return!0;return!1},{timeout:e.timeout})).page();if(!s)throw new Error(`Failed to create a page for the launched PWA (manifestId = ${e.manifestId})`);return s}async getPWAState(e){if(this.#d)throw new Error("PWA APIs are not supported when network restrictions are configured.");let{badgeCount:t,fileHandlers:r}=await this.#r.send("PWA.getOsAppState",{manifestId:e.manifestId});return{badgeCount:t,fileHandlers:r}}async screens(){let{screenInfos:e}=await this.#r.send("Emulation.getScreenInfos");return e}async addScreen(e){let{screenInfo:t}=await this.#r.send("Emulation.addScreen",e);return t}async removeScreen(e){return await this.#r.send("Emulation.removeScreen",{screenId:e})}async getWindowBounds(e){let{bounds:t}=await this.#r.send("Browser.getWindowBounds",{windowId:Number(e)});return t}async setWindowBounds(e,t){await this.#r.send("Browser.setWindowBounds",{windowId:Number(e),bounds:t})}targets(){return Array.from(this.#o.getAvailableTargets().values()).filter(e=>e._isTargetExposed()&&e._initializedDeferred.value()===Te.SUCCESS)}target(){let e=this.targets().find(t=>t.type()==="browser");if(!e)throw new Error("Browser target is not found");return e}async version(){return(await this.#S()).product}async userAgent(){return(await this.#S()).userAgent}async close(){await this.#i.call(null),await this.disconnect()}disconnect(){return this.#o.dispose(),this.#r.dispose(),this._detach(),Promise.resolve()}get _connection(){return this.#r}get connected(){return!this.#r._closed}async#S(){if(!this.#m){this.#m=O.create();try{this.#m.resolve(await this.#r.send("Browser.getVersion"))}catch(e){this.#m.reject(e)}}return await this.#m.valueOrThrow()}get debugInfo(){return{pendingProtocolErrors:this.#r.getPendingProtocolErrors()}}isNetworkEnabled(){return this.#c}async extensions(){let e=await this.#r.send("Extensions.getExtensions"),t=new Map;for(let r of e.extensions)if(this.#p.has(r.id))t.set(r.id,this.#p.get(r.id));else{let s=new $i(r.id,r.version,r.name,r.path,r.enabled,this,this.logger);t.set(r.id,s)}return this.#p=t,this.#p}isIssuesEnabled(){return this.#l}};async function $o(i,e,t,r){let{acceptInsecureCerts:s=!1,networkEnabled:n=!0,issuesEnabled:o=!0,defaultViewport:a=Dr,downloadBehavior:c,targetFilter:l,_isPageTarget:u,slowMo:h=0,protocolTimeout:f,handleDevToolsAsPage:p,idGenerator:w=pt(),blocklist:y,allowlist:b}=t,T=t.logger??r,W=new Yt(e,i,h,f,!1,w,T),{browserContextIds:N}=await W.send("Target.getBrowserContexts");return await Vi._create(W,N,s,a,c,void 0,()=>W.send("Browser.close").catch($=>{T?.(E.error)?.($)}),l,u,void 0,n,o,p,y,b,T)}var Vo={targetId:"tabTargetId",type:"tab",title:"tab",url:"about:blank",attached:!1,canAccessOpener:!1},Go={targetId:"pageTargetId",type:"page",title:"page",url:"about:blank",attached:!1,canAccessOpener:!1},Xo=class i{static async connectTab(e){return await chrome.debugger.attach({tabId:e},"1.3"),new i(e)}onmessage;onclose;#e;constructor(e){this.#e=e,chrome.debugger.onEvent.addListener(this.#t)}#t=(e,t,r)=>{e.tabId===this.#e&&this.#r({sessionId:e.sessionId??"pageTargetSessionId",method:t,params:r})};#r(e){setTimeout(()=>{this.onmessage?.(JSON.stringify(e))},0)}send(e){let t=JSON.parse(e);switch(t.method){case"Browser.getVersion":{this.#r({id:t.id,sessionId:t.sessionId,method:t.method,result:{protocolVersion:"1.3",product:"chrome",revision:"unknown",userAgent:"chrome",jsVersion:"unknown"}});return}case"Target.getBrowserContexts":{this.#r({id:t.id,sessionId:t.sessionId,method:t.method,result:{browserContextIds:[]}});return}case"Target.setDiscoverTargets":{this.#r({method:"Target.targetCreated",params:{targetInfo:Vo}}),this.#r({method:"Target.targetCreated",params:{targetInfo:Go}}),this.#r({id:t.id,sessionId:t.sessionId,method:t.method,result:{}});return}case"Target.setAutoAttach":if(t.sessionId==="tabTargetSessionId"){this.#r({method:"Target.attachedToTarget",sessionId:"tabTargetSessionId",params:{targetInfo:Go,sessionId:"pageTargetSessionId"}}),this.#r({id:t.id,sessionId:t.sessionId,method:t.method,result:{}});return}else if(!t.sessionId){this.#r({method:"Target.attachedToTarget",params:{targetInfo:Vo,sessionId:"tabTargetSessionId"}}),this.#r({id:t.id,sessionId:t.sessionId,method:t.method,result:{}});return}}t.sessionId==="pageTargetSessionId"&&delete t.sessionId,chrome.debugger.sendCommand({tabId:this.#e,sessionId:t.sessionId},t.method,t.params).then(r=>{this.#r({id:t.id,sessionId:t.sessionId??"pageTargetSessionId",method:t.method,result:r})}).catch(r=>{this.#r({id:t.id,sessionId:t.sessionId??"pageTargetSessionId",method:t.method,error:{code:r?.code,data:r?.data,message:r?.message??"CDP error had no message"}})})}close(){chrome.debugger.onEvent.removeListener(this.#t),chrome.debugger.detach({tabId:this.#e})}};var Ty=Object.freeze({"Slow 3G":{download:5e4,upload:5e4,latency:2e3},"Fast 3G":{download:18e4,upload:84375,latency:562.5},"Slow 4G":{download:18e4,upload:84375,latency:562.5},"Fast 4G":{download:1012500,upload:168750,latency:165}});var ml=[{name:"Blackberry PlayBook",userAgent:"Mozilla/5.0 (PlayBook; U; RIM Tablet OS 2.1.0; en-US) AppleWebKit/536.2+ (KHTML like Gecko) Version/7.2.1.0 Safari/536.2+",viewport:{width:600,height:1024,deviceScaleFactor:1,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"Blackberry PlayBook landscape",userAgent:"Mozilla/5.0 (PlayBook; U; RIM Tablet OS 2.1.0; en-US) AppleWebKit/536.2+ (KHTML like Gecko) Version/7.2.1.0 Safari/536.2+",viewport:{width:1024,height:600,deviceScaleFactor:1,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"BlackBerry Z30",userAgent:"Mozilla/5.0 (BB10; Touch) AppleWebKit/537.10+ (KHTML, like Gecko) Version/10.0.9.2372 Mobile Safari/537.10+",viewport:{width:360,height:640,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"BlackBerry Z30 landscape",userAgent:"Mozilla/5.0 (BB10; Touch) AppleWebKit/537.10+ (KHTML, like Gecko) Version/10.0.9.2372 Mobile Safari/537.10+",viewport:{width:640,height:360,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"Galaxy Note 3",userAgent:"Mozilla/5.0 (Linux; U; Android 4.3; en-us; SM-N900T Build/JSS15J) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30",viewport:{width:360,height:640,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"Galaxy Note 3 landscape",userAgent:"Mozilla/5.0 (Linux; U; Android 4.3; en-us; SM-N900T Build/JSS15J) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30",viewport:{width:640,height:360,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"Galaxy Note II",userAgent:"Mozilla/5.0 (Linux; U; Android 4.1; en-us; GT-N7100 Build/JRO03C) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30",viewport:{width:360,height:640,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"Galaxy Note II landscape",userAgent:"Mozilla/5.0 (Linux; U; Android 4.1; en-us; GT-N7100 Build/JRO03C) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30",viewport:{width:640,height:360,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"Galaxy S III",userAgent:"Mozilla/5.0 (Linux; U; Android 4.0; en-us; GT-I9300 Build/IMM76D) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30",viewport:{width:360,height:640,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"Galaxy S III landscape",userAgent:"Mozilla/5.0 (Linux; U; Android 4.0; en-us; GT-I9300 Build/IMM76D) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30",viewport:{width:640,height:360,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"Galaxy S5",userAgent:"Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/LRX21T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3765.0 Mobile Safari/537.36",viewport:{width:360,height:640,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"Galaxy S5 landscape",userAgent:"Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/LRX21T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3765.0 Mobile Safari/537.36",viewport:{width:640,height:360,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"Galaxy S8",userAgent:"Mozilla/5.0 (Linux; Android 7.0; SM-G950U Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.84 Mobile Safari/537.36",viewport:{width:360,height:740,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"Galaxy S8 landscape",userAgent:"Mozilla/5.0 (Linux; Android 7.0; SM-G950U Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.84 Mobile Safari/537.36",viewport:{width:740,height:360,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"Galaxy S9+",userAgent:"Mozilla/5.0 (Linux; Android 8.0.0; SM-G965U Build/R16NW) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.111 Mobile Safari/537.36",viewport:{width:320,height:658,deviceScaleFactor:4.5,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"Galaxy S9+ landscape",userAgent:"Mozilla/5.0 (Linux; Android 8.0.0; SM-G965U Build/R16NW) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.111 Mobile Safari/537.36",viewport:{width:658,height:320,deviceScaleFactor:4.5,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"Galaxy Tab S4",userAgent:"Mozilla/5.0 (Linux; Android 8.1.0; SM-T837A) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.80 Safari/537.36",viewport:{width:712,height:1138,deviceScaleFactor:2.25,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"Galaxy Tab S4 landscape",userAgent:"Mozilla/5.0 (Linux; Android 8.1.0; SM-T837A) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.80 Safari/537.36",viewport:{width:1138,height:712,deviceScaleFactor:2.25,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPad",userAgent:"Mozilla/5.0 (iPad; CPU OS 11_0 like Mac OS X) AppleWebKit/604.1.34 (KHTML, like Gecko) Version/11.0 Mobile/15A5341f Safari/604.1",viewport:{width:768,height:1024,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPad landscape",userAgent:"Mozilla/5.0 (iPad; CPU OS 11_0 like Mac OS X) AppleWebKit/604.1.34 (KHTML, like Gecko) Version/11.0 Mobile/15A5341f Safari/604.1",viewport:{width:1024,height:768,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPad (gen 6)",userAgent:"Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1",viewport:{width:768,height:1024,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPad (gen 6) landscape",userAgent:"Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1",viewport:{width:1024,height:768,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPad (gen 7)",userAgent:"Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1",viewport:{width:810,height:1080,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPad (gen 7) landscape",userAgent:"Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1",viewport:{width:1080,height:810,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPad Mini",userAgent:"Mozilla/5.0 (iPad; CPU OS 11_0 like Mac OS X) AppleWebKit/604.1.34 (KHTML, like Gecko) Version/11.0 Mobile/15A5341f Safari/604.1",viewport:{width:768,height:1024,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPad Mini landscape",userAgent:"Mozilla/5.0 (iPad; CPU OS 11_0 like Mac OS X) AppleWebKit/604.1.34 (KHTML, like Gecko) Version/11.0 Mobile/15A5341f Safari/604.1",viewport:{width:1024,height:768,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPad Pro",userAgent:"Mozilla/5.0 (iPad; CPU OS 11_0 like Mac OS X) AppleWebKit/604.1.34 (KHTML, like Gecko) Version/11.0 Mobile/15A5341f Safari/604.1",viewport:{width:1024,height:1366,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPad Pro landscape",userAgent:"Mozilla/5.0 (iPad; CPU OS 11_0 like Mac OS X) AppleWebKit/604.1.34 (KHTML, like Gecko) Version/11.0 Mobile/15A5341f Safari/604.1",viewport:{width:1366,height:1024,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPad Pro 11",userAgent:"Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1",viewport:{width:834,height:1194,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPad Pro 11 landscape",userAgent:"Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1",viewport:{width:1194,height:834,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 4",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 7_1_2 like Mac OS X) AppleWebKit/537.51.2 (KHTML, like Gecko) Version/7.0 Mobile/11D257 Safari/9537.53",viewport:{width:320,height:480,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 4 landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 7_1_2 like Mac OS X) AppleWebKit/537.51.2 (KHTML, like Gecko) Version/7.0 Mobile/11D257 Safari/9537.53",viewport:{width:480,height:320,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 5",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/10.0 Mobile/14E304 Safari/602.1",viewport:{width:320,height:568,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 5 landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/10.0 Mobile/14E304 Safari/602.1",viewport:{width:568,height:320,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 6",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1",viewport:{width:375,height:667,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 6 landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1",viewport:{width:667,height:375,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 6 Plus",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1",viewport:{width:414,height:736,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 6 Plus landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1",viewport:{width:736,height:414,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 7",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1",viewport:{width:375,height:667,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 7 landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1",viewport:{width:667,height:375,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 7 Plus",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1",viewport:{width:414,height:736,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 7 Plus landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1",viewport:{width:736,height:414,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 8",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1",viewport:{width:375,height:667,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 8 landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1",viewport:{width:667,height:375,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 8 Plus",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1",viewport:{width:414,height:736,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 8 Plus landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1",viewport:{width:736,height:414,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone SE",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/10.0 Mobile/14E304 Safari/602.1",viewport:{width:320,height:568,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone SE landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/10.0 Mobile/14E304 Safari/602.1",viewport:{width:568,height:320,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone SE (3rd gen)",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 18_5 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/26.5 Mobile/19E241 Safari/602.1",viewport:{width:375,height:667,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone SE (3rd gen) landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 18_5 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/26.5 Mobile/19E241 Safari/602.1",viewport:{width:667,height:375,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone X",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1",viewport:{width:375,height:812,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone X landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1",viewport:{width:812,height:375,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone XR",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 12_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0 Mobile/15E148 Safari/604.1",viewport:{width:414,height:896,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone XR landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 12_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0 Mobile/15E148 Safari/604.1",viewport:{width:896,height:414,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 11",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 13_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1 Mobile/15E148 Safari/604.1",viewport:{width:414,height:828,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 11 landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 13_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1 Mobile/15E148 Safari/604.1",viewport:{width:828,height:414,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 11 Pro",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 13_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1 Mobile/15E148 Safari/604.1",viewport:{width:375,height:812,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 11 Pro landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 13_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1 Mobile/15E148 Safari/604.1",viewport:{width:812,height:375,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 11 Pro Max",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 13_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1 Mobile/15E148 Safari/604.1",viewport:{width:414,height:896,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 11 Pro Max landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 13_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1 Mobile/15E148 Safari/604.1",viewport:{width:896,height:414,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 12",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1",viewport:{width:390,height:844,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 12 landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1",viewport:{width:844,height:390,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 12 Pro",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1",viewport:{width:390,height:844,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 12 Pro landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1",viewport:{width:844,height:390,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 12 Pro Max",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1",viewport:{width:428,height:926,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 12 Pro Max landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1",viewport:{width:926,height:428,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 12 Mini",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1",viewport:{width:375,height:812,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 12 Mini landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1",viewport:{width:812,height:375,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 13",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1",viewport:{width:390,height:844,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 13 landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1",viewport:{width:844,height:390,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 13 Pro",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1",viewport:{width:390,height:844,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 13 Pro landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1",viewport:{width:844,height:390,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 13 Pro Max",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1",viewport:{width:428,height:926,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 13 Pro Max landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1",viewport:{width:926,height:428,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 13 Mini",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1",viewport:{width:375,height:812,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 13 Mini landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1",viewport:{width:812,height:375,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 14",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 16_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1",viewport:{width:390,height:663,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 14 landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 16_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1",viewport:{width:750,height:340,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 14 Plus",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 16_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1",viewport:{width:428,height:745,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 14 Plus landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 16_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1",viewport:{width:832,height:378,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 14 Pro",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 16_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1",viewport:{width:393,height:659,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 14 Pro landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 16_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1",viewport:{width:734,height:343,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 14 Pro Max",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 16_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1",viewport:{width:430,height:739,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 14 Pro Max landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 16_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1",viewport:{width:814,height:380,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 15",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Mobile/15E148 Safari/604.1",viewport:{width:393,height:659,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 15 landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Mobile/15E148 Safari/604.1",viewport:{width:734,height:343,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 15 Plus",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Mobile/15E148 Safari/604.1",viewport:{width:430,height:739,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 15 Plus landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Mobile/15E148 Safari/604.1",viewport:{width:814,height:380,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 15 Pro",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Mobile/15E148 Safari/604.1",viewport:{width:393,height:659,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 15 Pro landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Mobile/15E148 Safari/604.1",viewport:{width:734,height:343,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 15 Pro Max",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Mobile/15E148 Safari/604.1",viewport:{width:430,height:739,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 15 Pro Max landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Mobile/15E148 Safari/604.1",viewport:{width:814,height:380,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 16",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",viewport:{width:393,height:659,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 16 landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",viewport:{width:734,height:343,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 16 Plus",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",viewport:{width:430,height:739,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 16 Plus landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",viewport:{width:814,height:380,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 16 Pro",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",viewport:{width:402,height:681,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 16 Pro landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",viewport:{width:756,height:352,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 16 Pro Max",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",viewport:{width:440,height:763,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 16 Pro Max landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",viewport:{width:838,height:390,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 16e",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",viewport:{width:390,height:651,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 16e landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",viewport:{width:726,height:340,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 17",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",viewport:{width:402,height:681,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 17 landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",viewport:{width:756,height:352,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone Air",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",viewport:{width:420,height:719,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone Air landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",viewport:{width:794,height:370,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 17 Pro",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",viewport:{width:402,height:681,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 17 Pro landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",viewport:{width:756,height:352,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 17 Pro Max",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",viewport:{width:440,height:763,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 17 Pro Max landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",viewport:{width:838,height:390,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 17e",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",viewport:{width:390,height:651,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 17e landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",viewport:{width:726,height:340,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"JioPhone 2",userAgent:"Mozilla/5.0 (Mobile; LYF/F300B/LYF-F300B-001-01-15-130718-i;Android; rv:48.0) Gecko/48.0 Firefox/48.0 KAIOS/2.5",viewport:{width:240,height:320,deviceScaleFactor:1,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"JioPhone 2 landscape",userAgent:"Mozilla/5.0 (Mobile; LYF/F300B/LYF-F300B-001-01-15-130718-i;Android; rv:48.0) Gecko/48.0 Firefox/48.0 KAIOS/2.5",viewport:{width:320,height:240,deviceScaleFactor:1,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"Kindle Fire HDX",userAgent:"Mozilla/5.0 (Linux; U; en-us; KFAPWI Build/JDQ39) AppleWebKit/535.19 (KHTML, like Gecko) Silk/3.13 Safari/535.19 Silk-Accelerated=true",viewport:{width:800,height:1280,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"Kindle Fire HDX landscape",userAgent:"Mozilla/5.0 (Linux; U; en-us; KFAPWI Build/JDQ39) AppleWebKit/535.19 (KHTML, like Gecko) Silk/3.13 Safari/535.19 Silk-Accelerated=true",viewport:{width:1280,height:800,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"LG Optimus L70",userAgent:"Mozilla/5.0 (Linux; U; Android 4.4.2; en-us; LGMS323 Build/KOT49I.MS32310c) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3765.0 Mobile Safari/537.36",viewport:{width:384,height:640,deviceScaleFactor:1.25,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"LG Optimus L70 landscape",userAgent:"Mozilla/5.0 (Linux; U; Android 4.4.2; en-us; LGMS323 Build/KOT49I.MS32310c) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3765.0 Mobile Safari/537.36",viewport:{width:640,height:384,deviceScaleFactor:1.25,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"Microsoft Lumia 550",userAgent:"Mozilla/5.0 (Windows Phone 10.0; Android 4.2.1; Microsoft; Lumia 550) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Mobile Safari/537.36 Edge/14.14263",viewport:{width:640,height:360,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"Microsoft Lumia 950",userAgent:"Mozilla/5.0 (Windows Phone 10.0; Android 4.2.1; Microsoft; Lumia 950) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Mobile Safari/537.36 Edge/14.14263",viewport:{width:360,height:640,deviceScaleFactor:4,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"Microsoft Lumia 950 landscape",userAgent:"Mozilla/5.0 (Windows Phone 10.0; Android 4.2.1; Microsoft; Lumia 950) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Mobile Safari/537.36 Edge/14.14263",viewport:{width:640,height:360,deviceScaleFactor:4,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"Nexus 10",userAgent:"Mozilla/5.0 (Linux; Android 6.0.1; Nexus 10 Build/MOB31T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3765.0 Safari/537.36",viewport:{width:800,height:1280,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"Nexus 10 landscape",userAgent:"Mozilla/5.0 (Linux; Android 6.0.1; Nexus 10 Build/MOB31T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3765.0 Safari/537.36",viewport:{width:1280,height:800,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"Nexus 4",userAgent:"Mozilla/5.0 (Linux; Android 4.4.2; Nexus 4 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3765.0 Mobile Safari/537.36",viewport:{width:384,height:640,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"Nexus 4 landscape",userAgent:"Mozilla/5.0 (Linux; Android 4.4.2; Nexus 4 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3765.0 Mobile Safari/537.36",viewport:{width:640,height:384,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"Nexus 5",userAgent:"Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3765.0 Mobile Safari/537.36",viewport:{width:360,height:640,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"Nexus 5 landscape",userAgent:"Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3765.0 Mobile Safari/537.36",viewport:{width:640,height:360,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"Nexus 5X",userAgent:"Mozilla/5.0 (Linux; Android 8.0.0; Nexus 5X Build/OPR4.170623.006) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3765.0 Mobile Safari/537.36",viewport:{width:412,height:732,deviceScaleFactor:2.625,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"Nexus 5X landscape",userAgent:"Mozilla/5.0 (Linux; Android 8.0.0; Nexus 5X Build/OPR4.170623.006) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3765.0 Mobile Safari/537.36",viewport:{width:732,height:412,deviceScaleFactor:2.625,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"Nexus 6",userAgent:"Mozilla/5.0 (Linux; Android 7.1.1; Nexus 6 Build/N6F26U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3765.0 Mobile Safari/537.36",viewport:{width:412,height:732,deviceScaleFactor:3.5,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"Nexus 6 landscape",userAgent:"Mozilla/5.0 (Linux; Android 7.1.1; Nexus 6 Build/N6F26U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3765.0 Mobile Safari/537.36",viewport:{width:732,height:412,deviceScaleFactor:3.5,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"Nexus 6P",userAgent:"Mozilla/5.0 (Linux; Android 8.0.0; Nexus 6P Build/OPP3.170518.006) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3765.0 Mobile Safari/537.36",viewport:{width:412,height:732,deviceScaleFactor:3.5,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"Nexus 6P landscape",userAgent:"Mozilla/5.0 (Linux; Android 8.0.0; Nexus 6P Build/OPP3.170518.006) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3765.0 Mobile Safari/537.36",viewport:{width:732,height:412,deviceScaleFactor:3.5,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"Nexus 7",userAgent:"Mozilla/5.0 (Linux; Android 6.0.1; Nexus 7 Build/MOB30X) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3765.0 Safari/537.36",viewport:{width:600,height:960,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"Nexus 7 landscape",userAgent:"Mozilla/5.0 (Linux; Android 6.0.1; Nexus 7 Build/MOB30X) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3765.0 Safari/537.36",viewport:{width:960,height:600,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"Nokia Lumia 520",userAgent:"Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; ARM; Touch; NOKIA; Lumia 520)",viewport:{width:320,height:533,deviceScaleFactor:1.5,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"Nokia Lumia 520 landscape",userAgent:"Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; ARM; Touch; NOKIA; Lumia 520)",viewport:{width:533,height:320,deviceScaleFactor:1.5,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"Nokia N9",userAgent:"Mozilla/5.0 (MeeGo; NokiaN9) AppleWebKit/534.13 (KHTML, like Gecko) NokiaBrowser/8.5.0 Mobile Safari/534.13",viewport:{width:480,height:854,deviceScaleFactor:1,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"Nokia N9 landscape",userAgent:"Mozilla/5.0 (MeeGo; NokiaN9) AppleWebKit/534.13 (KHTML, like Gecko) NokiaBrowser/8.5.0 Mobile Safari/534.13",viewport:{width:854,height:480,deviceScaleFactor:1,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"Pixel 2",userAgent:"Mozilla/5.0 (Linux; Android 8.0; Pixel 2 Build/OPD3.170816.012) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3765.0 Mobile Safari/537.36",viewport:{width:411,height:731,deviceScaleFactor:2.625,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"Pixel 2 landscape",userAgent:"Mozilla/5.0 (Linux; Android 8.0; Pixel 2 Build/OPD3.170816.012) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3765.0 Mobile Safari/537.36",viewport:{width:731,height:411,deviceScaleFactor:2.625,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"Pixel 2 XL",userAgent:"Mozilla/5.0 (Linux; Android 8.0.0; Pixel 2 XL Build/OPD1.170816.004) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3765.0 Mobile Safari/537.36",viewport:{width:411,height:823,deviceScaleFactor:3.5,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"Pixel 2 XL landscape",userAgent:"Mozilla/5.0 (Linux; Android 8.0.0; Pixel 2 XL Build/OPD1.170816.004) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3765.0 Mobile Safari/537.36",viewport:{width:823,height:411,deviceScaleFactor:3.5,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"Pixel 3",userAgent:"Mozilla/5.0 (Linux; Android 9; Pixel 3 Build/PQ1A.181105.017.A1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.158 Mobile Safari/537.36",viewport:{width:393,height:786,deviceScaleFactor:2.75,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"Pixel 3 landscape",userAgent:"Mozilla/5.0 (Linux; Android 9; Pixel 3 Build/PQ1A.181105.017.A1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.158 Mobile Safari/537.36",viewport:{width:786,height:393,deviceScaleFactor:2.75,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"Pixel 4",userAgent:"Mozilla/5.0 (Linux; Android 10; Pixel 4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Mobile Safari/537.36",viewport:{width:353,height:745,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"Pixel 4 landscape",userAgent:"Mozilla/5.0 (Linux; Android 10; Pixel 4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Mobile Safari/537.36",viewport:{width:745,height:353,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"Pixel 4a (5G)",userAgent:"Mozilla/5.0 (Linux; Android 11; Pixel 4a (5G)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4812.0 Mobile Safari/537.36",viewport:{width:353,height:745,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"Pixel 4a (5G) landscape",userAgent:"Mozilla/5.0 (Linux; Android 11; Pixel 4a (5G)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4812.0 Mobile Safari/537.36",viewport:{width:745,height:353,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"Pixel 5",userAgent:"Mozilla/5.0 (Linux; Android 11; Pixel 5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4812.0 Mobile Safari/537.36",viewport:{width:393,height:851,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"Pixel 5 landscape",userAgent:"Mozilla/5.0 (Linux; Android 11; Pixel 5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4812.0 Mobile Safari/537.36",viewport:{width:851,height:393,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"Moto G4",userAgent:"Mozilla/5.0 (Linux; Android 7.0; Moto G (4)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4812.0 Mobile Safari/537.36",viewport:{width:360,height:640,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"Moto G4 landscape",userAgent:"Mozilla/5.0 (Linux; Android 7.0; Moto G (4)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4812.0 Mobile Safari/537.36",viewport:{width:640,height:360,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}}],Qo={};for(let i of ml)Qo[i.name]=i;var _y=Object.freeze(Qo);async function Jo(i,e,t,r){let{acceptInsecureCerts:s=!1,networkEnabled:n=!0,issuesEnabled:o=!0,defaultViewport:a=Dr}=t,{bidiConnection:c,cdpConnection:l,closeCallback:u}=await gl(i,e,t,r);return await(await import("./chunk-6QBHU4DF.mjs")).BidiBrowser.create({connection:c,cdpConnection:l,closeCallback:u,process:void 0,defaultViewport:a,acceptInsecureCerts:s,networkEnabled:n,issuesEnabled:o,capabilities:t.capabilities,logger:r})}async function gl(i,e,t,r){let s=await import("./chunk-6QBHU4DF.mjs"),{slowMo:n=0,protocolTimeout:o,idGenerator:a=pt()}=t,c=new s.BidiConnection(e,i,a,n,o,t.logger??r);try{let f=await c.send("session.status",{});if("type"in f&&f.type==="success")return{bidiConnection:c,closeCallback:async()=>{await c.send("browser.close",{}).catch(p=>{r?.(E.error)?.(p)})}}}catch(f){if(!(f instanceof Le))throw f}c.unbind();let l=new Yt(e,i,n,o,!0,a,t.logger??r);if((await l.send("Browser.getVersion")).product.toLowerCase().includes("firefox"))throw new at("Firefox is not supported in BiDi over CDP mode.");let h=await s.connectBidiOverCdp(l,r);return{cdpConnection:l,bidiConnection:h,closeCallback:async()=>{await l.send("Browser.close").catch(f=>{r?.(E.error)?.(f)})}}}var en=async()=>Xi?(await import("./chunk-V6XZ4VIR.mjs")).NodeWebSocketTransport:(await import("./chunk-GRAXKKG4.mjs")).BrowserWebSocketTransport;function wl(i){if(i.blocklist&&i.allowlist)throw new Error("Cannot specify both blocklist and allowlist");if(i.protocol==="webDriverBiDi"&&(i.blocklist||i.allowlist))throw new Error("blocklist and allowlist are only supported with the CDP protocol");if(i.blocklist)for(let e of i.blocklist)new Rt(e);if(i.allowlist)for(let e of i.allowlist)new Rt(e)}async function Yo(i){wl(i);let{connectionTransport:e,endpointUrl:t}=await yl(i);return i.protocol==="webDriverBiDi"?await Jo(e,t,i,i.logger):await $o(e,t,i,i.logger)}async function yl(i){let{browserWSEndpoint:e,browserURL:t,channel:r,transport:s}=i,n=i.wsOptions?.headers??i.headers??{},o=i.wsOptions??{};if(P(+!!e+ +!!t+ +!!s+ +!!r==1,"Exactly one of browserWSEndpoint, browserURL, transport or channel must be passed to puppeteer.connect"),s)return{connectionTransport:s,endpointUrl:""};if(e)return{connectionTransport:await(await en()).create(e,n,i.logger,o),endpointUrl:e};if(t){let a=await vl(t,n);return{connectionTransport:await(await en()).create(a,n,i.logger,o),endpointUrl:a}}else if(i.channel&&Xi){let{detectBrowserPlatform:a,resolveDefaultUserDataDir:c,Browser:l}=await import("./chunk-LKX55H76.mjs"),u=a();if(!u)throw new Error("Could not detect required browser platform");let{convertPuppeteerChannelToBrowsersChannel:h}=await import("./chunk-AGDILNWB.mjs"),{join:f}=await import("node:path"),p=c(l.CHROME,u,h(i.channel)),w=f(p,"DevToolsActivePort");try{let y=await ee.value.readFile(w,"ascii"),[b,T]=y.split(`
47
+ `:", "):e}var Sr=class extends ci{#e;#t=null;#r=O.create();#i;#s;#n;#a;#u;#c={};#l;#o;constructor(e,t,r){super(),this.#e=e,this.#i={ip:t.remoteIPAddress,port:t.remotePort},this.#n=this.#h(r)||t.statusText,this.#a=!!t.fromDiskCache,this.#u=!!t.fromServiceWorker,this.#s=r?r.statusCode:t.status;let s=r?r.headers:t.headers;for(let[n,o]of Object.entries(s)){let a=n.toLowerCase();this.#c[a]=vo(a,o)}this.#l=t.securityDetails?new xi(t.securityDetails):null,this.#o=t.timing||null}#h(e){if(!e||!e.headersText)return;let t=e.headersText.split("\r",1)[0];if(!t||t.length>1e3)return;let r=t.match(/[^ ]* [^ ]* (.*)/);if(!r)return;let s=r[1];if(s)return s}_resolveBody(e){return e?this.#r.reject(e):this.#r.resolve()}remoteAddress(){return this.#i}url(){return this.#e.url()}status(){return this.#s}statusText(){return this.#n}headers(){return this.#c}securityDetails(){return this.#l}timing(){return this.#o}content(){return this.#t||(this.#t=this.#r.valueOrThrow().then(async()=>{try{let e=await this.#e.client.send("Network.getResponseBody",{requestId:this.#e.id});return Ue(e.body,e.base64Encoded)}catch(e){throw e instanceof Le&&e.originalMessage==="No resource with given identifier found"?new Le("Could not load response body for this request. This might happen if the request is a preflight request."):e}})),this.#t}request(){return this.#e}fromCache(){return this.#a||this.#e._fromMemoryCache}fromServiceWorker(){return this.#u}frame(){return this.#e.frame()}};var Ii=class{#e=new Map;#t=new Map;#r=new Map;#i=new Map;#s=new Map;#n=new Map;#a=new Map;forget(e){this.#e.delete(e),this.#t.delete(e),this.#i.delete(e),this.#a.delete(e),this.#n.delete(e),this.#s.delete(e)}requestExtraInfo(e){return this.#i.has(e)||this.#i.set(e,[]),this.#i.get(e)}responseExtraInfo(e){return this.#s.has(e)||this.#s.set(e,[]),this.#s.get(e)}queuedRedirectInfo(e){return this.#n.has(e)||this.#n.set(e,[]),this.#n.get(e)}queueRedirectInfo(e,t){this.queuedRedirectInfo(e).push(t)}takeQueuedRedirectInfo(e){return this.queuedRedirectInfo(e).shift()}inFlightRequestsCount(){let e=0;for(let t of this.#r.values())t.response()||e++;return e}storeRequestWillBeSent(e,t){this.#e.set(e,t)}getRequestWillBeSent(e){return this.#e.get(e)}forgetRequestWillBeSent(e){this.#e.delete(e)}getRequestPaused(e){return this.#t.get(e)}forgetRequestPaused(e){this.#t.delete(e)}storeRequestPaused(e,t){this.#t.set(e,t)}getRequest(e){return this.#r.get(e)}storeRequest(e,t){this.#r.set(e,t)}forgetRequest(e){this.#r.delete(e)}getQueuedEventGroup(e){return this.#a.get(e)}queueEventGroup(e,t){this.#a.set(e,t)}forgetQueuedEventGroup(e){this.#a.delete(e)}printState(){function e(t,r){return r instanceof Map?{dataType:"Map",value:Array.from(r.entries())}:r instanceof Ft?{dataType:"CdpHTTPRequest",value:`${r.id}: ${r.url()}`}:r}console.log("httpRequestsMap",JSON.stringify(this.#r,e,2)),console.log("requestWillBeSentMap",JSON.stringify(this.#e,e,2)),console.log("requestWillBeSentMap",JSON.stringify(this.#s,e,2)),console.log("requestWillBeSentMap",JSON.stringify(this.#t,e,2))}};var Ai=class extends C{#e;#t=new Ii;#r;#i=null;#s=new Set;#n=!1;#a;#u;#c;#l;#o;#h;#p;#m=!1;#d=[["Fetch.requestPaused",this.#k],["Fetch.authRequired",this.#I],["Network.requestWillBeSent",this.#M],["Network.requestWillBeSentExtraInfo",this.#D],["Network.requestServedFromCache",this.#N],["Network.responseReceived",this.#H],["Network.loadingFinished",this.#O],["Network.loadingFailed",this.#q],["Network.responseReceivedExtraInfo",this.#W],[B.Disconnected,this.#b]];#f=new Map;#g;#v;constructor(e,t=!0,r){super(void 0,r),this.#e=e,this.#g=t??!0,this.#v=r}#w(e){return Q(e)&&(je(e)||e.message.includes("Not supported")||e.message.includes("wasn't found"))}async addClient(e){if(!this.#g||this.#f.has(e))return;let t=new G;this.#f.set(e,t);let r=t.use(new C(e));for(let[s,n]of this.#d)r.on(s,o=>n.bind(this)(e,o));try{await Promise.all([e.send("Network.enable"),this.#P(e),this.#E(e),this.#T(e),this.#_(e),this.#S(e)])}catch(s){if(this.#w(s))return;throw s}}async#b(e){this.#f.get(e)?.dispose(),this.#f.delete(e)}async authenticate(e){this.#i=e;let t=this.#n||!!this.#i;t!==this.#a&&(this.#a=t,await this.#y(this.#_.bind(this)))}async setExtraHTTPHeaders(e){let t={};for(let[r,s]of Object.entries(e))P(Oe(s),`Expected value of header "${r}" to be String, but "${typeof s}" is found.`),t[r.toLowerCase()]=s;this.#r=t,await this.#y(this.#P.bind(this))}async#P(e){if(this.#r!==void 0)try{await e.send("Network.setExtraHTTPHeaders",{headers:this.#r})}catch(t){if(this.#w(t))return;throw t}}extraHTTPHeaders(){return Object.assign({},this.#r)}inFlightRequestsCount(){return this.#t.inFlightRequestsCount()}async setOfflineMode(e){this.#c||(this.#c={offline:!1,upload:-1,download:-1,latency:0}),this.#c.offline=e,await this.#y(this.#E.bind(this))}async emulateNetworkConditions(e){this.#c||(this.#c={offline:e?.offline??!1,upload:-1,download:-1,latency:0}),this.#c.upload=e?e.upload:-1,this.#c.download=e?e.download:-1,this.#c.latency=e?e.latency:0,this.#c.offline=e?.offline??!1,await this.#y(this.#E.bind(this))}async#y(e){await Promise.all(Array.from(this.#f.keys()).map(t=>e(t)))}async#E(e){if(this.#c!==void 0)try{await e.send("Network.emulateNetworkConditions",{offline:this.#c.offline,latency:this.#c.latency,uploadThroughput:this.#c.upload,downloadThroughput:this.#c.download})}catch(t){if(this.#w(t))return;throw t}}async setUserAgent(e,t,r){this.#l=e,this.#o=t,this.#h=r,await this.#y(this.#S.bind(this))}async setAcceptLanguage(e){this.#p=e,await this.#y(this.#S.bind(this))}async#S(e){let t=this.#l===void 0&&this.#o===void 0&&this.#p===void 0&&this.#h===void 0;if(t&&!this.#m)return;let r=this.#l??await this.#e.page().browser().userAgent();if(r!==void 0)try{await e.send("Network.setUserAgentOverride",{userAgent:r,acceptLanguage:this.#p,userAgentMetadata:this.#o,platform:this.#h}),this.#m=!t}catch(s){if(this.#w(s))return;throw s}}async setCacheEnabled(e){this.#u=!e,await this.#y(this.#T.bind(this))}async setRequestInterception(e){this.#n=e;let t=this.#n||!!this.#i;t!==this.#a&&(this.#a=t,await this.#y(this.#_.bind(this)))}async#_(e){if(this.#a!==void 0){this.#u===void 0&&(this.#u=!1);try{this.#a?await Promise.all([this.#T(e),e.send("Fetch.enable",{handleAuthRequests:!0,patterns:[{urlPattern:"*"}]})]):await Promise.all([this.#T(e),e.send("Fetch.disable")])}catch(t){if(this.#w(t))return;throw t}}}async#T(e){if(this.#u!==void 0)try{await e.send("Network.setCacheDisabled",{cacheDisabled:this.#u})}catch(t){if(this.#w(t))return;throw t}}#M(e,t){if(this.#n&&!t.request.url.startsWith("data:")){let{requestId:r}=t;this.#t.storeRequestWillBeSent(r,t);let s=this.#t.getRequestPaused(r);if(s){let{requestId:n}=s;this.#x(t,s),this.#A(e,t,n),this.#t.forgetRequestPaused(r)}return}this.#A(e,t,void 0)}#I(e,t){let r="Default";this.#s.has(t.requestId)?r="CancelAuth":this.#i&&(r="ProvideCredentials",this.#s.add(t.requestId));let{username:s,password:n}=this.#i||{username:void 0,password:void 0};e.send("Fetch.continueWithAuth",{requestId:t.requestId,authChallengeResponse:{response:r,username:s,password:n}}).catch(o=>{this.#v?.(E.error)?.(o)})}#k(e,t){!this.#n&&this.#a&&e.send("Fetch.continueRequest",{requestId:t.requestId}).catch(o=>{this.#v?.(E.error)?.(o)});let{networkId:r,requestId:s}=t;if(!r){this.#R(e,t);return}let n=(()=>{let o=this.#t.getRequestWillBeSent(r);if(o&&(o.request.url!==t.request.url||o.request.method!==t.request.method)){this.#t.forgetRequestWillBeSent(r);return}return o})();n?(this.#x(n,t),this.#A(e,n,s)):this.#t.storeRequestPaused(r,t)}#x(e,t){e.request.headers={...e.request.headers,...t.request.headers}}#R(e,t){let r=t.frameId?this.#e.frame(t.frameId):null,s=new Ft(e,r,t.requestId,this.#n,t,[],this.#v);this.emit(re.Request,s),s.finalizeInterceptions()}#A(e,t,r,s=!1){let n=[];if(t.redirectResponse){let l=null;if(t.redirectHasExtraInfo&&(l=this.#t.responseExtraInfo(t.requestId).shift(),!l)){this.#t.queueRedirectInfo(t.requestId,{event:t,fetchRequestId:r});return}let u=this.#t.getRequest(t.requestId);if(u){this.#F(e,u,t.redirectResponse,l),n=u._redirectChain;let h=this.#t.requestExtraInfo(t.requestId).shift();h&&u.updateHeaders(h.headers)}}let o=t.frameId?this.#e.frame(t.frameId):null,a=new Ft(e,o,r,this.#n,t,n,this.#v),c=this.#t.requestExtraInfo(t.requestId).shift();c&&a.updateHeaders(c.headers),a._fromMemoryCache=s,this.#t.storeRequest(t.requestId,a),this.emit(re.Request,a),a.finalizeInterceptions()}#D(e,t){let r=this.#t.getRequest(t.requestId);r?r.updateHeaders(t.headers):this.#t.requestExtraInfo(t.requestId).push(t)}#N(e,t){let r=this.#t.getRequestWillBeSent(t.requestId),s=this.#t.getRequest(t.requestId);if(s&&(s._fromMemoryCache=!0),!s&&r&&(this.#A(e,r,void 0,!0),s=this.#t.getRequest(t.requestId)),!s){this.#v?.(E.error)?.(new Error(`Request ${t.requestId} was served from cache but we could not find the corresponding request object`));return}this.emit(re.RequestServedFromCache,s)}#F(e,t,r,s){let n=new Sr(t,r,s);t._response=n,t._redirectChain.push(t),n._resolveBody(new Error("Response body is unavailable for redirect responses")),this.#L(t,!1),this.emit(re.Response,n),this.emit(re.RequestFinished,t)}#C(e,t,r){let s=this.#t.getRequest(t.requestId);if(!s)return;this.#t.responseExtraInfo(t.requestId).length&&this.#v?.(E.error)?.(new Error("Unexpected extraInfo events for request "+t.requestId)),t.response.fromDiskCache&&(r=null);let o=new Sr(s,t.response,r);s._response=o,this.emit(re.Response,o)}#H(e,t){let r=this.#t.getRequest(t.requestId),s=null;if(r&&!r._fromMemoryCache&&t.hasExtraInfo&&(s=this.#t.responseExtraInfo(t.requestId).shift(),!s)){this.#t.queueEventGroup(t.requestId,{responseReceivedEvent:t});return}this.#C(e,t,s)}#W(e,t){let r=this.#t.takeQueuedRedirectInfo(t.requestId);if(r){this.#t.responseExtraInfo(t.requestId).push(t),this.#A(e,r.event,r.fetchRequestId);return}let s=this.#t.getQueuedEventGroup(t.requestId);if(s){this.#t.forgetQueuedEventGroup(t.requestId),this.#C(e,s.responseReceivedEvent,t),s.loadingFinishedEvent&&this.#B(e,s.loadingFinishedEvent),s.loadingFailedEvent&&this.#U(e,s.loadingFailedEvent);return}this.#t.responseExtraInfo(t.requestId).push(t)}#L(e,t){let r=e.id,s=e._interceptionId;this.#t.forgetRequest(r),s!==void 0&&this.#s.delete(s),t&&this.#t.forget(r)}#O(e,t){let r=this.#t.getQueuedEventGroup(t.requestId);r?r.loadingFinishedEvent=t:this.#B(e,t)}#B(e,t){let r=this.#t.getRequest(t.requestId);r&&(this.#K(e,r),r.response()&&r.response()?._resolveBody(),this.#L(r,!0),this.emit(re.RequestFinished,r))}#q(e,t){let r=this.#t.getQueuedEventGroup(t.requestId);r?r.loadingFailedEvent=t:this.#U(e,t)}#U(e,t){let r=this.#t.getRequest(t.requestId);if(!r)return;this.#K(e,r),r._failureText=t.errorText;let s=r.response();s&&s._resolveBody(),this.#L(r,!0),this.emit(re.RequestFailed,r)}#K(e,t){e!==t.client&&(t.client=e)}};var Ci=class{#e;#t;constructor(e){this.#e=e.code,this.#t=e.details}get code(){return this.#e}get details(){return this.#t}};var el=function(i,e,t){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var r,s;if(t){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=e[Symbol.asyncDispose]}if(r===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=e[Symbol.dispose],t&&(s=r)}if(typeof r!="function")throw new TypeError("Object not disposable.");s&&(r=function(){try{s.call(this)}catch(n){return Promise.reject(n)}}),i.stack.push({value:e,dispose:r,async:t})}else t&&i.stack.push({async:!0});return e},tl=(function(i){return function(e){function t(o){e.error=e.hasError?new i(o,e.error,"An error was suppressed during disposal."):o,e.hasError=!0}var r,s=0;function n(){for(;r=e.stack.pop();)try{if(!r.async&&s===1)return s=0,e.stack.push(r),Promise.resolve().then(n);if(r.dispose){var o=r.dispose.call(r.value);if(r.async)return s|=2,Promise.resolve(o).then(n,function(a){return t(a),n()})}else s|=1}catch(a){t(a)}if(s===1)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}return n()}})(typeof SuppressedError=="function"?SuppressedError:function(i,e,t){var r=new Error(t);return r.name="SuppressedError",r.error=i,r.suppressed=e,r}),bo="chrome-extension://",Li=class extends C{#e;#t;#r;#i=new Set;#s;#n=new Map;#a=new Set;_frameTree=new Mi;#u=new Set;#c=new WeakMap;#l;#o;get timeoutSettings(){return this.#r}get networkManager(){return this.#t}get client(){return this.#s}constructor(e,t,r,s){super(void 0,s),this.#s=e,this.#e=t,this.#t=new Ai(this,t.browser().isNetworkEnabled(),s),this.#r=r,this.#o=s,this.setupEventListeners(this.#s),e.once(B.Disconnected,()=>{this.#h(e).catch(n=>{this.#o?.(E.error)?.(n)})})}async#h(e){let t={stack:[],error:void 0,hasError:!1};try{let r=this._frameTree.getMainFrame();if(!r||this.#s!==e)return;if(!this.#e.browser().connected||this.#e.isClosed()){this.#T(r);return}for(let c of r.childFrames())this.#T(c);let s=O.create(),n=el(t,new G,!1),o=n.use(new C(r)),a=n.use(new C(this.#e));o.once(ce.FrameSwappedByActivation,()=>{s.resolve()}),a.once("close",()=>{s.reject(new Error("Page closed"))});try{await s.valueOrThrow()}catch{this.#T(r)}}catch(r){t.error=r,t.hasError=!0}finally{tl(t)}}async swapFrameTree(e){this.#s=e;let t=this._frameTree.getMainFrame();t&&(this.#u.add(this.#s.target()._targetId),this._frameTree.removeFrame(t),t.updateId(this.#s.target()._targetId),this._frameTree.addFrame(t),t.updateClient(e)),this.setupEventListeners(e),e.once(B.Disconnected,()=>{this.#h(e).catch(r=>{this.#o?.(E.error)?.(r)})}),await this.initialize(e,t),await this.#t.addClient(e),t&&t.emit(ce.FrameSwappedByActivation,void 0)}async registerSpeculativeSession(e){await this.#t.addClient(e)}setupEventListeners(e){e.on("Page.frameAttached",async t=>{await this.#l?.valueOrThrow(),this.#v(e,t.frameId,t.parentFrameId)}),e.on("Page.frameNavigated",async t=>{this.#u.add(t.frame.id),await this.#l?.valueOrThrow(),this.#w(t.frame,t.type)}),e.on("Page.navigatedWithinDocument",async t=>{await this.#l?.valueOrThrow(),this.#P(t.frameId,t.url)}),e.on("Page.frameDetached",async t=>{await this.#l?.valueOrThrow(),this.#y(t.frameId,t.reason)}),e.on("Page.frameStartedLoading",async t=>{await this.#l?.valueOrThrow(),this.#d(t.frameId)}),e.on("Page.frameStoppedLoading",async t=>{await this.#l?.valueOrThrow(),this.#f(t.frameId)}),e.on("Runtime.executionContextCreated",async t=>{await this.#l?.valueOrThrow(),this.#_(t.context,e)}),e.on("Page.lifecycleEvent",async t=>{await this.#l?.valueOrThrow(),this.#m(t)}),e.on("Audits.issueAdded",t=>{this.#e.emit("issue",new Ci(t.issue))})}async initialize(e,t){try{this.#l?.resolve(),this.#l=O.create(),await Promise.all([this.#t.addClient(e),e.send("Page.enable"),e.send("Page.getFrameTree").then(({frameTree:r})=>{this.#g(e,r),this.#l?.resolve()}),e.send("Page.setLifecycleEventsEnabled",{enabled:!0}),e.send("Runtime.enable").then(()=>this.#b(e,ps)),...(t?Array.from(this.#n.values()):[]).map(r=>t?.addPreloadScript(r)),...(t?Array.from(this.#a.values()):[]).map(r=>t?.addExposedFunctionBinding(r)),this.#e.browser().isIssuesEnabled()&&e.send("Audits.enable")])}catch(r){if(this.#l?.resolve(),Q(r)&&je(r))return;throw r}}page(){return this.#e}mainFrame(){let e=this._frameTree.getMainFrame();return P(e,"Requesting main frame too early!"),e}frames(){return Array.from(this._frameTree.frames())}frame(e){return this._frameTree.getById(e)||null}async#p(e){await Promise.all(this.frames().map(async t=>{try{await e(t)}catch(r){if(t._client()===this.#s||!Q(r)||!je(r))throw r}}))}async addExposedFunctionBinding(e){this.#a.add(e),await this.#p(t=>t.addExposedFunctionBinding(e))}async removeExposedFunctionBinding(e){this.#a.delete(e),await this.#p(t=>t.removeExposedFunctionBinding(e))}async evaluateOnNewDocument(e){let{identifier:t}=await this.mainFrame()._client().send("Page.addScriptToEvaluateOnNewDocument",{source:e}),r=new Ei(this.mainFrame(),t,e);return this.#n.set(t,r),await this.#p(s=>s.addPreloadScript(r)),{identifier:t}}async removeScriptToEvaluateOnNewDocument(e){let t=this.#n.get(e);if(!t)throw new Error(`Script to evaluate on new document with id ${e} not found`);this.#n.delete(e),await Promise.all(this.frames().map(r=>{let s=t.getIdForFrame(r);if(s)return r._client().send("Page.removeScriptToEvaluateOnNewDocument",{identifier:s}).catch(n=>{this.#o?.(E.error)?.(n)})}))}onAttachedToTarget(e){if(e._getTargetInfo().type!=="iframe")return;let t=this.frame(e._getTargetInfo().targetId);t&&t.updateClient(e._session()),this.setupEventListeners(e._session()),this.initialize(e._session(),t).catch(r=>{this.#o?.(E.error)?.(r)})}_deviceRequestPromptManager(e){let t=this.#c.get(e);return t===void 0&&(t=new ki(e,this.#r),this.#c.set(e,t)),t}#m(e){let t=this.frame(e.frameId);t&&(t._onLifecycleEvent(e.loaderId,e.name),this.emit(te.LifecycleEvent,t),t.emit(ce.LifecycleEvent,void 0))}#d(e){let t=this.frame(e);t&&t._onLoadingStarted()}#f(e){let t=this.frame(e);t&&(t._onLoadingStopped(),this.emit(te.LifecycleEvent,t),t.emit(ce.LifecycleEvent,void 0))}#g(e,t){if(t.frame.parentId&&this.#v(e,t.frame.id,t.frame.parentId),this.#u.has(t.frame.id)?this.#u.delete(t.frame.id):this.#w(t.frame,"Navigation"),!!t.childFrames)for(let r of t.childFrames)this.#g(e,r)}#v(e,t,r){let s=this.frame(t);if(s){let n=this.frame(r);e&&n&&s.client!==n?.client&&s.updateClient(e);return}s=new Rs(this,t,r,e,this.#o),this._frameTree.addFrame(s),this.emit(te.FrameAttached,s)}async#w(e,t){let r=e.id,s=!e.parentId,n=this._frameTree.getById(r);if(n)for(let o of n.childFrames())this.#T(o);s&&(n?(this._frameTree.removeFrame(n),n._id=r):n=new Rs(this,r,void 0,this.#s,this.#o),this._frameTree.addFrame(n)),n=await this._frameTree.waitForFrame(r),n._navigated(e),this.emit(te.FrameNavigated,n),n.emit(ce.FrameNavigated,t)}async#b(e,t){let r=`${e.id()}:${t}`;this.#i.has(r)||(await e.send("Page.addScriptToEvaluateOnNewDocument",{source:`//# sourceURL=${xe.INTERNAL_URL}`,worldName:t}),await Promise.all(this.frames().filter(s=>s.client===e).map(s=>e.send("Page.createIsolatedWorld",{frameId:s._id,worldName:t,grantUniveralAccess:!0}).catch(n=>{this.#o?.(E.error)?.(n)}))),this.#i.add(r))}#P(e,t){let r=this.frame(e);r&&(r._navigatedWithinDocument(t),this.emit(te.FrameNavigatedWithinDocument,r),r.emit(ce.FrameNavigatedWithinDocument,void 0),this.emit(te.FrameNavigated,r),r.emit(ce.FrameNavigated,"Navigation"))}#y(e,t){let r=this.frame(e);if(r)switch(t){case"remove":this.#T(r);break;case"swap":this.emit(te.FrameSwapped,r),r.emit(ce.FrameSwapped,void 0);break}}#E(e){return e.startsWith(bo)}#S(e){if(!e||!this.#E(e))return null;let t=e.substring(bo.length),r=t.indexOf("/");return r===-1?t:t.substring(0,r)}#_(e,t){let r=e.auxData,s=e.origin,n=r&&r.frameId,o=typeof n=="string"?this.frame(n):void 0,a;if(o){if(o.client!==t)return;if(e.auxData&&e.auxData.isDefault)a=o.worlds[me];else if(e.name===ps)a=o.worlds[Ct];else if(this.#E(s)){let l=this.#S(s);if(!l){this.#o?.(E.error)?.("Error while parsing extension id");return}o.extensionWorlds[l]?a=o.extensionWorlds[l]:(a=new it(o,this.timeoutSettings,l,this.#o),o.extensionWorlds[l]=a,o.registerWorldListeners(a),a.origin=s,a.setWorldId(l))}}if(!a)return;let c=new Zt(o?.client||this.#s,e,a,this.#o);a.setContext(c)}#T(e){for(let t of e.childFrames())this.#T(t);this._frameTree.removeFrame(e),this.emit(te.FrameDetached,e),e.emit(ce.FrameDetached,e),e[F]()}};var Fi=class extends li{#e;#t=new Set;_modifiers=0;constructor(e){super(),this.#e=e}updateClient(e){this.#e=e}async down(e,t={text:void 0,commands:[]}){let r=this.#i(e),s=this.#t.has(r.code);this.#t.add(r.code),this._modifiers|=this.#r(r.key);let n=t.text===void 0?r.text:t.text;await this.#e.send("Input.dispatchKeyEvent",{type:n?"keyDown":"rawKeyDown",modifiers:this._modifiers,windowsVirtualKeyCode:r.keyCode,code:r.code,key:r.key,text:n,unmodifiedText:n,autoRepeat:s,location:r.location,isKeypad:r.location===3,commands:t.commands})}#r(e){return e==="Alt"?1:e==="Control"?2:e==="Meta"?4:e==="Shift"?8:0}#i(e){let t=this._modifiers&8,r={key:"",keyCode:0,code:"",text:"",location:0},s=Qi[e];return P(s,`Unknown key: "${e}"`),s.key&&(r.key=s.key),t&&s.shiftKey&&(r.key=s.shiftKey),s.keyCode&&(r.keyCode=s.keyCode),t&&s.shiftKeyCode&&(r.keyCode=s.shiftKeyCode),s.code&&(r.code=s.code),s.location&&(r.location=s.location),r.key.length===1&&(r.text=r.key),s.text&&(r.text=s.text),t&&s.shiftText&&(r.text=s.shiftText),this._modifiers&-9&&(r.text=""),r}async up(e){let t=this.#i(e);this._modifiers&=~this.#r(t.key),this.#t.delete(t.code),await this.#e.send("Input.dispatchKeyEvent",{type:"keyUp",modifiers:this._modifiers,key:t.key,windowsVirtualKeyCode:t.keyCode,code:t.code,location:t.location})}async sendCharacter(e){await this.#e.send("Input.insertText",{text:e})}charIsKey(e){return!!Qi[e]}async type(e,t={}){let r=t.delay||void 0;for(let s of e)this.charIsKey(s)?await this.press(s,{delay:r}):(r&&await new Promise(n=>setTimeout(n,r)),await this.sendCharacter(s))}async press(e,t={}){let{delay:r=null}=t;await this.down(e,t),r&&await new Promise(s=>setTimeout(s,t.delay)),await this.up(e)}},So=i=>{switch(i){case de.Left:return 1;case de.Right:return 2;case de.Middle:return 4;case de.Back:return 8;case de.Forward:return 16}},rl=i=>i&1?de.Left:i&2?de.Right:i&4?de.Middle:i&8?de.Back:i&16?de.Forward:"none",Oi=class extends ui{#e;#t;constructor(e,t){super(),this.#e=e,this.#t=t}updateClient(e){this.#e=e}#r={position:{x:0,y:0},buttons:0};get#i(){return Object.assign({...this.#r},...this.#s)}#s=[];#n(){let e={};this.#s.push(e);let t=()=>{this.#s.splice(this.#s.indexOf(e),1)};return{update:r=>{Object.assign(e,r)},commit:()=>{this.#r={...this.#r,...e},t()},rollback:t}}async#a(e){let{update:t,commit:r,rollback:s}=this.#n();try{await e(t),r()}catch(n){throw s(),n}}async reset(){let e=[];for(let[t,r]of[[1,de.Left],[4,de.Middle],[2,de.Right],[16,de.Forward],[8,de.Back]])this.#i.buttons&t&&e.push(this.up({button:r}));(this.#i.position.x!==0||this.#i.position.y!==0)&&e.push(this.move(0,0)),await Promise.all(e)}async move(e,t,r={}){let{steps:s=1}=r,n=this.#i.position,o={x:e,y:t};for(let a=1;a<=s;a++)await this.#a(c=>{c({position:{x:n.x+(o.x-n.x)*(a/s),y:n.y+(o.y-n.y)*(a/s)}});let{buttons:l,position:u}=this.#i;return this.#e.send("Input.dispatchMouseEvent",{type:"mouseMoved",modifiers:this.#t._modifiers,buttons:l,button:rl(l),...u})})}async down(e={}){let{button:t=de.Left,clickCount:r=1}=e,s=So(t);if(!s)throw new Error(`Unsupported mouse button: ${t}`);if(this.#i.buttons&s)throw new Error(`'${t}' is already pressed.`);await this.#a(n=>{n({buttons:this.#i.buttons|s});let{buttons:o,position:a}=this.#i;return this.#e.send("Input.dispatchMouseEvent",{type:"mousePressed",modifiers:this.#t._modifiers,clickCount:r,buttons:o,button:t,...a})})}async up(e={}){let{button:t=de.Left,clickCount:r=1}=e,s=So(t);if(!s)throw new Error(`Unsupported mouse button: ${t}`);if(!(this.#i.buttons&s))throw new Error(`'${t}' is not pressed.`);await this.#a(n=>{n({buttons:this.#i.buttons&~s});let{buttons:o,position:a}=this.#i;return this.#e.send("Input.dispatchMouseEvent",{type:"mouseReleased",modifiers:this.#t._modifiers,clickCount:r,buttons:o,button:t,...a})})}async click(e,t,r={}){let{delay:s,count:n=1}=r;if(n<1)throw new Error("Click must occur a positive number of times.");let o=[this.move(e,t)];for(let a=1;a<n;++a)o.push(this.down({...r,clickCount:a}),this.up({...r,clickCount:a}));o.push(this.down({...r,clickCount:n})),typeof s=="number"&&(await Promise.all(o),o.length=0,await new Promise(a=>{setTimeout(a,s)})),o.push(this.up({...r,clickCount:n})),await Promise.all(o)}async wheel(e={}){let{deltaX:t=0,deltaY:r=0}=e,{position:s,buttons:n}=this.#i;await this.#e.send("Input.dispatchMouseEvent",{type:"mouseWheel",pointerType:"mouse",modifiers:this.#t._modifiers,deltaY:r,deltaX:t,buttons:n,...s})}async drag(e,t){let r=new Promise(s=>{this.#e.once("Input.dragIntercepted",n=>s(n.data))});return await this.move(e.x,e.y),await this.down(),await this.move(t.x,t.y),await r}async dragEnter(e,t){await this.#e.send("Input.dispatchDragEvent",{type:"dragEnter",x:e.x,y:e.y,modifiers:this.#t._modifiers,data:t})}async dragOver(e,t){await this.#e.send("Input.dispatchDragEvent",{type:"dragOver",x:e.x,y:e.y,modifiers:this.#t._modifiers,data:t})}async drop(e,t){await this.#e.send("Input.dispatchDragEvent",{type:"drop",x:e.x,y:e.y,modifiers:this.#t._modifiers,data:t})}async dragAndDrop(e,t,r={}){let{delay:s=null}=r,n=await this.drag(e,t);await this.dragEnter(t,n),await this.dragOver(t,n),s&&await new Promise(o=>setTimeout(o,s)),await this.drop(t,n),await this.up()}},Ds=class{#e=!1;#t;#r;#i;#s;constructor(e,t,r,s){this.#i=e,this.#t=t,this.#s=r,this.#r=s}updateClient(e){this.#i=e}async start(){if(this.#e)throw new Et("Touch has already started");await this.#i.send("Input.dispatchTouchEvent",{type:"touchStart",touchPoints:[this.#r],modifiers:this.#s._modifiers}),this.#e=!0}move(e,t){return this.#r.x=Math.round(e),this.#r.y=Math.round(t),this.#i.send("Input.dispatchTouchEvent",{type:"touchMove",touchPoints:[this.#r],modifiers:this.#s._modifiers})}async end(){await this.#i.send("Input.dispatchTouchEvent",{type:"touchEnd",touchPoints:[this.#r],modifiers:this.#s._modifiers}),this.#t.removeHandle(this)}},Ri=class extends hi{#e;#t;constructor(e,t){super(),this.#e=e,this.#t=t}updateClient(e){this.#e=e,this.touches.forEach(t=>{t.updateClient(e)})}async touchStart(e,t){let r=this.idGenerator(),s={x:Math.round(e),y:Math.round(t),radiusX:.5,radiusY:.5,force:.5,id:r},n=new Ds(this.#e,this,this.#t,s);return await n.start(),this.touches.push(n),n}};var il=function(i,e,t){for(var r=arguments.length>2,s=0;s<e.length;s++)t=r?e[s].call(i,t):e[s].call(i);return r?t:void 0},sl=function(i,e,t,r,s,n){function o(T){if(T!==void 0&&typeof T!="function")throw new TypeError("Function expected");return T}for(var a=r.kind,c=a==="getter"?"get":a==="setter"?"set":"value",l=!e&&i?r.static?i:i.prototype:null,u=e||(l?Object.getOwnPropertyDescriptor(l,r.name):{}),h,f=!1,p=t.length-1;p>=0;p--){var w={};for(var y in r)w[y]=y==="access"?{}:r[y];for(var y in r.access)w.access[y]=r.access[y];w.addInitializer=function(T){if(f)throw new TypeError("Cannot add initializers after decoration has completed");n.push(o(T||null))};var b=(0,t[p])(a==="accessor"?{get:u.get,set:u.set}:u[c],w);if(a==="accessor"){if(b===void 0)continue;if(b===null||typeof b!="object")throw new TypeError("Object expected");(h=o(b.get))&&(u.get=h),(h=o(b.set))&&(u.set=h),(h=o(b.init))&&s.unshift(h)}else(h=o(b))&&(a==="field"?s.unshift(h):u[c]=h)}l&&Object.defineProperty(l,r.name,u),f=!0},Eo=(()=>{let i=mi,e=[],t;return class extends i{static{let s=typeof Symbol=="function"&&Symbol.metadata?Object.create(i[Symbol.metadata]??null):void 0;t=[ti()],sl(this,null,t,{kind:"method",name:"stop",static:!1,private:!1,access:{has:n=>"stop"in n,get:n=>n.stop},metadata:s},null,e),s&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:s})}#e=il(this,e);constructor(s,n={},o){super(s,n,o);let{client:a}=this.page.mainFrame();a?.once?.(B.Disconnected,()=>{this.stop().catch(c=>{this.logger(E.error)?.(c)})})}async _start(){let{client:s}=this.page.mainFrame(),n=this.options.frameRate??this.options.fps,o=await s.send("Page.startScreenRecording",{audio:this.options.audio,maxWidth:this.options.maxWidth,maxHeight:this.options.maxHeight,frameRate:n});this.#e=o.stream}async stop(){if(!this.stopped){this.stopped=!0;try{let{client:s}=this.page.mainFrame();if(await s.send("Page.stopScreenRecording").catch(o=>{this.logger(E.error)?.(o)}),!this.#e)throw new Error("Screen recording stream handle is missing.");let n=!1;for(;!n;){let{data:o,base64Encoded:a,eof:c}=await s.send("IO.read",{handle:this.#e});if(n=c,o){let l=Ue(o,a??!1);this.controller.enqueue(l);for(let u of this.destinations)u.write(l)}}await s.send("IO.close",{handle:this.#e}).catch(o=>{this.logger(E.error)?.(o)})}finally{await this.closeDestinations()}}}}})();var Di=class{#e;#t=!1;#r;#i;constructor(e,t){this.#e=e,this.#i=t}updateClient(e){this.#e=e}async start(e={}){P(!this.#t,"Cannot start recording trace while already recording trace.");let t=["-*","devtools.timeline","v8.execute","disabled-by-default-devtools.timeline","disabled-by-default-devtools.timeline.frame","toplevel","blink.console","blink.user_timing","latencyInfo","disabled-by-default-devtools.timeline.stack","disabled-by-default-v8.cpu_profiler"],{path:r,screenshots:s=!1,categories:n=t,bufferSize:o}=e;s&&n.push("disabled-by-default-devtools.screenshot");let a=n.filter(l=>l.startsWith("-")).map(l=>l.slice(1)),c=n.filter(l=>!l.startsWith("-"));this.#r=r,this.#t=!0,await this.#e.send("Tracing.start",{transferMode:"ReturnAsStream",traceConfig:{excludedCategories:a,includedCategories:c,traceBufferSizeInKb:o}})}async stop(){let e=O.create();return this.#e.once("Tracing.tracingComplete",async t=>{try{P(t.stream,'Missing "stream"');let r=await Wr(this.#e,t.stream),s=await Hr(r,this.#r,this.#i);e.resolve(s??void 0)}catch(r){Q(r)?e.reject(r):e.reject(new Error(`Unknown error: ${r}`))}}),await this.#e.send("Tracing.end"),this.#t=!1,await e.valueOrThrow()}};var Ns=class extends C{#e;#t;#r;name;description;inputSchema;annotations;frame;location;rawStackTrace;constructor(e,t,r){super(),this.#e=e,this.name=t.name,this.description=t.description,this.inputSchema=t.inputSchema,this.annotations=t.annotations,this.frame=r,this.#t=t.backendNodeId,t.stackTrace?.callFrames.length&&(this.location={url:t.stackTrace.callFrames[0].url,lineNumber:t.stackTrace.callFrames[0].lineNumber,columnNumber:t.stackTrace.callFrames[0].columnNumber}),this.rawStackTrace=t.stackTrace}get formElement(){return(async()=>{if(this.#r&&!this.#r.disposed)return this.#r;if(this.#t)return this.#r=await this.frame.worlds[me].adoptBackendNode(this.#t),this.#r})()}async execute(e={},t={}){let{invocationId:r}=await this.#e.invokeTool(this,e);return await new Promise(s=>{let n=()=>{this.#e.cancelInvocation(r)},o=a=>{a.id===r&&(t.signal?.removeEventListener("abort",n),this.#e.off("toolresponded",o),s(a))};this.#e.on("toolresponded",o),t.signal?.aborted?n():t.signal?.addEventListener("abort",n,{once:!0})})}},Hs=class{id;tool;input;#e;constructor(e,t,r,s){this.id=e,this.tool=t,this.#e=s;try{this.input=JSON.parse(r)}catch(n){this.input={},this.#e?.(E.error)?.(n)}}},Ni=class extends C{#e;#t;#r=new Map;#i=new Map;#s;#n=new G;#a=e=>{let t=[];for(let r of e.tools){let s=this.#t.frame(r.frameId);if(!s)continue;let n=this.#r.get(r.frameId)??new Map;this.#r.has(r.frameId)||(this.#r.set(r.frameId,n),this.#h(s));let o=new Ns(this,r,s);n.set(r.name,o),t.push(o)}this.emit("toolsadded",{tools:t})};#u=e=>{let t=[];e.tools.forEach(r=>{let s=this.#r.get(r.frameId)?.get(r.name);s&&t.push(s),this.#r.get(r.frameId)?.delete(r.name)}),this.emit("toolsremoved",{tools:t})};#c=e=>{let t=this.#r.get(e.frameId)?.get(e.toolName);if(!t)return;let r=new Hs(e.invocationId,t,e.input,this.#s);this.#i.set(r.id,r),t.emit("toolinvoked",r),this.emit("toolinvoked",r)};#l=e=>{let t=this.#i.get(e.invocationId);t&&this.#i.delete(e.invocationId);let r={id:e.invocationId,call:t,status:e.status,output:e.output,errorText:e.errorText,exception:e.exception};this.emit("toolresponded",r)};#o=e=>{this.#i.clear();let t=this.#r.get(e._id);if(!t)return;let r=Array.from(t.values());this.#r.delete(e._id),r.length&&this.emit("toolsremoved",{tools:r})};#h(e){e.mainRealm().context?.once("disposed",()=>{this.#o(e)})}constructor(e,t,r){super(void 0,r),this.#e=e,this.#t=t,this.#s=r,this.#p()}async initialize(){return await this.#e.send("WebMCP.enable").catch(e=>{this.#s?.(E.error)?.(e)})}async invokeTool(e,t){return await this.#e.send("WebMCP.invokeTool",{frameId:e.frame._id,toolName:e.name,input:t})}async cancelInvocation(e){return await this.#e.send("WebMCP.cancelInvocation",{invocationId:e}).catch(t=>{this.#s?.(E.error)?.(t)})}tools(){return Array.from(this.#r.values()).flatMap(e=>Array.from(e.values()))}#p(){let e=this.#n.use(new C(this.#e));e.on("WebMCP.toolsAdded",this.#a),e.on("WebMCP.toolsRemoved",this.#u),e.on("WebMCP.toolInvoked",this.#c),e.on("WebMCP.toolResponded",this.#l)}updateClient(e){this.#n.dispose(),this.#n=new G,this.#e=e,this.#p()}};var Hi=function(i,e,t){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var r,s;if(t){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=e[Symbol.asyncDispose]}if(r===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=e[Symbol.dispose],t&&(s=r)}if(typeof r!="function")throw new TypeError("Object not disposable.");s&&(r=function(){try{s.call(this)}catch(n){return Promise.reject(n)}}),i.stack.push({value:e,dispose:r,async:t})}else t&&i.stack.push({async:!0});return e},Wi=(function(i){return function(e){function t(o){e.error=e.hasError?new i(o,e.error,"An error was suppressed during disposal."):o,e.hasError=!0}var r,s=0;function n(){for(;r=e.stack.pop();)try{if(!r.async&&s===1)return s=0,e.stack.push(r),Promise.resolve().then(n);if(r.dispose){var o=r.dispose.call(r.value);if(r.async)return s|=2,Promise.resolve(o).then(n,function(a){return t(a),n()})}else s|=1}catch(a){t(a)}if(s===1)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}return n()}})(typeof SuppressedError=="function"?SuppressedError:function(i,e,t){var r=new Error(t);return r.name="SuppressedError",r.error=i,r.suppressed=e,r});function Ws(i){switch(i){case"Strict":case"Lax":case"None":return i;default:return}}var Er=class i extends lo{static async _create(e,t,r,s){let n=new i(e,t,s);if(await n.#x(),r)try{await n.setViewport(r)}catch(o){if(Q(o)&&je(o))n.logger?.(E.error)?.(o);else throw o}return n}#e=!1;#t;#r;#i;#s;#n;#a;#u;#c;#l;#o;#h;#p;#m;#d=new Map;#f=new Map;#g;#v;#w=new Map;#b=new Set;#P=O.create();#y=!1;#E=!1;constructor(e,t,r){super(r),this.#i=e,this.#n=e.parentSession(),P(this.#n,"Tab target session is not defined."),this.#a=this.#n.target(),P(this.#a,"Tab target is not defined."),this._tabId=this.#a._getTargetInfo().targetId,this.#s=t,this.#t=t._targetManager(),this.#u=new Fi(e),this.#c=new Oi(e,this.#u),this.#l=new Ri(e,this.#u),this.#o=new Li(e,this,this._timeoutSettings,r),this.#h=new po(e,this.logger),this.#p=new Di(e,this.logger),this.#m=new Ni(e,this.#o,r),this.#g=new bi(e),this.#v=null,this.#r=new yi(this.#i.connection());let s=new C(this.#o);s.on(te.FrameAttached,o=>{this.emit("frameattached",o)}),s.on(te.FrameDetached,o=>{this.emit("framedetached",o)}),s.on(te.FrameNavigated,o=>{this.emit("framenavigated",o)}),s.on(te.ConsoleApiCalled,([o,a])=>{this.#H(o,a)}),s.on(te.BindingCalled,([o,a])=>{this.#W(o,a)});let n=new C(this.#o.networkManager);n.on(re.Request,o=>{this.emit("request",o)}),n.on(re.RequestServedFromCache,o=>{this.emit("requestservedfromcache",o)}),n.on(re.Response,o=>{this.emit("response",o)}),n.on(re.RequestFailed,o=>{this.emit("requestfailed",o)}),n.on(re.RequestFinished,o=>{this.emit("requestfinished",o)}),this.#n.on(B.Swapped,this.#_.bind(this)),this.#n.on(B.Ready,this.#T.bind(this)),this.#t.on("targetGone",this.#I),this.#a._isClosedDeferred.valueOrThrow().then(()=>{this.#t.off("targetGone",this.#I),this.emit("close",void 0),this.#e=!0}).catch(o=>{this.logger?.(E.error)?.(o)}),this.#M(),this.#S()}#S(){let e=[];for(let r of this.#t.getChildTargets(this.#s))e.push(r);let t=0;for(;t<e.length;){let r=e[t];t++;let s=r._session();s&&this.#k(s);for(let n of this.#t.getChildTargets(r))e.push(n)}}async#_(e){P(e instanceof Ae,"CDPSession is not instance of CdpCDPSession"),this.#i=e,this.#s=e.target(),P(this.#s,"Missing target on swap"),this.#u.updateClient(e),this.#c.updateClient(e),this.#l.updateClient(e),this.#h.updateClient(e),this.#p.updateClient(e),this.#m.updateClient(e),this.#g.updateClient(e),await this.#o.swapFrameTree(e),this.#M()}async#T(e){P(e instanceof Ae),e.target()._subtype()==="prerender"&&(this.#o.registerSpeculativeSession(e).catch(t=>{this.logger?.(E.error)?.(t)}),this.#h.registerSpeculativeSession(e).catch(t=>{this.logger?.(E.error)?.(t)}))}#M(){let e=new C(this.#i);e.on(B.Ready,this.#k),e.on(B.Disconnected,()=>{this.#P.reject(new ge("Target closed"))}),e.on("Page.domContentEventFired",()=>{this.emit("domcontentloaded",void 0)}),e.on("Page.loadEventFired",()=>{this.emit("load",void 0)}),e.on("Page.javascriptDialogOpening",this.#L.bind(this)),e.on("Runtime.exceptionThrown",this.#C.bind(this)),e.on("Inspector.targetCrashed",this.#A.bind(this)),e.on("Performance.metrics",this.#N.bind(this)),e.on("Log.entryAdded",this.#D.bind(this)),e.on("Page.fileChooserOpened",this.#R.bind(this))}#I=e=>{let t=e._session()?.id(),r=this.#w.get(t);r&&(this.#w.delete(t),this.emit("workerdestroyed",r))};#k=e=>{if(P(e instanceof Ae),this.#o.onAttachedToTarget(e.target()),e.target()._getTargetInfo().type==="worker"){let t=new vt(e,e.target().url(),e.target()._targetId,e.target().type(),this.#C.bind(this),this.#o.networkManager,this.logger);this.#w.set(e.id(),t),t.internalEmitter.on(Be.Console,r=>{let s=this.listenerCount("console")===0,n=t.listenerCount(Be.Console)===0;if(s&&n){for(let o of r.args())o.dispose().catch(a=>{this.logger?.(E.error)?.(a)});return}s||this.emit("console",r)}),this.emit("workercreated",t)}e.on(B.Ready,this.#k)};async#x(){try{await Promise.all([this.#o.initialize(this.#i),this.#i.send("Performance.enable"),this.#i.send("Log.enable"),this.#m.initialize()])}catch(e){if(Q(e)&&je(e))this.logger?.(E.error)?.(e);else throw e}}async resize(e){let t=await this.windowId();await this.#i.send("Browser.setContentsSize",{windowId:Number(t),width:e.contentWidth,height:e.contentHeight})}async windowId(){let{windowId:e}=await this.#i.send("Browser.getWindowForTarget");return e.toString()}async#R(e){let t={stack:[],error:void 0,hasError:!1};try{if(!this.#b.size)return;let r=this.#o.frame(e.frameId);P(r,"This should never happen.");let s=Hi(t,await r.worlds[me].adoptBackendNode(e.backendNodeId),!1),n=new vi(s.move(),e.mode!=="selectSingle");for(let o of this.#b)o.resolve(n);this.#b.clear()}catch(r){t.error=r,t.hasError=!0}finally{Wi(t)}}_client(){return this.#i}_isUrlAllowed(e){return this.#t.isUrlAllowed(e)}isServiceWorkerBypassed(){return this.#y}isDragInterceptionEnabled(){return this.#E}isJavaScriptEnabled(){return this.#h.javascriptEnabled}async openDevTools(){let e=this.target()._targetId,t=this.browser(),r=await t._hasDevToolsTarget(this.target()._targetId);return r?await t._getDevToolsTargetPage(r):await t._createDevToolsPage(e)}async hasDevTools(){return!!await this.browser()._hasDevToolsTarget(this.target()._targetId)}async waitForFileChooser(e={}){let t=this.#b.size===0,{timeout:r=this._timeoutSettings.timeout()}=e,s=O.create({message:`Waiting for \`FileChooser\` failed: ${r}ms exceeded`,timeout:r});e.signal&&e.signal.addEventListener("abort",()=>{s.reject(e.signal?.reason)},{once:!0}),this.#b.add(s);let n;t&&(n=this.#i.send("Page.setInterceptFileChooserDialog",{enabled:!0}));try{let[o]=await Promise.all([s.valueOrThrow(),n]);return o}catch(o){throw this.#b.delete(s),o}}async setGeolocation(e){return await this.#h.setGeolocation(e)}target(){return this.#s}browser(){return this.#s.browser()}browserContext(){return this.#s.browserContext()}#A(){this.emit("error",new Error("Page crashed!"))}#D(e){let{level:t,text:r,args:s,source:n,url:o,lineNumber:a,stackTrace:c}=e.entry;s&&s.map(l=>{Os(this.#i,l,this.logger)}),n!=="worker"&&this.emit("console",new Qt(Fs(t),r,[],[{url:o,lineNumber:a}],void 0,c,this.#s._targetId))}mainFrame(){return this.#o.mainFrame()}get keyboard(){return this.#u}get touchscreen(){return this.#l}get coverage(){return this.#g}get tracing(){return this.#p}get webmcp(){return this.#m}frames(){return this.#o.frames()}workers(){return Array.from(this.#w.values())}async setRequestInterception(e){return await this.#o.networkManager.setRequestInterception(e)}async setBypassServiceWorker(e){return this.#y=e,await this.#i.send("Network.setBypassServiceWorker",{bypass:e})}async setDragInterception(e){return this.#E=e,await this.#i.send("Input.setInterceptDrags",{enabled:e})}async setOfflineMode(e){return await this.#o.networkManager.setOfflineMode(e)}async emulateNetworkConditions(e){return await this.#o.networkManager.emulateNetworkConditions(e)}async emulateFocusedPage(e){return await this.#h.emulateFocus(e)}setDefaultNavigationTimeout(e){this._timeoutSettings.setDefaultNavigationTimeout(e)}setDefaultTimeout(e){this._timeoutSettings.setDefaultTimeout(e)}getDefaultTimeout(){return this._timeoutSettings.timeout()}getDefaultNavigationTimeout(){return this._timeoutSettings.navigationTimeout()}async queryObjects(e){P(!e.disposed,"Prototype JSHandle is disposed!"),P(e.id,"Prototype JSHandle must not be referencing primitive value");let t=await this.mainFrame().client.send("Runtime.queryObjects",{prototypeObjectId:e.id});return this.mainFrame().mainRealm().createCdpHandle(t.objects)}async cookies(...e){let t=(await this.#i.send("Network.getCookies",{urls:e.length?e:[this.url()]})).cookies,r=["sourcePort"],s=n=>{for(let o of r)delete n[o];return n};return t.map(s).map(n=>({...n,partitionKey:n.partitionKey?n.partitionKey.topLevelSite:void 0}))}async deleteCookie(...e){let t=this.url();for(let r of e){let s={...r,partitionKey:Bi(r.partitionKey)};if(!r.url&&t.startsWith("http")&&(s.url=t),await this.#i.send("Network.deleteCookies",s),t.startsWith("http")&&!s.partitionKey){let n=new URL(t);await this.#i.send("Network.deleteCookies",{...s,partitionKey:{topLevelSite:n.origin.replace(`:${n.port}`,""),hasCrossSiteAncestor:!1}})}}}async setCookie(...e){let t=this.url(),r=t.startsWith("http"),s=e.map(n=>{let o=Object.assign({},n);return!o.url&&r&&(o.url=t),P(o.url!=="about:blank",`Blank page can not have cookie "${o.name}"`),P(!String.prototype.startsWith.call(o.url||"","data:"),`Data URL page can not have cookie "${o.name}"`),o});await this.deleteCookie(...s),s.length&&await this.#i.send("Network.setCookies",{cookies:s.map(n=>({...n,partitionKey:Bi(n.partitionKey),sameSite:Ws(n.sameSite)}))})}async exposeFunction(e,t){if(this.#d.has(e))throw new Error(`Failed to add page binding with name ${e}: window['${e}'] already exists!`);let r=wo("exposedFun",e),s;typeof t==="function"?s=new gt(e,t,r,this.logger):s=new gt(e,t.default,r,this.logger),this.#d.set(e,s);let[{identifier:n}]=await Promise.all([this.#o.evaluateOnNewDocument(r),this.#o.addExposedFunctionBinding(s)]);this.#f.set(e,n)}async removeExposedFunction(e){let t=this.#f.get(e);if(!t)throw new Error(`Function with name "${e}" does not exist`);let r=this.#d.get(e);this.#f.delete(e),this.#d.delete(e),await Promise.all([this.#o.removeScriptToEvaluateOnNewDocument(t),this.#o.removeExposedFunctionBinding(r)])}async authenticate(e){return await this.#o.networkManager.authenticate(e)}async setExtraHTTPHeaders(e){return await this.#o.networkManager.setExtraHTTPHeaders(e)}async setUserAgent(e,t){if(typeof e=="string")return await this.#o.networkManager.setUserAgent(e,t);{let r=e.userAgent??await this.browser().userAgent();return await this.#o.networkManager.setUserAgent(r,e.userAgentMetadata,e.platform)}}async metrics(){let e=await this.#i.send("Performance.getMetrics");return this.#F(e.metrics)}async captureHeapSnapshot(e){let t={stack:[],error:void 0,hasError:!1};try{let r=ee.value.createWriteStream(e.path),s=new Promise((a,c)=>{r.on("error",c),r.on("finish",a)}),n=this.#i;await n.send("HeapProfiler.enable"),await n.send("HeapProfiler.collectGarbage"),Hi(t,new C(n),!1).on("HeapProfiler.addHeapSnapshotChunk",a=>{r.write(a.chunk)});try{await n.send("HeapProfiler.takeHeapSnapshot",{reportProgress:!1})}finally{await n.send("HeapProfiler.disable")}r.end(),await s}catch(r){t.error=r,t.hasError=!0}finally{Wi(t)}}#N(e){this.emit("metrics",{title:e.title,metrics:this.#F(e.metrics)})}#F(e){let t={};for(let r of e||[])nl.has(r.name)&&(t[r.name]=r.value);return t}#C(e){this.emit("pageerror",go(e.exceptionDetails))}#H(e,t,r){r||(r=t.args.map(a=>e.createCdpHandle(a)));let s=this.listenerCount("console")>0,n=e.environment instanceof Xt&&e.environment.listenerCount(Be.Console)>0;if(!s){if(!n)for(let a of r)a.dispose().catch(c=>{this.logger?.(E.error)?.(c)});return}let o;e.environment.client instanceof Ae&&(o=e.environment.client.target()._targetId),this.emit("console",Ti(t,r,o))}async#W(e,t){let r;try{r=JSON.parse(t.payload)}catch{return}let{type:s,name:n,seq:o,args:a,isTrivial:c}=r;if(s!=="exposedFun")return;let l=e.context;if(!l)return;await this.#d.get(n)?.run(l,o,a,c)}#L(e){let t=zn(e.type),r=new Si(this.#i,t,e.message,e.defaultPrompt);this.emit("dialog",r)}async reload(e){let[t]=await Promise.all([this.waitForNavigation({...e,ignoreSameDocumentNavigation:!0}),this.#i.send("Page.reload",{ignoreCache:e?.ignoreCache??!1})]);return t}async createCDPSession(){return await this.target().createCDPSession()}async goBack(e={}){return await this.#O(-1,e)}async goForward(e={}){return await this.#O(1,e)}async#O(e,t){let r=await this.#i.send("Page.getNavigationHistory"),s=r.entries[r.currentIndex+e];if(!s)throw new Error("History entry to navigate to not found.");return(await Promise.all([this.waitForNavigation(t),this.#i.send("Page.navigateToHistoryEntry",{entryId:s.id})]))[0]}async bringToFront(){await this.#i.send("Page.bringToFront")}async setJavaScriptEnabled(e){return await this.#h.setJavaScriptEnabled(e)}async setBypassCSP(e){await this.#i.send("Page.setBypassCSP",{enabled:e})}async triggerExtensionAction(e){return await e.triggerAction(this)}async emulateMediaType(e){return await this.#h.emulateMediaType(e)}async emulateCPUThrottling(e){return await this.#h.emulateCPUThrottling(e)}async emulateMediaFeatures(e){return await this.#h.emulateMediaFeatures(e)}async emulateTimezone(e){return await this.#h.emulateTimezone(e)}async emulateLocale(e){await this.#h.emulateLocale(e),await this.#o.networkManager.setAcceptLanguage(e)}async emulateIdleState(e){return await this.#h.emulateIdleState(e)}async emulateVisionDeficiency(e){return await this.#h.emulateVisionDeficiency(e)}async setViewport(e){let t=await this.#h.emulateViewport(e);this.#v=e,t&&await this.reload()}viewport(){return this.#v}async evaluateOnNewDocument(e,...t){let r=Nr(e,...t);return await this.#o.evaluateOnNewDocument(r)}async removeScriptToEvaluateOnNewDocument(e){return await this.#o.removeScriptToEvaluateOnNewDocument(e)}async setCacheEnabled(e=!0){await this.#o.networkManager.setCacheEnabled(e)}async _screenshot(e){let t={stack:[],error:void 0,hasError:!1};try{let{fromSurface:r,omitBackground:s,optimizeForSpeed:n,quality:o,clip:a,type:c,captureBeyondViewport:l}=e,u=Hi(t,new Pr,!0);s&&(c==="png"||c==="webp")&&(await this.#h.setTransparentBackgroundColor(),u.defer(async()=>{await this.#h.resetDefaultBackgroundColor().catch(p=>{this.logger?.(E.error)?.(p)})}));let h=a;if(h&&!l){let p=await this.mainFrame().isolatedRealm().evaluate(()=>{let{height:w,pageLeft:y,pageTop:b,width:T}=window.visualViewport;return{x:y,y:b,height:w,width:T}});h=ol(h,p)}let{data:f}=await this.#i.send("Page.captureScreenshot",{format:c,optimizeForSpeed:n,fromSurface:r,...o!==void 0?{quality:Math.round(o)}:{},...h?{clip:{...h,scale:h.scale??1}}:{},captureBeyondViewport:l});return f}catch(r){t.error=r,t.hasError=!0}finally{let r=Wi(t);r&&await r}}async createPDFStream(e={}){let{timeout:t=this._timeoutSettings.timeout()}=e,{landscape:r,displayHeaderFooter:s,headerTemplate:n,footerTemplate:o,printBackground:a,scale:c,width:l,height:u,margin:h,pageRanges:f,preferCSSPageSize:p,omitBackground:w,tagged:y,outline:b,waitForFonts:T}=Gn(e);w&&await this.#h.setTransparentBackgroundColor(),T&&await ne(H(this.mainFrame().isolatedRealm().evaluate(()=>document.fonts.ready)).pipe(we(ye(t))));let W=this.#i.send("Page.printToPDF",{transferMode:"ReturnAsStream",landscape:r,displayHeaderFooter:s,headerTemplate:n,footerTemplate:o,printBackground:a,scale:c,paperWidth:l,paperHeight:u,marginTop:h.top,marginBottom:h.bottom,marginLeft:h.left,marginRight:h.right,pageRanges:f,preferCSSPageSize:p,generateTaggedPDF:y,generateDocumentOutline:b}),N=await ne(H(W).pipe(we(ye(t))));return w&&await this.#h.resetDefaultBackgroundColor(),P(N.stream,"`stream` is missing from `Page.printToPDF"),await Wr(this.#i,N.stream)}async pdf(e={}){let{path:t=void 0}=e,r=await this.createPDFStream(e),s=await Hr(r,t,this.logger);return P(s,"Could not create typed array"),s}async close(e={runBeforeUnload:void 0}){let t={stack:[],error:void 0,hasError:!1};try{let r=Hi(t,await this.browserContext().waitForScreenshotOperations(),!1),s=this.#i.connection();P(s,"Connection closed. Most likely the page has been closed."),!!e.runBeforeUnload?await this.#i.send("Page.close"):(await s.send("Target.closeTarget",{targetId:this.#s._targetId}),await this.#a._isClosedDeferred.valueOrThrow())}catch(r){t.error=r,t.hasError=!0}finally{Wi(t)}}isClosed(){return this.#e}get mouse(){return this.#c}async waitForDevicePrompt(e={}){return await this.mainFrame().waitForDevicePrompt(e)}get bluetooth(){return this.#r}extensionRealms(){return this.mainFrame().extensionRealms()}createScreenRecording(e){return new Eo(this,e,this.logger)}},nl=new Set(["Timestamp","Documents","Frames","JSEventListeners","Nodes","LayoutCount","RecalcStyleCount","LayoutDuration","RecalcStyleDuration","ScriptDuration","TaskDuration","JSHeapUsedSize","JSHeapTotalSize"]);function ol(i,e){let t=Math.max(i.x,e.x),r=Math.max(i.y,e.y);return{x:t,y:r,width:Math.max(Math.min(i.x+i.width,e.x+e.width)-t,0),height:Math.max(Math.min(i.y+i.height,e.y+e.height)-r,0)}}function Bi(i){if(i!==void 0)return typeof i=="string"?{topLevelSite:i,hasCrossSiteAncestor:!1}:{topLevelSite:i.sourceOrigin,hasCrossSiteAncestor:i.hasCrossSiteAncestor??!1}}var al=function(i,e,t){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var r,s;if(t){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=e[Symbol.asyncDispose]}if(r===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=e[Symbol.dispose],t&&(s=r)}if(typeof r!="function")throw new TypeError("Object not disposable.");s&&(r=function(){try{s.call(this)}catch(n){return Promise.reject(n)}}),i.stack.push({value:e,dispose:r,async:t})}else t&&i.stack.push({async:!0});return e},cl=(function(i){return function(e){function t(o){e.error=e.hasError?new i(o,e.error,"An error was suppressed during disposal."):o,e.hasError=!0}var r,s=0;function n(){for(;r=e.stack.pop();)try{if(!r.async&&s===1)return s=0,e.stack.push(r),Promise.resolve().then(n);if(r.dispose){var o=r.dispose.call(r.value);if(r.async)return s|=2,Promise.resolve(o).then(n,function(a){return t(a),n()})}else s|=1}catch(a){t(a)}if(s===1)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}return n()}})(typeof SuppressedError=="function"?SuppressedError:function(i,e,t){var r=new Error(t);return r.name="SuppressedError",r.error=i,r.suppressed=e,r}),tr=class extends Ur{#e;#t;#r;constructor(e,t,r=void 0,s){super(s),this.#e=e,this.#t=t,this.#r=r}get id(){return this.#r}targets(){return this.#t.targets().filter(e=>e.browserContext()===this)}async pages(e=!1){return(await Promise.all(this.targets().filter(r=>r.type()==="page"||(r.type()==="other"||e)&&this.#t._getIsPageTargetCallback()?.(r)).map(r=>r.page()))).filter(r=>!!r)}async overridePermissions(e,t){let r=t.map(s=>{let n=Xn.get(s);if(!n)throw new Error("Unknown permission: "+s);return n});await this.#e.send("Browser.grantPermissions",{origin:e,browserContextId:this.#r||void 0,permissions:r})}async setPermission(e,...t){await Promise.all(t.map(async r=>{let s={name:r.permission.name,userVisibleOnly:r.permission.userVisibleOnly,sysex:r.permission.sysex,allowWithoutSanitization:r.permission.allowWithoutSanitization,panTiltZoom:r.permission.panTiltZoom};await this.#e.send("Browser.setPermission",{origin:e==="*"?void 0:e,browserContextId:this.#r||void 0,permission:s,setting:r.state})}))}async clearPermissionOverrides(){await this.#e.send("Browser.resetPermissions",{browserContextId:this.#r||void 0})}async newPage(e){let t={stack:[],error:void 0,hasError:!1};try{let r=al(t,await this.waitForScreenshotOperations(),!1);return await this.#t._createPageInContext(this.#r,e)}catch(r){t.error=r,t.hasError=!0}finally{cl(t)}}browser(){return this.#t}async close(){P(this.#r,"Default BrowserContext cannot be closed!"),await this.#t._disposeContext(this.#r)}async cookies(){let{cookies:e}=await this.#e.send("Storage.getCookies",{browserContextId:this.#r});return e.map(t=>({...t,partitionKey:t.partitionKey?{sourceOrigin:t.partitionKey.topLevelSite,hasCrossSiteAncestor:t.partitionKey.hasCrossSiteAncestor}:void 0}))}async setCookie(...e){return await this.#e.send("Storage.setCookies",{browserContextId:this.#r,cookies:e.map(t=>({...t,partitionKey:Bi(t.partitionKey),sameSite:Ws(t.sameSite)}))})}async setDownloadBehavior(e){await this.#e.send("Browser.setDownloadBehavior",{behavior:e.policy,downloadPath:e.downloadPath,browserContextId:this.#r})}};var Te;(function(i){i.SUCCESS="success",i.ABORTED="aborted"})(Te||(Te={}));var kr=class extends gi{#e;#t;#r;#i;#s;#n;#a=new Set;_initializedDeferred=O.create();_isClosedDeferred=O.create();_targetId;_asPagePromise;pagePromise;constructor(e,t,r,s,n,o){super(o),this.#t=t,this.#i=s,this.#r=e,this.#e=r,this._targetId=e.targetId,this.#s=n,this.#n=o,this.#t&&this.#t.setTarget(this)}async asPage(){if(this.pagePromise){let e=await this.pagePromise;if(e)return e}if(!this._asPagePromise){let e=this._session();this._asPagePromise=(e?Promise.resolve(e):this._sessionFactory()(!1)).then(t=>Er._create(t,this,null,this.#n))}return await this._asPagePromise??null}_subtype(){return this.#r.subtype}_session(){return this.#t}_addChildTarget(e){this.#a.add(e)}_removeChildTarget(e){this.#a.delete(e)}_childTargets(){return this.#a}_sessionFactory(){if(!this.#s)throw new Error("sessionFactory is not initialized");return this.#s}createCDPSession(){if(!this.#s)throw new Error("sessionFactory is not initialized");return this.#s(!1).then(e=>(e.setTarget(this),e))}url(){return this.#r.url}type(){switch(this.#r.type){case"page":return ke.PAGE;case"background_page":return ke.BACKGROUND_PAGE;case"service_worker":return ke.SERVICE_WORKER;case"shared_worker":return ke.SHARED_WORKER;case"browser":return ke.BROWSER;case"webview":return ke.WEBVIEW;case"tab":return ke.TAB;default:return ke.OTHER}}_targetManager(){if(!this.#i)throw new Error("targetManager is not initialized");return this.#i}_getTargetInfo(){return this.#r}browser(){if(!this.#e)throw new Error("browserContext is not initialized");return this.#e.browser()}browserContext(){if(!this.#e)throw new Error("browserContext is not initialized");return this.#e}opener(){let{openerId:e}=this.#r;if(e)return this.browser().targets().find(t=>t._targetId===e)}_targetInfoChanged(e){this.#r=e,this._checkIfInitialized()}_initialize(){this._initializedDeferred.resolve(Te.SUCCESS)}_isTargetExposed(){return this.type()!==ke.TAB&&!this._subtype()}_checkIfInitialized(){this._initializedDeferred.resolved()||this._initializedDeferred.resolve(Te.SUCCESS)}},Tr=class i extends kr{#e;constructor(e,t,r,s,n,o,a){super(e,t,r,s,n,a),this.#e=o??void 0}_initialize(){this._initializedDeferred.valueOrThrow().then(async e=>{if(e===Te.ABORTED)return;let t=this.opener();if(!(t instanceof i))return;if(!t||!t.pagePromise||this.type()!=="page")return!0;let r=await t.pagePromise;if(!r.listenerCount("popup"))return!0;let s=await this.page();return r.emit("popup",s),!0}).catch(e=>{this.logger?.(E.error)?.(e)}),this._checkIfInitialized()}async page(){if(!this.pagePromise){let e=this._session();this.pagePromise=(e?Promise.resolve(e):this._sessionFactory()(!1)).then(t=>Er._create(t,this,this.#e??null,this.logger))}return await this.pagePromise??null}_checkIfInitialized(){this._initializedDeferred.resolved()||this._getTargetInfo().url!==""&&this._initializedDeferred.resolve(Te.SUCCESS)}},Ui=class extends Tr{},Ki=class extends kr{#e;async worker(){if(!this.#e){let e=this._session();this.#e=(e?Promise.resolve(e):this._sessionFactory()(!1)).then(t=>new vt(t,this._getTargetInfo().url,this._targetId,this.type(),()=>{},void 0,this.logger))}return await this.#e}},qi=class extends kr{};var ll=Object.defineProperty,L=(i,e)=>ll(i,"name",{value:e,configurable:!0}),sr=class{type=3;name="";prefix="";value="";suffix="";modifier=3;constructor(i,e,t,r,s,n){this.type=i,this.name=e,this.prefix=t,this.value=r,this.suffix=s,this.modifier=n}hasCustomName(){return this.name!==""&&typeof this.name!="number"}};L(sr,"Part");var ul=/[$_\p{ID_Start}]/u,hl=/[$_\u200C\u200D\p{ID_Continue}]/u,Us=".*";function ko(i,e){return(e?/^[\x00-\xFF]*$/:/^[\x00-\x7F]*$/).test(i)}L(ko,"isASCII");function js(i,e=!1){let t=[],r=0;for(;r<i.length;){let s=i[r],n=L(function(o){if(!e)throw new TypeError(o);t.push({type:"INVALID_CHAR",index:r,value:i[r++]})},"ErrorOrInvalid");if(s==="*"){t.push({type:"ASTERISK",index:r,value:i[r++]});continue}if(s==="+"||s==="?"){t.push({type:"OTHER_MODIFIER",index:r,value:i[r++]});continue}if(s==="\\"){t.push({type:"ESCAPED_CHAR",index:r++,value:i[r++]});continue}if(s==="{"){t.push({type:"OPEN",index:r,value:i[r++]});continue}if(s==="}"){t.push({type:"CLOSE",index:r,value:i[r++]});continue}if(s===":"){let o="",a=r+1;for(;a<i.length;){let c=i.substr(a,1);if(a===r+1&&ul.test(c)||a!==r+1&&hl.test(c)){o+=i[a++];continue}break}if(!o){n(`Missing parameter name at ${r}`);continue}t.push({type:"NAME",index:r,value:o}),r=a;continue}if(s==="("){let o=1,a="",c=r+1,l=!1;if(i[c]==="?"){n(`Pattern cannot start with "?" at ${c}`);continue}for(;c<i.length;){if(!ko(i[c],!1)){n(`Invalid character '${i[c]}' at ${c}.`),l=!0;break}if(i[c]==="\\"){a+=i[c++]+i[c++];continue}if(i[c]===")"){if(o--,o===0){c++;break}}else if(i[c]==="("&&(o++,i[c+1]!=="?")){n(`Capturing groups are not allowed at ${c}`),l=!0;break}a+=i[c++]}if(l)continue;if(o){n(`Unbalanced pattern at ${r}`);continue}if(!a){n(`Missing pattern at ${r}`);continue}t.push({type:"REGEX",index:r,value:a}),r=c;continue}t.push({type:"CHAR",index:r,value:i[r++]})}return t.push({type:"END",index:r,value:""}),t}L(js,"lexer");function zs(i,e={}){let t=js(i);e.delimiter??="/#?",e.prefixes??="./";let r=`[^${Ce(e.delimiter)}]+?`,s=[],n=0,o=0,a="",c=new Set,l=L(N=>{if(o<t.length&&t[o].type===N)return t[o++].value},"tryConsume"),u=L(()=>l("OTHER_MODIFIER")??l("ASTERISK"),"tryConsumeModifier"),h=L(N=>{let j=l(N);if(j!==void 0)return j;let{type:$,index:le}=t[o];throw new TypeError(`Unexpected ${$} at ${le}, expected ${N}`)},"mustConsume"),f=L(()=>{let N="",j;for(;j=l("CHAR")??l("ESCAPED_CHAR");)N+=j;return N},"consumeText"),p=L(N=>N,"DefaultEncodePart"),w=e.encodePart||p,y="",b=L(N=>{y+=N},"appendToPendingFixedValue"),T=L(()=>{y.length&&(s.push(new sr(3,"","",w(y),"",3)),y="")},"maybeAddPartFromPendingFixedValue"),W=L((N,j,$,le,S)=>{let m=3;switch(S){case"?":m=1;break;case"*":m=0;break;case"+":m=2;break}if(!j&&!$&&m===3){b(N);return}if(T(),!j&&!$){if(!N)return;s.push(new sr(3,"","",w(N),"",m));return}let _;$?$==="*"?_=Us:_=$:_=r;let k=2;_===r?(k=1,_=""):_===Us&&(k=0,_="");let v;if(j?v=j:$&&(v=n++),c.has(v))throw new TypeError(`Duplicate name '${v}'.`);c.add(v),s.push(new sr(k,v,w(N),_,w(le),m))},"addPart");for(;o<t.length;){let N=l("CHAR"),j=l("NAME"),$=l("REGEX");if(!j&&!$&&($=l("ASTERISK")),j||$){let S=N??"";e.prefixes.indexOf(S)===-1&&(b(S),S=""),T();let m=u();W(S,j,$,"",m);continue}let le=N??l("ESCAPED_CHAR");if(le){b(le);continue}if(l("OPEN")){let S=f(),m=l("NAME"),_=l("REGEX");!m&&!_&&(_=l("ASTERISK"));let k=f();h("CLOSE");let v=u();W(S,m,_,k,v);continue}T(),h("END")}return s}L(zs,"parse");function Ce(i){return i.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")}L(Ce,"escapeString");function Ks(i){return i&&i.ignoreCase?"ui":"u"}L(Ks,"flags");function To(i,e,t){return $s(zs(i,t),e,t)}L(To,"stringToRegexp");function Ot(i){switch(i){case 0:return"*";case 1:return"?";case 2:return"+";case 3:return""}}L(Ot,"modifierToString");function $s(i,e,t={}){t.delimiter??="/#?",t.prefixes??="./",t.sensitive??=!1,t.strict??=!1,t.end??=!0,t.start??=!0,t.endsWith="";let r=t.start?"^":"";for(let a of i){if(a.type===3){a.modifier===3?r+=Ce(a.value):r+=`(?:${Ce(a.value)})${Ot(a.modifier)}`;continue}e&&e.push(a.name);let c=`[^${Ce(t.delimiter)}]+?`,l=a.value;if(a.type===1?l=c:a.type===0&&(l=Us),!a.prefix.length&&!a.suffix.length){a.modifier===3||a.modifier===1?r+=`(${l})${Ot(a.modifier)}`:r+=`((?:${l})${Ot(a.modifier)})`;continue}if(a.modifier===3||a.modifier===1){r+=`(?:${Ce(a.prefix)}(${l})${Ce(a.suffix)})`,r+=Ot(a.modifier);continue}r+=`(?:${Ce(a.prefix)}`,r+=`((?:${l})(?:`,r+=Ce(a.suffix),r+=Ce(a.prefix),r+=`(?:${l}))*)${Ce(a.suffix)})`,a.modifier===0&&(r+="?")}let s=`[${Ce(t.endsWith)}]|$`,n=`[${Ce(t.delimiter)}]`;if(t.end)return t.strict||(r+=`${n}?`),t.endsWith.length?r+=`(?=${s})`:r+="$",new RegExp(r,Ks(t));t.strict||(r+=`(?:${n}(?=${s}))?`);let o=!1;if(i.length){let a=i[i.length-1];a.type===3&&a.modifier===3&&(o=t.delimiter.indexOf(a)>-1)}return o||(r+=`(?=${n}|${s})`),new RegExp(r,Ks(t))}L($s,"partsToRegexp");var St={delimiter:"",prefixes:"",sensitive:!0,strict:!0},dl={delimiter:".",prefixes:"",sensitive:!0,strict:!0},fl={delimiter:"/",prefixes:"/",sensitive:!0,strict:!0};function Po(i,e){return i.length?i[0]==="/"?!0:!e||i.length<2?!1:(i[0]=="\\"||i[0]=="{")&&i[1]=="/":!1}L(Po,"isAbsolutePathname");function Vs(i,e){return i.startsWith(e)?i.substring(e.length,i.length):i}L(Vs,"maybeStripPrefix");function _o(i,e){return i.endsWith(e)?i.substr(0,i.length-e.length):i}L(_o,"maybeStripSuffix");function Gs(i){return!i||i.length<2?!1:i[0]==="["||(i[0]==="\\"||i[0]==="{")&&i[1]==="["}L(Gs,"treatAsIPv6Hostname");var Mo=["ftp","file","http","https","ws","wss"];function Xs(i){if(!i)return!0;for(let e of Mo)if(i.test(e))return!0;return!1}L(Xs,"isSpecialScheme");function xo(i,e){if(i=Vs(i,"#"),e||i==="")return i;let t=new URL("https://example.com");return t.hash=i,t.hash?t.hash.substring(1,t.hash.length):""}L(xo,"canonicalizeHash");function Io(i,e){if(i=Vs(i,"?"),e||i==="")return i;let t=new URL("https://example.com");return t.search=i,t.search?t.search.substring(1,t.search.length):""}L(Io,"canonicalizeSearch");function Ao(i,e){return e||i===""?i:Gs(i)?Ys(i):Js(i)}L(Ao,"canonicalizeHostname");function Co(i,e){if(e||i==="")return i;let t=new URL("https://example.com");return t.password=i,t.password}L(Co,"canonicalizePassword");function Lo(i,e){if(e||i==="")return i;let t=new URL("https://example.com");return t.username=i,t.username}L(Lo,"canonicalizeUsername");function Fo(i,e,t){if(t||i==="")return i;if(e&&!Mo.includes(e))return new URL(`${e}:${i}`).pathname;let r=i[0]=="/";return i=new URL(r?i:"/-"+i,"https://example.com").pathname,r||(i=i.substring(2,i.length)),i}L(Fo,"canonicalizePathname");function Oo(i,e,t){return Qs(e)===i&&(i=""),t||i===""?i:Zs(i)}L(Oo,"canonicalizePort");function Ro(i,e){return i=_o(i,":"),e||i===""?i:ji(i)}L(Ro,"canonicalizeProtocol");function Qs(i){switch(i){case"ws":case"http":return"80";case"wws":case"https":return"443";case"ftp":return"21";default:return""}}L(Qs,"defaultPortForProtocol");function ji(i){if(i==="")return i;if(/^[-+.A-Za-z0-9]*$/.test(i))return i.toLowerCase();throw new TypeError(`Invalid protocol '${i}'.`)}L(ji,"protocolEncodeCallback");function Do(i){if(i==="")return i;let e=new URL("https://example.com");return e.username=i,e.username}L(Do,"usernameEncodeCallback");function No(i){if(i==="")return i;let e=new URL("https://example.com");return e.password=i,e.password}L(No,"passwordEncodeCallback");function Js(i){if(i==="")return i;if(/[\t\n\r #%/:<>?@[\]^\\|]/g.test(i))throw new TypeError(`Invalid hostname '${i}'`);let e=new URL("https://example.com");return e.hostname=i,e.hostname}L(Js,"hostnameEncodeCallback");function Ys(i){if(i==="")return i;if(/[^0-9a-fA-F[\]:]/g.test(i))throw new TypeError(`Invalid IPv6 hostname '${i}'`);return i.toLowerCase()}L(Ys,"ipv6HostnameEncodeCallback");function Zs(i){if(i===""||/^[0-9]*$/.test(i)&&parseInt(i)<=65535)return i;throw new TypeError(`Invalid port '${i}'.`)}L(Zs,"portEncodeCallback");function Ho(i){if(i==="")return i;let e=new URL("https://example.com");return e.pathname=i[0]!=="/"?"/-"+i:i,i[0]!=="/"?e.pathname.substring(2,e.pathname.length):e.pathname}L(Ho,"standardURLPathnameEncodeCallback");function Wo(i){return i===""?i:new URL(`data:${i}`).pathname}L(Wo,"pathURLPathnameEncodeCallback");function Bo(i){if(i==="")return i;let e=new URL("https://example.com");return e.search=i,e.search.substring(1,e.search.length)}L(Bo,"searchEncodeCallback");function Uo(i){if(i==="")return i;let e=new URL("https://example.com");return e.hash=i,e.hash.substring(1,e.hash.length)}L(Uo,"hashEncodeCallback");var Ko=class{#e;#t=[];#r={};#i=0;#s=1;#n=0;#a=0;#u=0;#c=0;#l=!1;constructor(i){this.#e=i}get result(){return this.#r}parse(){for(this.#t=js(this.#e,!0);this.#i<this.#t.length;this.#i+=this.#s){if(this.#s=1,this.#t[this.#i].type==="END"){if(this.#a===0){this.#p(),this.#S()?this.#o(9,1):this.#E()?this.#o(8,1):this.#o(7,0);continue}else if(this.#a===2){this.#m(5);continue}this.#o(10,0);break}if(this.#u>0)if(this.#T())this.#u-=1;else continue;if(this.#_()){this.#u+=1;continue}switch(this.#a){case 0:this.#g()&&this.#m(1);break;case 1:if(this.#g()){this.#x();let i=7,e=1;this.#v()?(i=2,e=3):this.#l&&(i=2),this.#o(i,e)}break;case 2:this.#w()?this.#m(3):(this.#y()||this.#E()||this.#S())&&this.#m(5);break;case 3:this.#b()?this.#o(4,1):this.#w()&&this.#o(5,1);break;case 4:this.#w()&&this.#o(5,1);break;case 5:this.#M()?this.#c+=1:this.#I()&&(this.#c-=1),this.#P()&&!this.#c?this.#o(6,1):this.#y()?this.#o(7,0):this.#E()?this.#o(8,1):this.#S()&&this.#o(9,1);break;case 6:this.#y()?this.#o(7,0):this.#E()?this.#o(8,1):this.#S()&&this.#o(9,1);break;case 7:this.#E()?this.#o(8,1):this.#S()&&this.#o(9,1);break;case 8:this.#S()&&this.#o(9,1);break;case 9:break;case 10:break}}this.#r.hostname!==void 0&&this.#r.port===void 0&&(this.#r.port="")}#o(i,e){switch(this.#a){case 0:break;case 1:this.#r.protocol=this.#k();break;case 2:break;case 3:this.#r.username=this.#k();break;case 4:this.#r.password=this.#k();break;case 5:this.#r.hostname=this.#k();break;case 6:this.#r.port=this.#k();break;case 7:this.#r.pathname=this.#k();break;case 8:this.#r.search=this.#k();break;case 9:this.#r.hash=this.#k();break;case 10:break}this.#a!==0&&i!==10&&([1,2,3,4].includes(this.#a)&&[6,7,8,9].includes(i)&&(this.#r.hostname??=""),[1,2,3,4,5,6].includes(this.#a)&&[8,9].includes(i)&&(this.#r.pathname??=this.#l?"/":""),[1,2,3,4,5,6,7].includes(this.#a)&&i===9&&(this.#r.search??="")),this.#h(i,e)}#h(i,e){this.#a=i,this.#n=this.#i+e,this.#i+=e,this.#s=0}#p(){this.#i=this.#n,this.#s=0}#m(i){this.#p(),this.#a=i}#d(i){return i<0&&(i=this.#t.length-i),i<this.#t.length?this.#t[i]:this.#t[this.#t.length-1]}#f(i,e){let t=this.#d(i);return t.value===e&&(t.type==="CHAR"||t.type==="ESCAPED_CHAR"||t.type==="INVALID_CHAR")}#g(){return this.#f(this.#i,":")}#v(){return this.#f(this.#i+1,"/")&&this.#f(this.#i+2,"/")}#w(){return this.#f(this.#i,"@")}#b(){return this.#f(this.#i,":")}#P(){return this.#f(this.#i,":")}#y(){return this.#f(this.#i,"/")}#E(){if(this.#f(this.#i,"?"))return!0;if(this.#t[this.#i].value!=="?")return!1;let i=this.#d(this.#i-1);return i.type!=="NAME"&&i.type!=="REGEX"&&i.type!=="CLOSE"&&i.type!=="ASTERISK"}#S(){return this.#f(this.#i,"#")}#_(){return this.#t[this.#i].type=="OPEN"}#T(){return this.#t[this.#i].type=="CLOSE"}#M(){return this.#f(this.#i,"[")}#I(){return this.#f(this.#i,"]")}#k(){let i=this.#t[this.#i],e=this.#d(this.#n).index;return this.#e.substring(e,i.index)}#x(){let i={};Object.assign(i,St),i.encodePart=ji;let e=To(this.#k(),void 0,i);this.#l=Xs(e)}};L(Ko,"Parser");var Bs=["protocol","username","password","hostname","port","pathname","search","hash"],bt="*";function qs(i,e){if(typeof i!="string")throw new TypeError("parameter 1 is not of type 'string'.");let t=new URL(i,e);return{protocol:t.protocol.substring(0,t.protocol.length-1),username:t.username,password:t.password,hostname:t.hostname,port:t.port,pathname:t.pathname,search:t.search!==""?t.search.substring(1,t.search.length):void 0,hash:t.hash!==""?t.hash.substring(1,t.hash.length):void 0}}L(qs,"extractValues");function ze(i,e){return e?ir(i):i}L(ze,"processBaseURLString");function rr(i,e,t){let r;if(typeof e.baseURL=="string")try{r=new URL(e.baseURL),e.protocol===void 0&&(i.protocol=ze(r.protocol.substring(0,r.protocol.length-1),t)),!t&&e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&e.username===void 0&&(i.username=ze(r.username,t)),!t&&e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&e.username===void 0&&e.password===void 0&&(i.password=ze(r.password,t)),e.protocol===void 0&&e.hostname===void 0&&(i.hostname=ze(r.hostname,t)),e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&(i.port=ze(r.port,t)),e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&e.pathname===void 0&&(i.pathname=ze(r.pathname,t)),e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&e.pathname===void 0&&e.search===void 0&&(i.search=ze(r.search.substring(1,r.search.length),t)),e.protocol===void 0&&e.hostname===void 0&&e.port===void 0&&e.pathname===void 0&&e.search===void 0&&e.hash===void 0&&(i.hash=ze(r.hash.substring(1,r.hash.length),t))}catch{throw new TypeError(`invalid baseURL '${e.baseURL}'.`)}if(typeof e.protocol=="string"&&(i.protocol=Ro(e.protocol,t)),typeof e.username=="string"&&(i.username=Lo(e.username,t)),typeof e.password=="string"&&(i.password=Co(e.password,t)),typeof e.hostname=="string"&&(i.hostname=Ao(e.hostname,t)),typeof e.port=="string"&&(i.port=Oo(e.port,i.protocol,t)),typeof e.pathname=="string"){if(i.pathname=e.pathname,r&&!Po(i.pathname,t)){let s=r.pathname.lastIndexOf("/");s>=0&&(i.pathname=ze(r.pathname.substring(0,s+1),t)+i.pathname)}i.pathname=Fo(i.pathname,i.protocol,t)}return typeof e.search=="string"&&(i.search=Io(e.search,t)),typeof e.hash=="string"&&(i.hash=xo(e.hash,t)),i}L(rr,"applyInit");function ir(i){return i.replace(/([+*?:{}()\\])/g,"\\$1")}L(ir,"escapePatternString");function qo(i){return i.replace(/([.+*?^${}()[\]|/\\])/g,"\\$1")}L(qo,"escapeRegexpString");function jo(i,e){e.delimiter??="/#?",e.prefixes??="./",e.sensitive??=!1,e.strict??=!1,e.end??=!0,e.start??=!0,e.endsWith="";let t=".*",r=`[^${qo(e.delimiter)}]+?`,s=/[$_\u200C\u200D\p{ID_Continue}]/u,n="";for(let o=0;o<i.length;++o){let a=i[o];if(a.type===3){if(a.modifier===3){n+=ir(a.value);continue}n+=`{${ir(a.value)}}${Ot(a.modifier)}`;continue}let c=a.hasCustomName(),l=!!a.suffix.length||!!a.prefix.length&&(a.prefix.length!==1||!e.prefixes.includes(a.prefix)),u=o>0?i[o-1]:null,h=o<i.length-1?i[o+1]:null;if(!l&&c&&a.type===1&&a.modifier===3&&h&&!h.prefix.length&&!h.suffix.length)if(h.type===3){let f=h.value.length>0?h.value[0]:"";l=s.test(f)}else l=!h.hasCustomName();if(!l&&!a.prefix.length&&u&&u.type===3){let f=u.value[u.value.length-1];l=e.prefixes.includes(f)}l&&(n+="{"),n+=ir(a.prefix),c&&(n+=`:${a.name}`),a.type===2?n+=`(${a.value})`:a.type===1?c||(n+=`(${r})`):a.type===0&&(!c&&(!u||u.type===3||u.modifier!==3||l||a.prefix!=="")?n+="*":n+=`(${t})`),a.type===1&&c&&a.suffix.length&&s.test(a.suffix[0])&&(n+="\\"),n+=ir(a.suffix),l&&(n+="}"),a.modifier!==3&&(n+=Ot(a.modifier))}return n}L(jo,"partsToPattern");var Rt=class{#e;#t={};#r={};#i={};#s={};#n=!1;constructor(i={},e,t){try{let r;if(typeof e=="string"?r=e:t=e,typeof i=="string"){let a=new Ko(i);if(a.parse(),i=a.result,r===void 0&&typeof i.protocol!="string")throw new TypeError("A base URL must be provided for a relative constructor string.");i.baseURL=r}else{if(!i||typeof i!="object")throw new TypeError("parameter 1 is not of type 'string' and cannot convert to dictionary.");if(r)throw new TypeError("parameter 1 is not of type 'string'.")}typeof t>"u"&&(t={ignoreCase:!1});let s={ignoreCase:t.ignoreCase===!0},n={pathname:bt,protocol:bt,username:bt,password:bt,hostname:bt,port:bt,search:bt,hash:bt};this.#e=rr(n,i,!0),Qs(this.#e.protocol)===this.#e.port&&(this.#e.port="");let o;for(o of Bs){if(!(o in this.#e))continue;let a={},c=this.#e[o];switch(this.#r[o]=[],o){case"protocol":Object.assign(a,St),a.encodePart=ji;break;case"username":Object.assign(a,St),a.encodePart=Do;break;case"password":Object.assign(a,St),a.encodePart=No;break;case"hostname":Object.assign(a,dl),Gs(c)?a.encodePart=Ys:a.encodePart=Js;break;case"port":Object.assign(a,St),a.encodePart=Zs;break;case"pathname":Xs(this.#t.protocol)?(Object.assign(a,fl,s),a.encodePart=Ho):(Object.assign(a,St,s),a.encodePart=Wo);break;case"search":Object.assign(a,St,s),a.encodePart=Bo;break;case"hash":Object.assign(a,St,s),a.encodePart=Uo;break}try{this.#s[o]=zs(c,a),this.#t[o]=$s(this.#s[o],this.#r[o],a),this.#i[o]=jo(this.#s[o],a),this.#n=this.#n||this.#s[o].some(l=>l.type===2)}catch{throw new TypeError(`invalid ${o} pattern '${this.#e[o]}'.`)}}}catch(r){throw new TypeError(`Failed to construct 'URLPattern': ${r.message}`)}}get[Symbol.toStringTag](){return"URLPattern"}test(i={},e){let t={pathname:"",protocol:"",username:"",password:"",hostname:"",port:"",search:"",hash:""};if(typeof i!="string"&&e)throw new TypeError("parameter 1 is not of type 'string'.");if(typeof i>"u")return!1;try{typeof i=="object"?t=rr(t,i,!1):t=rr(t,qs(i,e),!1)}catch{return!1}let r;for(r of Bs)if(!this.#t[r].exec(t[r]))return!1;return!0}exec(i={},e){let t={pathname:"",protocol:"",username:"",password:"",hostname:"",port:"",search:"",hash:""};if(typeof i!="string"&&e)throw new TypeError("parameter 1 is not of type 'string'.");if(typeof i>"u")return;try{typeof i=="object"?t=rr(t,i,!1):t=rr(t,qs(i,e),!1)}catch{return null}let r={};e?r.inputs=[i,e]:r.inputs=[i];let s;for(s of Bs){let n=this.#t[s].exec(t[s]);if(!n)return null;let o={};for(let[a,c]of this.#r[s].entries())if(typeof c=="string"||typeof c=="number"){let l=n[a+1];o[c]=l}r[s]={input:t[s]??"",groups:o}}return r}static compareComponent(i,e,t){let r=L((a,c)=>{for(let l of["type","modifier","prefix","value","suffix"]){if(a[l]<c[l])return-1;if(a[l]!==c[l])return 1}return 0},"comparePart"),s=new sr(3,"","","","",3),n=new sr(0,"","","","",3),o=L((a,c)=>{let l=0;for(;l<Math.min(a.length,c.length);++l){let u=r(a[l],c[l]);if(u)return u}return a.length===c.length?0:r(a[l]??s,c[l]??s)},"comparePartList");return!e.#i[i]&&!t.#i[i]?0:e.#i[i]&&!t.#i[i]?o(e.#s[i],[n]):!e.#i[i]&&t.#i[i]?o([n],t.#s[i]):o(e.#s[i],t.#s[i])}get protocol(){return this.#i.protocol}get username(){return this.#i.username}get password(){return this.#i.password}get hostname(){return this.#i.hostname}get port(){return this.#i.port}get pathname(){return this.#i.pathname}get search(){return this.#i.search}get hash(){return this.#i.hash}get hasRegExpGroups(){return this.#n}};L(Rt,"URLPattern");globalThis.URLPattern||(globalThis.URLPattern=Rt);function pl(i,e){return!!i._subtype()&&!e.subtype}var zi=class extends C{#e;#t=new Map;#r=new Map;#i=new Map;#s=new Set;#n;#a;#u=new G;#c=new WeakMap;#l=O.create();#o=!0;#h=[{}];#p=new Set;#m=!1;#d=[];#f=[];#g;constructor(e,t,r,s=!0,n,o,a){if(super(void 0,a),n&&o)throw new Error("Cannot specify both blockList and allowList");this.#e=e,this.#n=r,this.#a=t,this.#o=s,this.#g=a,this.#d=this.#k(n),this.#f=this.#k(o);let c=this.#u.use(new C(this.#e));c.on("Target.targetCreated",this.#E),c.on("Target.targetDestroyed",this.#S),c.on("Target.targetInfoChanged",this.#_),c.on(B.SessionDetached,this.#y),this.#v(this.#e)}async initialize(){await this.#e.send("Target.setDiscoverTargets",{discover:!0,filter:this.#h}),await this.#e.send("Target.setAutoAttach",{waitForDebuggerOnStart:!0,flatten:!0,autoAttach:!0,filter:[{type:"page",exclude:!0},...this.#h]}),this.#m=!0,this.#M(),await this.#l.valueOrThrow()}addToIgnoreTarget(e){this.#s.add(e)}getChildTargets(e){return e._childTargets()}dispose(){this.#u.dispose(),this.#w(this.#e)}getAvailableTargets(){return this.#r}getDiscoveredTargetInfos(){return this.#t}#v(e){P(!this.#c.has(e));let t=new G,r=t.use(new C(e));r.on("Target.attachedToTarget",s=>{this.#T(e,s)}),r.on("Target.detachedFromTarget",s=>this.#I(e,s)),this.#c.set(e,t)}#w(e){let t=this.#c.get(e);t&&(t.dispose(),this.#c.delete(e))}#b=async(e,t)=>{await e.send("Runtime.runIfWaitingForDebugger").catch(r=>{this.#g?.(E.error)?.(r)}),await t.send("Target.detachFromTarget",{sessionId:e.id()}).catch(r=>{this.#g?.(E.error)?.(r)})};#P=e=>e instanceof Ae?e.target():null;#y=e=>{this.#w(e)};#E=async e=>{if(this.#t.set(e.targetInfo.targetId,e.targetInfo),this.emit("targetDiscovered",e.targetInfo),e.targetInfo.type==="browser"&&e.targetInfo.attached){if(this.#r.has(e.targetInfo.targetId))return;let t=this.#a(e.targetInfo,void 0);t._initialize(),this.#r.set(e.targetInfo.targetId,t)}};#S=e=>{let t=this.#t.get(e.targetId);if(this.#t.delete(e.targetId),this.#M(e.targetId),t?.type==="service_worker"){let r=this.#r.get(e.targetId);r&&(this.emit("targetGone",r),this.#r.delete(e.targetId))}};#_=e=>{if(this.#t.set(e.targetInfo.targetId,e.targetInfo),this.#s.has(e.targetInfo.targetId)||!e.targetInfo.attached)return;let t=this.#r.get(e.targetInfo.targetId);if(!t)return;let r=t.url(),s=t._initializedDeferred.value()===Te.SUCCESS;if(pl(t,e.targetInfo)){let n=t._session();P(n,"Target that is being activated is missing a CDPSession."),n.parentSession()?.emit(B.Swapped,n)}t._targetInfoChanged(e.targetInfo),s&&r!==t.url()&&this.emit("targetChanged",{target:t,wasInitialized:s,previousURL:r})};#T=async(e,t)=>{let r=t.targetInfo,s=this.#e._session(t.sessionId);if(!s)throw new Error(`Session ${t.sessionId} was not created.`);if(!this.#e.isAutoAttached(r.targetId)){await this.#x(s,r);return}if(!this.#m&&!this.isUrlAllowed(r.url)){await this.#b(s,e);return}if(r.type==="service_worker"){if(!this.isUrlAllowed(r.url)){await Promise.all([this.#x(s,r),s.send("Runtime.runIfWaitingForDebugger")]).catch(l=>{this.#g?.(E.error)?.(l)});return}if(await this.#b(s,e),this.#r.has(r.targetId)||this.#s.has(r.targetId)||!this.#t.has(r.targetId))return;let c=this.#a(r);c._initialize(),this.#r.set(r.targetId,c),this.emit("targetAvailable",c);return}let n=this.#r.get(r.targetId),o=n!==void 0;n||(n=this.#a(r,s,e instanceof Ae?e:void 0));let a=this.#P(e);if(this.#n&&!this.#n(n)){this.#s.add(r.targetId),a?.type()==="tab"&&this.#M(a._targetId),await this.#b(s,e);return}this.#o&&t.targetInfo.type==="tab"&&!this.#m&&this.#p.add(t.targetInfo.targetId),this.#v(s),o?(s.setTarget(n),this.#i.set(s.id(),n)):(n._initialize(),this.#r.set(r.targetId,n),this.#i.set(s.id(),n)),a?._addChildTarget(n),e.emit(B.Ready,s),o||this.emit("targetAvailable",n),a?.type()==="tab"&&this.#M(a._targetId),await Promise.all([s.send("Target.setAutoAttach",{waitForDebuggerOnStart:!0,flatten:!0,autoAttach:!0,filter:this.#h}),this.#x(s,r),s.send("Runtime.runIfWaitingForDebugger")]).catch(c=>{this.#g?.(E.error)?.(c)})};#M(e){e!==void 0&&this.#p.delete(e),this.#m&&this.#p.size===0&&this.#l.resolve()}#I=(e,t)=>{let r=this.#i.get(t.sessionId);this.#i.delete(t.sessionId),r&&(e instanceof Ae&&e.target()._removeChildTarget(r),this.#r.delete(r._targetId),this.emit("targetGone",r))};isUrlAllowed=e=>{if(this.#d.length===0&&this.#f.length===0||!e||e==="about:blank")return!0;for(let t of this.#d)if(t.pattern.test(e))return!1;if(this.#f.length>0){for(let t of this.#f)if(t.pattern.test(e))return!0;return!1}return!0};#k(e){let t=[];for(let r of e??[])t.push({pattern:new Rt(r),rule:r});return t}#x=async(e,t)=>{if(this.#d.length===0&&this.#f.length===0)return;let r=[];for(let o of this.#d)r.push({urlPattern:o.rule,offline:!0,latency:0,downloadThroughput:-1,uploadThroughput:-1});if(this.#f.length>0){for(let o of this.#f)r.push({urlPattern:o.rule,offline:!1,latency:0,downloadThroughput:-1,uploadThroughput:-1});r.push({urlPattern:"",offline:!0,latency:0,downloadThroughput:-1,uploadThroughput:-1})}let s=t.type==="worker"||t.type==="service_worker"||t.type==="shared_worker",n=[];s&&n.push(e.send("Network.enable")),n.push(e.send("Network.emulateNetworkConditionsByRule",{offline:this.#d.length>0?!0:void 0,matchedNetworkConditions:r})),await Promise.all(n).catch(o=>{this.#g?.(E.error)?.(o)})}};var $i=class extends oi{#e;#t;constructor(e,t,r,s,n,o,a){super(e,t,r,s,n),this.#e=o,this.#t=a}async workers(){let t=this.#e.targets().filter(s=>{let n=s.url();return s.type()==="service_worker"&&n.startsWith("chrome-extension://"+this.id)});return(await Promise.all(t.map(async s=>{try{return await s.worker()}catch(n){if(this.#r(n))return this.#t?.(E.error)?.(n),null;throw n}}))).filter(s=>s!==null)}async pages(){let t=this.#e.targets().filter(s=>{let n=s.url();return(s.type()==="page"||s.type()==="background_page")&&n.startsWith("chrome-extension://"+this.id)});return(await Promise.all(t.map(async s=>{try{return await s.asPage()}catch(n){if(this.#r(n))return this.#t?.(E.error)?.(n),null;throw n}}))).filter(s=>s!==null)}async triggerAction(e){await this.#e._connection.send("Extensions.triggerAction",{id:this.id,targetId:e._tabId})}#r(e){return Q(e)&&(je(e)||e.message.includes("No target with given id found"))}};function zo(i){return i.startsWith("devtools://devtools/bundled/devtools_app.html")}var Vi=class i extends Br{protocol="cdp";static async _create(e,t,r,s=void 0,n=void 0,o=void 0,a=void 0,c=void 0,l=void 0,u=!0,h=!0,f=!0,p=!1,w=void 0,y=void 0,b){let T=new i(e,t,s,o,a,c,l,u,h,f,p,w,y,b);if(y){let W=await T.#S();if(parseInt(W.product.match(/\d+/)?.[0]??"0",10)<149)throw new Error("The allowlist option require Chrome 149 or greater.")}return r&&await e.send("Security.setIgnoreCertificateErrors",{ignore:!0}),await T._attach(n),T}#e;#t;#r;#i;#s;#n;#a;#u=new Map;#c=!0;#l=!0;#o;#h=!1;#p=new Map;#m;#d=!1;#f=new G;constructor(e,t,r=void 0,s=void 0,n=void 0,o=void 0,a=void 0,c=!0,l=!0,u=!0,h=!1,f=void 0,p=void 0,w){super(w),this.#c=l,this.#l=u,this.#e=r,this.#t=s,this.#r=e,this.#i=n||(()=>{}),this.#s=o||(()=>!0),this.#h=h,this.#v(a),this.#d=!!(f&&f.length>0||p&&p.length>0),e.rejectEmulateNetworkConditionsCalls=this.#d,this.#o=new zi(e,this.#w,this.#s,c,f,p,w),this.#a=new tr(this.#r,this,void 0,w);for(let y of t)this.#u.set(y,new tr(this.#r,this,y,w))}#g=()=>{this.emit("disconnected",void 0)};async _attach(e){this.#f.use(new C(this.#r)).on(B.Disconnected,this.#g),e&&await this.#a.setDownloadBehavior(e);let r=this.#f.use(new C(this.#o));r.on("targetAvailable",this.#b),r.on("targetGone",this.#P),r.on("targetChanged",this.#y),r.on("targetDiscovered",this.#E),await this.#o.initialize()}_detach(){this.#f.dispose()}process(){return this.#t??null}_targetManager(){return this.#o}#v(e){this.#n=e||(t=>t.type()==="page"||t.type()==="background_page"||t.type()==="webview"||this.#h&&t.type()==="other"&&zo(t.url()))}_getIsPageTargetCallback(){return this.#n}async createBrowserContext(e={}){let{proxyServer:t,proxyBypassList:r,downloadBehavior:s}=e,{browserContextId:n}=await this.#r.send("Target.createBrowserContext",{proxyServer:t,proxyBypassList:r&&r.join(",")}),o=new tr(this.#r,this,n,this.logger);return s&&await o.setDownloadBehavior(s),this.#u.set(n,o),o}browserContexts(){return[this.#a,...Array.from(this.#u.values())]}defaultBrowserContext(){return this.#a}async _disposeContext(e){e&&(await this.#r.send("Target.disposeBrowserContext",{browserContextId:e}),this.#u.delete(e))}#w=(e,t)=>{let{browserContextId:r}=e,s=r&&this.#u.has(r)?this.#u.get(r):this.#a;if(!s)throw new Error("Missing browser context");let n=a=>this.#r._createSession(e,a),o=new qi(e,t,s,this.#o,n,this.logger);return e.url&&zo(e.url)?new Ui(e,t,s,this.#o,n,this.#e??null,this.logger):this.#n(o)?new Tr(e,t,s,this.#o,n,this.#e??null,this.logger):e.type==="service_worker"||e.type==="shared_worker"?new Ki(e,t,s,this.#o,n,this.logger):o};#b=async e=>{e._isTargetExposed()&&await e._initializedDeferred.valueOrThrow()===Te.SUCCESS&&(this.emit("targetcreated",e),e.browserContext().emit("targetcreated",e))};#P=async e=>{e._initializedDeferred.resolve(Te.ABORTED),e._isClosedDeferred.resolve(),e._isTargetExposed()&&await e._initializedDeferred.valueOrThrow()===Te.SUCCESS&&(this.emit("targetdestroyed",e),e.browserContext().emit("targetdestroyed",e))};#y=({target:e})=>{this.emit("targetchanged",e),e.browserContext().emit("targetchanged",e)};#E=e=>{this.emit("targetdiscovered",e)};wsEndpoint(){return this.#r.url()}async newPage(e){return await this.#a.newPage(e)}async _createPageInContext(e,t){let r=this.targets().filter(l=>l.browserContext().id===e).length>0,s=t?.type==="window"?t.windowBounds:void 0,{targetId:n}=await this.#r.send("Target.createTarget",{url:"about:blank",browserContextId:e||void 0,left:s?.left,top:s?.top,width:s?.width,height:s?.height,windowState:s?.windowState,newWindow:r&&t?.type==="window"?!0:void 0,background:t?.background}),o=await this.waitForTarget(l=>l._targetId===n);if(!o)throw new Error(`Missing target for page (id = ${n})`);if(!(await o._initializedDeferred.valueOrThrow()===Te.SUCCESS))throw new Error(`Failed to create target for page (id = ${n})`);let c=await o.page();if(!c)throw new Error(`Failed to create a page for context (id = ${e})`);return c}async _createDevToolsPage(e){let t=await this.#r.send("Target.openDevTools",{targetId:e});return await this._getDevToolsTargetPage(t.targetId)}async _getDevToolsTargetPage(e){let t=await this.waitForTarget(n=>n._targetId===e);if(!t)throw new Error(`Missing target for DevTools page (id = ${e})`);if(!(await t._initializedDeferred.valueOrThrow()===Te.SUCCESS))throw new Error(`Failed to create target for DevTools page (id = ${e})`);let s=await t.page();if(!s)throw new Error(`Failed to create a DevTools Page for target (id = ${e})`);return s}async _hasDevToolsTarget(e){return(await this.#r.send("Target.getDevToolsTarget",{targetId:e})).targetId}async installExtension(e,t){let{id:r}=await this.#r.send("Extensions.loadUnpacked",{path:e,enableInIncognito:t?.enabledInIncognito??!1});return this.#p.delete(r),r}async uninstallExtension(e){await this.#r.send("Extensions.uninstall",{id:e});let t=[];for(let[r,s]of this._targetManager().getDiscoveredTargetInfos().entries())s.url.includes(e)&&s.type==="service_worker"&&(this._targetManager().addToIgnoreTarget(r),t.push(new Promise(n=>setTimeout(()=>{this.#r.emit("Target.targetDestroyed",{targetId:r}),n(null)},0))));await Promise.all(t),this.#p.delete(e)}async installPWA(e){if(this.#d)throw new Error("PWA APIs are not supported when network restrictions are configured.");return await this.#r.send("PWA.install",{manifestId:e.manifestId,installUrlOrBundleUrl:e.installUrlOrBundleUrl}),e.displayMode&&await this.#r.send("PWA.changeAppUserSettings",{manifestId:e.manifestId,displayMode:e.displayMode}),e.manifestId}async uninstallPWA(e){if(this.#d)throw new Error("PWA APIs are not supported when network restrictions are configured.");await this.#r.send("PWA.uninstall",{manifestId:e.manifestId})}async launchPWA(e){if(this.#d)throw new Error("PWA APIs are not supported when network restrictions are configured.");let{targetId:t}=await this.#r.send("PWA.launch",{manifestId:e.manifestId,url:e.url}),s=await(await this.waitForTarget(n=>{let o=this.#o.getAvailableTargets().get(t);if(o?.type()!=="tab")return!1;for(let a of o._childTargets())if(a===n)return!0;return!1},{timeout:e.timeout})).page();if(!s)throw new Error(`Failed to create a page for the launched PWA (manifestId = ${e.manifestId})`);return s}async getPWAState(e){if(this.#d)throw new Error("PWA APIs are not supported when network restrictions are configured.");let{badgeCount:t,fileHandlers:r}=await this.#r.send("PWA.getOsAppState",{manifestId:e.manifestId});return{badgeCount:t,fileHandlers:r}}async screens(){let{screenInfos:e}=await this.#r.send("Emulation.getScreenInfos");return e}async addScreen(e){let{screenInfo:t}=await this.#r.send("Emulation.addScreen",e);return t}async removeScreen(e){return await this.#r.send("Emulation.removeScreen",{screenId:e})}async getWindowBounds(e){let{bounds:t}=await this.#r.send("Browser.getWindowBounds",{windowId:Number(e)});return t}async setWindowBounds(e,t){await this.#r.send("Browser.setWindowBounds",{windowId:Number(e),bounds:t})}targets(){return Array.from(this.#o.getAvailableTargets().values()).filter(e=>e._isTargetExposed()&&e._initializedDeferred.value()===Te.SUCCESS)}target(){let e=this.targets().find(t=>t.type()==="browser");if(!e)throw new Error("Browser target is not found");return e}async version(){return(await this.#S()).product}async userAgent(){return(await this.#S()).userAgent}async close(){await this.#i.call(null),await this.disconnect()}disconnect(){return this.#o.dispose(),this.#r.dispose(),this._detach(),Promise.resolve()}get _connection(){return this.#r}get connected(){return!this.#r._closed}async#S(){if(!this.#m){this.#m=O.create();try{this.#m.resolve(await this.#r.send("Browser.getVersion"))}catch(e){this.#m.reject(e)}}return await this.#m.valueOrThrow()}get debugInfo(){return{pendingProtocolErrors:this.#r.getPendingProtocolErrors()}}isNetworkEnabled(){return this.#c}async extensions(){let e=await this.#r.send("Extensions.getExtensions"),t=new Map;for(let r of e.extensions)if(this.#p.has(r.id))t.set(r.id,this.#p.get(r.id));else{let s=new $i(r.id,r.version,r.name,r.path,r.enabled,this,this.logger);t.set(r.id,s)}return this.#p=t,this.#p}isIssuesEnabled(){return this.#l}};async function $o(i,e,t,r){let{acceptInsecureCerts:s=!1,networkEnabled:n=!0,issuesEnabled:o=!0,defaultViewport:a=Dr,downloadBehavior:c,targetFilter:l,_isPageTarget:u,slowMo:h=0,protocolTimeout:f,handleDevToolsAsPage:p,idGenerator:w=pt(),blocklist:y,allowlist:b}=t,T=t.logger??r,W=new Yt(e,i,h,f,!1,w,T),{browserContextIds:N}=await W.send("Target.getBrowserContexts");return await Vi._create(W,N,s,a,c,void 0,()=>W.send("Browser.close").catch($=>{T?.(E.error)?.($)}),l,u,void 0,n,o,p,y,b,T)}var Vo={targetId:"tabTargetId",type:"tab",title:"tab",url:"about:blank",attached:!1,canAccessOpener:!1},Go={targetId:"pageTargetId",type:"page",title:"page",url:"about:blank",attached:!1,canAccessOpener:!1},Xo=class i{static async connectTab(e){return await chrome.debugger.attach({tabId:e},"1.3"),new i(e)}onmessage;onclose;#e;constructor(e){this.#e=e,chrome.debugger.onEvent.addListener(this.#t)}#t=(e,t,r)=>{e.tabId===this.#e&&this.#r({sessionId:e.sessionId??"pageTargetSessionId",method:t,params:r})};#r(e){setTimeout(()=>{this.onmessage?.(JSON.stringify(e))},0)}send(e){let t=JSON.parse(e);switch(t.method){case"Browser.getVersion":{this.#r({id:t.id,sessionId:t.sessionId,method:t.method,result:{protocolVersion:"1.3",product:"chrome",revision:"unknown",userAgent:"chrome",jsVersion:"unknown"}});return}case"Target.getBrowserContexts":{this.#r({id:t.id,sessionId:t.sessionId,method:t.method,result:{browserContextIds:[]}});return}case"Target.setDiscoverTargets":{this.#r({method:"Target.targetCreated",params:{targetInfo:Vo}}),this.#r({method:"Target.targetCreated",params:{targetInfo:Go}}),this.#r({id:t.id,sessionId:t.sessionId,method:t.method,result:{}});return}case"Target.setAutoAttach":if(t.sessionId==="tabTargetSessionId"){this.#r({method:"Target.attachedToTarget",sessionId:"tabTargetSessionId",params:{targetInfo:Go,sessionId:"pageTargetSessionId"}}),this.#r({id:t.id,sessionId:t.sessionId,method:t.method,result:{}});return}else if(!t.sessionId){this.#r({method:"Target.attachedToTarget",params:{targetInfo:Vo,sessionId:"tabTargetSessionId"}}),this.#r({id:t.id,sessionId:t.sessionId,method:t.method,result:{}});return}}t.sessionId==="pageTargetSessionId"&&delete t.sessionId,chrome.debugger.sendCommand({tabId:this.#e,sessionId:t.sessionId},t.method,t.params).then(r=>{this.#r({id:t.id,sessionId:t.sessionId??"pageTargetSessionId",method:t.method,result:r})}).catch(r=>{this.#r({id:t.id,sessionId:t.sessionId??"pageTargetSessionId",method:t.method,error:{code:r?.code,data:r?.data,message:r?.message??"CDP error had no message"}})})}close(){chrome.debugger.onEvent.removeListener(this.#t),chrome.debugger.detach({tabId:this.#e})}};var Ty=Object.freeze({"Slow 3G":{download:5e4,upload:5e4,latency:2e3},"Fast 3G":{download:18e4,upload:84375,latency:562.5},"Slow 4G":{download:18e4,upload:84375,latency:562.5},"Fast 4G":{download:1012500,upload:168750,latency:165}});var ml=[{name:"Blackberry PlayBook",userAgent:"Mozilla/5.0 (PlayBook; U; RIM Tablet OS 2.1.0; en-US) AppleWebKit/536.2+ (KHTML like Gecko) Version/7.2.1.0 Safari/536.2+",viewport:{width:600,height:1024,deviceScaleFactor:1,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"Blackberry PlayBook landscape",userAgent:"Mozilla/5.0 (PlayBook; U; RIM Tablet OS 2.1.0; en-US) AppleWebKit/536.2+ (KHTML like Gecko) Version/7.2.1.0 Safari/536.2+",viewport:{width:1024,height:600,deviceScaleFactor:1,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"BlackBerry Z30",userAgent:"Mozilla/5.0 (BB10; Touch) AppleWebKit/537.10+ (KHTML, like Gecko) Version/10.0.9.2372 Mobile Safari/537.10+",viewport:{width:360,height:640,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"BlackBerry Z30 landscape",userAgent:"Mozilla/5.0 (BB10; Touch) AppleWebKit/537.10+ (KHTML, like Gecko) Version/10.0.9.2372 Mobile Safari/537.10+",viewport:{width:640,height:360,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"Galaxy Note 3",userAgent:"Mozilla/5.0 (Linux; U; Android 4.3; en-us; SM-N900T Build/JSS15J) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30",viewport:{width:360,height:640,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"Galaxy Note 3 landscape",userAgent:"Mozilla/5.0 (Linux; U; Android 4.3; en-us; SM-N900T Build/JSS15J) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30",viewport:{width:640,height:360,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"Galaxy Note II",userAgent:"Mozilla/5.0 (Linux; U; Android 4.1; en-us; GT-N7100 Build/JRO03C) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30",viewport:{width:360,height:640,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"Galaxy Note II landscape",userAgent:"Mozilla/5.0 (Linux; U; Android 4.1; en-us; GT-N7100 Build/JRO03C) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30",viewport:{width:640,height:360,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"Galaxy S III",userAgent:"Mozilla/5.0 (Linux; U; Android 4.0; en-us; GT-I9300 Build/IMM76D) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30",viewport:{width:360,height:640,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"Galaxy S III landscape",userAgent:"Mozilla/5.0 (Linux; U; Android 4.0; en-us; GT-I9300 Build/IMM76D) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30",viewport:{width:640,height:360,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"Galaxy S5",userAgent:"Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/LRX21T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3765.0 Mobile Safari/537.36",viewport:{width:360,height:640,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"Galaxy S5 landscape",userAgent:"Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/LRX21T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3765.0 Mobile Safari/537.36",viewport:{width:640,height:360,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"Galaxy S8",userAgent:"Mozilla/5.0 (Linux; Android 7.0; SM-G950U Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.84 Mobile Safari/537.36",viewport:{width:360,height:740,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"Galaxy S8 landscape",userAgent:"Mozilla/5.0 (Linux; Android 7.0; SM-G950U Build/NRD90M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.84 Mobile Safari/537.36",viewport:{width:740,height:360,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"Galaxy S9+",userAgent:"Mozilla/5.0 (Linux; Android 8.0.0; SM-G965U Build/R16NW) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.111 Mobile Safari/537.36",viewport:{width:320,height:658,deviceScaleFactor:4.5,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"Galaxy S9+ landscape",userAgent:"Mozilla/5.0 (Linux; Android 8.0.0; SM-G965U Build/R16NW) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.111 Mobile Safari/537.36",viewport:{width:658,height:320,deviceScaleFactor:4.5,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"Galaxy Tab S4",userAgent:"Mozilla/5.0 (Linux; Android 8.1.0; SM-T837A) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.80 Safari/537.36",viewport:{width:712,height:1138,deviceScaleFactor:2.25,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"Galaxy Tab S4 landscape",userAgent:"Mozilla/5.0 (Linux; Android 8.1.0; SM-T837A) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.80 Safari/537.36",viewport:{width:1138,height:712,deviceScaleFactor:2.25,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPad",userAgent:"Mozilla/5.0 (iPad; CPU OS 11_0 like Mac OS X) AppleWebKit/604.1.34 (KHTML, like Gecko) Version/11.0 Mobile/15A5341f Safari/604.1",viewport:{width:768,height:1024,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPad landscape",userAgent:"Mozilla/5.0 (iPad; CPU OS 11_0 like Mac OS X) AppleWebKit/604.1.34 (KHTML, like Gecko) Version/11.0 Mobile/15A5341f Safari/604.1",viewport:{width:1024,height:768,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPad (gen 6)",userAgent:"Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1",viewport:{width:768,height:1024,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPad (gen 6) landscape",userAgent:"Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1",viewport:{width:1024,height:768,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPad (gen 7)",userAgent:"Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1",viewport:{width:810,height:1080,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPad (gen 7) landscape",userAgent:"Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1",viewport:{width:1080,height:810,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPad Mini",userAgent:"Mozilla/5.0 (iPad; CPU OS 11_0 like Mac OS X) AppleWebKit/604.1.34 (KHTML, like Gecko) Version/11.0 Mobile/15A5341f Safari/604.1",viewport:{width:768,height:1024,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPad Mini landscape",userAgent:"Mozilla/5.0 (iPad; CPU OS 11_0 like Mac OS X) AppleWebKit/604.1.34 (KHTML, like Gecko) Version/11.0 Mobile/15A5341f Safari/604.1",viewport:{width:1024,height:768,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPad Pro",userAgent:"Mozilla/5.0 (iPad; CPU OS 11_0 like Mac OS X) AppleWebKit/604.1.34 (KHTML, like Gecko) Version/11.0 Mobile/15A5341f Safari/604.1",viewport:{width:1024,height:1366,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPad Pro landscape",userAgent:"Mozilla/5.0 (iPad; CPU OS 11_0 like Mac OS X) AppleWebKit/604.1.34 (KHTML, like Gecko) Version/11.0 Mobile/15A5341f Safari/604.1",viewport:{width:1366,height:1024,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPad Pro 11",userAgent:"Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1",viewport:{width:834,height:1194,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPad Pro 11 landscape",userAgent:"Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1",viewport:{width:1194,height:834,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 4",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 7_1_2 like Mac OS X) AppleWebKit/537.51.2 (KHTML, like Gecko) Version/7.0 Mobile/11D257 Safari/9537.53",viewport:{width:320,height:480,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 4 landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 7_1_2 like Mac OS X) AppleWebKit/537.51.2 (KHTML, like Gecko) Version/7.0 Mobile/11D257 Safari/9537.53",viewport:{width:480,height:320,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 5",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/10.0 Mobile/14E304 Safari/602.1",viewport:{width:320,height:568,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 5 landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/10.0 Mobile/14E304 Safari/602.1",viewport:{width:568,height:320,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 6",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1",viewport:{width:375,height:667,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 6 landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1",viewport:{width:667,height:375,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 6 Plus",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1",viewport:{width:414,height:736,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 6 Plus landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1",viewport:{width:736,height:414,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 7",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1",viewport:{width:375,height:667,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 7 landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1",viewport:{width:667,height:375,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 7 Plus",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1",viewport:{width:414,height:736,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 7 Plus landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1",viewport:{width:736,height:414,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 8",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1",viewport:{width:375,height:667,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 8 landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1",viewport:{width:667,height:375,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 8 Plus",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1",viewport:{width:414,height:736,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 8 Plus landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1",viewport:{width:736,height:414,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone SE",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/10.0 Mobile/14E304 Safari/602.1",viewport:{width:320,height:568,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone SE landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/10.0 Mobile/14E304 Safari/602.1",viewport:{width:568,height:320,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone SE (3rd gen)",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 18_5 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/26.5 Mobile/19E241 Safari/602.1",viewport:{width:375,height:667,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone SE (3rd gen) landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 18_5 like Mac OS X) AppleWebKit/603.1.30 (KHTML, like Gecko) Version/26.5 Mobile/19E241 Safari/602.1",viewport:{width:667,height:375,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone X",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1",viewport:{width:375,height:812,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone X landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1",viewport:{width:812,height:375,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone XR",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 12_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0 Mobile/15E148 Safari/604.1",viewport:{width:414,height:896,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone XR landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 12_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0 Mobile/15E148 Safari/604.1",viewport:{width:896,height:414,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 11",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 13_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1 Mobile/15E148 Safari/604.1",viewport:{width:414,height:828,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 11 landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 13_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1 Mobile/15E148 Safari/604.1",viewport:{width:828,height:414,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 11 Pro",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 13_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1 Mobile/15E148 Safari/604.1",viewport:{width:375,height:812,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 11 Pro landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 13_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1 Mobile/15E148 Safari/604.1",viewport:{width:812,height:375,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 11 Pro Max",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 13_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1 Mobile/15E148 Safari/604.1",viewport:{width:414,height:896,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 11 Pro Max landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 13_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1 Mobile/15E148 Safari/604.1",viewport:{width:896,height:414,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 12",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1",viewport:{width:390,height:844,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 12 landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1",viewport:{width:844,height:390,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 12 Pro",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1",viewport:{width:390,height:844,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 12 Pro landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1",viewport:{width:844,height:390,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 12 Pro Max",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1",viewport:{width:428,height:926,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 12 Pro Max landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1",viewport:{width:926,height:428,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 12 Mini",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1",viewport:{width:375,height:812,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 12 Mini landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1",viewport:{width:812,height:375,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 13",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1",viewport:{width:390,height:844,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 13 landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1",viewport:{width:844,height:390,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 13 Pro",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1",viewport:{width:390,height:844,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 13 Pro landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1",viewport:{width:844,height:390,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 13 Pro Max",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1",viewport:{width:428,height:926,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 13 Pro Max landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1",viewport:{width:926,height:428,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 13 Mini",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1",viewport:{width:375,height:812,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 13 Mini landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 15_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1",viewport:{width:812,height:375,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 14",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 16_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1",viewport:{width:390,height:663,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 14 landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 16_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1",viewport:{width:750,height:340,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 14 Plus",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 16_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1",viewport:{width:428,height:745,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 14 Plus landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 16_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1",viewport:{width:832,height:378,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 14 Pro",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 16_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1",viewport:{width:393,height:659,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 14 Pro landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 16_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1",viewport:{width:734,height:343,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 14 Pro Max",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 16_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1",viewport:{width:430,height:739,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 14 Pro Max landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 16_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1",viewport:{width:814,height:380,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 15",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Mobile/15E148 Safari/604.1",viewport:{width:393,height:659,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 15 landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Mobile/15E148 Safari/604.1",viewport:{width:734,height:343,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 15 Plus",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Mobile/15E148 Safari/604.1",viewport:{width:430,height:739,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 15 Plus landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Mobile/15E148 Safari/604.1",viewport:{width:814,height:380,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 15 Pro",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Mobile/15E148 Safari/604.1",viewport:{width:393,height:659,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 15 Pro landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Mobile/15E148 Safari/604.1",viewport:{width:734,height:343,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 15 Pro Max",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Mobile/15E148 Safari/604.1",viewport:{width:430,height:739,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 15 Pro Max landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 17_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.5 Mobile/15E148 Safari/604.1",viewport:{width:814,height:380,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 16",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",viewport:{width:393,height:659,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 16 landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",viewport:{width:734,height:343,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 16 Plus",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",viewport:{width:430,height:739,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 16 Plus landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",viewport:{width:814,height:380,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 16 Pro",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",viewport:{width:402,height:681,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 16 Pro landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",viewport:{width:756,height:352,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 16 Pro Max",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",viewport:{width:440,height:763,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 16 Pro Max landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",viewport:{width:838,height:390,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 16e",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",viewport:{width:390,height:651,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 16e landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",viewport:{width:726,height:340,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 17",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",viewport:{width:402,height:681,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 17 landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",viewport:{width:756,height:352,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone Air",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",viewport:{width:420,height:719,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone Air landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",viewport:{width:794,height:370,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 17 Pro",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",viewport:{width:402,height:681,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 17 Pro landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",viewport:{width:756,height:352,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 17 Pro Max",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",viewport:{width:440,height:763,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 17 Pro Max landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",viewport:{width:838,height:390,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"iPhone 17e",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",viewport:{width:390,height:651,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"iPhone 17e landscape",userAgent:"Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.5 Mobile/15E148 Safari/604.1",viewport:{width:726,height:340,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"JioPhone 2",userAgent:"Mozilla/5.0 (Mobile; LYF/F300B/LYF-F300B-001-01-15-130718-i;Android; rv:48.0) Gecko/48.0 Firefox/48.0 KAIOS/2.5",viewport:{width:240,height:320,deviceScaleFactor:1,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"JioPhone 2 landscape",userAgent:"Mozilla/5.0 (Mobile; LYF/F300B/LYF-F300B-001-01-15-130718-i;Android; rv:48.0) Gecko/48.0 Firefox/48.0 KAIOS/2.5",viewport:{width:320,height:240,deviceScaleFactor:1,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"Kindle Fire HDX",userAgent:"Mozilla/5.0 (Linux; U; en-us; KFAPWI Build/JDQ39) AppleWebKit/535.19 (KHTML, like Gecko) Silk/3.13 Safari/535.19 Silk-Accelerated=true",viewport:{width:800,height:1280,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"Kindle Fire HDX landscape",userAgent:"Mozilla/5.0 (Linux; U; en-us; KFAPWI Build/JDQ39) AppleWebKit/535.19 (KHTML, like Gecko) Silk/3.13 Safari/535.19 Silk-Accelerated=true",viewport:{width:1280,height:800,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"LG Optimus L70",userAgent:"Mozilla/5.0 (Linux; U; Android 4.4.2; en-us; LGMS323 Build/KOT49I.MS32310c) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3765.0 Mobile Safari/537.36",viewport:{width:384,height:640,deviceScaleFactor:1.25,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"LG Optimus L70 landscape",userAgent:"Mozilla/5.0 (Linux; U; Android 4.4.2; en-us; LGMS323 Build/KOT49I.MS32310c) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/75.0.3765.0 Mobile Safari/537.36",viewport:{width:640,height:384,deviceScaleFactor:1.25,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"Microsoft Lumia 550",userAgent:"Mozilla/5.0 (Windows Phone 10.0; Android 4.2.1; Microsoft; Lumia 550) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Mobile Safari/537.36 Edge/14.14263",viewport:{width:640,height:360,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"Microsoft Lumia 950",userAgent:"Mozilla/5.0 (Windows Phone 10.0; Android 4.2.1; Microsoft; Lumia 950) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Mobile Safari/537.36 Edge/14.14263",viewport:{width:360,height:640,deviceScaleFactor:4,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"Microsoft Lumia 950 landscape",userAgent:"Mozilla/5.0 (Windows Phone 10.0; Android 4.2.1; Microsoft; Lumia 950) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Mobile Safari/537.36 Edge/14.14263",viewport:{width:640,height:360,deviceScaleFactor:4,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"Nexus 10",userAgent:"Mozilla/5.0 (Linux; Android 6.0.1; Nexus 10 Build/MOB31T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3765.0 Safari/537.36",viewport:{width:800,height:1280,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"Nexus 10 landscape",userAgent:"Mozilla/5.0 (Linux; Android 6.0.1; Nexus 10 Build/MOB31T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3765.0 Safari/537.36",viewport:{width:1280,height:800,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"Nexus 4",userAgent:"Mozilla/5.0 (Linux; Android 4.4.2; Nexus 4 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3765.0 Mobile Safari/537.36",viewport:{width:384,height:640,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"Nexus 4 landscape",userAgent:"Mozilla/5.0 (Linux; Android 4.4.2; Nexus 4 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3765.0 Mobile Safari/537.36",viewport:{width:640,height:384,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"Nexus 5",userAgent:"Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3765.0 Mobile Safari/537.36",viewport:{width:360,height:640,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"Nexus 5 landscape",userAgent:"Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3765.0 Mobile Safari/537.36",viewport:{width:640,height:360,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"Nexus 5X",userAgent:"Mozilla/5.0 (Linux; Android 8.0.0; Nexus 5X Build/OPR4.170623.006) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3765.0 Mobile Safari/537.36",viewport:{width:412,height:732,deviceScaleFactor:2.625,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"Nexus 5X landscape",userAgent:"Mozilla/5.0 (Linux; Android 8.0.0; Nexus 5X Build/OPR4.170623.006) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3765.0 Mobile Safari/537.36",viewport:{width:732,height:412,deviceScaleFactor:2.625,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"Nexus 6",userAgent:"Mozilla/5.0 (Linux; Android 7.1.1; Nexus 6 Build/N6F26U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3765.0 Mobile Safari/537.36",viewport:{width:412,height:732,deviceScaleFactor:3.5,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"Nexus 6 landscape",userAgent:"Mozilla/5.0 (Linux; Android 7.1.1; Nexus 6 Build/N6F26U) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3765.0 Mobile Safari/537.36",viewport:{width:732,height:412,deviceScaleFactor:3.5,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"Nexus 6P",userAgent:"Mozilla/5.0 (Linux; Android 8.0.0; Nexus 6P Build/OPP3.170518.006) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3765.0 Mobile Safari/537.36",viewport:{width:412,height:732,deviceScaleFactor:3.5,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"Nexus 6P landscape",userAgent:"Mozilla/5.0 (Linux; Android 8.0.0; Nexus 6P Build/OPP3.170518.006) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3765.0 Mobile Safari/537.36",viewport:{width:732,height:412,deviceScaleFactor:3.5,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"Nexus 7",userAgent:"Mozilla/5.0 (Linux; Android 6.0.1; Nexus 7 Build/MOB30X) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3765.0 Safari/537.36",viewport:{width:600,height:960,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"Nexus 7 landscape",userAgent:"Mozilla/5.0 (Linux; Android 6.0.1; Nexus 7 Build/MOB30X) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3765.0 Safari/537.36",viewport:{width:960,height:600,deviceScaleFactor:2,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"Nokia Lumia 520",userAgent:"Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; ARM; Touch; NOKIA; Lumia 520)",viewport:{width:320,height:533,deviceScaleFactor:1.5,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"Nokia Lumia 520 landscape",userAgent:"Mozilla/5.0 (compatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; ARM; Touch; NOKIA; Lumia 520)",viewport:{width:533,height:320,deviceScaleFactor:1.5,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"Nokia N9",userAgent:"Mozilla/5.0 (MeeGo; NokiaN9) AppleWebKit/534.13 (KHTML, like Gecko) NokiaBrowser/8.5.0 Mobile Safari/534.13",viewport:{width:480,height:854,deviceScaleFactor:1,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"Nokia N9 landscape",userAgent:"Mozilla/5.0 (MeeGo; NokiaN9) AppleWebKit/534.13 (KHTML, like Gecko) NokiaBrowser/8.5.0 Mobile Safari/534.13",viewport:{width:854,height:480,deviceScaleFactor:1,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"Pixel 2",userAgent:"Mozilla/5.0 (Linux; Android 8.0; Pixel 2 Build/OPD3.170816.012) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3765.0 Mobile Safari/537.36",viewport:{width:411,height:731,deviceScaleFactor:2.625,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"Pixel 2 landscape",userAgent:"Mozilla/5.0 (Linux; Android 8.0; Pixel 2 Build/OPD3.170816.012) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3765.0 Mobile Safari/537.36",viewport:{width:731,height:411,deviceScaleFactor:2.625,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"Pixel 2 XL",userAgent:"Mozilla/5.0 (Linux; Android 8.0.0; Pixel 2 XL Build/OPD1.170816.004) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3765.0 Mobile Safari/537.36",viewport:{width:411,height:823,deviceScaleFactor:3.5,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"Pixel 2 XL landscape",userAgent:"Mozilla/5.0 (Linux; Android 8.0.0; Pixel 2 XL Build/OPD1.170816.004) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3765.0 Mobile Safari/537.36",viewport:{width:823,height:411,deviceScaleFactor:3.5,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"Pixel 3",userAgent:"Mozilla/5.0 (Linux; Android 9; Pixel 3 Build/PQ1A.181105.017.A1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.158 Mobile Safari/537.36",viewport:{width:393,height:786,deviceScaleFactor:2.75,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"Pixel 3 landscape",userAgent:"Mozilla/5.0 (Linux; Android 9; Pixel 3 Build/PQ1A.181105.017.A1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.158 Mobile Safari/537.36",viewport:{width:786,height:393,deviceScaleFactor:2.75,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"Pixel 4",userAgent:"Mozilla/5.0 (Linux; Android 10; Pixel 4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Mobile Safari/537.36",viewport:{width:353,height:745,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"Pixel 4 landscape",userAgent:"Mozilla/5.0 (Linux; Android 10; Pixel 4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Mobile Safari/537.36",viewport:{width:745,height:353,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"Pixel 4a (5G)",userAgent:"Mozilla/5.0 (Linux; Android 11; Pixel 4a (5G)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4812.0 Mobile Safari/537.36",viewport:{width:353,height:745,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"Pixel 4a (5G) landscape",userAgent:"Mozilla/5.0 (Linux; Android 11; Pixel 4a (5G)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4812.0 Mobile Safari/537.36",viewport:{width:745,height:353,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"Pixel 5",userAgent:"Mozilla/5.0 (Linux; Android 11; Pixel 5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4812.0 Mobile Safari/537.36",viewport:{width:393,height:851,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"Pixel 5 landscape",userAgent:"Mozilla/5.0 (Linux; Android 11; Pixel 5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4812.0 Mobile Safari/537.36",viewport:{width:851,height:393,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}},{name:"Moto G4",userAgent:"Mozilla/5.0 (Linux; Android 7.0; Moto G (4)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4812.0 Mobile Safari/537.36",viewport:{width:360,height:640,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!1}},{name:"Moto G4 landscape",userAgent:"Mozilla/5.0 (Linux; Android 7.0; Moto G (4)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4812.0 Mobile Safari/537.36",viewport:{width:640,height:360,deviceScaleFactor:3,isMobile:!0,hasTouch:!0,isLandscape:!0}}],Qo={};for(let i of ml)Qo[i.name]=i;var _y=Object.freeze(Qo);async function Jo(i,e,t,r){let{acceptInsecureCerts:s=!1,networkEnabled:n=!0,issuesEnabled:o=!0,defaultViewport:a=Dr}=t,{bidiConnection:c,cdpConnection:l,closeCallback:u}=await gl(i,e,t,r);return await(await import("./chunk-ZCP7BTOZ.mjs")).BidiBrowser.create({connection:c,cdpConnection:l,closeCallback:u,process:void 0,defaultViewport:a,acceptInsecureCerts:s,networkEnabled:n,issuesEnabled:o,capabilities:t.capabilities,logger:r})}async function gl(i,e,t,r){let s=await import("./chunk-ZCP7BTOZ.mjs"),{slowMo:n=0,protocolTimeout:o,idGenerator:a=pt()}=t,c=new s.BidiConnection(e,i,a,n,o,t.logger??r);try{let f=await c.send("session.status",{});if("type"in f&&f.type==="success")return{bidiConnection:c,closeCallback:async()=>{await c.send("browser.close",{}).catch(p=>{r?.(E.error)?.(p)})}}}catch(f){if(!(f instanceof Le))throw f}c.unbind();let l=new Yt(e,i,n,o,!0,a,t.logger??r);if((await l.send("Browser.getVersion")).product.toLowerCase().includes("firefox"))throw new at("Firefox is not supported in BiDi over CDP mode.");let h=await s.connectBidiOverCdp(l,r);return{cdpConnection:l,bidiConnection:h,closeCallback:async()=>{await l.send("Browser.close").catch(f=>{r?.(E.error)?.(f)})}}}var en=async()=>Xi?(await import("./chunk-GWOYMENX.mjs")).NodeWebSocketTransport:(await import("./chunk-QZ35UAB4.mjs")).BrowserWebSocketTransport;function wl(i){if(i.blocklist&&i.allowlist)throw new Error("Cannot specify both blocklist and allowlist");if(i.protocol==="webDriverBiDi"&&(i.blocklist||i.allowlist))throw new Error("blocklist and allowlist are only supported with the CDP protocol");if(i.blocklist)for(let e of i.blocklist)new Rt(e);if(i.allowlist)for(let e of i.allowlist)new Rt(e)}async function Yo(i){wl(i);let{connectionTransport:e,endpointUrl:t}=await yl(i);return i.protocol==="webDriverBiDi"?await Jo(e,t,i,i.logger):await $o(e,t,i,i.logger)}async function yl(i){let{browserWSEndpoint:e,browserURL:t,channel:r,transport:s}=i,n=i.wsOptions?.headers??i.headers??{},o=i.wsOptions??{};if(P(+!!e+ +!!t+ +!!s+ +!!r==1,"Exactly one of browserWSEndpoint, browserURL, transport or channel must be passed to puppeteer.connect"),s)return{connectionTransport:s,endpointUrl:""};if(e)return{connectionTransport:await(await en()).create(e,n,i.logger,o),endpointUrl:e};if(t){let a=await vl(t,n);return{connectionTransport:await(await en()).create(a,n,i.logger,o),endpointUrl:a}}else if(i.channel&&Xi){let{detectBrowserPlatform:a,resolveDefaultUserDataDir:c,Browser:l}=await import("./chunk-NAGMRVW4.mjs"),u=a();if(!u)throw new Error("Could not detect required browser platform");let{convertPuppeteerChannelToBrowsersChannel:h}=await import("./chunk-VPVOAJ7X.mjs"),{join:f}=await import("node:path"),p=c(l.CHROME,u,h(i.channel)),w=f(p,"DevToolsActivePort");try{let y=await ee.value.readFile(w,"ascii"),[b,T]=y.split(`
48
48
  `).map(le=>le.trim()).filter(le=>!!le);if(!b||!T)throw new Error(`Invalid DevToolsActivePort '${y}' found`);let W=parseInt(b,10);if(isNaN(W)||W<=0||W>65535)throw new Error(`Invalid port '${b}' found`);let N=`ws://localhost:${W}${T}`;return{connectionTransport:await(await en()).create(N,n,i.logger,o),endpointUrl:N}}catch(y){throw new Error(`Could not find DevToolsActivePort for ${i.channel} at ${w}`,{cause:y})}}throw new Error("Invalid connection options")}async function vl(i,e){let t=new URL("/json/version",i);try{let r=await globalThis.fetch(t.toString(),{method:"GET",headers:e});if(!r.ok)throw new Error(`HTTP ${r.statusText}`);return(await r.json()).webSocketDebuggerUrl}catch(r){throw Q(r)&&(r.message=`Failed to fetch browser webSocket URL from ${t}: `+r.message),r}}var Zo=class{static customQueryHandlers=mr;static registerCustomQueryHandler(e,t){return this.customQueryHandlers.register(e,t)}static unregisterCustomQueryHandler(e){return this.customQueryHandlers.unregister(e)}static customQueryHandlerNames(){return this.customQueryHandlers.names()}static clearCustomQueryHandlers(){return this.customQueryHandlers.clear()}_isPuppeteerCore;_changedBrowsers=!1;constructor(e){this._isPuppeteerCore=e.isPuppeteerCore,this.connect=this.connect.bind(this)}connect(e){let t={logger:tn,...e};return Yo(t)}};var ea=class{#e;constructor(){this.#e=Promise.resolve()}postTask(e){let t=this.#e.then(e);return this.#e=t.then(()=>{},()=>{}),t}};var $y=Object.freeze({chrome:"154.0.8037.57","chrome-headless-shell":"154.0.8037.57",firefox:"stable_156.0.1"});export{H as a,_t as b,Al as c,ne as d,oe as e,Cl as f,Mt as g,Lr as h,hr as i,Ye as j,Dn as k,Ll as l,Fl as m,nc as n,Kt as o,we as p,Un as q,Kn as r,pr as s,F as t,q as u,Ji as v,G as w,Yi as x,Pr as y,bl as z,C as A,P as B,Ue as C,qn as D,Ht as E,He as F,Et as G,Le as H,at as I,ge as J,_r as K,nn as L,Dr as M,xe as N,Y as O,jn as P,Oe as Q,cc as R,jl as S,zl as T,$l as U,Nr as V,Hr as W,Wr as X,zn as Y,ye as Z,ps as _,ms as $,$n as aa,Vn as ba,Gn as ca,fs as da,Z as ea,Ze as fa,lt as ga,Xn as ha,Br as ia,O as ja,ut as ka,Ur as la,B as ma,Kr as na,qr as oa,jr as pa,Ke as qa,Q as ra,yu as sa,ws as ta,zr as ua,Re as va,xt as wa,Vr as xa,Ee as ya,ve as za,It as Aa,vs as Ba,zt as Ca,bs as Da,mr as Ea,Qr as Fa,Jr as Ga,Zn as Ha,Yr as Ia,Zr as Ja,$t as Ka,R as La,mh as Ma,Ie as Na,ti as Oa,gh as Pa,et as Qa,Vt as Ra,tt as Sa,Gt as Ta,ii as Ua,si as Va,ni as Wa,ht as Xa,Es as Ya,ri as Za,U as _a,io as $a,oi as ab,ce as bb,V as cb,so as db,td as eb,br as fb,qe as gb,Ts as hb,no as ib,ai as jb,ci as kb,pt as lb,li as mb,de as nb,ui as ob,hi as pb,mt as qb,Uc as rb,lo as sb,Sd as tb,di as ub,fi as vb,pi as wb,mi as xb,ke as yb,gi as zb,Be as Ab,Xt as Bb,wi as Cb,gt as Db,yi as Eb,Qt as Fb,vi as Gb,re as Hb,Jt as Ib,Ms as Jb,Ae as Kb,Yt as Lb,je as Mb,bi as Nb,xs as Ob,Is as Pb,Si as Qb,_e as Rb,po as Sb,Ei as Tb,As as Ub,ki as Vb,Ti as Wb,Cs as Xb,go as Yb,zc as Zb,$c as _b,rt as $b,Ls as ac,wt as bc,wo as cc,Fs as dc,yt as ec,Os as fc,_i as gc,Zt as hc,te as ic,me as jc,Ct as kc,vt as lc,it as mc,er as nc,Rs as oc,Zc as pc,Mi as qc,Ft as rc,xi as sc,vo as tc,Sr as uc,Ii as vc,Ai as wc,Li as xc,Fi as yc,Oi as zc,Ds as Ac,Ri as Bc,Eo as Cc,Di as Dc,Ns as Ec,Hs as Fc,Ni as Gc,Ws as Hc,Er as Ic,Bi as Jc,tr as Kc,Te as Lc,kr as Mc,Tr as Nc,Ui as Oc,Ki as Pc,qi as Qc,zi as Rc,Vi as Sc,$o as Tc,Xo as Uc,Ty as Vc,_y as Wc,wl as Xc,Zo as Yc,ea as Zc,$y as _c};